PageSourceSearch

https://waterdispenseinsights.com/assets/index-BQj9OxMI.js

js waterdispenseinsights.com collected 2026-10-07 11:39:32 UTC 1,782,542 bytes, 706 lines download raw bytes

vendor: 5,204 bytes, lines 1-9
1var P7=Object.defineProperty;var zD=t=>{throw TypeError(t)};var R7=(t,e,n)=>e in t?P7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Z=(t,e,n)=>R7(t,typeof e!="symbol"?e+"":e,n),aC=(t,e,n)=>e.has(t)||zD("Cannot "+n);var h=(t,e,n)=>(aC(t,e,"read from private field"),n?n.call(t):e.get(t)),A=(t,e,n)=>e.has(t)?zD("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),_=(t,e,n,r)=>(aC(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),j=(t,e,n)=>(aC(t,e,"access private method"),n);var pn=(t,e,n,r)=>({set _(s){_(t,e,s,n)},get _(){return h(t,e,r)}});function I7(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function D7(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}),n}var D5={exports:{}},z_={},M5={exports:{}},at={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var m0=Symbol.for("react.element"),M7=Symbol.for("react.portal"),O7=Symbol.for("react.fragment"),L7=Symbol.for("react.strict_mode"),F7=Symbol.for("react.profiler"),B7=Symbol.for("react.provider"),$7=Symbol.for("react.context"),U7=Symbol.for("react.forward_ref"),z7=Symbol.for("react.suspense"),V7=Symbol.for("react.memo"),W7=Symbol.for("react.lazy"),VD=Symbol.iterator;function H7(t){return t===null||typeof t!="object"?null:(t=VD&&t[VD]||t["@@iterator"],typeof t=="function"?t:null)}var O5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L5=Object.assign,F5={};function $y(t,e,n){this.props=t,this.context=e,this.refs=F5,this.updater=n||O5}$y.prototype.isReactComponent={};$y.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")};$y.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function B5(){}B5.prototype=$y.prototype;function cP(t,e,n){this.props=t,this.context=e,this.refs=F5,this.updater=n||O5}var uP=cP.prototype=new B5;uP.constructor=cP;L5(uP,$y.prototype);uP.isPureReactComponent=!0;var WD=Array.isArray,$5=Object.prototype.hasOwnProperty,dP={current:null},U5={key:!0,ref:!0,__self:!0,__source:!0};function z5(t,e,n){var r,s={},i=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(i=""+e.key),e)$5.call(e,r)&&!U5.hasOwnProperty(r)&&(s[r]=e[r]);var o=arguments.length-2;if(o===1)s.children=n;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];s.children=l}if(t&&t.defaultProps)for(r in o=t.defaultProps,o)s[r]===void 0&&(s[r]=o[r]);return{$$typeof:m0,type:t,key:i,ref:a,props:s,_owner:dP.current}}function q7(t,e){return{$$typeof:m0,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function hP(t){return typeof t=="object"&&t!==null&&t.$$typeof===m0}function G7(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var HD=/\/+/g;function oC(t,e){return typeof t=="object"&&t!==null&&t.key!=null?G7(""+t.key):e.toString(36)}function X1(t,e,n,r,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case m0:case M7:a=!0}}if(a)return a=t,s=s(a),t=r===""?"."+oC(a,0):r,WD(s)?(n="",t!=null&&(n=t.replace(HD,"$&/")+"/"),X1(s,e,n,"",function(u){return u}
vendor: 4,445 bytes, lines 9-17
9)):s!=null&&(hP(s)&&(s=q7(s,n+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(HD,"$&/")+"/")+t)),e.push(s)),1;if(a=0,r=r===""?".":r+":",WD(t))for(var o=0;o<t.length;o++){i=t[o];var l=r+oC(i,o);a+=X1(i,e,n,l,s)}else if(l=H7(t),typeof l=="function")for(t=l.call(t),o=0;!(i=t.next()).done;)i=i.value,l=r+oC(i,o++),a+=X1(i,e,n,l,s);else if(i==="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 Y0(t,e,n){if(t==null)return t;var r=[],s=0;return X1(t,r,"","",function(i){return e.call(n,i,s++)}),r}function K7(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 bs={current:null},Z1={transition:null},Y7={ReactCurrentDispatcher:bs,ReactCurrentBatchConfig:Z1,ReactCurrentOwner:dP};function V5(){throw Error("act(...) is not supported in production builds of React.")}at.Children={map:Y0,forEach:function(t,e,n){Y0(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Y0(t,function(){e++}),e},toArray:function(t){return Y0(t,function(e){return e})||[]},only:function(t){if(!hP(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};at.Component=$y;at.Fragment=O7;at.Profiler=F7;at.PureComponent=cP;at.StrictMode=L7;at.Suspense=z7;at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y7;at.act=V5;at.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=L5({},t.props),s=t.key,i=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,a=dP.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(l in e)$5.call(e,l)&&!U5.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 u=0;u<l;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:m0,type:t.type,key:s,ref:i,props:r,_owner:a}};at.createContext=function(t){return t={$$typeof:$7,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:B7,_context:t},t.Consumer=t};at.createElement=z5;at.createFactory=function(t){var e=z5.bind(null,t);return e.type=t,e};at.createRef=function(){return{current:null}};at.forwardRef=function(t){return{$$typeof:U7,render:t}};at.isValidElement=hP;at.lazy=function(t){return{$$typeof:W7,_payload:{_status:-1,_result:t},_init:K7}};at.memo=function(t,e){return{$$typeof:V7,type:t,compare:e===void 0?null:e}};at.startTransition=function(t){var e=Z1.transition;Z1.transition={};try{t()}finally{Z1.transition=e}};at.unstable_act=V5;at.useCallback=function(t,e){return bs.current.useCallback(t,e)};at.useContext=function(t){return bs.current.useContext(t)};at.useDebugValue=function(){};at.useDeferredValue=function(t){return bs.current.useDeferredValue(t)};at.useEffect=function(t,e){return bs.current.useEffect(t,e)};at.useId=function(){return bs.current.useId()};at.useImperativeHandle=function(t,e,n){return bs.current.useImperativeHandle(t,e,n)};at.useInsertionEffect=function(t,e){return bs.current.useInsertionEffect(t,e)};at.useLayoutEffect=function(t,e){return bs.current.useLayoutEffect(t,e)};at.useMemo=function(t,e){return bs.current.useMemo(t,e)};at.useReducer=function(t,e,n){return bs.current.useReducer(t,e,n)};at.useRef=function(t){return bs.current.useRef(t)};at.useState=function(t){return bs.current.useState(t)};at.useSyncExternalStore=function(t,e,n){return bs.current.useSyncExternalStore(t,e,n)};at.useTransition=function(){return bs.current.useTransition()};at.version="18.3.1";M5.exports=at;var k=M5.exports;const K=Sc(k),fP=I7({__proto__:null,default:K},[k]);/**
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 X7=k,Z7=Symbol.for("react.element"),Q7=Symbol.for("react.fragment"),J7=Object.prototype.hasOwnProperty,eK=X7.__SECRET_INT
vendor: 11,397 bytes, lines 17-34
17ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tK={key:!0,ref:!0,__self:!0,__source:!0};function W5(t,e,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)J7.call(e,r)&&!tK.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:Z7,type:t,key:i,ref:a,props:s,_owner:eK.current}}z_.Fragment=Q7;z_.jsx=W5;z_.jsxs=W5;D5.exports=z_;var c=D5.exports,H5={exports:{}},Di={},q5={exports:{}},G5={};/**
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($,I){var N=$.length;$.push(I);e:for(;0<N;){var W=N-1>>>1,q=$[W];if(0<s(q,I))$[W]=I,$[N]=q,N=W;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var I=$[0],N=$.pop();if(N!==I){$[0]=N;e:for(var W=0,q=$.length,D=q>>>1;W<D;){var Q=2*(W+1)-1,X=$[Q],se=Q+1,Y=$[se];if(0>s(X,N))se<q&&0>s(Y,X)?($[W]=Y,$[se]=N,W=se):($[W]=X,$[Q]=N,W=Q);else if(se<q&&0>s(Y,N))$[W]=Y,$[se]=N,W=se;else break e}}return I}function s($,I){var N=$.sortIndex-I.sortIndex;return N!==0?N:$.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],u=[],d=1,f=null,p=3,m=!1,y=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,x=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 v($){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=$)r(u),I.sortIndex=I.expirationTime,e(l,I);else break;I=n(u)}}function S($){if(g=!1,v($),!y)if(n(l)!==null)y=!0,z(E);else{var I=n(u);I!==null&&V(S,I.startTime-$)}}function E($,I){y=!1,g&&(g=!1,x(P),P=-1),m=!0;var N=p;try{for(v(I),f=n(l);f!==null&&(!(f.expirationTime>I)||$&&!O());){var W=f.callback;if(typeof W=="function"){f.callback=null,p=f.priorityLevel;var q=W(f.expirationTime<=I);I=t.unstable_now(),typeof q=="function"?f.callback=q:f===n(l)&&r(l),v(I)}else r(l);f=n(l)}if(f!==null)var D=!0;else{var Q=n(u);Q!==null&&V(S,Q.startTime-I),D=!1}return D}finally{f=null,p=N,m=!1}}var C=!1,T=null,P=-1,M=5,R=-1;function O(){return!(t.unstable_now()-R<M)}function L(){if(T!==null){var $=t.unstable_now();R=$;var I=!0;try{I=T(!0,$)}finally{I?U():(C=!1,T=null)}}else C=!1}var U;if(typeof w=="function")U=function(){w(L)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,H=B.port2;B.port1.onmessage=L,U=function(){H.postMessage(null)}}else U=function(){b(L,0)};function z($){T=$,C||(C=!0,U())}function V($,I){P=b(function(){$(t.unstable_now())},I)}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($){$.callback=null},t.unstable_continueExecution=function(){y||m||(y=!0,z(E))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function($){switch(p){case 1:case 2:case 3:var I=3;break;default:I=p}var N=p;p=I;try{return $()}finally{p=N}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,I){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var N=p;p=$;try{return I()}finally{p=N}},t.unstable_scheduleCallback=function($,I,N){var W=t.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?W+N:W):N=W,$){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=N+q,$={id:d++,callback:I,priorityLevel:$,startTime:N,expirationTime:q,sortIndex:-1},N>W?($.sortIndex=N,e(u,$),n(l)===null&&$===n(u)&&(g?(x(P),P=-1):g=!0,V(S,N-W))):($.sortIndex=q,e(l,$),y||m||(y=!0,z(E))),$},t.unstable_shouldYield=O,t.unstable_wrapCallback=function($){var I=p;return function(){var N=p;p=I;try{return $.apply(this,arguments)}finally{p=N}}}})(G5);q5.exports=G5;var nK=q5.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 rK=k,Pi=nK;function ne(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 K5=new Set,Lv={};function rp(t,e){py(t,e),py(t+"Capture",e)}function py(t,e){for(Lv[t]=e,t=0;t<e.length;t++)K5.add(e[t])}var lc=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uT=Object.prototype.hasOwnProperty,sK=/^[: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]*$/,qD={},GD={};function iK(t){return uT.call(GD,t)?!0:uT.call(qD,t)?!1:sK.test(t)?GD[t]=!0:(qD[t]=!0,!1)}function aK(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 oK(t,e,n,r){if(e===null||typeof e>"u"||aK(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 ws(t,e,n,r,s,i,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=a}var jr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){jr[t]=new ws(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];jr[e]=new ws(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){jr[t]=new ws(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){jr[t]=new ws(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){jr[t]=new ws(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){jr[t]=new ws(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){jr[t]=new ws(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){jr[t]=new ws(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){jr[t]=new ws(t,5,!1,t.toLowerCase(),null,!1,!1)});var pP=/[\-:]([a-z])/g;function mP(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(pP,mP);jr[e]=new ws(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(pP,mP);jr[e]=new ws(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(pP,mP);jr[e]=new ws(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){jr[t]=new ws(t,1,!1,t.toLowerCase(),null,!1,!1)});jr.xlinkHref=new ws("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){jr[t]=new ws(t,1,!1,t.toLowerCase(),null,!0,!0)});function gP(t,e,n,r){var s=jr.hasOwnProperty(e)?jr[e]:null;(s!==null?s.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(oK(e,n,s,r)&&(n=null),r||s===null?iK(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):s.mustUseProperty?t[s.propertyName]=n===null?s.type===3?!1:"":n:(e=s.attributeName,r=s.attributeNamespace,n===null?t.removeAttribute(e):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var _c=rK.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,X0=Symbol.for("react.element"),Hp=Symbol.for("react.portal"),qp=Symbol.for("react.fragment"),yP=Symbol.for("react.strict_mode"),dT=Symbol.for("react.profiler"),Y5=Symbol.for("react.provider"),X5=Symbol.for("react.context"),xP=Symbol.for("react.forward_ref"),hT=Symbol.for("react.suspense"),fT=Symbol.for("react.suspense_list"),vP=Symbol.for("react.memo"),$c=Symbol.for("react.lazy"),Z5=Symbol.for("react.offscreen"),KD=Symbol.iterator;function ox(t){return t===null||typeof t!="object"?null:(t=KD&&t[KD]||t["@@iterator"],typeof t=="function"?t:null)}var fn=Object.assign,lC;function Ox(t){if(lC===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);lC=e&&e[1]||""}return`
34`+lC+t}var cC=!1;function uC(t,e){if(!t||cC)return"";cC=!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(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}
vendor: 18,193 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
35`),i=r.stack.split(`
36`),a=s.length-1,o=i.length-1;1<=a&&0<=o&&s[a]!==i[o];)o--;for(;1<=a&&0<=o;a--,o--)if(s[a]!==i[o]){if(a!==1||o!==1)do if(a--,o--,0>o||s[a]!==i[o]){var l=`
37`+s[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=a&&0<=o);break}}}finally{cC=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ox(t):""}function lK(t){switch(t.tag){case 5:return Ox(t.type);case 16:return Ox("Lazy");case 13:return Ox("Suspense");case 19:return Ox("SuspenseList");case 0:case 2:case 15:return t=uC(t.type,!1),t;case 11:return t=uC(t.type.render,!1),t;case 1:return t=uC(t.type,!0),t;default:return""}}function pT(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 qp:return"Fragment";case Hp:return"Portal";case dT:return"Profiler";case yP:return"StrictMode";case hT:return"Suspense";case fT:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case X5:return(t.displayName||"Context")+".Consumer";case Y5:return(t._context.displayName||"Context")+".Provider";case xP: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:pT(t.type)||"Memo";case $c:e=t._payload,t=t._init;try{return pT(t(e))}catch{}}return null}function cK(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 pT(e);case 8:return e===yP?"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 cd(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Q5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function uK(t){var e=Q5(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 s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.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 Z0(t){t._valueTracker||(t._valueTracker=uK(t))}function J5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Q5(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function iS(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 mT(t,e){var n=e.checked;return fn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function YD(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=cd(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 eB(t,e){e=e.checked,e!=null&&gP(t,"checked",e,!1)}function gT(t,e){eB(t,e);var n=cd(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")?yT(t,e.type,n):e.hasOwnProperty("defaultValue")&&yT(t,e.type,cd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function XD(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 yT(t,e,n){(e!=="number"||iS(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Lx=Array.isArray;function pm(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s<n.length;s++)e["$"+n[s]]=!0;for(n=0;n<t.length;n++)s=e.hasOwnProperty("$"+t[n].value),t[n].selected!==s&&(t[n].selected=s),s&&r&&(t[n].defaultSelected=!0)}else{for(n=""+cd(n),e=null,s=0;s<t.length;s++){if(t[s].value===n){t[s].selected=!0,r&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function xT(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(ne(91));return fn({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ZD(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(ne(92));if(Lx(n)){if(1<n.length)throw Error(ne(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:cd(n)}}function tB(t,e){var n=cd(e.value),r=cd(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 QD(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function nB(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 vT(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?nB(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Q0,rB=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,s){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,s)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Q0=Q0||document.createElement("div"),Q0.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Q0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Fv(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var hv={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},dK=["Webkit","ms","Moz","O"];Object.keys(hv).forEach(function(t){dK.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),hv[e]=hv[t]})});function sB(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||hv.hasOwnProperty(t)&&hv[t]?(""+e).trim():e+"px"}function iB(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=sB(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var hK=fn({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 bT(t,e){if(e){if(hK[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ne(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ne(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ne(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ne(62))}}function wT(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 kT=null;function bP(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ST=null,mm=null,gm=null;function JD(t){if(t=x0(t)){if(typeof ST!="function")throw Error(ne(280));var e=t.stateNode;e&&(e=G_(e),ST(t.stateNode,t.type,e))}}function aB(t){mm?gm?gm.push(t):gm=[t]:mm=t}function oB(){if(mm){var t=mm,e=gm;if(gm=mm=null,JD(t),e)for(t=0;t<e.length;t++)JD(e[t])}}function lB(t,e){return t(e)}function cB(){}var dC=!1;function uB(t,e,n){if(dC)return t(e,n);dC=!0;try{return lB(t,e,n)}finally{dC=!1,(mm!==null||gm!==null)&&(cB(),oB())}}function Bv(t,e){var n=t.stateNode;if(n===null)return null;var r=G_(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(ne(231,e,typeof n));return n}var _T=!1;if(lc)try{var lx={};Object.defineProperty(lx,"passive",{get:function(){_T=!0}}),window.addEventListener("test",lx,lx),window.removeEventListener("test",lx,lx)}catch{_T=!1}function fK(t,e,n,r,s,i,a,o,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(d){this.onError(d)}}var fv=!1,aS=null,oS=!1,ET=null,pK={onError:function(t){fv=!0,aS=t}};function mK(t,e,n,r,s,i,a,o,l){fv=!1,aS=null,fK.apply(pK,arguments)}function gK(t,e,n,r,s,i,a,o,l){if(mK.apply(this,arguments),fv){if(fv){var u=aS;fv=!1,aS=null}else throw Error(ne(198));oS||(oS=!0,ET=u)}}function sp(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 dB(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 eM(t){if(sp(t)!==t)throw Error(ne(188))}function yK(t){var e=t.alternate;if(!e){if(e=sp(t),e===null)throw Error(ne(188));return e!==t?null:t}for(var n=t,r=e;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return eM(s),t;if(i===r)return eM(s),e;i=i.sibling}throw Error(ne(188))}if(n.return!==r.return)n=s,r=i;else{for(var a=!1,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){for(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)throw Error(ne(189))}}if(n.alternate!==r)throw Error(ne(190))}if(n.tag!==3)throw Error(ne(188));return n.stateNode.current===n?t:e}function hB(t){return t=yK(t),t!==null?fB(t):null}function fB(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=fB(t);if(e!==null)return e;t=t.sibling}return null}var pB=Pi.unstable_scheduleCallback,tM=Pi.unstable_cancelCallback,xK=Pi.unstable_shouldYield,vK=Pi.unstable_requestPaint,jn=Pi.unstable_now,bK=Pi.unstable_getCurrentPriorityLevel,wP=Pi.unstable_ImmediatePriority,mB=Pi.unstable_UserBlockingPriority,lS=Pi.unstable_NormalPriority,wK=Pi.unstable_LowPriority,gB=Pi.unstable_IdlePriority,V_=null,Xo=null;function kK(t){if(Xo&&typeof Xo.onCommitFiberRoot=="function")try{Xo.onCommitFiberRoot(V_,t,void 0,(t.current.flags&128)===128)}catch{}}var Za=Math.clz32?Math.clz32:EK,SK=Math.log,_K=Math.LN2;function EK(t){return t>>>=0,t===0?32:31-(SK(t)/_K|0)|0}var J0=64,e1=4194304;function Fx(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 cS(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,a=n&268435455;if(a!==0){var o=a&~s;o!==0?r=Fx(o):(i&=a,i!==0&&(r=Fx(i)))}else a=n&~s,a!==0?r=Fx(a):i!==0&&(r=Fx(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&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-Za(e),s=1<<n,r|=t[n],e&=~s;return r}function CK(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 AK(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var a=31-Za(i),o=1<<a,l=s[a];l===-1?(!(o&n)||o&r)&&(s[a]=CK(o,e)):l<=e&&(t.expiredLanes|=o),i&=~o}}function CT(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function yB(){var t=J0;return J0<<=1,!(J0&4194240)&&(J0=64),t}function hC(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function g0(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Za(e),t[e]=n}function TK(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 s=31-Za(n),i=1<<s;e[s]=0,r[s]=-1,t[s]=-1,n&=~i}}function kP(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Za(n),s=1<<r;s&e|t[r]&e&&(t[r]|=e),n&=~s}}var _t=0;function xB(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var vB,SP,bB,wB,kB,AT=!1,t1=[],Xu=null,Zu=null,Qu=null,$v=new Map,Uv=new Map,Vc=[],jK="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 nM(t,e){switch(t){case"focusin":case"focusout":Xu=null;break;case"dragenter":case"dragleave":Zu=null;break;case"mouseover":case"mouseout":Qu=null;break;case"pointerover":case"pointerout":$v.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uv.delete(e.pointerId)}}function cx(t,e,n,r,s,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},e!==null&&(e=x0(e),e!==null&&SP(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function NK(t,e,n,r,s){switch(e){case"focusin":return Xu=cx(Xu,t,e,n,r,s),!0;case"dragenter":return Zu=cx(Zu,t,e,n,r,s),!0;case"mouseover":return Qu=cx(Qu,t,e,n,r,s),!0;case"pointerover":var i=s.pointerId;return $v.set(i,cx($v.get(i)||null,t,e,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Uv.set(i,cx(Uv.get(i)||null,t,e,n,r,s)),!0}return!1}function SB(t){var e=uh(t.target);if(e!==null){var n=sp(e);if(n!==null){if(e=n.tag,e===13){if(e=dB(n),e!==null){t.blockedOn=e,kB(t.priority,function(){bB(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 Q1(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=TT(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);kT=r,n.target.dispatchEvent(r),kT=null}else return e=x0(n),e!==null&&SP(e),t.blockedOn=n,!1;e.shift()}return!0}function rM(t,e,n){Q1(t)&&n.delete(e)}function PK(){AT=!1,Xu!==null&&Q1(Xu)&&(Xu=null),Zu!==null&&Q1(Zu)&&(Zu=null),Qu!==null&&Q1(Qu)&&(Qu=null),$v.forEach(rM),Uv.forEach(rM)}function ux(t,e){t.blockedOn===e&&(t.blockedOn=null,AT||(AT=!0,Pi.unstable_scheduleCallback(Pi.unstable_NormalPriority,PK)))}function zv(t){function e(s){return ux(s,t)}if(0<t1.length){ux(t1[0],t);for(var n=1;n<t1.length;n++){var r=t1[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Xu!==null&&ux(Xu,t),Zu!==null&&ux(Zu,t),Qu!==null&&ux(Qu,t),$v.forEach(e),Uv.forEach(e),n=0;n<Vc.length;n++)r=Vc[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Vc.length&&(n=Vc[0],n.blockedOn===null);)SB(n),n.blockedOn===null&&Vc.shift()}var ym=_c.ReactCurrentBatchConfig,uS=!0;function RK(t,e,n,r){var s=_t,i=ym.transition;ym.transition=null;try{_t=1,_P(t,e,n,r)}finally{_t=s,ym.transition=i}}function IK(t,e,n,r){var s=_t,i=ym.transition;ym.transition=null;try{_t=4,_P(t,e,n,r)}finally{_t=s,ym.transition=i}}function _P(t,e,n,r){if(uS){var s=TT(t,e,n,r);if(s===null)kC(t,e,r,dS,n),nM(t,r);else if(NK(s,t,e,n,r))r.stopPropagation();else if(nM(t,r),e&4&&-1<jK.indexOf(t)){for(;s!==null;){var i=x0(s);if(i!==null&&vB(i),i=TT(t,e,n,r),i===null&&kC(t,e,r,dS,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else kC(t,e,r,null,n)}}var dS=null;function TT(t,e,n,r){if(dS=null,t=bP(r),t=uh(t),t!==null)if(e=sp(t),e===null)t=null;else if(n=e.tag,n===13){if(t=dB(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 dS=t,null}
vendor: 9,127 bytes, line 37
37function _B(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(bK()){case wP:return 1;case mB:return 4;case lS:case wK:return 16;case gB:return 536870912;default:return 16}default:return 16}}var Hu=null,EP=null,J1=null;function EB(){if(J1)return J1;var t,e=EP,n=e.length,r,s="value"in Hu?Hu.value:Hu.textContent,i=s.length;for(t=0;t<n&&e[t]===s[t];t++);var a=n-t;for(r=1;r<=a&&e[n-r]===s[i-r];r++);return J1=s.slice(t,1<r?1-r:void 0)}function ek(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 n1(){return!0}function sM(){return!1}function Mi(t){function e(n,r,s,i,a){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(n=t[o],this[o]=n?n(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?n1:sM,this.isPropagationStopped=sM,this}return fn(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=n1)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=n1)},persist:function(){},isPersistent:n1}),e}var Uy={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},CP=Mi(Uy),y0=fn({},Uy,{view:0,detail:0}),DK=Mi(y0),fC,pC,dx,W_=fn({},y0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:AP,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!==dx&&(dx&&t.type==="mousemove"?(fC=t.screenX-dx.screenX,pC=t.screenY-dx.screenY):pC=fC=0,dx=t),fC)},movementY:function(t){return"movementY"in t?t.movementY:pC}}),iM=Mi(W_),MK=fn({},W_,{dataTransfer:0}),OK=Mi(MK),LK=fn({},y0,{relatedTarget:0}),mC=Mi(LK),FK=fn({},Uy,{animationName:0,elapsedTime:0,pseudoElement:0}),BK=Mi(FK),$K=fn({},Uy,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),UK=Mi($K),zK=fn({},Uy,{data:0}),aM=Mi(zK),VK={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WK={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"},HK={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qK(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=HK[t])?!!e[t]:!1}function AP(){return qK}var GK=fn({},y0,{key:function(t){if(t.key){var e=VK[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ek(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?WK[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:AP,charCode:function(t){return t.type==="keypress"?ek(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ek(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),KK=Mi(GK),YK=fn({},W_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),oM=Mi(YK),XK=fn({},y0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:AP}),ZK=Mi(XK),QK=fn({},Uy,{propertyName:0,elapsedTime:0,pseudoElement:0}),JK=Mi(QK),eY=fn({},W_,{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}),tY=Mi(eY),nY=[9,13,27,32],TP=lc&&"CompositionEvent"in window,pv=null;lc&&"documentMode"in document&&(pv=document.documentMode);var rY=lc&&"TextEvent"in window&&!pv,CB=lc&&(!TP||pv&&8<pv&&11>=pv),lM=" ",cM=!1;function AB(t,e){switch(t){case"keyup":return nY.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function TB(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Gp=!1;function sY(t,e){switch(t){case"compositionend":return TB(e);case"keypress":return e.which!==32?null:(cM=!0,lM);case"textInput":return t=e.data,t===lM&&cM?null:t;default:return null}}function iY(t,e){if(Gp)return t==="compositionend"||!TP&&AB(t,e)?(t=EB(),J1=EP=Hu=null,Gp=!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 CB&&e.locale!=="ko"?null:e.data;default:return null}}var aY={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 uM(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!aY[t.type]:e==="textarea"}function jB(t,e,n,r){aB(r),e=hS(e,"onChange"),0<e.length&&(n=new CP("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var mv=null,Vv=null;function oY(t){$B(t,0)}function H_(t){var e=Xp(t);if(J5(e))return t}function lY(t,e){if(t==="change")return e}var NB=!1;if(lc){var gC;if(lc){var yC="oninput"in document;if(!yC){var dM=document.createElement("div");dM.setAttribute("oninput","return;"),yC=typeof dM.oninput=="function"}gC=yC}else gC=!1;NB=gC&&(!document.documentMode||9<document.documentMode)}function hM(){mv&&(mv.detachEvent("onpropertychange",PB),Vv=mv=null)}function PB(t){if(t.propertyName==="value"&&H_(Vv)){var e=[];jB(e,Vv,t,bP(t)),uB(oY,e)}}function cY(t,e,n){t==="focusin"?(hM(),mv=e,Vv=n,mv.attachEvent("onpropertychange",PB)):t==="focusout"&&hM()}function uY(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return H_(Vv)}function dY(t,e){if(t==="click")return H_(e)}function hY(t,e){if(t==="input"||t==="change")return H_(e)}function fY(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var to=typeof Object.is=="function"?Object.is:fY;function Wv(t,e){if(to(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 s=n[r];if(!uT.call(e,s)||!to(t[s],e[s]))return!1}return!0}function fM(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function pM(t,e){var n=fM(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=fM(n)}}function RB(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?RB(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function IB(){for(var t=window,e=iS();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=iS(t.document)}return e}function jP(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 pY(t){var e=IB(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&RB(n.ownerDocument.documentElement,n)){if(r!==null&&jP(n)){if
vendor: 5,074 bytes, line 37
37(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 s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=pM(n,i);var a=pM(n,r);s&&a&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>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 mY=lc&&"documentMode"in document&&11>=document.documentMode,Kp=null,jT=null,gv=null,NT=!1;function mM(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;NT||Kp==null||Kp!==iS(r)||(r=Kp,"selectionStart"in r&&jP(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}),gv&&Wv(gv,r)||(gv=r,r=hS(jT,"onSelect"),0<r.length&&(e=new CP("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Kp)))}function r1(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Yp={animationend:r1("Animation","AnimationEnd"),animationiteration:r1("Animation","AnimationIteration"),animationstart:r1("Animation","AnimationStart"),transitionend:r1("Transition","TransitionEnd")},xC={},DB={};lc&&(DB=document.createElement("div").style,"AnimationEvent"in window||(delete Yp.animationend.animation,delete Yp.animationiteration.animation,delete Yp.animationstart.animation),"TransitionEvent"in window||delete Yp.transitionend.transition);function q_(t){if(xC[t])return xC[t];if(!Yp[t])return t;var e=Yp[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in DB)return xC[t]=e[n];return t}var MB=q_("animationend"),OB=q_("animationiteration"),LB=q_("animationstart"),FB=q_("transitionend"),BB=new Map,gM="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 Cd(t,e){BB.set(t,e),rp(e,[t])}for(var vC=0;vC<gM.length;vC++){var bC=gM[vC],gY=bC.toLowerCase(),yY=bC[0].toUpperCase()+bC.slice(1);Cd(gY,"on"+yY)}Cd(MB,"onAnimationEnd");Cd(OB,"onAnimationIteration");Cd(LB,"onAnimationStart");Cd("dblclick","onDoubleClick");Cd("focusin","onFocus");Cd("focusout","onBlur");Cd(FB,"onTransitionEnd");py("onMouseEnter",["mouseout","mouseover"]);py("onMouseLeave",["mouseout","mouseover"]);py("onPointerEnter",["pointerout","pointerover"]);py("onPointerLeave",["pointerout","pointerover"]);rp("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));rp("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));rp("onBeforeInput",["compositionend","keypress","textInput","paste"]);rp("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));rp("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));rp("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bx="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(" "),xY=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bx));function yM(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,gK(r,e,void 0,t),t.currentTarget=null}function $B(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],s=r.event;r=r.listeners;e:{var i=void 0;if(e)for(var a=r.length-1;0<=a;a--){var o=r[a],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==i&&s.isPropagationStopped())break e;yM(s,o,u),i=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,u=o.currentTarget,o=o.listener,l!==i&&s.isPropagationStopped())break e;yM(s,o,u),i=l}}}if(oS)throw t=ET,oS=!1,ET=null,t}function Xt(t,e){var n=e[MT];n===void 0&&(n=e[MT]=new Set);var r=t+"__bubble";n.has(r)||(UB(e,t,2,!1),n.add(r))}function wC(t,e,n){var r=0;e&&(r|=4),UB(n,t,r,e)}var s1="_reactListening"+Math.random().toString(36).slice(2);
vendor: 3,228 bytes, line 37
37function Hv(t){if(!t[s1]){t[s1]=!0,K5.forEach(function(n){n!=="selectionchange"&&(xY.has(n)||wC(n,!1,t),wC(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[s1]||(e[s1]=!0,wC("selectionchange",!1,e))}}function UB(t,e,n,r){switch(_B(e)){case 1:var s=RK;break;case 4:s=IK;break;default:s=_P}n=s.bind(null,e,n,t),s=void 0,!_T||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),r?s!==void 0?t.addEventListener(e,n,{capture:!0,passive:s}):t.addEventListener(e,n,!0):s!==void 0?t.addEventListener(e,n,{passive:s}):t.addEventListener(e,n,!1)}function kC(t,e,n,r,s){var i=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===s||o.nodeType===8&&o.parentNode===s)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;a=a.return}for(;o!==null;){if(a=uh(o),a===null)return;if(l=a.tag,l===5||l===6){r=i=a;continue e}o=o.parentNode}}r=r.return}uB(function(){var u=i,d=bP(n),f=[];e:{var p=BB.get(t);if(p!==void 0){var m=CP,y=t;switch(t){case"keypress":if(ek(n)===0)break e;case"keydown":case"keyup":m=KK;break;case"focusin":y="focus",m=mC;break;case"focusout":y="blur",m=mC;break;case"beforeblur":case"afterblur":m=mC;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":m=iM;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=OK;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=ZK;break;case MB:case OB:case LB:m=BK;break;case FB:m=JK;break;case"scroll":m=DK;break;case"wheel":m=tY;break;case"copy":case"cut":case"paste":m=UK;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=oM}var g=(e&4)!==0,b=!g&&t==="scroll",x=g?p!==null?p+"Capture":null:p;g=[];for(var w=u,v;w!==null;){v=w;var S=v.stateNode;if(v.tag===5&&S!==null&&(v=S,x!==null&&(S=Bv(w,x),S!=null&&g.push(qv(w,S,v)))),b)break;w=w.return}0<g.length&&(p=new m(p,y,null,n,d),f.push({event:p,listeners:g}))}}if(!(e&7)){e:{if(p=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",p&&n!==kT&&(y=n.relatedTarget||n.fromElement)&&(uh(y)||y[cc]))break e;if((m||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=u,y=y?uh(y):null,y!==null&&(b=sp(y),y!==b||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=u),m!==y)){if(g=iM,S="onMouseLeave",x="onMouseEnter",w="mouse",(t==="pointerout"||t==="pointerover")&&(g=oM,S="onPointerLeave",x="onPointerEnter",w="pointer"),b=m==null?p:Xp(m),v=y==null?p:Xp(y),p=new g(S,w+"leave",m,n,d),p.target=b,p.relatedTarget=v,S=null,uh(d)===u&&(g=new g(x,w+"enter",y,n,d),g.target=v,g.relatedTarget=b,S=g),b=S,m&&y)t:{for(g=m,x=y,w=0,v=g;v;v=pp(v))w++;for(v=0,S=x;S;S=pp(S))v++;for(;0<w-v;)g=pp(g),w--;for(;0<v-w;)x=pp(x),v--;for(;w--;){if(g===x||x!==null&&g===x.alternate)break t;g=pp(g),x=pp(x)}g=null}else g=null;m!==null&&xM(f,p,m,g,!1),y!==null&&b!==null&&xM(f,b,y,g,!0)}}
vendor: 5,411 bytes, lines 37-38
37e:{if(p=u?Xp(u):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var E=lY;else if(uM(p))if(NB)E=hY;else{E=uY;var C=cY}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(E=dY);if(E&&(E=E(t,u))){jB(f,E,n,d);break e}C&&C(t,p,u),t==="focusout"&&(C=p._wrapperState)&&C.controlled&&p.type==="number"&&yT(p,"number",p.value)}switch(C=u?Xp(u):window,t){case"focusin":(uM(C)||C.contentEditable==="true")&&(Kp=C,jT=u,gv=null);break;case"focusout":gv=jT=Kp=null;break;case"mousedown":NT=!0;break;case"contextmenu":case"mouseup":case"dragend":NT=!1,mM(f,n,d);break;case"selectionchange":if(mY)break;case"keydown":case"keyup":mM(f,n,d)}var T;if(TP)e:{switch(t){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Gp?AB(t,n)&&(P="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(CB&&n.locale!=="ko"&&(Gp||P!=="onCompositionStart"?P==="onCompositionEnd"&&Gp&&(T=EB()):(Hu=d,EP="value"in Hu?Hu.value:Hu.textContent,Gp=!0)),C=hS(u,P),0<C.length&&(P=new aM(P,t,null,n,d),f.push({event:P,listeners:C}),T?P.data=T:(T=TB(n),T!==null&&(P.data=T)))),(T=rY?sY(t,n):iY(t,n))&&(u=hS(u,"onBeforeInput"),0<u.length&&(d=new aM("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=T))}$B(f,e)})}function qv(t,e,n){return{instance:t,listener:e,currentTarget:n}}function hS(t,e){for(var n=e+"Capture",r=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Bv(t,n),i!=null&&r.unshift(qv(t,i,s)),i=Bv(t,e),i!=null&&r.push(qv(t,i,s))),t=t.return}return r}function pp(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function xM(t,e,n,r,s){for(var i=e._reactName,a=[];n!==null&&n!==r;){var o=n,l=o.alternate,u=o.stateNode;if(l!==null&&l===r)break;o.tag===5&&u!==null&&(o=u,s?(l=Bv(n,i),l!=null&&a.unshift(qv(n,l,o))):s||(l=Bv(n,i),l!=null&&a.push(qv(n,l,o)))),n=n.return}a.length!==0&&t.push({event:e,listeners:a})}var vY=/\r\n?/g,bY=/\u0000|\uFFFD/g;function vM(t){return(typeof t=="string"?t:""+t).replace(vY,`
38`).replace(bY,"")}function i1(t,e,n){if(e=vM(e),vM(t)!==e&&n)throw Error(ne(425))}function fS(){}var PT=null,RT=null;function IT(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 DT=typeof setTimeout=="function"?setTimeout:void 0,wY=typeof clearTimeout=="function"?clearTimeout:void 0,bM=typeof Promise=="function"?Promise:void 0,kY=typeof queueMicrotask=="function"?queueMicrotask:typeof bM<"u"?function(t){return bM.resolve(null).then(t).catch(SY)}:DT;function SY(t){setTimeout(function(){throw t})}function SC(t,e){var n=e,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){t.removeChild(s),zv(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);zv(e)}function Ju(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 wM(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 zy=Math.random().toString(36).slice(2),Wo="__reactFiber$"+zy,Gv="__reactProps$"+zy,cc="__reactContainer$"+zy,MT="__reactEvents$"+zy,_Y="__reactListeners$"+zy,EY="__reactHandles$"+zy;function uh(t){var e=t[Wo];if(e)return e;for(var n=t.parentNode;n;){if(e=n[cc]||n[Wo]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=wM(t);t!==null;){if(n=t[Wo])return n;t=wM(t)}return e}t=n,n=t.parentNode}return null}function x0(t){return t=t[Wo]||t[cc],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Xp(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(ne(33))}function G_(t){return t[Gv]||null}var OT=[],Zp=-1;function Ad(t){return{current:t}}function Qt(t){0>Zp||(t.current=OT[Zp],OT[Zp]=null,Zp--)}function Ht(t,e){Zp++,OT[Zp]=t.current,t.current=e}var ud={},Zr=Ad(ud),qs=Ad(!1),zf=ud;function my(t,e){var n=t.type.contextTypes;if(!n)return ud;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function Gs(t){return t=t.childContextTypes,t!=null}function pS(){Qt(qs),Qt(Zr)}function kM(t,e,n){if(Zr.current!==ud)throw Error(ne(168));Ht(Zr,e),Ht(qs,n)}function zB(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(ne(108,cK(t)||"Unknown",s));return fn({},n,r)}function mS(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ud,zf=Zr.current,Ht(Zr,t),Ht(qs,qs.current),!0}function SM(t,e,n){var r=t.stateNode;if(!r)throw Error(ne(169));n?(t=zB(t,e,zf),r.__reactInternalMemoizedMergedChildContext=t,Qt(qs),Qt(Zr),Ht(Zr,t)):Qt(qs),Ht(qs,n)}var bl=null,K_=!1,_C=!1;function VB(t){bl===null?bl=[t]:bl.push(t)}function CY(t){K_=!0,VB(t)}function Td(){if(!_C&&bl!==null){_C=!0;var t=0,e=_t;try{var n=bl;
vendor: 17,201 bytes, line 38
38for(_t=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}bl=null,K_=!1}catch(s){throw bl!==null&&(bl=bl.slice(t+1)),pB(wP,Td),s}finally{_t=e,_C=!1}}return null}var Qp=[],Jp=0,gS=null,yS=0,ta=[],na=0,Vf=null,nc=1,rc="";function Yd(t,e){Qp[Jp++]=yS,Qp[Jp++]=gS,gS=t,yS=e}function WB(t,e,n){ta[na++]=nc,ta[na++]=rc,ta[na++]=Vf,Vf=t;var r=nc;t=rc;var s=32-Za(r)-1;r&=~(1<<s),n+=1;var i=32-Za(e)+s;if(30<i){var a=s-s%5;i=(r&(1<<a)-1).toString(32),r>>=a,s-=a,nc=1<<32-Za(e)+s|n<<s|r,rc=i+t}else nc=1<<i|n<<s|r,rc=t}function NP(t){t.return!==null&&(Yd(t,1),WB(t,1,0))}function PP(t){for(;t===gS;)gS=Qp[--Jp],Qp[Jp]=null,yS=Qp[--Jp],Qp[Jp]=null;for(;t===Vf;)Vf=ta[--na],ta[na]=null,rc=ta[--na],ta[na]=null,nc=ta[--na],ta[na]=null}var Ai=null,Ci=null,nn=!1,Ka=null;function HB(t,e){var n=aa(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 _M(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,Ai=t,Ci=Ju(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Ai=t,Ci=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Vf!==null?{id:nc,overflow:rc}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=aa(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Ai=t,Ci=null,!0):!1;default:return!1}}function LT(t){return(t.mode&1)!==0&&(t.flags&128)===0}function FT(t){if(nn){var e=Ci;if(e){var n=e;if(!_M(t,e)){if(LT(t))throw Error(ne(418));e=Ju(n.nextSibling);var r=Ai;e&&_M(t,e)?HB(r,n):(t.flags=t.flags&-4097|2,nn=!1,Ai=t)}}else{if(LT(t))throw Error(ne(418));t.flags=t.flags&-4097|2,nn=!1,Ai=t}}}function EM(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Ai=t}function a1(t){if(t!==Ai)return!1;if(!nn)return EM(t),nn=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!IT(t.type,t.memoizedProps)),e&&(e=Ci)){if(LT(t))throw qB(),Error(ne(418));for(;e;)HB(t,e),e=Ju(e.nextSibling)}if(EM(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(ne(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Ci=Ju(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Ci=null}}else Ci=Ai?Ju(t.stateNode.nextSibling):null;return!0}function qB(){for(var t=Ci;t;)t=Ju(t.nextSibling)}function gy(){Ci=Ai=null,nn=!1}function RP(t){Ka===null?Ka=[t]:Ka.push(t)}var AY=_c.ReactCurrentBatchConfig;function hx(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(ne(309));var r=n.stateNode}if(!r)throw Error(ne(147,t));var s=r,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(a){var o=s.refs;a===null?delete o[i]:o[i]=a},e._stringRef=i,e)}if(typeof t!="string")throw Error(ne(284));if(!n._owner)throw Error(ne(290,t))}return t}function o1(t,e){throw t=Object.prototype.toString.call(e),Error(ne(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function CM(t){var e=t._init;return e(t._payload)}function GB(t){function e(x,w){if(t){var v=x.deletions;v===null?(x.deletions=[w],x.flags|=16):v.push(w)}}function n(x,w){if(!t)return null;for(;w!==null;)e(x,w),w=w.sibling;return null}function r(x,w){for(x=new Map;w!==null;)w.key!==null?x.set(w.key,w):x.set(w.index,w),w=w.sibling;return x}function s(x,w){return x=rd(x,w),x.index=0,x.sibling=null,x}function i(x,w,v){return x.index=v,t?(v=x.alternate,v!==null?(v=v.index,v<w?(x.flags|=2,w):v):(x.flags|=2,w)):(x.flags|=1048576,w)}function a(x){return t&&x.alternate===null&&(x.flags|=2),x}function o(x,w,v,S){return w===null||w.tag!==6?(w=PC(v,x.mode,S),w.return=x,w):(w=s(w,v),w.return=x,w)}function l(x,w,v,S){var E=v.type;return E===qp?d(x,w,v.props.children,S,v.key):w!==null&&(w.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===$c&&CM(E)===w.type)?(S=s(w,v.props),S.ref=hx(x,w,v),S.return=x,S):(S=ok(v.type,v.key,v.props,null,x.mode,S),S.ref=hx(x,w,v),S.return=x,S)}function u(x,w,v,S){return w===null||w.tag!==4||w.stateNode.containerInfo!==v.containerInfo||w.stateNode.implementation!==v.implementation?(w=RC(v,x.mode,S),w.return=x,w):(w=s(w,v.children||[]),w.return=x,w)}function d(x,w,v,S,E){return w===null||w.tag!==7?(w=Ff(v,x.mode,S,E),w.return=x,w):(w=s(w,v),w.return=x,w)}function f(x,w,v){if(typeof w=="string"&&w!==""||typeof w=="number")return w=PC(""+w,x.mode,v),w.return=x,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case X0:return v=ok(w.type,w.key,w.props,null,x.mode,v),v.ref=hx(x,null,w),v.return=x,v;case Hp:return w=RC(w,x.mode,v),w.return=x,w;case $c:var S=w._init;return f(x,S(w._payload),v)}if(Lx(w)||ox(w))return w=Ff(w,x.mode,v,null),w.return=x,w;o1(x,w)}return null}function p(x,w,v,S){var E=w!==null?w.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return E!==null?null:o(x,w,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case X0:return v.key===E?l(x,w,v,S):null;case Hp:return v.key===E?u(x,w,v,S):null;case $c:return E=v._init,p(x,w,E(v._payload),S)}if(Lx(v)||ox(v))return E!==null?null:d(x,w,v,S,null);o1(x,v)}return null}function m(x,w,v,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return x=x.get(v)||null,o(w,x,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case X0:return x=x.get(S.key===null?v:S.key)||null,l(w,x,S,E);case Hp:return x=x.get(S.key===null?v:S.key)||null,u(w,x,S,E);case $c:var C=S._init;return m(x,w,v,C(S._payload),E)}if(Lx(S)||ox(S))return x=x.get(v)||null,d(w,x,S,E,null);o1(w,S)}return null}function y(x,w,v,S){for(var E=null,C=null,T=w,P=w=0,M=null;T!==null&&P<v.length;P++){T.index>P?(M=T,T=null):M=T.sibling;var R=p(x,T,v[P],S);if(R===null){T===null&&(T=M);break}t&&T&&R.alternate===null&&e(x,T),w=i(R,w,P),C===null?E=R:C.sibling=R,C=R,T=M}if(P===v.length)return n(x,T),nn&&Yd(x,P),E;if(T===null){for(;P<v.length;P++)T=f(x,v[P],S),T!==null&&(w=i(T,w,P),C===null?E=T:C.sibling=T,C=T);return nn&&Yd(x,P),E}for(T=r(x,T);P<v.length;P++)M=m(T,x,P,v[P],S),M!==null&&(t&&M.alternate!==null&&T.delete(M.key===null?P:M.key),w=i(M,w,P),C===null?E=M:C.sibling=M,C=M);return t&&T.forEach(function(O){return e(x,O)}),nn&&Yd(x,P),E}function g(x,w,v,S){var E=ox(v);if(typeof E!="function")throw Error(ne(150));if(v=E.call(v),v==null)throw Error(ne(151));for(var C=E=null,T=w,P=w=0,M=null,R=v.next();T!==null&&!R.done;P++,R=v.next()){T.index>P?(M=T,T=null):M=T.sibling;var O=p(x,T,R.value,S);if(O===null){T===null&&(T=M);break}t&&T&&O.alternate===null&&e(x,T),w=i(O,w,P),C===null?E=O:C.sibling=O,C=O,T=M}if(R.done)return n(x,T),nn&&Yd(x,P),E;if(T===null){for(;!R.done;P++,R=v.next())R=f(x,R.value,S),R!==null&&(w=i(R,w,P),C===null?E=R:C.sibling=R,C=R);return nn&&Yd(x,P),E}for(T=r(x,T);!R.done;P++,R=v.next())R=m(T,x,P,R.value,S),R!==null&&(t&&R.alternate!==null&&T.delete(R.key===null?P:R.key),w=i(R,w,P),C===null?E=R:C.sibling=R,C=R);return t&&T.forEach(function(L){return e(x,L)}),nn&&Yd(x,P),E}function b(x,w,v,S){if(typeof v=="object"&&v!==null&&v.type===qp&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case X0:e:{for(var E=v.key,C=w;C!==null;){if(C.key===E){if(E=v.type,E===qp){if(C.tag===7){n(x,C.sibling),w=s(C,v.props.children),w.return=x,x=w;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===$c&&CM(E)===C.type){n(x,C.sibling),w=s(C,v.props),w.ref=hx(x,C,v),w.return=x,x=w;break e}n(x,C);break}else e(x,C);C=C.sibling}v.type===qp?(w=Ff(v.props.children,x.mode,S,v.key),w.return=x,x=w):(S=ok(v.type,v.key,v.props,null,x.mode,S),S.ref=hx(x,w,v),S.return=x,x=S)}return a(x);case Hp:e:{for(C=v.key;w!==null;){if(w.key===C)if(w.tag===4&&w.stateNode.containerInfo===v.containerInfo&&w.stateNode.implementation===v.implementation){n(x,w.sibling),w=s(w,v.children||[]),w.return=x,x=w;break e}else{n(x,w);break}else e(x,w);w=w.sibling}w=RC(v,x.mode,S),w.return=x,x=w}return a(x);case $c:return C=v._init,b(x,w,C(v._payload),S)}if(Lx(v))return y(x,w,v,S);if(ox(v))return g(x,w,v,S);o1(x,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,w!==null&&w.tag===6?(n(x,w.sibling),w=s(w,v),w.return=x,x=w):(n(x,w),w=PC(v,x.mode,S),w.return=x,x=w),a(x)):n(x,w)}return b}var yy=GB(!0),KB=GB(!1),xS=Ad(null),vS=null,em=null,IP=null;function DP(){IP=em=vS=null}function MP(t){var e=xS.current;Qt(xS),t._currentValue=e}function BT(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 xm(t,e){vS=t,IP=em=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Hs=!0),t.firstContext=null)}function pa(t){var e=t._currentValue;if(IP!==t)if(t={context:t,memoizedValue:e,next:null},em===null){if(vS===null)throw Error(ne(308));em=t,vS.dependencies={lanes:0,firstContext:t}}else em=em.next=t;return e}var dh=null;function OP(t){dh===null?dh=[t]:dh.push(t)}function YB(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,OP(e)):(n.next=s.next,s.next=n),e.interleaved=n,uc(t,r)}function uc(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 Uc=!1;function LP(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function XB(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 sc(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ed(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ut&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,uc(t,n)}return s=r.interleaved,s===null?(e.next=e,OP(r)):(e.next=s.next,s.next=e),r.interleaved=e,uc(t,n)}function tk(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,kP(t,n)}}function AM(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=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};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,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 bS(t,e,n,r){var s=t.updateQueue;Uc=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?i=u:a.next=u,a=l;var d=t.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;a=0,d=u=l=null,o=i;do{var p=o.lane,m=o.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var y=t,g=o;switch(p=e,m=n,g.tag){case 1:if(y=g.payload,typeof y=="function"){f=y.call(m,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,p=typeof y=="function"?y.call(m,f,p):y,p==null)break e;f=fn({},f,p);break e;case 2:Uc=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,p=s.effects,p===null?s.effects=[o]:p.push(o))}else m={eventTime:m,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=m,l=f):d=d.next=m,a|=p;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;p=o,o=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do a|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Hf|=a,t.lanes=a,t.memoizedState=f}}function TM(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(ne(191,s));s.call(r)}}}var v0={},Zo=Ad(v0),Kv=Ad(v0),Yv=Ad(v0);function hh(t){if(t===v0)throw Error(ne(174));return t}function FP(t,e){switch(Ht(Yv,e),Ht(Kv,t),Ht(Zo,v0),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:vT(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=vT(e,t)}Qt(Zo),Ht(Zo,e)}function xy(){Qt(Zo),Qt(Kv),Qt(Yv)}function ZB(t){hh(Yv.current);var e=hh(Zo.current),n=vT(e,t.type);e!==n&&(Ht(Kv,t),Ht(Zo,n))}function BP(t){Kv.current===t&&(Qt(Zo),Qt(Kv))}var on=Ad(0);function wS(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 EC=[];function $P(){for(var t=0;t<EC.length;t++)EC[t]._workInProgressVersionPrimary=null;EC.length=0}var nk=_c.ReactCurrentDispatcher,CC=_c.ReactCurrentBatchConfig,Wf=0,dn=null,Zn=null,ur=null,kS=!1,yv=!1,Xv=0,TY=0;function Ir(){throw Error(ne(321))}function UP(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!to(t[n],e[n]))return!1;return!0}function zP(t,e,n,r,s,i){if(Wf=i,dn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,nk.current=t===null||t.memoizedState===null?RY:IY,t=n(r,s),yv){i=0;do{if(yv=!1,Xv=0,25<=i)throw Error(ne(301));i+=1,ur=Zn=null,e.updateQueue=null,nk.current=DY,t=n(r,s)}while(yv)}if(nk.current=SS,e=Zn!==null&&Zn.next!==null,Wf=0,ur=Zn=dn=null,kS=!1,e)throw Error(ne(300));return t}function VP(){var t=Xv!==0;return Xv=0,t}function po(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ur===null?dn.memoizedState=ur=t:ur=ur.next=t,ur}function ma(){if(Zn===null){var t=dn.alternate;t=t!==null?t.memoizedState:null}else t=Zn.next;var e=ur===null?dn.memoizedState:ur.next;if(e!==null)ur=e,Zn=t;else{if(t===null)throw Error(ne(310));Zn=t,t={memoizedState:Zn.memoizedState,baseState:Zn.baseState,baseQueue:Zn.baseQueue,queue:Zn.queue,next:null},ur===null?dn.memoizedState=ur=t:ur=ur.next=t}return ur}function Zv(t,e){return typeof e=="function"?e(t):e}function AC(t){var e=ma(),n=e.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=t;var r=Zn,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var a=s.next;s.next=i.next,i.next=a}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var o=a=null,l=null,u=i;do{var d=u.lane;if((Wf&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=f,a=r):l=l.next=f,dn.lanes|=d,Hf|=d}u=u.next}while(u!==null&&u!==i);l===null?a=r:l.next=o,to(r,e.memoizedState)||(Hs=!0),e.memoizedState=r,e.baseState=a,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){s=t;do i=s.lane,dn.lanes|=i,Hf|=i,s=s.next;while(s!==t)}else s===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function TC(t){var e=ma(),n=e.queue;if(n===null)throw Error(ne(311));n.lastRenderedReducer=t;var r=n.dispatch,s=n.pending,i=e.memoizedState;if(s!==null){n.pending=null;var a=s=s.next;do i=t(i,a.action),a=a.next;while(a!==s);to(i,e.memoizedState)||(Hs=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function QB(){}function JB(t,e){var n=dn,r=ma(),s=e(),i=!to(r.memoizedState,s);if(i&&(r.memoizedState=s,Hs=!0),r=r.queue,WP(n$.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||ur!==null&&ur.memoizedState.tag&1){if(n.flags|=2048,Qv(9,t$.bind(null,n,r,s,e),void 0,null),dr===null)throw Error(ne(349));Wf&30||e$(n,e,s)}return s}function e$(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=dn.updateQueue,e===null?(e={lastEffect:null,stores:null},dn.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function t$(t,e,n,r){e.value=n,e.getSnapshot=r,r$(e)&&s$(t)}function n$(t,e,n){return n(function(){r$(e)&&s$(t)})}function r$(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!to(t,n)}catch{return!0}}function s$(t){var e=uc(t,1);e!==null&&Qa(e,t,1,-1)}function jM(t){var e=po();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Zv,lastRenderedState:t},e.queue=t,t=t.dispatch=PY.bind(null,dn,t),[e.memoizedState,t]}function Qv(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=dn.updateQueue,e===null?(e={lastEffect:null,stores:null},dn.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 i$(){return ma().memoizedState}
vendor: 4,214 bytes, line 38
38function rk(t,e,n,r){var s=po();dn.flags|=t,s.memoizedState=Qv(1|e,n,void 0,r===void 0?null:r)}function Y_(t,e,n,r){var s=ma();r=r===void 0?null:r;var i=void 0;if(Zn!==null){var a=Zn.memoizedState;if(i=a.destroy,r!==null&&UP(r,a.deps)){s.memoizedState=Qv(e,n,i,r);return}}dn.flags|=t,s.memoizedState=Qv(1|e,n,i,r)}function NM(t,e){return rk(8390656,8,t,e)}function WP(t,e){return Y_(2048,8,t,e)}function a$(t,e){return Y_(4,2,t,e)}function o$(t,e){return Y_(4,4,t,e)}function l$(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 c$(t,e,n){return n=n!=null?n.concat([t]):null,Y_(4,4,l$.bind(null,e,t),n)}function HP(){}function u$(t,e){var n=ma();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&UP(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function d$(t,e){var n=ma();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&UP(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function h$(t,e,n){return Wf&21?(to(n,e)||(n=yB(),dn.lanes|=n,Hf|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Hs=!0),t.memoizedState=n)}function jY(t,e){var n=_t;_t=n!==0&&4>n?n:4,t(!0);var r=CC.transition;CC.transition={};try{t(!1),e()}finally{_t=n,CC.transition=r}}function f$(){return ma().memoizedState}function NY(t,e,n){var r=nd(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},p$(t))m$(e,n);else if(n=YB(t,e,n,r),n!==null){var s=gs();Qa(n,t,r,s),g$(n,e,r)}}function PY(t,e,n){var r=nd(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(p$(t))m$(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,o=i(a,n);if(s.hasEagerState=!0,s.eagerState=o,to(o,a)){var l=e.interleaved;l===null?(s.next=s,OP(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}n=YB(t,e,s,r),n!==null&&(s=gs(),Qa(n,t,r,s),g$(n,e,r))}}function p$(t){var e=t.alternate;return t===dn||e!==null&&e===dn}function m$(t,e){yv=kS=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function g$(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,kP(t,n)}}var SS={readContext:pa,useCallback:Ir,useContext:Ir,useEffect:Ir,useImperativeHandle:Ir,useInsertionEffect:Ir,useLayoutEffect:Ir,useMemo:Ir,useReducer:Ir,useRef:Ir,useState:Ir,useDebugValue:Ir,useDeferredValue:Ir,useTransition:Ir,useMutableSource:Ir,useSyncExternalStore:Ir,useId:Ir,unstable_isNewReconciler:!1},RY={readContext:pa,useCallback:function(t,e){return po().memoizedState=[t,e===void 0?null:e],t},useContext:pa,useEffect:NM,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,rk(4194308,4,l$.bind(null,e,t),n)},useLayoutEffect:function(t,e){return rk(4194308,4,t,e)},useInsertionEffect:function(t,e){return rk(4,2,t,e)},useMemo:function(t,e){var n=po();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=po();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=NY.bind(null,dn,t),[r.memoizedState,t]},useRef:function(t){var e=po();return t={current:t},e.memoizedState=t},useState:jM,useDebugValue:HP,useDeferredValue:function(t){return po().memoizedState=t},useTransition:function(){var t=jM(!1),e=t[0];return t=jY.bind(null,t[1]),po().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=dn,s=po();if(nn){if(n===void 0)throw Error(ne(407));n=n()}else{if(n=e(),dr===null)throw Error(ne(349));Wf&30||e$(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,NM(n$.bind(null,r,i,t),[t]),r.flags|=2048,Qv(9,t$.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=po(),e=dr.identifierPrefix;if(nn){var n=rc,r=nc;n=(r&~(1<<32-Za(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Xv++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=TY++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},IY={readContext:pa,useCallback:u$,useContext:pa,useEffect:WP,useImperativeHandle:c$,useInsertionEffect:a$,useLayoutEffect:o$,useMemo:d$,useReducer:AC,useRef
vendor: 6,411 bytes, lines 38-40
38:i$,useState:function(){return AC(Zv)},useDebugValue:HP,useDeferredValue:function(t){var e=ma();return h$(e,Zn.memoizedState,t)},useTransition:function(){var t=AC(Zv)[0],e=ma().memoizedState;return[t,e]},useMutableSource:QB,useSyncExternalStore:JB,useId:f$,unstable_isNewReconciler:!1},DY={readContext:pa,useCallback:u$,useContext:pa,useEffect:WP,useImperativeHandle:c$,useInsertionEffect:a$,useLayoutEffect:o$,useMemo:d$,useReducer:TC,useRef:i$,useState:function(){return TC(Zv)},useDebugValue:HP,useDeferredValue:function(t){var e=ma();return Zn===null?e.memoizedState=t:h$(e,Zn.memoizedState,t)},useTransition:function(){var t=TC(Zv)[0],e=ma().memoizedState;return[t,e]},useMutableSource:QB,useSyncExternalStore:JB,useId:f$,unstable_isNewReconciler:!1};function Na(t,e){if(t&&t.defaultProps){e=fn({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function $T(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:fn({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var X_={isMounted:function(t){return(t=t._reactInternals)?sp(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=gs(),s=nd(t),i=sc(r,s);i.payload=e,n!=null&&(i.callback=n),e=ed(t,i,s),e!==null&&(Qa(e,t,s,r),tk(e,t,s))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=gs(),s=nd(t),i=sc(r,s);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=ed(t,i,s),e!==null&&(Qa(e,t,s,r),tk(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=gs(),r=nd(t),s=sc(n,r);s.tag=2,e!=null&&(s.callback=e),e=ed(t,s,r),e!==null&&(Qa(e,t,r,n),tk(e,t,r))}};function PM(t,e,n,r,s,i,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,a):e.prototype&&e.prototype.isPureReactComponent?!Wv(n,r)||!Wv(s,i):!0}function y$(t,e,n){var r=!1,s=ud,i=e.contextType;return typeof i=="object"&&i!==null?i=pa(i):(s=Gs(e)?zf:Zr.current,r=e.contextTypes,i=(r=r!=null)?my(t,s):ud),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=X_,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function RM(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&&X_.enqueueReplaceState(e,e.state,null)}function UT(t,e,n,r){var s=t.stateNode;s.props=n,s.state=t.memoizedState,s.refs={},LP(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=pa(i):(i=Gs(e)?zf:Zr.current,s.context=my(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&($T(t,e,i,n),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&X_.enqueueReplaceState(s,s.state,null),bS(t,n,s,r),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function vy(t,e){try{var n="",r=e;do n+=lK(r),r=r.return;while(r);var s=n}catch(i){s=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:t,source:e,stack:s,digest:null}}function jC(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function zT(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var MY=typeof WeakMap=="function"?WeakMap:Map;function x$(t,e,n){n=sc(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){ES||(ES=!0,QT=r),zT(t,e)},n}function v$(t,e,n){n=sc(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var s=e.value;n.payload=function(){return r(s)},n.callback=function(){zT(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){zT(t,e),typeof r!="function"&&(td===null?td=new Set([this]):td.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function IM(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new MY;var s=new Set;r.set(e,s)}else s=r.get(e),s===void 0&&(s=new Set,r.set(e,s));s.has(n)||(s.add(n),t=YY.bind(null,t,e,n),e.then(t,t))}function DM(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 MM(t,e,n,r,s){return t.mode&1?(t.flags|=65536,t.lanes=s,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=sc(-1,1),e.tag=2,ed(n,e,1))),n.lanes|=1),t)}var OY=_c.ReactCurrentOwner,Hs=!1;function cs(t,e,n,r){e.child=t===null?KB(e,null,n,r):yy(e,t.child,n,r)}function OM(t,e,n,r,s){n=n.render;var i=e.ref;return xm(e,s),r=zP(t,e,n,r,i,s),n=VP(),t!==null&&!Hs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,dc(t,e,s)):(nn&&n&&NP(e),e.flags|=1,cs(t,e,r,s),e.child)}function LM(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!JP(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,b$(t,e,i,r,s)):(t=ok(n.type,null,r,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Wv,n(a,r)&&t.ref===e.ref)return dc(t,e,s)}return e.flags|=1,t=rd(i,r),t.ref=e.ref,t.return=e,e.child=t}function b$(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(Wv(i,r)&&t.ref===e.ref)if(Hs=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(Hs=!0);else return e.lanes=t.lanes,dc(t,e,s)}return VT(t,e,n,r,s)}function w$(t,e,n){var r=e.pendingProps,s=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ht(nm,ki),ki|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Ht(nm,ki),ki|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ht(nm,ki),ki|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,Ht(nm,ki),ki|=r;return cs(t,e,s,n),e.child}function k$(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}
vendor: 5,244 bytes, line 40
40function VT(t,e,n,r,s){var i=Gs(n)?zf:Zr.current;return i=my(e,i),xm(e,s),n=zP(t,e,n,r,i,s),r=VP(),t!==null&&!Hs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,dc(t,e,s)):(nn&&r&&NP(e),e.flags|=1,cs(t,e,n,s),e.child)}function FM(t,e,n,r,s){if(Gs(n)){var i=!0;mS(e)}else i=!1;if(xm(e,s),e.stateNode===null)sk(t,e),y$(e,n,r),UT(e,n,r,s),r=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=pa(u):(u=Gs(n)?zf:Zr.current,u=my(e,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==u)&&RM(e,a,r,u),Uc=!1;var p=e.memoizedState;a.state=p,bS(e,r,a,s),l=e.memoizedState,o!==r||p!==l||qs.current||Uc?(typeof d=="function"&&($T(e,n,d,r),l=e.memoizedState),(o=Uc||PM(e,n,o,r,p,l,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),a.props=r,a.state=l,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,XB(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:Na(e.type,o),a.props=u,f=e.pendingProps,p=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=pa(l):(l=Gs(n)?zf:Zr.current,l=my(e,l));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||p!==l)&&RM(e,a,r,l),Uc=!1,p=e.memoizedState,a.state=p,bS(e,r,a,s);var y=e.memoizedState;o!==f||p!==y||qs.current||Uc?(typeof m=="function"&&($T(e,n,m,r),y=e.memoizedState),(u=Uc||PM(e,n,u,r,p,y,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,y,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,y,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=y),a.props=r,a.state=y,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return WT(t,e,n,r,i,s)}function WT(t,e,n,r,s,i){k$(t,e);var a=(e.flags&128)!==0;if(!r&&!a)return s&&SM(e,n,!1),dc(t,e,i);r=e.stateNode,OY.current=e;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=yy(e,t.child,null,i),e.child=yy(e,null,o,i)):cs(t,e,o,i),e.memoizedState=r.state,s&&SM(e,n,!0),e.child}function S$(t){var e=t.stateNode;e.pendingContext?kM(t,e.pendingContext,e.pendingContext!==e.context):e.context&&kM(t,e.context,!1),FP(t,e.containerInfo)}function BM(t,e,n,r,s){return gy(),RP(s),e.flags|=256,cs(t,e,n,r),e.child}var HT={dehydrated:null,treeContext:null,retryLane:0};function qT(t){return{baseLanes:t,cachePool:null,transitions:null}}function _$(t,e,n){var r=e.pendingProps,s=on.current,i=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(s&2)!==0),o?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),Ht(on,s&1),t===null)return FT(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,i?(r=e.mode,i=e.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=J_(a,r,0,null),t=Ff(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=qT(n),e.memoizedState=HT,t):qP(e,a));if(s=t.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return LY(t,e,a,r,o,s,n);if(i){i=r.fallback,a=e.mode,s=t.child,o=s.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=rd(s,l),r.subtreeFlags=s.subtreeFlags&14680064),o!==null?i=rd(o,i):(i=Ff(i,a,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,a=t.child.memoizedState,a=a===null?qT(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=t.childLanes&~n,e.memoizedState=HT,r}return i=t.child,t=i.sibling,r=rd(i,{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 qP(t,e){return e=J_({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function l1(t,e,n,r){return r!==null&&RP(r),yy(e,t.child,null,n),t=qP(e,e.pen
vendor: 4,919 bytes, line 40
40dingProps.children),t.flags|=2,e.memoizedState=null,t}function LY(t,e,n,r,s,i,a){if(n)return e.flags&256?(e.flags&=-257,r=jC(Error(ne(422))),l1(t,e,a,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=J_({mode:"visible",children:r.children},s,0,null),i=Ff(i,s,a,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&yy(e,t.child,null,a),e.child.memoizedState=qT(a),e.memoizedState=HT,i);if(!(e.mode&1))return l1(t,e,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var o=r.dgst;return r=o,i=Error(ne(419)),r=jC(i,r,void 0),l1(t,e,a,r)}if(o=(a&t.childLanes)!==0,Hs||o){if(r=dr,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,uc(t,s),Qa(r,t,s,-1))}return QP(),r=jC(Error(ne(421))),l1(t,e,a,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=XY.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,Ci=Ju(s.nextSibling),Ai=e,nn=!0,Ka=null,t!==null&&(ta[na++]=nc,ta[na++]=rc,ta[na++]=Vf,nc=t.id,rc=t.overflow,Vf=e),e=qP(e,r.children),e.flags|=4096,e)}function $M(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),BT(t.return,e,n)}function NC(t,e,n,r,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function E$(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(cs(t,e,r.children,n),r=on.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&&$M(t,n,e);else if(t.tag===19)$M(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(Ht(on,r),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(n=e.child,s=null;n!==null;)t=n.alternate,t!==null&&wS(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),NC(e,!1,s,n,i);break;case"backwards":for(n=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&wS(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}NC(e,!0,n,null,i);break;case"together":NC(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function sk(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function dc(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Hf|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ne(153));if(e.child!==null){for(t=e.child,n=rd(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=rd(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function FY(t,e,n){switch(e.tag){case 3:S$(e),gy();break;case 5:ZB(e);break;case 1:Gs(e.type)&&mS(e);break;case 4:FP(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;Ht(xS,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Ht(on,on.current&1),e.flags|=128,null):n&e.child.childLanes?_$(t,e,n):(Ht(on,on.current&1),t=dc(t,e,n),t!==null?t.sibling:null);Ht(on,on.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return E$(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ht(on,on.current),r)break;return null;case 22:case 23:return e.lanes=0,w$(t,e,n)}return dc(t,e,n)}var C$,GT,A$,T$;C$=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}};GT=function(){};A$=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,hh(Zo.current);var i=null;switch(n){case"input":s=mT(t,s),r=mT(t,r),i=[];break;case"select":s=fn({},s,{value:void 0}),r=fn({},r,{value:void 0}),i=[];break;case"textarea":s=xT(t,s),r=xT(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=fS)}bT(n,r);var a;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var o=s[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Lv.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];
vendor: 5,267 bytes, line 40
40if(o=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="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||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Lv.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Xt("scroll",t),i||o===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};T$=function(t,e,n,r){n!==r&&(e.flags|=4)};function fx(t,e){if(!nn)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 Dr(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function BY(t,e,n){var r=e.pendingProps;switch(PP(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dr(e),null;case 1:return Gs(e.type)&&pS(),Dr(e),null;case 3:return r=e.stateNode,xy(),Qt(qs),Qt(Zr),$P(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(a1(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ka!==null&&(tj(Ka),Ka=null))),GT(t,e),Dr(e),null;case 5:BP(e);var s=hh(Yv.current);if(n=e.type,t!==null&&e.stateNode!=null)A$(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(ne(166));return Dr(e),null}if(t=hh(Zo.current),a1(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[Wo]=e,r[Gv]=i,t=(e.mode&1)!==0,n){case"dialog":Xt("cancel",r),Xt("close",r);break;case"iframe":case"object":case"embed":Xt("load",r);break;case"video":case"audio":for(s=0;s<Bx.length;s++)Xt(Bx[s],r);break;case"source":Xt("error",r);break;case"img":case"image":case"link":Xt("error",r),Xt("load",r);break;case"details":Xt("toggle",r);break;case"input":YD(r,i),Xt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Xt("invalid",r);break;case"textarea":ZD(r,i),Xt("invalid",r)}bT(n,i),s=null;for(var a in i)if(i.hasOwnProperty(a)){var o=i[a];a==="children"?typeof o=="string"?r.textContent!==o&&(i.suppressHydrationWarning!==!0&&i1(r.textContent,o,t),s=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&i1(r.textContent,o,t),s=["children",""+o]):Lv.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Xt("scroll",r)}switch(n){case"input":Z0(r),XD(r,i,!0);break;case"textarea":Z0(r),QD(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=fS)}r=s,e.updateQueue=r,r!==null&&(e.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=nB(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[Wo]=e,t[Gv]=r,C$(t,e,!1,!1),e.stateNode=t;e:{switch(a=wT(n,r),n){case"dialog":Xt("cancel",t),Xt("close",t),s=r;break;case"iframe":case"object":case"embed":Xt("load",t),s=r;break;case"video":case"audio":for(s=0;s<Bx.length;s++)Xt(Bx[s],t);s=r;break;case"source":Xt("error",t),s=r;break;case"img":case"image":case"link":Xt("error",t),Xt("load",t),s=r;break;case"details":Xt("toggle",t),s=r;break;case"input":YD(t,r),s=mT(t,r),Xt("invalid",t);break;case"option":s=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},s=fn({},r,{value:void 0}),Xt("invalid",t);break;case"textarea":ZD(t,r),s=xT(t,r),Xt("invalid",t);break;default:s=r}bT(n,s),o=s;for(i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="style"?iB(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&rB(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Fv(t,l):typeof l=="number"&&Fv(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Lv.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Xt("scroll",t):l!=null&&gP(t,i,l,a))}switch(n){case"input":Z0(t),XD(t,r,!1);break;case"textarea":Z0(t),QD(t);break;case"option":r.value!=null&&t.setAttribute("value",""+cd(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?pm(t,!!r.multiple,i,!1):r.defaultValue!=null&&pm(t,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=fS)}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)}
vendor: 28,872 bytes, line 40
40return Dr(e),null;case 6:if(t&&e.stateNode!=null)T$(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(ne(166));if(n=hh(Yv.current),hh(Zo.current),a1(e)){if(r=e.stateNode,n=e.memoizedProps,r[Wo]=e,(i=r.nodeValue!==n)&&(t=Ai,t!==null))switch(t.tag){case 3:i1(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&i1(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wo]=e,e.stateNode=r}return Dr(e),null;case 13:if(Qt(on),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(nn&&Ci!==null&&e.mode&1&&!(e.flags&128))qB(),gy(),e.flags|=98560,i=!1;else if(i=a1(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(ne(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ne(317));i[Wo]=e}else gy(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Dr(e),i=!1}else Ka!==null&&(tj(Ka),Ka=null),i=!0;if(!i)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||on.current&1?Qn===0&&(Qn=3):QP())),e.updateQueue!==null&&(e.flags|=4),Dr(e),null);case 4:return xy(),GT(t,e),t===null&&Hv(e.stateNode.containerInfo),Dr(e),null;case 10:return MP(e.type._context),Dr(e),null;case 17:return Gs(e.type)&&pS(),Dr(e),null;case 19:if(Qt(on),i=e.memoizedState,i===null)return Dr(e),null;if(r=(e.flags&128)!==0,a=i.rendering,a===null)if(r)fx(i,!1);else{if(Qn!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=wS(t),a!==null){for(e.flags|=128,fx(i,!1),r=a.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)i=n,t=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,t=a.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Ht(on,on.current&1|2),e.child}t=t.sibling}i.tail!==null&&jn()>by&&(e.flags|=128,r=!0,fx(i,!1),e.lanes=4194304)}else{if(!r)if(t=wS(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),fx(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!nn)return Dr(e),null}else 2*jn()-i.renderingStartTime>by&&n!==1073741824&&(e.flags|=128,r=!0,fx(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(n=i.last,n!==null?n.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=jn(),e.sibling=null,n=on.current,Ht(on,r?n&1|2:n&1),e):(Dr(e),null);case 22:case 23:return ZP(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ki&1073741824&&(Dr(e),e.subtreeFlags&6&&(e.flags|=8192)):Dr(e),null;case 24:return null;case 25:return null}throw Error(ne(156,e.tag))}function $Y(t,e){switch(PP(e),e.tag){case 1:return Gs(e.type)&&pS(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return xy(),Qt(qs),Qt(Zr),$P(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return BP(e),null;case 13:if(Qt(on),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ne(340));gy()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Qt(on),null;case 4:return xy(),null;case 10:return MP(e.type._context),null;case 22:case 23:return ZP(),null;case 24:return null;default:return null}}var c1=!1,Hr=!1,UY=typeof WeakSet=="function"?WeakSet:Set,me=null;function tm(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Sn(t,e,r)}else n.current=null}function KT(t,e,n){try{n()}catch(r){Sn(t,e,r)}}var UM=!1;function zY(t,e){if(PT=uS,t=IB(),jP(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 s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,u=0,d=0,f=t,p=null;t:for(;;){for(var m;f!==n||s!==0&&f.nodeType!==3||(o=a+s),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===t)break t;if(p===n&&++u===s&&(o=a),p===i&&++d===r&&(l=a),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(RT={focusedElem:t,selectionRange:n},uS=!1,me=e;me!==null;)if(e=me,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,me=t;else for(;me!==null;){e=me;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,b=y.memoizedState,x=e.stateNode,w=x.getSnapshotBeforeUpdate(e.elementType===e.type?g:Na(e.type,g),b);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var v=e.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(S){Sn(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,me=t;break}me=e.return}return y=UM,UM=!1,y}function xv(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&KT(e,n,i)}s=s.next}while(s!==r)}}function Z_(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 YT(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 j$(t){var e=t.alternate;e!==null&&(t.alternate=null,j$(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Wo],delete e[Gv],delete e[MT],delete e[_Y],delete e[EY])),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 N$(t){return t.tag===5||t.tag===3||t.tag===4}function zM(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||N$(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 XT(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=fS));else if(r!==4&&(t=t.child,t!==null))for(XT(t,e,n),t=t.sibling;t!==null;)XT(t,e,n),t=t.sibling}function ZT(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(ZT(t,e,n),t=t.sibling;t!==null;)ZT(t,e,n),t=t.sibling}var Sr=null,qa=!1;function Tc(t,e,n){for(n=n.child;n!==null;)P$(t,e,n),n=n.sibling}function P$(t,e,n){if(Xo&&typeof Xo.onCommitFiberUnmount=="function")try{Xo.onCommitFiberUnmount(V_,n)}catch{}switch(n.tag){case 5:Hr||tm(n,e);case 6:var r=Sr,s=qa;Sr=null,Tc(t,e,n),Sr=r,qa=s,Sr!==null&&(qa?(t=Sr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Sr.removeChild(n.stateNode));break;case 18:Sr!==null&&(qa?(t=Sr,n=n.stateNode,t.nodeType===8?SC(t.parentNode,n):t.nodeType===1&&SC(t,n),zv(t)):SC(Sr,n.stateNode));break;case 4:r=Sr,s=qa,Sr=n.stateNode.containerInfo,qa=!0,Tc(t,e,n),Sr=r,qa=s;break;case 0:case 11:case 14:case 15:if(!Hr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&KT(n,e,a),s=s.next}while(s!==r)}Tc(t,e,n);break;case 1:if(!Hr&&(tm(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){Sn(n,e,o)}Tc(t,e,n);break;case 21:Tc(t,e,n);break;case 22:n.mode&1?(Hr=(r=Hr)||n.memoizedState!==null,Tc(t,e,n),Hr=r):Tc(t,e,n);break;default:Tc(t,e,n)}}function VM(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new UY),e.forEach(function(r){var s=ZY.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ka(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=t,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 5:Sr=o.stateNode,qa=!1;break e;case 3:Sr=o.stateNode.containerInfo,qa=!0;break e;case 4:Sr=o.stateNode.containerInfo,qa=!0;break e}o=o.return}if(Sr===null)throw Error(ne(160));P$(i,a,s),Sr=null,qa=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(u){Sn(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)R$(e,t),e=e.sibling}function R$(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(ka(e,t),co(t),r&4){try{xv(3,t,t.return),Z_(3,t)}catch(g){Sn(t,t.return,g)}try{xv(5,t,t.return)}catch(g){Sn(t,t.return,g)}}break;case 1:ka(e,t),co(t),r&512&&n!==null&&tm(n,n.return);break;case 5:if(ka(e,t),co(t),r&512&&n!==null&&tm(n,n.return),t.flags&32){var s=t.stateNode;try{Fv(s,"")}catch(g){Sn(t,t.return,g)}}if(r&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,a=n!==null?n.memoizedProps:i,o=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&eB(s,i),wT(o,a);var u=wT(o,i);for(a=0;a<l.length;a+=2){var d=l[a],f=l[a+1];d==="style"?iB(s,f):d==="dangerouslySetInnerHTML"?rB(s,f):d==="children"?Fv(s,f):gP(s,d,f,u)}switch(o){case"input":gT(s,i);break;case"textarea":tB(s,i);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?pm(s,!!i.multiple,m,!1):p!==!!i.multiple&&(i.defaultValue!=null?pm(s,!!i.multiple,i.defaultValue,!0):pm(s,!!i.multiple,i.multiple?[]:"",!1))}s[Gv]=i}catch(g){Sn(t,t.return,g)}}break;case 6:if(ka(e,t),co(t),r&4){if(t.stateNode===null)throw Error(ne(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(g){Sn(t,t.return,g)}}break;case 3:if(ka(e,t),co(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zv(e.containerInfo)}catch(g){Sn(t,t.return,g)}break;case 4:ka(e,t),co(t);break;case 13:ka(e,t),co(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(YP=jn())),r&4&&VM(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(Hr=(u=Hr)||d,ka(e,t),Hr=u):ka(e,t),co(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(me=t,d=t.child;d!==null;){for(f=me=d;me!==null;){switch(p=me,m=p.child,p.tag){case 0:case 11:case 14:case 15:xv(4,p,p.return);break;case 1:tm(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{e=r,y.props=e.memoizedProps,y.state=e.memoizedState,y.componentWillUnmount()}catch(g){Sn(r,n,g)}}break;case 5:tm(p,p.return);break;case 22:if(p.memoizedState!==null){HM(f);continue}}m!==null?(m.return=p,me=m):HM(f)}d=d.sibling}e:for(d=null,f=t;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=f.stateNode,l=f.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=sB("display",a))}catch(g){Sn(t,t.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){Sn(t,t.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ka(e,t),co(t),r&4&&VM(t);break;case 21:break;default:ka(e,t),co(t)}}function co(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(N$(n)){var r=n;break e}n=n.return}throw Error(ne(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Fv(s,""),r.flags&=-33);var i=zM(t);ZT(t,i,s);break;case 3:case 4:var a=r.stateNode.containerInfo,o=zM(t);XT(t,o,a);break;default:throw Error(ne(161))}}catch(l){Sn(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function VY(t,e,n){me=t,I$(t)}function I$(t,e,n){for(var r=(t.mode&1)!==0;me!==null;){var s=me,i=s.child;if(s.tag===22&&r){var a=s.memoizedState!==null||c1;if(!a){var o=s.alternate,l=o!==null&&o.memoizedState!==null||Hr;o=c1;var u=Hr;if(c1=a,(Hr=l)&&!u)for(me=s;me!==null;)a=me,l=a.child,a.tag===22&&a.memoizedState!==null?qM(s):l!==null?(l.return=a,me=l):qM(s);for(;i!==null;)me=i,I$(i),i=i.sibling;me=s,c1=o,Hr=u}WM(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,me=i):WM(t)}}function WM(t){for(;me!==null;){var e=me;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Hr||Z_(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Hr)if(n===null)r.componentDidMount();else{var s=e.elementType===e.type?n.memoizedProps:Na(e.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&TM(e,i,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}TM(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 u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&zv(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ne(163))}Hr||e.flags&512&&YT(e)}catch(p){Sn(e,e.return,p)}}if(e===t){me=null;break}if(n=e.sibling,n!==null){n.return=e.return,me=n;break}me=e.return}}function HM(t){for(;me!==null;){var e=me;if(e===t){me=null;break}var n=e.sibling;if(n!==null){n.return=e.return,me=n;break}me=e.return}}function qM(t){for(;me!==null;){var e=me;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Z_(4,e)}catch(l){Sn(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var s=e.return;try{r.componentDidMount()}catch(l){Sn(e,s,l)}}var i=e.return;try{YT(e)}catch(l){Sn(e,i,l)}break;case 5:var a=e.return;try{YT(e)}catch(l){Sn(e,a,l)}}}catch(l){Sn(e,e.return,l)}if(e===t){me=null;break}var o=e.sibling;if(o!==null){o.return=e.return,me=o;break}me=e.return}}var WY=Math.ceil,_S=_c.ReactCurrentDispatcher,GP=_c.ReactCurrentOwner,ua=_c.ReactCurrentBatchConfig,ut=0,dr=null,Un=null,Tr=0,ki=0,nm=Ad(0),Qn=0,Jv=null,Hf=0,Q_=0,KP=0,vv=null,zs=null,YP=0,by=1/0,gl=null,ES=!1,QT=null,td=null,u1=!1,qu=null,CS=0,bv=0,JT=null,ik=-1,ak=0;function gs(){return ut&6?jn():ik!==-1?ik:ik=jn()}function nd(t){return t.mode&1?ut&2&&Tr!==0?Tr&-Tr:AY.transition!==null?(ak===0&&(ak=yB()),ak):(t=_t,t!==0||(t=window.event,t=t===void 0?16:_B(t.type)),t):1}function Qa(t,e,n,r){if(50<bv)throw bv=0,JT=null,Error(ne(185));g0(t,n,r),(!(ut&2)||t!==dr)&&(t===dr&&(!(ut&2)&&(Q_|=n),Qn===4&&Wc(t,Tr)),Ks(t,r),n===1&&ut===0&&!(e.mode&1)&&(by=jn()+500,K_&&Td()))}function Ks(t,e){var n=t.callbackNode;AK(t,e);var r=cS(t,t===dr?Tr:0);if(r===0)n!==null&&tM(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&tM(n),e===1)t.tag===0?CY(GM.bind(null,t)):VB(GM.bind(null,t)),kY(function(){!(ut&6)&&Td()}),n=null;else{switch(xB(r)){case 1:n=wP;break;case 4:n=mB;break;case 16:n=lS;break;case 536870912:n=gB;break;default:n=lS}n=U$(n,D$.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function D$(t,e){if(ik=-1,ak=0,ut&6)throw Error(ne(327));var n=t.callbackNode;if(vm()&&t.callbackNode!==n)return null;var r=cS(t,t===dr?Tr:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=AS(t,r);else{e=r;var s=ut;ut|=2;var i=O$();(dr!==t||Tr!==e)&&(gl=null,by=jn()+500,Lf(t,e));do try{GY();break}catch(o){M$(t,o)}while(!0);DP(),_S.current=i,ut=s,Un!==null?e=0:(dr=null,Tr=0,e=Qn)}if(e!==0){if(e===2&&(s=CT(t),s!==0&&(r=s,e=ej(t,s))),e===1)throw n=Jv,Lf(t,0),Wc(t,r),Ks(t,jn()),n;if(e===6)Wc(t,r);else{if(s=t.current.alternate,!(r&30)&&!HY(s)&&(e=AS(t,r),e===2&&(i=CT(t),i!==0&&(r=i,e=ej(t,i))),e===1))throw n=Jv,Lf(t,0),Wc(t,r),Ks(t,jn()),n;switch(t.finishedWork=s,t.finishedLanes=r,e){case 0:case 1:throw Error(ne(345));case 2:Xd(t,zs,gl);break;case 3:if(Wc(t,r),(r&130023424)===r&&(e=YP+500-jn(),10<e)){if(cS(t,0)!==0)break;if(s=t.suspendedLanes,(s&r)!==r){gs(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=DT(Xd.bind(null,t,zs,gl),e);break}Xd(t,zs,gl);break;case 4:if(Wc(t,r),(r&4194240)===r)break;for(e=t.eventTimes,s=-1;0<r;){var a=31-Za(r);i=1<<a,a=e[a],a>s&&(s=a),r&=~i}if(r=s,r=jn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*WY(r/1960))-r,10<r){t.timeoutHandle=DT(Xd.bind(null,t,zs,gl),r);break}Xd(t,zs,gl);break;case 5:Xd(t,zs,gl);break;default:throw Error(ne(329))}}}return Ks(t,jn()),t.callbackNode===n?D$.bind(null,t):null}function ej(t,e){var n=vv;return t.current.memoizedState.isDehydrated&&(Lf(t,e).flags|=256),t=AS(t,e),t!==2&&(e=zs,zs=n,e!==null&&tj(e)),t}function tj(t){zs===null?zs=t:zs.push.apply(zs,t)}function HY(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 s=n[r],i=s.getSnapshot;s=s.value;try{if(!to(i(),s))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 Wc(t,e){for(e&=~KP,e&=~Q_,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Za(e),r=1<<n;t[n]=-1,e&=~r}}function GM(t){if(ut&6)throw Error(ne(327));vm();var e=cS(t,0);if(!(e&1))return Ks(t,jn()),null;var n=AS(t,e);if(t.tag!==0&&n===2){var r=CT(t);r!==0&&(e=r,n=ej(t,r))}if(n===1)throw n=Jv,Lf(t,0),Wc(t,e),Ks(t,jn()),n;if(n===6)throw Error(ne(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Xd(t,zs,gl),Ks(t,jn()),null}function XP(t,e){var n=ut;ut|=1;try{return t(e)}finally{ut=n,ut===0&&(by=jn()+500,K_&&Td())}}function qf(t){qu!==null&&qu.tag===0&&!(ut&6)&&vm();var e=ut;ut|=1;var n=ua.transition,r=_t;try{if(ua.transition=null,_t=1,t)return t()}finally{_t=r,ua.transition=n,ut=e,!(ut&6)&&Td()}}function ZP(){ki=nm.current,Qt(nm)}function Lf(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,wY(n)),Un!==null)for(n=Un.return;n!==null;){var r=n;switch(PP(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pS();break;case 3:xy(),Qt(qs),Qt(Zr),$P();break;case 5:BP(r);break;case 4:xy();break;case 13:Qt(on);break;case 19:Qt(on);break;case 10:MP(r.type._context);break;case 22:case 23:ZP()}n=n.return}if(dr=t,Un=t=rd(t.current,null),Tr=ki=e,Qn=0,Jv=null,KP=Q_=Hf=0,zs=vv=null,dh!==null){for(e=0;e<dh.length;e++)if(n=dh[e],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=s,r.next=a}n.pending=r}dh=null}return t}function M$(t,e){do{var n=Un;try{if(DP(),nk.current=SS,kS){for(var r=dn.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}kS=!1}if(Wf=0,ur=Zn=dn=null,yv=!1,Xv=0,GP.current=null,n===null||n.return===null){Qn=1,Jv=e,Un=null;break}e:{var i=t,a=n.return,o=n,l=e;if(e=Tr,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=o,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=DM(a);if(m!==null){m.flags&=-257,MM(m,a,o,i,e),m.mode&1&&IM(i,u,e),e=m,l=u;var y=e.updateQueue;if(y===null){var g=new Set;g.add(l),e.updateQueue=g}else y.add(l);break e}else{if(!(e&1)){IM(i,u,e),QP();break e}l=Error(ne(426))}}else if(nn&&o.mode&1){var b=DM(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),MM(b,a,o,i,e),RP(vy(l,o));break e}}i=l=vy(l,o),Qn!==4&&(Qn=2),vv===null?vv=[i]:vv.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var x=x$(i,l,e);AM(i,x);break e;case 1:o=l;var w=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(td===null||!td.has(v)))){i.flags|=65536,e&=-e,i.lanes|=e;var S=v$(i,o,e);AM(i,S);break e}}i=i.return}while(i!==null)}F$(n)}catch(E){e=E,Un===n&&n!==null&&(Un=n=n.return);continue}break}while(!0)}function O$(){var t=_S.current;return _S.current=SS,t===null?SS:t}function QP(){(Qn===0||Qn===3||Qn===2)&&(Qn=4),dr===null||!(Hf&268435455)&&!(Q_&268435455)||Wc(dr,Tr)}function AS(t,e){var n=ut;ut|=2;var r=O$();(dr!==t||Tr!==e)&&(gl=null,Lf(t,e));do try{qY();break}catch(s){M$(t,s)}while(!0);if(DP(),ut=n,_S.current=r,Un!==null)throw Error(ne(261));return dr=null,Tr=0,Qn}function qY(){for(;Un!==null;)L$(Un)}function GY(){for(;Un!==null&&!xK();)L$(Un)}function L$(t){var e=$$(t.alternate,t,ki);t.memoizedProps=t.pendingProps,e===null?F$(t):Un=e,GP.current=null}function F$(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=$Y(n,e),n!==null){n.flags&=32767,Un=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Qn=6,Un=null;return}}else if(n=BY(n,e,ki),n!==null){Un=n;return}if(e=e.sibling,e!==null){Un=e;return}Un=e=t}while(e!==null);Qn===0&&(Qn=5)}function Xd(t,e,n){var r=_t,s=ua.transition;try{ua.transition=null,_t=1,KY(t,e,n,r)}finally{ua.transition=s,_t=r}return null}function KY(t,e,n,r){do vm();while(qu!==null);if(ut&6)throw Error(ne(327));n=t.finishedWork;var s=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(ne(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(TK(t,i),t===dr&&(Un=dr=null,Tr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||u1||(u1=!0,U$(lS,function(){return vm(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ua.transition,ua.transition=null;var a=_t;_t=1;var o=ut;ut|=4,GP.current=null,zY(t,n),R$(n,t),pY(RT),uS=!!PT,RT=PT=null,t.current=n,VY(n),vK(),ut=o,_t=a,ua.transition=i}else t.current=n;if(u1&&(u1=!1,qu=t,CS=s),i=t.pendingLanes,i===0&&(td=null),kK(n.stateNode),Ks(t,jn()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)s=e[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(ES)throw ES=!1,t=QT,QT=null,t;return CS&1&&t.tag!==0&&vm(),i=t.pendingLanes,i&1?t===JT?bv++:(bv=0,JT=t):bv=0,Td(),null}function vm(){if(qu!==null){var t=xB(CS),e=ua.transition,n=_t;try{if(ua.transition=null,_t=16>t?16:t,qu===null)var r=!1;else{if(t=qu,qu=null,CS=0,ut&6)throw Error(ne(331));var s=ut;for(ut|=4,me=t.current;me!==null;){var i=me,a=i.child;if(me.flags&16){var o=i.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(me=u;me!==null;){var d=me;switch(d.tag){case 0:case 11:case 15:xv(8,d,i)}var f=d.child;if(f!==null)f.return=d,me=f;else for(;me!==null;){d=me;var p=d.sibling,m=d.return;if(j$(d),d===u){me=null;break}if(p!==null){p.return=m,me=p;break}me=m}}}var y=i.alternate;if(y!==null){var g=y.child;if(g!==null){y.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}me=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,me=a;else e:for(;me!==null;){if(i=me,i.flags&2048)switch(i.tag){case 0:case 11:case 15:xv(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,me=x;break e}me=i.return}}var w=t.current;for(me=w;me!==null;){a=me;var v=a.child;if(a.subtreeFlags&2064&&v!==null)v.return=a,me=v;else e:for(a=w;me!==null;){if(o=me,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Z_(9,o)}}catch(E){Sn(o,o.return,E)}if(o===a){me=null;break e}var S=o.sibling;if(S!==null){S.return=o.return,me=S;break e}me=o.return}}if(ut=s,Td(),Xo&&typeof Xo.onPostCommitFiberRoot=="function")try{Xo.onPostCommitFiberRoot(V_,t)}catch{}r=!0}return r}finally{_t=n,ua.transition=e}}return!1}function KM(t,e,n){e=vy(n,e),e=x$(t,e,1),t=ed(t,e,1),e=gs(),t!==null&&(g0(t,1,e),Ks(t,e))}function Sn(t,e,n){if(t.tag===3)KM(t,t,n);else for(;e!==null;){if(e.tag===3){KM(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(td===null||!td.has(r))){t=vy(n,t),t=v$(e,t,1),e=ed(e,t,1),t=gs(),e!==null&&(g0(e,1,t),Ks(e,t));break}}e=e.return}}function YY(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=gs(),t.pingedLanes|=t.suspendedLanes&n,dr===t&&(Tr&n)===n&&(Qn===4||Qn===3&&(Tr&130023424)===Tr&&500>jn()-YP?Lf(t,0):KP|=n),Ks(t,e)}function B$(t,e){e===0&&(t.mode&1?(e=e1,e1<<=1,!(e1&130023424)&&(e1=4194304)):e=1);var n=gs();t=uc(t,e),t!==null&&(g0(t,e,n),Ks(t,n))}function XY(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),B$(t,n)}function ZY(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ne(314))}r!==null&&r.delete(e),B$(t,n)}var $$;$$=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||qs.current)Hs=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Hs=!1,FY(t,e,n);Hs=!!(t.flags&131072)}else Hs=!1,nn&&e.flags&1048576&&WB(e,yS,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;sk(t,e),t=e.pendingProps;var s=my(e,Zr.current);xm(e,n),s=zP(null,e,r,t,s,n);var i=VP();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Gs(r)?(i=!0,mS(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,LP(e),s.updater=X_,e.stateNode=s,s._reactInternals=e,UT(e,r,t,n),e=WT(null,e,r,!0,i,n)):(e.tag=0,nn&&i&&NP(e),cs(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(sk(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=JY(r),t=Na(r,t),s){case 0:e=VT(null,e,r,t,n);break e;case 1:e=FM(null,e,r,t,n);break e;case 11:e=OM(null,e,r,t,n);break e;case 14:e=LM(null,e,r,Na(r.type,t),n);break e}throw Error(ne(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Na(r,s),VT(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Na(r,s),FM(t,e,r,s,n);case 3:e:{if(S$(e),t===null)throw Error(ne(387));r=e.pendingProps,i=e.memoizedState,s=i.element,XB(t,e),bS(e,r,null,n);var a=e.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=vy(Error(ne(423)),e),e=BM(t,e,r,n,s);break e}else if(r!==s){s=vy(Error(ne(424)),e),e=BM(t,e,r,n,s);break e}else for(Ci=Ju(e.stateNode.containerInfo.firstChild),Ai=e,nn=!0,Ka=null,n=KB(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gy(),r===s){e=dc(t,e,n);break e}cs(t,e,r,n)}e=e.child}return e;case 5:return ZB(e),t===null&&FT(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,a=s.children,IT(r,s)?a=null:i!==null&&IT(r,i)&&(e.flags|=32),k$(t,e),cs(t,e,a,n),e.child;case 6:return t===null&&FT(e),null;case 13:return _$(t,e,n);case 4:return FP(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=yy(e,null,r,n):cs(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Na(r,s),OM(t,e,r,s,n);case 7:return cs(t,e,e.pendingProps,n),e.child;case 8:return cs(t,e,e.pendingProps.children,n),e.child;case 12:return cs(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,a=s.value,Ht(xS,r._currentValue),r._currentValue=a,i!==null)if(to(i.value,a)){if(i.children===s.children&&!qs.current){e=dc(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=sc(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),BT(i.return,n,e),o.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(ne(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),BT(a,n,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}cs(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,xm(e,n),s=pa(s),r=r(s),e.flags|=1,cs(t,e,r,n),e.child;case 14:return r=e.type,s=Na(r,e.pendingProps),s=Na(r.type,s),LM(t,e,r,s,n);
vendor: 6,060 bytes, line 40
40case 15:return b$(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Na(r,s),sk(t,e),e.tag=1,Gs(r)?(t=!0,mS(e)):t=!1,xm(e,n),y$(e,r,s),UT(e,r,s,n),WT(null,e,r,!0,t,n);case 19:return E$(t,e,n);case 22:return w$(t,e,n)}throw Error(ne(156,e.tag))};function U$(t,e){return pB(t,e)}function QY(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 aa(t,e,n,r){return new QY(t,e,n,r)}function JP(t){return t=t.prototype,!(!t||!t.isReactComponent)}function JY(t){if(typeof t=="function")return JP(t)?1:0;if(t!=null){if(t=t.$$typeof,t===xP)return 11;if(t===vP)return 14}return 2}function rd(t,e){var n=t.alternate;return n===null?(n=aa(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 ok(t,e,n,r,s,i){var a=2;if(r=t,typeof t=="function")JP(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case qp:return Ff(n.children,s,i,e);case yP:a=8,s|=8;break;case dT:return t=aa(12,n,e,s|2),t.elementType=dT,t.lanes=i,t;case hT:return t=aa(13,n,e,s),t.elementType=hT,t.lanes=i,t;case fT:return t=aa(19,n,e,s),t.elementType=fT,t.lanes=i,t;case Z5:return J_(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Y5:a=10;break e;case X5:a=9;break e;case xP:a=11;break e;case vP:a=14;break e;case $c:a=16,r=null;break e}throw Error(ne(130,t==null?t:typeof t,""))}return e=aa(a,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Ff(t,e,n,r){return t=aa(7,t,r,e),t.lanes=n,t}function J_(t,e,n,r){return t=aa(22,t,r,e),t.elementType=Z5,t.lanes=n,t.stateNode={isHidden:!1},t}function PC(t,e,n){return t=aa(6,t,null,e),t.lanes=n,t}function RC(t,e,n){return e=aa(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function eX(t,e,n,r,s){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=hC(0),this.expirationTimes=hC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hC(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function eR(t,e,n,r,s,i,a,o,l){return t=new eX(t,e,n,o,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=aa(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},LP(i),t}function tX(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Hp,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function z$(t){if(!t)return ud;t=t._reactInternals;e:{if(sp(t)!==t||t.tag!==1)throw Error(ne(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Gs(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(ne(171))}if(t.tag===1){var n=t.type;if(Gs(n))return zB(t,n,e)}return e}function V$(t,e,n,r,s,i,a,o,l){return t=eR(n,r,!0,t,s,i,a,o,l),t.context=z$(null),n=t.current,r=gs(),s=nd(n),i=sc(r,s),i.callback=e??null,ed(n,i,s),t.current.lanes=s,g0(t,s,r),Ks(t,r),t}function eE(t,e,n,r){var s=e.current,i=gs(),a=nd(s);return n=z$(n),e.context===null?e.context=n:e.pendingContext=n,e=sc(i,a),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=ed(s,e,a),t!==null&&(Qa(t,s,a,i),tk(t,s,a)),a}function TS(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 YM(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function tR(t,e){YM(t,e),(t=t.alternate)&&YM(t,e)}function nX(){return null}var W$=typeof reportError=="function"?reportError:function(t){console.error(t)};function nR(t){this._internalRoot=t}tE.prototype.render=nR.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(ne(409));eE(t,e,null,null)};tE.prototype.unmount=nR.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;qf(function(){eE(null,t,null,null)}),e[cc]=null}};function tE(t){this._internalRoot=t}tE.prototype.unstable_scheduleHydration=function(t){if(t){var e=wB();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Vc.length&&e!==0&&e<Vc[n].priority;n++);Vc.splice(n,0,t),n===0&&SB(t)}};function rR(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function nE(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function XM(){}function rX(t,e,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=TS(a);i.call(u)}}var a=V$(e,r,t,0,null,!1,!1,"",XM);return t._reactRootContainer=a,t[cc]=a.current,Hv(t.nodeType===8?t.parentNode:t),qf(),a}for(;s=t.lastChild;)t.removeChild(s);if(typeof r=="function"){var o=r;r=function(){var u=TS(l);o.call(u)}}var l=eR(t,0,!1,null,null,!1,!1,"",XM);return t._reactRootContainer=l,t[cc]=l.current,Hv(t.nodeType===8?t.parentNode:t),qf(function(){eE(e,l,n,r)}),l}function rE(t,e,n,r,s){var i=n._reactRootContainer;if(i){var a=i;if(typeof s=="function"){var o=s;
vendor: 4,811 bytes, line 40
40s=function(){var l=TS(a);o.call(l)}}eE(e,a,t,s)}else a=rX(n,e,t,s,r);return TS(a)}vB=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Fx(e.pendingLanes);n!==0&&(kP(e,n|1),Ks(e,jn()),!(ut&6)&&(by=jn()+500,Td()))}break;case 13:qf(function(){var r=uc(t,1);if(r!==null){var s=gs();Qa(r,t,1,s)}}),tR(t,1)}};SP=function(t){if(t.tag===13){var e=uc(t,134217728);if(e!==null){var n=gs();Qa(e,t,134217728,n)}tR(t,134217728)}};bB=function(t){if(t.tag===13){var e=nd(t),n=uc(t,e);if(n!==null){var r=gs();Qa(n,t,e,r)}tR(t,e)}};wB=function(){return _t};kB=function(t,e){var n=_t;try{return _t=t,e()}finally{_t=n}};ST=function(t,e,n){switch(e){case"input":if(gT(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 s=G_(r);if(!s)throw Error(ne(90));J5(r),gT(r,s)}}}break;case"textarea":tB(t,n);break;case"select":e=n.value,e!=null&&pm(t,!!n.multiple,e,!1)}};lB=XP;cB=qf;var sX={usingClientEntryPoint:!1,Events:[x0,Xp,G_,aB,oB,XP]},px={findFiberByHostInstance:uh,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},iX={bundleType:px.bundleType,version:px.version,rendererPackageName:px.rendererPackageName,rendererConfig:px.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_c.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=hB(t),t===null?null:t.stateNode},findFiberByHostInstance:px.findFiberByHostInstance||nX,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var d1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!d1.isDisabled&&d1.supportsFiber)try{V_=d1.inject(iX),Xo=d1}catch{}}Di.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sX;Di.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!rR(e))throw Error(ne(200));return tX(t,e,null,n)};Di.createRoot=function(t,e){if(!rR(t))throw Error(ne(299));var n=!1,r="",s=W$;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=eR(t,1,!1,null,null,n,!1,r,s),t[cc]=e.current,Hv(t.nodeType===8?t.parentNode:t),new nR(e)};Di.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(ne(188)):(t=Object.keys(t).join(","),Error(ne(268,t)));return t=hB(e),t=t===null?null:t.stateNode,t};Di.flushSync=function(t){return qf(t)};Di.hydrate=function(t,e,n){if(!nE(e))throw Error(ne(200));return rE(null,t,e,!0,n)};Di.hydrateRoot=function(t,e,n){if(!rR(t))throw Error(ne(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",a=W$;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),e=V$(e,null,t,1,n??null,s,!1,i,a),t[cc]=e.current,Hv(t),r)for(t=0;t<r.length;t++)n=r[t],s=n._getVersion,s=s(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,s]:e.mutableSourceEagerHydrationData.push(n,s);return new tE(e)};Di.render=function(t,e,n){if(!nE(e))throw Error(ne(200));return rE(null,t,e,!1,n)};Di.unmountComponentAtNode=function(t){if(!nE(t))throw Error(ne(40));return t._reactRootContainer?(qf(function(){rE(null,null,t,!1,function(){t._reactRootContainer=null,t[cc]=null})}),!0):!1};Di.unstable_batchedUpdates=XP;Di.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!nE(n))throw Error(ne(200));if(t==null||t._reactInternals===void 0)throw Error(ne(38));return rE(t,e,n,!1,r)};Di.version="18.3.1-next-f1338f8080-20240426";function H$(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(H$)}catch(t){console.error(t)}}H$(),H5.exports=Di;var ip=H5.exports;const q$=Sc(ip);var G$,ZM=ip;G$=ZM.createRoot,ZM.hydrateRoot;const aX=1,oX=1e6;let IC=0;function lX(){return IC=(IC+1)%Number.MAX_SAFE_INTEGER,IC.toString()}const DC=new Map,QM=t=>{if(DC.has(t))return;const e=setTimeout(()=>{DC.delete(t),wv({type:"REMOVE_TOAST",toastId:t})},oX);DC.set(t,e)},cX=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,aX)};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;
40return n?QM(n):t.toasts.forEach(r=>{QM(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)}}},lk=[];let ck={toasts:[]};function wv(t){ck=cX(ck,t),lk.forEach(e=>{e(ck)})}function uX({...t}){const e=lX(),n=s=>wv({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>wv({type:"DISMISS_TOAST",toastId:e});return wv({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function dX(){const[t,e]=k.useState(ck);return k.useEffect(()=>(lk.push(e),()=>{const n=lk.indexOf(e);n>-1&&lk.splice(n,1)}),[t]),{...t,toast:uX,dismiss:n=>wv({type:"DISMISS_TOAST",toastId:n})}}function Ce(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function JM(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function K$(...t){return e=>{let n=!1;const r=t.map(s=>{const i=JM(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():JM(t[s],null)}}}}function bt(...t){return k.useCallback(K$(...t),t)}function hX(t,e){const n=k.createContext(e),r=i=>{const{children:a,...o}=i,l=k.useMemo(()=>o,Object.values(o));return c.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function s(i){const a=k.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function il(t,e=[]){let n=[];function r(i,a){const o=k.createContext(a),l=n.length;n=[...n,a];const u=f=>{var x;const{scope:p,children:m,...y}=f,g=((x=p==null?void 0:p[t])==null?void 0:x[l])||o,b=k.useMemo(()=>y,Object.values(y));return c.jsx(g.Provider,{value:b,children:m})};u.displayName=i+"Provider";function d(f,p){var g;const m=((g=p==null?void 0:p[t])==null?void 0:g[l])||o,y=k.useContext(m);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const s=()=>{const i=n.map(a=>k.createContext(a));return function(o){const l=(o==null?void 0:o[t])||i;return k.useMemo(()=>({[`__scope${t}`]:{...o,[t]:l}}),[o,l])}};return s.scopeName=t,[r,fX(s,...e)]}function fX(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((o,{useScope:l,scopeName:u})=>{const f=l(i)[`__scope${u}`];return{...o,...f}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function wy(t){const e=mX(t),n=k.forwardRef((r,s)=>{const{children:i,...a}=r,o=k.Children.toArray(i),l=o.find(yX);if(l){const u=l.props.children,d=o.map(f=>f===l?k.Children.count(u)>1?k.Children.only(null):k.isValidElement(u)?u.props.children:null:f);return c.jsx(e,{...a,ref:s,children:k.isValidElement(u)?k.cloneElement(u,void 0,d):null})}return c.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}var pX=wy("Slot");function mX(t){const e=k.forwardRef((n,r)=>{const{children:s,...i}=n;if(k.isValidElement(s)){const a=vX(s),o=xX(i,s.props);return s.type!==k.Fragment&&(o.ref=r?K$(r,a):a),k.cloneElement(s,o)}return k.Children.count(s)>1?k.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Y$=Symbol("radix.slottable");function gX(t){const e=({children:n})=>c.jsx(c.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=Y$,e}function yX(t){return k.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Y$}function xX(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...o)=>{const l=i(...o);return s(...o),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function vX(t){var r,s;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=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.
vendor: 10,431 bytes, line 40
40isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function sR(t){const e=t+"CollectionProvider",[n,r]=il(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:b,children:x}=g,w=K.useRef(null),v=K.useRef(new Map).current;return c.jsx(s,{scope:b,itemMap:v,collectionRef:w,children:x})};a.displayName=e;const o=t+"CollectionSlot",l=wy(o),u=K.forwardRef((g,b)=>{const{scope:x,children:w}=g,v=i(o,x),S=bt(b,v.collectionRef);return c.jsx(l,{ref:S,children:w})});u.displayName=o;const d=t+"CollectionItemSlot",f="data-radix-collection-item",p=wy(d),m=K.forwardRef((g,b)=>{const{scope:x,children:w,...v}=g,S=K.useRef(null),E=bt(b,S),C=i(d,x);return K.useEffect(()=>(C.itemMap.set(S,{ref:S,...v}),()=>void C.itemMap.delete(S))),c.jsx(p,{[f]:"",ref:E,children:w})});m.displayName=d;function y(g){const b=i(t+"CollectionConsumer",g);return K.useCallback(()=>{const w=b.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((C,T)=>v.indexOf(C.ref.current)-v.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:u,ItemSlot:m},y,r]}var bX=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fe=bX.reduce((t,e)=>{const n=wy(`Primitive.${e}`),r=k.forwardRef((s,i)=>{const{asChild:a,...o}=s,l=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...o,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function X$(t,e){t&&ip.flushSync(()=>t.dispatchEvent(e))}function ga(t){const e=k.useRef(t);return k.useEffect(()=>{e.current=t}),k.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function wX(t,e=globalThis==null?void 0:globalThis.document){const n=ga(t);k.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var kX="DismissableLayer",nj="dismissableLayer.update",SX="dismissableLayer.pointerDownOutside",_X="dismissableLayer.focusOutside",eO,Z$=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),b0=k.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...l}=t,u=k.useContext(Z$),[d,f]=k.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=k.useState({}),y=bt(e,T=>f(T)),g=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(b),w=d?g.indexOf(d):-1,v=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=x,E=CX(T=>{const P=T.target,M=[...u.branches].some(R=>R.contains(P));!S||M||(s==null||s(T),a==null||a(T),T.defaultPrevented||o==null||o())},p),C=AX(T=>{const P=T.target;[...u.branches].some(R=>R.contains(P))||(i==null||i(T),a==null||a(T),T.defaultPrevented||o==null||o())},p);return wX(T=>{w===u.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&o&&(T.preventDefault(),o()))},p),k.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(eO=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),tO(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=eO)}},[d,p,n,u]),k.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),tO())},[d,u]),k.useEffect(()=>{const T=()=>m({});return document.addEventListener(nj,T),()=>document.removeEventListener(nj,T)},[]),c.jsx(Fe.div,{...l,ref:y,style:{pointerEvents:v?S?"auto":"none":void 0,...t.style},onFocusCapture:Ce(t.onFocusCapture,C.onFocusCapture),onBlurCapture:Ce(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ce(t.onPointerDownCapture,E.onPointerDownCapture)})});b0.displayName=kX;var EX="DismissableLayerBranch",Q$=k.forwardRef((t,e)=>{const n=k.useContext(Z$),r=k.useRef(null),s=bt(e,r);return k.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(Fe.div,{...t,ref:s})});Q$.displayName=EX;function CX(t,e=globalThis==null?void 0:globalThis.document){const n=ga(t),r=k.useRef(!1),s=k.useRef(()=>{});return k.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let l=function(){J$(SX,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function AX(t,e=globalThis==null?void 0:globalThis.document){const n=ga(t),r=k.useRef(!1);return k.useEffect(()=>{const s=i=>{i.target&&!r.current&&J$(_X,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tO(){const t=new CustomEvent(nj);document.dispatchEvent(t)}function J$(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?X$(s,i):s.dispatchEvent(i)}var TX=b0,jX=Q$,Nr=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},NX="Portal",sE=k.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=k.useState(!1);Nr(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?q$.createPortal(c.jsx(Fe.div,{...r,ref:e}),a):null});sE.displayName=NX;function PX(t,e){return k.useReducer((n,r)=>e[n][r]??n,t)}var jd=t=>{const{present:e,children:n}=t,r=RX(e),s=typeof n=="function"?n({present:r.isPresent}):k.Children.only(n),i=bt(r.ref,IX(s));return typeof n=="function"||r.isPresent?k.cloneElement(s,{ref:i}):null};jd.displayName="Presence";function RX(t){const[e,n]=k.useState(),r=k.useRef(null),s=k.useRef(t),i=k.useRef("none"),a=t?"mounted":"unmounted",[o,l]=PX(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const u=h1(r.current);i.current=o==="mounted"?u:"none"},[o]),Nr(()=>{const u=r.current,d=s.current;if(d!==t){const p=i.current,m=h1(u);t?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),Nr(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,f=m=>{const g=h1(r.current).includes(m.animationName);if(m.target===e&&g&&(l("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},p=m=>{m.target===e&&(i.current=h1(r.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",f),e.addEventListener("animationend",f),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",f),e.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:k.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function h1(t){return(t==null?void 0:t.animationName)||"none"}function IX(t){var r,s;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=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var DX=fP[" useInsertionEffect ".trim().toString()]||Nr;function dd({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,a]=MX({defaultProp:e,onChange:n}),o=t!==void 0,l=o?t:s;{const d=k.useRef(t!==void 0);k.useEffect(()=>{const f=d.current;f!==o&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=o},[o,r])}const u=k.useCallback(d=>{var f;if(o){const p=OX(d)?d(t):d;p!==t&&((f=a.current)==null||f.call(a,p))}else i(d)},[o,t,i,a]);return[l,u]}function MX({defaultProp:t,onChange:e}){const[n,r]=k.useState(t),s=k.useRef(n),i=k.useRef(e);return DX(()=>{i.current=e},[e]),k.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}function OX(t){return typeof t=="function"}var eU=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),LX="VisuallyHidden",iE=k.forwardRef((t,e)=>c.jsx(Fe.span,{...t,ref:e,style:{...eU,...t.style}}));iE.displayName=LX;var FX=iE,iR="ToastProvider",[aR,BX,$X]=sR("Toast"),[tU,GCe]=il("Toast",[$X]),[UX,aE]=tU(iR),nU=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[o,l]=k.useState(null),[u,d]=k.useState(0),f=k.useRef(!1),p=k.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${iR}\`. Expected non-empty \`string\`.`),c.jsx(aR.Provider,{scope:e,children:c.jsx(UX,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:o,onViewportChange:l,onToastAdd:k.useCallback(()=>d(m=>m+1),[]),onToastRemove:k.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:a})})};nU.displayName=iR;var rU="ToastViewport",zX=["F8"],rj="toast.viewportPause",sj="toast.viewportResume",sU=k.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=zX,label:s="Notifications ({hotkey})",...i}=t,a=aE(rU,n),o=BX(n),l=k.useRef(null),u=k.useRef(null),d=k.useRef(null),f=k.useRef(null),p=bt(e,f,a.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;k.useEffect(()=>{const b=x=>{var v;r.length!==0&&r.every(S=>x[S]||x.code===S)&&((v=f.current)==null||v.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),k.useEffect(()=>{const b=l.current,x=f.current;if(y&&b&&x){const w=()=>
40{if(!a.isClosePausedRef.current){const C=new CustomEvent(rj);x.dispatchEvent(C),a.isClosePausedRef.current=!0}},v=()=>{if(a.isClosePausedRef.current){const C=new CustomEvent(sj);x.dispatchEvent(C),a.isClosePausedRef.current=!1}},S=C=>{!b.contains(C.relatedTarget)&&v()},E=()=>{b.contains(document.activeElement)||v()};return b.addEventListener("focusin",w),b.addEventListener("focusout",S),b.addEventListener("pointermove",w),b.addEventListener("pointerleave",E),window.addEventListener("blur",w),window.addEventListener("focus",v),()=>{b.removeEventListener("focusin",w),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",w),b.removeEventListener("pointerleave",E),window.removeEventListener("blur",w),window.removeEventListener("focus",v)}}},[y,a.isClosePausedRef]);const g=k.useCallback(({tabbingDirection:b})=>{const w=o().map(v=>{const S=v.ref.current,E=[S,...tZ(S)];return b==="forwards"?E:E.reverse()});return(b==="forwards"?w.reverse():w).flat()},[o]);return k.useEffect(()=>{const b=f.current;if(b){const x=w=>{var E,C,T;const v=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!v){const P=document.activeElement,M=w.shiftKey;if(w.target===b&&M){(E=u.current)==null||E.focus();return}const L=g({tabbingDirection:M?"backwards":"forwards"}),U=L.findIndex(B=>B===P);MC(L.slice(U+1))?w.preventDefault():M?(C=u.current)==null||C.focus():(T=d.current)==null||T.focus()}};return b.addEventListener("keydown",x),()=>b.removeEventListener("keydown",x)}},[o,g]),c.jsxs(jX,{ref:l,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&c.jsx(ij,{ref:u,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"forwards"});MC(b)}}),c.jsx(aR.Slot,{scope:n,children:c.jsx(Fe.ol,{tabIndex:-1,...i,ref:p})}),y&&c.jsx(ij,{ref:d,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"backwards"});MC(b)}})]})});sU.displayName=rU;var iU="ToastFocusProxy",ij=k.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=aE(iU,n);return c.jsx(iE,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{var u;const o=a.relatedTarget;!((u=i.viewport)!=null&&u.contains(o))&&r()}})});ij.displayName=iU;var w0="Toast",VX="toast.swipeStart",WX="toast.swipeMove",HX="toast.swipeCancel",qX="toast.swipeEnd",aU=k.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[o,l]=dd({prop:r,defaultProp:s??!0,onChange:i,caller:w0});return c.jsx(jd,{present:n||o,children:c.jsx(YX,{open:o,...a,ref:e,onClose:()=>l(!1),onPause:ga(t.onPause),onResume:ga(t.onResume),onSwipeStart:Ce(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ce(t.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Ce(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ce(t.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});aU.displayName=w0;var[GX,KX]=tU(w0,{onClose(){}}),YX=k.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:o,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...y}=t,g=aE(w0,n),[b,x]=k.useState(null),w=bt(e,B=>x(B)),v=k.useRef(null),S=k.useRef(null),E=s||g.duration,C=k.useRef(0),T=k.useRef(E),P=k.useRef(0),{onToastAdd:M,onToastRemove:R}=g,O=ga(()=>{var H;(b==null?void 0:b.contains(document.activeElement))&&((H=g.viewport)==null||H.focus()),a()}),L=k.useCallback(B=>
40{!B||B===1/0||(window.clearTimeout(P.current),C.current=new Date().getTime(),P.current=window.setTimeout(O,B))},[O]);k.useEffect(()=>{const B=g.viewport;if(B){const H=()=>{L(T.current),u==null||u()},z=()=>{const V=new Date().getTime()-C.current;T.current=T.current-V,window.clearTimeout(P.current),l==null||l()};return B.addEventListener(rj,z),B.addEventListener(sj,H),()=>{B.removeEventListener(rj,z),B.removeEventListener(sj,H)}}},[g.viewport,E,l,u,L]),k.useEffect(()=>{i&&!g.isClosePausedRef.current&&L(E)},[i,E,g.isClosePausedRef,L]),k.useEffect(()=>(M(),()=>R()),[M,R]);const U=k.useMemo(()=>b?fU(b):null,[b]);return g.viewport?c.jsxs(c.Fragment,{children:[U&&c.jsx(XX,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),c.jsx(GX,{scope:n,onClose:O,children:ip.createPortal(c.jsx(aR.ItemSlot,{scope:n,children:c.jsx(TX,{asChild:!0,onEscapeKeyDown:Ce(o,()=>{g.isFocusedToastEscapeKeyDownRef.current||O(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(Fe.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:w,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ce(t.onKeyDown,B=>{B.key==="Escape"&&(o==null||o(B.nativeEvent),B.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:Ce(t.onPointerDown,B=>{B.button===0&&(v.current={x:B.clientX,y:B.clientY})}),onPointerMove:Ce(t.onPointerMove,B=>{if(!v.current)return;const H=B.clientX-v.current.x,z=B.clientY-v.current.y,V=!!S.current,$=["left","right"].includes(g.swipeDirection),I=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,N=$?I(0,H):0,W=$?0:I(0,z),q=B.pointerType==="touch"?10:2,D={x:N,y:W},Q={originalEvent:B,delta:D};V?(S.current=D,f1(WX,f,Q,{discrete:!1})):nO(D,g.swipeDirection,q)?(S.current=D,f1(VX,d,Q,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(H)>q||Math.abs(z)>q)&&(v.current=null)}),onPointerUp:Ce(t.onPointerUp,B=>{const H=S.current,z=B.target;if(z.hasPointerCapture(B.pointerId)&&z.releasePointerCapture(B.pointerId),S.current=null,v.current=null,H){const V=B.currentTarget,$={originalEvent:B,delta:H};nO(H,g.swipeDirection,g.swipeThreshold)?f1(qX,m,$,{discrete:!0}):f1(HX,p,$,{discrete:!0}),V.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),XX=t=>{const{__scopeToast:e,children:n,...r}=t,s=aE(w0,e),[i,a]=k.useState(!1),[o,l]=k.useState(!1);return JX(()=>a(!0)),k.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:c.jsx(sE,{asChild:!0,children:c.jsx(iE,{...r,children:i&&c.jsxs(c.Fragment,{children:[s.label," ",n]})})})},ZX="ToastTitle",oU=k.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return c.jsx(Fe.div,{...r,ref:e})});oU.displayName=ZX;var QX="ToastDescription",lU=k.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return c.jsx(Fe.div,{...r,ref:e})});lU.displayName=QX;var cU="ToastAction",uU=k.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?c.jsx(hU,{altText:n,asChild:!0,children:c.jsx(oR,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${cU}\`. Expected non-empty \`string\`.`),null)});uU.displayName=cU;var dU="ToastClose",oR=k.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=KX(dU,n);return c.jsx(hU,{asChild:!0,children:c.jsx(Fe.button,{type:"button",...r,ref:e,onClick:Ce(t.onClick,s.onClose)})})});oR.displayName=dU;var hU=k.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return c.jsx(Fe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function fU(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),eZ(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...fU(r))}}),e}function f1(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?X$(s,i):s.dispatchEvent(i)}var nO=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function JX(t=()=>{}){const e=ga(t);Nr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function eZ(t){return t.nodeType===t.ELEMENT_NODE}function tZ(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function MC(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var nZ=nU,pU=sU,mU=aU,gU=oU,yU=lU,xU=uU,vU=oR;function bU(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=bU(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Vy(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=bU(t))&&(r&&(r+=" "),r+=e);return r}const rO=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,sO=Vy,oE=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return sO(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],f=i==null?void 0:i[u];if(d===null)return null;const p=rO(d)||rO(f);return s[u][p]}),o=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...m}=d;return Object.entries(m).every(y=>{let[g,b]=y;return Array.isArray(b)?b.includes({...i,...o}[g]):{...i,...o}[g]===b})?[...u,f,p]:u},[]);return sO(t,a,l,n==null?void 0:n.class,n==null?void 0:n.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const rZ=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wU=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var sZ={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"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const iZ=k.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>k.createElement("svg",{ref:l,...sZ,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:wU("lucide",s),...o},[...a.map(([u,d])=>k.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const ae=(t,e)=>{const n=k.forwardRef(({className:r,...s},i)=>k.createElement(iZ,{ref:i,iconNode:e,className:wU(`lucide-${rZ(t)}`,r),...s}));return n.displayName=`${t}`,n};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const kU=ae("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const lR=ae("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const Yr=ae("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const Jn=ae("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const aZ=ae("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const oZ=ae("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const iO=ae("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const lZ=ae("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const cR=ae("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
105],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const cZ=ae("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"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const k0=ae("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const lE=ae("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const oa=ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const SU=ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const uZ=ae("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const dZ=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const hZ=ae("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const jS=ae("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const fZ=ae("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const aO=ae("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const pZ=ae("Coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);/**
166 * @license lucide-react v0.462.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const mZ=ae("Cookie",[["path",{d:"M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5",key:"laymnq"}],["path",{d:"M8.5 8.5v.01",key:"ue8clq"}],["path",{d:"M16 15.5v.01",key:"14dtrp"}],["path",{d:"M12 12v.01",key:"u5ubse"}],["path",{d:"M11 17v.01",key:"1hyl5a"}],["path",{d:"M7 14v.01",key:"uct60s"}]]);/**
171 * @license lucide-react v0.462.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const gZ=ae("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}
175],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
176 * @license lucide-react v0.462.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const yZ=ae("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
181 * @license lucide-react v0.462.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const _U=ae("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
186 * @license lucide-react v0.462.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const S0=ae("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"}]]);/**
191 * @license lucide-react v0.462.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const EU=ae("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]]);/**
196 * @license lucide-react v0.462.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const CU=ae("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
201 * @license lucide-react v0.462.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const cE=ae("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"}]]);/**
206 * @license lucide-react v0.462.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const uR=ae("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"}]]);/**
211 * @license lucide-react v0.462.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const oO=ae("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
216 * @license lucide-react v0.462.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const AU=ae("Factory",[["path",{d:"M2 20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8l-7 5V8l-7 5V4a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"159hny"}],["path",{d:"M17 18h1",key:"uldtlt"}],["path",{d:"M12 18h1",key:"s9uhes"}],["path",{d:"M7 18h1",key:"1neino"}]]);/**
221 * @license lucide-react v0.462.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const xZ=ae("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]]);/**
226 * @license lucide-react v0.462.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const ky=ae("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/**
231 * @license lucide-react v0.462.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const ds=ae("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"}]]);/**
236 * @license lucide-react v0.462.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const TU=ae("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
241 * @license lucide-react v0.462.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const dR=ae("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
246 * @license lucide-react v0.462.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const vZ=ae("GitCompareArrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]);/**
251 * @license lucide-react v0.462.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const bZ=ae("GlassWater",[["path",{d:"M5.116 4.104A1 1 0 0 1 6.11 3h11.78a1 1 0 0 1 .994 1.105L17.19 20.21A2 2 
2550 0 1 15.2 22H8.8a2 2 0 0 1-2-1.79z",key:"p55z4y"}],["path",{d:"M6 12a5 5 0 0 1 6 0 5 5 0 0 0 6 0",key:"mjntcy"}]]);/**
256 * @license lucide-react v0.462.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const _0=ae("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
261 * @license lucide-react v0.462.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const wZ=ae("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
266 * @license lucide-react v0.462.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const kZ=ae("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
271 * @license lucide-react v0.462.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const jU=ae("Layers3",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m6.08 9.5-3.5 1.6a1 1 0 0 0 0 1.81l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9a1 1 0 0 0 0-1.83l-3.5-1.59",key:"1e5n1m"}],["path",{d:"m6.08 14.5-3.5 1.6a1 1 0 0 0 0 1.81l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9a1 1 0 0 0 0-1.83l-3.5-1.59",key:"1iwflc"}]]);/**
276 * @license lucide-react v0.462.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const SZ=ae("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
281 * @license lucide-react v0.462.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const lO=ae("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"}]]);/**
286 * @license lucide-react v0.462.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const hc=ae("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"}]]);/**
291 * @license lucide-react v0.462.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const ap=ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
296 * @license lucide-react v0.462.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const eb=ae("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"}]]);/**
301 * @license lucide-react v0.462.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const _Z=ae("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"}]]);/**
306 * @license lucide-react v0.462.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const fc=ae("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"}]]);/**
311 * @license lucide-react v0.462.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const NU=ae("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
316 * @license lucide-react v0.462.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const EZ=ae("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
321 * @license lucide-react v0.462.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const CZ=ae("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}
325],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/**
326 * @license lucide-react v0.462.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const E0=ae("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/**
331 * @license lucide-react v0.462.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const PU=ae("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
336 * @license lucide-react v0.462.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const AZ=ae("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
341 * @license lucide-react v0.462.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const hR=ae("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
346 * @license lucide-react v0.462.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const RU=ae("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
351 * @license lucide-react v0.462.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const Sy=ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
356 * @license lucide-react v0.462.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const TZ=ae("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
361 * @license lucide-react v0.462.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const jZ=ae("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/**
366 * @license lucide-react v0.462.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const IU=ae("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
371 * @license lucide-react v0.462.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const NZ=ae("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
376 * @license lucide-react v0.462.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const PZ=ae("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"}]]);/**
381 * @license lucide-react v0.462.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const DU=ae("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
386 * @license lucide-react v0.462.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const fR=ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
391 * @license lucide-react v0.462.0 - ISC
392 *
393 * This source code is licensed under the ISC license.
394 * See the LICENSE file in the root directory of this source tree.
395 */const RZ=ae("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
396 * @license lucide-react v0.462.0 - ISC
397 *
398 * This source code is licensed under the ISC license.
399 * See the LICENSE file in the root directory of this source tree.
400 */const cO=ae("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"}]]);/**
401 * @license lucide-react v0.462.0 - ISC
402 *
403 * This source code is licensed under the ISC license.
404 * See the LICENSE file in the root directory of this source tree.
405 */const pR=ae("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
405y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
406 * @license lucide-react v0.462.0 - ISC
407 *
408 * This source code is licensed under the ISC license.
409 * See the LICENSE file in the root directory of this source tree.
410 */const MU=ae("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/**
411 * @license lucide-react v0.462.0 - ISC
412 *
413 * This source code is licensed under the ISC license.
414 * See the LICENSE file in the root directory of this source tree.
415 */const mR=ae("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
416 * @license lucide-react v0.462.0 - ISC
417 *
418 * This source code is licensed under the ISC license.
419 * See the LICENSE file in the root directory of this source tree.
420 */const mx=ae("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"}]]);/**
421 * @license lucide-react v0.462.0 - ISC
422 *
423 * This source code is licensed under the ISC license.
424 * See the LICENSE file in the root directory of this source tree.
425 */const NS=ae("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
426 * @license lucide-react v0.462.0 - ISC
427 *
428 * This source code is licensed under the ISC license.
429 * See the LICENSE file in the root directory of this source tree.
430 */const IZ=ae("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/**
431 * @license lucide-react v0.462.0 - ISC
432 *
433 * This source code is licensed under the ISC license.
434 * See the LICENSE file in the root directory of this source tree.
435 */const OU=ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
436 * @license lucide-react v0.462.0 - ISC
437 *
438 * This source code is licensed under the ISC license.
439 * See the LICENSE file in the root directory of this source tree.
440 */const gR=ae("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"}]]);/**
441 * @license lucide-react v0.462.0 - ISC
442 *
443 * This source code is licensed under the ISC license.
444 * See the LICENSE file in the root directory of this source tree.
445 */const DZ=ae("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/**
446 * @license lucide-react v0.462.0 - ISC
447 *
448 * This source code is licensed under the ISC license.
449 * See the LICENSE file in the root directory of this source tree.
450 */const yR=ae("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"}]]);/**
451 * @license lucide-react v0.462.0 - ISC
452 *
453 * This source code is licensed under the ISC license.
454 * See the LICENSE file in the root directory of this source tree.
455 */const _y=ae("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"}]]);/**
456 * @license lucide-react v0.462.0 - ISC
457 *
458 * This source code is licensed under the ISC license.
459 * See the LICENSE file in the root directory of this source tree.
460 */const LU=ae("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
461 * @license lucide-react v0.462.0 - ISC
462 *
463 * This source code is licensed under the ISC license.
464 * See the LICENSE file in the root directory of this source tree.
465 */const MZ=ae("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
466 * @license lucide-react v0.462.0 - ISC
467 *
468 * This source code is licensed under the ISC license.
469 * See the LICENSE file in the root directory of this source tree.
470 */const OZ=ae("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
471 * @license lucide-react v0.462.0 - ISC
472 *
473 * This source code is licensed under the ISC license.
474 * See the LICENSE file in the root directory of this source tree.
475 */const LZ=ae("Waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]);/**
476 * @license lucide-react v0.462.0 - ISC
477 *
478 * This source code is licensed under the ISC license.
479 * See the LICENSE file in the root directory of this source tree.
480 */const FZ=ae("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
481 * @license lucide-react v0.462.0 - ISC
482 *
483 * This source code is licensed under the ISC license.
484 * See the LICENSE file in the root directory of this source tree.
485 */const C0=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 5,859 bytes, line 485
485],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),xR="-",BZ=t=>{const e=UZ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const o=a.split(xR);return o[0]===""&&o.length!==1&&o.shift(),FU(o,e)||$Z(a)},getConflictingClassGroupIds:(a,o)=>{const l=n[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},FU=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?FU(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(xR);return(a=e.validators.find(({validator:o})=>o(i)))==null?void 0:a.classGroupId},uO=/^\[(.+)\]$/,$Z=t=>{if(uO.test(t)){const e=uO.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},UZ=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return VZ(Object.entries(t.classGroups),n).forEach(([i,a])=>{aj(a,r,i,e)}),r},aj=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:dO(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(zZ(s)){aj(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,a])=>{aj(a,dO(e,i),n,r)})})},dO=(t,e)=>{let n=t;return e.split(xR).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},zZ=t=>t.isThemeGetter,VZ=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,o])=>[e+a,o])):i);return[n,s]}):t,WZ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,a)=>{n.set(i,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return s(i,a),a},set(i,a){n.has(i)?n.set(i,a):s(i,a)}}},BU="!",HZ=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,a=o=>{const l=[];let u=0,d=0,f;for(let b=0;b<o.length;b++){let x=o[b];if(u===0){if(x===s&&(r||o.slice(b,b+i)===e)){l.push(o.slice(d,b)),d=b+i;continue}if(x==="/"){f=b;continue}}x==="["?u++:x==="]"&&u--}const p=l.length===0?o:o.substring(d),m=p.startsWith(BU),y=m?p.substring(1):p,g=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:g}};return n?o=>n({className:o,parseClassName:a}):a},qZ=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},GZ=t=>({cache:WZ(t.cacheSize),parseClassName:HZ(t),...BZ(t)}),KZ=/\s+/,YZ=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],a=t.trim().split(KZ);let o="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(u);let y=!!m,g=r(y?p.substring(0,m):p);if(!g){if(!y){o=u+(o.length>0?" "+o:o);continue}if(g=r(p),!g){o=u+(o.length>0?" "+o:o);continue}y=!1}const b=qZ(d).join(":"),x=f?b+BU:b,w=x+g;if(i.includes(w))continue;i.push(w);const v=s(g,y);for(let S=0;S<v.length;++S){const E=v[S];i.push(x+E)}o=u+(o.length>0?" "+o:o)}return o};function XZ(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=$U(e))&&(r&&(r+=" "),r+=n);return r}const $U=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=$U(t[r]))&&(n&&(n+=" "),n+=e);return n};function ZZ(t,...e){let n,r,s,i=a;function a(l){const u=e.reduce((d,f)=>f(d),t());return n=GZ(u),r=n.cache.get,s=n.cache.set,i=o,o(l)}function o(l){const u=r(l);if(u)return u;const d=YZ(l,n);return s(l,d),d}return function(){return i(XZ.apply(null,arguments))}}const Yt=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},UU=/^\[(?:([a-z-]+):)?(.+)\]$/i,QZ=/^\d+\/\d+$/,JZ=new Set(["px","full","screen"]),eQ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tQ=/\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$/,nQ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,rQ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sQ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dl=t=>bm(t)||JZ.has(t)||QZ.test(t),jc=t=>Wy(t,"length",hQ),bm=t=>!!t&&!Number.isNaN(Number(t)),OC=t=>Wy(t,"number",bm),gx=t=>!!t&&Number.isInteger(Number(t)),iQ=t=>t.endsWith("%")&&bm(t.slice(0,-1)),Ye=t=>UU.test(t),Nc=t=>eQ.test(t),aQ=new Set(["length","size","percentage"]),oQ=t=>Wy(t,aQ,zU),lQ=t=>Wy(t,"position",zU),cQ=new Set(["image","url"]),uQ=t=>Wy(t,cQ,pQ),dQ=t=>Wy(t,"",fQ),yx=()=>!0,Wy=(t,e,n)=>{const r=UU.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},hQ=t=>tQ.test(t)&&!nQ.test(t),zU=()=>!1,fQ=t=>rQ.test(t),pQ=t=>sQ.test(t),mQ=()=>{const t=Yt("colors"),e=Yt("spacing"),n=Yt("blur"),r=Yt("brightness"),s=Yt("borderColor"),i=Yt("borderRadius"),a=Yt("borderSpacing"),o=Yt("borderWidth"),l=Yt("contrast"),u=Yt("grayscale"),d=Yt("hueRotate"),f=Yt("invert"),p=Yt("gap"),m=Yt("gradientColorStops"),y=Yt("gradientColorStopPositions"),g=Yt("inset"),b=Yt("margin"),x=Yt("opacity"),w=Yt("padding"),v=Yt("saturate"),S=Yt("scale"),E=Yt("sepia"),C=Yt("skew"),T=Yt("space"),P=Yt("translate"),M=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Ye,e],L=()=>[Ye,e],U=()=>["",dl,jc],B=()=>["auto",bm,Ye],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",Ye],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],W=()=>[bm,Ye];return{cacheSize:500,separator:":",theme:{colors:[yx],spacing:[dl,jc],blur:["none","",
vendor: 11,577 bytes, line 485
485Nc,Ye],brightness:W(),borderColor:[t],borderRadius:["none","","full",Nc,Ye],borderSpacing:L(),borderWidth:U(),contrast:W(),grayscale:I(),hueRotate:W(),invert:I(),gap:L(),gradientColorStops:[t],gradientColorStopPositions:[iQ,jc],inset:O(),margin:O(),opacity:W(),padding:L(),saturate:W(),scale:W(),sepia:I(),skew:W(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[Nc]}],"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:[...H(),Ye]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gx,Ye]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",gx,Ye]}],"grid-cols":[{"grid-cols":[yx]}],"col-start-end":[{col:["auto",{span:["full",gx,Ye]},Ye]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[yx]}],"row-start-end":[{row:["auto",{span:[gx,Ye]},Ye]}],"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",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"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:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ye,e]}],"min-w":[{"min-w":[Ye,e,"min","max","fit"]}],"max-w":[{"max-w":[Ye,e,"none","full","min","max","fit","prose",{screen:[Nc]},Nc]}],h:[{h:[Ye,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Nc,jc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",OC]}],"font-family":[{font:[yx]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",bm,OC]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",dl,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",dl,jc]}],"underline-offset":[{"underline-offset":["auto",dl,Ye]}],"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:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],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",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),lQ]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",oQ]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},uQ]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...z(),"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":[x]}],"divide-style":[{divide:z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[dl,Ye]}],"outline-w":[{outline:[dl,jc]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[dl,jc]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Nc,dQ]}],"shadow-color":[{shadow:[yx]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Nc,Ye]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[v]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"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",Ye]}],duration:[{duration:W()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:W()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[gx,Ye]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"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",Ye]}],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",Ye]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,647 bytes, line 485
485],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",Ye]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[dl,jc,OC]}],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-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},gQ=ZZ(mQ);function Oe(...t){return gQ(Vy(t))}const yQ=nZ,VU=k.forwardRef(({className:t,...e},n)=>c.jsx(pU,{ref:n,className:Oe("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}));VU.displayName=pU.displayName;const xQ=oE("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"}}),WU=k.forwardRef(({className:t,variant:e,...n},r)=>c.jsx(mU,{ref:r,className:Oe(xQ({variant:e}),t),...n}));WU.displayName=mU.displayName;const vQ=k.forwardRef(({className:t,...e},n)=>c.jsx(xU,{ref:n,className:Oe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));vQ.displayName=xU.displayName;const HU=k.forwardRef(({className:t,...e},n)=>c.jsx(vU,{ref:n,className:Oe("absolute right-2 top-2 rounded-md p-1 text-foreground
485/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:c.jsx(C0,{className:"h-4 w-4"})}));HU.displayName=vU.displayName;const qU=k.forwardRef(({className:t,...e},n)=>c.jsx(gU,{ref:n,className:Oe("text-sm font-semibold",t),...e}));qU.displayName=gU.displayName;const GU=k.forwardRef(({className:t,...e},n)=>c.jsx(yU,{ref:n,className:Oe("text-sm opacity-90",t),...e}));GU.displayName=yU.displayName;function bQ(){const{toasts:t}=dX();return c.jsxs(yQ,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return c.jsxs(WU,{...i,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(qU,{children:n}),r&&c.jsx(GU,{children:r})]}),s,c.jsx(HU,{})]},e)}),c.jsx(VU,{})]})}var hO=["light","dark"],wQ="(prefers-color-scheme: dark)",kQ=k.createContext(void 0),SQ={setTheme:t=>{},themes:[]},_Q=()=>{var t;return(t=k.useContext(kQ))!=null?t:SQ};k.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:a,attrs:o,nonce:l})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?hO.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(y,g=!1,b=!0)=>{let x=a?a[y]:y,w=g?y+"|| ''":`'${x}'`,v="";return s&&b&&!g&&hO.includes(y)&&(v+=`d.style.colorScheme = '${y}';`),n==="class"?g||x?v+=`c.add(${w})`:v+="null":x&&(v+=`d[s](n,${w})`),v},m=t?`!function(){${d}${p(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${wQ}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}${u?"":"else{"+p(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${f}}catch(t){}}();`;return k.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:m}})});var EQ=t=>{switch(t){case"success":return TQ;case"info":return NQ;case"warning":return jQ;case"error":return PQ;default:return null}},CQ=Array(12).fill(0),AQ=({visible:t,className:e})=>K.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},K.createElement("div",{className:"sonner-spinner"},CQ.map((n,r)=>K.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),TQ=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.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"})),jQ=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},K.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"})),NQ=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.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"})),PQ=K.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},K.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"})),RQ=K.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"},K.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),K.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),IQ=()=>{let[t,e]=K.useState(document.hidden);return K.useEffect(()=>{let n=()=>{e(document.hidden)};
485return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},oj=1,DQ=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,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:oj++,i=this.toasts.find(o=>o.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(o=>o.id===s?(this.publish({...o,...t,id:s,title:n}),{...o,...t,id:s,dismissible:a,title:n}):o):this.addToast({title:n,...r,dismissible:a,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(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(),s=n!==void 0,i,a=r.then(async l=>{if(i=["resolve",l],K.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(OQ(l)&&!l.ok){s=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:n,type:"error",message:u,description:d})}else if(e.success!==void 0){s=!1;let u=typeof e.success=="function"?await e.success(l):e.success,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){s=!1;let u=typeof e.error=="function"?await e.error(l):e.error,d=typeof e.description=="function"?await e.description(l):e.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var l;s&&(this.dismiss(n),n=void 0),(l=e.finally)==null||l.call(e)}),o=()=>new Promise((l,u)=>a.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:o}:Object.assign(n,{unwrap:o})},this.custom=(t,e)=>{let n=(e==null?void 0:e.id)||oj++;return this.create({jsx:t(n),id:n,...e}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Bs=new DQ,MQ=(t,e)=>{let n=(e==null?void 0:e.id)||oj++;return Bs.addToast({title:t,...e,id:n}),n},OQ=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",LQ=MQ,FQ=()=>Bs.toasts,BQ=()=>Bs.getActiveToasts(),te=Object.assign(LQ,{success:Bs.success,info:Bs.info,warning:Bs.warning,error:Bs.error,custom:Bs.custom,message:Bs.message,promise:Bs.promise,dismiss:Bs.dismiss,loading:Bs.loading},{getHistory:FQ,getToasts:BQ});function $Q(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))}$Q(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
485left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
485:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
485--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
486`);function p1(t){return t.label!==void 0}var UQ=3,zQ="32px",VQ="16px",fO=4e3,WQ=356,HQ=14,qQ=20,GQ=200;function Sa(...t){return t.filter(Boolean).join(" ")}function KQ(t){let[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}var YQ=t=>{var e,n,r,s,i,a,o,l,u,d,f;let{invert:p,toast:m,unstyled:y,interacting:g,setHeights:b,visibleToasts:x,heights:w,index:v,toasts:S,expanded:E,removeToast:C,defaultRichColors:T,closeButton:P,style:M,cancelButtonStyle:R,actionButtonStyle:O,className:L="",descriptionClassName:U="",duration:B,position:H,gap:z,loadingIcon:V,expandByDefault:$,classNames:I,icons:N,closeButtonAriaLabel:W="Close toast",pauseWhenPageIsHidden:q}=t,[D,Q]=K.useState(null),[X,se]=K.useState(null),[Y,de]=K.useState(!1),[Ie,_e]=K.useState(!1),[Ee,xe]=K.useState(!1),[Ne,tt]=K.useState(!1),[qe,pt]=K.useState(!1),[Et,Bt]=K.useState(0),[Pr,Oi]=K.useState(0),
486ks=K.useRef(m.duration||B||fO),ll=K.useRef(null),fr=K.useRef(null),cl=v===0,va=v+1<=x,G=m.type,ee=m.dismissible!==!1,Pe=m.className||"",De=m.descriptionClassName||"",Ge=K.useMemo(()=>w.findIndex(Le=>Le.toastId===m.id)||0,[w,m.id]),$t=K.useMemo(()=>{var Le;return(Le=m.closeButton)!=null?Le:P},[m.closeButton,P]),pr=K.useMemo(()=>m.duration||B||fO,[m.duration,B]),tr=K.useRef(0),mr=K.useRef(0),Hn=K.useRef(0),Pt=K.useRef(null),[Li,Jr]=H.split("-"),K0=K.useMemo(()=>w.reduce((Le,Me,gt)=>gt>=Ge?Le:Le+Me.height,0),[w,Ge]),fp=IQ(),ix=m.invert||p,ax=G==="loading";mr.current=K.useMemo(()=>Ge*z+K0,[Ge,K0]),K.useEffect(()=>{ks.current=pr},[pr]),K.useEffect(()=>{de(!0)},[]),K.useEffect(()=>{let Le=fr.current;if(Le){let Me=Le.getBoundingClientRect().height;return Oi(Me),b(gt=>[{toastId:m.id,height:Me,position:m.position},...gt]),()=>b(gt=>gt.filter(Qs=>Qs.toastId!==m.id))}},[b,m.id]),K.useLayoutEffect(()=>{if(!Y)return;let Le=fr.current,Me=Le.style.height;Le.style.height="auto";let gt=Le.getBoundingClientRect().height;Le.style.height=Me,Oi(gt),b(Qs=>Qs.find(_s=>_s.toastId===m.id)?Qs.map(_s=>_s.toastId===m.id?{..._s,height:gt}:_s):[{toastId:m.id,height:gt,position:m.position},...Qs])},[Y,m.title,m.description,b,m.id]);let Ss=K.useCallback(()=>{_e(!0),Bt(mr.current),b(Le=>Le.filter(Me=>Me.toastId!==m.id)),setTimeout(()=>{C(m)},GQ)},[m,C,b,mr]);K.useEffect(()=>{if(m.promise&&G==="loading"||m.duration===1/0||m.type==="loading")return;let Le;return E||g||q&&fp?(()=>{if(Hn.current<tr.current){let Me=new Date().getTime()-tr.current;ks.current=ks.current-Me}Hn.current=new Date().getTime()})():ks.current!==1/0&&(tr.current=new Date().getTime(),Le=setTimeout(()=>{var Me;(Me=m.onAutoClose)==null||Me.call(m,m),Ss()},ks.current)),()=>clearTimeout(Le)},[E,g,m,G,q,fp,Ss]),K.useEffect(()=>{m.delete&&Ss()},[Ss,m.delete]);function nC(){var Le,Me,gt;return N!=null&&N.loading?K.createElement("div",{className:Sa(I==null?void 0:I.loader,(Le=m==null?void 0:m.classNames)==null?void 0:Le.loader,"sonner-loader"),"data-visible":G==="loading"},N.loading):V?K.createElement("div",{className:Sa(I==null?void 0:I.loader,(Me=m==null?void 0:m.classNames)==null?void 0:Me.loader,"sonner-loader"),"data-visible":G==="loading"},V):K.createElement(AQ,{className:Sa(I==null?void 0:I.loader,(gt=m==null?void 0:m.classNames)==null?void 0:gt.loader),visible:G==="loading"})}return K.createElement("li",{tabIndex:0,ref:fr,className:Sa(L,Pe,I==null?void 0:I.toast,(e=m==null?void 0:m.classNames)==null?void 0:e.toast,I==null?void 0:I.default,I==null?void 0:I[G],(n=m==null?void 0:m.classNames)==null?void 0:n[G]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:T,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":Y,"data-promise":!!m.promise,"data-swiped":qe,"data-removed":Ie,"data-visible":va,"data-y-position":Li,"data-x-position":Jr,"data-index":v,"data-front":cl,"data-swiping":Ee,"data-dismissible":ee,"data-type":G,"data-invert":ix,"data-swipe-out":Ne,"data-swipe-direction":X,"data-expanded":!!(E||$&&Y),style:{"--index":v,"--toasts-before":v,"--z-index":S.length-v,"--offset":`${Ie?Et:mr.current}px`,"--initial-height":$?"auto":`${Pr}px`,...M,...m.style},onDragEnd:()=>{xe(!1),Q(null),Pt.current=null},onPointerDown:Le=>{ax||!ee||(ll.current=new Date,Bt(mr.current),Le.target.setPointerCapture(Le.pointerId),Le.target.tagName!=="BUTTON"&&(xe(!0),Pt.current={x:Le.clientX,y:Le.clientY}))},onPointerUp:()=>{var Le,Me,gt,Qs;if(Ne||!ee)return;Pt.current=null;let _s=Number(((Le=fr.current)==null?void 0:Le.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fi=Number(((Me=fr.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),oo=new Date().getTime()-((gt=ll.current)==null?void 0:gt.getTime()),Es=D==="x"?_s:Fi,lo=Math.abs(Es)/oo;if(Math.abs(Es)>=qQ||lo>.11){Bt(mr.current),(Qs=m.onDismiss)==null||Qs.call(m,m),se(D==="x"?_s>0?"right":"left":Fi>0?"down":"up"),Ss(),tt(!0),pt(!1);return}xe(!1),Q(null)},onPointerMove:Le=>{var Me,gt,Qs,_s;if(!Pt.current||!ee||((Me=window.getSelection())==null?void 0:Me.toString().length)>0)return;let Fi=Le.clientY-Pt.current.y,oo=Le.clientX-Pt.current.x,Es=(gt=t.swipeDirections)!=null?gt:KQ(H);!D&&(Math.abs(oo)>1||Math.abs(Fi)>1)&&Q(Math.abs(oo)>Math.abs(Fi)?"x":"y");let lo={x:0,y:0};D==="y"?(Es.includes("top")||Es.includes("bottom"))&&(Es.includes("top")&&Fi<0||Es.includes("bottom")&&Fi>0)&&(lo.y=Fi):D==="x"&&(Es.includes("left")||Es.includes("right"))&&(Es.includes("left")&&oo<0||Es.includes("right")&&oo>0)&&(lo.x=oo),(Math.abs(lo.x)>0||Math.abs(lo.y)>0)&&pt(!0),(Qs=fr.current)==null||Qs.style.setProperty("--swipe-amount-x",`${lo.x}px`),(_s=fr.current)==null||_s.style.setProperty("--swipe-amount-y",`${lo.y}px`)}},$t&&!m.jsx?K.createElement("button",{"aria-label":W,"data-disabled":ax,"data-close-button":!0,onClick:ax||!ee?()=>{}:()=>{var Le;Ss(),(Le=m.onDismiss)==null||Le.call(m,m)},className:Sa(I==null?void 0:I.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(i=N==null?void 0:N.close)!=null?i:RQ):null,m.jsx||k.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:K.createElement(K.Fragment,null,G||m.icon||m.promise?K.createElement("div",{"data-icon":"",className:Sa(I==null?void 0:I.icon,(a=m==null?void 0:m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||nC():null,m.type!=="loading"?m.
vendor: 5,895 bytes, line 486
486icon||(N==null?void 0:N[G])||EQ(G):null):null,K.createElement("div",{"data-content":"",className:Sa(I==null?void 0:I.content,(o=m==null?void 0:m.classNames)==null?void 0:o.content)},K.createElement("div",{"data-title":"",className:Sa(I==null?void 0:I.title,(l=m==null?void 0:m.classNames)==null?void 0:l.title)},typeof m.title=="function"?m.title():m.title),m.description?K.createElement("div",{"data-description":"",className:Sa(U,De,I==null?void 0:I.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),k.isValidElement(m.cancel)?m.cancel:m.cancel&&p1(m.cancel)?K.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||R,onClick:Le=>{var Me,gt;p1(m.cancel)&&ee&&((gt=(Me=m.cancel).onClick)==null||gt.call(Me,Le),Ss())},className:Sa(I==null?void 0:I.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,k.isValidElement(m.action)?m.action:m.action&&p1(m.action)?K.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||O,onClick:Le=>{var Me,gt;p1(m.action)&&((gt=(Me=m.action).onClick)==null||gt.call(Me,Le),!Le.defaultPrevented&&Ss())},className:Sa(I==null?void 0:I.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function pO(){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}function XQ(t,e){let n={};return[t,e].forEach((r,s)=>{let i=s===1,a=i?"--mobile-offset":"--offset",o=i?VQ:zQ;function l(u){["top","right","bottom","left"].forEach(d=>{n[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${a}-${u}`]=o:n[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(o)}),n}var ZQ=k.forwardRef(function(t,e){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:a,className:o,offset:l,mobileOffset:u,theme:d="light",richColors:f,duration:p,style:m,visibleToasts:y=UQ,toastOptions:g,dir:b=pO(),gap:x=HQ,loadingIcon:w,icons:v,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:E}=t,[C,T]=K.useState([]),P=K.useMemo(()=>Array.from(new Set([r].concat(C.filter(q=>q.position).map(q=>q.position)))),[C,r]),[M,R]=K.useState([]),[O,L]=K.useState(!1),[U,B]=K.useState(!1),[H,z]=K.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=K.useRef(null),$=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=K.useRef(null),N=K.useRef(!1),W=K.useCallback(q=>{T(D=>{var Q;return(Q=D.find(X=>X.id===q.id))!=null&&Q.delete||Bs.dismiss(q.id),D.filter(({id:X})=>X!==q.id)})},[]);return K.useEffect(()=>Bs.subscribe(q=>{if(q.dismiss){T(D=>D.map(Q=>Q.id===q.id?{...Q,delete:!0}:Q));return}setTimeout(()=>{q$.flushSync(()=>{T(D=>{let Q=D.findIndex(X=>X.id===q.id);return Q!==-1?[...D.slice(0,Q),{...D[Q],...q},...D.slice(Q+1)]:[q,...D]})})})}),[]),K.useEffect(()=>{if(d!=="system"){z(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:D})=>{z(D?"dark":"light")})}catch{q.addListener(({matches:Q})=>{try{z(Q?"dark":"light")}catch(X){console.error(X)}})}},[d]),K.useEffect(()=>{C.length<=1&&L(!1)},[C]),K.useEffect(()=>{let q=D=>{var Q,X;s.every(se=>D[se]||D.code===se)&&(L(!0),(Q=V.current)==null||Q.focus()),D.code==="Escape"&&(document.activeElement===V.current||(X=V.current)!=null&&X.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[s]),K.useEffect(()=>{if(V.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,N.current=!1)}},[V.current]),K.createElement("section",{ref:e,"aria-label":`${S} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((q,D)=>{var Q;let[X,se]=q.split("-");return C.length?K.createElement("ol",{key:q,dir:b==="auto"?pO():b,tabIndex:-1,ref:V,className:o,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":X,"data-lifted":O&&C.length>1&&!i,"data-x-position":se,style:{"--front-toast-height":`${((Q=M[0])==null?void 0:Q.height)||0}px`,"--width":`${WQ}px`,"--gap":`${x}px`,...m,...XQ(l,u)},onBlur:Y=>{N.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(N.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||N.current||(N.current=!0,I.current=Y.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{U||L(!1)},onDragEnd:()=>L(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},C.filter(Y=>!Y.position&&D===0||Y.position===q).map((Y,de)=>{var Ie,_e;return K.createElement(YQ,{key:Y.id,icons:v,index:de,toast:Y,defaultRichColors:f,duration:(Ie=g==null?void 0:g.duration)!=null?Ie:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:y,closeButton:(_e=g==null?void 0:g.closeButton)!=null?_e:a,interacting:U,position:q,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:W,toasts:C.filter(Ee=>Ee.position==Y.position),heights:M.filter(Ee=>Ee.position==Y.position),setHeights:R,expandByDefault:i,gap:x,loadingIcon:w,exp
vendor: 5,075 bytes, line 486
486anded:O,pauseWhenPageIsHidden:E,swipeDirections:t.swipeDirections})})):null}))});const QQ=({...t})=>{const{theme:e="system"}=_Q();return c.jsx(ZQ,{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})};var JQ=fP[" useId ".trim().toString()]||(()=>{}),eJ=0;function sd(t){const[e,n]=k.useState(JQ());return Nr(()=>{t||n(r=>r??String(eJ++))},[t]),t||(e?`radix-${e}`:"")}const tJ=["top","right","bottom","left"],hd=Math.min,_i=Math.max,PS=Math.round,m1=Math.floor,Qo=t=>({x:t,y:t}),nJ={left:"right",right:"left",bottom:"top",top:"bottom"},rJ={start:"end",end:"start"};function lj(t,e,n){return _i(t,hd(e,n))}function pc(t,e){return typeof t=="function"?t(e):t}function mc(t){return t.split("-")[0]}function Hy(t){return t.split("-")[1]}function vR(t){return t==="x"?"y":"x"}function bR(t){return t==="y"?"height":"width"}const sJ=new Set(["top","bottom"]);function Ko(t){return sJ.has(mc(t))?"y":"x"}function wR(t){return vR(Ko(t))}function iJ(t,e,n){n===void 0&&(n=!1);const r=Hy(t),s=wR(t),i=bR(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=RS(a)),[a,RS(a)]}function aJ(t){const e=RS(t);return[cj(t),e,cj(e)]}function cj(t){return t.replace(/start|end/g,e=>rJ[e])}const mO=["left","right"],gO=["right","left"],oJ=["top","bottom"],lJ=["bottom","top"];function cJ(t,e,n){switch(t){case"top":case"bottom":return n?e?gO:mO:e?mO:gO;case"left":case"right":return e?oJ:lJ;default:return[]}}function uJ(t,e,n,r){const s=Hy(t);let i=cJ(mc(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(cj)))),i}function RS(t){return t.replace(/left|right|bottom|top/g,e=>nJ[e])}function dJ(t){return{top:0,right:0,bottom:0,left:0,...t}}function KU(t){return typeof t!="number"?dJ(t):{top:t,right:t,bottom:t,left:t}}function IS(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function yO(t,e,n){let{reference:r,floating:s}=t;const i=Ko(e),a=wR(e),o=bR(a),l=mc(e),u=i==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,p=r[o]/2-s[o]/2;let m;switch(l){case"top":m={x:d,y:r.y-s.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-s.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Hy(e)){case"start":m[a]-=p*(n&&u?-1:1);break;case"end":m[a]+=p*(n&&u?-1:1);break}return m}const hJ=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,o=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:f}=yO(u,r,l),p=r,m={},y=0;for(let g=0;g<o.length;g++){const{name:b,fn:x}=o[g],{x:w,y:v,data:S,reset:E}=await x({x:d,y:f,initialPlacement:r,placement:p,strategy:s,middlewareData:m,rects:u,platform:a,elements:{reference:t,floating:e}});d=w??d,f=v??f,m={...m,[b]:{...m[b],...S}},E&&y<=50&&(y++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(u=E.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):E.rects),{x:d,y:f}=yO(u,p,l)),g=-1)}return{x:d,y:f,placement:p,strategy:s,middlewareData:m}};async function tb(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:o,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=pc(e,t),y=KU(m),b=o[p?f==="floating"?"reference":"floating":f],x=IS(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:l})),w=f==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),S=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},E=IS(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:w,offsetParent:v,strategy:l}):w);return{top:(x.top-E.top+y.top)/S.y,bottom:(E.bottom-x.bottom+y.bottom)/S.y,left:(x.left-E.left+y.left)/S.x,right:(E.right-x.right+y.right)/S.x}}const fJ=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:o,middlewareData:l}=e,{element:u,padding:d=0}=pc(t,e)||{};if(u==null)return{};const f=KU(d),p={x:n,y:r},m=wR(s),y=bR(m),g=await a.getDimensions(u),b=m==="y",x=b?"top":"left",w=b?"bottom":"right",v=b?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[m]-p[m]-i.floating[y],E=p[m]-i.reference[m],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let T=C?C[v]:0;
vendor: 7,683 bytes, line 486
486(!T||!await(a.isElement==null?void 0:a.isElement(C)))&&(T=o.floating[v]||i.floating[y]);const P=S/2-E/2,M=T/2-g[y]/2-1,R=hd(f[x],M),O=hd(f[w],M),L=R,U=T-g[y]-O,B=T/2-g[y]/2+P,H=lj(L,B,U),z=!l.arrow&&Hy(s)!=null&&B!==H&&i.reference[y]/2-(B<L?R:O)-g[y]/2<0,V=z?B<L?B-L:B-U:0;return{[m]:p[m]+V,data:{[m]:H,centerOffset:B-H-V,...z&&{alignmentOffset:V}},reset:z}}}),pJ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:u}=e,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...b}=pc(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=mc(s),w=Ko(o),v=mc(o)===o,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(v||!g?[RS(o)]:aJ(o)),C=y!=="none";!p&&C&&E.push(...uJ(o,g,y,S));const T=[o,...E],P=await tb(e,b),M=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&M.push(P[x]),f){const B=iJ(s,a,S);M.push(P[B[0]],P[B[1]])}if(R=[...R,{placement:s,overflows:M}],!M.every(B=>B<=0)){var O,L;const B=(((O=i.flip)==null?void 0:O.index)||0)+1,H=T[B];if(H&&(!(f==="alignment"?w!==Ko(H):!1)||R.every($=>$.overflows[0]>0&&Ko($.placement)===w)))return{data:{index:B,overflows:R},reset:{placement:H}};let z=(L=R.filter(V=>V.overflows[0]<=0).sort((V,$)=>V.overflows[1]-$.overflows[1])[0])==null?void 0:L.placement;if(!z)switch(m){case"bestFit":{var U;const V=(U=R.filter($=>{if(C){const I=Ko($.placement);return I===w||I==="y"}return!0}).map($=>[$.placement,$.overflows.filter(I=>I>0).reduce((I,N)=>I+N,0)]).sort(($,I)=>$[1]-I[1])[0])==null?void 0:U[0];V&&(z=V);break}case"initialPlacement":z=o;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function xO(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function vO(t){return tJ.some(e=>t[e]>=0)}const mJ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=pc(t,e);switch(r){case"referenceHidden":{const i=await tb(e,{...s,elementContext:"reference"}),a=xO(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:vO(a)}}}case"escaped":{const i=await tb(e,{...s,altBoundary:!0}),a=xO(i,n.floating);return{data:{escapedOffsets:a,escaped:vO(a)}}}default:return{}}}}},YU=new Set(["left","top"]);async function gJ(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=mc(n),o=Hy(n),l=Ko(n)==="y",u=YU.has(a)?-1:1,d=i&&l?-1:1,f=pc(e,t);let{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof y=="number"&&(m=o==="end"?y*-1:y),l?{x:m*d,y:p*u}:{x:p*u,y:m*d}}const yJ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:o}=e,l=await gJ(e,t);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:a}}}}},xJ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:o={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...l}=pc(t,e),u={x:n,y:r},d=await tb(e,l),f=Ko(mc(s)),p=vR(f);let m=u[p],y=u[f];if(i){const b=p==="y"?"top":"left",x=p==="y"?"bottom":"right",w=m+d[b],v=m-d[x];m=lj(w,m,v)}if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=y+d[b],v=y-d[x];y=lj(w,y,v)}const g=o.fn({...e,[p]:m,[f]:y});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[f]:a}}}}}},vJ=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=e,{offset:o=0,mainAxis:l=!0,crossAxis:u=!0}=pc(t,e),d={x:n,y:r},f=Ko(s),p=vR(f);let m=d[p],y=d[f];const g=pc(o,e),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const v=p==="y"?"height":"width",S=i.reference[p]-i.floating[v]+b.mainAxis,E=i.reference[p]+i.reference[v]-b.mainAxis;m<S?m=S:m>E&&(m=E)}if(u){var x,w;const v=p==="y"?"width":"height",S=YU.has(mc(s)),E=i.reference[f]-i.floating[v]+(S&&((x=a.offset)==null?void 0:x[f])||0)+(S?0:b.crossAxis),C=i.reference[f]+i.reference[v]+(S?0:((w=a.offset)==null?void 0:w[f])||0)-(S?b.crossAxis:0);y<E?y=E:y>C&&(y=C)}return{[p]:m,[f]:y}}}},bJ=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:s,rects:i,platform:a,elements:o}=e,{apply:l=()=>{},...u}=pc(t,e),d=await tb(e,u),f=mc(s),p=Hy(s),m=Ko(s)==="y",{width:y,height:g}=i.floating;let b,x;f==="top"||f==="bottom"?(b=f,x=p===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(x=f,b=p==="end"?"top":"bottom");const w=g-d.top-d.bottom,v=y-d.left-d.right,S=hd(g-d[b],w),E=hd(y-d[x],v),C=!e.middlewareData.shift;let T=S,P=E;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(P=v),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(T=w),C&&!p){const R=_i(d.left,0),O=_i(d.right,0),L=_i(d.top,0),U=_i(d.bottom,0);m?P=y-2*(R!==0||O!==0?R+O:_i(d.left,d.right)):T=g-2*(L!==0||U!==0?L+U:_i(d.top,d.bottom))}await l({...e,availableWidth:P,availableHeight:T});const M=await a.getDimensions(o.floating);return y!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function uE(){return typeof window<"u"}function qy(t){return XU(t)?(t.nodeName||"").toLowerCase():"#document"}function Ti(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function al(t){var e;return(e=(XU(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function XU(t){return uE()?t instanceof Node||t instanceof Ti(t).Node:!1}function no(t){return uE()?t instanceof Element||t instanceof Ti(t).Element:!1}function tl(t){return uE()?t instanceof HTMLElement||t instanceof Ti(t).HTMLElement:!1}function bO(t){return!uE()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ti(t).ShadowRoot}const wJ=new Set(["inline","contents"]);function A0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=ro(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!wJ.has(s)}const kJ=new Set(["table","td","th"]);function SJ(t){return kJ.has(qy(t))}const _J=[":popover-open",":modal"];function dE(t){return _J.some(e=>{try{return t.matches(e)}catch{return!1}})}const EJ=["transform","translate","scale","rotate","perspective"],CJ=["transform","translate","scale","rotate","perspective","filter"],AJ=["paint","layout","strict","content"];function kR(t){const e=SR(),n=no(t)?ro(t):t;return EJ.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||CJ.some(r=>(n.willChange||"").includes(r))||AJ.some(r=>(n.contain||"").includes(r))}function TJ(t){let e=fd(t);for(;tl(e)&&!Ey(e);){if(kR(e))return e;if(dE(e))return null;e=fd(e)}return null}function SR(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const jJ=new Set(["html","body","#document"]);function Ey(t){return jJ.has(qy(t))}function ro(t){return Ti(t).getComputedStyle(t)}function hE(t){return no(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function fd(t){if(qy(t)==="html")return t;const e=t.assignedSlot||t.parentNode||bO(t)&&t.host||al(t);return bO(e)?e.host:e}function ZU(t){const e=fd(t);return Ey(e)?t.ownerDocument?t.ownerDocument.body:t.body:tl(e)&&A0(e)?e:ZU(e)}function nb(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=ZU(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Ti(s);if(i){const o=uj(a);
vendor: 6,458 bytes, line 486
486return e.concat(a,a.visualViewport||[],A0(s)?s:[],o&&n?nb(o):[])}return e.concat(s,nb(s,[],n))}function uj(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function QU(t){const e=ro(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=tl(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,o=PS(n)!==i||PS(r)!==a;return o&&(n=i,r=a),{width:n,height:r,$:o}}function _R(t){return no(t)?t:t.contextElement}function wm(t){const e=_R(t);if(!tl(e))return Qo(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=QU(e);let a=(i?PS(n.width):n.width)/r,o=(i?PS(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const NJ=Qo(0);function JU(t){const e=Ti(t);return!SR()||!e.visualViewport?NJ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function PJ(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ti(t)?!1:e}function Gf(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=_R(t);let a=Qo(1);e&&(r?no(r)&&(a=wm(r)):a=wm(t));const o=PJ(i,n,r)?JU(i):Qo(0);let l=(s.left+o.x)/a.x,u=(s.top+o.y)/a.y,d=s.width/a.x,f=s.height/a.y;if(i){const p=Ti(i),m=r&&no(r)?Ti(r):r;let y=p,g=uj(y);for(;g&&r&&m!==y;){const b=wm(g),x=g.getBoundingClientRect(),w=ro(g),v=x.left+(g.clientLeft+parseFloat(w.paddingLeft))*b.x,S=x.top+(g.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,u*=b.y,d*=b.x,f*=b.y,l+=v,u+=S,y=Ti(g),g=uj(y)}}return IS({width:d,height:f,x:l,y:u})}function ER(t,e){const n=hE(t).scrollLeft;return e?e.left+n:Gf(al(t)).left+n}function ez(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=r.left+e.scrollLeft-(n?0:ER(t,r)),i=r.top+e.scrollTop;return{x:s,y:i}}function RJ(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=al(r),o=e?dE(e.floating):!1;if(r===a||o&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Qo(1);const d=Qo(0),f=tl(r);if((f||!f&&!i)&&((qy(r)!=="body"||A0(a))&&(l=hE(r)),tl(r))){const m=Gf(r);u=wm(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const p=a&&!f&&!i?ez(a,l,!0):Qo(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function IJ(t){return Array.from(t.getClientRects())}function DJ(t){const e=al(t),n=hE(t),r=t.ownerDocument.body,s=_i(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=_i(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ER(t);const o=-n.scrollTop;return ro(r).direction==="rtl"&&(a+=_i(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:o}}function MJ(t,e){const n=Ti(t),r=al(t),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,o=0,l=0;if(s){i=s.width,a=s.height;const u=SR();(!u||u&&e==="fixed")&&(o=s.offsetLeft,l=s.offsetTop)}return{width:i,height:a,x:o,y:l}}const OJ=new Set(["absolute","fixed"]);function LJ(t,e){const n=Gf(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=tl(t)?wm(t):Qo(1),a=t.clientWidth*i.x,o=t.clientHeight*i.y,l=s*i.x,u=r*i.y;return{width:a,height:o,x:l,y:u}}function wO(t,e,n){let r;if(e==="viewport")r=MJ(t,n);else if(e==="document")r=DJ(al(t));else if(no(e))r=LJ(e,n);else{const s=JU(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return IS(r)}function tz(t,e){const n=fd(t);return n===e||!no(n)||Ey(n)?!1:ro(n).position==="fixed"||tz(n,e)}function FJ(t,e){const n=e.get(t);if(n)return n;let r=nb(t,[],!1).filter(o=>no(o)&&qy(o)!=="body"),s=null;const i=ro(t).position==="fixed";let a=i?fd(t):t;for(;no(a)&&!Ey(a);){const o=ro(a),l=kR(a);!l&&o.position==="fixed"&&(s=null),(i?!l&&!s:!l&&o.position==="static"&&!!s&&OJ.has(s.position)||A0(a)&&!l&&tz(t,a))?r=r.filter(d=>d!==a):s=o,a=fd(a)}return e.set(t,r),r}function BJ(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?dE(e)?[]:FJ(e,this._c):[].concat(n),r],o=a[0],l=a.reduce((u,d)=>{const f=wO(e,d,s);return u.top=_i(f.top,u.top),u.right=hd(f.right,u.right),u.bottom=hd(f.bottom,u.bottom),u.left=_i(f.left,u.left),u},wO(e,o,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function $J(t){const{width:e,height:n}=QU(t);return{width:e,height:n}}function UJ(t,e,n){const r=tl(e),s=al(e),i=n==="fixed",a=Gf(t,!0,i,e);let o={scrollLeft:0,scrollTop:0};const l=Qo(0);function u(){l.x=ER(s)}if(r||!r&&!i)if((qy(e)!=="body"||A0(s))&&(o=hE(e)),r){const m=Gf(e,!0,i,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else s&&u();i&&!r&&s&&u();const d=s&&!r&&!i?ez(s,o):Qo(0),f=a.left+o.scrollLeft-l.x-d.x,p=a.top+o.scrollTop-l.y-d.y;return{x:f,y:p,width:a.width,height:a.height}}function LC(t){return ro(t).position==="static"}function kO(t,e){if(!tl(t)||ro(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return al(t)===n&&(n=n.ownerDocument.body),n}function nz(t,e){const n=Ti(t);if(dE(t))return n;if(!tl(t)){let s=fd(t);for(;s&&!Ey(s);){if(no(s)&&!LC(s))return s;s=fd(s)}return n}let r=kO(t,e);for(;r&&SJ(r)&&LC(r);)r=kO(r,e);return r&&Ey(r)&&LC(r)&&!kR(r)?n:r||TJ(t)||n}const zJ=async function(t){const e=this.getOffsetParent||nz,n=this.getDimensions,r=await n(t.floating);return{reference:UJ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function VJ(t){return ro(t).direction==="rtl"}const WJ={convertOffsetParentRelativeRectToViewportRelativeRect:RJ,getDocumentElement:al,getClippingRect:BJ,getOffsetParent:nz,getElementRects:zJ,getClientRects:IJ,getDimensions:$J,getScale:wm,isElement:no,isRTL:VJ};function rz(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function HJ(t,e){let n=null,r;const s=al(t);function i(){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),i();const u=t.getBoundingClientRect(),{left:d,top:f,width:p,height:m}=u;if(o||e(),!p||!m)return;const y=m1(f),g=m1(s.clientWidth-(d+p)),b=m1(s.clientHeight-(f+m)),x=m1(d),v={rootMargin:-y+"px "+-g+"px "+-b+"px "+-x+"px",threshold:_i(0,hd(1,l))||1};let S=!0;function E(C){const T=C[0].intersectionRatio;if(T!==l){if(!S)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},1e3)}T===1&&!rz(u,t.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(E,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,v)}n.observe(t)}return a(!0),i}function qJ(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}
vendor: 4,272 bytes, line 486
486=r,u=_R(t),d=s||i?[...u?nb(u):[],...nb(e)]:[];d.forEach(x=>{s&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=u&&o?HJ(u,n):null;let p=-1,m=null;a&&(m=new ResizeObserver(x=>{let[w]=x;w&&w.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),n()}),u&&!l&&m.observe(u),m.observe(e));let y,g=l?Gf(t):null;l&&b();function b(){const x=Gf(t);g&&!rz(g,x)&&n(),g=x,y=requestAnimationFrame(b)}return n(),()=>{var x;d.forEach(w=>{s&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,l&&cancelAnimationFrame(y)}}const GJ=yJ,KJ=xJ,YJ=pJ,XJ=bJ,ZJ=mJ,SO=fJ,QJ=vJ,JJ=(t,e,n)=>{const r=new Map,s={platform:WJ,...n},i={...s.platform,_c:r};return hJ(t,e,{...s,platform:i})};var eee=typeof document<"u",tee=function(){},uk=eee?k.useLayoutEffect:tee;function DS(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,s;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(!DS(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!DS(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function sz(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function _O(t,e){const n=sz(t);return Math.round(e*n)/n}function FC(t){const e=k.useRef(t);return uk(()=>{e.current=t}),e}function nee(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:o=!0,whileElementsMounted:l,open:u}=t,[d,f]=k.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=k.useState(r);DS(p,r)||m(r);const[y,g]=k.useState(null),[b,x]=k.useState(null),w=k.useCallback($=>{$!==C.current&&(C.current=$,g($))},[]),v=k.useCallback($=>{$!==T.current&&(T.current=$,x($))},[]),S=i||y,E=a||b,C=k.useRef(null),T=k.useRef(null),P=k.useRef(d),M=l!=null,R=FC(l),O=FC(s),L=FC(u),U=k.useCallback(()=>{if(!C.current||!T.current)return;const $={placement:e,strategy:n,middleware:p};O.current&&($.platform=O.current),JJ(C.current,T.current,$).then(I=>{const N={...I,isPositioned:L.current!==!1};B.current&&!DS(P.current,N)&&(P.current=N,ip.flushSync(()=>{f(N)}))})},[p,e,n,O,L]);uk(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[u]);const B=k.useRef(!1);uk(()=>(B.current=!0,()=>{B.current=!1}),[]),uk(()=>{if(S&&(C.current=S),E&&(T.current=E),S&&E){if(R.current)return R.current(S,E,U);U()}},[S,E,U,R,M]);const H=k.useMemo(()=>({reference:C,floating:T,setReference:w,setFloating:v}),[w,v]),z=k.useMemo(()=>({reference:S,floating:E}),[S,E]),V=k.useMemo(()=>{const $={position:n,left:0,top:0};if(!z.floating)return $;const I=_O(z.floating,d.x),N=_O(z.floating,d.y);return o?{...$,transform:"translate("+I+"px, "+N+"px)",...sz(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:N}},[n,o,z.floating,d.x,d.y]);return k.useMemo(()=>({...d,update:U,refs:H,elements:z,floatingStyles:V}),[d,U,H,z,V])}const ree=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?SO({element:r.current,padding:s}).fn(n):{}:r?SO({element:r,padding:s}).fn(n):{}}}},see=(t,e)=>({...GJ(t),options:[t,e]}),iee=(t,e)=>({...KJ(t),options:[t,e]}),aee=(t,e)=>({...QJ(t),options:[t,e]}),oee=(t,e)=>({...YJ(t),options:[t,e]}),lee=(t,e)=>({...XJ(t),options:[t,e]}),cee=(t,e)=>({...ZJ(t),options:[t,e]}),uee=(t,e)=>({...ree(t),options:[t,e]});var dee="Arrow",iz=k.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return c.jsx(Fe.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});iz.displayName=dee;var hee=iz;function CR(t){const[e,n]=k.useState(void 0);return Nr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>
vendor: 10,561 bytes, line 486
486{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,o;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,o=u.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 AR="Popper",[az,fE]=il(AR),[fee,oz]=az(AR),lz=t=>{const{__scopePopper:e,children:n}=t,[r,s]=k.useState(null);return c.jsx(fee,{scope:e,anchor:r,onAnchorChange:s,children:n})};lz.displayName=AR;var cz="PopperAnchor",uz=k.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=oz(cz,n),a=k.useRef(null),o=bt(e,a);return k.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:c.jsx(Fe.div,{...s,ref:o})});uz.displayName=cz;var TR="PopperContent",[pee,mee]=az(TR),dz=k.forwardRef((t,e)=>{var Y,de,Ie,_e,Ee,xe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:y,...g}=t,b=oz(TR,n),[x,w]=k.useState(null),v=bt(e,Ne=>w(Ne)),[S,E]=k.useState(null),C=CR(S),T=(C==null?void 0:C.width)??0,P=(C==null?void 0:C.height)??0,M=r+(i!=="center"?"-"+i:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],L=O.length>0,U={padding:R,boundary:O.filter(yee),altBoundary:L},{refs:B,floatingStyles:H,placement:z,isPositioned:V,middlewareData:$}=nee({strategy:"fixed",placement:M,whileElementsMounted:(...Ne)=>qJ(...Ne,{animationFrame:m==="always"}),elements:{reference:b.anchor},middleware:[see({mainAxis:s+P,alignmentAxis:a}),l&&iee({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?aee():void 0,...U}),l&&oee({...U}),lee({...U,apply:({elements:Ne,rects:tt,availableWidth:qe,availableHeight:pt})=>{const{width:Et,height:Bt}=tt.reference,Pr=Ne.floating.style;Pr.setProperty("--radix-popper-available-width",`${qe}px`),Pr.setProperty("--radix-popper-available-height",`${pt}px`),Pr.setProperty("--radix-popper-anchor-width",`${Et}px`),Pr.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),S&&uee({element:S,padding:o}),xee({arrowWidth:T,arrowHeight:P}),p&&cee({strategy:"referenceHidden",...U})]}),[I,N]=pz(z),W=ga(y);Nr(()=>{V&&(W==null||W())},[V,W]);const q=(Y=$.arrow)==null?void 0:Y.x,D=(de=$.arrow)==null?void 0:de.y,Q=((Ie=$.arrow)==null?void 0:Ie.centerOffset)!==0,[X,se]=k.useState();return Nr(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),c.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:V?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(_e=$.transformOrigin)==null?void 0:_e.x,(Ee=$.transformOrigin)==null?void 0:Ee.y].join(" "),...((xe=$.hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx(pee,{scope:n,placedSide:I,onArrowChange:E,arrowX:q,arrowY:D,shouldHideArrow:Q,children:c.jsx(Fe.div,{"data-side":I,"data-align":N,...g,ref:v,style:{...g.style,animation:V?void 0:"none"}})})})});dz.displayName=TR;var hz="PopperArrow",gee={top:"bottom",right:"left",bottom:"top",left:"right"},fz=k.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=mee(hz,r),a=gee[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(hee,{...s,ref:n,style:{...s.style,display:"block"}})})});fz.displayName=hz;function yee(t){return t!==null}var xee=t=>({name:"transformOrigin",options:t,fn(e){var b,x,w;const{placement:n,rects:r,middlewareData:s}=e,a=((b=s.arrow)==null?void 0:b.centerOffset)!==0,o=a?0:t.arrowWidth,l=a?0:t.arrowHeight,[u,d]=pz(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((x=s.arrow)==null?void 0:x.x)??0)+o/2,m=(((w=s.arrow)==null?void 0:w.y)??0)+l/2;let y="",g="";return u==="bottom"?(y=a?f:`${p}px`,g=`${-l}px`):u==="top"?(y=a?f:`${p}px`,g=`${r.floating.height+l}px`):u==="right"?(y=`${-l}px`,g=a?f:`${m}px`):u==="left"&&(y=`${r.floating.width+l}px`,g=a?f:`${m}px`),{data:{x:y,y:g}}}});function pz(t){const[e,n="center"]=t.split("-");return[e,n]}var vee=lz,mz=uz,gz=dz,yz=fz,[pE,KCe]=il("Tooltip",[fE]),jR=fE(),xz="TooltipProvider",bee=700,EO="tooltip.open",[wee,vz]=pE(xz),bz=t=>{const{__scopeTooltip:e,delayDuration:n=bee,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=k.useRef(!0),o=k.useRef(!1),l=k.useRef(0);return k.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(wee,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:k.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:k.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:k.useCallback(u=>{o.current=u},[]),disableHoverableContent:s,children:i})};bz.displayName=xz;var wz="Tooltip",[YCe,mE]=pE(wz),dj="TooltipTrigger",kee=k.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=mE(dj,n),i=vz(dj,n),a=jR(n),o=k.useRef(null),l=bt(e,o,s.onTriggerChange),u=k.useRef(!1),d=k.useRef(!1),f=k.useCallback(()=>u.current=!1,[]);return k.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(mz,{asChild:!0,...a,children:c.jsx(Fe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Ce(t.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ce(t.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:Ce(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ce(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Ce(t.onBlur,s.onClose),onClick:Ce(t.onClick,s.onClose)})})});kee.displayName=dj;var See="TooltipPortal",[XCe,_ee]=pE(See,{forceMount:void 0}),Cy="TooltipContent",kz=k.forwardRef((t,e)=>{const n=_ee(Cy,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=mE(Cy,t.__scopeTooltip);return c.jsx(jd,{present:r||a.open,children:a.disableHoverableContent?c.jsx(Sz,{side:s,...i,ref:e}):c.jsx(Eee,{side:s,...i,ref:e})})}),Eee=k.forwardRef((t,e)=>{const n=mE(Cy,t.__scopeTooltip),r=vz(Cy,t.__scopeTooltip),s=k.useRef(null),i=bt(e,s),[a,o]=k.useState(null),{trigger:l,onClose:u}=n,d=s.current,{onPointerInTransitChange:f}=r,p=k.useCallback(()=>{o(null),f(!1)},[f]),m=k.useCallback((y,g)=>{const b=y.currentTarget,x={x:y.clientX,y:y.clientY},w=Nee(x,b.getBoundingClientRect()),v=Pee(x,w),S=Ree(g.getBoundingClientRect()),E=Dee([...v,...S]);o(E),f(!0)},[f]);return k.useEffect(()=>()=>p(),[p]),k.useEffect(()=>{if(l&&d){const y=b=>m(b,d),g=b=>m(b,l);return l.addEventListener("pointerleave",y),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",g)}}},[l,d,m,p]),k.useEffect(()=>{if(a){const y=g=>{const b=g.target,x={x:g.clientX,y:g.clientY},w=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),v=!Iee(x,a);w?p():v&&(p(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,d,a,u,p]),c.jsx(Sz,{...t,ref:i})}),[Cee,Aee]=pE(wz,{isInside:!1}),Tee=gX("TooltipContent"),Sz=k.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...o}=t,l=mE(Cy,n),u=jR(n),{onClose:d}=l;return k.useEffect(()=>(document.addEventListener(EO,d),()=>document.removeEventListener(EO,d)),[d]),k.useEffect(()=>{if(l.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),c.jsx(b0,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(gz,{"data-state":l.stateAttribute,...u,...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:[c.jsx(Tee,{children:r}),c.jsx(Cee,{scope:n,isInside:!0,children:c.jsx(FX,{id:l.contentId,role:"tooltip",children:s||r})})]})})});kz.displayName=Cy;var _z="TooltipArrow",jee=k.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=jR(n);return Aee(_z,n).isInside?null:c.jsx(yz,{...s,...r,ref:e})});jee.displayName=_z;function Nee(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Pee(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}function Ree(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function Iee(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const o=e[i],l=e[a],u=o.x,d=o.y,f=l.x,p=l.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(s=!s)}return s}function Dee(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),Mee(e)}function Mee(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const s=t[r];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}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 Oee=bz,Ez=kz;const Lee=Oee,Fee=k.forwardRef(({className:t,sideOffset:e=4,...n},r)=>
vendor: 24,222 bytes, line 486
486c.jsx(Ez,{ref:r,sideOffset:e,className:Oe("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}));Fee.displayName=Ez.displayName;var gE=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(){}},yE=typeof window>"u"||"Deno"in globalThis;function Pa(){}function Bee(t,e){return typeof t=="function"?t(e):t}function $ee(t){return typeof t=="number"&&t>=0&&t!==1/0}function Uee(t,e){return Math.max(t+(e||0)-Date.now(),0)}function hj(t,e){return typeof t=="function"?t(e):t}function zee(t,e){return typeof t=="function"?t(e):t}function CO(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==NR(a,e.options))return!1}else if(!sb(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||s&&s!==e.state.fetchStatus||i&&!i(e))}function AO(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(rb(e.options.mutationKey)!==rb(i))return!1}else if(!sb(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function NR(t,e){return((e==null?void 0:e.queryKeyHashFn)||rb)(t)}function rb(t){return JSON.stringify(t,(e,n)=>fj(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function sb(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>sb(t[n],e[n])):!1}function Cz(t,e){if(t===e)return t;const n=TO(t)&&TO(e);if(n||fj(t)&&fj(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),a=i.length,o=n?[]:{},l=new Set(r);let u=0;for(let d=0;d<a;d++){const f=n?d:i[d];(!n&&l.has(f)||n)&&t[f]===void 0&&e[f]===void 0?(o[f]=void 0,u++):(o[f]=Cz(t[f],e[f]),o[f]===t[f]&&t[f]!==void 0&&u++)}return s===a&&u===s?t:o}return e}function TO(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function fj(t){if(!jO(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!jO(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function jO(t){return Object.prototype.toString.call(t)==="[object Object]"}function Vee(t){return new Promise(e=>{setTimeout(e,t)})}function Wee(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Cz(t,e):e}function Hee(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function qee(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var PR=Symbol();function Az(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===PR?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var yh,qc,Dm,_5,Gee=(_5=class extends gE{constructor(){super();A(this,yh);A(this,qc);A(this,Dm);_(this,Dm,e=>{if(!yE&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){h(this,qc)||this.setEventListener(h(this,Dm))}onUnsubscribe(){var e;this.hasListeners()||((e=h(this,qc))==null||e.call(this),_(this,qc,void 0))}setEventListener(e){var n;_(this,Dm,e),(n=h(this,qc))==null||n.call(this),_(this,qc,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){h(this,yh)!==e&&(_(this,yh,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof h(this,yh)=="boolean"?h(this,yh):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},yh=new WeakMap,qc=new WeakMap,Dm=new WeakMap,_5),Tz=new Gee,Mm,Gc,Om,E5,Kee=(E5=class extends gE{constructor(){super();A(this,Mm,!0);A(this,Gc);A(this,Om);_(this,Om,e=>{if(!yE&&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(){h(this,Gc)||this.setEventListener(h(this,Om))}onUnsubscribe(){var e;this.hasListeners()||((e=h(this,Gc))==null||e.call(this),_(this,Gc,void 0))}setEventListener(e){var n;_(this,Om,e),(n=h(this,Gc))==null||n.call(this),_(this,Gc,e(this.setOnline.bind(this)))}setOnline(e){h(this,Mm)!==e&&(_(this,Mm,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return h(this,Mm)}},Mm=new WeakMap,Gc=new WeakMap,Om=new WeakMap,E5),MS=new Kee;function Yee(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}function Xee(t){return Math.min(1e3*2**t,3e4)}function jz(t){return(t??"online")==="online"?MS.isOnline():!0}var Nz=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function BC(t){return t instanceof Nz}function Pz(t){let e=!1,n=0,r=!1,s;const i=Yee(),a=g=>{var b;r||(p(new Nz(g)),(b=t.abort)==null||b.call(t))},o=()=>{e=!0},l=()=>{e=!1},u=()=>Tz.isFocused()&&(t.networkMode==="always"||MS.isOnline())&&t.canRun(),d=()=>jz(t.networkMode)&&t.canRun(),f=g=>{var b;r||(r=!0,(b=t.onSuccess)==null||b.call(t,g),s==null||s(),i.resolve(g))},p=g=>{var b;r||(r=!0,(b=t.onError)==null||b.call(t,g),s==null||s(),i.reject(g))},m=()=>new Promise(g=>{var b;s=x=>{(r||u())&&g(x)},(b=t.onPause)==null||b.call(t)}).then(()=>{var g;s=void 0,r||(g=t.onContinue)==null||g.call(t)}),y=()=>{if(r)return;let g;const b=n===0?t.initialPromise:void 0;try{g=b??t.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{var C;if(r)return;const w=t.retry??(yE?0:3),v=t.retryDelay??Xee,S=typeof v=="function"?v(n,x):v,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,x);if(e||!E){p(x);return}n++,(C=t.onFail)==null||C.call(t,n,x),Vee(S).then(()=>u()?void 0:m()).then(()=>{e?p(x):y()})})};return{promise:i,cancel:a,continue:()=>(s==null||s(),i),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?y():m().then(y),i)}}var Zee=t=>setTimeout(t,0);function Qee(){let t=[],e=0,n=o=>{o()},r=o=>{o()},s=Zee;const i=o=>{e?t.push(o):s(()=>{n(o)})},a=()=>{const o=t;t=[],o.length&&s(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;e++;try{l=o()}finally{e--,e||a()}return l},batchCalls:o=>(...l)=>{i(()=>{o(...l)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var us=Qee(),xh,C5,Rz=(C5=class{constructor(){A(this,xh)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$ee(this.gcTime)&&_(this,xh,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(yE?1/0:5*60*1e3))}clearGcTimeout(){h(this,xh)&&(clearTimeout(h(this,xh)),_(this,xh,void 0))}},xh=new WeakMap,C5),Lm,vh,Vi,bh,Or,Ib,wh,Ra,hl,A5,Jee=(A5=class extends Rz{constructor(e){super();A(this,Ra);A(this,Lm);A(this,vh);A(this,Vi);A(this,bh);A(this,Or);A(this,Ib);A(this,wh);_(this,wh,!1),_(this,Ib,e.defaultOptions),this.setOptions(e.options),this.observers=[],_(this,bh,e.client),_(this,Vi,h(this,bh).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,_(this,Lm,tte(this.options)),this.state=e.state??h(this,Lm),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=h(this,Or))==null?void 0:e.promise}setOptions(e){this.options={...h(this,Ib),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&h(this,Vi).remove(this)}setData(e,n){const r=Wee(this.state.data,e,this.options);return j(this,Ra,hl).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){j(this,Ra,hl).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=h(this,Or))==null?void 0:r.promise;return(s=h(this,Or))==null||s.cancel(e),n?n.then(Pa).catch(Pa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(h(this,Lm))}isActive(){return this.observers.some(e=>zee(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===PR||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>hj(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Uee(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=h(this,Or))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=h(this,Or))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),h(this,Vi).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(h(this,Or)&&(h(this,wh)?h(this,Or).cancel({revert:!0}):h(this,Or).cancelRetry()),this.scheduleGc()),h(this,Vi).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||j(this,Ra,hl).call(this,{type:"invalidate"})}fetch(e,n){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(h(this,Or))return h(this,Or).continueRetry(),h(this,Or).promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(_(this,wh,!0),r.signal)})},i=()=>{const p=Az(this.options,n),y=(()=>{const g={client:h(this,bh),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return _(this,wh,!1),this.options.persister?this.options.persister(p,y,this):p(y)},o=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:h(this,bh),state:this.state,fetchFn:i};return s(p),p})();(u=this.options.behavior)==null||u.onFetch(o,this),_(this,vh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&j(this,Ra,hl).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const l=p=>{var m,y,g,b;BC(p)&&p.silent||j(this,Ra,hl).call(this,{type:"error",error:p}),BC(p)||((y=(m=h(this,Vi).config).onError)==null||y.call(m,p,this),(b=(g=h(this,Vi).config).onSettled)==null||b.call(g,this.state.data,p,this)),this.scheduleGc()};return _(this,Or,Pz({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,y,g,b;if(p===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(x){l(x);return}(y=(m=h(this,Vi).config).onSuccess)==null||y.call(m,p,this),(b=(g=h(this,Vi).config).onSettled)==null||b.call(g,p,this.state.error,this),this.scheduleGc()},onError:l,onFail:(p,m)=>{j(this,Ra,hl).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{j(this,Ra,hl).call(this,{type:"pause"})},onContinue:()=>{j(this,Ra,hl).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),h(this,Or).start()}},Lm=new WeakMap,vh=new WeakMap,Vi=new WeakMap,bh=new WeakMap,Or=new WeakMap,Ib=new WeakMap,wh=new WeakMap,Ra=new WeakSet,hl=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,...ete(r.data,this.options),fetchMeta:e.meta??null};case"success":return _(this,vh,void 0),{...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 s=e.error;return BC(s)&&s.revert&&h(this,vh)?{...h(this,vh),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),us.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),h(this,Vi).notify({query:this,type:"updated",action:e})})},A5);function ete(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jz(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function tte(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 xo,T5,nte=(T5=class extends gE{constructor(e={}){super();A(this,xo);this.config=e,_(this,xo,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??NR(s,n);let a=this.get(i);return a||(a=new Jee({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){h(this,xo).has(e.queryHash)||(h(this,xo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=h(this,xo).get(e.queryHash);n&&(e.destroy(),n===e&&h(this,xo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){us.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return h(this,xo).get(e)}getAll(){return[...h(this,xo).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>CO(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>CO(e,r)):n}notify(e){us.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){us.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){us.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},xo=new WeakMap,T5),vo,ss,kh,bo,Dc,j5,rte=(j5=class extends Rz{constructor(e){super();A(this,bo);A(this,vo);A(this,ss);A(this,kh);this.mutationId=e.mutationId,_(this,ss,e.mutationCache),_(this,vo,[]),this.state=e.state||ste(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){h(this,vo).includes(e)||(h(this,vo).push(e),this.clearGcTimeout(),h(this,ss).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){_(this,vo,h(this,vo).filter(n=>n!==e)),this.scheduleGc(),h(this,ss).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){h(this,vo).length||(this.state.status==="pending"?this.scheduleGc():h(this,ss).remove(this))}continue(){var e;return((e=h(this,kh))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,a,o,l,u,d,f,p,m,y,g,b,x,w,v,S,E,C,T,P;const n=()=>{j(this,bo,Dc).call(this,{type:"continue"})};_(this,kh,Pz({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(M,R)=>{j(this,bo,Dc).call(this,{type:"failed",failureCount:M,error:R})},onPause:()=>{j(this,bo,Dc).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>h(this,ss).canRun(this)}));const r=this.state.status==="pending",s=!h(this,kh).canStart();try{if(r)n();else{j(this,bo,Dc).call(this,{type:"pending",variables:e,isPaused:s}),await((a=(i=h(this,ss).config).onMutate)==null?void 0:a.call(i,e,this));const R=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,e));R!==this.state.context&&j(this,bo,Dc).call(this,{type:"pending",context:R,variables:e,isPaused:s})}const M=await h(this,kh).start();return await((d=(u=h(this,ss).config).onSuccess)==null?void 0:d.call(u,M,e,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,M,e,this.state.context)),await((y=(m=h(this,ss).config).onSettled)==null?void 0:y.call(m,M,null,this.state.variables,this.state.context,this)),await((b=(g=this.options).onSettled)==null?void 0:b.call(g,M,null,e,this.state.context)),j(this,bo,Dc).call(this,{type:"success",data:M}),M}catch(M){try{throw await((w=(x=h(this,ss).config).onError)==null?void 0:w.call(x,M,e,this.state.context,this)),await((S=(v=this.options).onError)==null?void 0:S.call(v,M,e,this.state.context)),await((C=(E=h(this,ss).config).onSettled)==null?void 0:C.call(E,void 0,M,this.state.variables,this.state.context,this)),await((P=(T=this.options).onSettled)==null?void 0:P.call(T,void 0,M,e,this.state.context)),M}finally{j(this,bo,Dc).call(this,{type:"error",error:M})}}finally{h(this,ss).runNext(this)}}},vo=new WeakMap,ss=new WeakMap,kh=new WeakMap,bo=new WeakSet,Dc=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),us.batch(()=>{h(this,vo).forEach(r=>{r.onMutationUpdate(e)}),h(this,ss).notify({mutation:this,type:"updated",action:e})})},j5);function ste(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wl,Ia,Db,N5,ite=(N5=class extends gE{constructor(e={}){super();A(this,wl);A(this,Ia);A(this,Db);this.config=e,_(this,wl,new Set),_(this,Ia,new Map),_(this,Db,0)}build(e,n,r){const s=new rte({mutationCache:this,mutationId:++pn(this,Db)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){h(this,wl).add(e);const n=g1(e);if(typeof n=="string"){const r=h(this,Ia).get(n);r?r.push(e):h(this,Ia).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(h(this,wl).delete(e)){const n=g1(e);if(typeof n=="string"){const r=h(this,Ia).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&h(this,Ia).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=g1(e);if(typeof n=="string"){const r=h(this,Ia).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=g1(e);if(typeof n=="string"){const s=(r=h(this,Ia).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){us.batch(()=>{h(this,wl).forEach(e=>{this.notify({type:"removed",mutation:e})}),h(this,wl).clear(),h(this,Ia).clear()})}getAll(){return Array.from(h(this,wl))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>AO(n,r))}findAll(e={}){return this.getAll().filter(n=>AO(e,n))}notify(e){us.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return us.batch(()=>Promise.all(e.map(n=>n.continue().catch(Pa))))}},wl=new WeakMap,Ia=new WeakMap,Db=new WeakMap,N5);function g1(t){var e;return(e=t.options.scope)==null?void 0:e.id}function NO(t){return{onFetch:(e,n)=>{var d,f,p,m,y;const r=e.options,s=(p=(f=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,i=((m=e.state.data)==null?void 0:m.pages)||[],a=((y=e.state.data)==null?void 0:y.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let g=!1;const b=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},x=Az(e.options,e.fetchOptions),w=async(v,S,E)=>{if(g)return Promise.reject();if(S==null&&v.pages.length)return Promise.resolve(v);const T=(()=>{const O={client:e.client,queryKey:e.queryKey,pageParam:S,direction:E?"backward":"forward",meta:e.options.meta};return b(O),O})(),P=await x(T),{maxPages:M}=e.options,R=E?qee:Hee;return{pages:R(v.pages,P,M),pageParams:R(v.pageParams,S,M)}};if(s&&i.length){const v=s==="backward",S=v?ate:PO,E={pages:i,pageParams:a},C=S(r,E);o=await w(E,C,v)}else{const v=t??i.length;do{const S=l===0?a[0]??r.initialPageParam:PO(r,o);if(l>0&&S==null)break;o=await w(o,S),l++}while(l<v)}return o};e.options.persister?e.fetchFn=()=>{var g,b;return(b=(g=e.options).persister)==null?void 0:b.call(g,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function PO(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 ate(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 gn,Kc,Yc,Fm,Bm,Xc,$m,Um,P5,ote=(P5=class{constructor(t={}){A(this,gn);A(this,Kc);A(this,Yc);A(this,Fm);A(this,Bm);A(this,Xc);A(this,$m);A(this,Um);_(this,gn,t.queryCache||new nte),_(this,Kc,t.mutationCache||new ite),_(this,Yc,t.defaultOptions||{}),_(this,Fm,new Map),_(this,Bm,new Map),_(this,Xc,0)}mount(){pn(this,Xc)._++,h(this,Xc)===1&&(_(this,$m,Tz.subscribe(async t=>{t&&(await this.resumePausedMutations(),h(this,gn).onFocus())})),_(this,Um,MS.subscribe(async t=>{t&&(await this.resumePausedMutations(),h(this,gn).onOnline())})))}unmount(){var t,e;pn(this,Xc)._--,h(this,Xc)===0&&((t=h(this,$m))==null||t.call(this),_(this,$m,void 0),(e=h(this,Um))==null||e.call(this),_(this,Um,void 0))}isFetching(t){return h(this,gn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return h(this,Kc).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=h(this,gn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=h(this,gn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(hj(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return h(this,gn).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=h(this,gn).get(r.queryHash),i=s==null?void 0:s.state.data,a=Bee(e,i);if(a!==void 0)return h(this,gn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return us.batch(()=>h(this,gn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=h(this,gn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=h(this,gn);us.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=h(this,gn);return us.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=us.batch(()=>h(this,gn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Pa).catch(Pa)}invalidateQueries(t,e={}){return us.batch(()=>(h(this,gn).findAll(t).forEach(n=>
486{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=us.batch(()=>h(this,gn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Pa)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Pa)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=h(this,gn).build(this,e);return n.isStaleByTime(hj(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Pa).catch(Pa)}fetchInfiniteQuery(t){return t.behavior=NO(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Pa).catch(Pa)}ensureInfiniteQueryData(t){return t.behavior=NO(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return MS.isOnline()?h(this,Kc).resumePausedMutations():Promise.resolve()}getQueryCache(){return h(this,gn)}getMutationCache(){return h(this,Kc)}getDefaultOptions(){return h(this,Yc)}setDefaultOptions(t){_(this,Yc,t)}setQueryDefaults(t,e){h(this,Fm).set(rb(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...h(this,Fm).values()],n={};return e.forEach(r=>{sb(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){h(this,Bm).set(rb(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...h(this,Bm).values()],n={};return e.forEach(r=>{sb(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...h(this,Yc).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=NR(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===PR&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...h(this,Yc).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){h(this,gn).clear(),h(this,Kc).clear()}},gn=new WeakMap,Kc=new WeakMap,Yc=new WeakMap,Fm=new WeakMap,Bm=new WeakMap,Xc=new WeakMap,$m=new WeakMap,Um=new WeakMap,P5),lte=k.createContext(void 0),cte=({client:t,children:e})=>(k.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),c.jsx(lte.Provider,{value:t,children:e}));/**
487 * @remix-run/router v1.23.0
488 *
489 * Copyright (c) Remix Software Inc.
490 *
491 * This source code is licensed under the MIT license found in the
492 * LICENSE.md file in the root directory of this source tree.
493 *
494 * @license MIT
495 */function ib(){return ib=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},ib.apply(this,arguments)}var Gu;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Gu||(Gu={}));const RO="popstate";function ute(t){t===void 0&&(t={});function e(r,s){let{pathname:i,search:a,hash:o}=r.location;return pj("",{pathname:i,search:a,hash:o},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:OS(s)}return hte(e,n,null,t)}function Rn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Iz(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function dte(){return Math.random().toString(36).substr(2,8)}function IO(t,e){return{usr:t.state,key:t.key,idx:e}}function pj(t,e,n,r){return n===void 0&&(n=null),ib({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Gy(e):e,{state:n,key:e&&e.key||r||dte()})}function OS(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 Gy(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 hte(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,o=Gu.Pop,l=null,u=d();u==null&&(u=0,a.replaceState(ib({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){o=Gu.Pop;let b=d(),x=b==null?null:b-u;u=b,l&&l({action:o,location:g.location,delta:x})}function p(b,x){o=Gu.Push;let w=pj(g.location,b,x);u=d()+1;let v=IO(w,u),S=g.createHref(w);try{a.pushState(v,"",S)}
vendor: 9,302 bytes, lines 495-504
495catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(S)}i&&l&&l({action:o,location:g.location,delta:1})}function m(b,x){o=Gu.Replace;let w=pj(g.location,b,x);u=d();let v=IO(w,u),S=g.createHref(w);a.replaceState(v,"",S),i&&l&&l({action:o,location:g.location,delta:0})}function y(b){let x=s.location.origin!=="null"?s.location.origin:s.location.href,w=typeof b=="string"?b:OS(b);return w=w.replace(/ $/,"%20"),Rn(x,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,x)}let g={get action(){return o},get location(){return t(s,a)},listen(b){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(RO,f),l=b,()=>{s.removeEventListener(RO,f),l=null}},createHref(b){return e(s,b)},createURL:y,encodeLocation(b){let x=y(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:m,go(b){return a.go(b)}};return g}var DO;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(DO||(DO={}));function fte(t,e,n){return n===void 0&&(n="/"),pte(t,e,n,!1)}function pte(t,e,n,r){let s=typeof e=="string"?Gy(e):e,i=RR(s.pathname||"/",n);if(i==null)return null;let a=Dz(t);mte(a);let o=null;for(let l=0;o==null&&l<a.length;++l){let u=Cte(i);o=_te(a[l],u,r)}return o}function Dz(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,a,o)=>{let l={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(Rn(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 u=id([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(Rn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Dz(i.children,e,d,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:kte(u,i.index),routesMeta:d})};return t.forEach((i,a)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))s(i,a);else for(let l of Mz(i.path))s(i,a,l)}),e}function Mz(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=Mz(r.join("/")),o=[];return o.push(...a.map(l=>l===""?i:[i,l].join("/"))),s&&o.push(...a),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function mte(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:Ste(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const gte=/^:[\w-]+$/,yte=3,xte=2,vte=1,bte=10,wte=-2,MO=t=>t==="*";function kte(t,e){let n=t.split("/"),r=n.length;return n.some(MO)&&(r+=wte),e&&(r+=xte),n.filter(s=>!MO(s)).reduce((s,i)=>s+(gte.test(i)?yte:i===""?vte:bte),r)}function Ste(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function _te(t,e,n){let{routesMeta:r}=t,s={},i="/",a=[];for(let o=0;o<r.length;++o){let l=r[o],u=o===r.length-1,d=i==="/"?e:e.slice(i.length)||"/",f=OO({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),p=l.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=OO({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!f)return null;Object.assign(s,f.params),a.push({params:s,pathname:id([i,f.pathname]),pathnameBase:Nte(id([i,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(i=id([i,f.pathnameBase]))}return a}function OO(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=Ete(t.path,t.caseSensitive,t.end),s=e.match(n);if(!s)return null;let i=s[0],a=i.replace(/(.)\/+$/,"$1"),o=s.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:p,isOptional:m}=d;if(p==="*"){let g=o[f]||"";a=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const y=o[f];return m&&!y?u[p]=void 0:u[p]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:t}}function Ete(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Iz(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=[],s="^"+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:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function Cte(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Iz(!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 RR(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 Ate(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?Gy(t):t;return{pathname:n?n.startsWith("/")?n:Tte(n,e):e,search:Pte(r),hash:Rte(s)}}function Tte(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function $C(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 jte(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function IR(t,e){let n=jte(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function DR(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=Gy(t):(s=ib({},t),Rn(!s.pathname||!s.pathname.includes("?"),$C("?","pathname","search",s)),Rn(!s.pathname||!s.pathname.includes("#"),$C("#","pathname","hash",s)),Rn(!s.search||!s.search.includes("#"),$C("#","search","hash",s)));let i=t===""||s.pathname==="",a=i?"/":s.pathname,o;if(a==null)o=n;else{let f=e.length-1;if(!r&&a.startsWith("..")){let p=a.split("/");for(;p[0]==="..";)p.shift(),f-=1;s.pathname=p.join("/")}o=f>=0?e[f]:"/"}let l=Ate(s,o),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const id=t=>t.join("/").replace(/\/\/+/g,"/"),Nte=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Pte=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Rte=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Ite(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Oz=["post","put","patch","delete"];new Set(Oz);const Dte=["get",...Oz];new Set(Dte);/**
496 * React Router v6.30.1
497 *
498 * Copyright (c) Remix Software Inc.
499 *
500 * This source code is licensed under the MIT license found in the
501 * LICENSE.md file in the root directory of this source tree.
502 *
503 * @license MIT
504 */function ab(){return ab=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},ab.apply(this,arguments)}const MR=k.createContext(null),Mte=k.createContext(null),Nd=k.createContext(null),xE=k.createContext(null),Ec=k.createContext({outlet:null,matches:[],isDataRoute:!1}),Lz=k.createContext(null);function Ote(t,e){let{relative:n}=e===void 0?{}:e;Ky()||Rn(!1);let{basename:r,navigator:s}=k.useContext(Nd),{hash:i,pathname:a,search:o}=Bz(t,{relative:n}),l=a;return r!=="/"&&(l=a==="/"?r:id([r,a])),s.createHref({pathname:l,search:o,hash:i})}function Ky(){return k.useContext(xE)!=null}function Pd(){return Ky()||Rn(!1),k.useContext(xE).location}function Fz(t){k.useContext(Nd).static||k.useLayoutEffect(t)}function Rd(){let{isDataRoute:t}=k.useContext(Ec);return t?Yte():Lte()}function Lte(){Ky()||Rn(!1);let t=k.useContext(MR),{basename:e,future:n,navigator:r}=k.useContext(Nd),{matches:s}=k.useContext(Ec),{pathname:i}=Pd(),a=JSON.stringify(IR(s,n.v7_relativeSplatPath)),o=k.useRef(!1);return Fz(()=>{o.current=!0}),k.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let f=DR(u,JSON.parse(a),i,d.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:id([e,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[e,r,a,i,t])}function OR(){let{matches:t}=k.useContext(Ec),e=t[t.length-1];return e?e.params:{}}function Bz(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=k.useContext(Nd),{matches:s}=k.useContext(Ec),{pathname:i}=Pd(),a=JSON.stringify(IR(s,r.v7_relativeSplatPath));return k.useMemo(()=>DR(t,JSON.parse(a),i,n==="path"),[t,a,i,n])}function Fte(t,e){return Bte(t,e)}function Bte(t,e,n,r){Ky()||Rn(!1);let{navigator:s}=k.useContext(Nd),{matches:i}=k.useContext(Ec),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=Pd(),d;if(e){var f;
vendor: 5,687 bytes, line 504
504let b=typeof e=="string"?Gy(e):e;l==="/"||(f=b.pathname)!=null&&f.startsWith(l)||Rn(!1),d=b}else d=u;let p=d.pathname||"/",m=p;if(l!=="/"){let b=l.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let y=fte(t,{pathname:m}),g=Wte(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},o,b.params),pathname:id([l,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:id([l,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n,r);return e&&g?k.createElement(xE.Provider,{value:{location:ab({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Gu.Pop}},g):g}function $te(){let t=Kte(),e=Ite(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},e),n?k.createElement("pre",{style:s},n):null,null)}const Ute=k.createElement($te,null);class zte extends k.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?k.createElement(Ec.Provider,{value:this.props.routeContext},k.createElement(Lz.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Vte(t){let{routeContext:e,match:n,children:r}=t,s=k.useContext(MR);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(Ec.Provider,{value:e},r)}function Wte(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,o=(s=n)==null?void 0:s.errors;if(o!=null){let d=a.findIndex(f=>f.route.id&&(o==null?void 0:o[f.route.id])!==void 0);d>=0||Rn(!1),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<a.length;d++){let f=a[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:p,errors:m}=n,y=f.route.loader&&p[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||y){l=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,f,p)=>{let m,y=!1,g=null,b=null;n&&(m=o&&f.route.id?o[f.route.id]:void 0,g=f.route.errorElement||Ute,l&&(u<0&&p===0?(y=!0,b=null):u===p&&(y=!0,b=f.route.hydrateFallbackElement||null)));let x=e.concat(a.slice(0,p+1)),w=()=>{let v;return m?v=g:y?v=b:f.route.Component?v=k.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=d,k.createElement(Vte,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?k.createElement(zte,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):w()},null)}var $z=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}($z||{}),LS=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}(LS||{});function Hte(t){let e=k.useContext(MR);return e||Rn(!1),e}function qte(t){let e=k.useContext(Mte);return e||Rn(!1),e}function Gte(t){let e=k.useContext(Ec);return e||Rn(!1),e}function Uz(t){let e=Gte(),n=e.matches[e.matches.length-1];return n.route.id||Rn(!1),n.route.id}function Kte(){var t;let e=k.useContext(Lz),n=qte(LS.UseRouteError),r=Uz(LS.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Yte(){let{router:t}=Hte($z.UseNavigateStable),e=Uz(LS.UseNavigateStable),n=k.useRef(!1);return Fz(()=>{n.current=!0}),k.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,ab({fromRouteId:e},i)))},[t,e])}function Xte(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function mj(t){let{to:e,replace:n,state:r,relative:s}=t;Ky()||Rn(!1);let{future:i,static:a}=k.useContext(Nd),{matches:o}=k.useContext(Ec),{pathname:l}=Pd(),u=Rd(),d=DR(e,IR(o,i.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return k.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:s}),[u,f,s,n,r]),null}function _n(t){Rn(!1)}function Zte(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Gu.Pop,navigator:i,static:a=!1,future:o}=t;Ky()&&Rn(!1);let l=e.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:l,navigator:i,static:a,future:ab({v7_relativeSplatPath:!1},o)}),[l,o,i,a]);typeof r=="string"&&(r=Gy(r));let{pathname:d="/",search:f="",hash:p="",state:m=null,key:y="default"}=r,g=k.useMemo(()=>{let b=RR(d,l);return b==null?null:{location:{pathname:b,search:f,hash:p,state:m,ke
504y:y},navigationType:s}},[l,d,f,p,m,y,s]);return g==null?null:k.createElement(Nd.Provider,{value:u},k.createElement(xE.Provider,{children:n,value:g}))}function Qte(t){let{children:e,location:n}=t;return Fte(gj(e),n)}new Promise(()=>{});function gj(t,e){e===void 0&&(e=[]);let n=[];return k.Children.forEach(t,(r,s)=>{if(!k.isValidElement(r))return;let i=[...e,s];if(r.type===k.Fragment){n.push.apply(n,gj(r.props.children,i));return}r.type!==_n&&Rn(!1),!r.props.index||!r.props.children||Rn(!1);let a={id:r.props.id||i.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=gj(r.props.children,i)),n.push(a)}),n}/**
505 * React Router DOM v6.30.1
506 *
507 * Copyright (c) Remix Software Inc.
508 *
509 * This source code is licensed under the MIT license found in the
510 * LICENSE.md file in the root directory of this source tree.
511 *
512 * @license MIT
513 */function yj(){return yj=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},yj.apply(this,arguments)}function Jte(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i<r.length;i++)s=r[i],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function ene(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function tne(t,e){return t.button===0&&(!e||e==="_self")&&!ene(t)}function xj(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function nne(t,e){let n=xj(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const rne=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],sne="6";try{window.__reactRouterVersion=sne}catch{}const ine="startTransition",LO=fP[ine];function ane(t){let{basename:e,children:n,future:r,window:s}=t,i=k.useRef();i.current==null&&(i.current=ute({window:s,v5Compat:!0}));let a=i.current,[o,l]=k.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},d=k.useCallback(f=>{u&&LO?LO(()=>l(f)):l(f)},[l,u]);return k.useLayoutEffect(()=>a.listen(d),[a,d]),k.useEffect(()=>Xte(r),[r]),k.createElement(Zte,{basename:e,children:n,location:o.location,navigationType:o.action,navigator:a,future:r})}const one=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lne=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rt=k.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:a,state:o,target:l,to:u,preventScrollReset:d,viewTransition:f}=e,p=Jte(e,rne),{basename:m}=k.useContext(Nd),y,g=!1;if(typeof u=="string"&&lne.test(u)&&(y=u,one))try{let v=new URL(window.location.href),S=u.startsWith("//")?new URL(v.protocol+u):new URL(u),E=RR(S.pathname,m);S.origin===v.origin&&E!=null?u=E+S.search+S.hash:g=!0}catch{}let b=Ote(u,{relative:s}),x=cne(u,{replace:a,state:o,target:l,preventScrollReset:d,relative:s,viewTransition:f});function w(v){r&&r(v),v.defaultPrevented||x(v)}return k.createElement("a",yj({},p,{href:y||b,onClick:g||i?r:w,ref:n,target:l}))});var FO;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(FO||(FO={}));var BO;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(BO||(BO={}));function cne(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:a,viewTransition:o}=e===void 0?{}:e,l=Rd(),u=Pd(),d=Bz(t,{relative:a});return k.useCallback(f=>{if(tne(f,n)){f.preventDefault();let p=r!==void 0?r:OS(u)===OS(d);l(t,{replace:p,state:s,preventScrollReset:i,relative:a,viewTransition:o})}},[u,l,d,r,s,n,t,i,a,o])}function zz(t){let e=k.useRef(xj(t)),n=k.useRef(!1),r=Pd(),s=k.useMemo(()=>nne(r.search,n.current?null:e.current),[r.search]),i=Rd(),a=k.useCallback((o,l)=>{const u=xj(typeof o=="function"?o(s):o);n.current=!0,i("?"+u,l)},[i,s]);return[s,a]}var une=typeof Element<"u",dne=typeof Map=="function",hne=typeof Set=="function",fne=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function dk(t,e){if(t===e)return!0;
513if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,s;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!dk(t[r],e[r]))return!1;return!0}var i;if(dne&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;for(i=t.entries();!(r=i.next()).done;)if(!dk(r.value[1],e.get(r.value[0])))return!1;return!0}if(hne&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(fne&&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(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[r]))return!1;if(une&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((s[r]==="_owner"||s[r]==="__v"||s[r]==="__o")&&t.$$typeof)&&!dk(t[s[r]],e[s[r]]))return!1;return!0}return t!==t&&e!==e}var pne=function(e,n){try{return dk(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 mne=Sc(pne);var gne=function(t,e,n,r,s,i,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 u=[n,r,s,i,a,o],d=0;l=new Error(e.replace(/%s/g,function(){return u[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},yne=gne;const $O=Sc(yne);var xne=function(e,n,r,s){var i=r?r.call(s,e,n):void 0;if(i!==void 0)return!!i;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),u=0;u<a.length;u++){var d=a[u];if(!l(d))return!1;var f=e[d],p=n[d];if(i=r?r.call(s,f,p,d):void 0,i===!1||i===void 0&&f!==p)return!1}return!0};const vne=Sc(xne);var Vz=(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))(Vz||{}),UC={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"]}},UO=Object.values(Vz),vE={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Wz=Object.entries(vE).reduce((t,[e,n])=>(t[n]=e,t),{}),Ya="data-rh",km={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},Sm=(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},bne=t=>{let e=Sm(t,"title");const n=Sm(t,km.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),n&&e)return n.replace(/%s/g,()=>e);const r=Sm(t,km.DEFAULT_TITLE);return e||r||void 0},wne=t=>Sm(t,km.ON_CHANGE_CLIENT_STATE)||(()=>{}),zC=(t,e)=>e.filter(n=>typeof n[t]<"u").map(n=>n[t]).reduce((n,r)=>({...n,...r}),{}),kne=(t,e)=>e.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const s=Object.keys(r);for(let i=0;i<s.length;i+=1){const o=s[i].toLowerCase();if(t.indexOf(o)!==-1&&r[o])return n.concat(r)}}return n},[]),Sne=t=>console&&typeof console.warn=="function"&&console.warn(t),xx=(t,e,n)=>{const r={};return n.filter(s=>Array.isArray(s[t])?!0:(typeof s[t]<"u"&&Sne(`Helmet: ${t} should be of type "Array". Instead found type "${typeof s[t]}"`),!1)).map(s=>s[t]).reverse().reduce((s,i)=>{const a={};i.filter(l=>{let u;const d=Object.keys(l);for(let p=0;p<d.length;p+=1){const m=d[p],y=m.toLowerCase();e.indexOf(y)!==-1&&!(u==="rel"&&l[u].toLowerCase()==="canonical")&&!(y==="rel"&&l[y].toLowerCase()==="stylesheet")&&(u=y),e.indexOf(m)!==-1&&(m==="innerHTML"||m==="cssText"||m==="itemprop")&&(u=m)}if(!u||!l[u])return!1;const f=l[u].toLowerCase();return r[u]||(r[u]={}),a[u]||(a[u]={}),r[u][f]?!1:(a[u][f]=!0,!0)}
513).reverse().forEach(l=>s.push(l));const o=Object.keys(a);for(let l=0;l<o.length;l+=1){const u=o[l],d={...r[u],...a[u]};r[u]=d}return s},[]).reverse()},_ne=(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},Ene=t=>({baseTag:kne(["href"],t),bodyAttributes:zC("bodyAttributes",t),defer:Sm(t,km.DEFER),encode:Sm(t,km.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:zC("htmlAttributes",t),linkTags:xx("link",["rel","href"],t),metaTags:xx("meta",["name","charset","http-equiv","property","itemprop"],t),noscriptTags:xx("noscript",["innerHTML"],t),onChangeClientState:wne(t),scriptTags:xx("script",["src","innerHTML"],t),styleTags:xx("style",["cssText"],t),title:bne(t),titleAttributes:zC("titleAttributes",t),prioritizeSeoTags:_ne(t,km.PRIORITIZE_SEO_TAGS)}),Hz=t=>Array.isArray(t)?t.join(""):t,Cne=(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},VC=(t,e)=>Array.isArray(t)?t.reduce((n,r)=>(Cne(r,e)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:t,priority:[]},zO=(t,e)=>({...t,[e]:void 0}),Ane=["noscript","script","style"],vj=(t,e=!0)=>e===!1?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),qz=t=>Object.keys(t).reduce((e,n)=>{const r=typeof t[n]<"u"?`${n}="${t[n]}"`:`${n}`;return e?`${e} ${r}`:r},""),Tne=(t,e,n,r)=>{const s=qz(n),i=Hz(e);return s?`<${t} ${Ya}="true" ${s}>${vj(i,r)}</${t}>`:`<${t} ${Ya}="true">${vj(i,r)}</${t}>`},jne=(t,e,n=!0)=>e.reduce((r,s)=>{const i=s,a=Object.keys(i).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const f=typeof i[d]>"u"?d:`${d}="${vj(i[d],n)}"`;return u?`${u} ${f}`:f},""),o=i.innerHTML||i.cssText||"",l=Ane.indexOf(t)===-1;return`${r}<${t} ${Ya}="true" ${a}${l?"/>":`>${o}</${t}>`}`},""),Gz=(t,e={})=>Object.keys(t).reduce((n,r)=>{const s=vE[r];return n[s||r]=t[r],n},e),Nne=(t,e,n)=>{const r={key:e,[Ya]:!0},s=Gz(n,r);return[K.createElement("title",s,e)]},hk=(t,e)=>e.map((n,r)=>{const s={key:r,[Ya]:!0};return Object.keys(n).forEach(i=>{const o=vE[i]||i;if(o==="innerHTML"||o==="cssText"){const l=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[o]=n[i]}),K.createElement(t,s)}),zi=(t,e,n=!0)=>{switch(t){case"title":return{toComponent:()=>Nne(t,e.title,e.titleAttributes),toString:()=>Tne(t,e.title,e.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Gz(e),toString:()=>qz(e)};default:return{toComponent:()=>hk(t,e),toString:()=>jne(t,e,n)}}},Pne=({metaTags:t,linkTags:e,scriptTags:n,encode:r})=>{const s=VC(t,UC.meta),i=VC(e,UC.link),a=VC(n,UC.script);return{priorityMethods:{toComponent:()=>[...hk("meta",s.priority),...hk("link",i.priority),...hk("script",a.priority)],toString:()=>`${zi("meta",s.priority,r)} ${zi("link",i.priority,r)} ${zi("script",a.priority,r)}`},metaTags:s.default,linkTags:i.default,scriptTags:a.default}},Rne=t=>{const{baseTag:e,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:i,styleTags:a,title:o="",titleAttributes:l,prioritizeSeoTags:u}=t;let{linkTags:d,metaTags:f,scriptTags:p}=t,m={toComponent:()=>[],toString:()=>""};return u&&({priorityMethods:m,linkTags:d,metaTags:f,scriptTags:p}=Pne(t)),{priority:m,base:zi("base",e,r),bodyAttributes:zi("bodyAttributes",n,r),htmlAttributes:zi("htmlAttributes",s,r),link:zi("link",d,r),meta:zi("meta",f,r),noscript:zi("noscript",i,r),script:zi("script",p,r),style:zi("style",a,r),title:zi("title",{title:o,titleAttributes:l},r)}},bj=Rne,y1=[],LR=!!(typeof window<"u"&&window.document&&window.document.createElement),wj=class{constructor(t,e){Z(this,"instances",[]);Z(this,"canUseDOM",LR);Z(this,"context");Z(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?y1:this.instances,add:t=>{(this.canUseDOM?y1:this.instances).push(t)},remove:t=>{const e=(this.canUseDOM?y1:this.instances).indexOf(t);(this.canUseDOM?y1:this.instances).splice(e,1)}}});this.context=t,this.canUseDOM=e||!1,e||(t.helmet=bj({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Ine=parseInt(K.version.split(".")[0],10),kj=Ine>=19,Dne={},Kz=K.createContext(Dne),Sh,Yz=(Sh=class extends k.Component{constructor(n){super(n);Z(this,"helmetData");kj?this.helmetData=null:this.helmetData=new wj(this.props.context||{},Sh.canUseDOM)}render(){return kj?K.createElement(K.Fragment,null,this.props.children):K.createElement(Kz.Provider,{value:this.helmetData.value},this.props.children)}},Z(Sh,"canUseDOM",LR),Sh),mp=(t,e)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${t}[${Ya}]`),s=[].slice.call(r),i=[];let a;return e&&e.length&&e.forEach(o=>{const l=document.createElement(t);for(const u in o)if(Object.prototype.hasOwnProperty.call(o,u))if(u==="innerHTML")l.innerHTML=o.innerHTML;else if(u==="cssText"){const d=o.cssText;
513l.appendChild(document.createTextNode(d))}else{const d=u,f=typeof o[d]>"u"?"":o[d];l.setAttribute(u,f)}l.setAttribute(Ya,"true"),s.some((u,d)=>(a=d,l.isEqualNode(u)))?s.splice(a,1):i.push(l)}),s.forEach(o=>{var l;return(l=o.parentNode)==null?void 0:l.removeChild(o)}),i.forEach(o=>n.appendChild(o)),{oldTags:s,newTags:i}},Sj=(t,e)=>{const n=document.getElementsByTagName(t)[0];if(!n)return;const r=n.getAttribute(Ya),s=r?r.split(","):[],i=[...s],a=Object.keys(e);for(const o of a){const l=e[o]||"";n.getAttribute(o)!==l&&n.setAttribute(o,l),s.indexOf(o)===-1&&s.push(o);const u=i.indexOf(o);u!==-1&&i.splice(u,1)}for(let o=i.length-1;o>=0;o-=1)n.removeAttribute(i[o]);s.length===i.length?n.removeAttribute(Ya):n.getAttribute(Ya)!==a.join(",")&&n.setAttribute(Ya,a.join(","))},Mne=(t,e)=>{typeof t<"u"&&document.title!==t&&(document.title=Hz(t)),Sj("title",e)},VO=(t,e)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:i,metaTags:a,noscriptTags:o,onChangeClientState:l,scriptTags:u,styleTags:d,title:f,titleAttributes:p}=t;Sj("body",r),Sj("html",s),Mne(f,p);const m={baseTag:mp("base",n),linkTags:mp("link",i),metaTags:mp("meta",a),noscriptTags:mp("noscript",o),scriptTags:mp("script",u),styleTags:mp("style",d)},y={},g={};Object.keys(m).forEach(b=>{const{newTags:x,oldTags:w}=m[b];x.length&&(y[b]=x),w.length&&(g[b]=m[b].oldTags)}),e&&e(),l(t,y,g)},vx=null,One=t=>{vx&&cancelAnimationFrame(vx),t.defer?vx=requestAnimationFrame(()=>{VO(t,()=>{vx=null})}):(VO(t),vx=null)},Lne=One,WO=class extends k.Component{constructor(){super(...arguments);Z(this,"rendered",!1)}shouldComponentUpdate(e){return!vne(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 s=Ene(e.get().map(i=>{const{context:a,...o}=i.props;return o}));Yz.canUseDOM?Lne(s):bj&&(r=bj(s)),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}},fk=[],HO=t=>{const e={};for(const n of Object.keys(t))e[Wz[n]||n]=t[n];return e},Bd=t=>{const e={};for(const n of Object.keys(t)){const r=vE[n];e[r||n]=t[n]}return e},qO=(t,e)=>{if(!LR)return;const n=document.getElementsByTagName(t)[0];if(!n)return;const r="data-rh-managed",s=n.getAttribute(r),i=s?s.split(","):[],a=Object.keys(e);for(const o of i)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)},WC=()=>{const t={},e={};for(const n of fk){const{htmlAttributes:r,bodyAttributes:s}=n.props;r&&Object.assign(t,HO(r)),s&&Object.assign(e,HO(s))}qO("html",t),qO("body",e)},Fne=class extends k.Component{componentDidMount(){fk.push(this),WC()}componentDidUpdate(){WC()}componentWillUnmount(){const t=fk.indexOf(this);t!==-1&&fk.splice(t,1),WC()}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 K.createElement("title",Bd(e),t)}renderBase(){const{base:t}=this.props;return t?K.createElement("base",Bd(t)):null}renderMeta(){const{meta:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>K.createElement("meta",{key:n,...Bd(e)}))}renderLink(){const{link:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>K.createElement("link",{key:n,...Bd(e)}))}renderScript(){const{script:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>{const{innerHTML:r,...s}=e,i=Bd(s);return r&&(i.dangerouslySetInnerHTML={__html:r}),K.createElement("script",{key:n,...i})})}renderStyle(){const{style:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>{const{cssText:r,...s}=e,i=Bd(s);return r&&(i.dangerouslySetInnerHTML={__html:r}),K.createElement("style",{key:n,...i})})}renderNoscript(){const{noscript:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,n)=>{const{innerHTML:r,...s}=e,i=Bd(s);return r&&(i.dangerouslySetInnerHTML={__html:r}),K.createElement("noscript",{key:n,...i})})}render(){return K.createElement(K.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},cT,xs=(cT=class extends k.Component{shouldComponentUpdate(t){return!mne(zO(this.props,"helmetData"),zO(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}
513warnOnInvalidChildren(t,e){return $O(UO.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 ${UO.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),$O(!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 K.Children.forEach(t,r=>{if(!r||!r.props)return;const{children:s,...i}=r.props,a=Object.keys(i).reduce((l,u)=>(l[Wz[u]||u]=i[u],l),{});let{type:o}=r;switch(typeof o=="symbol"?o=o.toString():this.warnOnInvalidChildren(r,s),o){case"Symbol(react.fragment)":e=this.mapChildrenToProps(s,e);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,a,s);break;default:e=this.mapObjectTypeChildren(r,e,a,s);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 wj)){const s=r;r=new wj(s.context,!0),delete n.helmetData}return kj?K.createElement(Fne,{...n}):r?K.createElement(WO,{...n,context:r.value}):K.createElement(Kz.Consumer,null,s=>K.createElement(WO,{...n,context:s}))}},Z(cT,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),cT);const Bne=oE("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 shadow-elegant transition-all duration-300",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",hero:"bg-accent text-accent-foreground hover:bg-accent/90 shadow-glow hover:shadow-elegant transition-all duration-500 font-semibold",cta:"bg-primary text-primary-foreground hover:bg-primary-dark shadow-elegant hover:scale-105 transition-all duration-300 font-semibold"},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"}}),oe=k.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?pX:"button";return c.jsx(a,{className:Oe(Bne({variant:e,size:n,className:t})),ref:i,...s})});oe.displayName="Button";const $ne="/assets/hero-image-CRM1E-_9.jpg",FR=k.createContext({});function BR(t){const e=k.useRef(null);return e.current===null&&(e.current=t()),e.current}const Xz=typeof window<"u",Zz=Xz?k.useLayoutEffect:k.useEffect,bE=k.createContext(null);function $R(t,e){t.indexOf(e)===-1&&t.push(e)}function FS(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const nl=(t,e,n)=>n>e?e:n<t?t:n;let wE=()=>{},Ay=()=>{};const gc={},Qz=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Jz(t){return typeof t=="object"&&t!==null}const e6=t=>/^0[^.\s]+$/u.test(t);function t6(t){let e;return()=>(e===void 0&&(e=t()),e)}const da=t=>t,Une=(t,e)=>n=>e(t(n)),T0=(...t)=>t.reduce(Une),ob=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class UR{constructor(){this.subscriptions=[]}add(e){return $R(this.subscriptions,e),()=>FS(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const a=this.subscriptions[i];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ha=t=>t*1e3,la=t=>t/1e3;function n6(t,e){return e?t*(1e3/e):0}const r6=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,zne=1e-7,Vne=12;function Wne(t,e,n,r,s){let i,a,o=0;do a=e+(n-e)/2,i=r6(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>zne&&++o<Vne);return a}function j0(t,e,n,r){if(t===e&&n===r)return da;const s=i=>Wne(i,0,1,t,n);return i=>i===0||i===1?i:r6(s(i),e,r)}const s6=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,i6=t=>e=>1-t(1-e),a6=j0(.33,1.53,.69,.99),zR=i6(a6),o6=s6(zR),l6=t=>(t*=2)<1?.5*zR(t):.5*(2-Math.pow(2,-10*(t-1))),VR=t=>1-Math.sin(Math.acos(t)),c6=i6(VR),u6=s6(VR),Hne=j0(.42,0,1,1),qne=j0(0,0,.58,1),d6=j0(.42,0,.58,1),Gne=t=>Array.isArray(t)&&typeof t[0]!="number",h6=t=>Array.isArray(t)&&typeof t[0]=="number",GO={linear:da,easeIn:Hne,easeInOut:d6,easeOut:qne,circIn:VR,circInOut:u6,circOut:c6,backIn:zR,backInOut:o6,backOut:a6,anticipate:l6},Kne=t=>typeof t=="string",KO=t=>{if(h6(t)){Ay(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,r,s]=t;
vendor: 20,606 bytes, line 513
513return j0(e,n,r,s)}else if(Kne(t))return Ay(GO[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),GO[t];return t},x1=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],YO={value:null,addProjectionMetrics:null};function Yne(t,e){let n=new Set,r=new Set,s=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function u(f){a.has(f)&&(d.schedule(f),t()),l++,f(o)}const d={schedule:(f,p=!1,m=!1)=>{const g=m&&s?n:r;return p&&a.add(f),g.has(f)||g.add(f),f},cancel:f=>{r.delete(f),a.delete(f)},process:f=>{if(o=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(u),e&&YO.value&&YO.value.frameloop[e].push(l),l=0,n.clear(),s=!1,i&&(i=!1,d.process(f))}};return d}const Xne=40;function f6(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=x1.reduce((v,S)=>(v[S]=Yne(i,e?S:void 0),v),{}),{setup:o,read:l,resolveKeyframes:u,preUpdate:d,update:f,preRender:p,render:m,postRender:y}=a,g=()=>{const v=gc.useManualTiming?s.timestamp:performance.now();n=!1,gc.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(v-s.timestamp,Xne),1)),s.timestamp=v,s.isProcessing=!0,o.process(s),l.process(s),u.process(s),d.process(s),f.process(s),p.process(s),m.process(s),y.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(g))},b=()=>{n=!0,r=!0,s.isProcessing||t(g)};return{schedule:x1.reduce((v,S)=>{const E=a[S];return v[S]=(C,T=!1,P=!1)=>(n||b(),E.schedule(C,T,P)),v},{}),cancel:v=>{for(let S=0;S<x1.length;S++)a[x1[S]].cancel(v)},state:s,steps:a}}const{schedule:Kt,cancel:pd,state:_r,steps:HC}=f6(typeof requestAnimationFrame<"u"?requestAnimationFrame:da,!0);let pk;function Zne(){pk=void 0}const fs={now:()=>(pk===void 0&&fs.set(_r.isProcessing||gc.useManualTiming?_r.timestamp:performance.now()),pk),set:t=>{pk=t,queueMicrotask(Zne)}},p6=t=>e=>typeof e=="string"&&e.startsWith(t),m6=p6("--"),Qne=p6("var(--"),WR=t=>Qne(t)?Jne.test(t.split("/*")[0].trim()):!1,Jne=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function XO(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Yy={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},lb={...Yy,transform:t=>nl(0,1,t)},v1={...Yy,default:1},kv=t=>Math.round(t*1e5)/1e5,HR=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ere(t){return t==null}const tre=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,qR=(t,e)=>n=>!!(typeof n=="string"&&tre.test(n)&&n.startsWith(t)||e&&!ere(n)&&Object.prototype.hasOwnProperty.call(n,e)),g6=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,o]=r.match(HR);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},nre=t=>nl(0,255,t),qC={...Yy,transform:t=>Math.round(nre(t))},fh={test:qR("rgb","red"),parse:g6("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+qC.transform(t)+", "+qC.transform(e)+", "+qC.transform(n)+", "+kv(lb.transform(r))+")"};function rre(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const _j={test:qR("#"),parse:rre,transform:fh.transform},N0=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Mc=N0("deg"),Jo=N0("%"),ye=N0("px"),sre=N0("vh"),ire=N0("vw"),ZO={...Jo,parse:t=>Jo.parse(t)/100,transform:t=>Jo.transform(t*100)},rm={test:qR("hsl","hue"),parse:g6("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Jo.transform(kv(e))+", "+Jo.transform(kv(n))+", "+kv(lb.transform(r))+")"},$n={test:t=>fh.test(t)||_j.test(t)||rm.test(t),parse:t=>fh.test(t)?fh.parse(t):rm.test(t)?rm.parse(t):_j.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?fh.transform(t):rm.transform(t),getAnimatableNone:t=>{const e=$n.parse(t);return e.alpha=0,$n.transform(e)}},are=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ore(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(HR))==null?void 0:e.length)||0)+(((n=t.match(are))==null?void 0:n.length)||0)>0}const y6="number",x6="color",lre="var",cre="var(",QO="${}",ure=/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 cb(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const o=e.replace(ure,l=>($n.test(l)?(r.color.push(i),s.push(x6),n.push($n.parse(l))):l.startsWith(cre)?(r.var.push(i),s.push(lre),n.push(l)):(r.number.push(i),s.push(y6),n.push(parseFloat(l))),++i,QO)).split(QO);return{values:n,split:o,indexes:r,types:s}}function v6(t){return cb(t).values}function b6(t){const{split:e,types:n}=cb(t),r=e.length;return s=>{let i="";for(let a=0;a<r;a++)if(i+=e[a],s[a]!==void 0){const o=n[a];o===y6?i+=kv(s[a]):o===x6?i+=$n.transform(s[a]):i+=s[a]}return i}}const dre=t=>typeof t=="number"?0:$n.test(t)?$n.getAnimatableNone(t):t;function hre(t){const e=v6(t);return b6(t)(e.map(dre))}const Ja={test:ore,parse:v6,createTransformer:b6,getAnimatableNone:hre};function GC(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 fre({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,a=0;if(!e)s=i=a=n;else{const o=n<.5?n*(1+e):n+e-n*e,l=2*n-o;s=GC(l,o,t+1/3),i=GC(l,o,t),a=GC(l,o,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function BS(t,e){return n=>n>0?e:t}const cn=(t,e,n)=>t+(e-t)*n,KC=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},pre=[_j,fh,rm],mre=t=>pre.find(e=>e.test(t));function JO(t){const e=mre(t);if(wE(!!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===rm&&(n=fre(n)),n}const eL=(t,e)=>{const n=JO(t),r=JO(e);if(!n||!r)return BS(t,e);const s={...n};return i=>(s.red=KC(n.red,r.red,i),s.green=KC(n.green,r.green,i),s.blue=KC(n.blue,r.blue,i),s.alpha=cn(n.alpha,r.alpha,i),fh.transform(s))},Ej=new Set(["none","hidden"]);function gre(t,e){return Ej.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function yre(t,e){return n=>cn(t,e,n)}function GR(t){return typeof t=="number"?yre:typeof t=="string"?WR(t)?BS:$n.test(t)?eL:bre:Array.isArray(t)?w6:typeof t=="object"?$n.test(t)?eL:xre:BS}function w6(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>GR(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function xre(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=GR(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function vre(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const i=e.types[s],a=t.indexes[i][r[i]],o=t.values[a]??0;n[s]=o,r[i]++}return n}const bre=(t,e)=>{const n=Ja.createTransformer(e),r=cb(t),s=cb(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Ej.has(t)&&!s.values.length||Ej.has(e)&&!r.values.length?gre(t,e):T0(w6(vre(r,s),s.values),n):(wE(!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"),BS(t,e))};function k6(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?cn(t,e,n):GR(t)(t,e)}const wre=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Kt.update(e,n),stop:()=>pd(e),now:()=>_r.isProcessing?_r.timestamp:fs.now()}},S6=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i<s;i++)r+=Math.round(t(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},$S=2e4;function KR(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<$S;)e+=n,r=t.next(e);return e>=$S?1/0:e}function kre(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(KR(r),$S);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:la(s)}}const Sre=5;function _6(t,e,n){const r=Math.max(e-Sre,0);return n6(n-t(r),e-r)}const an={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},YC=.001;function _re({duration:t=an.duration,bounce:e=an.bounce,velocity:n=an.velocity,mass:r=an.mass}){let s,i;wE(t<=ha(an.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-e;a=nl(an.minDamping,an.maxDamping,a),t=nl(an.minDuration,an.maxDuration,la(t)),a<1?(s=u=>{const d=u*a,f=d*t,p=d-n,m=Cj(u,a),y=Math.exp(-f);return YC-p/m*y},i=u=>{const f=u*a*t,p=f*n+n,m=Math.pow(a,2)*Math.pow(u,2)*t,y=Math.exp(-f),g=Cj(Math.pow(u,2),a);return(-s(u)+YC>0?-1:1)*((p-m)*y)/g}):(s=u=>{const d=Math.exp(-u*t),f=(u-n)*t+1;return-YC+d*f},i=u=>{const d=Math.exp(-u*t),f=(n-u)*(t*t);return d*f});const o=5/t,l=Cre(s,i,o);if(t=ha(t),isNaN(l))return{stiffness:an.stiffness,damping:an.damping,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:t}}}const Ere=12;function Cre(t,e,n){let r=n;for(let s=1;s<Ere;s++)r=r-t(r)/e(r);return r}function Cj(t,e){return t*Math.sqrt(1-e*e)}const Are=["duration","bounce"],Tre=["stiffness","damping","mass"];function tL(t,e){return e.some(n=>t[n]!==void 0)}function jre(t){let e={velocity:an.velocity,stiffness:an.stiffness,damping:an.damping,mass:an.mass,isResolvedFromDuration:!1,...t};if(!tL(t,Tre)&&tL(t,Are))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*nl(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:an.mass,stiffness:s,damping:i}}else{const n=_re({...t,velocity:0});e={...e,...n,mass:an.mass},e.isResolvedFromDuration=!0}return e}function US(t=an.visualDuration,e=an.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:l,damping:u,mass:d,duration:f,velocity:p,isResolvedFromDuration:m}=jre({...n,velocity:-la(n.velocity||0)}),y=p||0,g=u/(2*Math.sqrt(l*d)),b=a-i,x=la(Math.sqrt(l/d)),w=Math.abs(b)<5;r||(r=w?an.restSpeed.granular:an.restSpeed.default),s||(s=w?an.restDelta.granular:an.restDelta.default);let v;if(g<1){const E=Cj(x,g);v=C=>{const T=Math.exp(-g*x*C);return a-T*((y+g*x*b)/E*Math.sin(E*C)+b*Math.cos(E*C))}}else if(g===1)v=E=>a-Math.exp(-x*E)*(b+(y+x*b)*E);else{const E=x*Math.sqrt(g*g-1);v=C=>{const T=Math.exp(-g*x*C),P=Math.min(E*C,300);return a-T*((y+g*x*b)*Math.sinh(P)+E*b*Math.cosh(P))/E}}const S={calculatedDuration:m&&f||null,next:E=>{const C=v(E);if(m)o.done=E>=f;else{let T=E===0?y:0;g<1&&(T=E===0?ha(y):_6(v,E,C));const P=Math.abs(T)<=r,M=Math.abs(a-C)<=s;o.done=P&&M}return o.value=o.done?a:C,o},toString:()=>{const E=Math.min(KR(S),$S),C=S6(T=>S.next(E*T).value,E,30);return E+"ms "+C},toTransition:()=>{}};return S}US.applyToOptions=t=>{const e=kre(t,100,US);return t.ease=e.ease,t.duration=ha(e.duration),t.type="keyframes",t};function Aj({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:d}){const f=t[0],p={done:!1,value:f},m=P=>o!==void 0&&P<o||l!==void 0&&P>l,y=P=>o===void 0?l:l===void 0||Math.abs(o-P)<Math.abs(l-P)?o:l;let g=n*e;const b=f+g,x=a===void 0?b:a(b);x!==b&&(g=x-f);const w=P=>-g*Math.exp(-P/r),v=P=>x+w(P),S=P=>{const M=w(P),R=v(P);p.done=Math.abs(M)<=u,p.value=p.done?x:R};let E,C;const T=P=>{m(p.value)&&(E=P,C=US({keyframes:[p.value,y(p.value)],velocity:_6(v,P,p.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return T(0),{calculatedDuration:null,next:P=>{let M=!1;return!C&&E===void 0&&(M=!0,S(P),T(P)),E!==void 0&&P>=E?C.next(P-E):(!M&&S(P),p)}}}function Nre(t,e,n){const r=[],s=n||gc.mix||k6,i=t.length-1;for(let a=0;a<i;a++){let o=s(t[a],t[a+1]);if(e){const l=Array.isArray(e)?e[a]||da:e;o=T0(l,o)}r.push(o)}return r}function Pre(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(Ay(i===e.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=Nre(e,r,s),l=o.length,u=d=>{if(a&&d<t[0])return e[0];let f=0;if(l>1)for(;f<t.length-2&&!(d<t[f+1]);f++);const p=ob(t[f],t[f+1],d);return o[f](p)};return n?d=>u(nl(t[0],t[i-1],d)):u}function Rre(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=ob(0,e,r);t.push(cn(n,1,s))}}function Ire(t){const e=[0];return Rre(e,t.length-1),e}function Dre(t,e){return t.map(n=>n*e)}function Mre(t,e){return t.map(()=>e||d6).splice(0,t.length-1)}function Sv({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=Gne(r)?r.map(KO):KO(r),i={done:!1,value:e[0]},a=Dre(n&&n.length===e.length?n:Ire(e),t),o=Pre(a,e,{ease:Array.isArray(s)?s:Mre(e,s)});return{calculatedDuration:t,next:l=>(i.value=o(l),i.done=l>=t,i)}}const Ore=t=>t!==null;function YR(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(Ore),o=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const Lre={decay:Aj,inertia:Aj,tween:Sv,keyframes:Sv,spring:US};function E6(t){typeof t.type=="string"&&(t.type=Lre[t.type])}class XR{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 Fre=t=>t/100;class ZR extends XR{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==fs.now()&&this.tick(fs.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;E6(e);const{type:n=Sv,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:o}=e;const l=n||Sv;l!==Sv&&typeof o[0]!="number"&&(this.mixKeyframes=T0(Fre,k6(o[0],o[1])),o=[0,100]);const u=l({...e,keyframes:o});i==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...o].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=KR(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}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:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:f,repeatType:p,repeatDelay:m,type:y,onUpdate:g,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?x<0:x>s;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,S=r;if(f){const P=Math.min(this.currentTime,s)/o;let M=Math.floor(P),R=P%1;!R&&P>=1&&(R=1),R===1&&M--,M=Math.min(M,f+1),!!(M%2)&&(p==="reverse"?(R=1-R,m&&(R-=m/o)):p==="mirror"&&(S=a)),v=nl(0,1,R)*o}const E=w?{done:!1,value:d[0]}:S.next(v);i&&(E.value=i(E.value));let{done:C}=E;!w&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return T&&y!==Aj&&(E.value=YR(d,this.options,b,this.speed)),g&&g(E.value),T&&this.finish(),E}then(e,n){return this.finished.then(e,n)}get duration(){return la(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+la(e)}get time(){return la(this.currentTime)}set time(e){var n;e=ha(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),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(fs.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=la(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=wre,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(i=(s=this.options).onPlay)==null||i.call(s);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(fs.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 Bre(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ph=t=>t*180/Math.PI,Tj=t=>{const e=ph(Math.atan2(t[1],t[0]));return jj(e)},$re={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Tj,rotateZ:Tj,skewX:t=>ph(Math.atan(t[1])),skewY:t=>ph(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},jj=t=>(t=t%360,t<0&&(t+=360),t),nL=Tj,rL=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),sL=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ure={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:rL,scaleY:sL,scale:t=>(rL(t)+sL(t))/2,rotateX:t=>jj(ph(Math.atan2(t[6],t[5]))),rotateY:t=>jj(ph(Math.atan2(-t[2],t[0]))),rotateZ:nL,rotate:nL,skewX:t=>ph(Math.atan(t[4])),skewY:t=>ph(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Nj(t){return t.includes("scale")?1:0}function Pj(t,e){if(!t||t==="none")return Nj(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Ure,s=n;else{const o=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=$re,s=o}if(!s)return Nj(e);const i=r[e],a=s[1].split(",").map(Vre);return typeof i=="function"?i(a):a[i]}const zre=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Pj(n,e)};function Vre(t){return parseFloat(t.trim())}const Xy=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zy=new Set(Xy),iL=t=>t===Yy||t===ye,Wre=new Set(["x","y","z"]),Hre=Xy.filter(t=>!Wre.has(t));function qre(t){const e=[];return Hre.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Ku={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-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})=>Pj(e,"x"),y:(t,{transform:e})=>Pj(e,"y")};Ku.translateX=Ku.x;Ku.translateY=Ku.y;const Bf=new Set;let Rj=!1,Ij=!1,Dj=!1;function C6(){if(Ij){const t=Array.from(Bf).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=qre(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);
vendor: 1,618 bytes, line 513
513s&&s.forEach(([i,a])=>{var o;(o=r.getValue(i))==null||o.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ij=!1,Rj=!1,Bf.forEach(t=>t.complete(Dj)),Bf.clear()}function A6(){Bf.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ij=!0)})}function Gre(){Dj=!0,A6(),C6(),Dj=!1}class QR{constructor(e,n,r,s,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Bf.add(this),Rj||(Rj=!0,Kt.read(A6),Kt.resolveKeyframes(C6))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const o=r.readValue(n,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),s&&i===void 0&&s.set(e[0])}Bre(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Bf.delete(this)}cancel(){this.state==="scheduled"&&(Bf.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Kre=t=>t.startsWith("--");function Yre(t,e,n){Kre(e)?t.style.setProperty(e,n):t.style[e]=n}const Xre={};function T6(t,e){const n=t6(t);return()=>Xre[e]??n()}const Zre=T6(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),j6=T6(()=>{try{document.createElement("div").animate({opacity:0}
513,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$x=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,aL={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$x([0,.65,.55,1]),circOut:$x([.55,0,1,.45]),backIn:$x([.31,.01,.66,-.59]),backOut:$x([.33,1.53,.69,.99])};function N6(t,e){if(t)return typeof t=="function"?j6()?S6(t,e):"ease-out":h6(t)?$x(t):Array.isArray(t)?t.map(n=>N6(n,e)||aL.easeOut):aL[t]}function Qre(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const d={[e]:n};l&&(d.offset=l);const f=N6(o,s);Array.isArray(f)&&(d.easing=f);const p={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return u&&(p.pseudoElement=u),t.animate(d,p)}function P6(t){return typeof t=="function"&&"applyToOptions"in t}function Jre({type:t,...e}){return P6(t)&&j6()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class R6 extends XR{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,Ay(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Jre(e);this.animation=Qre(n,r,s,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=YR(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(d):Yre(n,r,d),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,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.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 la(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+la(e)}get time(){return la(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ha(e)}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,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Zre()?(this.animation.timeline=e,da):n(this)}}const I6={anticipate:l6,backInOut:o6,circInOut:u6};function ese(t){return t in I6}function tse(t){typeof t.ease=="string"&&ese(t.ease)&&(t.ease=I6[t.ease])}const XC=10;class nse extends R6{constructor(e){tse(e),E6(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const o=new ZR({...a,autoplay:!1}),l=Math.max(XC,fs.now()-this.startTime),u=nl(0,XC,l-XC);n.setWithVelocity(o.sample(Math.max(0,l-u)).value,o.sample(l).value,u),o.stop()}}const oL=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ja.test(t)||t==="0")&&!t.startsWith("url("));function rse(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 sse(t,e,n,r){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],a=oL(s,e),o=oL(i,e);return wE(a===o,`You are trying to animate ${e} from "${s}" to "${i}". "${a?i:s}" is not an animatable value.`,"value-not-animatable"),!a||!o?!1:rse(t)||(n==="spring"||P6(n))&&r}function Mj(t){t.duration=0,t.type="keyframes"}const ise=new Set(["opacity","clipPath","filter","transform"]),ase=t6(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ose(t){var d;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a}=t;if(!(((d=e==null?void 0:e.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return ase()&&n&&ise.has(n)&&(n!=="transform"||!u)&&!l&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const lse=40;class cse extends XR{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:o,name:l,motionValue:u,element:d,...f}){var y;super(),this.stop=()=>{var g,b;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=fs.now();const p={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:l,motionValue:u,element:d,...f},m=(d==null?void 0:d.KeyframeResolver)||QR;this.keyframeResolver=new m(o,(g,b,x)=>this.onKeyframesResolved(g,b,p,!x),l,u,d),(y=this.keyframeResolver)==null||y.scheduleResolve()}
513onKeyframesResolved(e,n,r,s){var b,x;this.keyframeResolver=void 0;const{name:i,type:a,velocity:o,delay:l,isHandoff:u,onUpdate:d}=r;this.resolvedAt=fs.now(),sse(e,i,a,o)||((gc.instantAnimations||!l)&&(d==null||d(YR(e,r,n))),e[0]=e[e.length-1],Mj(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>lse?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},m=!u&&ose(p),y=(x=(b=p.motionValue)==null?void 0:b.owner)==null?void 0:x.current,g=m?new nse({...p,element:y}):new ZR(p);g.finished.then(()=>{this.notifyFinished()}).catch(da),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}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(),Gre()),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 D6(t,e,n,r=0,s=1){const i=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),a=t.size,o=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:o-i*r}const use=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function dse(t){const e=use.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}const hse=4;function M6(t,e,n=1){Ay(n<=hse,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=dse(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return Qz(a)?parseFloat(a):a}return WR(s)?M6(s,e,n+1):s}const fse={type:"spring",stiffness:500,damping:25,restSpeed:10},pse=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),mse={type:"keyframes",duration:.8},gse={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},yse=(t,{keyframes:e})=>e.length>2?mse:Zy.has(t)?t.startsWith("scale")?pse(e[1]):fse:gse,xse=t=>t!==null;function vse(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter(xse),i=e&&n!=="loop"&&e%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}function O6(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function JR(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?O6(n,t):n}function bse({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:a,repeatDelay:o,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const eI=(t,e,n,r={},s,i)=>a=>{const o=JR(r,t)||{},l=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-ha(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:p=>{e.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:i?void 0:s};bse(o)||Object.assign(d,yse(t,d)),d.duration&&(d.duration=ha(d.duration)),d.repeatDelay&&(d.repeatDelay=ha(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Mj(d),d.delay===0&&(f=!0)),(gc.instantAnimations||gc.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(f=!0,Mj(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,f&&!i&&e.get()!==void 0){const p=vse(d.keyframes,o);if(p!==void 0){Kt.update(()=>{d.onUpdate(p),d.onComplete()});return}}return o.isSync?new ZR(d):new cse(d)};function lL(t){const e=[{},{}];
vendor: 8,057 bytes, line 513
513return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function tI(t,e,n,r){if(typeof e=="function"){const[s,i]=lL(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=lL(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function _m(t,e,n){const r=t.getProps();return tI(r,e,n!==void 0?n:r.custom,t)}const L6=new Set(["width","height","top","left","right","bottom",...Xy]),cL=30,wse=t=>!isNaN(parseFloat(t));class kse{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=fs.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.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=fs.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wse(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 UR);const r=this.events[e].add(n);return e==="change"?()=>{r(),Kt.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=fs.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>cL)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,cL);return n6(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 Ty(t,e){return new kse(t,e)}const Oj=t=>Array.isArray(t);function Sse(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ty(n))}function _se(t){return Oj(t)?t[t.length-1]||0:t}function Ese(t,e){const n=_m(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const o=_se(i[a]);Sse(t,a,o)}}const Gr=t=>!!(t&&t.getVelocity);function Cse(t){return!!(Gr(t)&&t.add)}function Lj(t,e){const n=t.getValue("willChange");if(Cse(n))return n.add(e);if(!n&&gc.WillChange){const r=new gc.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function nI(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ase="framerAppearId",F6="data-"+nI(Ase);function B6(t){return t.props[F6]}function Tse({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function $6(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();i=i?O6(i,l):l;const u=i==null?void 0:i.reduceMotion;r&&(i=r);const d=[],f=s&&t.animationState&&t.animationState.getState()[s];for(const p in o){const m=t.getValue(p,t.latestValues[p]??null),y=o[p];if(y===void 0||f&&Tse(f,p))continue;const g={delay:n,...JR(i||{},p)},b=m.get();if(b!==void 0&&!m.isAnimating&&!Array.isArray(y)&&y===b&&!g.velocity)continue;let x=!1;if(window.MotionHandoffAnimation){const S=B6(t);if(S){const E=window.MotionHandoffAnimation(S,p,Kt);E!==null&&(g.startTime=E,x=!0)}}Lj(t,p);const w=u??t.shouldReduceMotion;m.start(eI(p,m,y,w&&L6.has(p)?{type:!1}:g,t,x));const v=m.animation;v&&d.push(v)}if(a){const p=()=>Kt.update(()=>{a&&Ese(t,a)});d.length?Promise.all(d).then(p):p()}return d}function Fj(t,e,n={}){var l;const r=_m(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all($6(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:p}=s;return jse(t,e,u,d,f,p,n)}:()=>Promise.resolve(),{when:o}=s;if(o){const[u,d]=o==="beforeChildren"?[i,a]:[a,i];return u().then(()=>d())}else return Promise.all([i(),a(n.delay)])}function jse(t,e,n=0,r=0,s=0,i=1,a){const o=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),o.push(Fj(l,e,{...a,delay:n+(typeof r=="function"?0:r)+D6(t.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(o)}function Nse(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Fj(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Fj(t,e,n);else{const s=typeof e=="function"?_m(t,e,n.custom):e;r=Promise.all($6(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const Pse={test:t=>t==="auto",parse:t=>t},U6=t=>e=>e.test(t),z6=[Yy,ye,Jo,Mc,ire,sre,Pse],uL=t=>z6.find(U6(t));function Rse(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||e6(t):!0}const Ise=new Set(["brightness","contrast","saturate","opacity"]);function Dse(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(HR)||[];if(!r)return t;const s=n.replace(r,"");let i=Ise.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const Mse=/\b([a-z-]*)\(.*?\)/gu,Bj={...Ja,getAnimatableNone:t=>{const e=t.match(Mse);return e?e.map(Dse).join(" "):t}},$j={...Ja,getAnimatableNone:t=>{const e=Ja.parse(t);return Ja.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},dL={...Yy,transform:Math.round},Ose={rotate:Mc,rotateX:Mc,rotateY:Mc,rotateZ:Mc,scale:v1,scaleX:v1,scaleY:v1,scaleZ:v1,skew:Mc,skewX:Mc,skewY:Mc,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:lb,originX:ZO,originY:ZO,originZ:ye},rI={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,inset:ye,insetBlock:ye,insetBlockStart:ye,insetBlockEnd:ye,insetInline:ye,insetInlineStart:ye,insetInlineEnd:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,paddingBlock:ye,paddingBlockStart:ye,paddingBlockEnd:ye,paddingInline:ye,paddingInlineStart:ye,paddingInlineEnd:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,marginBlock:ye,marginBlockStart:ye,marginBlockEnd:ye,marginInline:ye,marginInlineStart:ye,marginInlineEnd:ye,fontSize:ye,backgroundPositionX:ye,backgroundPositionY:ye,...Ose,zIndex:dL,fillOpacity:lb,strokeOpacity:lb,numOctaves:dL},Lse={...rI,color:$n,backgroundColor:$n,outlineColor:$n,fill:$n,stroke:$n,borderColor:$n,borderTopColor:$n,borderRightColor:$n,borderBottomColor:$n,borderLeftColor:$n,filter:Bj,WebkitFilter:Bj,mask:$j,WebkitMask:$j},V6=t=>Lse[t],Fse=new Set([Bj,$j]);function W6(t,e){let n=V6(t);return Fse.has(n)||(n=Ja),n.getAnimatableNone?n.getAnimatableNone(e):void 0}
vendor: 1,723 bytes, line 513
513const Bse=new Set(["auto","none","0"]);function $se(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!Bse.has(i)&&cb(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=W6(n,s)}class Use extends QR{constructor(e,n,r,s,i){super(e,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let f=e[d];if(typeof f=="string"&&(f=f.trim(),WR(f))){const p=M6(f,n.current);p!==void 0&&(e[d]=p),d===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!L6.has(r)||e.length!==2)return;const[s,i]=e,a=uL(s),o=uL(i),l=XO(s),u=XO(i);if(l!==u&&Ku[r]){this.needsMeasurement=!0;return}if(a!==o)if(iL(a)&&iL(o))for(let d=0;d<e.length;d++){const f=e[d];typeof f=="string"&&(e[d]=parseFloat(f))}else Ku[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||Rse(e[s]))&&r.push(s);r.length&&$se(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=Ku[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var o;const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=Ku[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: 11,910 bytes, line 513
513h(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const zse=new Set(["opacity","clipPath","filter","transform"]);function sI(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const s=document.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const H6=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Uj(t){return Jz(t)&&"offsetHeight"in t}const{schedule:iI,cancel:ZCe}=f6(queueMicrotask,!1),Aa={x:!1,y:!1};function q6(){return Aa.x||Aa.y}function Vse(t){return t==="x"||t==="y"?Aa[t]?null:(Aa[t]=!0,()=>{Aa[t]=!1}):Aa.x||Aa.y?null:(Aa.x=Aa.y=!0,()=>{Aa.x=Aa.y=!1})}function G6(t,e){const n=sI(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function Wse(t){return!(t.pointerType==="touch"||q6())}function Hse(t,e,n={}){const[r,s,i]=G6(t,n);return r.forEach(a=>{let o=!1,l=!1,u;const d=()=>{a.removeEventListener("pointerleave",y)},f=b=>{u&&(u(b),u=void 0),d()},p=b=>{o=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),l&&(l=!1,f(b))},m=()=>{o=!0,window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",p,s)},y=b=>{if(b.pointerType!=="touch"){if(o){l=!0;return}f(b)}},g=b=>{if(!Wse(b))return;l=!1;const x=e(a,b);typeof x=="function"&&(u=x,a.addEventListener("pointerleave",y,s))};a.addEventListener("pointerenter",g,s),a.addEventListener("pointerdown",m,s)}),i}const K6=(t,e)=>e?t===e?!0:K6(t,e.parentElement):!1,aI=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,qse=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Gse(t){return qse.has(t.tagName)||t.isContentEditable===!0}const Kse=new Set(["INPUT","SELECT","TEXTAREA"]);function Yse(t){return Kse.has(t.tagName)||t.isContentEditable===!0}const mk=new WeakSet;function hL(t){return e=>{e.key==="Enter"&&t(e)}}function ZC(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Xse=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=hL(()=>{if(mk.has(n))return;ZC(n,"down");const s=hL(()=>{ZC(n,"up")}),i=()=>ZC(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function fL(t){return aI(t)&&!q6()}const pL=new WeakSet;function Zse(t,e,n={}){const[r,s,i]=G6(t,n),a=o=>{const l=o.currentTarget;if(!fL(o)||pL.has(o))return;mk.add(l),n.stopPropagation&&pL.add(o);const u=e(l,o),d=(m,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),mk.has(l)&&mk.delete(l),fL(m)&&typeof u=="function"&&u(m,{success:y})},f=m=>{d(m,l===window||l===document||n.useGlobalTarget||K6(l,m.target))},p=m=>{d(m,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",p,s)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,s),Uj(o)&&(o.addEventListener("focus",u=>Xse(u,s)),!Gse(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),i}function oI(t){return Jz(t)&&"ownerSVGElement"in t}const gk=new WeakMap;let Oc;const Y6=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:oI(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Qse=Y6("inline","width","offsetWidth"),Jse=Y6("block","height","offsetHeight");function eie({target:t,borderBoxSize:e}){var n;(n=gk.get(t))==null||n.forEach(r=>{r(t,{get width(){return Qse(t,e)},get height(){return Jse(t,e)}})})}function tie(t){t.forEach(eie)}function nie(){typeof ResizeObserver>"u"||(Oc=new ResizeObserver(tie))}function rie(t,e){Oc||nie();const n=sI(t);return n.forEach(r=>{let s=gk.get(r);s||(s=new Set,gk.set(r,s)),s.add(e),Oc==null||Oc.observe(r)}),()=>{n.forEach(r=>{const s=gk.get(r);s==null||s.delete(e),s!=null&&s.size||Oc==null||Oc.unobserve(r)})}}const yk=new Set;let sm;function sie(){sm=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};yk.forEach(e=>e(t))},window.addEventListener("resize",sm)}function iie(t){return yk.add(t),sm||sie(),()=>{yk.delete(t),!yk.size&&typeof sm=="function"&&(window.removeEventListener("resize",sm),sm=void 0)}}function mL(t,e){return typeof t=="function"?iie(t):rie(t,e)}function aie(t){return oI(t)&&t.tagName==="svg"}const oie=[...z6,$n,Ja],lie=t=>oie.find(U6(t)),gL=()=>({translate:0,scale:1,origin:0,originPoint:0}),im=()=>({x:gL(),y:gL()}),yL=()=>({min:0,max:0}),Xn=()=>({x:yL(),y:yL()}),cie=new WeakMap;function kE(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ub(t){return typeof t=="string"||Array.isArray(t)}const lI=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cI=["initial",...lI];function SE(t){return kE(t.animate)||cI.some(e=>ub(t[e]))}function X6(t){return!!(SE(t)||t.variants)}function uie(t,e,n){for(const r in e){const s=e[r],i=n[r];if(Gr(s))t.addValue(r,s);else if(Gr(i))t.addValue(r,Ty(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=t.getStaticValue(r);t.addValue(r,Ty(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const zj={current:null},Z6={current:!1},die=typeof window<"u";function hie(){if(Z6.current=!0,!!die)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>zj.current=t.matches;t.addEventListener("change",e),e()}else zj.current=!1}const xL=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let zS={};function Q6(t){zS=t}function fie(){return zS}class pie{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,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=QR,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 m=fs.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Kt.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!a,this.isControllingVariants=SE(n),this.isVariantNode=X6(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in p){const y=p[m];u[m]!==void 0&&Gr(y)&&y.set(u[m])}}mount(e){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,cie.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((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Z6.current||hie(),this.shouldReduceMotion=zj.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(),pd(this.notifyUpdate),pd(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&&zse.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:o,times:l,ease:u,duration:d}=n.accelerate,f=new R6({element:this.current,name:e,keyframes:o,times:l,ease:u,duration:ha(d)}),p=a(f);this.valueSubscriptions.set(e,()=>{p(),f.cancel()});return}const r=Zy.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Kt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i(),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 zS){const n=zS[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Xn()}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<xL.length;r++){const s=xL[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,a=e[i];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=uie(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=Ty(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"&&(Qz(r)||e6(r))?r=parseFloat(r):!l
vendor: 10,091 bytes, line 513
513ie(r)&&Ja.test(n)&&(r=W6(e,n)),this.setBaseTarget(e,Gr(r)?r.get():r)),Gr(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=tI(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Gr(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new UR),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){iI.render(this.render)}}class J6 extends pie{constructor(){super(...arguments),this.KeyframeResolver=Use}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;Gr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Id{constructor(e){this.isMounted=!1,this.node=e}update(){}}function eV({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function mie({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function gie(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 QC(t){return t===void 0||t===1}function Vj({scale:t,scaleX:e,scaleY:n}){return!QC(t)||!QC(e)||!QC(n)}function Zd(t){return Vj(t)||tV(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function tV(t){return vL(t.x)||vL(t.y)}function vL(t){return t&&t!=="0%"}function VS(t,e,n){const r=t-n,s=e*r;return n+s}function bL(t,e,n,r,s){return s!==void 0&&(t=VS(t,s,r)),VS(t,n,r)+e}function Wj(t,e=0,n=1,r,s){t.min=bL(t.min,e,n,r,s),t.max=bL(t.max,e,n,r,s)}function nV(t,{x:e,y:n}){Wj(t.x,e.translate,e.scale,e.originPoint),Wj(t.y,n.translate,n.scale,n.originPoint)}const wL=.999999999999,kL=1.0000000000001;function yie(t,e,n,r=!1){const s=n.length;if(!s)return;e.x=e.y=1;let i,a;for(let o=0;o<s;o++){i=n[o],a=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&om(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(e.x*=a.x.scale,e.y*=a.y.scale,nV(t,a)),r&&Zd(i.latestValues)&&om(t,i.latestValues))}e.x<kL&&e.x>wL&&(e.x=1),e.y<kL&&e.y>wL&&(e.y=1)}function am(t,e){t.min=t.min+e,t.max=t.max+e}function SL(t,e,n,r,s=.5){const i=cn(t.min,t.max,s);Wj(t,e,n,i,r)}function om(t,e){SL(t.x,e.x,e.scaleX,e.scale,e.originX),SL(t.y,e.y,e.scaleY,e.scale,e.originY)}function rV(t,e){return eV(gie(t.getBoundingClientRect(),e))}function xie(t,e,n){const r=rV(t,n),{scroll:s}=e;return s&&(am(r.x,s.offset.x),am(r.y,s.offset.y)),r}const vie={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bie=Xy.length;function wie(t,e,n){let r="",s=!0;for(let i=0;i<bie;i++){const a=Xy[i],o=t[a];if(o===void 0)continue;let l=!0;if(typeof o=="number")l=o===(a.startsWith("scale")?1:0);else{const u=parseFloat(o);l=a.startsWith("scale")?u===1:u===0}if(!l||n){const u=H6(o,rI[a]);if(!l){s=!1;const d=vie[a]||a;r+=`${d}(${u}) `}n&&(e[a]=u)}}return r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function uI(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,o=!1;for(const l in e){const u=e[l];if(Zy.has(l)){a=!0;continue}else if(m6(l)){s[l]=u;continue}else{const d=H6(u,rI[l]);l.startsWith("origin")?(o=!0,i[l]=d):r[l]=d}}if(e.transform||(a||n?r.transform=wie(e,t.transform,n):r.transform&&(r.transform="none")),o){const{originX:l="50%",originY:u="50%",originZ:d=0}=i;r.transformOrigin=`${l} ${u} ${d}`}}function sV(t,{style:e,vars:n},r,s){const i=t.style;let a;for(a in e)i[a]=e[a];s==null||s.applyProjectionStyles(i,r);for(a in n)i.setProperty(a,n[a])}function _L(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const bx={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(ye.test(t))t=parseFloat(t);else return t;const n=_L(t,e.target.x),r=_L(t,e.target.y);return`${n}% ${r}%`}},kie={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Ja.parse(t);if(s.length>5)return r;const i=Ja.createTransformer(t),a=typeof s[0]!="number"?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;s[0+a]/=o,s[1+a]/=l;const u=cn(o,l,.5);return typeof s[2+a]=="number"&&(s[2+a]/=u),typeof s[3+a]=="number"&&(s[3+a]/=u),i(s)}},Hj={borderRadius:{...bx,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bx,borderTopRightRadius:bx,borderBottomLeftRadius:bx,borderBottomRightRadius:bx,boxShadow:kie};function iV(t,{layout:e,layoutId:n}){return Zy.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Hj[t]||t==="opacity")}function dI(t,e,n){var a;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const o in r)(Gr(r[o])||s&&Gr(s[o])||iV(o,t)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(i[o]=r[o]);return i}function Sie(t){return window.getComputedStyle(t)}class _ie extends J6{constructor(){super(...arguments),this.type="html",this.renderInstance=sV}readValueFromInstance(e,n){var r;if(Zy.has(n))return(r=this.projection)!=null&&r.isProjecting?Nj(n):zre(e,n);{const s=Sie(e),i=(m6(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return rV(e,n)}build(e,n,r){uI(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return dI(e,n,r)}}const Eie={offset:"stroke-dashoffset",array:"stroke-dasharray"},Cie={offset:"strokeDashoffset",array:"strokeDasharray"};function Aie(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?Eie:Cie;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const Tie=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function aV(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...o},l,u,d){if(uI(t,o,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:p}=t;f.transform&&(p.transform=f.transform,delete f.transform),(p.transform||f.transformOrigin)&&(p.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),p.transform&&(p.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const m of Tie)f[m]!==void 0&&(p[m]=f[m],delete f[m]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&Aie(f,s,i,a,!1)}const oV=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"]),lV=t=>typeof t=="string"&&t.toLowerCase()==="svg";function jie(t,e,n,r){sV(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(oV.has(s)?s:nI(s),e.attrs[s])}function cV(t,e,n){const r=dI(t,e,n);for(const s in t)if(Gr(t[s])||Gr(e[s])){const i=Xy.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class Nie extends J6{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Xn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Zy.has(n)){const r=V6(n);return r&&r.default||0}return n=oV.has(n)?n:nI(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return cV(e,n,r)}build(e,n,r){aV(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){jie(e,n,r,s)}mount(e){this.isSVGTag=lV(e.tagName),super.mount(e)}}const Pie=cI.length;function uV(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?uV(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Pie;n++){const r=cI[n],s=t.props[r];(ub(s)||s===!1)&&(e[r]=s)}return e}function dV(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 Rie=[...lI].reverse(),Iie=lI.length;function Die(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Nse(t,n,r)))}function Mie(t){let e=Die(t),n=EL(),r=!0;const s=l=>(u,d)=>{var p;const f=_m(t,d,l==="exit"?(p=t.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:m,transitionEnd:y,...g}=f;u={...u,...g,...y}}return u};function i(l){e=l(t)}function a(l){const{props:u}=t,d=uV(t.parent)||{},f=[],p=new Set;let m={},y=1/0;for(let b=0;b<Iie;b++){const x=Rie[b],w=n[x],v=u[x]!==void 0?u[x]:d[x],S=ub(v),E=x===l?w.isActive:null;E===!1&&(y=b);let C=v===d[x]&&v!==u[x]&&S;if(C&&r&&t.manuallyAnimateOnMount&&(C=!1),w.protectedKeys={...m},!w.isActive&&E===null||!v&&!w.prevProp||kE(v)||typeof v=="boolean")continue;if(x==="exit"&&w.isActive&&E!==!0){w.prevResolvedValues&&(m={...m,...w.prevResolvedValues});continue}const T=Oie(w.prevProp,v);let P=T||x===l&&w.isActive&&!C&&S||b>y&&S,M=!1;const R=Array.isArray(v)?v:[v];let O=R.reduce(s(x),{});E===!1&&(O={});const{prevResolvedValues:L={}}=w,U={...L,...O},B=V=>{P=!0,p.has(V)&&(M=!0,p.delete(V)),w.needsAnimating[V]=!0;const $=t.getValue(V);$&&($.liveStyle=!1)};for(const V in U){const $=O[V],I=L[V];if(m.hasOwnProperty(V))continue;let N=!1;Oj($)&&Oj(I)?N=!dV($,I):N=$!==I,N?$!=null?B(V):p.add(V):$!==void 0&&p.has(V)?B(V):w.protectedKeys[V]=!0}w.prevProp=v,w.prevResolvedValues=O,w.isActive&&(m={...m,...O}),r&&t.blockInitialAnimation&&(P=!1);const H=C&&T;P&&(!H||M)&&f.push(...R.map(V=>{const $={type:x};if(typeof V=="string"&&r&&!H&&t.manuallyAnimateOnMount&&t.parent){const{parent:I}=t,N=_m(I,V);if(I.enteringChildren&&N){const{delayChildren:W}=N.transition||{};$.delay=D6(I.enteringChildren,t,W)}}return{animation:V,options:$}}))}if(p.size){const b={};if(typeof u.initial!="boolean"){const x=_m(t,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(b.transition=x.transition)}
vendor: 4,590 bytes, line 513
513p.forEach(x=>{const w=t.getBaseTarget(x),v=t.getValue(x);v&&(v.liveStyle=!0),b[x]=w??null}),f.push({animation:b})}let g=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),r=!1,g?e(f):Promise.resolve()}function o(l,u){var f;if(n[l].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(l,u)}),n[l].isActive=u;const d=a(l);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:o,setAnimateFunction:i,getState:()=>n,reset:()=>{n=EL()}}}function Oie(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!dV(e,t):!1}function $d(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function EL(){return{animate:$d(!0),whileInView:$d(),whileHover:$d(),whileTap:$d(),whileDrag:$d(),whileFocus:$d(),exit:$d()}}function CL(t,e){t.min=e.min,t.max=e.max}function _a(t,e){CL(t.x,e.x),CL(t.y,e.y)}function AL(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const hV=1e-4,Lie=1-hV,Fie=1+hV,fV=.01,Bie=0-fV,$ie=0+fV;function ps(t){return t.max-t.min}function Uie(t,e,n){return Math.abs(t-e)<=n}function TL(t,e,n,r=.5){t.origin=r,t.originPoint=cn(e.min,e.max,t.origin),t.scale=ps(n)/ps(e),t.translate=cn(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Lie&&t.scale<=Fie||isNaN(t.scale))&&(t.scale=1),(t.translate>=Bie&&t.translate<=$ie||isNaN(t.translate))&&(t.translate=0)}function _v(t,e,n,r){TL(t.x,e.x,n.x,r?r.originX:void 0),TL(t.y,e.y,n.y,r?r.originY:void 0)}function jL(t,e,n){t.min=n.min+e.min,t.max=t.min+ps(e)}function zie(t,e,n){jL(t.x,e.x,n.x),jL(t.y,e.y,n.y)}function NL(t,e,n){t.min=e.min-n.min,t.max=t.min+ps(e)}function WS(t,e,n){NL(t.x,e.x,n.x),NL(t.y,e.y,n.y)}function PL(t,e,n,r,s){return t-=e,t=VS(t,1/n,r),s!==void 0&&(t=VS(t,1/s,r)),t}function Vie(t,e=0,n=1,r=.5,s,i=t,a=t){if(Jo.test(e)&&(e=parseFloat(e),e=cn(a.min,a.max,e/100)-a.min),typeof e!="number")return;let o=cn(i.min,i.max,r);t===i&&(o-=e),t.min=PL(t.min,e,n,o,s),t.max=PL(t.max,e,n,o,s)}function RL(t,e,[n,r,s],i,a){Vie(t,e[n],e[r],e[s],e.scale,i,a)}const Wie=["x","scaleX","originX"],Hie=["y","scaleY","originY"];function IL(t,e,n,r){RL(t.x,e,Wie,n?n.x:void 0,r?r.x:void 0),RL(t.y,e,Hie,n?n.y:void 0,r?r.y:void 0)}function DL(t){return t.translate===0&&t.scale===1}function pV(t){return DL(t.x)&&DL(t.y)}function ML(t,e){return t.min===e.min&&t.max===e.max}function qie(t,e){return ML(t.x,e.x)&&ML(t.y,e.y)}function OL(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function mV(t,e){return OL(t.x,e.x)&&OL(t.y,e.y)}function LL(t){return ps(t.x)/ps(t.y)}function FL(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function mo(t){return[t("x"),t("y")]}function Gie(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:p,skewX:m,skewY:y}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}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 gV=["TopLeft","TopRight","BottomLeft","BottomRight"],Kie=gV.length,BL=t=>typeof t=="string"?parseFloat(t):t,$L=t=>typeof t=="number"||ye.test(t);function Yie(t,e,n,r,s,i){s?(t.opacity=cn(0,n.opacity??1,Xie(r)),t.opacityExit=cn(e.opacity??1,0,Zie(r))):i&&(t.opacity=cn(e.opacity??1,n.opacity??1,r));for(let a=0;a<Kie;a++){const o=`border${gV[a]}Radius`;let l=UL(e,o),u=UL(n,o);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||$L(l)===$L(u)?(t[o]=Math.max(cn(BL(l),BL(u),r),0),(Jo.test(u)||Jo.test(l))&&(t[o]+="%")):t[o]=u}(e.rotate||n.rotate)&&(t.rotate=cn(e.rotate||0,n.rotate||0,r))}function UL(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Xie=yV(0,.5,c6),Zie=yV(.5,.95,da);function yV(t,e,n){return r=>r<t?0:r>e?1:n(ob(t,e,r))}function Qie(t,e,n){const r=Gr(t)?t:Ty(t);return r.start(eI("",r,e,n)),r.animation}function db(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const Jie=(t,e)=>t.depth-e.depth;class eae{constructor(){this.children=[],this.isDirty=!1}add(e){$R(this.children,e),this.isDirty=!0}remove(e){FS(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Jie),this.isDirty=!1,this.children.forEac
513h(e)}}function tae(t,e){const n=fs.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(pd(r),t(i-e))};return Kt.setup(r,!0),()=>pd(r)}function xk(t){return Gr(t)?t.get():t}class nae{constructor(){this.members=[]}add(e){$R(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 s=r.instance;s&&s.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&FS(this.members,r)}e.scheduleRender()}remove(e){if(FS(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){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s],a=i.instance;if(i.isPresent!==!1&&(!a||a.isConnected!==!1)){r=i;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender();const s=r.options.layoutDependency,i=e.options.layoutDependency;if(!(s!==void 0&&i!==void 0&&s===i)){const l=r.instance;l&&l.isConnected===!1&&!r.snapshot||(e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:o}=e.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const vk={hasAnimatedSinceResize:!0,hasEverUpdated:!1},JC=["","X","Y","Z"],rae=1e3;let sae=0;function eA(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function xV(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=B6(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Kt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&xV(r)}
vendor: 11,476 bytes, line 513
513function vV({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},o=e==null?void 0:e()){this.id=sae++,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(oae),this.nodes.forEach(dae),this.nodes.forEach(hae),this.nodes.forEach(lae)},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 eae)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new UR),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=oI(a)&&!aie(a),this.instance=a;const{layoutId:o,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||o)&&(this.isLayoutDirty=!0),t){let d,f=0;const p=()=>this.root.updateBlockedByResize=!1;Kt.read(()=>{f=window.innerWidth}),t(a,()=>{const m=window.innerWidth;m!==f&&(f=m,this.root.updateBlockedByResize=!0,d&&d(),d=tae(p,250),vk.hasAnimatedSinceResize&&(vk.hasAnimatedSinceResize=!1,this.nodes.forEach(WL)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||yae,{onLayoutAnimationStart:g,onLayoutAnimationComplete:b}=u.getProps(),x=!this.targetLayout||!mV(this.targetLayout,m),w=!f&&p;if(this.options.layoutRoot||this.resumeFrom||w||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...JR(y,"layout"),onPlay:g,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(d,w)}else f||WL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}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(),pd(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(fae),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&&xV(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:o,layout:l}=this.options;if(o===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(zL);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(VL);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(uae),this.nodes.forEach(iae),this.nodes.forEach(aae)):this.nodes.forEach(VL),this.clearAllSnapshots();const o=fs.now();_r.delta=nl(0,1e3/60,o-_r.timestamp),_r.timestamp=o,_r.isProcessing=!0,HC.update.process(_r),HC.preRender.process(_r),HC.render.process(_r),_r.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,iI.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cae),this.sharedNodes.forEach(pae)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Kt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Kt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ps(this.snapshot.measuredBox.x)&&!ps(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=Xn(),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(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!pV(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&this.instance&&(o||Zd(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let l=this.removeElementScroll(o);return a&&(l=this.removeTransform(l)),xae(l),{animationId:this.root.animationId,measuredBox:o,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return Xn();const o=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(vae))){const{scroll:d}=this.root;d&&(am(o.x,d.offset.x),am(o.y,d.offset.y))}return o}removeElementScroll(a){var l;const o=Xn();if(_a(o,a),(l=this.scroll)!=null&&l.wasRoot)return o;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:p}=d;d!==this.root&&f&&p.layoutScroll&&(f.wasRoot&&_a(o,a),am(o.x,f.offset.x),am(o.y,f.offset.y))}return o}applyTransform(a,o=!1){const l=Xn();_a(l,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&om(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Zd(d.latestValues)&&om(l,d.latestValues)}return Zd(this.latestValues)&&om(l,this.latestValues),l}removeTransform(a){const o=Xn();_a(o,a);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Zd(u.latestValues))continue;Vj(u.latestValues)&&u.updateSnapshot();const d=Xn(),f=u.measurePageBox();_a(d,f),IL(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Zd(this.latestValues)&&IL(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!==_r.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var m;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||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=_r.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Xn(),this.targetWithTransforms=Xn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zie(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):_a(this.target,this.layout.layoutBox),nV(this.target,this.targetDelta)):_a(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Vj(this.parent.latestValues)||tV(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=Xn(),this.relativeTargetOrigin=Xn(),WS(this.relativeTargetOrigin,o,l),_a(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&
vendor: 5,307 bytes, line 513
513(l=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===_r.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;_a(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;yie(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=Xn());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(AL(this.prevProjectionDelta.x,this.projectionDelta.x),AL(this.prevProjectionDelta.y,this.projectionDelta.y)),_v(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!FL(this.projectionDelta.x,this.prevProjectionDelta.x)||!FL(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}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=im(),this.projectionDelta=im(),this.projectionDeltaWithTransform=im()}setAnimationOrigin(a,o=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},f=im();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const p=Xn(),m=l?l.source:void 0,y=this.layout?this.layout.source:void 0,g=m!==y,b=this.getStack(),x=!b||b.members.length<=1,w=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(gae));this.animationProgress=0;let v;this.mixTargetDelta=S=>{const E=S/1e3;HL(f.x,a.x,E),HL(f.y,a.y,E),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(WS(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mae(this.relativeTarget,this.relativeTargetOrigin,p,E),v&&qie(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=Xn()),_a(v,this.relativeTarget)),g&&(this.animationValues=d,Yie(d,u,this.latestValues,E,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,l,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(pd(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Kt.update(()=>{vk.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ty(0)),this.motionValue.jump(0,!1),this.currentAnimation=Qie(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),a.onUpdate&&a.onUpdate(d)},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(rae),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:u,latestValues:d}=a;if(!(!o||!l||!u)){if(this!==a&&this.layout&&u&&bV(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Xn();const f=ps(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const p=ps(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+p}_a(o,l),om(o,d),_v(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new nae),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.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 u=this.getStack();u&&u.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}
vendor: 11,402 bytes, lines 513-521
513resetSkewAndRotation(){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 u={};l.z&&eA("z",a,u,this.animationValues);for(let d=0;d<JC.length;d++)eA(`rotate${JC[d]}`,a,u,this.animationValues),eA(`skew${JC[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);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=xk(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=xk(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Zd(this.latestValues)&&(a.transform=l?l({},""):"none",this.hasProjected=!1);return}a.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Gie(this.projectionDeltaWithTransform,this.treeScale,d);l&&(f=l(d,f)),a.transform=f;const{x:p,y:m}=this.projectionDelta;a.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,u.animationValues?a.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const y in Hj){if(d[y]===void 0)continue;const{correct:g,applyTo:b,isCSSVariable:x}=Hj[y],w=f==="none"?d[y]:g(d[y],u);if(b){const v=b.length;for(let S=0;S<v;S++)a[b[S]]=w}else x?this.options.visualElement.renderState.vars[y]=w:a[y]=w}this.options.layoutId&&(a.pointerEvents=u===this?xk(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(zL),this.root.sharedNodes.clear()}}}function iae(t){t.updateLayout()}function aae(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:s}=t.layout,{animationType:i}=t.options,a=e.source!==t.layout.source;i==="size"?mo(f=>{const p=a?e.measuredBox[f]:e.layoutBox[f],m=ps(p);p.min=r[f].min,p.max=p.min+m}):bV(i,e.layoutBox,r)&&mo(f=>{const p=a?e.measuredBox[f]:e.layoutBox[f],m=ps(r[f]);p.max=p.min+m,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+m)});const o=im();_v(o,r,e.layoutBox);const l=im();a?_v(l,t.applyTransform(s,!0),e.measuredBox):_v(l,r,e.layoutBox);const u=!pV(o);let d=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:m}=f;if(p&&m){const y=Xn();WS(y,e.layoutBox,p.layoutBox);const g=Xn();WS(g,r,m.layoutBox),mV(y,g)||(d=!0),f.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=y,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function oae(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function lae(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function cae(t){t.clearSnapshot()}function zL(t){t.clearMeasurements()}function VL(t){t.isLayoutDirty=!1}function uae(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function WL(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function dae(t){t.resolveTargetDelta()}function hae(t){t.calcProjection()}function fae(t){t.resetSkewAndRotation()}function pae(t){t.removeLeadSnapshot()}function HL(t,e,n){t.translate=cn(e.translate,0,n),t.scale=cn(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function qL(t,e,n,r){t.min=cn(e.min,n.min,r),t.max=cn(e.max,n.max,r)}function mae(t,e,n,r){qL(t.x,e.x,n.x,r),qL(t.y,e.y,n.y,r)}function gae(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const yae={duration:.45,ease:[.4,0,.1,1]},GL=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),KL=GL("applewebkit/")&&!GL("chrome/")?Math.round:da;function YL(t){t.min=KL(t.min),t.max=KL(t.max)}function xae(t){YL(t.x),YL(t.y)}function bV(t,e,n){return t==="position"||t==="preserve-aspect"&&!Uie(LL(e),LL(n),.2)}function vae(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const bae=vV({attachResizeListener:(t,e)=>db(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}),tA={current:void 0},wV=vV({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!tA.current){const t=new bae({});t.mount(window),t.setOptions({layoutScroll:!0}),tA.current=t}return tA.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),hI=k.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function XL(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function wae(...t){return e=>{let n=!1;const r=t.map(s=>{const i=XL(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():XL(t[s],null)}}}}function kae(...t){return k.useCallback(wae(...t),t)}class Sae extends k.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Uj(r)&&r.offsetWidth||0,i=Uj(r)&&r.offsetHeight||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left,a.bottom=i-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function _ae({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var p;const a=k.useId(),o=k.useRef(null),l=k.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=k.useContext(hI),d=((p=t.props)==null?void 0:p.ref)??(t==null?void 0:t.ref),f=kae(o,d);return k.useInsertionEffect(()=>{const{width:m,height:y,top:g,left:b,right:x,bottom:w}=l.current;if(e||i===!1||!o.current||!m||!y)return;const v=n==="left"?`left: ${b}`:`right: ${x}`,S=r==="bottom"?`bottom: ${w}`:`top: ${g}`;o.current.dataset.motionPopId=a;const E=document.createElement("style");u&&(E.nonce=u);const C=s??document.head;return C.appendChild(E),E.sheet&&E.sheet.insertRule(`
514          [data-motion-pop-id="${a}"] {
515            position: absolute !important;
516            width: ${m}px !important;
517            height: ${y}px !important;
518            ${v}px !important;
519            ${S}px !important;
520          }
521        `),()=>{C.contains(E)&&C.removeChild(E)}},[e]),c.jsx(Sae,{isPresent:e,childRef:o,sizeRef:l,pop:i,children:i===!1?t:k.cloneElement(t,{ref:f})})}const Eae=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:o,anchorY:l,root:u})=>{const d=BR(Cae),f=k.useId();let p=!0,m=k.useMemo(()=>(p=!1,{id:f,initial:e,isPresent:n,custom:s,onExitComplete:y=>{d.set(y,!0);for(const g of d.values())if(!g)return;r&&r()},register:y=>(d.set(y,!1),()=>d.delete(y))}),[n,d,r]);return i&&p&&(m={...m}),k.useMemo(()=>{d.forEach((y,g)=>d.set(g,!1))},[n]),k.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=c.jsx(_ae,{pop:a==="popLayout",isPresent:n,anchorX:o,anchorY:l,root:u,children:t}),c.jsx(bE.Provider,{value:m,children:t})};function Cae(){return new Map}function kV(t=!0){const e=k.useContext(bE);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=k.useId();k.useEffect(()=>{if(t)return s(i)},[t]);const a=k.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,a]:[!0]}const b1=t=>t.key||"";function ZL(t){const e=[];return k.Children.forEach(t,n=>{k.isValidElement(n)&&e.push(n)}),e}const SV=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:o="left",anchorY:l="top",root:u})=>{const[d,f]=kV(a),p=k.useMemo(()=>ZL(t),[t]),m=a&&!d?[]:p.map(b1),y=k.useRef(!0),g=k.useRef(p),b=BR(()=>new Map),x=k.useRef(new Set),[w,v]=k.useState(p),[S,E]=k.useState(p);Zz(()=>{y.current=!1,g.current=p;for(let P=0;P<S.length;P++){const M=b1(S[P]);m.includes(M)?(b.delete(M),x.current.delete(M)):b.get(M)!==!0&&b.set(M,!1)}},[S,m.length,m.join("-")]);const C=[];if(p!==w){let P=[...p];for(let M=0;M<S.length;M++){const R=S[M],O=b1(R);m.includes(O)||(P.splice(M,0,R),C.push(R))}return i==="wait"&&C.length&&(P=C),E(ZL(P)),v(p),null}const{forceRender:T}=k.useContext(FR);return c.jsx(c.Fragment,{children:S.map(P=>{const M=b1(P),R=a&&!d?!1:p===S||m.includes(M),O=()=>{if(x.current.has(M))return;if(x.current.add(M),b.has(M))b.set(M,!0);else return;let L=!0;b.forEach(U=>{U||(L=!1)}),L&&(T==null||T(),E(g.current),a&&(f==null||f()),r&&r())};return c.jsx(Eae,{isPresent:R,initial:!y.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:u,onExitComplete:R?void 0:O,anchorX:o,anchorY:l,children:P},M)})})},_V=k.createContext({strict:!1}),QL={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 JL=!1;function Aae(){if(JL)return;const t={};for(const e in QL)t[e]={isEnabled:n=>QL[e].some(r=>!!n[r])};Q6(t),JL=!0}function EV(){return Aae(),fie()}function Tae(t){const e=EV();for(const n in t)e[n]={...e[n],...t[n]};Q6(e)}const jae=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 HS(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||jae.has(t)}let CV=t=>!HS(t);function Nae(t){typeof t=="function"&&(CV=e=>e.startsWith("on")?!HS(e):t(e))}try{Nae(require("@emotion/is-prop-valid").default)}catch{}function Pae(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(CV(s)||n===!0&&HS(s)||
vendor: 23,856 bytes, line 521
521!e&&!HS(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const _E=k.createContext({});function Rae(t,e){if(SE(t)){const{initial:n,animate:r}=t;return{initial:n===!1||ub(n)?n:void 0,animate:ub(r)?r:void 0}}return t.inherit!==!1?e:{}}function Iae(t){const{initial:e,animate:n}=Rae(t,k.useContext(_E));return k.useMemo(()=>({initial:e,animate:n}),[eF(e),eF(n)])}function eF(t){return Array.isArray(t)?t.join(" "):t}const fI=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function AV(t,e,n){for(const r in e)!Gr(e[r])&&!iV(r,n)&&(t[r]=e[r])}function Dae({transformTemplate:t},e){return k.useMemo(()=>{const n=fI();return uI(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Mae(t,e){const n=t.style||{},r={};return AV(r,n,t),Object.assign(r,Dae(t,e)),r}function Oae(t,e){const n={},r=Mae(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 TV=()=>({...fI(),attrs:{}});function Lae(t,e,n,r){const s=k.useMemo(()=>{const i=TV();return aV(i,e,lV(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};AV(i,t.style,t),s.style={...i,...s.style}}return s}const Fae=["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 pI(t){return typeof t!="string"||t.includes("-")?!1:!!(Fae.indexOf(t)>-1||/[A-Z]/u.test(t))}function Bae(t,e,n,{latestValues:r},s,i=!1,a){const l=(a??pI(t)?Lae:Oae)(e,r,s,t),u=Pae(e,typeof t=="string",i),d=t!==k.Fragment?{...u,...l,ref:n}:{},{children:f}=e,p=k.useMemo(()=>Gr(f)?f.get():f,[f]);return k.createElement(t,{...d,children:p})}function $ae({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:Uae(n,r,s,t),renderState:e()}}function Uae(t,e,n,r){const s={},i=r(t,{});for(const p in i)s[p]=xk(i[p]);let{initial:a,animate:o}=t;const l=SE(t),u=X6(t);e&&u&&!l&&t.inherit!==!1&&(a===void 0&&(a=e.initial),o===void 0&&(o=e.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?o:a;if(f&&typeof f!="boolean"&&!kE(f)){const p=Array.isArray(f)?f:[f];for(let m=0;m<p.length;m++){const y=tI(t,p[m]);if(y){const{transitionEnd:g,transition:b,...x}=y;for(const w in x){let v=x[w];if(Array.isArray(v)){const S=d?v.length-1:0;v=v[S]}v!==null&&(s[w]=v)}for(const w in g)s[w]=g[w]}}}return s}const jV=t=>(e,n)=>{const r=k.useContext(_E),s=k.useContext(bE),i=()=>$ae(t,e,r,s);return n?i():BR(i)},zae=jV({scrapeMotionValuesFromProps:dI,createRenderState:fI}),Vae=jV({scrapeMotionValuesFromProps:cV,createRenderState:TV}),Wae=Symbol.for("motionComponentSymbol");function Hae(t,e,n){const r=k.useRef(n);k.useInsertionEffect(()=>{r.current=n});const s=k.useRef(null);return k.useCallback(i=>{var o;i&&((o=t.onMount)==null||o.call(t,i)),e&&(i?e.mount(i):e.unmount());const a=r.current;if(typeof a=="function")if(i){const l=a(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[e])}const NV=k.createContext({});function Np(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function qae(t,e,n,r,s,i){var v,S;const{visualElement:a}=k.useContext(_E),o=k.useContext(_V),l=k.useContext(bE),u=k.useContext(hI),d=u.reducedMotion,f=u.skipAnimations,p=k.useRef(null),m=k.useRef(!1);r=r||o.renderer,!p.current&&r&&(p.current=r(t,{visualState:e,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:i}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const y=p.current,g=k.useContext(NV);y&&!y.projection&&s&&(y.type==="html"||y.type==="svg")&&Gae(p.current,n,s,g);const b=k.useRef(!1);k.useInsertionEffect(()=>{y&&b.current&&y.update(n,l)});const x=n[F6],w=k.useRef(!!x&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,x))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,x)));return Zz(()=>{m.current=!0,y&&(b.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),w.current&&y.animationState&&y.animationState.animateChanges())}),k.useEffect(()=>{y&&(!w.current&&y.animationState&&y.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,x)}),w.current=!1),y.enteringChildren=void 0)}),y}function Gae(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:u,layoutCrossfade:d}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:PV(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||o&&Np(o),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u})}function PV(t){if(t)return t.options.allowProjection!==!1?t.projection:PV(t.parent)}function nA(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&Tae(r);const i=n?n==="svg":pI(t),a=i?Vae:zae;function o(u,d){let f;const p={...k.useContext(hI),...u,layoutId:Kae(u)},{isStatic:m}=p,y=Iae(u),g=a(u,m);if(!m&&Xz){Yae();const b=Xae(p);f=b.MeasureLayout,y.visualElement=qae(t,g,p,s,b.ProjectionNode,i)}return c.jsxs(_E.Provider,{value:y,children:[f&&y.visualElement?c.jsx(f,{visualElement:y.visualElement,...p}):null,Bae(t,u,Hae(g,y.visualElement,d),g,m,e,i)]})}o.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=k.forwardRef(o);return l[Wae]=t,l}function Kae({layoutId:t}){const e=k.useContext(FR).id;return e&&t!==void 0?e+"-"+t:t}function Yae(t,e){k.useContext(_V).strict}function Xae(t){const e=EV(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Zae(t,e){if(typeof Proxy>"u")return nA;const n=new Map,r=(i,a)=>nA(i,a,t,e),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,nA(a,void 0,t,e)),n.get(a))})}const Qae=(t,e)=>e.isSVG??pI(t)?new Nie(e):new _ie(e,{allowProjection:t!==k.Fragment});class Jae extends Id{constructor(e){super(e),e.animationState||(e.animationState=Mie(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();kE(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 eoe=0;class toe extends Id{constructor(){super(...arguments),this.id=eoe++}update(){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;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const noe={animation:{Feature:Jae},exit:{Feature:toe}};function P0(t){return{point:{x:t.pageX,y:t.pageY}}}const roe=t=>e=>aI(e)&&t(e,P0(e));function Ev(t,e,n,r){return db(t,e,roe(n),r)}const RV=({current:t})=>t?t.ownerDocument.defaultView:null,tF=(t,e)=>Math.abs(t-e);function soe(t,e){const n=tF(t.x,e.x),r=tF(t.y,e.y);return Math.sqrt(n**2+r**2)}const nF=new Set(["auto","scroll"]);class IV{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=sA(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,g=soe(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!g)return;const{point:b}=m,{timestamp:x}=_r;this.history.push({...b,timestamp:x});const{onStart:w,onMove:v}=this.handlers;y||(w&&w(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,m)},this.handlePointerMove=(m,y)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=rA(y,this.transformPagePoint),Kt.update(this.updatePoint,!0)},this.handlePointerUp=(m,y)=>{this.end();const{onEnd:g,onSessionEnd:b,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=sA(m.type==="pointercancel"?this.lastMoveEventInfo:rA(y,this.transformPagePoint),this.history);this.startEvent&&g&&g(m,w),b&&b(m,w)},!aI(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const l=P0(e),u=rA(l,this.transformPagePoint),{point:d}=u,{timestamp:f}=_r;this.history=[{...d,timestamp:f}];const{onSessionStart:p}=n;p&&p(e,sA(u,this.history)),this.removeListeners=T0(Ev(this.contextWindow,"pointermove",this.handlePointerMove),Ev(this.contextWindow,"pointerup",this.handlePointerUp),Ev(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(nF.has(r.overflowX)||nF.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,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),Kt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),pd(this.updatePoint)}}function rA(t,e){return e?{point:e(t.point)}:t}function rF(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sA({point:t},e){return{point:t,delta:rF(t,DV(e)),offset:rF(t,ioe(e)),velocity:aoe(e,.1)}}function ioe(t){return t[0]}function DV(t){return t[t.length-1]}function aoe(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=DV(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>ha(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>ha(e)*2&&(r=t[1]);const i=la(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function ooe(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?cn(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?cn(n,t,r.max):Math.min(t,n)),t}function sF(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 loe(t,{top:e,left:n,bottom:r,right:s}){return{x:sF(t.x,n,s),y:sF(t.y,e,r)}}function iF(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 coe(t,e){return{x:iF(t.x,e.x),y:iF(t.y,e.y)}}function uoe(t,e){let n=.5;const r=ps(t),s=ps(e);return s>r?n=ob(e.min,e.max-r,t.min):r>s&&(n=ob(t.min,t.max-s,e.min)),nl(0,1,n)}function doe(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 qj=.35;function hoe(t=qj){return t===!1?t=0:t===!0&&(t=qj),{x:aF(t,"left","right"),y:aF(t,"top","bottom")}}function aF(t,e,n){return{min:oF(t,e),max:oF(t,n)}}function oF(t,e){return typeof t=="number"?t:t[e]||0}const foe=new WeakMap;class poe{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=Xn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=f=>{n&&this.snapToCursor(P0(f).point),this.stopAnimation()},a=(f,p)=>{const{drag:m,dragPropagation:y,onDragStart:g}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vse(m),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),mo(x=>{let w=this.getAxisMotionValue(x).get()||0;if(Jo.test(w)){const{projection:v}=this.visualElement;if(v&&v.layout){const S=v.layout.layoutBox[x];S&&(w=ps(S)*(parseFloat(w)/100))}}this.originPoint[x]=w}),g&&Kt.update(()=>g(f,p),!1,!0),Lj(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p;const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:g,onDrag:b}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=p;if(y&&this.currentDirection===null){this.currentDirection=goe(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",p.point,x),this.updateAxis("y",p.point,x),this.visualElement.render(),b&&Kt.update(()=>b(f,p),!1,!0)},l=(f,p)=>{this.latestPointerEvent=f,this.latestPanInfo=p,this.stop(f,p),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new IV(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:RV(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&Kt.postRender(()=>o(r,s))}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:s}=this.getProps();if(!r||!w1(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=ooe(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&Np(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=loe(r.layoutBox,e):this.constraints=!1,this.elastic=hoe(n),s!==this.constraints&&!Np(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&mo(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=doe(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Np(e))return!1;const r=e.current;Ay(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:s}=this.visualElement;if(!s||!s.layout)return!1;const i=xie(r,s.root,this.visualElement.getTransformPagePoint());let a=coe(s.layout.layoutBox,i);if(n){const o=n(mie(a));this.hasMutatedConstraints=!!o,o&&(a=eV(o))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},u=mo(d=>{if(!w1(d,n,this.currentDirection))return;let f=l&&l[d]||{};a&&(f={min:0,max:0});const p=s?200:1e6,m=s?40:1e7,y={type:"inertia",velocity:r?e[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(o)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Lj(this.visualElement,e),r.start(eI(e,r,0,n,this.visualElement,!1))}stopAnimation(){mo(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){mo(n=>{const{drag:r}=this.getProps();if(!w1(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:o}=s.layout.layoutBox[n],l=i.get()||0;i.set(e[n]-cn(a,o,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Np(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};mo(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();s[a]=uoe({min:l,max:l},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),mo(a=>{if(!w1(a,e,null))return;const o=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];o.set(cn(l,u,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;foe.set(this.visualElement,this);const e=this.visualElement.current,n=Ev(e,"pointerdown",u=>{const{drag:d,dragListener:f=!0}=this.getProps(),p=u.target,m=p!==e&&Yse(p);d&&f&&!m&&this.start(u)});let r;const s=()=>{const{dragConstraints:u}=this.getProps();Np(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=moe(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Kt.read(s);const o=db(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(mo(f=>{const p=this.getAxisMotionValue(f);p&&(this.originPoint[f]+=u[f].translate,p.set(p.get()+u[f].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:s=!1,dragConstraints:i=!1,dragElastic:a=qj,dragMomentum:o=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:o}}}function lF(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function moe(t,e,n){const r=mL(t,lF(n)),s=mL(e,lF(n));return()=>{r(),s()}}function w1(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function goe(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class yoe extends Id{constructor(e){super(e),this.removeGroupControls=da,this.removeListeners=da,this.controls=new poe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||da}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 iA=t=>(e,n)=>{t&&Kt.update(()=>t(e,n),!1,!0)};class xoe extends Id{constructor(){super(...arguments),this.removePointerDownListener=da}onPointerDown(e){this.session=new IV(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:RV(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:iA(e),onStart:iA(n),onMove:iA(r),onEnd:(i,a)=>{delete this.session,s&&Kt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Ev(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 aA=!1;class voe extends k.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),aA&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),vk.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),aA=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Kt.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),iI.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;aA=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function MV(t){const[e,n]=kV(),r=k.useContext(FR);return c.jsx(voe,{...t,layoutGroup:r,switchLayoutGroup:k.useContext(NV),isPresent:e,safeToRemove:n})}const boe={pan:{Feature:xoe},drag:{Feature:yoe,ProjectionNode:wV,MeasureLayout:MV}};function cF(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Kt.postRender(()=>i(e,P0(e)))}class woe extends Id{mount(){const{current:e}=this.node;e&&(this.unmount=Hse(e,(n,r)=>(cF(this.node,r,"Start"),s=>cF(this.node,s,"End"))))}unmount(){}}class koe extends Id{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=T0(db(this.node.current,"focus",()=>this.onFocus()),db(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uF(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 s="onTap"+(n==="End"?"":n),i=r[s];i&&Kt.postRender(()=>i(e,P0(e)))}class Soe extends Id{mount(){const{current:e}=this.node;if(!e)return;
521const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Zse(e,(s,i)=>(uF(this.node,i,"Start"),(a,{success:o})=>uF(this.node,a,o?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Gj=new WeakMap,oA=new WeakMap,_oe=t=>{const e=Gj.get(t.target);e&&e(t)},Eoe=t=>{t.forEach(_oe)};function Coe({root:t,...e}){const n=t||document;oA.has(n)||oA.set(n,{});const r=oA.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(Eoe,{root:t,...e})),r[s]}function Aoe(t,e,n){const r=Coe(e);return Gj.set(t,n),r.observe(t),()=>{Gj.delete(t),r.unobserve(t)}}const Toe={some:0,all:1};class joe extends Id{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Toe[s]},o=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),p=u?d:f;p&&p(l)};return Aoe(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(Noe(e,n))&&this.startObserver()}unmount(){}}function Noe({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Poe={inView:{Feature:joe},tap:{Feature:Soe},focus:{Feature:koe},hover:{Feature:woe}},Roe={layout:{ProjectionNode:wV,MeasureLayout:MV}},Ioe={...noe,...Poe,...boe,...Roe},xt=Zae(Ioe,Qae),Doe={some:0,all:1};function Moe(t,e,{root:n,margin:r,amount:s="some"}={}){const i=sI(t),a=new WeakMap,o=u=>{u.forEach(d=>{const f=a.get(d.target);if(d.isIntersecting!==!!f)if(d.isIntersecting){const p=e(d.target,d);typeof p=="function"?a.set(d.target,p):l.unobserve(d.target)}else typeof f=="function"&&(f(d),a.delete(d.target))})},l=new IntersectionObserver(o,{root:n,rootMargin:r,threshold:typeof s=="number"?s:Doe[s]});return i.forEach(u=>l.observe(u)),()=>l.disconnect()}function mI(t,{root:e,margin:n,amount:r,once:s=!1,initial:i=!1}={}){const[a,o]=k.useState(i);return k.useEffect(()=>{if(!t.current||s&&a)return;const l=()=>(o(!0),s?void 0:()=>o(!1)),u={root:e&&e.current||void 0,margin:n,amount:r};return Moe(t.current,l,u)},[e,t,n,s,r]),a}const Ooe=()=>{const t=()=>{var n;(n=document.getElementById("demo-section"))==null||n.scrollIntoView({behavior:"smooth"})},e=()=>{window.open("/reports","_blank","noopener,noreferrer")};return c.jsxs("section",{className:"relative min-h-[90vh] flex items-center bg-gradient-hero overflow-hidden",children:[c.jsx("div",{className:"absolute inset-0 opacity-10",children:c.jsx("img",{src:$ne,alt:"Water dispense market analytics dashboard showing European and USA market data",className:"w-full h-full object-cover",loading:"eager",width:"1920",height:"1080"})}),c.jsx("div",{className:"container mx-auto px-6 relative z-10",children:c.jsxs("div",{className:"max-w-4xl",children:[c.jsx(xt.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,ease:[.25,.4,.25,1]},className:"inline-block px-4 py-2 bg-accent/20 backdrop-blur-sm rounded-full mb-6",children:c.jsx("p",{className:"text-accent font-semibold text-sm",children:"Trusted by Industry Leaders Worldwide"})}),c.jsx(xt.h1,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{duration:.9,delay:.15,ease:[.25,.4,.25,1]},className:"text-4xl sm:text-5xl md:text-7xl font-bold text-primary-foreground mb-6 leading-tight",children:"Know the Water Dispense Market Before You Invest."}),c.jsx(xt.p,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{duration:.9,delay:.3,ease:[.25,.4,.25,1]},className:"text-lg sm:text-xl md:text-2xl text-primary-foreground/90 mb-8 leading-relaxed max-w-3xl",children:"Market size, competitors, pricing and forecasts across BWD, POU and integrated taps. Covering 31 European markets, the USA, UAE, Turkey, Japan and South Korea."}),c.jsxs(xt.div,{initial:{opacity:0,y:40}
521,animate:{opacity:1,y:0},transition:{duration:.9,delay:.45,ease:[.25,.4,.25,1]},className:"flex flex-col sm:flex-row gap-4",children:[c.jsxs(oe,{size:"lg",variant:"hero",className:"text-base sm:text-lg px-6 sm:px-8 py-5 sm:py-6 h-auto whitespace-normal text-center",onClick:e,children:[c.jsx(Yr,{className:"mr-2 shrink-0"}),c.jsx("span",{children:"Explore Markets & Pricing"})]}),c.jsxs(oe,{size:"lg",variant:"outline",className:"text-base sm:text-lg px-6 sm:px-8 py-5 sm:py-6 h-auto whitespace-normal text-center",onClick:t,children:[c.jsx(uR,{className:"mr-2 shrink-0"}),c.jsx("span",{children:"Preview the Data & Subscribe to the Newsletter"})]})]}),c.jsx(xt.p,{initial:{opacity:0},animate:{opacity:1},transition:{duration:1,delay:.7,ease:[.25,.4,.25,1]},className:"text-primary-foreground/70 text-sm mt-4",children:"Explore the coverage and sample data before choosing your report."})]})}),c.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-32 bg-gradient-to-t from-background to-transparent"})]})},dF="/assets/zenith-video-DMpSWdS6.mov",qt=({children:t,className:e="",delay:n=0,direction:r="up",duration:s=.8,once:i=!0})=>{const a=k.useRef(null),o=mI(a,{once:i,margin:"-100px"}),l={up:{y:60,x:0},down:{y:-60,x:0},left:{y:0,x:60},right:{y:0,x:-60}};return c.jsx(xt.div,{ref:a,className:e,initial:{opacity:0,y:l[r].y,x:l[r].x},animate:o?{opacity:1,y:0,x:0}:{opacity:0,y:l[r].y,x:l[r].x},transition:{duration:s,delay:n,ease:[.25,.4,.25,1]},children:t})},ic=({children:t,className:e="",staggerDelay:n=.1})=>{const r=k.useRef(null),s=mI(r,{once:!0,margin:"-50px"});return c.jsx(xt.div,{ref:r,className:e,initial:"hidden",animate:s?"visible":"hidden",variants:{hidden:{},visible:{transition:{staggerChildren:n}}},children:t})},Vs=({children:t,className:e=""})=>c.jsx(xt.div,{className:e,variants:{hidden:{opacity:0,y:40},visible:{opacity:1,y:0,transition:{duration:.6,ease:[.25,.4,.25,1]}}},children:t}),op=({children:t,className:e="",delay:n=0})=>{const r=k.useRef(null),s=mI(r,{once:!0,margin:"-100px"});return c.jsx(xt.div,{ref:r,className:e,initial:{opacity:0,scale:.8},animate:s?{opacity:1,scale:1}:{opacity:0,scale:.8},transition:{duration:.8,delay:n,ease:[.25,.4,.25,1]},children:t})},Loe=({value:t})=>{const[e,n]=k.useState(0),[r,s]=k.useState(!1),i=k.useRef(null);k.useEffect(()=>{const o=new IntersectionObserver(([l])=>{l.isIntersecting&&s(!0)},{threshold:.1});return i.current&&o.observe(i.current),()=>o.disconnect()},[]),k.useEffect(()=>{if(!r)return;const o=parseInt(t.replace(/[^0-9]/g,""))||1,l=2e3,u=60,d=o/u;let f=0;const p=setInterval(()=>{f+=d,f>=o?(n(o),clearInterval(p)):n(Math.floor(f))},l/u);return()=>clearInterval(p)},[r,t]);const a=()=>/\d/.test(t)?t.includes("+")?`${e}+`:t.includes("·")?t:e.toString():t;return c.jsx("div",{ref:i,className:"text-4xl font-bold text-primary mb-2",children:r?a():t})},Foe=()=>{const[t,e]=k.useState(!1),n=[{icon:_U,value:"37",label:"Markets Covered",description:"31 European markets + USA + UAE + Turkey + Jap
521an + South Korea"},{icon:EZ,value:"Primary Research",label:"Industry Input",description:"Operator, distributor and supplier research"},{icon:fZ,value:"30+",label:"Years of Heritage",description:"Broader Zenith Global Commercial research experience"},{icon:jU,value:"BWD · POU · ITS",label:"Three Core Segments",description:"Bottled Water Dispense (BWD) · Point of Use (POU) · Integrated Tap Systems (ITS)"}];return c.jsx("section",{className:"py-20 bg-gradient-subtle",id:"heritage",children:c.jsxs("div",{className:"container mx-auto px-6",children:[c.jsxs(qt,{className:"text-center mb-16",children:[c.jsxs("h2",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4",children:["Understand the Market. Know the Competitors. ",c.jsx("span",{className:"text-primary",children:"See Where the Opportunity Is."})]}),c.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"We track installed units, market size, operator shares, pricing, water volumes and forecasts across bottled water dispensers, point-of-use systems and integrated taps."})]}),c.jsx(ic,{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-8 mb-16",staggerDelay:.1,children:n.map((r,s)=>c.jsx(Vs,{children:c.jsxs("div",{className:"bg-card rounded-xl p-8 shadow-elegant hover:shadow-glow transition-all duration-300 border border-border h-full",children:[c.jsx(r.icon,{className:"w-12 h-12 text-accent mb-4"}),c.jsx(Loe,{value:r.value}),c.jsx("div",{className:"text-lg font-semibold text-foreground mb-1",children:r.label}),c.jsx("div",{className:"text-sm text-muted-foreground",children:r.description})]})},s))}),c.jsx(op,{className:"mb-16 flex justify-center",children:c.jsxs("video",{className:`rounded-xl shadow-elegant transition-all duration-500 ${t?"blur-md":""}`,width:"960",height:"540",autoPlay:!0,muted:!0,playsInline:!0,loop:!0,controls:!0,preload:"auto",onEnded:()=>e(!0),onPlay:()=>e(!1),onSeeked:()=>e(!1),onTimeUpdate:r=>{const s=r.currentTarget;s.currentTime>0&&!s.ended&&e(!1)},onLoadedData:r=>{r.target.play().catch(i=>{console.log("Autoplay prevented:",i)})},children:[c.jsx("source",{src:dF,type:"video/mp4"}),c.jsx("source",{src:dF,type:"video/quicktime"}),"Your browser does not support the video tag."]})}),c.jsx(qt,{delay:.2,children:c.jsx("div",{className:"bg-primary text-primary-foreground rounded-2xl p-12 shadow-elegant",children:c.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[c.jsx("h3",{className:"text-3xl font-bold mb-4",children:"How We Build the Market Picture"}),c.jsx("p",{className:"text-lg opacity-90 mb-6",children:"We bring together industry interviews, reported operating data and company research, then reconcile the evidence through market modelling. This provides a structured view of market size, competitive positions, pricing and growth, with the scope and definitions explained in the research."}),c.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row gap-4 justify-center items-center",children:[c.jsx(oe,{asChild:!0,size:"lg",className:"bg-accent text-accent-foreground hover:bg-accent/90 shadow-glow",children:c.jsxs("a",{href:"#demo-section",children:[c.jsx(S0,{className:"mr-2 h-5 w-5"}),"Get the Demo & US Guide"]})}),c.jsx(oe,{asChild:!0,size:"lg",variant:"outline",className:"bg-white/10 text-primary-foreground border-white/20 hover:bg-white/20",children:c.jsxs("a",{href:"#strategy-call-section",children:[c.jsx(RU,{className:"mr-2 h-5 w-5"}),"Free Strategy Call"]})})]})]})})})]})})},Boe="modulepreload",$oe=function(t){return"/"+t},hF={},Kf=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=$oe(l),l in hF)return;hF[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Boe,u||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return s.then(a=>{for(const o of a||[])o.status==="rejected"&&i(o.reason);return e().catch(i)})},Uoe=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Kf(async()=>{const{default:r}=await Promise.resolve().then(()=>Qy);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)};
521class gI extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}}class fF extends gI{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class pF extends gI{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class mF extends gI{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Kj;(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"})(Kj||(Kj={}));var zoe=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};class Voe{constructor(e,{headers:n={},customFetch:r,region:s=Kj.Any}={}){this.url=e,this.headers=n,this.region=s,this.fetch=Uoe(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return zoe(this,arguments,void 0,function*(n,r={}){var s;try{const{headers:i,method:a,body:o,signal:l}=r;let u={},{region:d}=r;d||(d=this.region);const f=new URL(`${this.url}/${n}`);d&&d!=="any"&&(u["x-region"]=d,f.searchParams.set("forceFunctionRegion",d));let p;o&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(u["Content-Type"]="application/octet-stream",p=o):typeof o=="string"?(u["Content-Type"]="text/plain",p=o):typeof FormData<"u"&&o instanceof FormData?p=o:(u["Content-Type"]="application/json",p=JSON.stringify(o)));const m=yield this.fetch(f.toString(),{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},u),this.headers),i),body:p,signal:l}).catch(x=>{throw x.name==="AbortError"?x:new fF(x)}),y=m.headers.get("x-relay-error");if(y&&y==="true")throw new pF(m);if(!m.ok)throw new mF(m);let g=((s=m.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),b;return g==="application/json"?b=yield m.json():g==="application/octet-stream"?b=yield m.blob():g==="text/event-stream"?b=m:g==="multipart/form-data"?b=yield m.formData():b=yield m.text(),{data:b,error:null,response:m}}catch(i){return i instanceof Error&&i.name==="AbortError"?{data:null,error:new fF(i)}:{data:null,error:i,response:i instanceof mF||i instanceof pF?i.context:void 0}}})}}var Ws={},yI={},EE={},R0={},CE={},AE={},Woe=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},jy=Woe();const Hoe=jy.fetch,OV=jy.fetch.bind(jy),LV=jy.Headers,qoe=jy.Request,Goe=jy.Response,Qy=Object.freeze(Object.defineProperty({__proto__:null,Headers:LV,Request:qoe,Response:Goe,default:OV,fetch:Hoe},Symbol.toStringTag,{value:"Module"})),Koe=D7(Qy);var TE={};Object.defineProperty(TE,"__esModule",{value:!0});let Yoe=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
521de=e.code}};TE.default=Yoe;var FV=Xr&&Xr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(AE,"__esModule",{value:!0});const Xoe=FV(Koe),Zoe=FV(TE);let Qoe=class{constructor(e){var n,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(n=e.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=Xoe.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,n){return this.headers=new Headers(this.headers),this.headers.set(e,n),this}then(e,n){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");const r=this.fetch;let s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var a,o,l,u;let d=null,f=null,p=null,m=i.status,y=i.statusText;if(i.ok){if(this.method!=="HEAD"){const w=await i.text();w===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((a=this.headers.get("Accept"))===null||a===void 0)&&a.includes("application/vnd.pgrst.plan+text"))?f=w:f=JSON.parse(w))}const b=(o=this.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),x=(l=i.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");b&&x&&x.length>1&&(p=parseInt(x[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(f)&&(f.length>1?(d={code:"PGRST116",details:`Results contain ${f.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},f=null,p=null,m=406,y="Not Acceptable"):f.length===1?f=f[0]:f=null)}else{const b=await i.text();try{d=JSON.parse(b),Array.isArray(d)&&i.status===404&&(f=[],d=null,m=200,y="OK")}catch{i.status===404&&b===""?(m=204,y="No Content"):d={message:b}}if(d&&this.isMaybeSingle&&(!((u=d==null?void 0:d.details)===null||u===void 0)&&u.includes("0 rows"))&&(d=null,m=200,y="OK"),d&&this.shouldThrowOnError)throw new Zoe.default(d)}return{error:d,data:f,count:p,status:m,statusText:y}});return this.shouldThrowOnError||(s=s.catch(i=>{var a,o,l;return{error:{message:`${(a=i==null?void 0:i.name)!==null&&a!==void 0?a:"FetchError"}: ${i==null?void 0:i.message}`,details:`${(o=i==null?void 0:i.stack)!==null&&o!==void 0?o:""}`,hint:"",code:`${(l=i==null?void 0:i.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),s.then(e,n)}returns(){return this}overrideTypes(){return this}};AE.default=Qoe;var Joe=Xr&&Xr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(CE,"__esModule",{value:!0});const ele=Joe(AE);let tle=class extends ele.default{select(e){let n=!1;const r=(e??"*").split("").map(s=>/\s/.test(s)&&!n?"":(s==='"'&&(n=!n),s)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:n=!0,nullsFirst:r,foreignTable:s,referencedTable:i=s}={}){const a=i?`${i}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${e}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,n,{foreignTable:r,referencedTable:s=r}={}){const i=typeof s>"u"?"offset":`${s}.offset`,a=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${n-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
521explain({analyze:e=!1,verbose:n=!1,settings:r=!1,buffers:s=!1,wal:i=!1,format:a="text"}={}){var o;const l=[e?"analyze":null,n?"verbose":null,r?"settings":null,s?"buffers":null,i?"wal":null].filter(Boolean).join("|"),u=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${u}"; options=${l};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};CE.default=tle;var nle=Xr&&Xr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(R0,"__esModule",{value:!0});const rle=nle(CE);let sle=class extends rle.default{eq(e,n){return this.url.searchParams.append(e,`eq.${n}`),this}neq(e,n){return this.url.searchParams.append(e,`neq.${n}`),this}gt(e,n){return this.url.searchParams.append(e,`gt.${n}`),this}gte(e,n){return this.url.searchParams.append(e,`gte.${n}`),this}lt(e,n){return this.url.searchParams.append(e,`lt.${n}`),this}lte(e,n){return this.url.searchParams.append(e,`lte.${n}`),this}like(e,n){return this.url.searchParams.append(e,`like.${n}`),this}likeAllOf(e,n){return this.url.searchParams.append(e,`like(all).{${n.join(",")}}`),this}likeAnyOf(e,n){return this.url.searchParams.append(e,`like(any).{${n.join(",")}}`),this}ilike(e,n){return this.url.searchParams.append(e,`ilike.${n}`),this}ilikeAllOf(e,n){return this.url.searchParams.append(e,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(e,n){return this.url.searchParams.append(e,`ilike(any).{${n.join(",")}}`),this}is(e,n){return this.url.searchParams.append(e,`is.${n}`),this}in(e,n){const r=Array.from(new Set(n)).map(s=>typeof s=="string"&&new RegExp("[,()]").test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}contains(e,n){return typeof n=="string"?this.url.searchParams.append(e,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(e,`cs.{${n.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(n)}`),this}containedBy(e,n){return typeof n=="string"?this.url.searchParams.append(e,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(e,`cd.{${n.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(n)}`),this}rangeGt(e,n){return this.url.searchParams.append(e,`sr.${n}`),this}rangeGte(e,n){return this.url.searchParams.append(e,`nxl.${n}`),this}rangeLt(e,n){return this.url.searchParams.append(e,`sl.${n}`),this}rangeLte(e,n){return this.url.searchParams.append(e,`nxr.${n}`),this}rangeAdjacent(e,n){return this.url.searchParams.append(e,`adj.${n}`),this}overlaps(e,n){return typeof n=="string"?this.url.searchParams.append(e,`ov.${n}`):this.url.searchParams.append(e,`ov.{${n.join(",")}}`),this}textSearch(e,n,{config:r,type:s}={}){let i="";s==="plain"?i="pl":s==="phrase"?i="ph":s==="websearch"&&(i="w");const a=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${a}.${n}`),this}match(e){return Object.entries(e).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(e,n,r){return this.url.searchParams.append(e,`not.${n}.${r}`),this}or(e,{foreignTable:n,referencedTable:r=n}={}){const s=r?`${r}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,n,r){return this.url.searchParams.append(e,`${n}.${r}`),this}};R0.default=sle;var ile=Xr&&Xr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(EE,"__esModule",{value:!0});const wx=ile(R0);let ale=class{constructor(e,{headers:n={},schema:r,fetch:s}){this.url=e,this.headers=new Headers(n),this.schema=r,this.fetch=s}select(e,n){const{head:r=!1,count:s}=n??{},i=r?"HEAD":"GET";let a=!1;const o=(e??"*").split("").map(l=>/\s/.test(l)&&!a?"":(l==='"'&&(a=!a),l)).join("");return this.url.searchParams.set("select",o),s&&this.headers.append("Prefer",`count=${s}`),new wx.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(e,{count:n,defaultToNull:r=!0}={}){var s;const i="POST";if(n&&this.headers.append("Prefer",`count=${n}`),r||this.headers.append("Prefer","missing=default"),Array.isArray(e)){const a=e.reduce((o,l)=>o.concat(Object.keys(l)),[]);if(a.length>
5210){const o=[...new Set(a)].map(l=>`"${l}"`);this.url.searchParams.set("columns",o.join(","))}}return new wx.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}upsert(e,{onConflict:n,ignoreDuplicates:r=!1,count:s,defaultToNull:i=!0}={}){var a;const o="POST";if(this.headers.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),n!==void 0&&this.url.searchParams.set("on_conflict",n),s&&this.headers.append("Prefer",`count=${s}`),i||this.headers.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){const u=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new wx.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}update(e,{count:n}={}){var r;const s="PATCH";return n&&this.headers.append("Prefer",`count=${n}`),new wx.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:e}={}){var n;const r="DELETE";return e&&this.headers.append("Prefer",`count=${e}`),new wx.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}};EE.default=ale;var BV=Xr&&Xr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yI,"__esModule",{value:!0});const ole=BV(EE),lle=BV(R0);let cle=class $V{constructor(e,{headers:n={},schema:r,fetch:s}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.fetch=s}from(e){const n=new URL(`${this.url}/${e}`);return new ole.default(n,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new $V(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,n={},{head:r=!1,get:s=!1,count:i}={}){var a;let o;const l=new URL(`${this.url}/rpc/${e}`);let u;r||s?(o=r?"HEAD":"GET",Object.entries(n).filter(([f,p])=>p!==void 0).map(([f,p])=>[f,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([f,p])=>{l.searchParams.append(f,p)})):(o="POST",u=n);const d=new Headers(this.headers);return i&&d.set("Prefer",`count=${i}`),new lle.default({method:o,url:l,headers:d,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};yI.default=cle;var Jy=Xr&&Xr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.PostgrestError=Ws.PostgrestBuilder=Ws.PostgrestTransformBuilder=Ws.PostgrestFilterBuilder=Ws.PostgrestQueryBuilder=Ws.PostgrestClient=void 0;const UV=Jy(yI);Ws.PostgrestClient=UV.default;const zV=Jy(EE);Ws.PostgrestQueryBuilder=zV.default;const VV=Jy(R0);Ws.PostgrestFilterBuilder=VV.default;const WV=Jy(CE);Ws.PostgrestTransformBuilder=WV.default;const HV=Jy(AE);Ws.PostgrestBuilder=HV.default;const qV=Jy(TE);Ws.PostgrestError=qV.default;var ule=Ws.default={PostgrestClient:UV.default,PostgrestQueryBuilder:zV.default,PostgrestFilterBuilder:VV.default,PostgrestTransformBuilder:WV.default,PostgrestBuilder:HV.default,PostgrestError:qV.default};const{PostgrestClient:dle,PostgrestQueryBuilder:sAe,PostgrestFilterBuilder:iAe,PostgrestTransformBuilder:aAe,PostgrestBuilder:oAe,PostgrestError:lAe}=ule;class hle{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."};if(typeof process<"u"){const n=process.versions;if(n&&n.node){const r=n.node,s=parseInt(r.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:
522import ws from "ws"
523new 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+=`
524
525Suggested solution: ${e.workaround}`),new Error(n)}static createWebSocket(e,n){const r=this.getWebSocketConstructor();return new r(e,n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const fle="2.75.0",ple=`realtime-js/${fle}`,mle="1.0.0",Yj=1e4,gle=1e3,yle=100;var Cv;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Cv||(Cv={}));var qn;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(qn||(qn={}));var Ga;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(Ga||(Ga={}));var Xj;(function(t){t.websocket="websocket"})(Xj||(Xj={}));var sh;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(sh||(sh={}));class xle{constructor(){this.HEADER_LENGTH=1}decode(e,n){return e.constructor===ArrayBuffer?n(this._binaryDecode(e)):n(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const n=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,n,r)}_decodeBroadcast(e,n,r){const s=n.getUint8(1),i=n.getUint8(2);let a=this.HEADER_LENGTH+2;const o=r.decode(e.slice(a,a+s));a=a+s;const l=r.decode(e.slice(a,a+i));a=a+i;const u=JSON.parse(r.decode(e.slice(a,e.byteLength)));return{ref:null,topic:o,event:l,payload:u}}}class GV{constructor(e,n){this.callback=e,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var zt;(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.t
525srange="tsrange",t.tstzrange="tstzrange"})(zt||(zt={}));const gF=(t,e,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((i,a)=>(i[a]=vle(a,t,e,s),i),{}):{}},vle=(t,e,n,r)=>{const s=e.find(o=>o.name===t),i=s==null?void 0:s.type,a=n[t];return i&&!r.includes(i)?KV(i,a):Zj(a)},KV=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return Sle(e,n)}switch(t){case zt.bool:return ble(e);case zt.float4:case zt.float8:case zt.int2:case zt.int4:case zt.int8:case zt.numeric:case zt.oid:return wle(e);case zt.json:case zt.jsonb:return kle(e);case zt.timestamp:return _le(e);case zt.abstime:case zt.date:case zt.daterange:case zt.int4range:case zt.int8range:case zt.money:case zt.reltime:case zt.text:case zt.time:case zt.timestamptz:case zt.timetz:case zt.tsrange:case zt.tstzrange:return Zj(e);default:return Zj(e)}},Zj=t=>t,ble=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},wle=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},kle=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},Sle=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let i;const a=t.slice(1,n);try{i=JSON.parse("["+a+"]")}catch{i=a?a.split(","):[]}return i.map(o=>KV(e,o))}return t},_le=t=>typeof t=="string"?t.replace(" ","T"):t,YV=t=>{let e=t;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")+"/api/broadcast"};class lA{constructor(e,n,r={},s=Yj){this.channel=e,this.event=n,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,n){var r;return this._hasReceived(e)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:e,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(n))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var yF;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(yF||(yF={}));class Av{constructor(e,n){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{const{onJoin:i,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Av.syncState(this.state,s,i,a),this.pendingDiffs.forEach(l=>{this.state=Av.syncDiff(this.state,l,i,a)}),this.pendingDiffs=[],o()}),this.channel._on(r.diff,{},s=>{const{onJoin:i,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Av.syncDiff(this.state,s,i,a),o())}),this.onJoin((s,i,a)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:a})}),this.onLeave((s,i,a)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,n,r,s){const i=this.cloneDeep(e),a=this.transformState(n),o={},l={};return this.map(i,(u,d)=>{a[u]||(l[u]=d)}),this.map(a,(u,d)=>{const f=i[u];if(f){const p=d.map(b=>b.presence_ref),m=f.map(b=>b.presence_ref),y=d.filter(b=>m.indexOf(b.presence_ref)<0),g=f.filter(b=>p.indexOf(b.presence_ref)<0);y.length>0&&(o[u]=y),g.length>0&&(l[u]=g)}else o[u]=d}),this.syncDiff(i,{joins:o,leaves:l},r,s)}static syncDiff(e,n,r,s){const{joins:i,leaves:a}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(i,(o,l)=>{var u;
525const d=(u=e[o])!==null&&u!==void 0?u:[];if(e[o]=this.cloneDeep(l),d.length>0){const f=e[o].map(m=>m.presence_ref),p=d.filter(m=>f.indexOf(m.presence_ref)<0);e[o].unshift(...p)}r(o,d,l)}),this.map(a,(o,l)=>{let u=e[o];if(!u)return;const d=l.map(f=>f.presence_ref);u=u.filter(f=>d.indexOf(f.presence_ref)<0),e[o]=u,s(o,u,l),u.length===0&&delete e[o]}),e}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const s=e[r];return"metas"in s?n[r]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[r]=s,n},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var xF;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(xF||(xF={}));var Tv;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Tv||(Tv={}));var yl;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(yl||(yl={}));class xI{constructor(e,n={config:{}},r){var s,i;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.state=qn.closed,this.joinedOnce=!1,this.pushBuffer=[],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.timeout=this.socket.timeout,this.joinPush=new lA(this,Ga.join,this.params,this.timeout),this.rejoinTimer=new GV(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=qn.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=qn.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=qn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=qn.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=qn.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Ga.reply,{},(a,o)=>{this._trigger(this._replyEventName(o),a)}),this.presence=new Av(this),this.broadcastEndpointURL=YV(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,n=this.timeout){var r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.state==qn.closed){const{config:{broadcast:a,presence:o,private:l}}=this.params,u=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(m=>m.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[Tv.PRESENCE]&&this.bindings[Tv.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},p={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:d}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(m=>e==null?void 0:e(yl.CHANNEL_ERROR,m)),this._onClose(()=>e==null?void 0:e(yl.CLOSED)),this.updateJoinPayload(Object.assign({config:p},f)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:m})=>{var y;if(this.socket.setAuth(),m===void 0){e==null||e(yl.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,b=(y=g==null?void 0:g.length)!==null&&y!==void 0?y:0,x=[];for(let w=0;w<b;w++){const v=g[w],{filter:{event:S,schema:E,table:C,filter:T}}=v,P=m&&m[w];if(P&&P.event===S&&P.schema===E&&P.table===C&&P.filter===T)x.push(Object.assign(Object.assign({},v),{id:P.id}));else{this.unsubscribe(),this.state=qn.errored,e==null||e(yl.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,e&&e(yl.SUBSCRIBED);return}}).receive("error",m=>{this.state=qn.errored,e==null||e(yl.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(yl.TIMED_OUT)})}return this}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){return this.state===qn.joined&&e===Tv.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,n,r)}async send(e,n={}){var r,s;if(!this._canPush()&&e.type==="broadcast"){const{event:i,payload:a}=e,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var a,o,l;const u=this._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)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=qn.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Ga.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(s=>{r=new lA(this,Ga.leave,{},e),r.receive("ok",()=>{n(),s("ok")}).receive("timeout",()=>{n(),s("timed out")}).receive("error",()=>{s("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}
525teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=qn.closed,this.bindings={}}async _fetchWithTimeout(e,n,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),a=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(i),a}_push(e,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new lA(this,e,n,r);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>yle){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(e,n,r){return n}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,n,r){var s,i;const a=e.toLocaleLowerCase(),{close:o,error:l,leave:u,join:d}=Ga;if(r&&[o,l,u,d].indexOf(a)>=0&&r!==this._joinRef())return;let p=this._onMessage(a,n,r);if(n&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(m=>{var y,g,b;return((y=m.filter)===null||y===void 0?void 0:y.event)==="*"||((b=(g=m.filter)===null||g===void 0?void 0:g.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===a}).map(m=>m.callback(p,r)):(i=this.bindings[a])===null||i===void 0||i.filter(m=>{var y,g,b,x,w,v;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in m){const S=m.id,E=(y=m.filter)===null||y===void 0?void 0:y.event;return S&&((g=n.ids)===null||g===void 0?void 0:g.includes(S))&&(E==="*"||(E==null?void 0:E.toLocaleLowerCase())===((b=n.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const S=(w=(x=m==null?void 0:m.filter)===null||x===void 0?void 0:x.event)===null||w===void 0?void 0:w.toLocaleLowerCase();return S==="*"||S===((v=n==null?void 0:n.event)===null||v===void 0?void 0:v.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===a}).map(m=>{if(typeof p=="object"&&"ids"in p){const y=p.data,{schema:g,table:b,commit_timestamp:x,type:w,errors:v}=y;p=Object.assign(Object.assign({},{schema:g,table:b,commit_timestamp:x,eventType:w,new:{},old:{},errors:v}),this._getPayloadRecords(y))}m.callback(p,r)})}_isClosed(){return this.state===qn.closed}_isJoined(){return this.state===qn.joined}_isJoining(){return this.state===qn.joining}_isLeaving(){return this.state===qn.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,n,r){const s=e.toLocaleLowerCase(),i={type:s,filter:n,callback:r};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,n){const r=e.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&xI.isEqual(s.filter,n))})),this}static isEqual(e,n){if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Ga.close,{},e)}_onError(e){this._on(Ga.error,{},n=>e(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=qn.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=gF(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=gF(e.columns,e.old_record)),n}}const cA=()=>{},k1={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Ele=[1e3,2e3,5e3,1e4],Cle=1e4,Ale=`
526  addEventListener("message", (e) => {
527    if (e.data.event === "start") {
528      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
529    }
530  });`;class Tle{constructor(e,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Yj,this.transport=null,this.heartbeatIntervalMs=k1.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=cA,this.ref=0,this.reconnectTimer=null,this.logger=cA,this.conn=null,this.sendBuffer=[],this.serializer
530=new xle,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>{let i;return s?i=s:typeof fetch>"u"?i=(...a)=>Kf(async()=>{const{default:o}=await Promise.resolve().then(()=>Qy);return{default:o}},void 0).then(({default:o})=>o(...a)).catch(o=>{throw new Error(`Failed to load @supabase/node-fetch: ${o.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):i=fetch,(...a)=>i(...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,this.endPoint=`${e}/${Xj.websocket}`,this.httpEndpoint=YV(e),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=hle.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const n=e.message;throw n.includes("Node.js")?new Error(`${n}
531
532To use Realtime in Node.js, you need to provide a WebSocket implementation:
533
534Option 1: Use Node.js 22+ which has native WebSocket support
535Option 2: Install and provide the "ws" package:
536
537  npm install ws
538
539  import ws from "ws"
540  const client = new RealtimeClient(url, {
541    ...options,
542    transport: ws
543  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:mle}))}disconnect(e,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},e?this.conn.close(e,n??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const e=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,n,r){this.logger(e,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case Cv.connecting:return sh.Connecting;case Cv.open:return sh.Open;case Cv.closing:return sh.Closing;default:return sh.Closed}}isConnected(){return this.connectionState()===sh.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,n={config:{}}){const r=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new xI(`realtime:${e}`,n,this);return this.channels.push(i),i}}push(e){const{topic:n,event:r,payload:s,ref:i}=e,a=()=>{this.encode(e,o=>{var l;(l=this.conn)===null||l===void 0||l.send(o)})};this.log("push",`${n} ${r} (${i})`,s),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(gle,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},k1.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>
5430&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let n=this.channels.find(r=>r.topic===e&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${e}"`),n.unsubscribe())}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply")try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error")}catch(u){this.log("error","error in heartbeat callback",u)}n.ref&&n.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:r,event:s,payload:i,ref:a}=n,o=a?`(${a})`:"",l=i.status||"";this.log("receive",`${l} ${r} ${s} ${o}`.trim(),i),this.channels.filter(u=>u._isMember(r)).forEach(u=>u._trigger(s,i,a)),this._triggerStateCallbacks("message",n)})}_clearTimer(e){var n;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),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))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_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.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var n;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(Ga.error))}_appendParams(e,n){if(Object.keys(n).length===0)return e;const r=e.match(/\?/)?"&":"?",s=new URLSearchParams(n);return`${e}${r}${s}`}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([Ale],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(e,n=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(e=null){let n;e?n=e:this.accessToken?n=await this.accessToken():n=this.accessTokenValue,this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const s={access_token:n,version:ple};n&&r.updateJoinPayload(s),r.joinedOnce&&r._isJoined()&&r._push(Ga.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(n=>{this.log("error",`error setting auth in ${e}`,n)})}_triggerStateCallbacks(e,n){try{this.stateChangeCallbacks[e].forEach(r=>{try{r(n)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new GV(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},k1.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var n,r,s,i,a,o,l,u,d;if(this.transport=(n=e==null?void 0:e.transport)!==null&&n!==void 0?n:null,this.timeout=(r=e==null?void 0:e.timeout)!==null&&r!==void 0?r:Yj,this.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:k1.HEARTBEAT_INTERVAL,this.worker=(i=e==null?void 0:e.worker)!==null&&i!==void 0?i:!1,this.accessToken=(a=e==null?void 0:e.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(o=e==null?void 0:e.heartbeatCallback)!==null&&o!==void 0?o:cA,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(l=e==null?void 0:e.reconnectAfterMs)!==null&&l!==void 0?l:f=>Ele[f-1]||Cle,this.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:(f,p)=>p(JSON.stringify(f)),this.decode=(d=e==null?void 0:e.decode)!==null&&d!==void 0?d:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}
543class vI extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function Bn(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class jle extends vI{constructor(e,n,r){super(e),this.name="StorageApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class Qj extends vI{constructor(e,n){super(e),this.name="StorageUnknownError",this.originalError=n}}var Nle=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};const XV=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Kf(async()=>{const{default:r}=await Promise.resolve().then(()=>Qy);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},Ple=()=>Nle(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Kf(()=>Promise.resolve().then(()=>Qy),void 0)).Response:Response}),Jj=t=>{if(Array.isArray(t))return t.map(n=>Jj(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=Jj(r)}),e},Rle=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)};var lp=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};const uA=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Ile=(t,e,n)=>lp(void 0,void 0,void 0,function*(){const r=yield Ple();t instanceof r&&!(n!=null&&n.noResolveJson)?t.json().then(s=>{const i=t.status||500,a=(s==null?void 0:s.statusCode)||i+"";e(new jle(uA(s),i,a))}).catch(s=>{e(new Qj(uA(s),s))}):e(new Qj(uA(t),t))}),Dle=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!r?s:(Rle(r)?(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(r)):s.body=r,e!=null&&e.duplex&&(s.duplex=e.duplex),Object.assign(Object.assign({},s),n))};function I0(t,e,n,r,s,i){return lp(this,void 0,void 0,function*(){return new Promise((a,o)=>{t(n,Dle(e,r,s,i)).then(l=>{if(!l.ok)throw l;return r!=null&&r.noResolveJson?l:l.json()}).then(l=>a(l)).catch(l=>Ile(l,o,r))})})}function qS(t,e,n,r){return lp(this,void 0,void 0,function*(){return I0(t,"GET",e,n,r)})}function go(t,e,n,r,s){return lp(this,void 0,void 0,function*(){return I0(t,"POST",e,r,s,n)})}function eN(t,e,n,r,s){return lp(this,void 0,void 0,function*(){return I0(t,"PUT",e,r,s,n)})}function Mle(t,e,n,r){return lp(this,void 0,void 0,function*(){return I0(t,"HEAD",e,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function ZV(t,e,n,r,s){return lp(this,void 0,void 0,function*(){return I0(t,"DELETE",e,r,s,n)})}var Ole=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};class Lle{constructor(e,n){this.downloadFn=e,this.shouldThrowOnError=n}then(e,n){return this.execute().then(e,n)}execute(){return Ole(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Bn(e))return{data:null,error:e};throw e}})}}var Fle=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};class Ble{constructor(e,n){this.downloadFn=e,this.shouldThrowOnError=n}asStream(){return new Lle(this.downloadFn,this.shouldThrowOnError)}then(e,n){return this.execute().then(e,n)}execute(){return Fle(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Bn(e))return{data:null,error:e};throw e}})}}var As=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}
543return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};const $le={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},vF={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Ule{constructor(e,n={},r,s){this.shouldThrowOnError=!1,this.url=e,this.headers=n,this.bucketId=r,this.fetch=XV(s)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,n,r,s){return As(this,void 0,void 0,function*(){try{let i;const a=Object.assign(Object.assign({},vF),s);let o=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const l=a.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",a.cacheControl),l&&i.append("metadata",this.encodeMetadata(l)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.append("cacheControl",a.cacheControl),l&&i.append("metadata",this.encodeMetadata(l))):(i=r,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),s!=null&&s.headers&&(o=Object.assign(Object.assign({},o),s.headers));const u=this._removeEmptyFolders(n),d=this._getFinalPath(u),f=yield(e=="PUT"?eN:go)(this.fetch,`${this.url}/object/${d}`,i,Object.assign({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{data:{path:u,id:f.Id,fullPath:f.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Bn(i))return{data:null,error:i};throw i}})}upload(e,n,r){return As(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,n,r)})}uploadToSignedUrl(e,n,r,s){return As(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),a=this._getFinalPath(i),o=new URL(this.url+`/object/upload/sign/${a}`);o.searchParams.set("token",n);try{let l;const u=Object.assign({upsert:vF.upsert},s),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);const f=yield eN(this.fetch,o.toString(),l,{headers:d});return{data:{path:i,fullPath:f.Key},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(Bn(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e,n){return As(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e);const s=Object.assign({},this.headers);n!=null&&n.upsert&&(s["x-upsert"]="true");const i=yield go(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:s}),a=new URL(this.url+i.url),o=a.searchParams.get("token");if(!o)throw new vI("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:o},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bn(r))return{data:null,error:r};throw r}})}update(e,n,r){return As(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,n,r)})}move(e,n,r){return As(this,void 0,void 0,function*(){try{return{data:yield go(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bn(s))return{data:null,error:s};throw s}})}copy(e,n,r){return As(this,void 0,void 0,function*(){try{return{data:{path:(yield go(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bn(s))return{data:null,error:s};throw s}})}createSignedUrl(e,n,r){return As(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),i=yield go(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const a=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${a}`)},{data:i,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bn(s))return{data:null,error:s};throw s}})}createSignedUrls(e,n,r){return As(this,void 0,void 0,function*(){try{const s=yield go(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:e},{headers:this.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:s.map(a=>Object.assign(Object.assign({},a),{signedUrl:a.signedURL?encodeURI(`${this.url}${a.signedURL}${i}`):null})),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bn(s))return{data:null,error:s};throw s}})}download(e,n){const s=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),a=i?`?${i}`:"",o=this._getFinalPath(e),l=()=>qS(this.fetch,`${this.url}/${s}/${o}${a}`,{headers:this.headers,noResolveJson:!0});return new Ble(l,this.shouldThrowOnError)}info(e){return As(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{const r=yield qS(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:Jj(r),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bn(r))return{data:null,error:r};throw r}})}exists(e){return As(this,void 0,void 0,function*(){const n=this._getFinalPath(e);try{return yield Mle(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bn(r)&&r instanceof Qj){const s=r.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:r}}throw r}})}getPublicUrl(e,n){const r=this._getFinalPath(e),s=[],i=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";i!==""&&s.push(i);const o=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});l!==""&&s.push(l);let u=s.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}${u}`)}}}remove(e){return As(this,void 0,void 0,function*(){try{return{data:yield ZV(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bn(n))return{data:null,error:n};throw n}})}list(e,n,r){return As(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},$le),n),{prefix:e||""});return{data:yield go(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},r),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bn(s))return{data:null,error:s};throw s}})}listV2(e,n){return As(this,void 0,void 0,function*(){try{const r=Object.assign({},e);return{data:yield go(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,r,{headers:this.headers},n),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bn(r))return{data:null,error:r};throw r}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const n=[];return e.width&&n.push(`width=${e.width}`),e.height&&n.push(`height=${e.height}`),e.resize&&n.push(`resize=${e.resize}`),e.format&&n.push(`format=${e.format}`),e.quality&&n.push(`quality=${e.quality}`),n.join("&")}}const zle="2.75.0",Vle={"X-Client-Info":`storage-js/${zle}`};var gp=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}
543return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};class Wle{constructor(e,n={},r,s){this.shouldThrowOnError=!1;const i=new URL(e);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Vle),n),this.fetch=XV(r)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(){return gp(this,void 0,void 0,function*(){try{return{data:yield qS(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Bn(e))return{data:null,error:e};throw e}})}getBucket(e){return gp(this,void 0,void 0,function*(){try{return{data:yield qS(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bn(n))return{data:null,error:n};throw n}})}createBucket(e){return gp(this,arguments,void 0,function*(n,r={public:!1}){try{return{data:yield go(this.fetch,`${this.url}/bucket`,{id:n,name:n,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(Bn(s))return{data:null,error:s};throw s}})}updateBucket(e,n){return gp(this,void 0,void 0,function*(){try{return{data:yield eN(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Bn(r))return{data:null,error:r};throw r}})}emptyBucket(e){return gp(this,void 0,void 0,function*(){try{return{data:yield go(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bn(n))return{data:null,error:n};throw n}})}deleteBucket(e){return gp(this,void 0,void 0,function*(){try{return{data:yield ZV(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Bn(n))return{data:null,error:n};throw n}})}}class Hle extends Wle{constructor(e,n={},r,s){super(e,n,r,s)}from(e){return new Ule(this.url,this.headers,e,this.fetch)}}const qle="2.75.0";let Ux="";typeof Deno<"u"?Ux="deno":typeof document<"u"?Ux="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ux="react-native":Ux="node";const Gle={"X-Client-Info":`supabase-js-${Ux}/${qle}`},Kle={headers:Gle},Yle={schema:"public"},Xle={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Zle={};var Qle=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};const Jle=t=>{let e;return t?e=t:typeof fetch>"u"?e=OV:e=fetch,(...n)=>e(...n)},ece=()=>typeof Headers>"u"?LV:Headers,tce=(t,e,n)=>{const r=Jle(n),s=ece();return(i,a)=>Qle(void 0,void 0,void 0,function*(){var o;const l=(o=yield e())!==null&&o!==void 0?o:t;let u=new s(a==null?void 0:a.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(i,Object.assign(Object.assign({},a),{headers:u}))})};var nce=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};function rce(t){return t.endsWith("/")?t:t+"/"}function sce(t,e){var n,r;const{db:s,auth:i,realtime:a,global:o}=t,{db:l,auth:u,realtime:d,global:f}=e,p={db:Object.assign(Object.assign({},l),s),auth:Object.assign(Object.assign({},u),i),realtime:Object.assign(Object.assign({},d),a),storage:{},global:Object.assign(Object.assign(Object.assign({},f),o),{headers:Object.assign(Object.assign({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=o==null?void 0:o.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>nce(this,void 0,void 0,function*(){return""})};return t.accessToken?p.accessToken=t.accessToken:delete p.accessToken,p}function ice(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");
543if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(rce(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const QV="2.75.0",Pp=30*1e3,tN=3,dA=tN*Pp,ace="http://localhost:9999",oce="supabase.auth.token",lce={"X-Client-Info":`gotrue-js/${QV}`},nN="X-Supabase-Api-Version",JV={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},cce=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,uce=10*60*1e3;class hb extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Te(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class dce extends hb{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function hce(t){return Te(t)&&t.name==="AuthApiError"}class ih extends hb{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class Dd extends hb{constructor(e,n,r,s){super(e,r,s),this.name=n,this.status=r}}class Lc extends Dd{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function fce(t){return Te(t)&&t.name==="AuthSessionMissingError"}class yp extends Dd{constructor(){super("Auth session or user missing","AuthInvalidToken
543ResponseError",500,void 0)}}class S1 extends Dd{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class _1 extends Dd{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function pce(t){return Te(t)&&t.name==="AuthImplicitGrantRedirectError"}class bF extends Dd{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class rN extends Dd{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function hA(t){return Te(t)&&t.name==="AuthRetryableFetchError"}class wF extends Dd{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class sN extends Dd{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const GS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),kF=` 	
544\r=`.split(""),mce=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<kF.length;e+=1)t[kF[e].charCodeAt(0)]=-2;for(let e=0;e<GS.length;e+=1)t[GS[e].charCodeAt(0)]=e;return t})();function SF(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(GS[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(GS[r]),e.queuedBits-=6}}function eW(t,e,n){const r=mce[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 _F(t){const e=[],n=a=>{e.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=a=>{xce(a,r,n)};for(let a=0;a<t.length;a+=1)eW(t.charCodeAt(a),s,i);return e.join("")}function gce(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 yce(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}gce(r,e)}}function xce(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 Em(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)eW(t.charCodeAt(s),n,r);return new Uint8Array(e)}function vce(t){const e=[];return yce(t,n=>e.push(n)),new Uint8Array(e)}function mh(t){const e=[],n={queue:0,queuedBits:0},r=s=>{e.push(s)};return t.forEach(s=>SF(s,n,r)),SF(null,n,r),e.join("")}function bce(t){return Math.round(Date.now()/1e3)+t}function wce(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}const ei=()=>typeof window<"u"&&typeof document<"u",Ud={tested:!1,writable:!1},tW=()=>{if(!ei())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ud.tested)return Ud.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Ud.tested=!0,Ud.writable=!0}catch{Ud.tested=!0,Ud.writable=!1}return Ud.writable};function kce(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,i)=>{e[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{e[s]=r}),e}const nW=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...n)=>Kf(async()=>{const{default:r}=await Promise.resolve().then(()=>Qy);return{default:r}},void 0).then(({default:r})=>r(...n)):e=fetch,(...n)=>e(...n)},Sce=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Rp=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},zd=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Pc=async(t,e)=>{await t.removeItem(e)};
544class jE{constructor(){this.promise=new jE.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}jE.promiseConstructor=Promise;function fA(t){const e=t.split(".");if(e.length!==3)throw new sN("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!cce.test(e[r]))throw new sN("JWT not in base64url format");return{header:JSON.parse(_F(e[0])),payload:JSON.parse(_F(e[1])),signature:Em(e[2]),raw:{header:e[0],payload:e[1]}}}async function _ce(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function Ece(t,e){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const a=await t(i);if(!e(i,null,a)){r(a);return}}catch(a){if(!e(i,a)){s(a);return}}})()})}function Cce(t){return("0"+t.toString(16)).substr(-2)}function Ace(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let i=0;i<56;i++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(e),Array.from(e,Cce).join("")}async function Tce(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function jce(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 Tce(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function xp(t,e,n=!1){const r=Ace();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Rp(t,`${e}-code-verifier`,s);const i=await jce(r);return[i,r===i?"plain":"s256"]}const Nce=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Pce(t){const e=t.headers.get(nN);if(!e||!e.match(Nce))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function Rce(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 Ice(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 Dce=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function vp(t){if(!Dce.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function pA(){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 EF(t){return JSON.parse(JSON.stringify(t))}var Mce=function(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 s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};const Qd=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Oce=[502,503,504];async function CF(t){var e;if(!Sce(t))throw new rN(Qd(t),0);if(Oce.includes(t.status))throw new rN(Qd(t),t.status);let n;try{n=await t.json()}catch(i){throw new ih(Qd(i),i)}let r;const s=Pce(t);if(s&&s.getTime()>=JV["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 wF(Qd(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new Lc}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((i,a)=>
544i&&typeof a=="string",!0))throw new wF(Qd(n),t.status,n.weak_password.reasons);throw new dce(Qd(n),t.status||500,r)}const Lce=(t,e,n,r)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function Be(t,e,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[nN]||(i[nN]=JV["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const a=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await Fce(t,e,n+o,{headers:i,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 Fce(t,e,n,r,s,i){const a=Lce(e,r,s,i);let o;try{o=await t(n,Object.assign({},a))}catch(l){throw console.error(l),new rN(Qd(l),0)}if(o.ok||await CF(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(l){await CF(l)}}function Ea(t){var e;let n=null;Uce(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=bce(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:n,user:r},error:null}}function AF(t){const e=Ea(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 Hc(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function Bce(t){return{data:t,error:null}}function $ce(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=t,a=Mce(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},l=Object.assign({},a);return{data:{properties:o,user:l},error:null}}function TF(t){return t}function Uce(t){return t.access_token&&t.refresh_token&&t.expires_in}const mA=["global","local","others"];var zce=function(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 s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};class Vce{constructor({url:e="",headers:n={},fetch:r}){this.url=e,this.headers=n,this.fetch=nW(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),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(e,n=mA[0]){if(mA.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${mA.join(", ")}`);try{return await Be(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Te(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await Be(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Hc})}catch(r){if(Te(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=zce(e,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Be(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:$ce,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Te(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await Be(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Hc})}catch(n){if(Te(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,s,i,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},d=await Be(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:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:TF});if(d.error)throw d.error;const f=await d.json(),p=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(l=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(y.split(";")[1].split("=")[1]);u[`${b}Page`]=g}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Te(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){vp(e);try{return await Be(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Hc})}catch(n){if(Te(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){vp(e);try{return await Be(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:Hc})}catch(r){if(Te(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){vp(e);
544try{return await Be(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:Hc})}catch(r){if(Te(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){vp(e.userId);try{const{data:n,error:r}=await Be(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(Te(n))return{data:null,error:n};throw n}}async _deleteFactor(e){vp(e.userId),vp(e.id);try{return{data:await Be(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(Te(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,s,i,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},d=await Be(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:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:TF});if(d.error)throw d.error;const f=await d.json(),p=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(l=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(y.split(";")[1].split("=")[1]);u[`${b}Page`]=g}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Te(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await Be(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Te(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await Be(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Te(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await Be(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Te(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await Be(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Te(n))return{data:null,error:n};throw n}}}function jF(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}const bp={debug:!!(globalThis&&tW()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class rW extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class Wce extends rW{}async function Hce(t,e,n){bp.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const r=new globalThis.AbortController;return e>0&&setTimeout(()=>{r.abort(),bp.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){bp.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await n()}finally{bp.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw bp.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Wce(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(bp.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}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"),await n()}}))}function qce(){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 sW(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}
544" is invalid.`);return t.toLowerCase()}function Gce(t){return parseInt(t,16)}function Kce(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function Yce(t){var e;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:l,resources:u,scheme:d,uri:f,version:p}=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(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
545`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const m=sW(t.address),y=d?`${d}://${r}
545`:r,g=t.statement?`${t.statement}
546`:"",b=`${y} wants you to sign in with your Ethereum account:
547${m}
548
549${g}`;let x=`URI: ${f}
550Version: ${p}
551Chain ID: ${n}${a?`
552Nonce: ${a}`:""}
553Issued At: ${i.toISOString()}`;if(s&&(x+=`
554Expiration Time: ${s.toISOString()}`),o&&(x+=`
555Not Before: ${o.toISOString()}`),l&&(x+=`
556Request ID: ${l}`),u){let w=`
557Resources:`;for(const v of u){if(!v||typeof v!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${v}`);w+=`
558- ${v}`}x+=w}return`${b}
559${x}`}class Fn extends Error{constructor({message:e,code:n,cause:r,name:s}){var i;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=s??(r instanceof Error?r.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}}class KS extends Fn{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function Xce({error:t,options:e}){var n,r,s;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Fn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Fn({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=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Fn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Fn({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 Fn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Fn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new Fn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Fn({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(aW(a)){if(i.rp.id!==a)return new Fn({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Fn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Fn({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 Fn({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 Fn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Zce({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 Fn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Fn({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(aW(r)){if(n.rpId!==r)return new Fn({message:`The RP ID "${n.rpId}
559" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Fn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Fn({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 Fn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}var iW=function(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 s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n};class Qce{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 Jce=new Qce;function eue(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,s=iW(t,["challenge","user","excludeCredentials"]),i=Em(e).buffer,a=Object.assign(Object.assign({},n),{id:Em(n.id).buffer}),o=Object.assign(Object.assign({},s),{challenge:i,user:a});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let l=0;l<r.length;l++){const u=r[l];o.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:Em(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function tue(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=iW(t,["challenge","allowCredentials"]),s=Em(e).buffer,i=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const o=n[a];i.allowCredentials[a]=Object.assign(Object.assign({},o),{id:Em(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return i}function nue(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:mh(new Uint8Array(t.response.attestationObject)),clientDataJSON:mh(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function rue(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:mh(new Uint8Array(s.authenticatorData)),clientDataJSON:mh(new Uint8Array(s.clientDataJSON)),signature:mh(new Uint8Array(s.signature)),userHandle:s.userHandle?mh(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function aW(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function NF(){var t,e;return!!(ei()&&"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 sue(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new KS("Browser returned unexpected credential type",e)}:{data:null,error:new KS("Empty credential response",e)}}catch(e){return{data:null,error:Xce({error:e,options:t})}}}async function iue(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new KS("Browser returned unexpected credential type",e)}:{data:null,error:new KS("Empty credential response",e)}}catch(e){return{data:null,error:Zce({error:e,options:t})}}}const aue={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"none"},oue={userVerification:"preferred",hints:["security-key"]};function YS(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of t)if(s)for(const i in s){const a=s[i];if(a!==void 0)if(Array.isArray(a))r[i]=a;else if(n(a))r[i]=a;else if(e(a)){const o=r[i];e(o)?r[i]=YS(o,a):r[i]=YS(a)}else r[i]=a}return r}function lue(t,e){return YS(aue,t,e||{})}function cue(t,e){return YS(oue,t,e||{})}class uue{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:s},i){try{const{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!a)return{data:null,error:o};const l=s??Jce.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${r}`),u.displayName||(u.displayName=u.name)}
559switch(a.webauthn.type){case"create":{const u=lue(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:d,error:f}=await sue({publicKey:u,signal:l});return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}case"request":{const u=cue(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:d,error:f}=await iue(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:l}));return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}}}catch(a){return Te(a)?{data:null,error:a}:{data:null,error:new ih("Unexpected error in challenge",a)}}}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:s}},i){if(!n)return{data:null,error:new hb("rpId is required for WebAuthn authentication")};try{if(!NF())return{data:null,error:new ih("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:i});if(!a)return{data:null,error:o};const{webauthn:l}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:r,credential_response:l.credential_response}})}catch(a){return Te(a)?{data:null,error:a}:{data:null,error:new ih("Unexpected error in authenticate",a)}}}async _register({friendlyName:e,rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s},i){if(!n)return{data:null,error:new hb("rpId is required for WebAuthn registration")};try{if(!NF())return{data:null,error:new ih("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(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===e&&p.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:o};const{data:l,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:i});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:u}}catch(a){return Te(a)?{data:null,error:a}:{data:null,error:new ih("Unexpected error in register",a)}}}}qce();const due={url:ace,storageKey:oce,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:lce,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function PF(t,e,n){return await n()}const wp={};class fb{get jwks(){var e,n;return(n=(e=wp[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){wp[this.storageKey]=Object.assign(Object.assign({},wp[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=wp[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){wp[this.storageKey]=Object.assign(Object.assign({},wp[this.storageKey]),{cachedAt:e})}constructor(e){var n,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=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,this.instanceID=fb.nextInstanceID,fb.nextInstanceID+=1,this.instanceID>0&&ei()&&console.warn("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.");const s=Object.assign(Object.assign({},due),e);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new Vce({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=nW(s.fetch),this.lock=s.lock||PF,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,s.lock?this.lock=s.lock:ei()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=Hce:this.lock=PF,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 uue(this)},this.persistSession?(s.storage?this.storage=s.storage:tW()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=jF(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=jF(this.memoryStorage)),ei()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${QV}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const n=kce(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),ei()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),pce(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:a,redirectType:o}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Te(n)?{error:n}:{error:new ih("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,s;try{const i=await Be(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:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:Ea}),{data:a,error:o}=i;if(o||!a)return{data:{user:null,session:null},error:o};const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(i){if(Te(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(e){var n,r,s;try{let i;if("email"in e){const{email:d,password:f,options:p}=e;let m=null,y=null;this.flowType==="pkce"&&([m,y]=await xp(this.storage,this.storageKey)),i=await Be(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:d,password:f,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:m,code_challenge_method:y},xform:Ea})}else if("phone"in e){const{phone:d,password:f,options:p}=e;i=await Be(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},channel:(s=p==null?void 0:p.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Ea})}else throw new S1("You must provide either an email or phone number and a password");const{data:a,error:o}=i;if(o||!a)return{data:{user:null,session:null},error:o};const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(i){if(Te(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(e){try{let n;if("email"in e){const{email:i,password:a,options:o}=e;n=await Be(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:AF})}else if("phone"in e){const{phone:i,password:a,options:o}=e;n=await Be(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:AF})}else throw new S1("You must provide either an email or phone number and a password");const{data:r,error:s}=n;return s?{data:{user:null,session:null},error:s}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new yp}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(Te(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(e){var n,r,s,i;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:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,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,s,i,a,o,l,u,d,f,p;let m,y;if("message"in e)m=e.message,y=e.signature;else{const{chain:g,wallet:b,statement:x,options:w}=e;let v;if(ei())if(typeof b=="object")v=b;else{const M=window;if("ethereum"in M&&typeof M.ethereum=="object"&&"request"in M.ethereum&&typeof M.ethereum.request=="function")v=M.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 b!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");v=b}const S=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href),E=await v.request({method:"eth_requestAccounts"}).then(M=>M).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!E||E.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const C=sW(E[0]);let T=(r=w==null?void 0:w.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!T){const M=await v.request({method:"eth_chainId"});T=Gce(M)}const P={domain:S.host,address:C,statement:x,uri:S.href,version:"1",chainId:T,nonce:(s=w==null?void 0:w.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(a=(i=w==null?void 0:w.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=w==null?void 0:w.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(l=w==null?void 0:w.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=w==null?void 0:w.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=w==null?void 0:w.signInWithEthereum)===null||d===void 0?void 0:d.resources};m=Yce(P),y=await v.request({method:"personal_sign",params:[Kce(m),C]})}try{const{data:g,error:b}=await Be(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature: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:Ea});if(b)throw b;return!g||!g.session||!g.user?{data:{user:null,session:null},error:new yp}:(g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),{data:Object.assign({},g),error:b})}catch(g){if(Te(g))return{data:{user:null,session:null},error:g};throw g}}async signInWithSolana(e){var n,r,s,i,a,o,l,u,d,f,p,m;let y,g;if("message"in e)y=e.message,g=e.signature;else{const{chain:b,wallet:x,statement:w,options:v}=e;let S;if(ei())if(typeof x=="object")S=x;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"))S=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 x!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=x}const E=new URL((n=v==null?void 0:v.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in S&&S.signIn){const C=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},v==null?void 0:v.signInWithSolana),{version:"1",domain:E.host,uri:E.href}),w?{statement:w}:null));let T;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")T=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)T=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in T&&"signature"in T&&(typeof T.signedMessage=="string"||T.signedMessage instanceof Uint8Array)&&T.signature instanceof Uint8Array)y=typeof T.signedMessage=="string"?T.signedMessage:new TextDecoder().decode(T.signedMessage),g=T.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${E.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...w?["",w,""]:[""],"Version: 1",`URI: ${E.href}`,`Issued At: ${(s=(r=v==null?void 0:v.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=v==null?void 0:v.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${v.signInWithSolana.notBefore}`]:[],...!((a=v==null?void 0:v.signI
559nWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${v.signInWithSolana.expirationTime}`]:[],...!((o=v==null?void 0:v.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${v.signInWithSolana.chainId}`]:[],...!((l=v==null?void 0:v.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${v.signInWithSolana.nonce}`]:[],...!((u=v==null?void 0:v.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${v.signInWithSolana.requestId}`]:[],...!((f=(d=v==null?void 0:v.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...v.signInWithSolana.resources.map(T=>`- ${T}`)]:[]].join(`
560`);const C=await S.signMessage(new TextEncoder().encode(y),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=C}}try{const{data:b,error:x}=await Be(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:mh(g)},!((p=e.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(m=e.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:Ea});if(x)throw x;return!b||!b.session||!b.user?{data:{user:null,session:null},error:new yp}:(b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),{data:Object.assign({},b),error:x})}catch(b){if(Te(b))return{data:{user:null,session:null},error:b};throw b}}async _exchangeCodeForSession(e){const n=await zd(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{const{data:i,error:a}=await Be(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:Ea});if(await Pc(this.storage,`${this.storageKey}-code-verifier`),a)throw a;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new yp}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:a})}catch(i){if(Te(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(e){try{const{options:n,provider:r,token:s,access_token:i,nonce:a}=e,o=await Be(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Ea}),{data:l,error:u}=o;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new yp}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(n){if(Te(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(e){var n,r,s,i,a;try{if("email"in e){const{email:o,options:l}=e;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await xp(this.storage,this.storageKey));const{error:f}=await Be(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:u,code_challenge_method:d},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){const{phone:o,options:l}=e,{data:u,error:d}=await Be(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(a=l==null?void 0:l.channel)!==null&&a!==void 0?a:"sms"}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d}}throw new S1("You must provide either an email or phone number.")}catch(o){if(Te(o))return{data:{user:null,session:null},error:o};throw o}}async verifyOtp(e){var n,r;try{let s,i;"options"in e&&(s=(n=e.options)===null||n===void 0?void 0:n.redirectTo,i=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:o}=await Be(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:Ea});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const l=a.session,u=a.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(s){if(Te(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithSSO(e){var n,r,s;try{let i=null,a=null;return this.flowType==="pkce"&&([i,a]=await xp(this.storage,this.storageKey)),await Be(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}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:a}),headers:this.headers,xform:Bce})}catch(i){if(Te(i))return{data:null,error:i};throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,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 Lc;const{error:s}=await Be(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:s}})}catch(e){if(Te(e))return{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:s,options:i}=e,{error:a}=await Be(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:a}}else if("phone"in e){const{phone:r,type:s,options:i}=e,{data:a,error:o}=await Be(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o}}throw new S1("You must provide either an email or phone number and a type")}catch(n){if(Te(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,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(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.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 zd(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 val
560id"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<dA:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const a=await zd(this.userStorage,this.storageKey+"-user");a!=null&&a.user?e.user=a.user:e.user=pA()}if(this.storage.isServer&&e.user){let a=this.suppressGetSessionWarning;e=new Proxy(e,{get:(l,u,d)=>(!a&&u==="user"&&(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."),a=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,u,d))})}return{data:{session:e},error:null}}const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:s},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await Be(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Hc}):await this._useSession(async n=>{var r,s,i;const{data:a,error:o}=n;if(o)throw o;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Lc}:await Be(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:Hc})})}catch(n){if(Te(n))return fce(n)&&(await this._removeSession(),await Pc(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(e,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,n))}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new Lc;const a=s.session;let o=null,l=null;this.flowType==="pkce"&&e.email!=null&&([o,l]=await xp(this.storage,this.storageKey));const{data:u,error:d}=await Be(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:Hc});if(d)throw d;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),{data:{user:a.user},error:null}})}catch(r){if(Te(r))return{data:{user:null},error:r};throw r}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Lc;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:a}=fA(e.access_token);if(a.exp&&(r=a.exp,s=r<=n),s){const{data:o,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!o)return{data:{user:null,session:null},error:null};i=o}else{const{data:o,error:l}=await this._getUser(e.access_token);if(l)throw l;i={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(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(n){if(Te(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,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 Lc;const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(Te(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(e,n){try{if(!ei())throw new _1("No browser detected.");
560if(e.error||e.error_description||e.error_code)throw new _1(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 bF("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new _1("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 bF("No code detected.");const{data:w,error:v}=await this._exchangeCodeForSession(e.code);if(v)throw v;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:w.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:i,refresh_token:a,expires_in:o,expires_at:l,token_type:u}=e;if(!i||!o||!a||!u)throw new _1("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(o);let p=d+f;l&&(p=parseInt(l));const m=p-d;m*1e3<=Pp&&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:g,error:b}=await this._getUser(i);if(b)throw b;const x={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:f,expires_at:p,refresh_token:a,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:x,redirectType:e.type},error:null}}catch(r){if(Te(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const n=await zd(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return{error:i};const a=(r=s.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:o}=await this.admin.signOut(a,e);if(o&&!(hce(o)&&(o.status===404||o.status===401||o.status===403)))return{error:o}}return e!=="others"&&(await this._removeSession(),await Pc(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const n=wce(),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(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,s;try{const{data:{session:i},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await xp(this.storage,this.storageKey,!0));try{return await Be(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(Te(i))return{data:null,error:i};throw i}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(n){if(Te(n))return{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:s}=await this._useSession(async i=>{var a,o,l,u,d;const{data:f,error:p}=i;if(p)throw p;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await Be(this.fetch,"GET",m,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return ei()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:e.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(Te(r))return{data:{provider:e.provider,url:null},error:r};throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:i}}=n;
560if(s)throw s;const{options:a,provider:o,token:l,access_token:u,nonce:d}=e,f=await Be(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=i==null?void 0:i.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:l,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Ea}),{data:p,error:m}=f;return m?{data:{user:null,session:null},error:m}:!p||!p.session||!p.user?{data:{user:null,session:null},error:new yp}:(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),{data:p,error:m})}catch(s){if(Te(s))return{data:{user:null,session:null},error:s};throw s}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:a}=n;if(a)throw a;return await Be(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(Te(n))return{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 Ece(async s=>(s>0&&await _ce(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await Be(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Ea})),(s,i)=>{const a=200*Math.pow(2,s);return i&&hA(i)&&Date.now()+a-r<Pp})}catch(r){if(this._debug(n,"error",r),Te(r))return{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),ei()&&!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 s=await zd(this.storage,this.storageKey);if(s&&this.userStorage){let a=await zd(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:s.user},await Rp(this.userStorage,this.storageKey+"-user",a)),s.user=(e=a==null?void 0:a.user)!==null&&e!==void 0?e:pA()}else if(s&&!s.user&&!s.user){const a=await zd(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(s.user=a.user,await Pc(this.storage,this.storageKey+"-user"),await Rp(this.storage,this.storageKey,s)):s.user=pA()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const i=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<dA;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${dA}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:a}=await this._callRefreshToken(s.refresh_token);a&&(console.error(a),hA(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:o}=await this._getUser(s.access_token);!o&&(a!=null&&a.user)?(s.user=a.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(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",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new Lc;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new jE;const{data:i,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!i.session)throw new Lc;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const o={data:i.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(i){if(this._debug(s,"error",i),Te(i)){const a={data:null,error:i};return hA(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,n,r=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const i=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,n)}catch(l){i.push(l)}});if(await Promise.all(a),i.length>0){for(let o=0;o<i.length;o+=1)console.error(i[o]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Rp(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=EF(s);await Rp(this.storage,this.storageKey,i)}else{const s=EF(n);await Rp(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),await Pc(this.storage,this.storageKey),await Pc(this.storage,this.storageKey+"-code-verifier"),await Pc(this.storage,this.storageKey+"-user"),this.userStorage&&await Pc(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&ei()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
560catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Pp);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}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 s=Math.floor((r.expires_at*1e3-e)/Pp);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Pp}ms, refresh threshold is ${tN} ticks`),s<=tN&&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 rW)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ei()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),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(-1,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 s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,a]=await xp(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(o.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?{data:null,error:i}:await Be(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Te(n))return{data:null,error:n};throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,s;const{data:i,error:a}=n;if(a)return{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:u}=await Be(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(e.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(n){if(Te(n))return{data:null,error:n};throw n}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return{data:null,error:i};const a=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?nue(e.webauthn.credential_response):rue(e.webauthn.credential_response)})}:{code:e.code}),{data:o,error:l}=await Be(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:a,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return l?{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),{data:o,error:l})})}catch(n){if(Te(n))return{data:null,error:n};throw n}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return{data:null,error:i};const a=await Be(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(r=s==null?void 0:s.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:eue(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:tue(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Te(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?{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 s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var n,r;const{data:{session:s},error:i}=e;if(i)return{data:null,error:i};if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=fA(s.access_token);let o=null;a.aal&&(o=a.aal);let l=o;((r=(n=s.user.factors)===null||n===void 0?void 0:n.filter(f=>f.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const d=a.amr||[];return{data:{currentLevel:o,nextLevel:l,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(o=>o.kid===e);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+uce>s)return r;const{data:i,error:a}=await Be(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,r=i.keys.find(o=>o.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:m,error:y}
560=await this.getSession();if(y||!m.session)return{data:null,error:y};r=m.session.access_token}const{header:s,payload:i,signature:a,raw:{header:o,payload:l}}=fA(r);n!=null&&n.allowExpired||Rce(i.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:m}=await this.getUser(r);if(m)throw m;return{data:{claims:i,header:s,signature:a},error:null}}const d=Ice(s.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,a,vce(`${o}.${l}`)))throw new sN("Invalid JWT signature");return{data:{claims:i,header:s,signature:a},error:null}}catch(r){if(Te(r))return{data:null,error:r};throw r}}}fb.nextInstanceID=0;const hue=fb;class fue extends hue{constructor(e){super(e)}}var pue=function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function o(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):s(d.value).then(o,l)}u((r=r.apply(t,e||[])).next())})};class mue{constructor(e,n,r){var s,i,a;this.supabaseUrl=e,this.supabaseKey=n;const o=ice(e);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const l=`sb-${o.hostname.split(".")[0]}-auth-token`,u={db:Yle,realtime:Zle,auth:Object.assign(Object.assign({},Xle),{storageKey:l}),global:Kle},d=sce(r??{},u);this.storageKey=(s=d.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(i=d.global.headers)!==null&&i!==void 0?i:{},d.accessToken?(this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(f,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((a=d.auth)!==null&&a!==void 0?a:{},this.headers,d.global.fetch),this.fetch=tce(n,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.rest=new dle(new URL("rest/v1",o).href,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),this.storage=new Hle(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),d.accessToken||this._listenForAuthEvents()}get functions(){return new Voe(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,n={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,n,r)}channel(e,n={config:{}}){return this.realtime.channel(e,n)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){return pue(this,void 0,void 0,function*(){var e,n;if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(n=(e=r.session)===null||e===void 0?void 0:e.access_token)!==null&&n!==void 0?n:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:s,userStorage:i,storageKey:a,flowType:o,lock:l,debug:u},d,f){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new fue({url:this.authUrl.href,headers:Object.assign(Object.assign({},p),d),storageKey:a,autoRefreshToken:e,persistSession:n,detectSessionInUrl:r,storage:s,userStorage:i,flowType:o,lock:l,debug:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new Tle(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(e,n,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const gue=(t,e,n)=>new mue(t,e,n);function yue(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}yue()&&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 N
560ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function xue(){var b,x;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}",s=n?((b=t.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:b[1])??((x=t.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:x[1]):void 0,i=window.parent&&window.parent!==window;if(!s||!i)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:""),u=l&&o.test(l)?[l]:a?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",f=2e3,p=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),m=(w,v,S)=>new Promise(E=>{const C=p();let T=!1,P;const M=L=>{T||(T=!0,clearTimeout(P),window.removeEventListener("message",R),E(L))},R=L=>{if(u.indexOf(L.origin)<0)return;const U=L.data;U&&U.type===d&&U.requestId===C&&M(U)};window.addEventListener("message",R);const O={type:w,requestId:C,projectId:s,key:v};S!==void 0&&(O.value=S);for(const L of u)window.parent.postMessage(O,L);P=setTimeout(()=>M(null),f)});let y=!0;const g=250;return{getItem:async w=>{let v=await m("lovable-preview-auth:get",w);return!v&&y&&(await new Promise(S=>setTimeout(S,g)),v=await m("lovable-preview-auth:get",w)),y=!1,v&&v.ok&&typeof v.value=="string"?v.value===""?(localStorage.removeItem(w),null):v.value:localStorage.getItem(w)},setItem:(w,v)=>(localStorage.setItem(w,v),m("lovable-preview-auth:set",w,v).then(S=>{S&&S.ok&&typeof S.value=="string"&&localStorage.getItem(w)===v&&(S.value===""?localStorage.removeItem(w):localStorage.setItem(w,S.value))})),removeItem:w=>(localStorage.removeItem(w),m("lovable-preview-auth:remove",w).then(()=>{}))}}const vue="https://aofirryrieneitjliizs.supabase.co",bue="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFvZmlycnlyaWVuZWl0amxpaXpzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjAwMTY2NDAsImV4cCI6MjA3NTU5MjY0MH0.95iCS2r8wC5eH1Vo1uXQBLvHx6E0hg6bwvGBBh7rH-c",ce=gue(vue,bue,{auth:{storage:xue(),persistSession:!0,autoRefreshToken:!0}});function oW(t,e){const[n,r]=k.useState(e||""),[s,i]=k.useState(!0),[a,o]=k.useState(null);return k.useEffect(()=>{(async()=>{try{i(!0);const{data:u,error:d}=await ce.from("video_links").select("youtube_url").eq("video_key",t).eq("is_active",!0).is("website_id",null).maybeSingle();if(d){console.error("Error fetching video link:",d),o(d.message),e&&r(e);return}u!=null&&u.youtube_url?r(u.youtube_url):e&&r(e)}catch(u){console.error("Unexpected error fetching video link:",u),o(u instanceof Error?u.message:"Unknown error"),e&&r(e)}finally{i(!1)}})()},[t,e]),{videoUrl:n,isLoading:s,error:a}}function wue(){const[t,e]=k.useState([]),[n,r]=k.useState(!0),[s,i]=k.useState(null),a=async()=>{try{r(!0);const{data:d,error:f}=await ce.from("video_links").select("*").order("display_order",{ascending:!0});if(f){console.error("Error fetching video links:",f),i(f.message);return}e(d||[])}catch(d){console.error("Unexpected error fetching video links:",d),i(d instanceof Error?d.message:"Unknown error")}finally{r(!1)}};return k.useEffect(()=>{a()},[]),{videos:t,isLoading:n,error:s,updateVideo:async(d,f)=>{const{error:p}=await ce.from("video_links").update(f).eq("id",d);if(p)throw p;await a()},addVideo:async d=>{const{error:f}=await ce.from("video_links").insert(d);if(f)throw f;await a()},deleteVideo:async d=>{const{error:f}=await ce.from("video_links").delete().eq("id",d);if(f)throw f;await a()},refetch:a}}const kue=()=>{const[t,e]=k.useState(!1),n=k.useRef(null),{videoUrl:r}=oW("expertise_promo","https://www.youtube.com/embed/_U5fshpcWW0");return k.useEffect(()=>{const s=new IntersectionObserver(([i])=>{i.isIntersecting&&e(!0)},{threshold:.5});return n.current&&s.observe(n.current),()=>s.disconnect()},[]),c.jsx("section",{className:"py-20 bg-background",children:c.jsx("div",{className:"container mx-auto px-6",children:c.jsx("div",{className:"max-w-6xl mx-auto",children:c.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center",children:[c.jsxs("div",{className:"order-2 md:order-1",children:[c.jsx(qt,{direction:"left",children:c.jsx("div",{className:"inline-block px-4 py-2 bg-accent/10 rounded-full mb-6",children:c.jsx("span",{className:"text-accent font-semibold text-sm",children:"Industry Leadership"})})}),c.jsx(qt,{delay:.1,direction:"left",children:c.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-foreground mb-6",children:c.jsx("span",{className:"text-accent",children:"Specialist Water Dispense Research"})})}),c.jsx(qt,{delay:.2,direction:"left",children:c.jsx("p",{className:"text-lg text-muted-foreground mb-6",children:"Akos Petri leads Zenith Global Commercial's water dispense research. His work covers market sizing, competitor benchmarking, market entry and M&A research across BWD, POU and integrated tap markets."})}),c.jsx(qt,{delay:.3,direction:"left",children:c.jsx("p",{className:"text-muted-foreground mb-8",children:"His work spans private consulting, competitive benchmarking and strategy sprints that help vending operators, machinery producers, beverage brands and ESG-driven organisations assess market opportunities and develop informed plans."})}),c.jsx(qt,{delay:.4,direction:"left",children:c.jsxs("a",{href:"https://www.linkedin.com/in/akospetri/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-6 py-3 bg-accent text-accent-foreground font-semibold rounded-lg hover:bg-accent/90 transition-all duration-300 shadow-elegant hover:shadow-glow",children:[c.jsx(hc,{className:"w-5 h-5"}),"Follow Akos on LinkedIn"]})})]}),c.jsx("div",{className:"order-1 md:order-2",children:c.jsx(op,{children:c.jsx("div",{ref:n,className:"relative rounded-2xl overflow-hidden shadow-elegant hover:shadow-glow transition-all duration-300 aspect-video",children:c.jsx("iframe",{src:`${r}${t?"?autoplay=1&mute=1":""}`,title:"Zenith Global Commercial Promo Video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute inset-0 w-full h-full"})})})})]})})})})},Sue=()=>c.jsx("section",{className:"py-20 bg-background",id:"why-us",children:c.jsx("div",{className:"container mx-auto px-6",children:c.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[c.jsx(qt,{children:c.jsxs("h2",{className:"text-4xl md:text-5xl font-bold text-foreground mb-8",children:["We Measure the Operating Market. ",c.jsx("span",{className:"text-accent",children:"Not Appliance Shipments."})]})}),c.jsx(op,{delay:.2,children:c.jsxs("div",{className:"bg-muted/50 border border-border rounded-2xl p-8 md:p-12 shadow-lg",children:[c.jsx("div",{className:"flex justify-center mb-6",children:c.jsx("div",{className:"bg-accent/20 p-4 rounded-full",children:c.jsx(xZ,{className:"w-8 h-8 text-accent"})})}),c.jsxs("div",{className:"text-xl md:text-2xl text-muted-foreground leading-relaxed space-y-6",children:[c.jsx("p",{children:"Water dispense is built around installed fleets, rental contracts, water deliveries, filter changes and recurring service. Our research measures the commercial market behind the equipment."}),c.jsx("p",{className:"text-foreground font-semibold text-xl md:text-2xl",children:"Preview the methodology and sample tables to see whether the coverage fits your question."}),c.jsx(oe,{asChild:!0,size:"lg",className:"mt-2",children:c.jsx("a",{href:"/reports#report-samples",target:"_blank",rel:"noopener noreferrer",children:"View Report Samples"})})]})]})})]})})}),_ue=()=>{const t=[{icon:gR,title:"Investors & Corporate Development",goal:"Assess the market behind an investment.",win:"Review market size, operator positions, competitive concentration and growth forecasts to inform screening and commercial due diligence."},{icon:AU,title:"Equipment Manufacturers",goal:"Prioritise markets and product segments.",win:"Compare BWD, POU and ITS development, equipment functionality and channel demand to support product and sales planning."},{icon:pZ,title:"Distributors & Coffee Companies",goal:"Assess opportunities in workplace water.",win:"Understand the operator landscape, equipment mix and channels to assess potential partners and routes to market."},{icon:FZ,title:"Water Dispense Operators",goal:"Benchmark your market position.",win:"Compare your business with available market benchmarks for installed units, rental pricing, water throughput and segment growth."}];return c.jsx("section",{className:"py-20 bg-muted/30",id:"decision-makers",children:c.jsxs("div",{className:"container mx-auto px-6",children:[c.jsx(qt,{className:"text-center mb-16",children:c.jsxs("h2",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4",children:["Built For ",c.jsx("span",{className:"text-primary",children:"Decision Makers"})]})}),c.jsx(ic,{className:"grid md:grid-cols-2 gap-8 max-w-5xl mx-auto",staggerDelay:.15,children:t.map((e,n)=>c.jsx(Vs,{children:c.jsxs("div",{className:"bg-card rounded-xl p-8 shadow-elegant hover:shadow-glow transition-all duration-300 border border-border hover:border-accent h-full",children:[c.jsx("div",{className:"mb-6 p-4 bg-accent/10 rounded-lg inline-block",children:c.jsx(e.icon,{className:"w-8 h-8 text-accent"})}),c.jsx("h3",{className:"text-2xl font-bold text-foreground mb-4",children:e.title}),c.jsxs("div",{className:"mb-4",children:[c.jsx("p",{className:"text-primary font-semibold mb-1",children:"The Goal:"}),c.jsx("p",{className:"text-foreground text-lg",children:e.goal})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-accent font-semibold mb-1",children:"The Win:"}),c.jsx("p",{className:"text-muted-foreground",children:e.win})]})]})}
560,n))}),c.jsx("p",{className:"mx-auto mt-8 max-w-3xl text-center text-sm text-muted-foreground",children:"Available metrics vary by market and report. Check the product contents for the exact coverage."})]})})},Eue="/assets/industry-image-c5HVjxOt.jpg",Cue="/assets/intelligence-offer-CojELGDl.png",Aue=()=>{const t=k.useRef(null),e=k.useRef(null),[n,r]=k.useState(!1),[s,i]=k.useState(!0),{videoUrl:a}=oW("insights_video","https://www.youtube.com/embed/sZTis65kA1w"),o=d=>{const f=d.match(/embed\/([a-zA-Z0-9_-]+)/);return f?f[1]:"sZTis65kA1w"};k.useEffect(()=>{const d=new IntersectionObserver(([f])=>{f.isIntersecting&&!n&&(r(!0),setTimeout(()=>{var p;(p=e.current)!=null&&p.contentWindow&&e.current.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*")},300))},{threshold:.5});return t.current&&d.observe(t.current),()=>d.disconnect()},[n]);const l=()=>{var d;(d=e.current)!=null&&d.contentWindow&&(s?e.current.contentWindow.postMessage('{"event":"command","func":"unMute","args":""}',"*"):e.current.contentWindow.postMessage('{"event":"command","func":"mute","args":""}',"*"),i(!s))},u=[{bold:"Market size and installed units",rest:" to assess the scale of each opportunity."},{bold:"Operator rankings and market shares",rest:" to understand competitive positions."},{bold:"BWD, POU and ITS segmentation",rest:" to compare equipment categories."},{bold:"Channel distribution",rest:" to understand where demand comes from."},{bold:"Historical trends and forecasts",rest:" to support planning."},{bold:"Rental and equipment pricing",rest:" to inform commercial benchmarking."},{bold:"Water throughput and cancellation measures",rest:", where included."},{bold:"Revenue breakdowns",rest:" to understand the market’s commercial structure."}];return c.jsx("section",{className:"py-20 bg-muted/30",id:"insights",children:c.jsxs("div",{className:"container mx-auto px-6",children:[c.jsxs(qt,{className:"text-center mb-16",children:[c.jsxs("h2",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4",children:["Understand the Market. Know the Competitors. ",c.jsx("span",{className:"text-primary",children:"See Where the Opportunity Is."})]}),c.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"We track installed units, market size, operator shares, pricing, water volumes and forecasts across bottled water dispensers, point-of-use systems and integrated taps."}),c.jsx("div",{className:"mt-10 max-w-4xl mx-auto",children:c.jsx("img",{src:Cue,alt:"Zenith Water Dispense Intelligence Offer — 32 country reports covering 31 European markets and the US, with 100+ data metrics, leading companies tracked, and a 2024–2029 forecast horizon",className:"w-full h-auto rounded-2xl shadow-elegant border border-border",loading:"lazy"})}),c.jsxs("div",{className:"mt-8 max-w-5xl mx-auto",children:[c.jsx("p",{className:"text-lg text-muted-foreground mb-6 text-center",children:c.jsx("strong",{className:"text-foreground",children:"Markets Covered:"})}),c.jsxs(ic,{className:"grid md:grid-cols-2 gap-6",staggerDelay:.15,children:[c.jsx(Vs,{children:c.jsxs("div",{className:"bg-accent/10 border border-accent/30 rounded-lg p-6 hover:shadow-lg transition-all",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("h4",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[c.jsx(TU,{className:"w-5 h-5 text-accent"}),"Eastern Europe"]}),c.jsx("span",{className:"bg-accent text-accent-foreground px-3 py-1 rounded-full text-sm font-semibold",children:"15 countries"})]}),c.jsx("p",{className:"text-base text-foreground/80 leading-relaxed",children:"Belarus, Bulgaria, Croatia, Czech Republic, Estonia, Hungary, Latvia, Lithuania, Poland, Romania, Russia, Serbia, Slovakia, Slovenia, Ukraine"})]})}),c.jsx(Vs,{children:c.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-lg p-6 hover:shadow-lg transition-all",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("h4",{className:"text-lg font-semibold text-primary flex items-center gap-2",children:[c.jsx(_0,{className:"w-5 h-5"}),"Western Europe"]}),c.jsx("span",{className:"bg-primary/20 text-primary px-3 py-1 rounded-full text-sm font-semibold",children:"16 countries"})]}),c.jsx("p",{className:"text-base text-muted-foreground leading-relaxed",children:"Austria, Belgium, Denmark, Finland, France, Germany, Greece, Ireland, Italy, Netherlands, Norway, Portugal, Spain, Sweden, Switzerland, UK"})]})})]})]})]}),c.jsx("div",{className:"max-w-4xl mx-auto mb-16",children:c.jsxs(qt,{direction:"right",delay:.2,children:[c.jsx("h3",{className:"text-3xl font-bold text-foreground mb-6",children:"What the Research Can Include"}),c.jsxs("blockquote",{className:"border-l-4 border-primary pl-6 mb-8",children:[c.jsx("p",{className:"text-muted-foreground text-lg italic mb-2",children:`"This isn't just a pile of numbers. It's a decision engine built for leaders who need to move quickly, justify their decisions, and present a clear growth story to boards, investors and their teams."`}),c.jsx("cite",{className:"text-foreground font-semibold not-italic",children:"— Akos Petri, Managing Director"})]}),c.jsx(ic,{className:"space-y-4",staggerDelay:.08,children:u.map((d,f)=>c.jsx(Vs,{children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(jS,{className:"w-6 h-6 text-accent mt-1 flex-shrink-0"}),c.jsxs("span",{className:"text-foreground text-lg",children:[c.jsx("strong",{children:d.bold}),d.rest]})]})},f))}),c.jsx("p",{className:"mt-6 text-sm text-muted-foreground",children:"Coverage, historical periods and forecast horizons are specified on each product page."})]})}),c.jsx(qt,{className:"bg-gradient-hero rounded-2xl overflow-hidden shadow-elegant mb-16",children:c.jsxs("div",{className:"grid lg:grid-cols-2 gap-0",children:[c.jsxs("div",{className:"p-12 flex flex-col justify-center",children:[c.jsx("h3",{className:"text-3xl font-bold text-primary-foreground mb-4",children:"Use the Research in the Format That Suits Your Team"}
vendor: 8,597 bytes, line 560
560),c.jsx("p",{className:"text-primary-foreground/90 text-lg mb-6",children:"Review the market narrative in PDF, analyse the figures in Excel, or compare markets through Power BI where included in your package."}),c.jsxs("ul",{className:"space-y-3 text-primary-foreground/90",children:[c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-2 h-2 bg-accent rounded-full"}),"PDF reports for market context, commentary and presentation-ready charts."]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-2 h-2 bg-accent rounded-full"}),"Excel databases for your own analysis and planning."]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-2 h-2 bg-accent rounded-full"}),"Interactive Power BI dashboards with selected regional packages."]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-2 h-2 bg-accent rounded-full"}),"Research support according to the scope of your purchase."]})]})]}),c.jsx("div",{className:"relative h-full min-h-[400px]",children:c.jsx("img",{src:Eue,alt:"Water dispensers deployed in a commercial office setting",className:"w-full h-full object-cover",loading:"lazy",width:"600",height:"400"})})]})}),c.jsxs(qt,{className:"mb-16",children:[c.jsx("h3",{className:"text-3xl font-bold text-foreground text-center mb-12",children:"Choose the Market You Need."}),c.jsxs(ic,{className:"grid md:grid-cols-3 gap-8 max-w-6xl mx-auto",staggerDelay:.12,children:[c.jsx(Vs,{children:c.jsxs("div",{className:"bg-card rounded-xl p-8 shadow-lg border border-border hover:shadow-elegant transition-shadow h-full",children:[c.jsx("h4",{className:"text-2xl font-bold text-foreground mb-3",children:"31 European Markets"}),c.jsx("p",{className:"text-muted-foreground mb-6",children:"Get detailed market size, competitor, pricing and forecast data for individual countries or compare markets across regions."}),c.jsx(oe,{asChild:!0,variant:"outline",children:c.jsxs("a",{href:"/reports",target:"_blank",rel:"noopener noreferrer",children:["Browse Country Reports ",c.jsx(Yr,{className:"ml-2 size-4"})]})})]})}),c.jsx(Vs,{children:c.jsxs("div",{className:"bg-card rounded-xl p-8 shadow-lg border border-border hover:shadow-elegant transition-shadow h-full",children:[c.jsx("h4",{className:"text-2xl font-bold text-foreground mb-3",children:"United States"}),c.jsx("p",{className:"text-muted-foreground mb-6",children:"Compare markets across Western Europe, Eastern Europe or the full European region. Review the included reports, Excel data, Power BI dashboard and support."}),c.jsx(oe,{asChild:!0,variant:"outline",children:c.jsxs("a",{href:"/reports#country-reports",target:"_blank",rel:"noopener noreferrer",children:["Explore Regional Packages ",c.jsx(Yr,{className:"ml-2 size-4"})]})})]})}),c.jsx(Vs,{children:c.jsxs("div",{className:"bg-card rounded-xl p-8 shadow-lg border border-border hover:shadow-elegant transition-shadow h-full",children:[c.jsx("h4",{className:"text-2xl font-bold text-foreground mb-3",children:"Need More Than the Report?"}),c.jsx("p",{className:"text-muted-foreground mb-6",children:"If you are entering a market, assessing an acquisition or investigating a competitor, we can build additional research around your specific commercial question."}),c.jsx(oe,{asChild:!0,variant:"outline",children:c.jsxs("a",{href:"https://zenithmarketintel.com/consulting",target:"_blank",rel:"noopener noreferrer",children:["Discuss Your Market ",c.jsx(Yr,{className:"ml-2 size-4"})]})})]})})]}),c.jsx(qt,{className:"mt-12 text-center",delay:.3,children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-3xl font-bold text-foreground text-center mb-6",children:"Explore the Power BI Dashboard"}),c.jsxs("div",{ref:t,className:"mx-auto max-w-4xl",children:[c.jsxs("div",{className:"w-full aspect-video rounded-xl overflow-hidden shadow-elegant relative group",children:[c.jsx("iframe",{ref:e,width:"100%",height:"100%",src:`${a}?autoplay=1&mute=1&loop=1&playlist=${o(a)}&rel=0&modestbranding=1&enablejsapi=1&vq=hd2160&iv_load_policy=3&fs=1&controls=1&disablekb=1&showinfo=0`,title:"Zenith Pro Pack Overview",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),c.jsx("button",{onClick:l,className:"absolute top-4 right-4 bg-background/80 hover:bg-background text-foreground p-3 rounded-full shadow-lg transition-all hover:scale-110 z-10","aria-label":s?"Unmute video":"Mute video",children:s?c.jsx(OZ,{className:"w-6 h-6"}):c.jsx(MZ,{className:"w-6 h-6"})})]}),c.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"Demonstration shown. Confirm the supplied edition and coverage when ordering."})]})]})})]})]})})},Tue="/assets/infographic-swiss-trends-CA5aggLe.jpeg",jue="/assets/infographic-rent-buy-DQBzoODb.jpeg",Nue="/assets/infographic-market-steps-Dk_TQ_-h.jpeg",Pue="/assets/infographic-pfas-divergence-l7cnankr.jpeg",Rue="/assets/infographic-bwt-uk-CM8aFXUH.jpeg",Iue="/assets/infographic-esg-mandates-CqYghLl4.jpeg";var gA="focusScope.autoFocusOnMount",yA="focusScope.autoFocusOnUnmount",RF={bubbles:!1,cancelable:!0},Due="FocusScope",bI=k.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,l]=k.useState(null),u=ga(s),d=ga(i),f=k.useRef(null),p=bt(e,g=>l(g)),m=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(r){let g=function(v){if(m.paused||!o)return;const S=v.target;o.contains(S)?f.current=S:Fc(f.current,{select:!0})},b=function(v){if(m.paused||!o)return;const S=v.relatedTarget;S!==null&&(o.contains(S)||Fc(f.current,{select:!0}))},x=function(v){if(document.activeElement===document.body)for(const E of v)E.removedNodes.length>0&&Fc(o)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const w=new MutationObserver(x);return o&&w.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),w.disconnect()}}},[r,o,m.paused]),k.useEffect(()=>{if(o){DF.add(m);const g=document.activeElement;if(!o.contains(g)){const x=new CustomEvent(gA,RF);o.addEventListener(gA,u),o.dispatchEvent(x),x.defaultPrevented||(Mue($ue(lW(o)),{select:!0}),document.activeElement===g&&Fc(o))}return()=>{o.removeEventListener(gA,u),setTimeout(()=>{const x=new CustomEvent(yA,RF);o.addEventListener(yA,d),o.dispatchEvent(x),x.defaultPrevented||Fc(g??document.body,{select:!0}),o.removeEventListener(yA,d),DF.remove(m)},0)}}},[o,u,d,m]);const y=k.useCallback(g=>{if(!n&&!r||m.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(b&&x){const w=g.currentTarget,[v,S]=Oue(w);v&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&Fc(v,{select:!0})):g.shiftKey&&x===v&&(g.preventDefault(),n&&Fc(S,{select:!0})):x===w&&g.preventDefault()}},[n,r,m.paused]);return c.jsx(Fe.div,{tabIndex:-1,...a,ref:p,onKeyDown:y})});bI.displayName=Due;function Mue(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Fc(r,{select:e}),document.activeElement!==n)return}function Oue(t){const e=lW(t),n=IF(e,t),r=IF(e.reverse(),t);return[n,r]}function lW(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function IF(t,e){for(const n of t)if(!Lue(n,{upTo:e}))return n}function Lue(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 Fue(t){return t instanceof HTMLInputElement&&"select"in t}function Fc(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Fue(t)&&e&&t.select()}}var DF=Bue();function Bue(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=MF(t,e),t.unshift(e)},remove(e){var n;t=MF(t,e),(n=t[0])==null||n.resume()}}}function MF(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function $ue(t){return t.filter(e=>e.tagName!=="A")}var xA=0;function cW(){k.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??OF()),document.body.insertAdjacentElement("beforeend",t[1]??OF()),xA++,()=>{xA===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 5,874 bytes, lines 560-575
560=>e.remove()),xA--}},[])}function OF(){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 Ho=function(){return Ho=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ho.apply(this,arguments)};function uW(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 s=0,r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(n[r[s]]=t[r[s]]);return n}function Uue(t,e,n){if(n||arguments.length===2)for(var r=0,s=e.length,i;r<s;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var bk="right-scroll-bar-position",wk="width-before-scroll-bar",zue="with-scroll-bars-hidden",Vue="--removed-body-scroll-bar-size";function vA(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Wue(t,e){var n=k.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=e,n.facade}var Hue=typeof window<"u"?k.useLayoutEffect:k.useEffect,LF=new WeakMap;function que(t,e){var n=Wue(null,function(r){return t.forEach(function(s){return vA(s,r)})});return Hue(function(){var r=LF.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(o){i.has(o)||vA(o,null)}),i.forEach(function(o){s.has(o)||vA(o,a)})}LF.set(n,t)},[t]),n}function Gue(t){return t}function Kue(t,e){e===void 0&&(e=Gue);var n=[],r=!1,s={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(i){var a=e(i,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(o){return i(o)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(i),a=n}var l=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return s}function Yue(t){t===void 0&&(t={});var e=Kue(null);return e.options=Ho({async:!0,ssr:!1},t),e}var dW=function(t){var e=t.sideCar,n=uW(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 k.createElement(r,Ho({},n))};dW.isSideCarExport=!0;function Xue(t,e){return t.useMedium(e),dW}var hW=Yue(),bA=function(){},NE=k.forwardRef(function(t,e){var n=k.useRef(null),r=k.useState({onScrollCapture:bA,onWheelCapture:bA,onTouchMoveCapture:bA}),s=r[0],i=r[1],a=t.forwardProps,o=t.children,l=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,m=t.noRelative,y=t.noIsolation,g=t.inert,b=t.allowPinchZoom,x=t.as,w=x===void 0?"div":x,v=t.gapMode,S=uW(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,C=que([n,e]),T=Ho(Ho({},S),s);return k.createElement(k.Fragment,null,d&&k.createElement(E,{sideCar:hW,removeScrollBar:u,shards:f,noRelative:m,noIsolation:y,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:v}),a?k.cloneElement(k.Children.only(o),Ho(Ho({},T),{ref:C})):k.createElement(w,Ho({},T,{className:l,ref:C}),o))});NE.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};NE.classNames={fullWidth:wk,zeroRight:bk};var Zue=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Que(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Zue();return e&&t.setAttribute("nonce",e),t}function Jue(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function ede(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var tde=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Que())&&(Jue(e,n),ede(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},nde=function(){var t=tde();return function(e,n){k.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},fW=function(){var t=nde(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},rde={left:0,top:0,right:0,gap:0},wA=function(t){return parseInt(t||"",10)||0},sde=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],s=e[t==="padding"?"paddingRight":"marginRight"];return[wA(n),wA(r),wA(s)]},ide=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return rde;var e=sde(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])}},ade=fW(),Cm="data-scroll-locked",ode=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,o=t.gap;return n===void 0&&(n="margin"),`
561  .`.concat(zue,` {
562   overflow: hidden `).concat(r,`;
563   padding-right: `).concat(o,"px ").concat(r,`;
564  }
565  body[`).concat(Cm,`] {
566    overflow: hidden `).concat(r,`;
567    overscroll-behavior: contain;
568    `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
569    padding-left: `.concat(s,`px;
570    padding-top: `).concat(i,`px;
571    padding-right: `).concat(a,`px;
572    margin-left:0;
573    margin-top:0;
574    margin-right: `).concat(o,"px ").concat(r,`;
575    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";
575")].filter(Boolean).join(""),`
576  }
577  
578  .`).concat(bk,` {
579    right: `).concat(o,"px ").concat(r,`;
580  }
581  
582  .`).concat(wk,` {
583    margin-right: `).concat(o,"px ").concat(r,`;
584  }
585  
586  .`).concat(bk," .").concat(bk,` {
587    right: 0 `).concat(r,`;
588  }
589  
590  .`).concat(wk," .").concat(wk,` {
591    margin-right: 0 `).concat(r,`;
592  }
593  
594  body[`).concat(Cm,`] {
595    `).concat(Vue,": ").concat(o,`px;
596  }
597`)},FF=function(){var t=parseInt(document.body.getAttribute(Cm)||"0",10);return isFinite(t)?t:0},lde=function(){k.useEffect(function(){return document.body.setAttribute(Cm,(FF()+1).toString()),function(){var t=FF()-1;t<=0?document.body.removeAttribute(Cm):document.body.setAttribute(Cm,t.toString())}},[])},cde=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;lde();var i=k.useMemo(function(){return ide(s)},[s]);return k.createElement(ade,{styles:ode(i,!e,s,n?"":"!important")})},iN=!1;if(typeof window<"u")try{var E1=Object.defineProperty({},"passive",{get:function(){return iN=!0,!0}});window.addEventListener("test",E1,E1),window.removeEventListener("test",E1,E1)}catch{iN=!1}var kp=iN?{passive:!1}:!1,ude=function(t){return t.tagName==="TEXTAREA"},pW=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!ude(t)&&n[e]==="visible")},dde=function(t){return pW(t,"overflowY")},hde=function(t){return pW(t,"overflowX")},BF=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=mW(t,r);if(s){var i=gW(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fde=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},pde=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},mW=function(t,e){return t==="v"?dde(e):hde(e)},gW=function(t,e){return t==="v"?fde(e):pde(e)},mde=function(t,e){return t==="h"&&e==="rtl"?-1:1},gde=function(t,e,n,r,s){var i=mde(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,l=e.contains(o),u=!1,d=a>0,f=0,p=0;do{if(!o)break;var m=gW(t,o),y=m[0],g=m[1],b=m[2],x=g-b-i*y;(y||x)&&mW(t,o)&&(f+=x,p+=y);var w=o.parentNode;o=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!l&&o!==document.body||l&&(e.contains(o)||e===o));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(p)<1||!s))&&(u=!0),u},C1=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},$F=function(t){return[t.deltaX,t.deltaY]},UF=function(t){return t&&"current"in t?t.current:t},yde=function(t,e){return t[0]===e[0]&&t[1]===e[1]},xde=function(t){return`
598  .block-interactivity-`.concat(t,` {pointer-events: none;}
599  .allow-interactivity-`).concat(t,` {pointer-events: all;}
600`)},vde=0,Sp=[];function bde(t){var e=k.useRef([]),n=k.useRef([0,0]),r=k.useRef(),s=k.useState(vde++)[0],i=k.useState(fW)[0],a=k.useRef(t);k.useEffect(function(){a.current=t},[t]),k.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var g=Uue([t.lockRef.current],(t.shards||[]).map(UF),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=k.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var x=C1(g),w=n.current,v="deltaX"in g?g.deltaX:w[0]-x[0],S="deltaY"in g?g.deltaY:w[1]-x[1],E,C=g.target,T=Math.abs(v)>Math.abs(S)?"h":"v";if("touches"in g&&T==="h"&&C.type==="range")return!1;var P=BF(T,C);if(!P)return!0;if(P?E=T:(E=T==="v"?"h":"v",P=BF(T,C)),!P)return!1;if(!r.current&&"changedTouches"in g&&(v||S)&&(r.current=E),!E)return!0;var M=r.current||E;return gde(M,b,g,M==="h"?v:S,!0)},[]),l=k.useCallback(function(g){var b=g;if(!(!Sp.length||Sp[Sp.length-1]!==i)){var x="deltaY"in b?$F(b):C1(b),w=e.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&yde(E.delta,x)})[0];if(w&&w.should){b.cancelable&&b.preventDefault();return}
vendor: 9,096 bytes, lines 600-604
600if(!w){var v=(a.current.shards||[]).map(UF).filter(Boolean).filter(function(E){return E.contains(b.target)}),S=v.length>0?o(b,v[0]):!a.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),u=k.useCallback(function(g,b,x,w){var v={name:g,delta:b,target:x,should:w,shadowParent:wde(x)};e.current.push(v),setTimeout(function(){e.current=e.current.filter(function(S){return S!==v})},1)},[]),d=k.useCallback(function(g){n.current=C1(g),r.current=void 0},[]),f=k.useCallback(function(g){u(g.type,$F(g),g.target,o(g,t.lockRef.current))},[]),p=k.useCallback(function(g){u(g.type,C1(g),g.target,o(g,t.lockRef.current))},[]);k.useEffect(function(){return Sp.push(i),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,kp),document.addEventListener("touchmove",l,kp),document.addEventListener("touchstart",d,kp),function(){Sp=Sp.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,kp),document.removeEventListener("touchmove",l,kp),document.removeEventListener("touchstart",d,kp)}},[]);var m=t.removeScrollBar,y=t.inert;return k.createElement(k.Fragment,null,y?k.createElement(i,{styles:xde(s)}):null,m?k.createElement(cde,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function wde(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const kde=Xue(hW,bde);var wI=k.forwardRef(function(t,e){return k.createElement(NE,Ho({},t,{ref:e,sideCar:kde}))});wI.classNames=NE.classNames;var Sde=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},_p=new WeakMap,A1=new WeakMap,T1={},kA=0,yW=function(t){return t&&(t.host||yW(t.parentNode))},_de=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=yW(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})},Ede=function(t,e,n,r){var s=_de(e,Array.isArray(t)?t:[t]);T1[n]||(T1[n]=new WeakMap);var i=T1[n],a=[],o=new Set,l=new Set(s),u=function(f){!f||o.has(f)||(o.add(f),u(f.parentNode))};s.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(o.has(p))d(p);else try{var m=p.getAttribute(r),y=m!==null&&m!=="false",g=(_p.get(p)||0)+1,b=(i.get(p)||0)+1;_p.set(p,g),i.set(p,b),a.push(p),g===1&&y&&A1.set(p,!0),b===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return d(e),o.clear(),kA++,function(){a.forEach(function(f){var p=_p.get(f)-1,m=i.get(f)-1;_p.set(f,p),i.set(f,m),p||(A1.has(f)||f.removeAttribute(r),A1.delete(f)),m||f.removeAttribute(n)}),kA--,kA||(_p=new WeakMap,_p=new WeakMap,A1=new WeakMap,T1={})}},xW=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=Sde(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),Ede(r,s,n,"aria-hidden")):function(){return null}},PE="Dialog",[vW,cAe]=il(PE),[Cde,ao]=vW(PE),bW=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=k.useRef(null),l=k.useRef(null),[u,d]=dd({prop:r,defaultProp:s??!1,onChange:i,caller:PE});return c.jsx(Cde,{scope:e,triggerRef:o,contentRef:l,contentId:sd(),titleId:sd(),descriptionId:sd(),open:u,onOpenChange:d,onOpenToggle:k.useCallback(()=>d(f=>!f),[d]),modal:a,children:n})};bW.displayName=PE;var wW="DialogTrigger",kW=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ao(wW,n),i=bt(e,s.triggerRef);return c.jsx(Fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":_I(s.open),...r,ref:i,onClick:Ce(t.onClick,s.onOpenToggle)})});kW.displayName=wW;var kI="DialogPortal",[Ade,SW]=vW(kI,{forceMount:void 0}),_W=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=ao(kI,e);return c.jsx(Ade,{scope:e,forceMount:n,children:k.Children.map(r,a=>c.jsx(jd,{present:n||i.open,children:c.jsx(sE,{asChild:!0,container:s,children:a})}))})};_W.displayName=kI;var XS="DialogOverlay",EW=k.forwardRef((t,e)=>{const n=SW(XS,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=ao(XS,t.__scopeDialog);return i.modal?c.jsx(jd,{present:r||i.open,children:c.jsx(jde,{...s,ref:e})}):null});EW.displayName=XS;var Tde=wy("DialogOverlay.RemoveScroll"),jde=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ao(XS,n);return c.jsx(wI,{as:Tde,allowPinchZoom:!0,shards:[s.contentRef],children:c.jsx(Fe.div,{"data-state":_I(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Yf="DialogContent",CW=k.forwardRef((t,e)=>{const n=SW(Yf,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=ao(Yf,t.__scopeDialog);return c.jsx(jd,{present:r||i.open,children:i.modal?c.jsx(Nde,{...s,ref:e}):c.jsx(Pde,{...s,ref:e})})});CW.displayName=Yf;var Nde=k.forwardRef((t,e)=>{const n=ao(Yf,t.__scopeDialog),r=k.useRef(null),s=bt(e,n.contentRef,r);return k.useEffect(()=>{const i=r.current;if(i)return xW(i)},[]),c.jsx(AW,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ce(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:Ce(t.onFocusOutside,i=>i.preventDefault())})}),Pde=k.forwardRef((t,e)=>{const n=ao(Yf,t.__scopeDialog),r=k.useRef(!1),s=k.useRef(!1);return c.jsx(AW,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),AW=k.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=ao(Yf,n),l=k.useRef(null),u=bt(e,l);return cW(),c.jsxs(c.Fragment,{children:[c.jsx(bI,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:c.jsx(b0,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":_I(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Rde,{titleId:o.titleId}),c.jsx(Dde,{contentRef:l,descriptionId:o.descriptionId})]})]})}),SI="DialogTitle",TW=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ao(SI,n);return c.jsx(Fe.h2,{id:s.titleId,...r,ref:e})});TW.displayName=SI;var jW="DialogDescription",NW=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ao(jW,n);return c.jsx(Fe.p,{id:s.descriptionId,...r,ref:e})});NW.displayName=jW;var PW="DialogClose",RW=k.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ao(PW,n);return c.jsx(Fe.button,{type:"button",...r,ref:e,onClick:Ce(t.onClick,()=>s.onOpenChange(!1))})});RW.displayName=PW;function _I(t){return t?"open":"closed"}var IW="DialogTitleWarning",[uAe,DW]=hX(IW,{contentName:Yf,titleName:SI,docsSlug:"dialog"}),Rde=({titleId:t})=>{const e=DW(IW),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
601
602If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
603
604For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return k.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Ide="DialogDescriptionWarning",Dde=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${DW(Ide).contentName}}.`;return k.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Mde=bW,Ode=kW,Lde=_W,MW=EW,OW=CW,LW=TW,FW=NW,Fde=RW;const md=Mde,Bde=Ode,$de=Lde,BW=k.forwardRef(({className:t,...e},n)=>c.jsx(MW,{ref:n,className:Oe("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}));BW.displayName=MW.displayName;const yc=k.forwardRef(({className:t,children:e,...n},r)=>c.jsxs($de,{children:[c.jsx(BW,{}),c.jsxs(OW,{ref:r,className:Oe("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,c.jsxs(Fde,{className:"absolute right-4 top-4 roun
604ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[c.jsx(C0,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));yc.displayName=OW.displayName;const gd=({className:t,...e})=>c.jsx("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});gd.displayName="DialogHeader";const Ny=({className:t,...e})=>c.jsx("div",{className:Oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Ny.displayName="DialogFooter";const yd=k.forwardRef(({className:t,...e},n)=>c.jsx(LW,{ref:n,className:Oe("text-lg font-semibold leading-none tracking-tight",t),...e}));yd.displayName=LW.displayName;const Xf=k.forwardRef(({className:t,...e},n)=>c.jsx(FW,{ref:n,className:Oe("text-sm text-muted-foreground",t),...e}));Xf.displayName=FW.displayName;const Ude=[{src:Tue,title:"Swiss Water Market Trends",description:"Visual analysis of emerging consumer demands and regulatory shifts"},{src:jue,title:"Rent vs. Buy Economics",description:"Decision framework for POU water system investments"},{src:Nue,title:"Market Entry Strategy",description:"Step-by-step guide to cracking the water dispense market"},{src:Pue,title:"Europe Accelerates. America Retreats.",description:"The PFAS regulatory divergence reshaping water dispense investment"},{src:Rue,title:"BWT Enters UK Water Dispense",description:"How a filtration-first technology entrant is changing the competitive game"},{src:Iue,title:"ESG Mandates Rewriting Office Water",description:"Why integrated tap systems and ESG-ready POU are winning enterprise contracts"}],zde=()=>{const[t,e]=k.useState(null);return c.jsxs("section",{className:"py-20 md:py-28 bg-muted/30",children:[c.jsxs("div",{className:"container mx-auto px-4",children:[c.jsxs(qt,{className:"text-center mb-12 md:mb-16",children:[c.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 text-primary mb-6",children:[c.jsx(AZ,{className:"w-4 h-4"}),c.jsx("span",{className:"text-sm font-medium",children:"Visual Intelligence"})]}),c.jsx("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-4",children:"Custom Infographics for Our Clients"}),c.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"We transform complex market data into clear, actionable visual insights that support strategic decision-making."})]}),c.jsx(ic,{className:"flex flex-wrap justify-center gap-4 md:gap-6",staggerDelay:.12,children:Ude.map((n,r)=>c.jsx(Vs,{children:c.jsxs("div",{onClick:()=>e(n),className:"group bg-card rounded-xl overflow-hidden shadow-md hover:shadow-lg transition-all duration-300 border border-border w-full sm:w-[280px] md:w-[300px] cursor-pointer",children:[c.jsx("div",{className:"aspect-[16/10] overflow-hidden",children:c.jsx("img",{src:n.src,alt:`${n.title} - ${n.description}`,className:"w-full h-full object-cover object-top group-hover:scale-105 transition-transform duration-500",loading:"lazy",width:"300",height:"188"})}),c.jsxs("div",{className:"p-4",children:[c.jsx("h3",{className:"font-semibold text-foreground text-sm mb-1",children:n.title}),c.jsx("p",{className:"text-xs text-muted-foreground",children:n.description})]})]})},r))})]}),c.jsx(md,{open:!!t,onOpenChange:()=>e(null),children:c.jsxs(yc,{className:"max-w-[95vw] max-h-[95vh] p-0 overflow-hidden bg-background/95 backdrop-blur-sm",children:[c.jsx("button",{onClick:()=>e(null),className:"absolute top-4 right-4 z-10 p-2 rounded-full bg-background/80 hover:bg-background transition-colors",children:c.jsx(C0,{className:"w-5 h-5"})}),t&&c.jsxs("div",{className:"flex flex-col items-center p-4",children:[c.jsx("img",{src:t.src,alt:t.title,className:"max-w-full max-h-[80vh] object-contain rounded-lg"}),c.jsxs("div",{className:"mt-4 text-center",children:[c.jsx("h3",{className:"font-semibold text-foreground text-lg",children:t.title}),c.jsx("p",{className:"text-sm text-muted-foreground",children:t.description})]})]})]})})]})},un=k.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:Oe("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));
604un.displayName="Card";const Ys=k.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:Oe("flex flex-col space-y-1.5 p-6",t),...e}));Ys.displayName="CardHeader";const Xs=k.forwardRef(({className:t,...e},n)=>c.jsx("h3",{ref:n,className:Oe("text-2xl font-semibold leading-none tracking-tight",t),...e}));Xs.displayName="CardTitle";const rl=k.forwardRef(({className:t,...e},n)=>c.jsx("p",{ref:n,className:Oe("text-sm text-muted-foreground",t),...e}));rl.displayName="CardDescription";const Nn=k.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:Oe("p-6 pt-0",t),...e}));Nn.displayName="CardContent";const Vde=k.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:Oe("flex items-center p-6 pt-0",t),...e}));Vde.displayName="CardFooter";const Wde=[{icon:_0,title:"31 European Markets",description:"Market Size • Competitors • Pricing • Forecasts",href:"/reports#country-reports"},{icon:NU,title:"United States",description:"Market Size • Competitors • Pricing • Forecasts",href:"/reports#country-reports"},{icon:TU,title:"International Markets",description:"UAE • Turkey • Japan • South Korea",href:"/reports/usa-water-dispense-market-report"}],Hde=()=>c.jsx("section",{className:"py-16 bg-background",children:c.jsxs("div",{className:"container mx-auto px-6",children:[c.jsx(qt,{className:"text-center mb-10",children:c.jsxs("h2",{className:"text-2xl md:text-3xl font-bold text-foreground mb-3",children:["Need Specific Regional Focus? ",c.jsx("span",{className:"text-accent",children:"We Have That Too."})]})}),c.jsx(ic,{className:"grid md:grid-cols-3 gap-6 max-w-5xl mx-auto",staggerDelay:.1,children:Wde.map((t,e)=>c.jsx(Vs,{children:c.jsx(un,{className:"bg-muted/30 border-border/50 hover:border-accent/30 transition-all duration-300 hover:shadow-md h-full",children:c.jsxs(Nn,{className:"p-6 text-center",children:[c.jsx("div",{className:"mb-4 flex justify-center",children:c.jsx("div",{className:"p-3 bg-accent/10 rounded-full",children:c.jsx(t.icon,{className:"w-6 h-6 text-accent"})})}),c.jsx("h3",{className:"font-semibold text-lg text-foreground mb-2",children:t.title}),c.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:t.description}),c.jsxs("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"mt-4 inline-flex items-center gap-1 text-sm font-semibold text-primary hover:text-accent",children:["View option ",c.jsx(Yr,{className:"size-4"})]})]})})},e))})]})}),qde=()=>c.jsx("section",{className:"py-20 bg-muted/30",children:c.jsx("div",{className:"container mx-auto px-6",children:c.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[c.jsx(op,{children:c.jsx("div",{className:"mb-6 flex justify-center",children:c.jsx("div",{className:"p-4 bg-accent/10 rounded-full",children:c.jsx(pR,{className:"w-12 h-12 text-accent"})})})}),c.jsx(qt,{delay:.1,children:c.jsxs("h2",{className:"text-4xl md:text-5xl font-bold text-foreground mb-6",children:["Understand How the ",c.jsx("span",{className:"text-accent",children:"Numbers Were Built"})]})}),c.jsxs(qt,{delay:.2,children:[c.jsx("p",{className:"text-xl text-muted-foreground leading-relaxed",children:"Review the scope, definitions and methodology before you buy. Our research combines industry input, company information and market modelling to help you assess the evidence behind each market view."}),c.jsx(oe,{asChild:!0,size:"lg",className:"mt-8",children:c.jsx("a",{href:"/reports",target:"_blank",rel:"noopener noreferrer",children:"Explore Reports & Samples"})})]})]})})}),Gde="/assets/stefano-branca-Dau6iyC1.png",Kde=()=>c.jsx("section",{className:"py-20 bg-background",children:c.jsx("div",{className:"container mx-auto px-6",children:c.jsx("div",{className:"max-w-4xl mx-auto",children:c.jsx(op,{children:c.jsxs("div",{className:"bg-gradient-to-br from-primary/5 to-accent/5 border border-border rounded-2xl p-8 md:p-12 shadow-lg",children:[c.jsxs(qt,{className:"text-center mb-8",children:[c.jsx("p",{className:"text-accent font-semibold text-sm uppercase tracking-wider mb-2",children:"Client Perspective"}),c.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-foreground",children:"Used by Leading Water Dispense Companies"})]}),c.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-8",children:[c.jsx(qt,{delay:.1,className:"flex-shrink-0",children:c.jsx("img",{src:Gde,alt:"Stefano Branca, Chief Strategy Officer at Culligan International, Zenith Global client",className:"w-32 h-32 md:w-40 md:h-40 rounded-full object-cover border-4 border-accent/20 shadow-xl",loading:"lazy",width:"160",height:"160"})}),c.jsxs(qt,{delay:.2,className:"flex-1 text-center md:text-left",children:[c.jsx(TZ,{className:"w-10 h-10 text-accent/40 mb-4 mx-auto md:mx-0"}),c.jsx("blockquote",{className:"text-lg md:text-xl text-foreground leading-relaxed mb-6",children:'"We have been partnering with Zenith since before I joined. The Zenith reports help us spotting organic and inorganic opportunities. The market reports helped us to navigate our business, spotting organic and inorganic opportunities."'}),c.jsxs("div",{className:"border-t border-border pt-4",children:[c.jsx("p",{className:"font-bold text-foreground text-lg",children:"Stefano Branca"}),c.jsxs("p",{className:"text-muted-foreground",children:["Chief Strategy Officer, ",c.jsx("span",{className:"font-semibold text-accent",children:"Culligan International"})]})]})]})]})]})})})})});function EI(t){const[e,n]=k.useState([]),[r,s]=k.useState(!0),[i,a]=k.useState(null);k.useEffect(()=>{(async()=>{try{s(!0);let u=ce.from("trustpilot_reviews").select("id, title, content, author, rating, review_date, is_verified").eq("is_displayed",!0).order("display_order",{ascending:!0});t&&(u=u.limit(t));const{data:d,error:f}=await u;if(f){console.error("Error fetching reviews:",f),a(f.message);return}n(d||[])}catch(u){console.error("Unexpected error fetching reviews:",u),a(u instanceof Error?u.message:"Unknown error")}finally{s(!1)}})()},[t]);const o=e.length>0?e.reduce((l,u)=>l+u.rating,0)/e.length:0;return{reviews:e,isLoading:r,error:i,averageRating:o}}const Yde=[{id:"1",title:"Proactive and supportive vendor collaboration",content:"Easy to buy, easy to understand what does the report include. Extra info needed provided",author:"Micaela",review_date:"2025-10-02",rating:5,is_verified:!0},{id:"2",title:"Zenith Global is a trustworthy partner",content:"Zenith Global has proven to be a reliable and valuable consultant for our Viking Resources' water bottling project in Iceland. They provided a comprehensive and professional valuation report, offering key insights into the project. Working with Akos Petri and his team has been a very positive experience, and we look forward to benefiting from their excellent services again soon.",author:"Oli",review_date:"2025-08-14",rating:5,is_verified:!0},{id:"3",title:"Best option for market intel in water",content:"Everyone working in the water space knows how difficult it is to get a grasp of the market due to its fragmented nature. Working with Zenith Global and Akos specifically reduced our margin of unknowns dramatically and shed some light into the trends, dynamics and economics of the market.",author:"Daniel",review_date:"2025-08-11",rating:5,is_verified:!1}],Xde=t=>new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),Zde=()=>{const{reviews:t,isLoading:e,averageRating:n}=EI(6),r=t.length>0?t:Yde,s=t.length>0?n.toFixed(1):"5.0";return c.jsx("section",{className:"py-20 bg-muted/30",children:c.jsxs("div",{className:"container mx-auto px-6",children:[c.jsxs(qt,{className:"text-center mb-12",children:[c.jsx("h2",{className:"text-4xl font-bold mb-4 text-primary",children:"Trusted by Industry Leaders"}),c.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[c.jsx("div",{className:"flex",children:[...Array(5)].map((i,a)=>c.jsx(NS,{className:"w-6 h-6 fill-accent text-accent"},a))}),c.jsx("span",{className:"text-2xl font-bold text-foreground",children:s})]}),c.jsx("p",{className:"text-muted-foreground",children:"Based on verified Trustpilot reviews"})]}),e?c.jsx("div",{className:"grid md:grid-cols-3 gap-8 max-w-7xl mx-auto",children:[1,2,3].map(i=>c.jsx(un,{className:"h-64 animate-pulse",children:c.jsxs(Nn,{className:"p-6",children:[c.jsx("div",{className:"h-4 bg-muted rounded w-24 mb-4"}),c.jsx("div",{className:"h-4 bg-muted rounded w-3/4 mb-3"}),c.jsx("div",{className:"h-20 bg-muted rounded mb-4"}),c.jsx("div",{className:"h-4 bg-muted rounded w-1/2"})]})},i))}):c.jsx(ic,{className:"grid md:grid-cols-3 gap-8 max-w-7xl mx-auto",staggerDelay:.12,children:r.slice(0,3).map(i=>c.jsx(Vs,{children:c.jsx(un,{className:"hover:shadow-lg transition-shadow h-full",children:c.jsxs(Nn,{className:"p-6",children:[c.jsx("div",{className:"flex mb-4",children:[...Array(i.rating)].map((a,o)=>c.jsx(NS,{className:"w-5 h-5 fill-accent text-accent"},o))}),c.jsx("h3",{className:"font-semibold text-lg mb-3 text-foreground",children:i.title}),c.jsx("p",{className:"text-muted-foreground mb-4 leading-relaxed line-clamp-4",children:i.content}),c.jsxs("div",{className:"border-t pt-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("p",{className:"font-semibold text-foreground",children:i.author}),i.is_verified&&c.jsx("span",{className:"text-xs bg-accent/20 text-accent px-2 py-0.5 rounded",children:"Verified"})]}),c.jsx("p",{className:"text-sm text-muted-foreground",children:Xde(i.review_date)})]})]})})},i.id))}),c.jsx(qt,{delay:.4,className:"text-center mt-8",children:c.jsx("a",{href:"https://www.trustpilot.com/review/zenithglobalcommercial.com",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:text-accent/80 font-semibold transition-colors",children:"Read all reviews on Trustpilot →"})})]})})},Ue=k.forwardRef(({className:t,type:e,...n},r)=>c.jsx("input",{type:e,className:Oe("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}));Ue.displayName="Input";var Qde="Label",$W=k.forwardRef((t,e)=>c.jsx(Fe.label,{...t,ref:e,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));$W.displayName=Qde;var UW=$W;const Jde=oE("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Se=k.forwardRef(({className:t,...e},n)=>c.jsx(UW,{ref:n,className:Oe(Jde(),t),...e}));Se.displayName=UW.displayName;function CI(t){const e=k.useRef({value:t,previous:t});return k.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var RE="Checkbox",[ehe,dAe]=il(RE),[the,AI]=ehe(RE);function nhe(t){const{__scopeCheckbox:e,checked:n,children:r,defaultChecked:s,disabled:i,form:a,name:o,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:f}=t,[p,m]=dd({prop:n,defaultProp:s??!1,onChange:l,caller:RE}),[y,g]=k.useState(null),[b,x]=k.useState(null),w=k.useRef(!1),v=y?!!a||!!y.closest("form"):!0,S={checked:p,disabled:i,setChecked:m,control:y,setControl:g,name:o,form:a,value:d,hasConsumerStoppedPropagationRef:w,required:u,defaultChecked:ad(s)?!1:s,isFormControl:v,bubbleInput:b,setBubbleInput:x};return c.jsx(the,{scope:e,...S,children:rhe(f)?f(S):r})}var zW="CheckboxTrigger",VW=k.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...r},s)=>{const{control:i,value:a,disabled:o,checked:l,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:y}=AI(zW,t),g=bt(s,d),b=k.useRef(l);return k.useEffect(()=>{const x=i==null?void 0:i.form;
604if(x){const w=()=>f(b.current);return x.addEventListener("reset",w),()=>x.removeEventListener("reset",w)}},[i,f]),c.jsx(Fe.button,{type:"button",role:"checkbox","aria-checked":ad(l)?"mixed":l,"aria-required":u,"data-state":KW(l),"data-disabled":o?"":void 0,disabled:o,value:a,...r,ref:g,onKeyDown:Ce(e,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:Ce(n,x=>{f(w=>ad(w)?!0:!w),y&&m&&(p.current=x.isPropagationStopped(),p.current||x.stopPropagation())})})});VW.displayName=zW;var TI=k.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:l,onCheckedChange:u,form:d,...f}=t;return c.jsx(nhe,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:o,required:a,onCheckedChange:u,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:p})=>c.jsxs(c.Fragment,{children:[c.jsx(VW,{...f,ref:e,__scopeCheckbox:n}),p&&c.jsx(GW,{__scopeCheckbox:n})]})})});TI.displayName=RE;var WW="CheckboxIndicator",HW=k.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=AI(WW,n);return c.jsx(jd,{present:r||ad(i.checked)||i.checked===!0,children:c.jsx(Fe.span,{"data-state":KW(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});HW.displayName=WW;var qW="CheckboxBubbleInput",GW=k.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:a,required:o,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:m}=AI(qW,t),y=bt(n,m),g=CI(i),b=CR(r);k.useEffect(()=>{const w=p;if(!w)return;const v=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(v,"checked").set,C=!s.current;if(g!==i&&E){const T=new Event("click",{bubbles:C});w.indeterminate=ad(i),E.call(w,ad(i)?!1:i),w.dispatchEvent(T)}},[p,g,i,s]);const x=k.useRef(ad(i)?!1:i);return c.jsx(Fe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??x.current,required:o,disabled:l,name:u,value:d,form:f,...e,tabIndex:-1,ref:y,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});GW.displayName=qW;function rhe(t){return typeof t=="function"}function ad(t){return t==="indeterminate"}function KW(t){return ad(t)?"indeterminate":t?"checked":"unchecked"}const jI=k.forwardRef(({className:t,...e},n)=>c.jsx(TI,{ref:n,className:Oe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-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),...e,children:c.jsx(HW,{className:Oe("flex items-center justify-center text-current"),children:c.jsx(oa,{className:"h-4 w-4"})})}));jI.displayName=TI.displayName;var mt;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(const o of i)a[o]=s[o];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},t.find=(s,i)=>{for(const a of s)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(mt||(mt={}));var zF;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(zF||(zF={}));const be=mt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zc=t=>{switch(typeof t){case"undefined":return be.undefined;case"string":return be.string;case"number":return Number.isNaN(t)?be.nan:be.number;case"boolean":return be.boolean;case"function":return be.function;case"bigint":return be.bigint;case"symbol":return be.symbol;case"object":return Array.isArray(t)?be.array:t===null?be.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?be.promise:typeof Map<"u"&&t instanceof Map?be.map:typeof Set<"u"&&t instanceof Set?be.set:typeof Date<"u"&&t instanceof Date?be.date:be.object;default:return be.unknown}}
vendor: 4,707 bytes, line 604
604,ie=mt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class xc 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(i){return i.message},r={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(n(a))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return s(this),r}static assert(e){if(!(e instanceof xc))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,mt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}xc.create=t=>new xc(t);const aN=(t,e)=>{let n;switch(t.code){case ie.invalid_type:t.received===be.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,mt.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:n=`Unrecognized key(s) in object: ${mt.joinValues(t.keys,", ")}`;break;case ie.invalid_union:n="Invalid input";break;case ie.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${mt.joinValues(t.options)}`;break;case ie.invalid_enum_value:n=`Invalid enum value. Expected ${mt.joinValues(t.options)}, received '${t.received}'`;break;case ie.invalid_arguments:n="Invalid function arguments";break;case ie.invalid_return_type:n="Invalid function return type";break;case ie.invalid_date:n="Invalid date";break;case ie.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}"`:mt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ie.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 ie.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 ie.custom:n="Invalid input";break;case ie.invalid_intersection_types:n="Intersection results could not be merged";break;case ie.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:n="Number must be finite";break;default:n=e.defaultError,mt.assertNever(t)}return{message:n}};let she=aN;function ihe(){return she}const ahe=t=>
vendor: 29,299 bytes, line 604
604{const{data:e,path:n,errorMaps:r,issueData:s}=t,i=[...n,...s.path||[]],a={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let o="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)o=u(a,{data:e,defaultError:o}).message;return{...s,path:i,message:o}};function ue(t,e){const n=ihe(),r=ahe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===aN?void 0:aN].filter(s=>!!s)});t.common.issues.push(r)}class Ri{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 s of n){if(s.status==="aborted")return Ve;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n){const i=await s.key,a=await s.value;r.push({key:i,value:a})}return Ri.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:i,value:a}=s;if(i.status==="aborted"||a.status==="aborted")return Ve;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[i.value]=a.value)}return{status:e.value,value:r}}}const Ve=Object.freeze({status:"aborted"}),zx=t=>({status:"dirty",value:t}),xa=t=>({status:"valid",value:t}),VF=t=>t.status==="aborted",WF=t=>t.status==="dirty",Py=t=>t.status==="valid",ZS=t=>typeof Promise<"u"&&t instanceof Promise;var ke;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ke||(ke={}));class xd{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const HF=(t,e)=>{if(Py(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 xc(t.common.issues);return this._error=n,this._error}}};function st(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=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:s}:{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:s}}class ft{get description(){return this._def.description}_getType(e){return zc(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:zc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ri,ctx:{common:e.parent.common,data:e.data,parsedType:zc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(ZS(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:zc(e)},s=this._parseSync({data:e,path:r.path,parent:r});return HF(r,s)}"~validate"(e){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zc(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:n});return Py(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(i=>Py(i)?{value:i.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:zc(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(ZS(s)?s:Promise.resolve(s));return HF(r,i)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const a=e(s),o=()=>i.addIssue({code:ie.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new Iy({schema:this,typeName:We.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 od.create(this,this._def)}nullable(){return Dy.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return el.create(this)}promise(){return t_.create(this,this._def)}or(e){return JS.create([this,e],this._def)}and(e){return e_.create(this,e,this._def)}transform(e){return new Iy({...st(this._def),schema:this,typeName:We.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new uN({...st(this._def),innerType:this,defaultValue:n,typeName:We.ZodDefault})}brand(){return new jhe({typeName:We.ZodBranded,type:this,...st(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new dN({...st(this._def),innerType:this,catchValue:n,typeName:We.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return NI.create(this,e)}readonly(){return hN.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ohe=/^c[^\s-]{8,}$/i,lhe=/^[0-9a-z]+$/,che=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uhe=/^[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,dhe=/^[a-z0-9_-]{21}$/i,hhe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fhe=/^[-+]?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)?)??$/,phe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,mhe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let SA;const ghe=/^(?:(?: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])$/,yhe=/^(?:(?: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])$/,xhe=/^(([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]))$/,vhe=/^(([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])$/,bhe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,whe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,YW="((\\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])))",khe=new RegExp(`^${YW}$`);function XW(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 She(t){return new RegExp(`^${XW(t)}$`)}function _he(t){let e=`${YW}T${XW(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 Ehe(t,e){return!!((e==="v4"||!e)&&ghe.test(t)||(e==="v6"||!e)&&xhe.test(t))}function Che(t,e){if(!hhe.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,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function Ahe(t,e){return!!((e==="v4"||!e)&&yhe.test(t)||(e==="v6"||!e)&&vhe.test(t))}class Yu extends ft{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==be.string){const i=this._getOrReturnCtx(e);return ue(i,{code:ie.invalid_type,expected:be.string,received:i.parsedType}),Ve}const r=new Ri;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const a=e.data.length>i.value,o=e.data.length<i.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?ue(s,{code:ie.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&ue(s,{code:ie.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")phe.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"email",code:ie.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")SA||(SA=new RegExp(mhe,"u")),SA.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"emoji",code:ie.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")uhe.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"uuid",code:ie.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")dhe.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"nanoid",code:ie.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")ohe.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"cuid",code:ie.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")lhe.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"cuid2",code:ie.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")che.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"ulid",code:ie.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ue(s,{validation:"url",code:ie.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"regex",code:ie.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?_he(i).test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?khe.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?She(i).test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?fhe.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"duration",code:ie.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Ehe(e.data,i.version)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"ip",code:ie.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Che(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"jwt",code:ie.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?Ahe(e.data,i.version)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"cidr",code:ie.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?bhe.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"base64",code:ie.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?whe.test(e.data)||(s=this._getOrReturnCtx(e,s),ue(s,{validation:"base64url",code:ie.invalid_string,message:i.message}),r.dirty()):mt.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:ie.invalid_string,...ke.errToObj(r)})}_addCheck(e){return new Yu({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ke.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ke.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ke.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ke.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ke.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ke.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ke.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ke.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ke.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ke.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ke.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ke.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ke.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,...ke.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,...ke.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ke.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ke.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ke.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ke.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ke.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ke.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ke.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ke.errToObj(n)})}nonempty(e){return this.min(1,ke.errToObj(e))}trim(){return new Yu({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Yu({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Yu({...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}}Yu.create=t=>new Yu({checks:[],typeName:We.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...st(t)});function The(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return i%a/10**s}class pb extends ft{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)!==be.number){const i=this._getOrReturnCtx(e);return ue(i,{code:ie.invalid_type,expected:be.number,received:i.parsedType}),Ve}let r;const s=new Ri;for(const i of this._def.checks)i.kind==="int"?mt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ue(r,{code:ie.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ue(r,{code:ie.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ue(r,{code:ie.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?The(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),ue(r,{code:ie.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ue(r,{code:ie.not_finite,message:i.message}),s.dirty()):mt.assertNever(i);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ke.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ke.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ke.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ke.toString(n))}setLimit(e,n,r,s){return new pb({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ke.toString(s)}]})}_addCheck(e){return new pb({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ke.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ke.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ke.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ke.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ke.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ke.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"&&mt.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)}}pb.create=t=>new pb({checks:[],typeName:We.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...st(t)});class mb extends ft{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)!==be.bigint)return this._getInvalidInput(e);let r;const s=new Ri;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),ue(r,{code:ie.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),ue(r,{code:ie.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ue(r,{code:ie.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):mt.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:be.bigint,received:n.parsedType}),Ve}gte(e,n){return this.setLimit("min",e,!0,ke.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ke.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ke.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ke.toString(n))}setLimit(e,n,r,s){return new mb({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ke.toString(s)}]})}_addCheck(e){return new mb({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ke.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}}mb.create=t=>new mb({checks:[],typeName:We.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...st(t)});class oN extends ft{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==be.boolean){const r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:be.boolean,received:r.parsedType}),Ve}return xa(e.data)}}oN.create=t=>new oN({typeName:We.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...st(t)});class QS extends ft{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==be.date){const i=this._getOrReturnCtx(e);return ue(i,{code:ie.invalid_type,expected:be.date,received:i.parsedType}),Ve}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return ue(i,{code:ie.invalid_date}),Ve}const r=new Ri;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),ue(s,{code:ie.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):mt.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new QS({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ke.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ke.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}}QS.create=t=>new QS({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:We.ZodDate,...st(t)});class qF extends ft{_parse(e){if(this._getType(e)!==be.symbol){const r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:be.symbol,received:r.parsedType}),Ve}return xa(e.data)}}qF.create=t=>new qF({typeName:We.ZodSymbol,...st(t)});class GF extends ft{_parse(e){if(this._getType(e)!==be.undefined){const r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:be.undefined,received:r.parsedType}),Ve}return xa(e.data)}}GF.create=t=>new GF({typeName:We.ZodUndefined,...st(t)});class KF extends ft{_parse(e){if(this._getType(e)!==be.null){const r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:be.null,received:r.parsedType}),Ve}return xa(e.data)}}KF.create=t=>new KF({typeName:We.ZodNull,...st(t)});class YF extends ft{constructor(){super(...arguments),this._any=!0}_parse(e){return xa(e.data)}}YF.create=t=>new YF({typeName:We.ZodAny,...st(t)});class XF extends ft{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xa(e.data)}}XF.create=t=>new XF({typeName:We.ZodUnknown,...st(t)});class vd extends ft{_parse(e){const n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:be.never,received:n.parsedType}),Ve}}vd.create=t=>new vd({typeName:We.ZodNever,...st(t)});class ZF extends ft{_parse(e){if(this._getType(e)!==be.undefined){const r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:be.void,received:r.parsedType}),Ve}return xa(e.data)}}ZF.create=t=>new ZF({typeName:We.ZodVoid,...st(t)});class el extends ft{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==be.array)return ue(n,{code:ie.invalid_type,expected:be.array,received:n.parsedType}),Ve;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,o=n.data.length<s.exactLength.value;(a||o)&&(ue(n,{code:a?ie.too_big:ie.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ue(n,{code:ie.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ue(n,{code:ie.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>s.type._parseAsync(new xd(n,a,n.path,o)))).then(a=>Ri.mergeArray(r,a));const i=[...n.data].map((a,o)=>s.type._parseSync(new xd(n,a,n.path,o)));return Ri.mergeArray(r,i)}
vendor: 5,088 bytes, line 604
604get element(){return this._def.type}min(e,n){return new el({...this._def,minLength:{value:e,message:ke.toString(n)}})}max(e,n){return new el({...this._def,maxLength:{value:e,message:ke.toString(n)}})}length(e,n){return new el({...this._def,exactLength:{value:e,message:ke.toString(n)}})}nonempty(e){return this.min(1,e)}}el.create=(t,e)=>new el({type:t,minLength:null,maxLength:null,exactLength:null,typeName:We.ZodArray,...st(e)});function Ip(t){if(t instanceof wn){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=od.create(Ip(r))}return new wn({...t._def,shape:()=>e})}else return t instanceof el?new el({...t._def,type:Ip(t.element)}):t instanceof od?od.create(Ip(t.unwrap())):t instanceof Dy?Dy.create(Ip(t.unwrap())):t instanceof Zf?Zf.create(t.items.map(e=>Ip(e))):t}class wn extends ft{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=mt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==be.object){const u=this._getOrReturnCtx(e);return ue(u,{code:ie.invalid_type,expected:be.object,received:u.parsedType}),Ve}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof vd&&this._def.unknownKeys==="strip"))for(const u in s.data)a.includes(u)||o.push(u);const l=[];for(const u of a){const d=i[u],f=s.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new xd(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof vd){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of o)l.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(u==="strict")o.length>0&&(ue(s,{code:ie.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of o){const f=s.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new xd(s,f,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key,p=await d.value;u.push({key:f,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>Ri.mergeObjectSync(r,u)):Ri.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ke.errToObj,new wn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,a;const s=((a=(i=this._def).errorMap)==null?void 0:a.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:ke.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new wn({...this._def,unknownKeys:"strip"})}passthrough(){return new wn({...this._def,unknownKeys:"passthrough"})}extend(e){return new wn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new wn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:We.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new wn({...this._def,catchall:e})}pick(e){const n={};for(const r of mt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new wn({...this._def,shape:()=>n})}omit(e){const n={};for(const r of mt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new wn({...this._def,shape:()=>n})}deepPartial(){return Ip(this)}partial(e){const n={};for(const r of mt.objectKeys(this.shape)){const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}return new wn({...this._def,shape:()=>n})}required(e){const n={};for(const r of mt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof od;)i=i._def.innerType;n[r]=i}return new wn({...this._def,shape:()=>n})}keyof(){return ZW(mt.objectKeys(this.shape))}}wn.create=(t,e)=>new wn({shape:()=>t,unknownKeys:"strip",catchall:vd.create(),typeName:We.ZodObject,...st(e)});wn.strictCreate=(t,e)=>new wn({shape:()=>t,unknownKeys:"strict",catchall:vd.create(),typeName:We.ZodObject,...st(e)});wn.lazycreate=(t,e)=>new wn({shape:t,unknownKeys:"strip",catchall:vd.create(),typeName:We.ZodObject,...st(e)});class JS extends ft{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(o=>new xc(o.ctx.common.issues));return ue(n,{code:ie.invalid_union,unionErrors:a}),Ve}if(n.common.async)return Promise.all(r.map(async i=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let i;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;
vendor: 5,044 bytes, line 604
604const o=a.map(l=>new xc(l));return ue(n,{code:ie.invalid_union,unionErrors:o}),Ve}}get options(){return this._def.options}}JS.create=(t,e)=>new JS({options:t,typeName:We.ZodUnion,...st(e)});function lN(t,e){const n=zc(t),r=zc(e);if(t===e)return{valid:!0,data:t};if(n===be.object&&r===be.object){const s=mt.objectKeys(e),i=mt.objectKeys(t).filter(o=>s.indexOf(o)!==-1),a={...t,...e};for(const o of i){const l=lN(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===be.array&&r===be.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const a=t[i],o=e[i],l=lN(a,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return n===be.date&&r===be.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class e_ extends ft{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(i,a)=>{if(VF(i)||VF(a))return Ve;const o=lN(i.value,a.value);return o.valid?((WF(i)||WF(a))&&n.dirty(),{status:n.value,value:o.data}):(ue(r,{code:ie.invalid_intersection_types}),Ve)};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(([i,a])=>s(i,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}e_.create=(t,e,n)=>new e_({left:t,right:e,typeName:We.ZodIntersection,...st(n)});class Zf extends ft{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==be.array)return ue(r,{code:ie.invalid_type,expected:be.array,received:r.parsedType}),Ve;if(r.data.length<this._def.items.length)return ue(r,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ve;!this._def.rest&&r.data.length>this._def.items.length&&(ue(r,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new xd(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(i).then(a=>Ri.mergeArray(n,a)):Ri.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Zf({...this._def,rest:e})}}Zf.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zf({items:t,typeName:We.ZodTuple,rest:null,...st(e)})};class QF extends ft{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!==be.map)return ue(r,{code:ie.invalid_type,expected:be.map,received:r.parsedType}),Ve;const s=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([o,l],u)=>({key:s._parse(new xd(r,o,r.path,[u,"key"])),value:i._parse(new xd(r,l,r.path,[u,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return Ve;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of a){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return Ve;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),o.set(u.value,d.value)}return{status:n.value,value:o}}}}QF.create=(t,e,n)=>new QF({valueType:e,keyType:t,typeName:We.ZodMap,...st(n)});class gb extends ft{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==be.set)return ue(r,{code:ie.invalid_type,expected:be.set,received:r.parsedType}),Ve;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ue(r,{code:ie.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ue(r,{code:ie.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function a(l){const u=new Set;for(const d of l){if(d.status==="aborted")return Ve;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const o=[...r.data.values()].map((l,u)=>i._parse(new xd(r,l,r.path,u)));return r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,n){return new gb({...this._def,minSize:{value:e,message:ke.toString(n)}})}max(e,n){return new gb({...this._def,maxSize:{value:e,message:ke.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}gb.create=(t,e)=>new gb({valueType:t,minSize:null,maxSize:null,typeName:We.ZodSet,...st(e)});class JF extends ft{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})}}JF.create=(t,e)=>new JF({getter:t,typeName:We.ZodLazy,...st(e)});class cN extends ft{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ue(n,{received:n.data,code:ie.invalid_literal,expected:this._def.value}),Ve}
vendor: 5,385 bytes, line 604
604return{status:"valid",value:e.data}}get value(){return this._def.value}}cN.create=(t,e)=>new cN({value:t,typeName:We.ZodLiteral,...st(e)});function ZW(t,e){return new Ry({values:t,typeName:We.ZodEnum,...st(e)})}class Ry extends ft{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ue(n,{expected:mt.joinValues(r),received:n.parsedType,code:ie.invalid_type}),Ve}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 ue(n,{received:n.data,code:ie.invalid_enum_value,options:r}),Ve}return xa(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 Ry.create(e,{...this._def,...n})}exclude(e,n=this._def){return Ry.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Ry.create=ZW;class e4 extends ft{_parse(e){const n=mt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==be.string&&r.parsedType!==be.number){const s=mt.objectValues(n);return ue(r,{expected:mt.joinValues(s),received:r.parsedType,code:ie.invalid_type}),Ve}if(this._cache||(this._cache=new Set(mt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=mt.objectValues(n);return ue(r,{received:r.data,code:ie.invalid_enum_value,options:s}),Ve}return xa(e.data)}get enum(){return this._def.values}}e4.create=(t,e)=>new e4({values:t,typeName:We.ZodNativeEnum,...st(e)});class t_ extends ft{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==be.promise&&n.common.async===!1)return ue(n,{code:ie.invalid_type,expected:be.promise,received:n.parsedType}),Ve;const r=n.parsedType===be.promise?n.data:Promise.resolve(n.data);return xa(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}t_.create=(t,e)=>new t_({type:t,typeName:We.ZodPromise,...st(e)});class Iy extends ft{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===We.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:a=>{ue(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const a=s.transform(r.data,i);if(r.common.async)return Promise.resolve(a).then(async o=>{if(n.value==="aborted")return Ve;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?Ve:l.status==="dirty"||n.value==="dirty"?zx(l.value):l});{if(n.value==="aborted")return Ve;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?Ve:o.status==="dirty"||n.value==="dirty"?zx(o.value):o}}if(s.type==="refinement"){const a=o=>{const l=s.refinement(o,i);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"?Ve:(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"?Ve:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.value}))))}if(s.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Py(a))return Ve;const o=s.transform(a.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Py(a)?Promise.resolve(s.transform(a.value,i)).then(o=>({status:n.value,value:o})):Ve);mt.assertNever(s)}}Iy.create=(t,e,n)=>new Iy({schema:t,typeName:We.ZodEffects,effect:e,...st(n)});Iy.createWithPreprocess=(t,e,n)=>new Iy({schema:e,effect:{type:"preprocess",transform:t},typeName:We.ZodEffects,...st(n)});class od extends ft{_parse(e){return this._getType(e)===be.undefined?xa(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}od.create=(t,e)=>new od({innerType:t,typeName:We.ZodOptional,...st(e)});class Dy extends ft{_parse(e){return this._getType(e)===be.null?xa(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dy.create=(t,e)=>new Dy({innerType:t,typeName:We.ZodNullable,...st(e)});class uN extends ft{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}uN.create=(t,e)=>new uN({innerType:t,typeName:We.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...st(e)});class dN extends ft{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ZS(s)?s.then(i=>
604({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new xc(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new xc(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}dN.create=(t,e)=>new dN({innerType:t,typeName:We.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...st(e)});class t4 extends ft{_parse(e){if(this._getType(e)!==be.nan){const r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:be.nan,received:r.parsedType}),Ve}return{status:"valid",value:e.data}}}t4.create=t=>new t4({typeName:We.ZodNaN,...st(t)});class jhe extends ft{_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 NI extends ft{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ve:i.status==="dirty"?(n.dirty(),zx(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ve:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new NI({in:e,out:n,typeName:We.ZodPipeline})}}class hN extends ft{_parse(e){const n=this._def.innerType._parse(e),r=s=>(Py(s)&&(s.value=Object.freeze(s.value)),s);return ZS(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}hN.create=(t,e)=>new hN({innerType:t,typeName:We.ZodReadonly,...st(e)});wn.lazycreate;var We;(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"})(We||(We={}));const Pn=Yu.create,Nhe=oN.create;vd.create;el.create;const cp=wn.create;wn.strictCreate;JS.create;e_.create;Zf.create;const Phe=cN.create;Ry.create;t_.create;od.create;Dy.create;const _A=768;function Rhe(){const[t,e]=k.useState(void 0);return k.useEffect(()=>{const n=window.matchMedia(`(max-width: ${_A-1}px)`),r=()=>{e(window.innerWidth<_A)};return n.addEventListener("change",r),e(window.innerWidth<_A),()=>n.removeEventListener("change",r)},[]),!!t}const Ihe="/assets/akos-petri-new-BdhNrmd_.jpg",Dhe=cp({name:Pn().trim().min(1,"Name is required").max(100),email:Pn().trim().email("Invalid email address").max(255),company:Pn().trim().min(1,"Company name is required").max(200),newsletter:Nhe()}),Mhe=()=>{Rhe();const[t,e]=k.useState({name:"",email:"",company:"",newsletter:!0}),[n,r]=k.useState(!1),s=async i=>{var l;i.preventDefault();const a=Dhe.safeParse(t);if(!a.success){te.error("Please check your form",{description:a.error.errors[0].message});return}r(!0),window.open("https://drive.google.com/drive/folders/1YZM-bGdbHOkc7UxA2_LYSQDVunOFeF5u?usp=sharing","_blank");try{const{data:u,error:d}=await ce.functions.invoke("register-demo",{body:{name:t.name,email:t.email,company:t.company,newsletter:t.newsletter}});if(d){if((l=d.message)!=null&&l.includes("Rate limit"))te.error("Too many requests",{description:"Please try again in an hour."});else throw d;return}if(!(u!=null&&u.success))throw new Error((u==null?void 0:u.error)||"Registration failed");
604te.success("Thank you! Your registration is complete.",{description:t.newsletter?"You've been subscribed to our newsletter. Your demo files are opening in a new tab.":"Your demo files are opening in a new tab."}),e({name:"",email:"",company:"",newsletter:!0})}catch(u){console.error("Error submitting form:",u),te.error("Something went wrong",{description:"Please try again or contact support."})}finally{r(!1)}};return c.jsxs("section",{className:"py-20 bg-gradient-subtle",id:"demo-section",children:[c.jsx("span",{id:"download-investment-guide",className:"block -mt-20 pt-20","aria-hidden":"true"}),c.jsx("div",{className:"container mx-auto px-6",children:c.jsxs("div",{className:"max-w-4xl mx-auto",children:[c.jsxs(qt,{className:"text-center mb-12",children:[c.jsxs("h2",{className:"text-4xl md:text-5xl font-bold text-foreground mb-4",children:["Preview the Research ",c.jsx("span",{className:"text-accent",children:"Before You Buy"})]}),c.jsx("p",{className:"text-xl text-muted-foreground",children:"Get access to the Europe and USA demo file and the Zenith US Investment Guide. Review the sample data and presentation format to assess whether the research fits your needs."})]}),c.jsx(op,{delay:.15,children:c.jsx("div",{className:"bg-card rounded-2xl shadow-elegant p-8 md:p-12 border border-border",children:c.jsxs("form",{onSubmit:s,className:"space-y-6",children:[c.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"name",className:"text-foreground font-semibold",children:"Full Name *"}),c.jsx(Ue,{id:"name",type:"text",required:!0,placeholder:"John Smith",value:t.name,onChange:i=>e({...t,name:i.target.value}),className:"mt-2"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"email",className:"text-foreground font-semibold",children:"Business Email *"}),c.jsx(Ue,{id:"email",type:"email",required:!0,placeholder:"[email protected]",value:t.email,onChange:i=>e({...t,email:i.target.value}),className:"mt-2"})]})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"company",className:"text-foreground font-semibold",children:"Company Name *"}),c.jsx(Ue,{id:"company",type:"text",required:!0,placeholder:"Your Company Ltd.",value:t.company,onChange:i=>e({...t,company:i.target.value}),className:"mt-2"})]}),c.jsxs("div",{className:"flex items-start space-x-3 pt-4",children:[c.jsx(jI,{id:"newsletter",checked:t.newsletter,onCheckedChange:i=>e({...t,newsletter:i})}),c.jsx("div",{children:c.jsxs(Se,{htmlFor:"newsletter",className:"text-sm text-foreground cursor-pointer leading-relaxed",children:["Yes, subscribe me to the free ",c.jsx("strong",{children:"Water Dispense Intelligence Newsletter"}),"."]})})]}),c.jsxs(oe,{type:"submit",size:"lg",variant:"cta",className:"w-full text-lg py-6 h-auto",disabled:n,children:[c.jsx(S0,{className:"mr-2"}),n?"Submitting...":"Get the Demo & US Guide"]}),c.jsxs("p",{className:"text-sm text-muted-foreground text-center",children:["By submitting this form, you agree to our"," ",c.jsx("a",{href:"https://www.zenithglobalcommercial.com/legal",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Privacy Policy"})]})]})})}),c.jsxs(ic,{className:"mt-12 grid md:grid-cols-3 gap-6",staggerDelay:.1,children:[c.jsx(Vs,{children:c.jsx("div",{className:"bg-card rounded-xl p-6 shadow-elegant border border-border hover:border-accent transition-all duration-300 h-full",children:c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"p-3 bg-accent/10 rounded-lg",children:c.jsx(fc,{className:"w-6 h-6 text-accent"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-bold text-foreground mb-2",children:"Join Our Newsletter"}),c.jsx("p",{className:"text-muted-foreground text-sm mb-3",children:"Get monthly insights delivered to your inbox. Industry trends, market analysis, and exclusive research."}),c.jsx("a",{href:"#demo-section",className:"text-accent font-semibold text-sm hover:underline",children:"Subscribe above →"})]})]})})}),c.jsx(Vs,{children:c.jsx("div",{className:"bg-card rounded-xl p-6 shadow-elegant border border-border hover:border-accent transition-all duration-300 h-full",children:c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"relative w-16 h-16 rounded-full overflow-hidden flex-shrink-0",children:c.jsx("img",{src:Ihe,alt:"Akos Petri, Managing Director of Zenith Global Commercial",className:"w-full h-full object-cover",loading:"lazy",width:"64",height:"64"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-bold text-foreground mb-2",children:"Follow Akos Petri, MD"}),c.jsx("p",{className:"text-muted-foreground text-sm mb-3",children:"Get actionable insights from our Managing Director. Industry commentary, strategic analysis, and market intelligence."}),c.jsxs("a",{href:"https://www.linkedin.com/in/akospetri/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-accent font-semibold text-sm hover:underline",children:[c.jsx(hc,{className:"w-4 h-4"}),"Connect on LinkedIn →"]})]})]})})}),c.jsx(Vs,{children:c.jsx("div",{className:"bg-card rounded-xl p-6 shadow-elegant border border-border hover:border-accent transition-all duration-300 h-full",children:c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"p-3 bg-accent/10 rounded-lg",children:c.jsx(IZ,{className:"w-6 h-6 text-accent"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-bold text-foreground mb-2",children:"Visit Water Dispense Store"}),c.jsx("p",{className:"text-muted-foreground text-sm mb-3",children:"Browse 35+ market reports across Europe, USA, Japan, South Korea, UAE and Turkey. PDF + Excel delivered within 24 hours."}),c.jsx("a",{href:"/reports",target:"_blank",rel:"noopener noreferrer",className:"text-accent font-semibold text-sm hover:underline",children:"Browse reports →"})]})]})})})]})]})})]})},Ohe=()=>c.jsx("section",{id:"strategy-call-section",className:"py-20 px-4 bg-gradient-to-b from-background to-muted/30",children:c.jsx("div",{className:"container-custom mx-auto text-center",children:c.jsxs("div",{className:"max-w-4xl mx-auto 
604space-y-8",children:[c.jsx(qt,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-4xl md:text-5xl font-bold text-foreground",children:"Which Market Are You Looking At?"}),c.jsx("p",{className:"text-xl text-muted-foreground",children:"Tell us the market or commercial question you are working on. We will tell you what data we have and which research option fits."})]})}),c.jsx(qt,{delay:.1,children:c.jsx("p",{className:"text-sm text-muted-foreground pt-4",children:"Ask About Your Market"})}),c.jsx(op,{delay:.2,children:c.jsx("div",{className:"mt-8 rounded-xl overflow-hidden shadow-elegant border border-border",children:c.jsx("iframe",{src:"https://calendly.com/apetri-zenithglobalcommercial/30min?embed_domain=localhost&embed_type=Inline",width:"100%",height:"700",frameBorder:"0",title:"Schedule a Strategy Call",className:"bg-background"})})})]})})}),Lhe="/assets/zenith-articles-preview-DB-qn11c.png",Fhe=()=>c.jsx("section",{className:"py-20 bg-gradient-to-b from-background to-muted/30",children:c.jsx("div",{className:"container mx-auto px-6",children:c.jsx("div",{className:"max-w-6xl mx-auto",children:c.jsxs("div",{className:"relative overflow-hidden rounded-3xl border border-border bg-card shadow-xl",children:[c.jsx("div",{className:"absolute -top-24 -right-24 w-96 h-96 bg-accent/10 rounded-full blur-3xl pointer-events-none"}),c.jsx("div",{className:"absolute -bottom-24 -left-24 w-96 h-96 bg-primary/10 rounded-full blur-3xl pointer-events-none"}),c.jsxs("div",{className:"relative grid md:grid-cols-2 gap-0",children:[c.jsxs("div",{className:"p-8 md:p-12 lg:p-14 flex flex-col justify-center",children:[c.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-primary/10 text-primary text-xs font-semibold uppercase tracking-wider w-fit mb-5",children:[c.jsx(E0,{className:"w-3.5 h-3.5"}),"Daily Intelligence"]}),c.jsxs("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-4 leading-tight",children:["Zenith ",c.jsx("span",{className:"text-accent",children:"Articles"})]}),c.jsx("p",{className:"text-base md:text-lg text-muted-foreground leading-relaxed mb-6",children:"Daily intelligence briefings on the global water dispense industry — covering POU, HOD, M&A activity, and operator strategy across the US and Europe."}),c.jsxs("div",{className:"space-y-3 mb-8",children:[c.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground",children:[c.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-accent/10 flex items-center justify-center",children:c.jsx(CU,{className:"w-4 h-4 text-accent"})}),c.jsxs("span",{children:[c.jsx("strong",{children:"31 European markets"})," + USA coverage"]})]}),c.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground",children:[c.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-accent/10 flex items-center justify-center",children:c.jsx(gR,{className:"w-4 h-4 text-accent"})}),c.jsxs("span",{children:[c.jsx("strong",{children:"M&A activity"})," & operator strategy"]})]}),c.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground",children:[c.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-accent/10 flex items-center justify-center",children:c.jsx(cZ,{className:"w-4 h-4 text-accent"})}),c.jsxs("span",{children:[c.jsx("strong",{children:"Updated daily"})," for decision-makers"]})]})]}),c.jsxs("a",{href:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 bg-accent text-accent-foreground font-semibold px-6 py-3.5 rounded-xl hover:bg-accent/90 hover:gap-3 transition-all shadow-lg shadow-accent/20 w-fit",children:["Explore the latest articles",c.jsx(Yr,{className:"w-4 h-4"})]})]}),c.jsx("div",{className:"relative bg-gradient-to-br from-primary/5 via-accent/5 to-primary/10 p-6 md:p-8 lg:p-10 flex items-center justify-center min-h-[320px] md:min-h-full overflow-hidden",children:c.jsxs("a",{href:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"group block relative w-full max-w-md transform transition-transform duration-500 hover:scale-[1.02]","aria-label":"Open Zenith Articles",children:[c.jsxs("div",{className:"rounded-xl overflow-hidden shadow-2xl border border-border bg-card",children:[c.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2 bg-muted/80 border-b border-border",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-muted-foreground
604/40"}),c.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-muted-foreground/40"}),c.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-muted-foreground/40"}),c.jsx("span",{className:"ml-3 text-[10px] text-muted-foreground font-mono truncate",children:"waterdispenseinsights.com/intelligence"})]}),c.jsx("img",{src:Lhe,alt:"Preview of Zenith Articles — Industry Intelligence page with daily water dispense briefings",className:"w-full h-auto block",loading:"lazy"})]}),c.jsx("div",{className:"absolute inset-0 rounded-xl bg-accent/0 group-hover:bg-accent/5 transition-colors pointer-events-none"})]})})]})]})})})}),Bhe="/assets/smart-dispensers-hero-ZBaJsPZ2.png",n_=({className:t=""})=>c.jsx("section",{className:`max-w-6xl mx-auto px-4 lg:px-6 ${t}`,children:c.jsx(rt,{to:"/smartdispensers",target:"_blank",rel:"noopener noreferrer","aria-label":"Get the free 2026 Smart Water Dispense report",className:"group block rounded-2xl overflow-hidden transition-transform duration-500 hover:scale-[1.005]",style:{background:"linear-gradient(135deg, #0A0F1F 0%, #0F1729 60%, #0A0F1F 100%)",boxShadow:"0 20px 50px -20px rgba(0,0,0,0.45)",border:"1px solid rgba(212, 245, 70, 0.15)"},children:c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-5 items-center",children:[c.jsx("div",{className:"md:col-span-2 p-5 md:p-6",children:c.jsx("img",{src:Bhe,alt:"Smart Water Dispense Arrives in Commercial Procurement — 2026 report by Akos Petri",className:"block w-full h-auto rounded-xl",loading:"lazy"})}),c.jsxs("div",{className:"md:col-span-3 p-6 md:p-10 text-left",children:[c.jsx("span",{className:"inline-block text-[11px] font-semibold tracking-[0.18em] uppercase mb-3",style:{color:"#D4F546"},children:"Free 2026 Report"}),c.jsx("h3",{className:"text-2xl md:text-3xl lg:text-4xl font-bold leading-tight mb-3",style:{color:"#FFFFFF",letterSpacing:"-0.01em"},children:"Smart Water Dispense Arrives in Commercial Procurement"}),c.jsx("p",{className:"text-sm md:text-base leading-relaxed mb-6",style:{color:"rgba(255,255,255,0.72)"},children:"How AI and IoT are rewriting operator economics in 2026 — by Akos Petri, MSc. Instant access, no credit card."}),c.jsxs("span",{className:"inline-flex items-center gap-2 px-5 py-3 rounded-lg font-semibold text-sm md:text-base transition-transform duration-300 group-hover:translate-x-1",style:{backgroundColor:"#D4F546",color:"#0A0F1F"},children:[c.jsx(S0,{className:"w-4 h-4"}),"Get Access Now",c.jsx(Yr,{className:"w-4 h-4"})]})]})]})})}),$he=1,Uhe="5905812a-53ea-47be-bed1-2c1b5fac72f8",zhe="3f9a82a5-d0b2-4316-963e-c28da70ebb78",Vhe="/__l5e/assets-v1/5905812a-53ea-47be-bed1-2c1b5fac72f8/water-dispense-reports-2026-cover.png",Whe="a/v1/3f9a82a5-d0b2-4316-963e-c28da70ebb78/5905812a-53ea-47be-bed1-2c1b5fac72f8/water-dispense-reports-2026-cover.png",Hhe="water-dispense-reports-2026-cover.png",qhe=1850166,Ghe="image/png",Khe="2026-07-13T11:33:06Z",QW={version:$he,asset_id:Uhe,project_id:zhe,url:Vhe,r2_key:Whe,original_filename:Hhe,size:qhe,content_type:Ghe,created_at:Khe},Yhe=()=>c.jsx("section",{className:"py-16 md:py-24 bg-background",children:c.jsxs("div",{className:"container mx-auto px-6",children:[c.jsxs(xt.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.7,ease:[.25,.4,.25,1]},className:"max-w-3xl",children:[c.jsx("span",{className:"inline-block text-xs font-semibold uppercase tracking-[0.2em] text-accent",children:"Explore Zenith Global Commercial"}),c.jsxs("h2",{className:"mt-3 font-serif text-3xl md:text-5xl font-bold text-foreground leading-tight",children:["Buy a report, or"," ",c.jsx("span",{className:"text-accent",children:"follow the market daily"})]}),c.jsx("p",{className:"mt-4 text-lg text-muted-foreground max-w-2xl",children:"Market reports across 31 European markets, USA, UAE, Turkey, Japan and South Korea — delivered by email within 24 hours — plus a daily-updated Intelligence Hub covering the moves shaping the category."})]}),c.jsxs("div",{className:"mt-10 grid gap-6 lg:grid-cols-5",children:[c.jsx(xt.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.8,ease:[.25,.4,.25,1]},className:"lg:col-span-3",children:c.jsxs("a",{href:"/reports",target:"_blank",rel:"noopener noreferrer","aria-label":"Explore the Zenith Global Commercial Water Dispense Report Store",className:"group relative block overflow-hidden rounded-3xl border border-border shadow-elegant transition-all duration-500 hover:shadow-glow",children:[c.jsx("img",{src:QW.url,alt:"Zenith Global Commercial Water Dispense Market Reports 2026 — Europe and USA report covers",className:"w-full h-auto aspect-[16/9] object-cover transition-transform duration-700 group-hover:scale-[1.02]",loading:"lazy",width:"1600",height:"900"}),c.jsx("div",{className:"absolute inset-0 pointer-events-none bg-gradient-to-t from-primary/40 via-trans
604parent to-transparent"}),c.jsxs("div",{className:"absolute bottom-4 right-4 inline-flex items-center gap-2 rounded-full bg-accent px-4 py-2 text-sm font-semibold text-accent-foreground shadow-lg transition-transform duration-500 group-hover:translate-x-1",children:["Browse the Report Store",c.jsx(Yr,{className:"size-4"})]})]})}),c.jsxs(xt.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.8,delay:.1,ease:[.25,.4,.25,1]},className:"lg:col-span-2 flex flex-col gap-6",children:[c.jsxs("a",{href:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"group relative flex-1 flex flex-col justify-between overflow-hidden rounded-3xl border border-border bg-gradient-hero p-8 text-primary-foreground shadow-elegant transition-all duration-500 hover:shadow-glow",children:[c.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 opacity-40 pointer-events-none",style:{background:"radial-gradient(circle at 85% 15%, hsl(75 85% 60% / 0.35), transparent 55%), radial-gradient(circle at 10% 90%, hsl(200 75% 40% / 0.4), transparent 60%)"}}),c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"inline-flex items-center justify-center size-11 rounded-xl bg-accent/20 text-accent",children:c.jsx(E0,{className:"size-5"})}),c.jsx("h3",{className:"mt-5 font-serif text-2xl md:text-3xl font-bold leading-tight",children:"Intelligence Hub"}),c.jsx("p",{className:"mt-3 text-primary-foreground/85 text-base leading-relaxed",children:"Daily analysis on deals, launches, pricing and category shifts across Europe and the USA."})]}),c.jsxs("div",{className:"relative mt-6 inline-flex items-center gap-2 text-accent font-semibold",children:["Read the latest",c.jsx(Yr,{className:"size-4 transition-transform duration-300 group-hover:translate-x-1"})]})]}),c.jsx("a",{href:"/reports",target:"_blank",rel:"noopener noreferrer",className:"group relative overflow-hidden rounded-3xl border border-border bg-card p-6 shadow-sm transition-all duration-500 hover:shadow-elegant",children:c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"inline-flex items-center justify-center size-11 rounded-xl bg-accent/15 text-accent shrink-0",children:c.jsx(oZ,{className:"size-5"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-serif text-xl font-bold text-foreground",children:"35+ market reports"}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Country, regional and pan-European bundles — Excel + PDF, emailed within 24 hours."}),c.jsxs("span",{className:"mt-3 inline-flex items-center gap-2 text-sm font-semibold text-accent",children:["See the catalogue",c.jsx(Yr,{className:"size-3.5 transition-transform duration-300 group-hover:translate-x-1"})]})]})]})})]})]})]})}),j1=[{id:1,region:"United States",text:"There are more than 5 million bottled water coolers humming away in US offices, homes and job sites right now — a market worth well over 5 billion dollars a year."},{id:2,region:"United States",text:"The number of water machines actually sitting in US buildings is more than double the figure the industry usually quotes. The true installed base is closer to 19 million, not 8 million."},{id:3,region:"Spain",text:"Spain has close to a million water coolers, and most of them sit in people's kitchens, not office
604s — the only major European market where bottled coolers are still growing."},{id:4,region:"Spain",text:"A single operator controls more than 8 out of every 10 bottled water coolers in Spain."},{id:5,region:"Austria",text:"Renting a water cooler in Austria costs around six times what it costs in Spain."},{id:6,region:"Denmark",text:"In Denmark more than 4 in 10 water dispensers are plumbed straight into the mains — the highest rate anywhere in Europe."},{id:7,region:"Norway",text:"Nearly 8 in 10 water dispensers in Norway are filter machines connected to the tap, not bottles."},{id:8,region:"Switzerland",text:"Switzerland nearly halved its bottled-cooler base in just five years."},{id:9,region:"Europe",text:"There are almost 6.5 million water dispensers across Europe, worth around 2.3 billion euros a year."},{id:10,region:"Russia",text:"Russia has more water coolers than any other country in Europe — over a million — even while the market shrinks."},{id:11,region:"Europe",text:"One company sits at number one in the UK, Germany, France and Italy all at the same time."},{id:12,region:"Finland",text:"Finnish customers cancel their water cooler contracts more than twice as often as German ones."},{id:13,region:"Poland",text:"Poland has nearly 400,000 water coolers, but almost none are plumbed in."},{id:14,region:"South Korea",text:"In South Korea more than half of all households rent a water purifier — over 12 million homes paying a monthly subscription for filtered water."},{id:15,region:"Australia",text:"Australia installs more boiling-and-chilled tap systems per person than anywhere else in the world. The two brands leading it, Zip and Billi, are both Australian."},{id:16,region:"United Arab Emirates",text:"In the heat of the UAE, bottled water coolers still rule — close to a million machines dispensing nearly a billion litres a year."},{id:17,region:"Turkey",text:"Turkey gets through more than 5 billion litres a year from big 19-litre 'damacana' bottles — a tradition now sliding as filtered taps move in."},{id:18,region:"Mexico",text:"Mexico still runs largely on the refillable 'garrafón' jug, with the race on to convert those homes to filtered taps."}];function Xhe(t){const e=Date.UTC(t.getUTCFullYear(),0,0),n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.floor((n-e)/864e5)}function Zhe(t=new Date){const n=((Xhe(t)-1)%j1.length+j1.length)%j1.length;return j1[n]}const IE=({className:t="",linkTarget:e="_blank",variant:n="card",showCta:r=!0})=>{const s=Zhe(),i=n==="muted",a=i?"bg-primary border-primary/50 hover:border-accent/60":"bg-primary/25 border-primary/35",o=i?"text-primary-foreground":"text-foreground",l=c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1.5 bg-accent"}),c.jsxs("div",{className:"pl-4 sm:pl-5",children:[c.jsxs("span",{className:"inline-flex items-center rounded-full bg-accent px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.2em] text-accent-foreground",children:["Did you know · ",s.region]}),c.jsx("p",{className:`mt-3 font-serif text-lg sm:text-xl leading-snug ${o}`,children:s.text}),r&&c.jsxs("span",{className:"mt-3 inline-flex items-center gap-2 text-sm font-semibold text-accent",children:["See the reports",c.jsx(Yr,{className:"size-4 transition-transform duration-300 group-hover:translate-x-1"})]})]})]}),u={initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.6,ease:[.25,.4,.25,1]}};return r?c.jsx(xt.a,{...u,href:"/reports",target:e,rel:e==="_blank"?"noopener noreferrer":void 0,className:`group relative block overflow-hidden rounded-2xl border ${a} p-5 sm:p-6 shadow-sm transition-all duration-500 hover:shadow-elegant ${t}`,"aria-label":`Did you know: ${s.text} — see the reports`,children:l}):c.jsx(xt.div,{...u,className:`group relative block overflow-hidden rounded-2xl border ${a} p-5 sm:p-6 shadow-sm ${t}`,"aria-label":`Did you know: ${s.text}`,children:l})},JW=({className:t=""})=>c.jsxs(xt.figure,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{duration:.6,ease:[.25,.4,.25,1]},className:`mx-auto max-w-3xl text-center ${t}
604`,children:[c.jsxs("div",{"aria-hidden":!0,className:"mx-auto mb-5 flex items-center justify-center gap-3",children:[c.jsx("span",{className:"h-px w-10 bg-accent/60"}),c.jsx("span",{className:"size-1.5 rotate-45 bg-accent"}),c.jsx("span",{className:"h-px w-10 bg-accent/60"})]}),c.jsx("blockquote",{className:"font-serif text-xl leading-snug text-foreground sm:text-2xl md:text-3xl",children:"“A moment’s insight is sometimes worth a life’s experience.”"}),c.jsx("figcaption",{className:"mt-4 text-xs font-semibold uppercase tracking-[0.25em] text-muted-foreground",children:"Oliver Wendell Holmes, Sr."})]}),Cc=()=>c.jsx("footer",{className:"bg-primary text-primary-foreground py-12",children:c.jsxs("div",{className:"container mx-auto px-6",children:[c.jsxs("div",{className:"grid md:grid-cols-2 gap-8 mb-8",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-2xl font-bold mb-4 text-accent",children:"Zenith Global Commercial"}),c.jsx("p",{className:"text-primary-foreground/80 mb-4",children:"Specialist water dispense market intelligence since 1998."})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold mb-4",children:"Connect With Us"}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("a",{href:"https://www.linkedin.com/in/akospetri/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(hc,{className:"w-5 h-5"}),"Follow Akos Petri on LinkedIn"]}),c.jsxs("a",{href:"https://waterdispenseinsights.com/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(E0,{className:"w-5 h-5"}),"US + Pan-European Insights 2026"]}),c.jsxs("a",{href:"/reports",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(ds,{className:"w-5 h-5"}),"Browse the report store"]}),c.jsxs("a",{href:"https://chinareport.zenithmarketintel.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(eb,{className:"w-5 h-5"}),"China Private-Label Water Report 2026"]}),c.jsxs("a",{href:"https://zenithmarketintel.com/consulting",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(lZ,{className:"w-5 h-5"}),"Submit your project enquiry"]}),c.jsxs("a",{href:"https://waterdispenseinsights.com/#demo-section",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(fc,{className:"w-5 h-5"}),"Subscribe to Newsletter"]}),c.jsxs("a",{href:"mailto:[email protected]",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(fc,{className:"w-5 h-5"}),"[email protected]"]}),c.jsxs("a",{href:"tel:+442033690036",className:"flex items-center gap-2 text-primary-foreground/80 hover:text-accent transition-colors",children:[c.jsx(RU,{className:"w-5 h-5"}),"+44 20 3369 0036"]})]})]})]}),c.jsxs("div",{className:"border-t border-primary-foreground/20 pt-8 text-center text-primary-foreground/60 text-sm",children:[c.jsxs("p",{children:["© ",new Date().getFullYear()," Zenith Global Commercial. All rights reserved."]}),c.jsx("p",{className:"mt-2",children:"Trusted by industry leaders worldwide since 1998"}),c.jsxs("p",{className:"mt-4 text-xs text-primary-foreground/40",children:["Copyright © 2026 Zenith Global Commercial Ltd. All Rights Reserved. |"," ",c.jsx("a",{href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-accent transition-colors underline",children:"Privacy Policy"})," ","| United Kingdom 71-75 Shelton Street, Covent Garden, London, WC2H 9JQ."]})]})]})}),Qhe=()=>c.jsxs("main",{className:"min-h-screen overflow-x-hidden",children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Water Dispenser Market Research, Reports & Consultancy | Zenith"}),c.jsx("meta",{name:"description",content:"Independent water dispense market intelligence, reports and consultancy covering BWD, POU and integrated tap systems across Europe, the USA and global markets."}),c.jsx("link",{rel:"canonical",href:"https://waterdispenseinsights.com/"})]}),c.jsx(Ooe,{}),c.jsx("section",{className:"py-12 md:py-16 bg-background","aria-label":"Quote",children:c.jsx("div",{className:"container mx-auto px-6",children:c.jsx(JW,{})})}),c.jsx(Foe,{}),c.jsx(Kde,{}),c.jsx("section",{className:"py-10 md:py-14 bg-background",children:c.jsx("div",{className:"container mx-auto px-6 max-w-4xl",children:c.jsx(IE,{})})}),c.jsx(Yhe,{}),c.jsx(kue,{}),c.jsx(Sue,{}),c.jsx(_ue,{}),c.jsx(Aue,{}),c.jsx("div",{className:"py-16 md:py-20 bg-gradient-subtle",children:c.jsx(n_,{})}),c.jsx(zde,{}),c.jsx(Hde,{}),c.jsx(qde,{}),c.jsx(Zde,{}),c.jsx(Mhe,{}),c.jsx(Ohe,{}),c.jsx(Fhe,{}),c.jsx(Cc,{})]}),Jhe=()=>{const t=Pd();return k.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),c.jsxs("main",{className:"flex min-h-screen items-center justify-center bg-muted",children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Page Not Found | Zenith Global Commercial"}),c.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"mb-4 text-4xl font-bold text-foreground",children:"404"}),c.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),c.jsx("a",{href:"/",target:"_blank",rel:"noopener noreferrer",className:"text-accent underline hover:text-accent/80",children:"Return to Home"})]})]})},efe=cp({email:Pn().trim().email("Invalid email address").max(255),password:Pn().trim().min(6,"Password must be at least 6 characters").max(100)});function tfe(){const t=Rd(),[e,n]=k.useState(""),[r,s]=k.useState(""),[i,a]=k.useState(!1),[o,l]=k.useState(!1),u=async()=>{const f=Pn().trim().email().safeParse(e);if(!f.success){te.error("Enter your email above first, then click Forgot password");return}l(!0);try{const{error:p}=await ce.auth.resetPasswordForEmail(f.data,{redirectTo:`${window.location.origin}/reset-password`});if(p){te.error("Could not send reset email",{description:p.message});return}te.success("Reset email sent",{description:"Check your inbox for a password reset link"})}finally{l(!1)}};k.useEffect(()=>{ce.auth.getSession().then(({data:{session:p}})=>{p&&t("/admin/dashboard")});const{data:{subscription:f}}=ce.auth.onAuthStateChange((p,m)=>{m&&t("/admin/dashboard")});return()=>f.unsubscribe()},[t]);const d=async f=>{f.preventDefault();const p=efe.safeParse({email:e,password:r});if(!p.success){te.error("Invalid input",{description:p.error.errors[0].message});return}a(!0);try{const{error:m}=await ce.auth.signInWithPassword({email:p.data.email,password:p.data.password});if(m){m.message.includes("Invalid login credentials")?te.error("Login failed",{description:"Invalid email or password"}):te.error("Login failed",{description:m.message});return}te.success("Login successful")}catch{te.error("An unexpected error occurred")}finally{a(!1)}};return c.jsxs("main",{className:"min-h-screen flex items-center justify-center bg-gradient-subtle p-4",children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Admin Login | Ze
604nith Global Commercial"}),c.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),c.jsxs(un,{className:"w-full max-w-md",children:[c.jsxs(Ys,{className:"text-center",children:[c.jsx("div",{className:"mx-auto w-12 h-12 bg-accent/10 rounded-full flex items-center justify-center mb-4",children:c.jsx(eb,{className:"w-6 h-6 text-accent"})}),c.jsx(Xs,{className:"text-2xl",children:"Admin Login"}),c.jsx(rl,{children:"Sign in to manage your website content"})]}),c.jsx(Nn,{children:c.jsxs("form",{onSubmit:d,className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"email",children:"Email"}),c.jsx(Ue,{id:"email",type:"email",placeholder:"[email protected]",value:e,onChange:f=>n(f.target.value),required:!0,className:"mt-2"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"password",children:"Password"}),c.jsx(Ue,{id:"password",type:"password",placeholder:"••••••••",value:r,onChange:f=>s(f.target.value),required:!0,className:"mt-2"})]}),c.jsx(oe,{type:"submit",className:"w-full",disabled:i,children:i?"Signing in...":"Sign In"}),c.jsx("button",{type:"button",onClick:u,disabled:o,className:"w-full text-sm text-muted-foreground hover:text-accent underline-offset-4 hover:underline transition-colors",children:o?"Sending reset email...":"Forgot password?"})]})})]})]})}var nfe=k.createContext(void 0);function PI(t){const e=k.useContext(nfe);return t||e||"ltr"}var EA="rovingFocusGroup.onEntryFocus",rfe={bubbles:!1,cancelable:!0},D0="RovingFocusGroup",[fN,eH,sfe]=sR(D0),[ife,tH]=il(D0,[sfe]),[afe,ofe]=ife(D0),nH=k.forwardRef((t,e)=>c.jsx(fN.Provider,{scope:t.__scopeRovingFocusGroup,children:c.jsx(fN.Slot,{scope:t.__scopeRovingFocusGroup,children:c.jsx(lfe,{...t,ref:e})})}));nH.displayName=D0;var lfe=k.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=t,p=k.useRef(null),m=bt(e,p),y=PI(i),[g,b]=dd({prop:a,defaultProp:o??null,onChange:l,caller:D0}),[x,w]=k.useState(!1),v=ga(u),S=eH(n),E=k.useRef(!1),[C,T]=k.useState(0);return k.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(EA,v),()=>P.removeEventListener(EA,v)},[v]),c.jsx(afe,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:g,onItemFocus:k.useCallback(P=>b(P),[b]),onItemShiftTab:k.useCallback(()=>w(!0),[]),onFocusableItemAdd:k.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:k.useCallback(()=>T(P=>P-1),[]),children:c.jsx(Fe.div,{tabIndex:x||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...t.style},onMouseDown:Ce(t.onMouseDown,()=>{E.current=!0}),onFocus:Ce(t.onFocus,P=>{const M=!E.current;if(P.target===P.currentTarget&&M&&!x){const R=new CustomEvent(EA,rfe);if(P.currentTarget.dispatchEvent(R),!R.defaultPrevented){const O=S().filter(z=>z.focusable),L=O.find(z=>z.active),U=O.find(z=>z.id===g),H=[L,U,...O].filter(Boolean).map(z=>z.ref.current);iH(H,d)}}E.current=!1}),onBlur:Ce(t.onBlur,()=>w(!1))})})}),rH="RovingFocusGroupItem",sH=k.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...o}=t,l=sd(),u=i||l,d=ofe(rH,n),f=d.currentTabStopId===u,p=eH(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:g}=d;return k.useEffect(()=>{if(r)return m(),()=>y()}
vendor: 4,735 bytes, line 604
604,[r,m,y]),c.jsx(fN.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:c.jsx(Fe.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...o,ref:e,onMouseDown:Ce(t.onMouseDown,b=>{r?d.onItemFocus(u):b.preventDefault()}),onFocus:Ce(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:Ce(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=dfe(b,d.orientation,d.dir);if(x!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let v=p().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")v.reverse();else if(x==="prev"||x==="next"){x==="prev"&&v.reverse();const S=v.indexOf(b.currentTarget);v=d.loop?hfe(v,S+1):v.slice(S+1)}setTimeout(()=>iH(v))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:g!=null}):a})})});sH.displayName=rH;var cfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ufe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function dfe(t,e,n){const r=ufe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cfe[r]}function iH(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function hfe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var ffe=nH,pfe=sH,DE="Tabs",[mfe,hAe]=il(DE,[tH]),aH=tH(),[gfe,RI]=mfe(DE),oH=k.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:o,activationMode:l="automatic",...u}=t,d=PI(o),[f,p]=dd({prop:r,onChange:s,defaultProp:i??"",caller:DE});return c.jsx(gfe,{scope:n,baseId:sd(),value:f,onValueChange:p,orientation:a,dir:d,activationMode:l,children:c.jsx(Fe.div,{dir:d,"data-orientation":a,...u,ref:e})})});oH.displayName=DE;var lH="TabsList",cH=k.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=RI(lH,n),a=aH(n);return c.jsx(ffe,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:c.jsx(Fe.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});cH.displayName=lH;var uH="TabsTrigger",dH=k.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=RI(uH,n),o=aH(n),l=pH(a.baseId,r),u=mH(a.baseId,r),d=r===a.value;return c.jsx(pfe,{asChild:!0,...o,focusable:!s,active:d,children:c.jsx(Fe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...i,ref:e,onMouseDown:Ce(t.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?a.onValueChange(r):f.preventDefault()}),onKeyDown:Ce(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(r)}),onFocus:Ce(t.onFocus,()=>{const f=a.activationMode!=="manual";!d&&!s&&f&&a.onValueChange(r)})})})});dH.displayName=uH;var hH="TabsContent",fH=k.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,o=RI(hH,n),l=pH(o.baseId,r),u=mH(o.baseId,r),d=r===o.value,f=k.useRef(d);return k.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(jd,{present:s||d,children:({present:p})=>c.jsx(Fe.div,{"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0},children:p&&i})})});fH.displayName=hH;function pH(t,e){return`${t}-trigger-${e}`}function mH(t,e){return`${t}-content-${e}`}var yfe=oH,gH=cH,yH=dH,xH=fH;const vH=yfe,II=k.forwardRef(({className:t,...e},n)=>c.jsx(gH,{ref:n,className:Oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));II.displayName=gH.displayName;const ni=k.forwardRef(({className:t,...e},n)=>c.jsx(yH,{ref:n,className:Oe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t),...e}));ni.displayName=yH.displayName;const ri=k.forwardRef(({className:t,...e},n)=>c.jsx(xH,{ref:n,className:Oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));ri.displayName=xH.displayName;const ca=k.forwardRef(({className:t,...e},n)=>c.jsx("textarea",{className:Oe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
604ing-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}));ca.displayName="Textarea";var ME="Switch",[xfe,fAe]=il(ME),[vfe,bfe]=xfe(ME),bH=k.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:l="on",onCheckedChange:u,form:d,...f}=t,[p,m]=k.useState(null),y=bt(e,v=>m(v)),g=k.useRef(!1),b=p?d||!!p.closest("form"):!0,[x,w]=dd({prop:s,defaultProp:i??!1,onChange:u,caller:ME});return c.jsxs(vfe,{scope:n,checked:x,disabled:o,children:[c.jsx(Fe.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":_H(x),"data-disabled":o?"":void 0,disabled:o,value:l,...f,ref:y,onClick:Ce(t.onClick,v=>{w(S=>!S),b&&(g.current=v.isPropagationStopped(),g.current||v.stopPropagation())})}),b&&c.jsx(SH,{control:p,bubbles:!g.current,name:r,value:l,checked:x,required:a,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});bH.displayName=ME;var wH="SwitchThumb",kH=k.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=bfe(wH,n);return c.jsx(Fe.span,{"data-state":_H(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});kH.displayName=wH;var wfe="SwitchBubbleInput",SH=k.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...s},i)=>{const a=k.useRef(null),o=bt(a,i),l=CI(n),u=CR(e);return k.useEffect(()=>{const d=a.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&m){const y=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(y)}},[l,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SH.displayName=wfe;function _H(t){return t?"checked":"unchecked"}var EH=bH,kfe=kH;const $f=k.forwardRef(({className:t,...e},n)=>c.jsx(EH,{className:Oe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",t),...e,ref:n,children:c.jsx(kfe,{className:Oe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));$f.displayName=EH.displayName;const Sfe=1,_fe="10813d83-b305-4695-b4a6-ef4006a9cc32",Efe="3f9a82a5-d0b2-4316-963e-c28da70ebb78",Cfe="/__l5e/assets-v1/10813d83-b305-4695-b4a6-ef4006a9cc32/Zenith_Water_Dispense_Country_Report_SAMPLE.pdf",Afe="a/v1/3f9a82a5-d0b2-4316-963e-c28da70ebb78/10813d83-b305-4695-b4a6-ef4006a9cc32/Zenith_Water_Dispense_Country_Report_SAMPLE.pdf",Tfe="Zenith_Water_Dispense_Country_Report_SAMPLE.pdf",jfe=2174036,Nfe="application/pdf",Pfe="2026-07-13T12:27:20Z",Rfe={version:Sfe,asset_id:_fe,project_id:Efe,url:Cfe,r2_key:Afe,original_filename:Tfe,size:jfe,content_type:Nfe,created_at:Pfe},Ife=1,Dfe="78b58747-5002-49bb-89e6-c106c5cedca2",Mfe="3f9a82a5-d0b2-4316-963e-c28da70ebb78",Ofe="/__l5e/assets-v1/78b58747-5002-49bb-89e6-c106c5cedca2/Zenith_Water_Dispense_Data_Report_SAMPLE.pdf",Lfe="a/v1/3f9a82a5-d0b2-4316-963e-c28da70ebb78/78b58747-5002-49bb-89e6-c106c5cedca2/Zenith_Water_Dispense_Data_Report_SAMPLE.pdf",Ffe="Zenith_Water_Dispense_Data_Report_SAMPLE.pdf",Bfe=2716249,$fe="application/pdf",Ufe="2026-07-13T12:27:24Z",zfe={version:Ife,asset_id:Dfe,project_id:Mfe,url:Ofe,r2_key:Lfe,original_filename:Ffe,size:Bfe,content_type:$fe,created_at:Ufe},Vfe=1,Wfe="9b0ca541-3ab4-4a81-b9e4-8a2963d4f591",Hfe="3f9a82a5-d0b2-4316-963e-c28da70ebb78",qfe="/__l5e/assets-v1/9b0ca541-3ab4-4a81-b9e4-8a2963d4f591/Zenith_US_Water_Dispense_Report_SAMPLE.pdf",Gfe="a/v1/3f9a82a5-d0b2-4316-963e-c28da70ebb78/9b0ca541-3ab4-4a81-b9e4-8a2963d4f591/Zenith_US_Water_Dispense_Report_SAMPLE.pdf",Kfe="Zenith_US_Water_Dispense_Report_SAMPLE.pdf",Yfe=5631465,Xfe="application/pdf",Zfe="2026-07-13T13:41:37Z",Qfe={ver
604sion:Vfe,asset_id:Wfe,project_id:Hfe,url:qfe,r2_key:Gfe,original_filename:Kfe,size:Yfe,content_type:Xfe,created_at:Zfe},CH=Rfe.url,AH=zfe.url,TH=Qfe.url;function Jfe(t){return t==="usa"?TH:t==="data"?AH:CH}const yb=[{id:"single",label:"Single-user licence",shortLabel:"Single-user",multiplier:1,description:"One named user"},{id:"departmental",label:"Departmental licence",shortLabel:"Departmental",multiplier:1.5,description:"Up to one department / team"},{id:"global",label:"Global corporate licence",shortLabel:"Global corporate",multiplier:2,description:"Entire organisation, worldwide"}];function epe(t){return yb.find(e=>e.id===t)||yb[0]}function jv(t,e){const n=epe(e);return Math.round(t*n.multiplier/100)*100}function bd(t,e="gbp"){return new Intl.NumberFormat("en-GB",{style:"currency",currency:e.toUpperCase(),minimumFractionDigits:0,maximumFractionDigits:0}).format(t/100)}const tpe={"west-europe":"West Europe bundle","east-europe":"East Europe bundle","pan-europe":"Pan-European bundle",country:"Country market",data:"Data report",usa:"USA",japan:"Japan",turkey:"Turkey","south-korea":"South Korea",uae:"UAE"};function lm(t,e){return(t==="country"||t==="data")&&e?e:tpe[t]||t}const npe=new Set(["west-europe","east-europe","pan-europe"]);function DI(t){return npe.has(t)}const rpe=new Set([]);function MI(t){return rpe.has(t)}function jH(t){return DI(t)||MI(t)}const ld="[email protected]",NH="Regional bundle enquiry — Zenith Water Dispense",spe=["All country reports in the region","Regional Power BI dashboard","Full Excel database for the region","Access to the full Zenith Infographs library","Private consulting support with Ákos Petri","Early access to the next annual update","Cross-market benchmarking & regional insights"],xb=new Set(["Austria","Belgium","Denmark","Finland","France","Germany","Greece","Ireland","Italy","Netherlands","Norway","Portugal","Spain","Sweden","Switzerland","United Kingdom"]),vb=new Set(["Belarus","Bulgaria","Croatia","Czech Republic","Estonia","Hungary","Latvia","Lithuania","Poland","Romania","Russia","Serbia","Slovakia","Slovenia","Ukraine"]),n4={"pan-europe":0,"west-europe":1,"east-europe":2,usa:3};function bb(t){return[...t].sort((e,n)=>{const r=n4[e.region]??100,s=n4[n.region]??100;return r!==s?r-s:e.title.localeCompare(n.title)})}async function OE(t,e){if(!t)return null;if(t.startsWith("http")||t.startsWith("/"))return t;const n=e?{transform:e}:void 0,{data:r}=await ce.storage.from("report-covers").createSignedUrl(t,60*60,n);return(r==null?void 0:r.signedUrl)||null}async function ipe(t){if(!t)return null;if(t.startsWith("http")||t.startsWith("/"))return t;const{data:e}=await ce.storage.from("report-samples").createSignedUrl(t,60*60);return(e==null?void 0:e.signedUrl)||null}const ape=[{id:"west-europe",label:"West Europe bundle"},{id:"east-europe",label:"East Europe bundle"},{id:"country",label:"Country market report"},{id:"data",label:"Data report"},{id:"usa",label:"USA"},{id:"japan",label:"Japan"},{id:"turkey",label:"Turkey"}];function ope(){const[t,e]=k.useState([]),[n,r]=k.useState(!0),[s,i]=k.useState(null),[a,o]=k.useState(!1),l=async()=>{r(!0);const{data:d,error:f}=await ce.from("reports").select("*").order("display_order");f?te.error(f.message):e(d||[]),r(!1)};k.useEffect(()=>{l()},[]);const u=async d=>{const{error:f}=await ce.from("reports").update({published:!d.published}).eq("id",d.id);f?te.error(f.message):(te.success(d.published?"Unpublished":"Published"),l())};return c.jsxs("div",{children:[c.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-serif text-2xl",children:"Reports store"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage the report catalog at /reports"})]}),c.jsxs(oe,{onClick:()=>o(!0),children:[c.jsx(Sy,{className:"mr-2 size-4"})," New report"]})]}),n?c.jsx("div",{className:"flex justify-center py-12",children:c.jsx(ap,{className:"size-6 animate-spin text-muted-foreground"})}):c.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-muted/50 text-left text-xs uppercase tracking-wider text-muted-foreground",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-3",children:"Title"}),c.jsx("th",{className:"px-4 py-3",children:"Region"}),c.jsx("th",{className:"px-4 py-3",children:"Price"}),c.jsx("th",{className:"px-4 py-3",children:"Order"}),c.jsx("th",{className:"px-4 py-3",children:"Published"}),c.jsx("th",{className:"px-4 py-3"})]})}),c.jsx("tbody",{children:t.map(d=>c.jsxs("tr",{className:"border-t border-border",children:[c.jsxs("td",{className:"px-4 py-2.5",children:[c.jsx("p",{className:"font-semibold",children:d.title}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["/reports/",d.slug]})]}),c.jsx("td",{className:"px-4 py-2.5 text-muted-foreground",children:lm(d.region,d.country)}),c.jsx("td",{className:"px-4 py-2.5",children:bd(d.price_cents,d.currency)}),c.jsx("td",{className:"px-4 py-2.5 text-muted-foreground",children:d.display_order}),c.jsx("td",{className:"px-4 py-2.5",children:c.jsx($f,{checked:d.published,onCheckedChange:()=>u(d)})}),c.jsx("td",{className:"px-4 py-2.5 text-right",children:c.jsxs("div",{className:"inline-flex gap-1",children:[c.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>i(d),children:c.jsx(hR,{className:"size-4"})}),c.jsx("a",{href:`/reports/${d.slug}`,target:"_blank",rel:"noopener noreferrer",children:c.jsx(oe,{size:"sm",variant:"ghost",children:c.jsx(cE,{className:"size-4"})})})]})})]},d.id))})]})}),(s||a)&&c.jsx(lpe,{report:s,onClose:()=>{i(null),o(!1)},onSaved:()=>{i(null),o(!1),l()}})]})}function lpe({report:t,onClose:e,onSaved:n}){const[r,s]=k.useState({slug:(t==null?void 0:t.slug)||"",title:(t==null?void 0:t.t
604itle)||"",subtitle:(t==null?void 0:t.subtitle)||"",region:(t==null?void 0:t.region)||"country",country:(t==null?void 0:t.country)||"",price_cents:(t==null?void 0:t.price_cents)||0,currency:(t==null?void 0:t.currency)||"gbp",cover_image_url:(t==null?void 0:t.cover_image_url)||"",sample_pdf_url:(t==null?void 0:t.sample_pdf_url)||"",deliverable_pdf_url:(t==null?void 0:t.deliverable_pdf_url)||"",short_description:(t==null?void 0:t.short_description)||"",market_overview:(t==null?void 0:t.market_overview)||"",long_description:(t==null?void 0:t.long_description)||"",highlights:((t==null?void 0:t.highlights)||[]).join(`
605`),includes_powerbi:(t==null?void 0:t.includes_powerbi)||!1,includes_excel:(t==null?void 0:t.includes_excel)||!1,page_count:(t==null?void 0:t.page_count)||0,display_order:(t==null?void 0:t.display_order)||0,seo_title:(t==null?void 0:t.seo_title)||"",seo_description:(t==null?void 0:t.seo_description)||"",published:(t==null?void 0:t.published)||!1}),[i,a]=k.useState(!1),o=async(u,d,f)=>{const p=(r.slug||crypto.randomUUID()).toLowerCase().replace(/[^a-z0-9-_]+/g,"-").replace(/^-+|-+$/g,"")||crypto.randomUUID(),m=u.name.normalize("NFKD").replace(/[^\w.\-]+/g,"-").replace(/-+/g,"-"),y=`${p}/${Date.now()}-${m}`,{error:g}=await ce.storage.from(d).upload(y,u,{upsert:!0,contentType:u.type||void 0});if(g){console.error("Storage upload failed",{bucket:d,path:y,error:g}),te.error(`Upload failed: ${g.message}`);return}s(b=>({...b,[f]:y})),te.success("Uploaded")},l=async()=>{a(!0);const u={slug:r.slug,title:r.title,subtitle:r.subtitle||null,region:r.region,country:r.country||null,price_cents:Number(r.price_cents)||0,currency:r.currency||"gbp",cover_image_url:r.cover_image_url||null,sample_pdf_url:r.sample_pdf_url||null,deliverable_pdf_url:r.deliverable_pdf_url||null,short_description:r.short_description||null,market_overview:r.market_overview||null,long_description:r.long_description||null,highlights:r.highlights.split(`
606`).map(f=>f.trim()).filter(Boolean),includes_powerbi:r.includes_powerbi,includes_excel:r.includes_excel,page_count:Number(r.page_count)||null,display_order:Number(r.display_order)||0,seo_title:r.seo_title||null,seo_description:r.seo_description||null,published:r.published};let d;if(t){const{error:f}=await ce.from("reports").update(u).eq("id",t.id);d=f}else{const{error:f}=await ce.from("reports").insert(u);d=f}a(!1),d?te.error(d.message):(te.success("Saved"),n())};return c.jsx(md,{open:!0,onOpenChange:e,children:c.jsxs(yc,{className:"max-h-[90vh] max-w-3xl overflow-y-auto",children:[c.jsx(gd,{children:c.jsx(yd,{children:t?"Edit report":"New report"})}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx(Se,{children:"Title"}),c.jsx(Ue,{value:r.title,onChange:u=>s({...r,title:u.target.value})})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Slug"}),c.jsx(Ue,{value:r.slug,onChange:u=>s({...r,slug:u.target.value})})]})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Subtitle"}),c.jsx(Ue,{value:r.subtitle,onChange:u=>s({...r,subtitle:u.target.value})})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[c.jsxs("div",{children:[c.jsx(Se,{children:"Region"}),c.jsx("select",{value:r.region,onChange:u=>s({...r,region:u.target.value}),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",children:ape.map(u=>c.jsx("option",{value:u.id,children:u.label},u.id))})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Country"}),c.jsx(Ue,{value:r.country,onChange:u=>s({...r,country:u.target.value})})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Display order"}),c.jsx(Ue,{type:"number",value:r.display_order,onChange:u=>s({...r,display_order:Number(u.target.value)})})]})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[c.jsxs("div",{children:[c.jsx(Se,{children:"Price (cents)"}),c.jsx(Ue,{type:"number",value:r.price_cents,onChange:u=>s({...r,price_cents:Number(u.target.value)})}),c.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["= ",bd(Number(r.price_cents)||0,r.currency)]})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Currency"}),c.jsx(Ue,{value:r.currency,onChange:u=>s({...r,currency:u.target.value})})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Page count"}),c.jsx(Ue,{type:"number",value:r.page_count,onChange:u=>s({...r,page_count:Number(u.target.value)})})]})]}),c.jsxs("div",{className:"flex flex-wrap gap-6",children:[c.jsxs("label",{className:"flex items-center gap-2",children:[c.jsx($f,{checked:r.includes_powerbi,onCheckedChange:u=>s({...r,includes_powerbi:u})}),c.jsx("span",{className:"text-sm",children:"Includes Power BI"})]}),c.jsxs("label",{className:"flex items-center gap-2",children:[c.jsx($f,{checked:r.includes_excel,onCheckedChange:u=>s({...r,includes_excel:u})}),c.jsx("span",{className:"text-sm",children:"Includes Excel database"})]}),c.jsxs("label",{className:"flex items-center gap-2",children:[c.jsx($f,{checked:r.published,onCheckedChange:u=>s({...r,published:u})}),c.jsx("span",{className:"text-sm",children:"Published"})]})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Short description (store card)"}),c.jsx(ca,{rows:2,value:r.short_description,onChange:u=>s({...r,short_description:u.target.value})})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Market overview (SEO copy, blank line between paragraphs)"}),c.jsx(ca,{rows:8,value:r.market_overview,onChange:u=>s({...r,market_overview:u.target.value})})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Long description (detail page)"}),c.jsx(ca,{rows:6,value:r.long_description,onChange:u=>s({...r,long_description:u.target.value})})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Highlights (one per line)"}),c.jsx(ca,{rows:4,value:r.highlights,onChange:u=>s({...r,highlights:u.target.value})})]}),c.jsxs("div",{className:"grid gap-3 rounded-md border border-border p-3",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Uploads"}),c.jsx(CA,{label:"Cover image",path:r.cover_image_url,accept:"image/*",onUpload:u=>o(u,"report-covers","cover_image_url"),onClear:()=>s({...r,cover_image_url:""})}),c.jsx(CA,{label:"Sample PDF (public preview)",path:r.sample_pdf_url,accept:"application/pdf",onUpload:u=>o(u,"report-samples","sample_pdf_url"),onClear:()=>s({...r,sample_pdf_url:""})}),c.jsx(CA,{label:"Full deliverable PDF (private, sent to buyers)",path:r.deliverable_pdf_url,accept:"application/pdf",onUpload:u=>o(u,"report-deliverables","deliverable_pdf_url"),onClear:()=>s({...r,deliverable_pdf_url:""})})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx(Se,{children:"SEO title"}),c.jsx(Ue,{value:r.seo_title,onChange:u=>s({...r,seo_title:u.target.value})})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"SEO description"}),c.jsx(Ue,{value:r.seo_description,onChange:u=>s({...r,seo_description:u.target.value})})]})]})]}),c.jsxs(Ny,{children:[c.jsx(oe,{variant:"ghost",onClick:e,children:"Cancel"}),c.jsx(oe,{onClick:l,disabled:i,children:i?c.jsx(ap,{className:"size-4 animate-spin"}):"Save"})]})]})})}function CA({label:t,path:e,accept:n,onUpload:r,onClear:s}){return c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-sm font-medium",children:t}),c.jsx("p",{className:"truncate text-xs text-muted-foreground",children:e||"No file"})]}),e&&c.jsx(oe,{size:"sm",variant:"ghost",onClick:s,children:"Clear"}),c.jsxs("label",{className:"inline-flex cursor-pointer items-center gap-1.5 rounded-md border border-input bg-background px-3 py-1.5 text-sm hover:bg-muted",children:[c.jsx(yR,{className:"size-3.5"})," Upload",c.jsx("input",{type:"file",accept:n,className:"hidden",onChange:i=>{var o;const a=(o=i.target.files)==null?void 0:o[0];a&&r(a)}})]})]})}const cpe=oE("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 Yo({className:t,variant:e,...n}){return c.jsx("div",{className:Oe(cpe({variant:e}),t),...n})}function Ot(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 wd(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const PH=6048e5,upe=864e5,N1=43200,r4=1440;let dpe={};function M0(){return dpe}function wb(t,e){var o,l,u,d;const n=M0(),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??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,s=Ot(t),i=s.getDay(),a=(i<r?7:0)+i-r;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function r_(t){return wb(t,{weekStartsOn:1}
606)}function RH(t){const e=Ot(t),n=e.getFullYear(),r=wd(t,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=r_(r),i=wd(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const a=r_(i);return e.getTime()>=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function s4(t){const e=Ot(t);return e.setHours(0,0,0,0),e}function s_(t){const e=Ot(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 hpe(t,e){const n=s4(t),r=s4(e),s=+n-s_(n),i=+r-s_(r);return Math.round((s-i)/upe)}function fpe(t){const e=RH(t),n=wd(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),r_(n)}function kk(t,e){const n=Ot(t),r=Ot(e),s=n.getTime()-r.getTime();return s<0?-1:s>0?1:s}function ppe(t){return wd(t,Date.now())}function mpe(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function gpe(t){if(!mpe(t)&&typeof t!="number")return!1;const e=Ot(t);return!isNaN(Number(e))}function ype(t,e){const n=Ot(t),r=Ot(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function xpe(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function vpe(t,e){return+Ot(t)-+Ot(e)}function bpe(t){const e=Ot(t);return e.setHours(23,59,59,999),e}function wpe(t){const e=Ot(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function kpe(t){const e=Ot(t);return+bpe(e)==+wpe(e)}function Spe(t,e){const n=Ot(t),r=Ot(e),s=kk(n,r),i=Math.abs(ype(n,r));let a;if(i<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*i);let o=kk(n,r)===-s;kpe(Ot(t))&&i===1&&kk(t,r)===1&&(o=!1),a=s*(i-Number(o))}return a===0?0:a}function _pe(t,e,n){const r=vpe(t,e)/1e3;return xpe(n==null?void 0:n.roundingMethod)(r)}function Epe(t){const e=Ot(t),n=wd(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Cpe={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"}},Ape=(t,e,n)=>{let r;const s=Cpe[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function AA(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Tpe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},jpe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Npe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ppe={date:AA({formats:Tpe,defaultWidth:"full"}),time:AA({formats:jpe,defaultWidth:"full"}),dateTime:AA({formats:Npe,defaultWidth:"full"})},Rpe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ipe=(t,e,n,r)=>Rpe[t];function kx(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):a;s=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[o]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const Dpe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Mpe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ope={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"]},Lpe={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
606ay","Saturday"]},Fpe={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"}},Bpe={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"}},$pe=(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"},Upe={ordinalNumber:$pe,era:kx({values:Dpe,defaultWidth:"wide"}),quarter:kx({values:Mpe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:kx({values:Ope,defaultWidth:"wide"}),day:kx({values:Lpe,defaultWidth:"wide"}),dayPeriod:kx({values:Fpe,defaultWidth:"wide",formattingValues:Bpe,defaultFormattingWidth:"wide"})};function Sx(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const a=i[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(o)?Vpe(o,f=>f.test(a)):zpe(o,f=>f.test(a));let u;u=t.valueCallback?t.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=e.slice(a.length);return{value:u,rest:d}}}function zpe(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Vpe(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Wpe(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const o=e.slice(s.length);return{value:a,rest:o}}}const Hpe=/^(\d+)(th|st|nd|rd)?/i,qpe=/\d+/i,Gpe={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},Kpe={any:[/^b/i,/^(a|c)/i]},Ype={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Xpe={any:[/1/i,/2/i,/3/i,/4/i]},Zpe={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},Qpe={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]},Jpe={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},eme={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]},tme={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},nme={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}},rme={ordinalNumber:Wpe({matchPattern:Hpe,parsePattern:qpe,valueCallback:t=>parseInt(t,10)}),era:Sx({matchPatterns:Gpe,defaultMatchWidth:"wide",parsePatterns:Kpe,defaultParseWidth:"any"}),quarter:Sx({matchPatterns:Ype,defaultMatchWidth:"wide",parsePatterns:Xpe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Sx({matchPatterns:Zpe,defaultMatchWidth:"wide",parsePatterns:Qpe,defaultParseWidth:"any"}),day:Sx({matchPatterns:Jpe,defaultMatchWidth:"wide",parsePatterns:eme,defaultParseWidth:"any"}),dayPeriod:Sx({matchPatterns:tme,defaultMatchWidth:"any",parsePatterns:nme,defaultParseWidth:"any"})},IH={code:"en-US",formatDistance:Ape,formatLong:Ppe,formatRelative:Ipe,localize:Upe,match:rme,options:{weekStartsOn:0,firstWeekContainsDate:1}};function sme(t){const e=Ot(t);return hpe(e,Epe(e))+1}function ime(t){const e=Ot(t),n=+r_(e)-+fpe(e);return Math.round(n/PH)+1}function DH(t,e){var d,f,p,m;const n=Ot(t),r=n.getFullYear(),s=M0(),i=(e==null?void 0:e.firstWeekContainsDate)??((f=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(p=s.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??1,a=wd(t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const o=wb(a,e),l=wd(t,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const u=wb(l,e);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function ame(t,e){var o,l,u,d;const n=M0(),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??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,s=DH(t,e),i=wd(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),wb(i,e)}function ome(t,e){const n=Ot(t),r=+wb(n,e)-+ame(n,e);return Math.round(r/PH)+1}function St(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const Rc={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return St(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):St(n+1,2)},d(t,e){return St(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 St(t.getHours()%12||12,e.length)},H(t,e){return St(t.getHours(),e.length)},m(t,e){return St(t.getMinutes(),e.length)},s(t,e){return St(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return St(s,e.length)}},Ep={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},i4={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(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Rc.y(t,e)},Y:function(t,e,n,r){const s=DH(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return St(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):St(i,e.length)},R:function(t,e){const n=RH(t);return St(n,e.length)},u:function(t,e){const n=t.getFullYear();return St(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 St(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 St(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 Rc.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 St(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 s=ome(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):St(s,e.length)},I:function(t,e,n){const r=ime(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):St(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Rc.d(t,e)},D:function(t,e,n){const r=sme(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):St(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 s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return St(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return St(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return St(s,e.length);case"io":return n.ordinalNumber(s,{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 s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=Ep.noon:r===0?s=Ep.midnight:s=r/12>
vendor: 4,427 bytes, line 606
606=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=Ep.evening:r>=12?s=Ep.afternoon:r>=4?s=Ep.morning:s=Ep.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{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 Rc.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Rc.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Rc.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Rc.s(t,e)},S:function(t,e){return Rc.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return o4(r);case"XXXX":case"XX":return Jd(r);case"XXXXX":case"XXX":default:return Jd(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return o4(r);case"xxxx":case"xx":return Jd(r);case"xxxxx":case"xxx":default:return Jd(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+a4(r,":");case"OOOO":default:return"GMT"+Jd(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+a4(r,":");case"zzzz":default:return"GMT"+Jd(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return St(r,e.length)},T:function(t,e,n){const r=t.getTime();return St(r,e.length)}};function a4(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+St(i,2)}function o4(t,e){return t%60===0?(t>0?"-":"+")+St(Math.abs(t)/60,2):Jd(t,e)}function Jd(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=St(Math.trunc(r/60),2),i=St(r%60,2);return n+s+e+i}const l4=(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"})}},MH=(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"})}},lme=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return l4(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",l4(r,e)).replace("{{time}}",MH(s,e))},cme={p:MH,P:lme},ume=/^D+$/,dme=/^Y+$/,hme=["D","DD","YY","YYYY"];function fme(t){return ume.test(t)}function pme(t){return dme.test(t)}function mme(t,e,n){const r=gme(t,e,n);if(console.warn(r),hme.includes(t))throw new RangeError(r)}function gme(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 yme=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xme=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vme=/^'([^]*?)'?$/,bme=/''/g,wme=/[a-zA-Z]/;function kme(t,e,n){var d,f,p,m;const r=M0(),s=r.locale??IH,i=r.firstWeekContainsDate??((f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,a=r.weekStartsOn??((m=(p=r.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??0,o=Ot(t);if(!gpe(o))throw new RangeError("Invalid time value");let l=e.match(xme).map(y=>{const g=y[0];if(g==="p"||g==="P"){const b=cme[g];return b(y,s.formatLong)}return y}).join("").match(yme).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:Sme(y)};if(i4[g])return{isToken:!0,value:y};
606if(g.match(wme))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const u={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return l.map(y=>{if(!y.isToken)return y.value;const g=y.value;(pme(g)||fme(g))&&mme(g,e,String(t));const b=i4[g[0]];return b(o,g,s.localize,u)}).join("")}function Sme(t){const e=t.match(vme);return e?e[1].replace(bme,"'"):t}function _me(t,e,n){const r=M0(),s=(n==null?void 0:n.locale)??r.locale??IH,i=2520,a=kk(t,e);if(isNaN(a))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:a});let l,u;a>0?(l=Ot(e),u=Ot(t)):(l=Ot(t),u=Ot(e));const d=_pe(u,l),f=(s_(u)-s_(l))/1e3,p=Math.round((d-f)/60);let m;if(p<2)return n!=null&&n.includeSeconds?d<5?s.formatDistance("lessThanXSeconds",5,o):d<10?s.formatDistance("lessThanXSeconds",10,o):d<20?s.formatDistance("lessThanXSeconds",20,o):d<40?s.formatDistance("halfAMinute",0,o):d<60?s.formatDistance("lessThanXMinutes",1,o):s.formatDistance("xMinutes",1,o):p===0?s.formatDistance("lessThanXMinutes",1,o):s.formatDistance("xMinutes",p,o);if(p<45)return s.formatDistance("xMinutes",p,o);if(p<90)return s.formatDistance("aboutXHours",1,o);if(p<r4){const y=Math.round(p/60);return s.formatDistance("aboutXHours",y,o)}else{if(p<i)return s.formatDistance("xDays",1,o);if(p<N1){const y=Math.round(p/r4);return s.formatDistance("xDays",y,o)}else if(p<N1*2)return m=Math.round(p/N1),s.formatDistance("aboutXMonths",m,o)}if(m=Spe(u,l),m<12){const y=Math.round(p/N1);return s.formatDistance("xMonths",y,o)}else{const y=m%12,g=Math.trunc(m/12);return y<3?s.formatDistance("aboutXYears",g,o):y<9?s.formatDistance("overXYears",g,o):s.formatDistance("almostXYears",g+1,o)}}function c4(t,e){return _me(t,ppe(t),e)}const u4=(t,e)=>new Intl.NumberFormat("en-GB",{style:"currency",currency:(e||"gbp").toUpperCase(),maximumFractionDigits:0}).format((t||0)/100);function Eme(){const[t,e]=k.useState([]),[n,r]=k.useState(!0),[s,i]=k.useState("unresolved"),[a,o]=k.useState(""),[l,u]=k.useState({}),d=async()=>{r(!0);const{data:g,error:b}=await ce.from("orders").select("*, order_items(*)").order("created_at",{ascending:!1}).limit(200);b?te.error("Failed to load orders",{description:b.message}):e(g||[]),r(!1)};k.useEffect(()=>{d()},[]);const f=async(g,b)=>{const{data:{user:x}}=await ce.auth.getUser(),{error:w}=await ce.from("orders").update({resolved:b,resolved_at:b?new Date().toISOString():null,resolved_by:b?(x==null?void 0:x.id)??null:null,admin_notes:l[g.id]??g.admin_notes}).eq("id",g.id);w?te.error("Update failed",{description:w.message}):(te.success(b?"Marked resolved":"Reopened"),d())},p=async g=>{const b=l[g.id]??g.admin_notes??"",{error:x}=await ce.from("orders").update({admin_notes:b}).eq("id",g.id);x?te.error("Save failed",{description:x.message}):te.success("Notes saved")},m=t.filter(g=>{if(s==="unresolved"&&g.resolved||s==="resolved"&&!g.resolved)return!1;if(a){const b=a.toLowerCase();if(![g.customer_email,g.customer_name,g.customer_company,...(g.order_items||[]).map(w=>w.report_title)].filter(Boolean).join(" ").toLowerCase().includes(b))return!1}return!0}),y=t.filter(g=>!g.resolved&&g.status==="paid").length;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-3xl font-bold text-foreground",children:"Report orders"}),c.jsxs("p",{className:"text-muted-foreground mt-1",children:["Each paid order stays unresolved until you mark it done."," ",c.jsxs("span",{className:"font-medium text-foreground",children:[y," awaiting fulfilment"]})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx(fR,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ue,{value:a,onChange:g=>o(g.target.value),placeholder:"Search email, name, report…",className:"pl-9 w-64"})]}),c.jsx("div",{className:"flex rounded-md border overflow-hidden",children:["unresolved","resolved","all"].map(g=>c.jsx("button",{onClick:()=>i(g),className:`px-3 py-1.5 text-sm capitalize transition-colors ${s===g?"bg-primary text-primary-foreground":"bg-background hover:bg-muted"}`,children:g},g))})]})]}),n?c.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading orders…"}):m.length===0?c.jsx(un,{children:c.jsxs(Nn,{className:"py-12 text-center text-muted-foreground",children:[c.jsx(PU,{className:"w-8 h-8 mx-auto mb-3 opacity-40"}),"No orders match."]})}):c.jsx("div",{className:"space-y-4",children:m.map(g=>c.jsxs(un,{className:g.resolved?"opacity-70":"",children:[c.jsx(Ys,{className:"pb-3",children:c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsxs(Xs,{className:"text-lg flex items-center gap-2 flex-wrap",children:[g.customer_name||g.customer_email||"Unknown customer",g.resolved?c.jsxs(Yo,{variant:"secondary",className:"gap-1",children:[c.jsx(jS,{className:"w-3 h-3"})," Resolved"]}):c.jsx(Yo,{variant:"destructive",children:"Unresolved"}),g.status!=="paid"&&c.jsx(Yo,{variant:"outline",children:g.status})]}),c.jsxs("div",{className:"text-sm text-muted-foreground mt-1 flex flex-wrap gap-x-4 gap-y-1",children:[g.customer_email&&c.jsxs("a",{href:`mailto:${g.customer_email}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:text-foreground",children:[c.jsx(fc,{className:"w-3 h-3"}),g.customer_email]}),g.customer_company&&c.jsx("span",{children:g.customer_company}),c.jsx("span",{children:c4(new Date(g.created_at),{addSuffix:!0})})]})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"text-xl font-semibold",children:u4(g.subtotal_cents,g.currency)}),c.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:["#",g.id.slice(0,8)]})]})]})}),c.jsxs(Nn,{className:"space-y-3",children:[c.jsx("div",{className:"rounded-md border bg-muted/40 divide-y",children:(g.order_items||[]).map(b=>c.jsxs("div",{className:"flex items-center justify-between px-3 py-2 text-sm",children:[c.jsx("span",{children:b.report_title}),c.jsx("span",{className:"font-medium",children:u4(b.price_cents,b.currency)})]},b.id))}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Fulfilment notes"}),c.jsx(ca,{rows:2,defaultValue:g.admin_notes||"",onChange:b=>u(x=>({...x,[g.id]:b.target.value})),placeholder:"e.g. Sent PDF + Excel via WeTransfer at 14:20"}),c.jsxs("div",{className:"flex justify-between items-center gap-2",children:[c.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>p(g),children:"Save notes"}),g.resolved?c.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>f(g,!1),children:[c.jsx(PZ,{className:"w-4 h-4 mr-1"})," Reopen"]}):c.jsxs(oe,{size:"sm",onClick:()=>f(g,!0),children:[c.jsx(jS,{className:"w-4 h-4 mr-1"})," Mark resolved"]})]}),g.resolved_at&&c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Resolved ",c4(new Date(g.resolved_at),{addSuffix:!0})]})]})]})]},g.id))})]})}function Cme({websites:t,onUpdate:e}){const n=Rd();return c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:t.map(r=>{var s;return c.jsxs(un,{className:"hover:shadow-lg transition-shadow",children:[c.jsx(Ys,{children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(_0,{className:"w-5 h-5 text-accent"}),c.jsxs("div",{children:[c.jsx(Xs,{className:"text-lg",children:r.name}),c.jsx(rl,{className:"text-sm mt-1",children:r.domain})]})]}),c.jsx(Yo,{variant:r.is_active?"default":"secondary",children:r.is_active?"Active":"Inactive"})]})}),c.jsx(Nn,{children:c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"text-sm text-muted-foreground",children:[c.jsx("span",{className:"font-medium",children:"Owner:"})," ",((s=r.owner)==null?void 0:s.email)||"No owner assigned"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(oe,{size:"sm",variant:"outline",className:"flex-1",onClick:()=>n(`/admin/website/${r.id}`),children:[c.jsx(RZ,{className:"w-4 h-4 mr-2"}),"Manage"]}),c.jsx(oe,{size:"sm",variant:"outline",onClick:()=>window.open(`https://${r.domain}`,"_blank"),children:c.jsx(uR,{className:"w-4 h-4"})})]})]})})]},r.id)})})}const Ame=cp({name:Pn().trim().min(1,"Website name is required").max(100),domain:Pn().trim().min(1,"Domain is required").max(200),ownerEmail:Pn().trim().email("Invalid email address").max(255),ownerName:Pn().trim().min(1,"Owner name is required").max(100)});function Tme({open:t,onOpenChange:e,onSuccess:n}){const[r,s]=k.useState({name:"",domain:"",ownerEmail:"",ownerName:""}),[i,a]=k.useState(null),[o,l]=k.useState(!1),u=()=>{const y="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*";let g="";for(let b=0;b<12;b++)g+=y.charAt(Math.floor(Math.random()*y.length));return g},d=async m=>{m.preventDefault();const y=Ame.safeParse(r);if(!y.success){te.error("Invalid input",{description:y.error.errors[0].message});return}l(!0);try{const g=u(),{data:b,error:x}=await ce.functions.invoke("create-site-owner",{body:{email:y.data.ownerEmail,password:g,name:y.data.ownerName,websiteName:y.data.name,domain:y.data.domain}});if(x)throw x;if(!b.success)throw new Error(b.error||"Failed to create website");a(g),te.success("Website created successfully!");const w=r.ownerEmail;s({name:"",domain:"",ownerEmail:w,ownerName:""}),n()}catch(g){te.error("Failed to create website",{description:g.message})}finally{l(!1)}},f=()=>{a(null),e(!1)},p=m=>{navigator.clipboard.writeText(m),te.success("Copied to clipboard!")};return c.jsx(md,{open:t,onOpenChange:f,children:c.jsxs(yc,{className:"sm:max-w-[500px]",children:[c.jsxs(gd,{children:[c.jsx(yd,{children:"Create New Website"}),c.jsx(Xf,{children:"Add a new website and create an owner account with auto-generated credentials."})]}),i?c.jsxs("div",{className:"space-y-4 py-4",children:[c.jsxs("div",{className:"bg-accent/10 border border-accent/20 rounded-lg p-4 space-y-3",children:[c.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Website created successfully! Here are the login credentials:"}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{children:[c.jsx(Se,{className:"text-xs text-muted-foreground",children:"Email"}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsx("code",{className:"flex-1 bg-background px-3 py-2 rounded text-sm",children:r.ownerEmail}),c.jsx(oe,{size:"sm",variant:"outline",onClick:()=>p(r.ownerEmail),children:"Copy"})]})]}),c.jsxs("div",{children:[c.jsx(Se,{className:"text-xs text-muted-foreground",children:"Password"}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsx("code",{className:"flex-1 bg-background px-3 py-2 rounded text-sm font-mono",children:i}),c.jsx(oe,{size:"sm",variant:"outline",onClick:()=>p(i),children:"Copy"})]})]})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"⚠️ Make sure to save these credentials securely. The password cannot be retrieved later."})]}),c.jsx(Ny,{children:c.jsx(oe,{onClick:f,children:"Done"})})]}):c.jsxs("form",{onSubmit:d,className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"name",children:"Website Name"}),c.jsx(Ue,{id:"name",placeholder:"e.g., Ixon and Soul",value:r.name,onChange:m=>s({...r,name:m.target.value}),required:!0,className:"mt-2"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"domain",children:"Domain"}),c.jsx(Ue,{id:"domain",placeholder:"e.g., ixonandsoul.com",value:r.domain,onChange:m=>s({...r,domain:m.target.value}),required:!0,className:"mt-2"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"ownerName",children:"Owner Name"}),c.jsx(Ue,{id:"ownerName",placeholder:"e.g., John Smith",value:r.ownerName,onChange:m=>s({...r,ownerName:m.target.value}),required:!0,className:"mt-2"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"ownerEmail",children:"Owner Email"}),c.jsx(Ue,{id:"ownerEmail",type:"email",placeholder:"e.g., [email protected]",value:r.ownerEmail,onChange:m=>s({...r,ownerEmail:m.target.value}),required:!0,className:"mt-2"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"An account will be created with auto-generated credentials"})]}),c.jsxs(Ny,{children:[c.jsx(oe,{type:"button",variant:"outline",onClick:()=>e(!1),children:"Cancel"}),c.jsx(oe,{type:"submit",disabled:o,children:o?"Creating...":"Create Website"})]})]})]})})}function jme(){const{videos:t,isLoading:e,updateVideo:n,addVideo:r,deleteVideo:s}=wue(),[i,a]=k.useState(null),[o,l]=k.useState(""),[u,d]=k.useState(""),[f,p]=k.useState(!1),[m,y]=k.useState({video_key:"",video_label:"",youtube_url:"",is_active:!0}),g=C=>{const T=[/(?:youtube\.com\/embed\/)([a-zA-Z0-9_-]+)/,/(?:youtube\.com\/watch\?v=)([a-zA-Z0-9_-]+)/,/(?:youtu\.be\/)([a-zA-Z0-9_-]+)/,/^([a-zA-Z0-9_-]+)$/];for(const P of T){const M=C.match(P);
606if(M)return M[1]}return null},b=C=>{const T=g(C);return T?`https://www.youtube.com/embed/${T}`:C},x=C=>{a(C.id),l(C.youtube_url),d(C.video_label)},w=async C=>{try{const T=b(o);await n(C,{youtube_url:T,video_label:u}),te.success("Video link updated"),a(null)}catch(T){te.error("Failed to update video link",{description:T instanceof Error?T.message:"Unknown error"})}},v=async(C,T)=>{try{await n(C,{is_active:T}),te.success(T?"Video enabled":"Video disabled")}catch{te.error("Failed to update video status")}},S=async C=>{if(confirm("Are you sure you want to delete this video link?"))try{await s(C),te.success("Video link deleted")}catch{te.error("Failed to delete video link")}},E=async()=>{if(!m.video_key||!m.video_label||!m.youtube_url){te.error("Please fill in all fields");return}try{const C=b(m.youtube_url);await r({video_key:m.video_key.toLowerCase().replace(/\s+/g,"_"),video_label:m.video_label,youtube_url:C,is_active:m.is_active}),te.success("Video link added"),p(!1),y({video_key:"",video_label:"",youtube_url:"",is_active:!0})}catch(C){te.error("Failed to add video link",{description:C instanceof Error?C.message:"Unknown error"})}};return e?c.jsx("div",{className:"text-center py-8",children:"Loading video links..."}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-xl font-semibold text-foreground",children:"YouTube Video Links"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage the YouTube videos displayed on your website"})]}),c.jsxs(md,{open:f,onOpenChange:p,children:[c.jsx(Bde,{asChild:!0,children:c.jsxs(oe,{children:[c.jsx(Sy,{className:"w-4 h-4 mr-2"}),"Add Video"]})}),c.jsxs(yc,{children:[c.jsxs(gd,{children:[c.jsx(yd,{children:"Add New Video Link"}),c.jsx(Xf,{children:"Add a new YouTube video to display on your website"})]}),c.jsxs("div",{className:"space-y-4 py-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Se,{htmlFor:"video_key",children:"Video Key"}),c.jsx(Ue,{id:"video_key",placeholder:"e.g., hero_video",value:m.video_key,onChange:C=>y({...m,video_key:C.target.value})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Unique identifier used in code (lowercase, underscores only)"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Se,{htmlFor:"video_label",children:"Display Label"}),c.jsx(Ue,{id:"video_label",placeholder:"e.g., Hero Section Video",value:m.video_label,onChange:C=>y({...m,video_label:C.target.value})})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Se,{htmlFor:"youtube_url",children:"YouTube URL"}),c.jsx(Ue,{id:"youtube_url",placeholder:"https://www.youtube.com/watch?v=...",value:m.youtube_url,onChange:C=>y({...m,youtube_url:C.target.value})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"You can paste any YouTube URL format or just the video ID"})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx($f,{checked:m.is_active,onCheckedChange:C=>y({...m,is_active:C})}),c.jsx(Se,{children:"Active"})]})]}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(oe,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),c.jsx(oe,{onClick:E,children:"Add Video"})]})]})]})]}),c.jsx("div",{className:"grid gap-4",children:t.length===0?c.jsx(un,{children:c.jsxs(Nn,{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(LU,{className:"w-12 h-12 text-muted-foreground mb-4"}),c.jsx("p",{className:"text-muted-foreground",children:"No video links configured yet"}),c.jsxs(oe,{className:"mt-4",onClick:()=>p(!0),children:[c.jsx(Sy,{className:"w-4 h-4 mr-2"}),"Add Your First Video"]})]})}):t.map(C=>c.jsxs(un,{className:C.is_active?"":"opacity-60",children:[c.jsx(Ys,{className:"pb-3",children:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[i===C.id?c.jsx(Ue,{value:u,onChange:T=>d(T.target.value),className:"mb-2",placeholder:"Video label"}):c.jsx(Xs,{className:"text-lg",children:C.video_label}),c.jsxs(rl,{className:"font-mono text-xs",children:["Key: ",C.video_key]})]}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsx($f,{checked:C.is_active,onCheckedChange:T=>v(C.id,T)})})]})}),c.jsx(Nn,{className:"space-y-4",children:i===C.id?c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Se,{children:"YouTube URL"}),c.jsx(Ue,{value:o,onChange:T=>l(T.target.value),placeholder:"YouTube URL or video ID"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(oe,{size:"sm",onClick:()=>w(C.id),children:[c.jsx(DU,{className:"w-4 h-4 mr-1"}),"Save"]}),c.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>a(null),children:[c.jsx(C0,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"aspect-video rounded-lg overflow-hidden bg-muted",children:c.jsx("iframe",{src:C.youtube_url,title:C.video_label,className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("a",{href:C.youtube_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground flex items-center gap-1",children:[c.jsx(cE,{className:"w-3 h-3"}),"Open in YouTube"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>x(C),children:[c.jsx(hR,{className:"w-4 h-4 mr-1"}),"Edit"]}),c.jsxs(oe,{size:"sm",variant:"destructive",onClick:()=>S(C.id),children:[c.jsx(OU,{className:"w-4 h-4 mr-1"}),"Delete"]})]})]})]})})]},C.id))})]})}const OI=k.forwardRef(({className:t,...e},n)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:n,className:Oe("w-full caption-bottom text-sm",t),...e})}));OI.displayName="Table";const LI=k.forwardRef(({className:t,...e},n)=>c.jsx("thead",{ref:n,className:Oe("[&_tr]:border-b",t),...e}));LI.displayName="TableHeader";const FI=k.forwardRef(({className:t,...e},n)=>c.jsx("tbody",{ref:n,className:Oe("[&_tr:last-child]:border-0",t),...e}));FI.displayName="TableBody";const Nme=k.forwardRef(({className:t,...e},n)=>c.jsx("tfoot",{ref:n,className:Oe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));Nme.displayName="TableFooter";const gh=k.forwardRef(({className:t,...e},n)=>c.jsx("tr",{ref:n,className:Oe("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",t),...e}));gh.displayName="TableRow";const Us=k.forwardRef(({className:t,...e},n)=>c.jsx("th",{ref:n,className:Oe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));Us.displayName="TableHead";const Vr=k.forwardRef(({className:t,...e},n)=>c.jsx("td",{ref:n,className:Oe("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Vr.displayName="TableCell";const Pme=k.forwardRef(({className:t,...e},n)=>c.jsx("caption",{ref:n,className:Oe("mt-4 text-sm text-muted-foreground",t),...e}));Pme.displayName="TableCaption";
606function P1({source:t="demo",title:e,subtitle:n}={}){const[r,s]=k.useState([]),[i,a]=k.useState(!0),[o,l]=k.useState("");k.useEffect(()=>{u()},[t]);const u=async()=>{a(!0);const{data:m,error:y}=await ce.from("registrants").select("id, name, email, company, newsletter, created_at, source").eq("source",t).order("created_at",{ascending:!1});y?te.error("Failed to load registrants",{description:y.message}):s(m||[]),a(!1)},d=r.filter(m=>{const y=o.toLowerCase();return m.name.toLowerCase().includes(y)||m.email.toLowerCase().includes(y)||m.company.toLowerCase().includes(y)}),f=e??(t==="reminder"?"Reminder Sign-Ups":t==="game20"?"Game 20% Sign-Ups":t==="sample"?"Report Sample Downloads":"Demo Registrants"),p=n??(t==="reminder"?`${r.length} monthly reminder subscriber${r.length!==1?"s":""}`:t==="game20"?`${r.length} scratch-card sign-up${r.length!==1?"s":""}`:t==="sample"?`${r.length} sample download${r.length!==1?"s":""}`:`${r.length} total registrant${r.length!==1?"s":""}`);return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-3xl font-bold text-foreground",children:f}),c.jsx("p",{className:"text-muted-foreground mt-1",children:p})]}),c.jsxs(oe,{variant:"outline",size:"sm",onClick:u,disabled:i,children:[c.jsx(IU,{className:`w-4 h-4 mr-2 ${i?"animate-spin":""}`}),"Refresh"]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[c.jsxs(un,{children:[c.jsx(Ys,{className:"pb-2",children:c.jsxs(Xs,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[c.jsx(_y,{className:"w-4 h-4"})," Total"]})}),c.jsx(Nn,{children:c.jsx("p",{className:"text-2xl font-bold",children:r.length})})]}),c.jsxs(un,{children:[c.jsx(Ys,{className:"pb-2",children:c.jsxs(Xs,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[c.jsx(fc,{className:"w-4 h-4"})," Newsletter"]})}),c.jsx(Nn,{children:c.jsx("p",{className:"text-2xl font-bold",children:r.filter(m=>m.newsletter).length})})]}),c.jsxs(un,{children:[c.jsx(Ys,{className:"pb-2",children:c.jsxs(Xs,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[c.jsx(cR,{className:"w-4 h-4"})," Companies"]})}),c.jsx(Nn,{children:c.jsx("p",{className:"text-2xl font-bold",children:new Set(r.map(m=>m.company.toLowerCase())).size})})]})]}),c.jsxs("div",{className:"relative",children:[c.jsx(fR,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),c.jsx(Ue,{placeholder:"Search by name, email, or company...",value:o,onChange:m=>l(m.target.value),className:"pl-10"})]}),c.jsx(un,{children:c.jsx(Nn,{className:"p-0",children:i?c.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading registrants..."}):d.length===0?c.jsx("div",{className:"text-center py-12 text-muted-foreground",children:o?"No registrants match your search.":"No registrants yet."}):c.jsxs(OI,{children:[c.jsx(LI,{children:c.jsxs(gh,{children:[c.jsx(Us,{children:"Name"}),c.jsx(Us,{children:"Email"}),c.jsx(Us,{children:"Company"}),c.jsx(Us,{children:"Newsletter"}),c.jsx(Us,{children:"Registered"})]})}),c.jsx(FI,{children:d.map(m=>c.jsxs(gh,{children:[c.jsx(Vr,{className:"font-medium",children:m.name}),c.jsx(Vr,{children:m.email}),c.jsx(Vr,{children:m.company}),c.jsx(Vr,{children:c.jsx(Yo,{variant:m.newsletter?"default":"secondary",children:m.newsletter?"Yes":"No"})}),c.jsx(Vr,{className:"text-muted-foreground text-sm",children:kme(new Date(m.created_at),"MMM d, yyyy HH:mm")})]},m.id))})]})})})]})}function d4(t,[e,n]){return Math.min(n,Math.max(e,t))}var Rme=[" ","Enter","ArrowUp","ArrowDown"],Ime=[" ","Enter"],Qf="Select",[LE,FE,Dme]=sR(Qf),[ex,pAe]=il(Qf,[Dme,fE]),BE=fE(),[Mme,Md]=ex(Qf),[Ome,Lme]=ex(Qf),OH=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:a,defaultValue:o,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:y}=t,g=BE(e),[b,x]=k.useState(null),[w,v]=k.useState(null),[S,E]=k.useState(!1),C=PI(u),[T,P]=dd({prop:r,defaultProp:s??!1,onChange:i,caller:Qf}),[M,R]=dd({prop:a,defaultProp:o,onChange:l,caller:Qf}),O=k.useRef(null),L=b?y||!!b.closest("form"):!0,[U,B]=k.useState(new Set),H=Array.from(U).map(z=>z.props.value).join(";");return c.jsx(vee,{...g,children:c.jsxs(Mme,{required:m,scope:e,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:v,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:sd(),value:M,onValueChange:R,open:T,onOpenChange:P,dir:C,triggerPointerDownPosRef:O,disabled:p,children:[c.jsx(LE.Provider,{scope:e,children:c.jsx(Ome,{scope:t.__scopeSelect,onNativeOptionAdd:k.useCallback(z=>{B(V=>new Set(V).add(z))},[]),onNativeOptionRemove:k.useCallback(z=>{B(V=>{const $=new Set(V);return $.delete(z),$})},[]),children:n})}),L?c.jsxs(a8,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:M,onChange:z=>R(z.target.value),disabled:p,form:y,children:[M===void 0?c.jsx("option",{value:""}):null,Array.from(U)]},H):null]})})};OH.displayName=Qf;var LH="SelectTrigger",FH=k.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=BE(n),a=Md(LH,n),o=a.disabled||r,l=bt(e,a.onTriggerChange),u=FE(n),d=k.useRef("touch"),[f,p,m]=l8(g=>{const b=u().filter(v=>!v.disabled),x=b.find(v=>v.value===a.value),w=c8(b,g,x);w!==void 0&&a.onValueChange(w.value)}),y=g=>{o||(a.onOpenChange(!0),m()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return c.jsx(mz,{asChild:!0,...i,children:c.jsx(Fe.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":o8(a.value)?"":void 0,...s,ref:l,onClick:Ce(s.onClick,g=>
vendor: 15,199 bytes, line 606
606{g.currentTarget.focus(),d.current!=="mouse"&&y(g)}),onPointerDown:Ce(s.onPointerDown,g=>{d.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:Ce(s.onKeyDown,g=>{const b=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(b&&g.key===" ")&&Rme.includes(g.key)&&(y(),g.preventDefault())})})})});FH.displayName=LH;var BH="SelectValue",$H=k.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:a="",...o}=t,l=Md(BH,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=bt(e,l.onValueNodeChange);return Nr(()=>{u(d)},[u,d]),c.jsx(Fe.span,{...o,ref:f,style:{pointerEvents:"none"},children:o8(l.value)?c.jsx(c.Fragment,{children:a}):i})});$H.displayName=BH;var Fme="SelectIcon",UH=k.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return c.jsx(Fe.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});UH.displayName=Fme;var Bme="SelectPortal",zH=t=>c.jsx(sE,{asChild:!0,...t});zH.displayName=Bme;var Jf="SelectContent",VH=k.forwardRef((t,e)=>{const n=Md(Jf,t.__scopeSelect),[r,s]=k.useState();if(Nr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?ip.createPortal(c.jsx(WH,{scope:t.__scopeSelect,children:c.jsx(LE.Slot,{scope:t.__scopeSelect,children:c.jsx("div",{children:t.children})})}),i):null}return c.jsx(HH,{...t,ref:e})});VH.displayName=Jf;var Ta=10,[WH,Od]=ex(Jf),$me="SelectContentImpl",Ume=wy("SelectContent.RemoveScroll"),HH=k.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:o,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:b,...x}=t,w=Md(Jf,n),[v,S]=k.useState(null),[E,C]=k.useState(null),T=bt(e,Y=>S(Y)),[P,M]=k.useState(null),[R,O]=k.useState(null),L=FE(n),[U,B]=k.useState(!1),H=k.useRef(!1);k.useEffect(()=>{if(v)return xW(v)},[v]),cW();const z=k.useCallback(Y=>{const[de,...Ie]=L().map(xe=>xe.ref.current),[_e]=Ie.slice(-1),Ee=document.activeElement;for(const xe of Y)if(xe===Ee||(xe==null||xe.scrollIntoView({block:"nearest"}),xe===de&&E&&(E.scrollTop=0),xe===_e&&E&&(E.scrollTop=E.scrollHeight),xe==null||xe.focus(),document.activeElement!==Ee))return},[L,E]),V=k.useCallback(()=>z([P,v]),[z,P,v]);k.useEffect(()=>{U&&V()},[U,V]);const{onOpenChange:$,triggerPointerDownPosRef:I}=w;k.useEffect(()=>{if(v){let Y={x:0,y:0};const de=_e=>{var Ee,xe;Y={x:Math.abs(Math.round(_e.pageX)-(((Ee=I.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(_e.pageY)-(((xe=I.current)==null?void 0:xe.y)??0))}},Ie=_e=>{Y.x<=10&&Y.y<=10?_e.preventDefault():v.contains(_e.target)||$(!1),document.removeEventListener("pointermove",de),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",Ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",Ie,{capture:!0})}}},[v,$,I]),k.useEffect(()=>{const Y=()=>$(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[$]);const[N,W]=l8(Y=>{const de=L().filter(Ee=>!Ee.disabled),Ie=de.find(Ee=>Ee.ref.current===document.activeElement),_e=c8(de,Y,Ie);_e&&setTimeout(()=>_e.ref.current.focus())}),q=k.useCallback((Y,de,Ie)=>{const _e=!H.current&&!Ie;(w.value!==void 0&&w.value===de||_e)&&(M(Y),_e&&(H.current=!0))},[w.value]),D=k.useCallback(()=>v==null?void 0:v.focus(),[v]),Q=k.useCallback((Y,de,Ie)=>{const _e=!H.current&&!Ie;(w.value!==void 0&&w.value===de||_e)&&O(Y)},[w.value]),X=r==="popper"?pN:qH,se=X===pN?{side:o,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:b}:{};return c.jsx(WH,{scope:n,content:v,viewport:E,onViewportChange:C,itemRefCallback:q,selectedItem:P,onItemLeave:D,itemTextRefCallback:Q,focusSelectedItem:V,selectedItemText:R,position:r,isPositioned:U,searchRef:N,children:c.jsx(wI,{as:Ume,allowPinchZoom:!0,children:c.jsx(bI,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Ce(s,Y=>{var de;(de=w.trigger)==null||de.focus({preventScroll:!0}),Y.preventDefault()}),children:c.jsx(b0,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:c.jsx(X,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault(),...x,...se,onPlaced:()=>B(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Ce(x.onKeyDown,Y=>{const de=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!de&&Y.key.length===1&&W(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let _e=L().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const Ee=Y.target,xe=_e.indexOf(Ee);_e=_e.slice(xe+1)}setTimeout(()=>z(_e)),Y.preventDefault()}})})})})})})});HH.displayName=$me;var zme="SelectItemAlignedPosition",qH=k.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=Md(Jf,n),a=Od(Jf,n),[o,l]=k.useState(null),[u,d]=k.useState(null),f=bt(e,T=>d(T)),p=FE(n),m=k.useRef(!1),y=k.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:x,focusSelectedItem:w}=a,v=k.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&g&&b&&x){const T=i.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),R=x.getBoundingClientRect();if(i.dir!=="rtl"){const Ee=R.left-P.left,xe=M.left-Ee,Ne=T.left-xe,tt=T.width+Ne,qe=Math.max(tt,P.width),pt=window.innerWidth-Ta,Et=d4(xe,[Ta,Math.max(Ta,pt-qe)]);o.style.minWidth=tt+"px",o.style.left=Et+"px"}else{const Ee=P.right-R.right,xe=window.innerWidth-M.right-Ee,Ne=window.innerWidth-T.right-xe,tt=T.width+Ne,qe=Math.max(tt,P.width),pt=window.innerWidth-Ta,Et=d4(xe,[Ta,Math.max(Ta,pt-qe)]);o.style.minWidth=tt+"px",o.style.right=Et+"px"}const O=p(),L=window.innerHeight-Ta*2,U=g.scrollHeight,B=window.getComputedStyle(u),H=parseInt(B.borderTopWidth,10),z=parseInt(B.paddingTop,10),V=parseInt(B.borderBottomWidth,10),$=parseInt(B.paddingBottom,10),I=H+z+U+$+V,N=Math.min(b.offsetHeight*5,I),W=window.getComputedStyle(g),q=parseInt(W.paddingTop,10),D=parseInt(W.paddingBottom,10),Q=T.top+T.height/2-Ta,X=L-Q,se=b.offsetHeight/2,Y=b.offsetTop+se,de=H+z+Y,Ie=I-de;if(de<=Q){const Ee=O.length>0&&b===O[O.length-1].ref.current;o.style.bottom="0px";const xe=u.clientHeight-g.offsetTop-g.offsetHeight,Ne=Math.max(X,se+(Ee?D:0)+xe+V),tt=de+Ne;o.style.height=tt+"px"}else{const Ee=O.length>0&&b===O[0].ref.current;o.style.top="0px";const Ne=Math.max(Q,H+g.offsetTop+(Ee?q:0)+se)+Ie;o.style.height=Ne+"px",g.scrollTop=de-Q+g.offsetTop}o.style.margin=`${Ta}px 0`,o.style.minHeight=N+"px",o.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,i.trigger,i.valueNode,o,u,g,b,x,i.dir,r]);Nr(()=>v(),[v]);const[S,E]=k.useState();Nr(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const C=k.useCallback(T=>{T&&y.current===!0&&(v(),w==null||w(),y.current=!1)},[v,w]);return c.jsx(Wme,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(Fe.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});qH.displayName=zme;var Vme="SelectPopperPosition",pN=k.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ta,...i}=t,a=BE(n);return c.jsx(gz,{...a,...i,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});pN.displayName=Vme;var[Wme,BI]=ex(Jf,{}),mN="SelectViewport",GH=k.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=Od(mN,n),a=BI(mN,n),o=bt(e,i.onViewportChange),l=k.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(LE.Slot,{scope:n,children:c.jsx(Fe.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ce(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&f){const m=Math.abs(l.current-d.scrollTop);if(m>0){const y=window.innerHeight-Ta*2,g=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),x=Math.max(g,b);if(x<y){const w=x+m,v=Math.min(y,w),S=w-v;f.style.height=v+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});GH.displayName=mN;var KH="SelectGroup",[Hme,qme]=ex(KH),Gme=k.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=sd();return c.jsx(Hme,{scope:n,id:s,children:c.jsx(Fe.div,{role:"group","aria-labelledby":s,...r,ref:e})})});Gme.displayName=KH;var YH="SelectLabel",XH=k.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=qme(YH,n);return c.jsx(Fe.div,{id:s.id,...r,ref:e})});XH.displayName=YH;var i_="SelectItem",[Kme,ZH]=ex(i_),QH=k.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...a}=t,o=Md(i_,n),l=Od(i_,n),u=o.value===r,[d,f]=k.useState(i??""),[p,m]=k.useState(!1),y=bt(e,w=>{var v;return(v=l.itemRefCallback)==null?void 0:v.call(l,w,r,s)}),g=sd(),b=k.useRef("touch"),x=()=>{s||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Kme,{scope:n,value:r,disabled:s,textId:g,isSelected:u,onItemTextChange:k.useCallback(w=>{f(v=>v||((w==null?void 0:w.textContent)??"").trim())},[]),children:c.jsx(LE.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:c.jsx(Fe.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:y,onFocus:Ce(a.onFocus,()=>m(!0)),onBlur:Ce(a.onBlur,()=>m(!1)),onClick:Ce(a.onClick,()=>{b.current!=="mouse"&&x()}),onPointerUp:Ce(a.onPointerUp,()=>{b.current==="mouse"&&x()}),onPointerDown:Ce(a.onPointerDown,w=>{b.current=w.pointerType}),onPointerMove:Ce(a.onPointerMove,w=>{var v;b.current=w.pointerType,s?(v=l.onItemLeave)==null||v.call(l):b.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(a.onPointerLeave,w=>{var v;w.currentTarget===document.activeElement&&((v=l.onItemLeave)==null||v.call(l))}),onKeyDown:Ce(a.onKeyDown,w=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&w.key===" "||(Ime.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});QH.displayName=i_;var Vx="SelectItemText",JH=k.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,a=Md(Vx,n),o=Od(Vx,n),l=ZH(Vx,n),u=Lme(Vx,n),[d,f]=k.useState(null),p=bt(e,x=>f(x),l.onItemTextChange,x=>{var w;return(w=o.itemTextRefCallback)==null?void 0:w.call(o,x,l.value,l.disabled)}),m=d==null?void 0:d.textContent,y=k.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=u;return Nr(()=>(g(y),()=>b(y)),[g,b,y]),c.jsxs(c.Fragment,{children:[c.jsx(Fe.span,{id:l.textId,...i,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ip.createPortal(i.children,a.valueNode):null]})});JH.displayName=Vx;var e8="SelectItemIndicator",t8=k.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return ZH(e8,n).isSelected?c.jsx(Fe.span,{"aria-hidden":!0,...r,ref:e}):null});t8.displayName=e8;var gN="SelectScrollUpButton",n8=k.forwardRef((t,e)=>{const n=Od(gN,t.__scopeSelect),r=BI(gN,t.__scopeSelect),[s,i]=k.useState(!1),a=bt(e,r.onScrollButtonChange);return Nr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollTop>0;i(u)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?c.jsx(s8,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});n8.displayName=gN;var yN="SelectScrollDownButton",r8=k.forwardRef((t,e)=>{const n=Od(yN,t.__scopeSelect),r=BI(yN,t.__scopeSelect),[s,i]=k.useState(!1),a=bt(e,r.onScrollButtonChange);return Nr(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;i(d)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?c.jsx(s8,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});r8.displayName=yN;var s8=k.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=Od("SelectScrollButton",n),a=k.useRef(null),o=FE(n),l=k.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return k.useEffect(()=>()=>l(),[l]),Nr(()=>{var d;const u=o().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),c.jsx(Fe.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:Ce(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ce(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ce(s.onPointerLeave,()=>{l()})})}),Yme="SelectSeparator",i8=k.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return c.jsx(Fe.div,{"aria-hidden":!0,...r,ref:e})});i8.displayName=Yme;var xN="SelectArrow",Xme=k.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=BE(n),i=Md(xN,n),a=Od(xN,n);return i.open&&a.position==="popper"?c.jsx(yz,{...s,...r,ref:e}):null});Xme.displayName=xN;var Zme="SelectBubbleInput",a8=k.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const s=k.useRef(null),i=bt(r,s),a=CI(e);return k.useEffect(()=>{const o=s.current;if(!o)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==e&&d){const f=new Event("change",{bubbles:!0});d.call(o,e),o.dispatchEvent(f)}},[a,e]),c.jsx(Fe.select,{...n,style:{...eU,...n.style},ref:i,defaultValue:e})});a8.displayName=Zme;function o8(t){return t===""||t===void 0}function l8(t){const e=ga(t),n=k.useRef(""),r=k.useRef(0),s=k.useCallback(a=>
606{const o=n.current+a;e(o),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[e]),i=k.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function c8(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=Qme(t,Math.max(i,0));s.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function Qme(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Jme=OH,u8=FH,ege=$H,tge=UH,nge=zH,d8=VH,rge=GH,h8=XH,f8=QH,sge=JH,ige=t8,p8=n8,m8=r8,g8=i8;const Nv=Jme,Pv=ege,Am=k.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(u8,{ref:r,className:Oe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,c.jsx(tge,{asChild:!0,children:c.jsx(SU,{className:"h-4 w-4 opacity-50"})})]}));Am.displayName=u8.displayName;const y8=k.forwardRef(({className:t,...e},n)=>c.jsx(p8,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",t),...e,children:c.jsx(hZ,{className:"h-4 w-4"})}));y8.displayName=p8.displayName;const x8=k.forwardRef(({className:t,...e},n)=>c.jsx(m8,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",t),...e,children:c.jsx(SU,{className:"h-4 w-4"})}));x8.displayName=m8.displayName;const Tm=k.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>c.jsx(nge,{children:c.jsxs(d8,{ref:s,className:Oe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[c.jsx(y8,{}),c.jsx(rge,{className:Oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),c.jsx(x8,{})]})}));Tm.displayName=d8.displayName;const age=k.forwardRef(({className:t,...e},n)=>c.jsx(h8,{ref:n,className:Oe("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));age.displayName=h8.displayName;const jm=k.forwardRef(({className:t,children:e,...n},r)=>c.jsxs(f8,{ref:r,className:Oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(ige,{children:c.jsx(oa,{className:"h-4 w-4"})})}),c.jsx(sge,{children:e})]}));jm.displayName=f8.displayName;const oge=k.forwardRef(({className:t,...e},n)=>c.jsx(g8,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",t),...e}));oge.displayName=g8.displayName;const Uf=["Market Shift & Segment Growth","Business Model & Pricing Strategy","Regulation & Compliance","Sustainability & ESG","Technology & Product Innovation","M&A, Investment & Valuation"],lge=["Business Model & Pricing Strategy","Market Shift & Segment Growth","Technology & Product Innovation","Regulation & Compliance","M&A, Investment & Valuation","Sustainability & ESG"],cge={"Market Shift & Segment Growth":[{term:"bottled water cooler",weight:3},{term:"bottled water",weight:3},{term:"point-of-use",weight:3},{term:"point of use",weight:3},{term:"integrated tap systems",weight:3},{term:"integrated tap system",weight:3},{term:"installed base",weight:3},{term:"market share",weight:3},{term:"unit count",weight:3},{term:"new installs",weight:3}
606,{term:"corporate buyers",weight:3},{term:"facilities managers",weight:3},{term:"workplace hydration",weight:3},{term:"regional markets",weight:3},{term:"western europe",weight:2},{term:"northern europe",weight:2},{term:"southern europe",weight:2},{term:"eastern europe",weight:2},{term:"tipping point",weight:3},{term:"category growth",weight:3},{term:"segment growth",weight:3},{term:"corporate segment",weight:3},{term:"account renewal",weight:3},{term:"customer transition",weight:3},{term:"account migration",weight:3},{term:"corporate installs",weight:3},{term:"bwd",weight:2},{term:"pou",weight:2},{term:"its",weight:1},{term:"penetration",weight:2},{term:"conversion",weight:1},{term:"migration",weight:1},{term:"switching",weight:1}],"Business Model & Pricing Strategy":[{term:"business model",weight:3},{term:"pricing strategy",weight:3},{term:"hardware trap",weight:4},{term:"rental model",weight:3},{term:"recurring revenue",weight:3},{term:"revenue per location",weight:3},{term:"service revenue",weight:3},{term:"filter subscription",weight:3},{term:"route density",weight:3},{term:"contract stickiness",weight:3},{term:"contract value",weight:3},{term:"cost-to-serve",weight:3},{term:"cost to serve",weight:3},{term:"total cost of ownership",weight:3},{term:"tco",weight:2},{term:"multi-year rental",weight:3},{term:"installed base economics",weight:3},{term:"account profitability",weight:3},{term:"service layer",weight:3},{term:"preventative maintenance",weight:3},{term:"service capability",weight:3},{term:"hardware vs service",weight:3},{term:"commercial model",weight:3},{term:"pricing",weight:1},{term:"repricing",weight:2},{term:"ebitda",weight:1},{term:"margin",weight:1},{term:"churn",weight:2},{term:"maintenance",weight:1}],"Regulation & Compliance":[{term:"drinking water directive",weight:4},{term:"ppwr",weight:4},{term:"plastic tax",weight:4},{term:"packaging waste",weight:3},{term:"packaging law",weight:3},{term:"recycled content",weight:3},{term:"compliance deadline",weight:4},{term:"compliance mandate",weight:4},{term:"legal deadline",weight:3},{term:"regulatory pressure",weight:3},{term:"regulatory enforcement",weight:3},{term:"water quality standard",weight:3},{term:"food safety",weight:2},{term:"test result",weight:2},{term:"certified pfas removal",weight:4},{term:"pfas regulation",weight:4},{term:"pfas",weight:2},{term:"statutory limit",weight:3},{term:"directive",weight:1},{term:"legislation",weight:1},{term:"regulator",weight:1},{term:"regulation",weight:1},{term:"compliance",weight:1},{term:"ban",weight:1},{term:"enforcement",weight:1},{term:"certification",weight:1},{term:"contamination",weight:1}],"Sustainability & ESG":[{term:"esg procurement",weight:4},{term:"esg reporting",weight:4},{term:"sustainability reporting",weight:4},{term:"sustainability audit",weight:3},{term:"scope 3",weight:4},{term:"carbon-neutral",weight:3},{term:"carbon neutral",weight:3},{term:"co2 reduction",weight:3},{term:"plastic reduction",weight:3},{term:"bottle elimination",weight:4},{term:"bottles saved",weight:3},{term:"single-use plastic",weight:3},{term:"single use plastic",weight:3},{term:"circular economy",weight:3},{term:"corporate sustainability",weight:3},{term:"environmental impact",weight:2},{term:"waste reduction",weight:2},{term:"procurement framework",weight:3},{term:"greenwashing",weight:3},{term:"esg",weight:1},{term:"sustainability",weight:1},{term:"emissions",weight:1},{term:"recycling",weight:1},{term:"refill",weight:1}],"Technology & Product Innovation":[{term:"smart dispenser",weight:4},{term:"smart tap",weight:4},{term:"connected dispenser",weight:4},{term:"remote diagnostics",weight:4},{term:"real-time data",weight:3},{term:"real time data",weight:3},{term:"data reporting",weight:3},{term:"usage data",weight:3},{term:"consumption data",weight:3},{term:"beverage platform",weight:4},{term:"functional beverage",weight:4},{term:"functional drinks",weight:3},{term:"machine launch",weight:3},{term:"new machine",weight:2},{term:"product launch",weight:3},{term:"filtration technology",weight:3},{term:"reverse osmosis",weight:3},{term:"activated carbon",weight:3},{term:"digital monitoring",weight:3},{term:"automated service",weight:3},{term:"signature countertop",weight:4},{term:"bevipop",weight:4},{term:"bevisport",weight:4},{term:"bevienergy",weight:4},{term:"prebiotics",weight:2},{term:"iot",weight:2},{term:"innovation",weight:1},{term:"diagnostics",weight:1},{term:"sensor",weight:1},{term:"platform",weight:1}],"M&A, Investment & Valuation":[{term:"private equity",weight:4},{term:"exit multiple",weight:4},{term:"ebitda multiple",weight:4},{term:"strategic buyer",weight:4},{term:"financial buyer",weight:4},{term:"due diligence",weight:4},{term:"purchase price",weight:3},{term:"funding round",weight:4}
606,{term:"capital raise",weight:4},{term:"roll-up",weight:3},{term:"roll up",weight:3},{term:"primo brands",weight:4},{term:"bluetriton",weight:4},{term:"culligan",weight:3},{term:"waterlogic",weight:3},{term:"aquaservice",weight:3},{term:"eden springs",weight:3},{term:"brita",weight:2},{term:"bevi funding",weight:4},{term:"m&a",weight:3},{term:"acquisition",weight:2},{term:"acquired",weight:2},{term:"acquirer",weight:2},{term:"merger",weight:2},{term:"consolidation",weight:2},{term:"investor",weight:1},{term:"valuation",weight:2},{term:"transaction",weight:1},{term:"synergy",weight:1},{term:"stake",weight:1}]},uge=["take the next step","turn this intelligence into action","book a free consultation call","visit water dispense insights","get a monthly reminder","zenith global commercial","share this article","share this insight"];function dge(t){if(!t)return"";const e=t.toLowerCase();let n=t.length;for(const r of uge){const s=e.indexOf(r);s>=0&&s<n&&(n=s)}return t.slice(0,n)}function h4(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hge(t,e){if(!t||!e)return 0;const n=e.includes(" ")?h4(e).replace(/ /g,"\\s+"):`\\b${h4(e)}\\b`,r=new RegExp(n,"gi"),s=t.match(r);return s?s.length:0}function TA(t,e){const n={"Market Shift & Segment Growth":0,"Business Model & Pricing Strategy":0,"Regulation & Compliance":0,"Sustainability & ESG":0,"Technology & Product Innovation":0,"M&A, Investment & Valuation":0};if(!t)return n;const r=dge(t);for(const s of Uf){let i=0;for(const a of cge[s]){const o=hge(r,a.term);o>0&&(i+=o*a.weight)}n[s]+=i*e}return n}function a_(t){const e=(t.title??"").toString(),n=(t.excerpt??"").toString(),r=(t.content??"").toString();if(!e&&!n&&!r)return"Business Model & Pricing Strategy";const s=TA(e,4),i=TA(n,2),a=TA(r,1),o={"Market Shift & Segment Growth":0,"Business Model & Pricing Strategy":0,"Regulation & Compliance":0,"Sustainability & ESG":0,"Technology & Product Innovation":0,"M&A, Investment & Valuation":0};for(const m of Uf)o[m]=s[m]+i[m]+a[m];const u=[...Uf].sort((m,y)=>o[y]-o[m])[0],d=o[u];if(d===0)return"Business Model & Pricing Strategy";const f=.85,p=Uf.filter(m=>o[m]>=d*f);for(const m of lge)if(p.includes(m))return m;return u}const fge=t=>t.replace(/\/\*[\s\S]*?\*\//g," ").replace(/--[^\n\r]*/g," "),pge=t=>{const e=[];let n=0;const r=t.length;for(;n<r;){const s=t[n];if(s===" "||s==="	"||s===`
607`||s==="\r"||s===","){n++;continue}if(s==="$"){const a=t.slice(n).match(/^\$([A-Za-z0-9_]*)\$/);if(a){const o=a[0],l=n+o.length,u=t.indexOf(o,l);if(u===-1)throw new Error("Unterminated dollar-quoted string");const d=t.slice(l,u);e.push({raw:t.slice(n,u+o.length),value:d}),n=u+o.length;continue}}if(s==="'"){let a=n+1,o="";for(;a<r;){if(t[a]==="'"){if(t[a+1]==="'"){o+="'",a+=2;continue}break}o+=t[a],a++}if(a>=r)throw new Error("Unterminated string literal");e.push({raw:t.slice(n,a+1),value:o}),n=a+1;continue}const i=t.slice(n).match(/^[A-Za-z0-9_.+\-]+/);if(i){const a=i[0],o=a.toUpperCase();let l;o==="NULL"?l=null:o==="TRUE"?l=!0:o==="FALSE"?l=!1:/^-?\d+(\.\d+)?$/.test(a)?l=Number(a):l=a,e.push({raw:a,value:l}),n+=a.length;continue}if(s==="("){let a=1,o=n+1;for(;o<r&&a>0;)t[o]==="("?a++:t[o]===")"&&a--,o++;const l=t.slice(n,o);e.push({raw:l,value:l}),n=o;continue}n++}return e},f4=(t,e)=>{let n=0,r=e,s=!1;for(;r<t.length;){const i=t[r];if(!s&&i==="$"){const a=t.slice(r).match(/^\$([A-Za-z0-9_]*)\$/);if(a){const o=a[0],l=t.indexOf(o,r+o.length);if(l===-1)throw new Error("Unterminated dollar-quote");r=l+o.length;continue}}if(i==="'"){if(s&&t[r+1]==="'"){r+=2;continue}s=!s,r++;continue}if(!s){if(i==="(")n++;else if(i===")"&&(n--,n===0))return r}r++}return-1},mge=t=>{const e=fge(t),n=e.match(/insert\s+into\s+(?:public\.)?news_articles\s*\(/i);if(!n)throw new Error("No INSERT INTO news_articles statement found");const r=n.index+n[0].length-1,s=f4(e,r);if(s===-1)throw new Error("Could not find end of column list");const i=e.slice(r+1,s).split(",").map(y=>y.trim().replace(/^"|"$/g,"").toLowerCase()),o=e.slice(s+1).match(/values\s*\(/i);if(!o)throw new Error("No VALUES clause found");const l=s+1+o.index+o[0].length-1,u=f4(e,l);if(u===-1)throw new Error("Could not find end of VALUES list");const d=e.slice(l+1,u),f=pge(d);if(f.length!==i.length)throw new Error(`Column/value count mismatch: ${i.length} columns vs ${f.length} values`);const p={body:"content",article_body:"content",html:"content",markdown:"content",summary:"excerpt",description:"excerpt",cover:"cover_image_url",image_url:"cover_image_url",cover_image:"cover_image_url",by_line:"author",byline:"author",analytics:"analytics_md",analytics_html:"analytics_md"},m={};if(i.forEach((y,g)=>{const b=p[y]||y,x=f[g].value;switch(b){case"title":case"slug":case"content":case"author":typeof x=="str
607ing"&&(m[b]=x);break;case"excerpt":case"analytics_md":case"cover_image_url":m[b]=x===null?null:typeof x=="string"?x:null;break;case"is_published":typeof x=="boolean"&&(m.is_published=x);break;case"published_at":case"scheduled_for":typeof x=="string"&&(m[b]=x);break}}),m.content&&!m.analytics_md){const y="(?:Strategic\\s*Read|Analytics(?:\\s*(?:&amp;|&|\\+|and)\\s*Strategic\\s*Insight)?|Strategic\\s*Insight)",g=m.content.match(/<div[^>]*class=["'][^"']*analytics[-_ ]?body[^"']*["'][^>]*>([\s\S]*?)<\/div>\s*$/i),b=new RegExp(`(?:<hr\\s*/?>\\s*)?<(h[1-4])[^>]*>\\s*(?:[^<\\w]*\\s*)?${y}[\\s\\S]*?</\\1>`,"i"),x=new RegExp(`\\n\\s*#{1,4}\\s*(?:[^\\w\\n]*\\s*)?${y}[^\\n]*\\n`,"i");if(g&&g.index!==void 0)m.analytics_md=g[1].trim(),m.content=m.content.slice(0,g.index).trim();else{const w=m.content.match(b);if(w&&w.index!==void 0)m.analytics_md=m.content.slice(w.index).trim(),m.content=m.content.slice(0,w.index).trim();else{const v=m.content.match(x);v&&v.index!==void 0&&(m.analytics_md=m.content.slice(v.index).trim(),m.content=m.content.slice(0,v.index).trim())}}m.analytics_md&&(m.content=m.content.replace(/<hr\s*\/?>\s*$/i,"").trim())}if(!m.slug&&m.title&&(m.slug=m.title.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").slice(0,80)),!m.title)throw new Error(`Parsed but no title found. Columns detected: ${i.join(", ")}`);if(!m.content)throw new Error(`Parsed but no content found. Expected a column named 'content' or 'body'. Columns detected: ${i.join(", ")}`);return m.topic=a_({title:m.title,excerpt:m.excerpt??null,content:m.content}),m},p4={style:"warm-biophilic",setting:"biophilic-office",palette:"warm-earth",extraNotes:""},gge=[{value:"warm-biophilic",label:"Warm biophilic (default)"},{value:"modern-minimal",label:"Modern minimal"},{value:"editorial-lifestyle",label:"Editorial lifestyle (Kinfolk)"},{value:"sustainability-nature",label:"Sustainability / nature"},{value:"industrial-corporate",label:"Industrial corporate (FT/Bloomberg)"}],yge=[{value:"biophilic-office",label:"Biophilic office with plants"},{value:"lounge",label:"Hospitality lounge / lobby"},{value:"kitchen-pantry",label:"Office pantry / tea-point"},{value:"boardroom",label:"Warm modern boardroom"},{value:"outdoor-terrace",label:"Green office terrace"},{value:"auto",label:"Auto — let AI decide"}],xge=[{value:"warm-earth",label:"Warm earth (terracotta, sage, oak)"},{value:"soft-neutral",label:"Soft neutral (cream, oak, brass)"},{value:"green-daylight",label:"Greens & daylight"},{value:"muted-blue-warm",label:"Muted blue + warm wood"}],m4=t=>t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").slice(0,80),g4=t=>{if(!t)return"";const e=new Date(t),n=r=>String(r).padStart(2,"0");return`${e.getFullYear()}-${n(e.getMonth()+1)}-${n(e.getDate())}T${n(e.getHours())}:${n(e.getMinutes())}`},vge=t=>t?new Date(t).toISOString():null,jA=()=>({title:"",slug:"",excerpt:"",content:"",analytics_md:"",cover_image_url:"",thumbnail_url:"",author:"Zenith Water Dispense Team",is_published:!1,scheduled_for:null,topic:"Business Model & Pricing Strategy"});function bge(){const[t,e]=k.useState([]),[n,r]=k.useState({}),[s,i]=k.useState(!0),[a,o]=k.useState(null),[l,u]=k.useState(null),[d,f]=k.useState(!1),[p,m]=k.useState(null),[y,g]=k.useState(!1),[b,x]=k.useState(!1),[w,v]=k.useState(null),[S,E]=k.useState(p4),C=(I,N,W)=>{if(!N.title){te.error("Add a title first so the AI knows what to draw");return}E(p4),v({forKey:I,seed:N,onResult:W})},T=async()=>{if(confirm("Re-classify topic for ALL articles based on current rules?")){g(!0);try{const{data:I,error:N}=await ce.from("news_articles").select("id, title, excerpt, content, topic");if(N)throw N;const W=I??[];let q=0,D=0;for(const Q of W){const X=a_({title:Q.title,excerpt:Q.excerpt,content:Q.content});if(X!==Q.topic){const{error:se}=await ce.from("news_articles").update({topic:X}).eq("id",Q.id);se?console.error("Update failed for",Q.id,se):q+=1}else D+=1}te.success(`Re-detect complete: ${q} updated, ${D} unchanged`),await M()}catch(I){te.error((I==null?void 0:I.message)||"Re-detect failed")}finally{g(!1)}}}
607,P=async(I,N,W)=>{if(!I.title&&!(W!=null&&W.customPrompt))return te.error("Add a title first so the AI knows what to draw"),null;m(N);try{const{data:q,error:D}=await ce.functions.invoke("generate-article-cover",{body:{title:I.title,excerpt:I.excerpt,slug:I.slug,content:I.content?String(I.content).slice(0,6e3):void 0,customPrompt:W==null?void 0:W.customPrompt,style:W==null?void 0:W.style,setting:W==null?void 0:W.setting,palette:W==null?void 0:W.palette,extraNotes:W==null?void 0:W.extraNotes}});if(D)throw D;if(!(q!=null&&q.url))throw new Error("No image returned");try{const{buildAndUploadVariants:Q}=await Kf(async()=>{const{buildAndUploadVariants:se}=await import("./imageProcessing-CcLE8UPS.js");return{buildAndUploadVariants:se}},[]),X=await Q(q.url,I.slug,ce);return{url:X.coverUrl,thumbnailUrl:X.thumbUrl}}catch(Q){return console.warn("[cover] post-process failed, using raw url",Q),{url:q.url,thumbnailUrl:null}}}catch(q){return te.error("Couldn't generate cover image",{description:q.message}),null}finally{m(null)}},M=async()=>{i(!0);const[I,N]=await Promise.all([ce.from("news_articles").select("*").order("created_at",{ascending:!1}),ce.rpc("article_stats")]);if(I.error?te.error("Failed to load articles",{description:I.error.message}):e(I.data??[]),!N.error&&Array.isArray(N.data)){const W={};for(const q of N.data)q.article_id&&(W[q.article_id]=q);r(W)}i(!1)};k.useEffect(()=>{M()},[]);const R=async I=>{o(I.id);const{error:N}=await ce.from("news_articles").update({is_published:!0,published_at:new Date().toISOString()}).eq("id",I.id);o(null),N?te.error("Publish failed",{description:N.message}):(te.success(`Published "${I.title}"`),M())},O=async I=>{o(I.id);const{error:N}=await ce.from("news_articles").update({is_published:!1}).eq("id",I.id);o(null),N?te.error("Unpublish failed",{description:N.message}):(te.success("Moved back to drafts"),M())},L=async I=>{if(!confirm(`Permanently delete "${I.title}"?`))return;o(I.id);const{error:N}=await ce.from("news_articles").delete().eq("id",I.id);o(null),N?te.error("Delete failed",{description:N.message}):(te.success("Article deleted"),M())},U=async()=>{var D,Q,X,se,Y,de,Ie;if(!l)return;if(!l.title||!l.content){te.error("Title and content are required");return}const I=((D=l.slug)==null?void 0:D.trim())||m4(l.title),N=l.scheduled_for?typeof l.scheduled_for=="string"&&l.scheduled_for.includes("T")&&l.scheduled_for.length<=16?vge(l.scheduled_for):l.scheduled_for:null;if(N&&new Date(N).getTime()<=Date.now()){te.error("Scheduled time must be in the future");return}const W=((Q=l.topic)==null?void 0:Q.trim())||a_({title:l.title,excerpt:l.excerpt,content:l.content}),q={title:l.title.trim(),slug:I,excerpt:((X=l.excerpt)==null?void 0:X.trim())||null,content:l.content,analytics_md:((se=l.analytics_md)==null?void 0:se.trim())||null,cover_image_url:((Y=l.cover_image_url)==null?void 0:Y.trim())||null,thumbnail_url:((de=l.thumbnail_url)==null?void 0:de.trim())||null,author:((Ie=l.author)==null?void 0:Ie.trim())||"Zenith Water Dispense Team",scheduled_for:N,topic:W};if(f(!0),l.id){const{error:_e}=await ce.from("news_articles").update(q).eq("id",l.id);if(f(!1),_e){te.error("Save failed",{description:_e.message});return}te.success(N?"Article scheduled":"Article updated")}else{const{error:_e}=await ce.from("news_articles").insert({...q,is_published:!1});if(f(!1),_e){te.error("Create failed",{description:_e.message});return}te.success(N?"Draft scheduled":"Draft created")}u(null),M()};if(s)return c.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading articles…"});const B=t.filter(I=>!I.is_published),H=t.filter(I=>I.is_published),z=I=>c.jsxs(un,{children:[c.jsx(Ys,{children:c.jsx("div",{className:"flex items-start justify-between gap-3",children:c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[I.is_published?c.jsx(Yo,{variant:"default",children:"Published"}):I.scheduled_for?c.jsxs(Yo,{variant:"secondary",className:"bg-blue-500/20 text-blue-300 border-blue-500/30",children:["Scheduled · ",new Date(I.scheduled_for).toLocaleStr
607ing([],{dateStyle:"short",timeStyle:"short"})]}):c.jsx(Yo,{variant:"secondary",className:"bg-yellow-500/20 text-yellow-300 border-yellow-500/30",children:"Draft"}),c.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(I.created_at).toLocaleDateString()}),I.topic&&c.jsx(Yo,{variant:"outline",className:"text-[10px]",children:I.topic})]}),c.jsx(Xs,{className:"text-lg leading-snug",children:I.title}),I.excerpt&&c.jsx(rl,{className:"mt-2 line-clamp-2",children:I.excerpt})]})})}),c.jsxs(Nn,{className:"space-y-3",children:[(()=>{const N=n[I.id],W=q=>q.toLocaleString();return c.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground border-y border-border/50 py-2",children:[c.jsxs("span",{children:[c.jsx("span",{className:"text-foreground font-semibold",children:W((N==null?void 0:N.views)??0)})," views",N!=null&&N.unique_views?c.jsxs("span",{className:"ml-1",children:["(",W(N.unique_views)," unique)"]}):null]}),c.jsxs("span",{children:[c.jsx("span",{className:"text-foreground font-semibold",children:W((N==null?void 0:N.clicks)??0)})," card clicks"]}),c.jsxs("span",{children:["7d: ",c.jsx("span",{className:"text-foreground",children:W((N==null?void 0:N.views_7d)??0)})]}),c.jsxs("span",{children:["30d: ",c.jsx("span",{className:"text-foreground",children:W((N==null?void 0:N.views_30d)??0)})]}),(N==null?void 0:N.last_view_at)&&c.jsxs("span",{className:"ml-auto",children:["Last read ",new Date(N.last_view_at).toLocaleString([],{dateStyle:"short",timeStyle:"short"})]})]})})(),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(oe,{asChild:!0,variant:"outline",size:"sm",children:c.jsxs(rt,{to:`/intelligence/${I.slug}`,target:"_blank",rel:"noopener noreferrer",children:[c.jsx(cE,{className:"w-3.5 h-3.5 mr-1.5"}),"Preview"]})}),c.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>u(I),children:[c.jsx(hR,{className:"w-3.5 h-3.5 mr-1.5"}),"Edit"]}),c.jsxs(oe,{size:"sm",variant:"outline",disabled:p===I.id,onClick:()=>{C(I.id,{title:I.title,excerpt:I.excerpt,slug:I.slug,content:I.content},async({url:N,thumbnailUrl:W})=>{const{error:q}=await ce.from("news_articles").update({cover_image_url:N,thumbnail_url:W}).eq("id",I.id);q?te.error("Couldn't save cover",{description:q.message}):(te.success("AI cover image saved"),M())})},children:[c.jsx(mx,{className:"w-3.5 h-3.5 mr-1.5"}),p===I.id?"Generating…":I.cover_image_url?"Regenerate cover":"Generate AI cover"]}),I.is_published?c.jsxs(c.Fragment,{children:[c.jsx(oe,{size:"sm",variant:"outline",onClick:()=>O(I),disabled:a===I.id,children:"Unpublish"}),c.jsx(oe,{size:"sm",variant:"destructive",onClick:()=>L(I),disabled:a===I.id,children:"Delete"})]}):c.jsxs(c.Fragment,{children:[c.jsxs(oe,{size:"sm",onClick:()=>R(I),disabled:a===I.id,className:"bg-green-600 hover:bg-green-700",children:[c.jsx(oa,{className:"w-3.5 h-3.5 mr-1.5"}),"Approve & Publish"]}),c.jsxs(oe,{size:"sm",variant:"destructive",onClick:()=>L(I),disabled:a===I.id,children:[c.jsx(C0,{className:"w-3.5 h-3.5 mr-1.5"}),"Reject"]})]})]})]})]},I.id),V=async I=>{var W;const N=(W=I.target.files)==null?void 0:W[0];if(I.target.value="",!!N)try{const q=await N.text(),D=mge(q);u({...jA(),...D,is_published:!1}),te.success("SQL parsed",{description:`Loaded "${D.title}" — generating AI cover image…`});const Q=await P({title:D.title,excerpt:D.excerpt,slug:D.slug,content:D.content},"__editor");if(console.log("[cover] generated",Q),Q){const{url:X,thumbnailUrl:se}=Q;u(Y=>Y?{...Y,cover_image_url:X,thumbnail_url:se}:{...jA(),...D,is_published:!1,cover_image_url:X,thumbnail_url:se}),te.success("AI cover image generated",{description:X})}}catch(q){te.error("Couldn't parse SQL",{description:q.message})}},$=async()=>{x(!0);try{const{buildAndUploadVariants:I}=await Kf(async()=>{const{buildAndUploadVariants:se}=await import("./imageProcessing-CcLE8UPS.js");return{buildAndUploadVariants:se}},[]),{data:N,error:W}=await ce.from("news_articles").select("id, slug, cover_image_url").is("thumbnail_url",null).not("cover_image_url","is",null);if(W)throw W;const q=N??[];if(q.length===0){te.success("Nothing to do — all articles already have thumbnails.");return}let D=0,Q=0;const X=te.loading(`Optimising 0/${q.length}…`);for(const se of q){try{const Y=await I(se.cover_image_url,se.slug,ce),{error:de}=await ce.from("news_articles").update({cover_image_url:Y.coverUrl,thumbnail_url:Y.thumbUrl}).eq("id",se.id);if(de)throw de;D++}
607catch(Y){Q++,console.error("Backfill failed for",se.slug,Y)}te.loading(`Optimising ${D}/${q.length}${Q?` (${Q} failed)`:""}…`,{id:X})}te.success(`Done — optimised ${D}${Q?`, ${Q} failed`:""}.`,{id:X}),await M()}catch(I){te.error("Backfill failed",{description:I==null?void 0:I.message})}finally{x(!1)}};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[c.jsxs(oe,{variant:"outline",onClick:$,disabled:b,children:[c.jsx(mx,{className:"w-4 h-4 mr-1.5"}),b?"Optimising covers…":"Optimise existing covers"]}),c.jsxs(oe,{variant:"outline",onClick:T,disabled:y,children:[c.jsx(mx,{className:"w-4 h-4 mr-1.5"}),y?"Re-detecting…":"Re-detect topics"]}),c.jsx(oe,{asChild:!0,variant:"outline",children:c.jsxs("label",{className:"cursor-pointer",children:[c.jsx(yR,{className:"w-4 h-4 mr-1.5"}),"Upload SQL",c.jsx("input",{type:"file",accept:".sql,text/plain,text/sql,application/sql",className:"hidden",onChange:V})]})}),c.jsxs(oe,{onClick:()=>u(jA()),children:[c.jsx(Sy,{className:"w-4 h-4 mr-1.5"}),"New article"]})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(ds,{className:"w-5 h-5 text-yellow-400"}),c.jsxs("h3",{className:"text-xl font-semibold",children:["Drafts (",B.length,")"]})]}),B.length===0?c.jsx("p",{className:"text-sm text-muted-foreground",children:"No drafts pending review."}):c.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:B.map(z)})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(ds,{className:"w-5 h-5 text-green-400"}),c.jsxs("h3",{className:"text-xl font-semibold",children:["Published (",H.length,")"]})]}),H.length===0?c.jsx("p",{className:"text-sm text-muted-foreground",children:"No published articles yet."}):c.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:H.map(z)})]}),c.jsx(md,{open:!!l,onOpenChange:I=>!I&&u(null),children:c.jsxs(yc,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[c.jsxs(gd,{children:[c.jsx(yd,{children:l!=null&&l.id?"Edit article":"New article"}),c.jsx(Xf,{children:"All fields support markdown in content/analytics. Slug auto-generates from title if left blank."})]}),l&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"title",children:"Title *"}),c.jsx(Ue,{id:"title",value:l.title||"",onChange:I=>u({...l,title:I.target.value}),placeholder:"The POU Tipping Point: …"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"slug",children:"URL slug"}),c.jsx(Ue,{id:"slug",value:l.slug||"",onChange:I=>u({...l,slug:I.target.value}),placeholder:"auto-generated from title"}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Final URL: /intelligence/",l.slug||m4(l.title||"")]})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"excerpt",children:"Excerpt (used in meta description, max ~160 chars)"}),c.jsx(ca,{id:"excerpt",rows:2,value:l.excerpt||"",onChange:I=>u({...l,excerpt:I.target.value}),placeholder:"One-line summary for SEO and article cards"}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[(l.excerpt||"").length," / 160 characters"]})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(Se,{htmlFor:"cover",children:"Cover image URL"}),c.jsxs(oe,{type:"button",size:"sm",variant:"outline",disabled:p==="__editor"||!l.title,onClick:()=>{C("__editor",{title:l.title,excerpt:l.excerpt,slug:l.slug,content:l.content},({url:I,thumbnailUrl:N})=>{u(W=>W&&{...W,cover_image_url:I,thumbnail_url:N}),te.success("AI cover image generated")})},children:[c.jsx(mx,{className:"w-3.5 h-3.5 mr-1.5"}),p==="__editor"?"Generating…":l.cover_image_url?"Regenerate":"Generate AI cover"]})]}),c.jsx(Ue,{id:"cover",value:l.cover_image_url||"",onChange:I=>u({...l,cover_image_url:I.target.value}),placeholder:"https://… or click Generate AI cover"}),l.cover_image_url&&c.jsx("img",{src:l.cover_image_url,alt:"Cover preview",className:"mt-2 rounded-md border border-border max-h-48 object-cover w-full",onError:I=>{console.error("[cover] image failed to load",l.cover_image_url),I.currentTarget.style.outline="2px s
607olid hsl(var(--destructive))"}})]}),c.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"author",children:"Author"}),c.jsx(Ue,{id:"author",value:l.author||"",onChange:I=>u({...l,author:I.target.value})})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"topic",children:"Topic"}),c.jsx("select",{id:"topic",value:l.topic||"Business Model & Pricing Strategy",onChange:I=>u({...l,topic:I.target.value}),className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",children:Uf.map(I=>c.jsx("option",{value:I,children:I},I))}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Auto-detected from text. Used for filtering on the public feed."})]})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"scheduled_for",children:"Schedule publication (optional)"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Ue,{id:"scheduled_for",type:"datetime-local",value:l.scheduled_for?l.scheduled_for.length<=16&&l.scheduled_for.includes("T")?l.scheduled_for:g4(l.scheduled_for):"",onChange:I=>u({...l,scheduled_for:I.target.value||null}),min:g4(new Date().toISOString())}),l.scheduled_for&&c.jsx(oe,{type:"button",variant:"ghost",onClick:()=>u({...l,scheduled_for:null}),children:"Clear"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Leave blank to keep as draft. Article will auto-publish at the chosen time (your local timezone). Checked every minute."})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"content",children:"Content (markdown) *"}),c.jsx(ca,{id:"content",rows:16,className:"font-mono text-sm",value:l.content||"",onChange:I=>u({...l,content:I.target.value}),placeholder:`## Heading
608
609Paragraph text…`})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"analytics",children:"Analytics block (markdown, optional)"}),c.jsx(ca,{id:"analytics",rows:10,className:"font-mono text-sm",value:l.analytics_md||"",onChange:I=>u({...l,analytics_md:I.target.value}),placeholder:"### Strategic Read…"})]})]}),c.jsxs(Ny,{children:[c.jsx(oe,{variant:"outline",onClick:()=>u(null),disabled:d,children:"Cancel"}),c.jsx(oe,{onClick:U,disabled:d,children:d?"Saving…":l!=null&&l.id?"Save changes":"Create draft"})]})]})}),c.jsx(md,{open:!!w,onOpenChange:I=>!I&&v(null),children:c.jsxs(yc,{className:"max-w-lg",children:[c.jsxs(gd,{children:[c.jsx(yd,{children:"AI cover image options"}),c.jsx(Xf,{children:"Pick the mood, setting, and palette. Default is a warm, plant-filled, modern office."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Se,{children:"Style"}),c.jsxs(Nv,{value:S.style,onValueChange:I=>E({...S,style:I}),children:[c.jsx(Am,{children:c.jsx(Pv,{})}),c.jsx(Tm,{children:gge.map(I=>c.jsx(jm,{value:I.value,children:I.label},I.value))})]})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Setting"}),c.jsxs(Nv,{value:S.setting,onValueChange:I=>E({...S,setting:I}),children:[c.jsx(Am,{children:c.jsx(Pv,{})}),c.jsx(Tm,{children:yge.map(I=>c.jsx(jm,{value:I.value,children:I.label},I.value))})]})]}),c.jsxs("div",{children:[c.jsx(Se,{children:"Color palette"}),c.jsxs(Nv,{value:S.palette,onValueChange:I=>E({...S,palette:I}),children:[c.jsx(Am,{children:c.jsx(Pv,{})}),c.jsx(Tm,{children:xge.map(I=>c.jsx(jm,{value:I.value,children:I.label},I.value))})]})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"extraNotes",children:"Extra direction (optional)"}),c.jsx(ca,{id:"extraNotes",rows:3,value:S.extraNotes,onChange:I=>E({...S,extraNotes:I.target.value}),placeholder:"e.g. include a barista-style coffee bar, morning light, no people"})]})]}),c.jsxs(Ny,{children:[c.jsx(oe,{variant:"outline",onClick:()=>v(null),disabled:!!p,children:"Cancel"}),c.jsxs(oe,{disabled:!!p,onClick:async()=>{if(!w)return;const{seed:I,forKey:N,onResult:W}=w,q=await P(I,N,S);q&&(await W(q),v(null))},children:[c.jsx(mx,{className:"w-3.5 h-3.5 mr-1.5"}),p?"Generating…":"Generate"]})]})]})})]})}const wge=[{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"},{value:"90",label:"Last 90 days"},{value:"all",label:"All time"}],kge={home:"Homepage (/)","landing:smartdispensers":"Smart Dispensers (/smartdispensers)","landing:intelligence":"Intelligence index (/intelligence)","landing:privacy-policy":"Privacy Policy (/privacy-policy)"};function Rv(t){if(!t||t<=0)return"—";const e=Math.round(t/1e3);if(e<60)return`${e}s`;const n=Math.floor(e/60),r=e%60;if(n<60)return r>0?`${n}m ${r}s`:`${n}m`;const s=Math.floor(n/60),i=n%60;return i>0?`${s}h ${i}m`:`${s}h`}function Sge(t){return new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(t))}function _ge(){const[t,e]=k.useState(!0),[n,r]=k.useState(null),[s,i]=k.useState("30"),[a,o]=k.useState(""),[l,u]=k.useState("views"),[d,f]=k.useState([]),[p,m]=k.useState({views:0,uniqueReaders:0,clicks:0,totalTimeMs:0,timeSamples:0}),y=async()=>{e(!0),r(null);try{const E=s==="all"?null:new Date(Date.now()-Number(s)*24*60*60*1e3).toISOString();let C=ce.from("article_events").select("slug, event_type, click_target, session_id, duration_ms, created_at").order("created_at",{ascending:!1}).limit(5e4);E&&(C=C.gte("created_at",E));const{data:T,error:P}=await C;if(P)throw P;const{data:M,error:R}=await ce.from("news_articles").select("slug, title");if(R)throw R;const O=new Map((M??[]).map(I=>[I.slug,I.title])),L=new Map;let U=0,B=0,H=0,z=0;const V=new Set;for(const I of T??[]){const N=I.slug||"(unknown)";let W=L.get(N);
609if(W||(W={views:0,clicks:0,sessions:new Set,lastView:null,clickBreakdown:{},totalTimeMs:0,timeSamples:0},L.set(N,W)),I.event_type==="view")W.views++,U++,I.session_id&&(W.sessions.add(I.session_id),V.add(I.session_id)),(!W.lastView||I.created_at>W.lastView)&&(W.lastView=I.created_at);else if(I.event_type==="click"){W.clicks++,B++;const q=I.click_target||"other";W.clickBreakdown[q]=(W.clickBreakdown[q]??0)+1}else if(I.event_type==="duration"){const q=Number(I.duration_ms??0);q>0&&(W.totalTimeMs+=q,W.timeSamples+=1,H+=q,z+=1)}}const $=Array.from(L.entries()).map(([I,N])=>({slug:I,title:O.get(I)??kge[I]??(I==="home"?"Homepage":I),views:N.views,uniqueReaders:N.sessions.size,clicks:N.clicks,ctr:N.views>0?N.clicks/N.views:0,totalTimeMs:N.totalTimeMs,avgTimeMs:N.timeSamples>0?N.totalTimeMs/N.timeSamples:0,timeSamples:N.timeSamples,lastView:N.lastView,clickBreakdown:N.clickBreakdown}));f($),m({views:U,uniqueReaders:V.size,clicks:B,totalTimeMs:H,timeSamples:z})}catch(E){r((E==null?void 0:E.message)??"Failed to load analytics")}finally{e(!1)}};k.useEffect(()=>{y()},[s]);const g=k.useMemo(()=>{const E=a.trim().toLowerCase();return[...E?d.filter(T=>T.title.toLowerCase().includes(E)||T.slug.toLowerCase().includes(E)):d].sort((T,P)=>{if(l==="views")return P.views-T.views;if(l==="clicks")return P.clicks-T.clicks;if(l==="ctr")return P.ctr-T.ctr;const M=T.lastView?new Date(T.lastView).getTime():0;return(P.lastView?new Date(P.lastView).getTime():0)-M})},[d,a,l]),b=g.filter(E=>!E.slug.startsWith("landing:")&&E.slug!=="home"),x=g.filter(E=>E.slug.startsWith("landing:")||E.slug==="home"),w=p.views>0?p.clicks/p.views*100:0,v=p.timeSamples>0?p.totalTimeMs/p.timeSamples:0,S=p.uniqueReaders>0?p.totalTimeMs/p.uniqueReaders:0;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-3xl font-bold text-foreground",children:"Site & Article Analytics"}),c.jsx("p",{className:"mt-1 text-muted-foreground",children:"Views, unique visitors, CTA clicks, and time spent across articles, landing pages, and the homepage. New routes are tracked automatically."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[wge.map(E=>c.jsx(oe,{size:"sm",variant:s===E.value?"default":"outline",onClick:()=>i(E.value),children:E.label},E.value)),c.jsxs(oe,{variant:"outline",size:"sm",onClick:y,children:[c.jsx(IU,{className:"w-4 h-4 mr-2"}),"Refresh"]})]})]}),n&&c.jsx("p",{className:"text-sm font-medium text-destructive",children:n}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[c.jsx(Vd,{icon:c.jsx(E0,{className:"w-4 h-4"}),label:"Total views",value:p.views.toLocaleString()}),c.jsx(Vd,{icon:c.jsx(_y,{className:"w-4 h-4"}),label:"Unique visitors",value:p.uniqueReaders.toLocaleString()}),c.jsx(Vd,{icon:c.jsx(cE,{className:"w-4 h-4"}),label:"CTA clicks",value:p.clicks.toLocaleString()}),c.jsx(Vd,{icon:c.jsx(k0,{className:"w-4 h-4"}),label:"Overall CTR",value:`${w.toFixed(1)}%`})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[c.jsx(Vd,{icon:c.jsx(aO,{className:"w-4 h-4"}),label:"Total time on site",value:Rv(p.totalTimeMs)}),c.jsx(Vd,{icon:c.jsx(aO,{className:"w-4 h-4"}),label:"Avg time per visit",value:Rv(v)}),c.jsx(Vd,{icon:c.jsx(_y,{className:"w-4 h-4"}),label:"Avg time per visitor",value:Rv(S)})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsxs("div",{className:"relative flex-1 min-w-[240px]",children:[c.jsx(fR,{className:"absolute left-3 top-1/2 w-4 h-4 -translate-y-1/2 text-muted-foreground"}),c.jsx(Ue,{placeholder:"Search by title or slug...",value:a,onChange:E=>o(E.target.value),className:"pl-10"})]}),c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(Se,{className:"text-muted-foreground",children:"Sort by"}),["views","clicks","ctr","lastView"].map(E=>c.jsx(oe,{size:"sm",variant:l===E?"default":"outline",onClick:()=>u(E),children:E==="lastView"?"Last view":E.toUpperCase()},E))]})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-2xl font-bold text-foreground mb-3",children:"Landing pages & homepage"}),c.jsx(un,{children:c.jsx(Nn,{className:"p-0",children:c.jsx(y4,{rows:x,loading:t,emptyLabel:"No landing page events yet.",showRegistrants:!1})})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-2xl font-bold text-foreground mb-3",children:"Articles"}),c.jsx(un,{children:c.jsx(Nn,{className:"p-0",children:c.jsx(y4,{rows:b,loading:t,emptyLabel:"No article events yet.",showRegistrants:!1})})})]})]})}function Vd({icon:t,label:e,value:n}){return c.jsx(un,{children:c.jsxs(Nn,{className:"p-4",children:[c.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-xs",children:[t,c.jsx("span",{children:e})]}),c.jsx("p",{className:"mt-2 text-2xl font-bold text-foreground",children:n})]})})}function y4({rows:t,loading:e,emptyLabel:n}){return c.jsxs(OI,{children:[c.jsx(LI,{children:c.jsxs(gh,{children:[c.jsx(Us,{children:"Page"}),c.jsx(Us,{className:"text-right",children:"Views"}),c.jsx(Us,{className:"text-right",children:"Unique"}),c.jsx(Us,{className:"text-right",children:"Clicks"}),c.jsx(Us,{className:"text-right",children:"CTR"}),c.jsx(Us,{className:"text-right",children:"Avg time"}),c.jsx(Us,{children:"Top CTAs"}),c.jsx(Us,{children:"Last view"})]})}),c.jsx(FI,{children:e?c.jsx(gh,{children:c.jsx(Vr,{colSpan:8,className:"text-center text-sm text-muted-foreground",children:"Loading…"})}):t.length===0?c.jsx(gh,{children:c.jsx(Vr,{colSpan:8,className:"text-center text-sm text-muted-foreground",children:n})}):t.map(r=>{const s=Object.entries(r.clickBreakdown).sort((i,a)=>a[1]-i[1]);return c.jsxs(gh,{children:[c.jsxs(Vr,{children:[c.jsx("div",{className:"font-medium text-foreground",children:r.title}),c.jsx("div",{className:"text-xs text-muted-foreground",children:r.slug})]}),c.jsx(Vr,{className:"text-right font-semibold",children:r.views.toLocaleStr
609ing()}),c.jsx(Vr,{className:"text-right",children:r.uniqueReaders.toLocaleString()}),c.jsx(Vr,{className:"text-right",children:r.clicks.toLocaleString()}),c.jsxs(Vr,{className:"text-right",children:[(r.ctr*100).toFixed(1),"%"]}),c.jsx(Vr,{className:"text-right text-sm",children:r.timeSamples>0?c.jsx("span",{className:"font-medium",title:`${r.timeSamples} sample(s) · total ${Rv(r.totalTimeMs)}`,children:Rv(r.avgTimeMs)}):c.jsx("span",{className:"text-muted-foreground",children:"—"})}),c.jsx(Vr,{children:s.length===0?c.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):c.jsx("div",{className:"flex flex-wrap gap-1",children:s.slice(0,4).map(([i,a])=>c.jsxs(Yo,{variant:"secondary",className:"text-[10px]",children:[i,": ",a]},i))})}),c.jsx(Vr,{className:"text-sm text-muted-foreground",children:r.lastView?Sge(r.lastView):"—"})]},r.slug)})})]})}function Ege({userId:t}){const[e,n]=k.useState([]),[r,s]=k.useState(!0),[i,a]=k.useState(!1);k.useEffect(()=>{o()},[]);const o=async()=>{s(!0);const{data:u,error:d}=await ce.from("websites").select(`
610        *,
611        owner:owner_id (
612          email
613        )
614      `).order("created_at",{ascending:!1});d?te.error("Failed to load websites",{description:d.message}):n(u||[]),s(!1)},l=()=>{o(),a(!1)};return r?c.jsx("div",{className:"text-center py-12",children:"Loading websites..."}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs(vH,{defaultValue:"websites",className:"w-full",children:[c.jsxs(II,{className:"grid w-full grid-cols-10 max-w-7xl",children:[c.jsxs(ni,{value:"reports",className:"flex items-center gap-2",children:[c.jsx(MU,{className:"w-4 h-4"}),"Reports"]}),c.jsxs(ni,{value:"orders",className:"flex items-center gap-2",children:[c.jsx(jZ,{className:"w-4 h-4"}),"Orders"]}),c.jsxs(ni,{value:"websites",className:"flex items-center gap-2",children:[c.jsx(_0,{className:"w-4 h-4"}),"Websites"]}),c.jsxs(ni,{value:"articles",className:"flex items-center gap-2",children:[c.jsx(E0,{className:"w-4 h-4"}),"Articles"]}),c.jsxs(ni,{value:"analytics",className:"flex items-center gap-2",children:[c.jsx(k0,{className:"w-4 h-4"}),"Analytics"]}),c.jsxs(ni,{value:"registrants",className:"flex items-center gap-2",children:[c.jsx(_y,{className:"w-4 h-4"}),"Demo"]}),c.jsxs(ni,{value:"reminders",className:"flex items-center gap-2",children:[c.jsx(aZ,{className:"w-4 h-4"}),"Reminders"]}),c.jsxs(ni,{value:"game20",className:"flex items-center gap-2",children:[c.jsx(dR,{className:"w-4 h-4"}),"Game 20%"]}),c.jsxs(ni,{value:"samples",className:"flex items-center gap-2",children:[c.jsx(ds,{className:"w-4 h-4"}),"Samples"]}),c.jsxs(ni,{value:"videos",className:"flex items-center gap-2",children:[c.jsx(LU,{className:"w-4 h-4"}),"Video Links"]})]}),c.jsx(ri,{value:"reports",className:"mt-6",children:c.jsx(ope,{})}),c.jsx(ri,{value:"orders",className:"mt-6",children:c.jsx(Eme,{})}),c.jsxs(ri,{value:"websites",className:"mt-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-3xl font-bold text-foreground",children:"Websites"}),c.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage all client websites and their content"})]}),c.jsxs(oe,{onClick:()=>a(!0),children:[c.jsx(Sy,{className:"w-4 h-4 mr-2"}),"Add Website"]})]}),e.length===0?c.jsxs(un,{children:[c.jsxs(Ys,{children:[c.jsx(Xs,{children:"No websites yet"}),c.jsx(rl,{children:"Create your first website to get started"})]}),c.jsx(Nn,{children:c.jsxs(oe,{onClick:()=>a(!0),children:[c.jsx(Sy,{className:"w-4 h-4 mr-2"}),"Create Website"]})})]}):c.jsx(Cme,{websites:e,onUpdate:o})]}),c.jsxs(ri,{value:"articles",className:"mt-6",children:[c.jsxs("div",{className:"mb-6",children:[c.jsx("h2",{className:"text-3xl font-bold text-foreground",children:"News Articles"}),c.jsx("p",{className:"text-muted-foreground mt-1",children:"Review draft articles and publish or reject them"})]}),c.jsx(bge,{})]}),c.jsx(ri,{value:"analytics",className:"mt-6",children:c.jsx(_ge,{})}),c.jsx(ri,{value:"registrants",className:"mt-6",children:c.jsx(P1,{source:"demo"})}),c.jsx(ri,{value:"reminders",className:"mt-6",children:c.jsx(P1,{source:"reminder"})}),c.jsx(ri,{value:"game20",className:"mt-6",children:c.jsx(P1,{source:"game20",title:"Game 20% Sign-Ups",subtitle:"People who unlocked the ZG20 scratch-card on /intelligence"})}),c.jsx(ri,{value:"samples",className:"mt-6",children:c.jsx(P1,{source:"sample",title:"Report Sample Downloads",subtitle:"People who unlocked a free report sample on /reports"})}),c.jsx(ri,{value:"videos",className:"mt-6",children:c.jsx(jme,{})})]}),c.jsx(Tme,{open:i,onOpenChange:a,onSuccess:l})]})}const x4=Pn().trim().max(5e3,"Content is too long (max 5000 characters)");function Cge({websiteId:t,userId:e}){const[n,r]=k.useState([]),[s,i]=k.useState({}),[a,o]=k.useState({}),[l,u]=k.useState(!0),[d,f]=k.useState(!1),[p,m]=k.useState(!1);k.useEffect(()=>{y()},[t]);const y=async()=>{u(!0);const{data:w,error:v}=await ce.from("content_sections").select("*").eq("website_id",t).eq("is_enabled",!0).order("display_order");if(v){te.error("Failed to load content sections",{description:v.message}),u(!1);return}r(w||[]);const{data:S,error:E}=await ce.from("website_content").select("section_key, published_content, draft_content").eq("website_id",t);if(E){te.error("Failed to load content",{description:E.message}),u(!1);return}const C={},T={};
614S==null||S.forEach(P=>{C[P.section_key]=P.draft_content||P.published_content||"",T[P.section_key]=P.published_content||""}),i(C),o(T),u(!1)},g=(w,v)=>{i(S=>({...S,[w]:v})),m(!0)},b=async()=>{f(!0);try{const w=n.map(S=>{const E=s[S.section_key]||"",C=x4.safeParse(E);if(!C.success)throw new Error(`${S.section_label}: ${C.error.errors[0].message}`);return{website_id:t,section_key:S.section_key,draft_content:E,updated_by:e}}),{error:v}=await ce.from("website_content").upsert(w,{onConflict:"website_id,section_key"});if(v)throw v;te.success("Draft saved successfully"),m(!1)}catch(w){te.error("Failed to save draft",{description:w.message})}finally{f(!1)}},x=async()=>{f(!0);try{const w=n.map(S=>{const E=s[S.section_key]||"",C=x4.safeParse(E);if(!C.success)throw new Error(`${S.section_label}: ${C.error.errors[0].message}`);return{website_id:t,section_key:S.section_key,published_content:E,draft_content:E,last_published_at:new Date().toISOString(),updated_by:e}}),{error:v}=await ce.from("website_content").upsert(w,{onConflict:"website_id,section_key"});if(v)throw v;te.success("Content published successfully! Changes are now live."),o(s),m(!1),await y()}catch(w){te.error("Failed to publish content",{description:w.message})}finally{f(!1)}};return l?c.jsx("div",{className:"text-center py-12",children:"Loading content editor..."}):n.length===0?c.jsx(un,{children:c.jsxs(Ys,{children:[c.jsx(Xs,{children:"No Content Sections"}),c.jsx(rl,{children:"Please contact your administrator to configure content sections for your website."})]})}):c.jsx("div",{className:"space-y-6",children:c.jsxs(un,{children:[c.jsx(Ys,{children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Xs,{children:"Content Editor"}),c.jsx(rl,{children:"Edit your website content and preview changes before publishing"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(oe,{variant:"outline",onClick:b,disabled:!p||d,children:[c.jsx(DU,{className:"w-4 h-4 mr-2"}),"Save Draft"]}),c.jsxs(oe,{onClick:x,disabled:!p||d,children:[c.jsx(yR,{className:"w-4 h-4 mr-2"}),"Publish"]})]})]})}),c.jsx(Nn,{children:c.jsxs(vH,{defaultValue:"edit",className:"w-full",children:[c.jsxs(II,{className:"grid w-full grid-cols-2",children:[c.jsx(ni,{value:"edit",children:"Edit"}),c.jsx(ni,{value:"preview",children:"Preview"})]}),c.jsx(ri,{value:"edit",className:"space-y-6 mt-6",children:n.map(w=>c.jsxs("div",{className:"space-y-2",children:[c.jsx(Se,{htmlFor:w.section_key,children:w.section_label}),w.section_type==="textarea"?c.jsx(ca,{id:w.section_key,value:s[w.section_key]||"",onChange:v=>g(w.section_key,v.target.value),rows:6,className:"mt-2"}):c.jsx(Ue,{id:w.section_key,type:w.section_type==="url"?"url":"text",value:s[w.section_key]||"",onChange:v=>g(w.section_key,v.target.value),className:"mt-2"})]},w.id))}),c.jsx(ri,{value:"preview",className:"space-y-6 mt-6",children:c.jsxs("div",{className:"bg-muted/50 rounded-lg p-6 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(uR,{className:"w-5 h-5 text-accent"}),c.jsx("h3",{className:"font-semibold text-foreground",children:"Content Preview"})]}),n.map(w=>c.jsxs("div",{className:"space-y-2",children:[c.jsx(Se,{className:"text-sm text-muted-foreground",children:w.section_label}),c.jsx("div",{className:"bg-background p-4 rounded border border-border",children:c.jsx("p",{className:"text-foreground whitespace-pre-wrap",children:s[w.section_key]||"(Empty)"})})]},w.id))]})})]})})]})})}function Age({userId:t}){const[e,n]=k.useState(null),[r,s]=k.useState(!0);k.useEffect(()=>{i()},[t]);const i=async()=>{s(!0);const{data:a,error:o}=await ce.from("websites").select("*").eq("owner_id",t).maybeSingle();o?te.error("Failed to load website",{description:o.message}):a?n(a):te.error("No website found",{description:"Please contact your administrator"}),s(!1)};return r?c.jsx("div",{className:"text-center py-12",children:"Loading your website..."}):e?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-3xl font-bold text-foreground",children:e.name}),c.jsx("p",{className:"text-muted-foreground mt-1",children:e.domain})]}),c.jsx(Cge,{websiteId:e.id,userId:t})]}):c.jsx(un,{children:c.jsxs(Ys,{children:[c.jsx(Xs,{children:"No Website Assigned"}),c.jsx(rl,{children:"Please contact your administrator to get access to a website."})]})})}function Tge(){const t=Rd(),[e,n]=k.useState(null),[r,s]=k.useState(!1),[i,a]=k.useState(!0);k.useEffect(()=>{o();const{data:{subscription:d}}=ce.auth.onAuthStateChange((f,p)=>{p?(n(p.user),l(p.user.id)):t("/admin")});return()=>d.unsubscribe()},[t]);const o=async()=>{const{data:{session:d}}=await ce.auth.getSession();if(!d){t("/admin");return}n(d.user),await l(d.user.id),a(!1)},l=async d=>{const{data:f,error:p}=await ce.from("user_roles").select("role").eq("user_id",d).eq("role","admin").maybeSingle();s(!!(!p&&f))},u=async()=>{const{error:d}=await ce.auth.signOut();d?te.error("Logout failed",{description:d.message}):(te.success("Logged out successfully"),t("/admin"))};return i?c.jsx("div",{className:"min-h-screen flex items-center justify-center",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-accent mx-auto mb-4"}),c.jsx("p",{className:"text-muted-foreground",children:"Loading..."})]})}):c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsx("header",{className:"border-b border-border bg-card",children:c.jsx("div",{className:"container mx-auto px-6 py-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[r?c.jsx(_y,{className:"w-6 h-6 text-accent"}):c.jsx(_0,{className:"w-6 h-6 text-accent"}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-xl font-bold text-foreground",children:r?"Super Admin Dashboard":"Website Admin"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:e==null?void 0:e.email})]})]}),c.jsxs(oe,{onClick:u,variant:"outline",size:"sm",children:[c.jsx(_Z,{className:"w-4 h-4 mr-2"}),"Logout"]})]})})}),c.jsx("main",{className:"container mx-auto px-6 py-8",children:r?c.jsx(Ege,{userId:e==null?void 0:e.id}):c.jsx(Age,{userId:e==null?void 0:e.id})})]})}const jge=cp({password:Pn().min(8,"Password must be at least 8 characters").max(100)});function Nge(){const t=Rd(),[e,n]=k.useState(""),[r,s]=k.useState(!1),[i,a]=k.useState(!1);k.useEffect(()=>{const{data:{subscription:l}}=ce.auth.onAuthStateChange((u,d)=>{(u==="PASSWORD_RECOVERY"||u==="SIGNED_IN"&&d)&&a(!0)});return ce.auth.getSession().then(({data:{session:u}})=>{u&&a(!0)}),()=>l.unsubscribe()},[]);const o=async l=>{l.preventDefault();const u=jge.safeParse({password:e});if(!u.success){te.error(u.error.errors[0].message);return}s(!0);try{const{error:d}=await ce.auth.updateUser({password:u.data.password});if(d){te.error("Could not update password",{description:d.message});return}te.success("Password updated successfully"),t("/admin/dashboard")}finally{s(!1)}};return c.jsxs("main",{className:"min-h-screen flex items-center justify-center bg-gradient-subtle p-4",children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Reset Password | Ze
614nith Global Commercial"}),c.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),c.jsxs(un,{className:"w-full max-w-md",children:[c.jsxs(Ys,{className:"text-center",children:[c.jsx("div",{className:"mx-auto w-12 h-12 bg-accent/10 rounded-full flex items-center justify-center mb-4",children:c.jsx(kZ,{className:"w-6 h-6 text-accent"})}),c.jsx(Xs,{className:"text-2xl",children:"Set new password"}),c.jsx(rl,{children:i?"Enter your new password below":"Open this page from the password reset link in your email"})]}),c.jsx(Nn,{children:c.jsxs("form",{onSubmit:o,className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"password",children:"New password"}),c.jsx(Ue,{id:"password",type:"password",placeholder:"••••••••",value:e,onChange:l=>n(l.target.value),required:!0,minLength:8,className:"mt-2",disabled:!i})]}),c.jsx(oe,{type:"submit",className:"w-full",disabled:r||!i,children:r?"Updating...":"Update password"})]})})]})]})}const Pge=()=>c.jsxs("main",{className:"min-h-screen bg-background py-12 px-6",children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Privacy Policy | Zenith Global Commercial"}),c.jsx("meta",{name:"description",content:"Privacy policy for Zenith Global Commercial Ltd covering data collection, usage, and protection for report sales and customer data."}),c.jsx("link",{rel:"canonical",href:"https://waterdispenseinsights.com/privacy-policy"})]}),c.jsxs("article",{className:"container mx-auto max-w-4xl",children:[c.jsx("h1",{className:"text-4xl font-bold mb-8 text-foreground",children:"Privacy Policy – Report Sales & Customer Data"}),c.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:"Last updated: 2025"}),c.jsxs("div",{className:"prose prose-slate max-w-none space-y-6 text-foreground",children:[c.jsx("p",{children:'This Privacy Policy explains how Zenith Global Commercial Ltd ("we", "us", "our") collects, uses, stores, and protects your personal data when you purchase or enquire about our market reports, databases, or related services.'}),c.jsx("p",{children:"By placing an order, submitting a purchase form, requesting a quote, or communicating with us, you acknowledge that you have read and understood this Privacy Policy."}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"1. Who We Are (Data Controller)"}),c.jsxs("p",{children:["Zenith Global Commercial Ltd",c.jsx("br",{}),"71–75 Shelton Street",c.jsx("br",{}),"Covent Garden",c.jsx("br",{}),"London",c.jsx("br",{}),"WC2H 9JQ",c.jsx("br",{}),"United Kingdom"]}),c.jsx("p",{children:"We act as the data controller for the personal data we collect in connection with report sales."}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"2. What Personal Data We Collect"}),c.jsx("p",{children:"Depending on how you interact with us (purchase, enquiry, invoice request, email exchange), we may collect:"}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"A. Identity & Contact Details"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Name"}),c.jsx("li",{children:"Job title"}),c.jsx("li",{children:"Company name"}),c.jsx("li",{children:"Business email address"}),c.jsx("li",{children:"Phone number"}),c.jsx("li",{children:"Country"}),c.jsx("li",{children:"Billing address"})]}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"B. Transaction & Purchase Information"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Details of the report(s) or service(s) ordered"}),c.jsx("li",{children:"Purchase amount and currency"}),c.jsx("li",{children:"VAT / tax information"}),c.jsx("li",{children:"Purchase order numbers"}),c.jsx("li",{children:"Invoicing details"}),c.jsx("li",{children:"Delivery preferences (e.g., digital download email, file access permissions)"})]}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"C. Payment Information"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"We do not store full payment card information."}),c.jsx("li",{children:"Payments may be processed through third-party providers (e.g., Str
614ipe, bank transfer)."}),c.jsx("li",{children:"We may store transaction IDs, payment confirmation, and billing metadata."})]}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"D. Communication Data"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Emails, messages, and correspondence related to your purchase"}),c.jsx("li",{children:"Support and customer-service interactions"})]}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"E. Technical Data"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"IP address, device type, and minimal log data for fraud prevention"}),c.jsx("li",{children:"Download logs for digital products to ensure licensing compliance"})]}),c.jsx("p",{className:"italic",children:"We do not collect special category data (health, beliefs, biometric, etc.) for report sales."}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"3. Why We Use Your Data (Purposes & Legal Bases)"}),c.jsx("p",{children:"We process your data only for legitimate business purposes and always in line with UK GDPR."}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"1. To process your order and deliver your report"}),c.jsx("p",{children:"Includes:"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Issuing invoices"}),c.jsx("li",{children:"Processing payments"}),c.jsx("li",{children:"Providing download links or digital files"}),c.jsx("li",{children:"Enabling access to password-protected portals"})]}),c.jsx("p",{children:"Legal basis: Contract performance (Article 6(1)(b)), Legitimate interests (fulfilling and protecting our business operations)"}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"2. To verify licensing and usage rights"}),c.jsx("p",{children:"Our reports are licensed products. We may use your data to:"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Confirm authorised users"}),c.jsx("li",{children:"Detect unauthorised sharing or distribution"}),c.jsx("li",{children:"Enforce our report licensing terms"})]}),c.jsx("p",{children:"Legal basis: Legitimate interests (protecting intellectual property)"}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"3. To communicate with you"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Sending order confirmations"}),c.jsx("li",{children:"Providing receipts, invoices, and delivery details"}),c.jsx("li",{children:"Responding to your enquiries"}),c.jsx("li",{children:"Sending important service updates (e.g., updated files, corrections)"})]}),c.jsx("p",{children:"Legal basis: Contract performance"}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"4. To manage our internal sales, accounting, and compliance obligations"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Record keeping"}),c.jsx("li",{children:"Tax and VAT compliance"}),c.jsx("li",{children:"Fraud prevention"}),c.jsx("li",{children:"Audit requirements"})]}),c.jsx("p",{children:"Legal basis: Legal obligation, Legitimate interests"}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"5. To offer related or relevant report updates"}),c.jsx("p",{children:"We may send you:"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Information about updated versions of the report you purchased"}),c.jsx("li",{children:"Related regional or category reports (e.g., East/West Europe if you purchased individual markets)"})]}),c.jsx("p",{children:"Legal basis: Legitimate interests (reasonable expectation of updates to products you purchased)"}),c.jsx("p",{children:"You may unsubscribe at any time. We do not add you to general marketing lists without your consent."}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"4. How We Share Your Personal Data"}),c.jsx("p",{className:"font-semibold",children:"We do not sell your data."}),c.jsx("p",{children:"We may share your data with:"}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"Internal Teams"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Sales, research, and operations staff processing your order"}),c.jsx("li",{children:"Finance teams handling invoicing and payments"})]}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"Trusted Service Providers (Processors)"}),c.jsx("p",{children:"Such as:"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Payment processors (e.g., Str
614ipe, banks)"}),c.jsx("li",{children:"Cloud storage providers"}),c.jsx("li",{children:"Digital delivery and file-sharing platforms"}),c.jsx("li",{children:"Email service providers"}),c.jsx("li",{children:"CRM and invoicing systems"}),c.jsx("li",{children:"Analytics and security tools (minimal data only)"})]}),c.jsx("p",{children:"All service providers operate under strict confidentiality and data-processing agreements."}),c.jsx("h3",{className:"text-xl font-semibold mt-6 mb-3",children:"Legal and Regulatory Bodies"}),c.jsx("p",{children:"Where required to:"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Respond to lawful requests"}),c.jsx("li",{children:"Comply with tax, regulatory, or court obligations"})]}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"5. International Data Transfers"}),c.jsx("p",{children:"Some service providers may be located outside the UK/EEA."}),c.jsx("p",{children:"Where international transfers occur, we ensure appropriate safeguards such as:"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Adequacy decisions"}),c.jsx("li",{children:"Standard Contractual Clauses (SCCs)"}),c.jsx("li",{children:"Other legally recognised mechanisms"})]}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"6. How Long We Keep Your Data"}),c.jsx("p",{children:"We retain your data only as long as necessary for the purposes above."}),c.jsx("p",{children:"Typical retention periods:"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Invoices, transactions, and VAT documentation: up to 7 years (legal requirement)"}),c.jsx("li",{children:"Customer correspondence and purchase history: 5–7 years"}),c.jsx("li",{children:"Digital delivery logs: 3–5 years"}),c.jsx("li",{children:"Email communication: up to 3 years, unless required longer for legal purposes"})]}),c.jsx("p",{children:"When no longer required, data is securely deleted or anonymised."}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"7. How We Protect Your Data"}),c.jsx("p",{children:"We implement appropriate organisational and technical security measures, including:"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Controlled access to customer files"}),c.jsx("li",{children:"Encryption of stored and transmitted data"}),c.jsx("li",{children:"Secure payment gateways"}),c.jsx("li",{children:"Regular security reviews"}),c.jsx("li",{children:"Monitoring for unauthorised access or distribution"})]}),c.jsx("p",{children:"No online service can be completely secure, but we take reasonable steps to protect your data at all times."}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"8. Your Rights Under UK GDPR"}),c.jsx("p",{children:"You have the right to request:"}),c.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[c.jsx("li",{children:"Access to your personal data"}),c.jsx("li",{children:"Correction of inaccurate data"}),c.jsx("li",{children:"Deletion of data (subject to legal retention requirements)"}),c.jsx("li",{children:"Restriction of processing"}),c.jsx("li",{children:"Objection to processing based on legitimate interests"}),c.jsx("li",{children:"Data portability where applicable"})]}),c.jsx("p",{children:"You also have the right to lodge a complaint with the ICO (Information Commissioner's Office)."}),c.jsx("p",{children:"We may need to verify your identity before responding."}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"9. Children's Data"}),c.jsx("p",{children:"Our reports and services are intended for business professionals. We do not knowingly collect data from children."}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"10. Updates to This Privacy Policy"}),c.jsx("p",{children:"We may update this Privacy Policy from time to time."}),c.jsx("p",{children:'When we do, we will update the "Last updated" date at the top of this page.'}),c.jsx("h2",{className:"text-2xl font-bold mt-8 mb-4",children:"11. Contact Us"}),c.jsx("p",{children:"If you have questions about this Privacy Policy or how we process your data, contact:"}),c.jsxs("p",{children:["Zenith Global Commercial Ltd",c.jsx("br",{}),"71–75 Shelton Street",c.jsx("br",{}),"Covent Garden",c.jsx("br",{}),"London",c.jsx("br",{}),"WC2H 9JQ",c.jsx("br",{}),"United Kingdom",c.jsx("br",{}),"Email: ",c.jsx("a",{className:"underline",href:"mailto:[email protected]",children:"[email protected]"}),c.jsx("br",{}),"Phone: ",c.jsx("a",{className:"underline",href:"tel:+442033690036",children:"+44 20 3369 0036"})]})]})]})]});function v8(){const[t,e]=k.useState(!1),[n,r]=k.useState(!0);return k.useEffect(()=>{let s=!0;const i=async o=>{if(!o){s&&(e(!1),r(!1));return}const{data:l}=await ce.from("user_roles").select("role").eq("user_id",o).eq("role","admin").maybeSingle();s&&(e(!!l),r(!1))};ce.auth.getSession().then(({data:{session:o}})=>{var l;i((l=o==null?void 0:o.user)==null?void 0:l.id)});const{data:{subscription:a}}=ce.auth.onAuthStateChange((o,l)=>{var u;r(!0),i((u=l==null?void 0:l.user)==null?void 0:u.id)});return()=>{s=!1,a.unsubscribe()}},[]),{isAdmin:t,loading:n}}const Rge=1,Ige="cfe233cb-976c-48a1-b441-4e93edfb7595",Dge="3f9a82a5-d0b2-4316-963e-c28da70ebb78",Mge="/__l5e/assets-v1/cfe233cb-976c-48a1-b441-4e93edfb7595/akos-petri-headshot.png",Oge="a/v1/3f9a82a5-d0b2-4316-963e-c28da70ebb78/cfe233cb-976c-48a1-b441-4e93edfb7595/akos-petri-headshot.png",Lge="akos-petri-headshot.png",Fge=889596,Bge="image/png",$ge="2026-07-08T22:33:19Z",b8={version:Rge,asset_id:Ige,project_id:Dge,url:Mge,r2_key:Oge,original_filename:Lge,size:Fge,content_type:Bge,created_at:$ge},Uge="/assets/china-report-cover-CoZruN71.png",w8=({className:t="",variant:e="default"})=>{const n=e==="featured";return c.jsxs("a",{href:"https://chinareport.zenithmarketintel.com",target:"_blank",rel:"noopener noreferrer",className:`group relative block overflow-hidden rounded-xl border border-[#c9a84c]/40 bg-gradient-to-br from-[#06101f] via-[#0a1628] to-[#102444] text-white shadow-[0_10px_40px_-15px_rgba(10,22,40,0.7)] transition-transform hover:-translate-y-0.5 no-underline ${t}`,"aria-label":"Open the Zenith Consulting China Private-Label Water Opportunity 2026 report",children:[c.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 opacity-40",style:{background:"radial-gradient(circle at 85% 15%, rgba(74,222,228,0.25), transparent 55%), radial-gradient(circle at 10% 90%, rgba(201,168,76,0.18), transparent 55%)"}}),c.jsxs("div",{className:`relative flex flex-col items-start gap-5 p-5 sm:flex-row sm:items-center sm:gap-6 sm:p-6 ${n?"md:p-8":""}`,children:[c.jsx("img",{src:Uge,alt:"China Private-Label Water Opportunity 2026 — Executive Intelligence Report cover",className:`flex-shrink-0 rounded-md shadow-2xl ring-1 ring-white/10 ${n?"h-40 w-auto sm:h-52":"h-32 w-auto sm:h-36"}`,loading:"lazy"}),c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#c9a84c] px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-[0.15em] text-[#0a1628]",children:[c.jsx(eb,{className:"size-3"})," Paid · Exclusive"]}),c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-[#f0d78c]",children:"Zenith Executive Intelligence Report"})]}),c.jsx("p",{className:`mt-2 font-serif leading-snug ${n?"text-xl sm:text-2xl":"text-lg sm:text-xl"}`,children:"China Private-Label Water Opportunity 2026"}),c.jsx("p",{className:"mt-1.5 text-sm text-white/75",children:"China's next water winners will control channels, not just brands. Private label, channel control and the margin reset — the executive intelligence read for operators, investors and CPG strategy teams sizing the China opportunity."}),c.jsxs("span",{className:"mt-3 inline-flex items-center gap-1.5 rounded-full bg-[#c9a84c] px-4 py-2 text-sm font-semibold text-[#0a1628] transition-transform group-hover:translate-x-0.5",children:["Access the report",c.jsx(Jn,{className:"size-4"})]})]})]})]})},k8=({className:t=""})=>c.jsxs("section",{"aria-label":"Zenith Consulting",className:`relative overflow-hidden rounded-2xl border border-border bg-primary text-primary-foreground shadow-elegant ${t}
614`,children:[c.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 opacity-60",style:{background:"radial-gradient(60% 80% at 0% 0%, hsl(var(--accent) / 0.30), transparent 60%), radial-gradient(50% 80% at 100% 100%, hsl(var(--accent) / 0.18), transparent 60%)"}}),c.jsxs("div",{className:"relative grid gap-6 p-6 sm:p-8 md:grid-cols-[1.4fr_auto] md:items-center md:gap-10 md:p-10",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold leading-tight tracking-tight md:text-3xl",children:"Need More Than the Report?"}),c.jsx("p",{className:"mt-3 max-w-2xl text-sm leading-7 text-primary-foreground/80 md:text-base",children:"If you are entering a market, assessing an acquisition or investigating a competitor, we can build additional research around your specific commercial question."})]}),c.jsxs("a",{href:"https://zenithmarketintel.com/consulting",target:"_blank",rel:"noopener noreferrer",className:"group inline-flex w-fit items-center gap-2 rounded-full bg-accent px-6 py-3.5 text-sm font-semibold text-accent-foreground shadow-sm transition-all hover:-translate-y-0.5 hover:shadow-glow no-underline",children:["Discuss Your Market",c.jsx(Yr,{className:"size-4 transition-transform group-hover:translate-x-0.5"})]})]})]}),Cp="hsl(200 80% 15%)",zge="hsl(75 85% 60%)",Vge=()=>typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform),Wge=()=>typeof navigator<"u"&&/Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent),v4=()=>typeof navigator<"u"&&typeof navigator.share=="function",Hge=(t,e)=>{if(typeof window>"u")return;let n=!1;const r=()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("pagehide",i)},s=()=>{document.visibilityState==="hidden"&&(n=!0,r())},i=()=>{n=!0,r()};document.addEventListener("visibilitychange",s),window.addEventListener("pagehide",i),window.location.href=t,window.setTimeout(()=>{r(),n||window.open(e,"_blank","noopener,noreferrer")},900)},b4=(t,e,n)=>{var s;t.preventDefault(),t.stopPropagation();const r=Vge()?"⌘ + D":"Ctrl + D";if((s=window.sidebar)!=null&&s.addPanel){window.sidebar.addPanel(n,e,"");return}te.success(`Press ${r} to bookmark this page`,{description:"Browsers don't allow auto-bookmarking, but it's just one shortcut away.",duration:5e3})},S8=({url:t,title:e,variant:n="full",className:r=""})=>{const[s,i]=k.useState(!1),a="aofirryrieneitjliizs";let o=t;try{const b=new URL(t),x=`${b.pathname}${b.search}${b.hash}`;o=`https://${a}.supabase.co/functions/v1/og-render?path=${encodeURIComponent(x)}`}catch{}const l=encodeURIComponent(o),u=encodeURIComponent(t),d=encodeURIComponent(e),f={linkedin:`https://www.linkedin.com/sharing/share-offsite/?url=${l}`,facebook:`https://www.facebook.com/sharer/sharer.php?u=${l}`,twitter:`https://twitter.com/intent/tweet?url=${l}&text=${d}`},p=b=>x=>{if(x.stopPropagation(),!Wge())return;x.preventDefault();const w=f[b],v=b==="linkedin"?`linkedin://shareArticle?mini=true&url=${u}`:`fb://facewebmodal/f?href=${encodeURIComponent(w)}`;Hge(v,w)},m=async b=>{b.preventDefault(),b.stopPropagation();try{await navigator.share({title:e,url:t})}catch{}},y=async b=>{b.preventDefault(),b.stopPropagation();try{await navigator.clipboard.writeText(t),i(!0),setTimeout(()=>i(!1),1800)}catch{}},g=b=>b.stopPropagation();if(n==="compact"){const b="inline-flex items-center justify-center w-8 h-8 rounded-md transition-colors",x={backgroundColor:"rgba(0,0,0,0.04)",color:"#3A3A45"};return c.jsxs("div",{className:`flex items-center gap-1.5 ${r}`,children:[v4()&&c.jsx("button",{type:"button",onClick:m,"aria-label":"Share",className:b,style:x,children:c.jsx(cO,{className:"w-4 h-4"})}),c.jsx("a",{href:f.linkedin,target:"_blank",rel:"noopener noreferrer",onClick:p("linkedin"),"aria-label":"Share on LinkedIn",className:b,style:x,children:c.jsx(hc,{className:"w-4 h-4"})}),c.jsx("a",{href:f.facebook,target:"_blank",rel:"noopener noreferrer",onClick:p("facebook"),"aria-label":"Share on Facebook",className:b,style:x,children:c.jsx(oO,{className:"w-4 h-4"})}),c.jsx("button",{type:"button",onClick:w=>b4(w,t,e),"aria-label":"Bookmark this article",className:b,style:x,children:c.jsx(iO,{className:"w-4 h-4"})}),c.jsx("button",{type:"button",onClick:y,"aria-label":"Copy link",className:b,style:{...x,color:s?Cp:"#3A3A45"},children:s?c.jsx(oa,{className:"w-4 h-4"}):c.jsx(lO,{className:"w-4 h-4"})})]})}return c.jsx("section",{className:`rounded-xl p-5 md:p-6 ${r}`,style:{backgroundColor:"#F4F2EE",border:"1px solid rgba(0,0,0,0.12)"},"aria-label":"Share this article",children:c.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold mb-0.5",style:{color:"#0A0A0F"},children:"Found this useful? Share or save it."}),c.jsx("p",{className:"text-xs",style:{color:"#5A5A66"},children:"Help your network stay ahead of the water dispense market."})]}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[v4()&&c.jsxs("button",{type:"button",onClick:m,className:"inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-semibold transition-transform hover:scale-105",style:{backgroundColor:zge,color:Cp},children:[c.jsx(cO,{className:"w-4 h-4"}),"Share"]}),c.jsxs("a",{href:f.linkedin,target:"_blank",rel:"noopener noreferrer",onClick:p("linkedin"),className:"inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-semibold transition-transform hover:scale-105",style:{backgroundColor:"#0A66C2",color:"#FFFFFF"},children:[c.jsx(hc,{className:"w-4 h-4"}),"LinkedIn"]}),c.jsxs("a",{href:f.facebook,target:"_blank",rel:"noopener noreferrer",onClick:p("facebook"),className:"inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-semibold transition-transform hover:scale-105",style:{backgroundColor:"#1877F2",color:"#FFFFFF"},children:[c.jsx(oO,{className:"w-4 h-4"}),"Facebook"]}),c.jsxs("a",{href:f.twitter,target:"_blank",rel:"noopener noreferrer",onClick:g,className:"inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-semibold transition-transform hover:scale-105",style:{backgroundColor:Cp,color:"#FFFFFF"},children:[c.jsx(DZ,{className:"w-4 h-4"}),"X / Twitter"]}),c.jsxs("button",{type:"button",onClick:b=>b4(b,t,e),className:"inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-semibold transition-transform hover:scale-105",style:{backgroundColor:"transparent",color:Cp,border:`1px solid ${Cp}`},children:[c.jsx(iO,{className:"w-4 h-4"}),"Bookmark"]}),c.jsxs("button",{type:"button",onClick:y,className:"inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-semibold transition-colors",style:{backgroundColor:"transparent",color:s?Cp:"#0A0A0F",border:"1px solid rgba(0,0,0,0.2)"},children:[s?c.jsx(oa,{className:"w-4 h-4"}):c.jsx(lO,{className:"w-4 h-4"}),s?"Copied":"Copy link"]})]})]})})},qge="/assets/infographs-library-preview-DSwLEeQ2.jpeg",vN=({className:t="",variant:e="default"})=>{const n=e==="featured";return c.jsxs("a",{href:"https://zenithmarketintel.com/zenithinfographs",target:"_blank",rel:"noopener noreferrer","aria-label":"Explore the free Zenith Infographs Library — 50+ premium visuals",className:`not-prose group relative block overflow-hidden rounded-2xl border text-white no-underline transition-all duration-500 hover:-translate-y-0.5 ${t}`,style:{background:"linear-gradient(135deg, #04101e 0%, #071a2e 55%, #0d2742 100%)",borderColor:"rgba(74, 222, 128, 0.30)",boxShadow:"0 20px 50px -20px rgba(0,0,0,0.55)"},children:[c.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 opacity-60",style:{background:"radial-gradient(circle at 85% 15%, rgba(74,222,128,0.22), transparent 55%), radial-gradient(circle at 10% 90%, rgba(96,165,250,0.20), transparent 55%)"}}),c.jsxs("div",{className:`relative flex flex-col items-stretch gap-5 p-5 sm:flex-row sm:items-center sm:gap-6 sm:p-6 ${n?"md:p-8 md:gap-8":""}`,children:[c.jsxs("div",{className:"relative flex-shrink-0 overflow-hidden rounded-md ring-1 ring-white/10 shadow-2xl",children:[c.jsx("img",{src:qge,alt:"Preview of the Zenith Infographs Library — 50+ premium food, beverage and water strategy visuals",className:`block w-full sm:w-auto object-cover object-top ${n?"h-44 sm:h-56 md:h-64":"h-36 sm:h-40"}`,loading:"lazy"}),c.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-t from-[#04101e]/40 to-transparent"})]}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-[0.15em]",style:{backgroundColor:"#4ade80",color:"#04101e"},children:[c.jsx(SZ,{className:"size-3"})," Free · 50+ visuals"]}
614),c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.18em]",style:{color:"#a7f3d0"},children:"Zenith Infographs Library"})]}),c.jsx("p",{className:`mt-2 leading-snug text-white ${n?"text-xl sm:text-2xl md:text-3xl":"text-lg sm:text-xl"}`,style:{fontFamily:"Georgia, 'Times New Roman', serif",letterSpacing:"-0.01em"},children:"Explore our infograph library — strategy visuals for food, beverage & water leaders."}),c.jsx("p",{className:"mt-2 text-sm text-white/75",children:"M&A deals, category growth, brand ownership, profit pools and more — at a glance. Free access for operators, investors and CPG strategy teams."}),c.jsxs("span",{className:"mt-4 inline-flex items-center gap-1.5 rounded-full px-4 py-2 text-sm font-semibold transition-transform duration-300 group-hover:translate-x-0.5",style:{backgroundColor:"#4ade80",color:"#04101e"},children:["Browse the library",c.jsx(Yr,{className:"size-4"})]})]})]})]})},w4="https://aofirryrieneitjliizs.supabase.co/functions/v1/track-article-event",k4="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFvZmlycnlyaWVuZWl0amxpaXpzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjAwMTY2NDAsImV4cCI6MjA3NTU5MjY0MH0.95iCS2r8wC5eH1Vo1uXQBLvHx6E0hg6bwvGBBh7rH-c",S4="wdi_session_id",Gge="wdi_viewed:",Kge=30*60*1e3;function $I(){var t,e;if(typeof window>"u")return"";try{let n=window.localStorage.getItem(S4);return n||(n=((e=(t=window.crypto)==null?void 0:t.randomUUID)==null?void 0:e.call(t))??`s_${Math.random().toString(36).slice(2)}_${Date.now()}`,window.localStorage.setItem(S4,n)),n}catch{return""}}function UI(t){const e=JSON.stringify(t);try{if(typeof navigator<"u"&&navigator.sendBeacon){const n=new Blob([e],{type:"application/json"});if(navigator.sendBeacon(w4,n))return}fetch(w4,{method:"POST",headers:{"Content-Type":"application/json",apikey:k4,Authorization:`Bearer ${k4}`},body:e,keepalive:!0}).catch(()=>{})}catch{}}function Yge(t){const e=(t||"/").replace(/\/+$/,"")||"/";if(e==="/")return"home";if(e.startsWith("/admin")||e.startsWith("/reset-password")||e.startsWith("/unsubscribe"))return"";const n=e.match(/^\/intelligence\/(.+)$/)||e.match(/^\/news\/(.+)$/);return n?n[1]:`landing:${e.replace(/^\/+/,"").replace(/\//g,"-")}`}function _8(t){if(!(typeof window>"u"||!t)){try{const e=`${Gge}${t}`,n=Number(window.sessionStorage.getItem(e)??"0");if(n&&Date.now()-n<Kge)return;window.sessionStorage.setItem(e,String(Date.now()))}catch{}UI({slug:t,eventType:"view",sessionId:$I(),referrer:typeof document<"u"&&document.referrer||null})}}function Xge(t,e){typeof window>"u"||!t||UI({slug:t||"home",eventType:"click",clickTarget:e,sessionId:$I(),referrer:typeof document<"u"&&document.referrer||null})}function Zge(t){k.useEffect(()=>{if(typeof window>"u"||!t)return;let e=typeof document<"u"&&document.visibilityState==="visible"?Date.now():null,n=0,r=!1;const s=()=>
614{if(r||(e!=null&&(n+=Date.now()-e,e=null),n<1e3))return;const a=Math.min(n,2*60*60*1e3);r=!0,UI({slug:t,eventType:"duration",durationMs:a,sessionId:$I()})},i=()=>{document.visibilityState==="hidden"?(e!=null&&(n+=Date.now()-e,e=null),s()):document.visibilityState==="visible"&&!r&&(e=Date.now())};return document.addEventListener("visibilitychange",i),window.addEventListener("pagehide",s),()=>{document.removeEventListener("visibilitychange",i),window.removeEventListener("pagehide",s),s()}},[t])}function bN(t,e){t&&(e==="view"?_8(t):Xge(t,"article_card"))}const _4=(t,e=200)=>t?t.replace(/<(script|style)[\s\S]*?<\/\1>/gi," ").replace(/<\/?[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/```[\s\S]*?```/g," ").replace(/!\[[^\]]*\]\([^)]*\)/g," ").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/[#>*_`~]+/g," ").replace(/^\s*-\s+/gm," ").replace(/\s+/g," ").trim().slice(0,e):"",Qge=t=>new Date(t).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).toUpperCase(),Jge=()=>{const[t,e]=k.useState([]),[n,r]=k.useState(!0),[s,i]=k.useState(!1),[a,o]=k.useState("All"),{isAdmin:l,loading:u}=v8();k.useEffect(()=>{if(typeof window>"u")return;const g=new URLSearchParams(window.location.search).get("topic");if(g){const b=["All",...Uf].find(x=>x===g);b&&o(b)}},[]);const d=async()=>{r(!0),i(!1);let y=ce.from("news_articles").select("id, title, slug, excerpt, content, cover_image_url, thumbnail_url, published_at, is_published, topic").order("published_at",{ascending:!1}).limit(1e3);l||(y=y.eq("is_published",!0));const{data:g,error:b}=await y;b?i(!0):e(g??[]),r(!1)};k.useEffect(()=>{u||d()},[u,l]);const f=k.useMemo(()=>t.map(y=>({...y,resolvedTopic:y.topic||a_({title:y.title,excerpt:y.excerpt,content:y.content})})),[t]),p=k.useMemo(()=>a==="All"?f:f.filter(y=>y.resolvedTopic===a),[f,a]),m=y=>f.length-f.findIndex(g=>g.id===y);return c.jsxs("main",{className:"min-h-screen",style:{backgroundColor:"#F4F2EE",color:"#1A1A1A"},children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Water Dispense Intelligence | European Market Insights, Regulation & Strategy"}),c.jsx("meta",{name:"description",content:"Strategic water dispense market intelligence for operators, investors and suppliers covering BWD, POU, ITS, regulation, consolidation, sustainability and European market growth."}),c.jsx("meta",{name:"keywords",content:"water dispense intelligence, water cooler market, BWD, POU, ITS, M&A, PFAS, PPWR, ESG, regulation, consolidation, Europe, USA"}),c.jsx("meta",{name:"robots",content:"index, follow, max-image-preview:large, max-snippet:-1"}),c.jsx("link",{rel:"canonical",href:"https://waterdispenseinsights.com/intelligence"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{property:"og:site_name",content:"Zenith Global Commercial"}),c.jsx("meta",{property:"og:title",content:"Water Dispense Intelligence | European Market Insights, Regulation & Strategy"}),c.jsx("meta",{property:"og:description",content:"Strategic water dispense market intelligence for operators, investors and suppliers covering BWD, POU, ITS, regulation, consolidation, sustainability and European market growth."}),c.jsx("meta",{property:"og:url",content:"https://waterdispenseinsights.com/intelligence"}),c.jsx("meta",{property:"og:image",content:"https://waterdispenseinsights.com/og-intelligence.jpg"}),c.jsx("meta",{property:"og:image:width",content:"1200"}),c.jsx("meta",{property:"og:image:height",content:"630"}),c.jsx("meta",{property:"og:image:alt",content:"Zenith Water Dispense Intelligence"}),c.jsx("meta",{property:"og:locale",content:"en_GB"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:"Water Dispense Intelligence | European Market Insights, Regulation & Strategy"}),c.jsx("meta",{name:"twitter:description",content:"Strategic water dispense market intelligence for operators, investors and suppliers covering BWD, POU, ITS, regulation, consolidation, sustainability and European market growth."}),c.jsx("meta",{name:"twitter:image",content:"https://waterdispenseinsights.com/og-intelligence.jpg"}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"CollectionPage",name:"Water Dispense Intelligence",description:"Strategic water dispense market intelligence for operators, investors and suppliers covering BWD, POU, ITS, regulation, consolidation, sustainability and European market growth.",url:"https://waterdispenseinsights.com/intelligence",isPartOf:{"@type":"WebSite",name:"Zenith Global Commercial",url:"https://waterdispenseinsights.com"},publisher:{"@type":"Organization",name:"Zenith Global Commercial",url:"https://waterdispenseinsights.com",logo:{"@type":"ImageObject",url:"https://storage.googleapis.com/gpt-engineer-file-uploads/xPOPHnyw89dKLtBAPfGsOEsvPnh2/uploads/1761076682105-zenith consulting logo template (1).png"}},inLanguage:"en-GB",mainEntity:{"@type":"ItemList",itemListOrder:"https://schema.org/ItemListOrderDe
614scending",numberOfItems:f.filter(y=>y.is_published).length,itemListElement:f.filter(y=>y.is_published).map((y,g)=>({"@type":"ListItem",position:g+1,url:`https://waterdispenseinsights.com/intelligence/${y.slug}`,name:y.title}))}})}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"Organization",name:"Zenith Global Commercial",url:"https://waterdispenseinsights.com",logo:"https://storage.googleapis.com/gpt-engineer-file-uploads/xPOPHnyw89dKLtBAPfGsOEsvPnh2/uploads/1761076682105-zenith consulting logo template (1).png",foundingDate:"1998",sameAs:["https://www.linkedin.com/in/akospetri/","https://www.trustpilot.com/review/zenithglobalcommercial.com"]})}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://waterdispenseinsights.com/"},{"@type":"ListItem",position:2,name:"Intelligence",item:"https://waterdispenseinsights.com/intelligence"}]})})]}),c.jsx("header",{className:"border-b",style:{borderColor:"rgba(255,255,255,0.1)",backgroundColor:"hsl(200 80% 15%)"},children:c.jsxs("div",{className:"max-w-6xl mx-auto px-4 lg:px-6 py-5 flex items-center justify-between gap-4",children:[c.jsx(rt,{to:"/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center min-w-0",children:c.jsxs("span",{className:"text-base md:text-xl font-bold tracking-tight truncate",style:{color:"#FFFFFF"},children:["Zenith ",c.jsx("span",{className:"text-accent",children:"Articles"})]})}),c.jsx("a",{href:"/",target:"_blank",rel:"noopener noreferrer",onClick:y=>{typeof window<"u"&&window.history.length>1&&(y.preventDefault(),window.history.back())},className:"inline-flex items-center gap-2 text-xs tracking-wider uppercase transition-colors shrink-0",style:{color:"rgba(255,255,255,0.75)"},onMouseEnter:y=>y.currentTarget.style.color="#FFFFFF",onMouseLeave:y=>y.currentTarget.style.color="rgba(255,255,255,0.75)","aria-label":"Back",children:c.jsx(lR,{className:"w-3.5 h-3.5"})})]})}),c.jsxs("section",{className:"max-w-6xl mx-auto px-4 lg:px-6 pt-10 pb-24",children:[c.jsxs("div",{className:"mb-10",children:[c.jsx("h1",{className:"text-4xl md:text-6xl font-bold tracking-tight mb-5",style:{color:"#0A0A0F",fontFamily:"Georgia, 'Times New Roman', serif",letterSpacing:"-0.02em"},children:"Water Dispense Intelligence"}),c.jsxs("p",{className:"text-base md:text-lg leading-relaxed max-w-4xl",style:{color:"#3A3A45"},children:[c.jsx("strong",{children:"Strategic intelligence"})," for water dispense operators, investors and suppliers — built on three decades of category expertise across ",c.jsx("strong",{children:"31 European markets, USA, UAE, Turkey, Japan and South Korea"}),"."]}),c.jsxs("p",{className:"text-sm md:text-base leading-relaxed max-w-4xl mt-3",style:{color:"#5A5A65"},children:["Covering ",c.jsx("strong",{children:"BWD, POU and ITS"}),", regulation (",c.jsx("strong",{children:"PFAS, PPWR, plastic taxes"}),"), ",c.jsx("strong",{children:"M&A and consolidation"}),", ",c.jsx("strong",{children:"sustainability and ESG"}),", dispense technology and pricing & service strategy."]})]}),c.jsxs("aside",{className:"mb-10 flex flex-col items-start gap-5 rounded-xl p-5 sm:flex-row sm:items-center sm:gap-6 sm:p-6",style:{backgroundColor:"#1d293d"},children:[c.jsx("img",{src:b8.url,alt:"Akos Petri, author",width:112,height:112,loading:"lazy",className:"size-24 shrink-0 rounded-full object-cover ring-2 ring-white/10 sm:size-28"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"#a3e635"},children:"Written by"}),c.jsx("p",{className:"mt-1 text-xl font-bold",style:{color:"#FFFFFF",fontFamily:"Georgia, 'Times New Roman', serif"},children:"Akos Petri"}),c.jsx("p",{className:"mt-2 text-sm leading-6",style:{color:"rgba(255,255,255,0.80)"},children:"Commercial strategy and market intelligence leader with founder-level execution experience and 8+ years of specialised expertise in water dispense strategy and market research. Managing Director of Zenith Global Commercial, advising businesses on market entry, competitive intelligence and growth strategy across food, beverage and CPG categories."}),c.jsxs("a",{href:"https://www.linkedin.com/in/akospetri",target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-2 text-sm font-semibold transition-colors",style:{color:"#a3e635"},onMouseEnter:y=>y.currentTarget.style.color="#FFFFFF",onMouseLeave:y=>y.currentTarget.style.color="#a3e635",children:[c.jsx(hc,{className:"w-4 h-4"}),"Connect on LinkedIn"]})]})]}),c.jsx("div",{className:"flex flex-wrap gap-2 mb-8",children:["All",...Uf].map(y=>{const g=a===y;return c.jsx("button",{onClick:()=>o(y),className:"px-3 py-1.5 rounded-full text-xs font-semibold uppercase tracking-wider transition-colors",style:{backgroundColor:g?"hsl(200 80% 15%)":"#FFFFFF",color:g?"#FFFFFF":"#3A3A45",border:g?"1px solid hsl(200 80% 15%)":"1px solid rgba(0,0,0,0.12)"},children:y},y)})}),c.jsx("div",{className:"mb-10",children:c.jsx(IE,{showCta:!1})}),c.jsx("a",{href:"https://waterdispenseinsights.com/reports",target:"_blank",rel:"noopener noreferrer",className:"group block w-fit mx-auto rounded-2xl overflow-hidden mb-12",style:{boxShadow:"0 12px 40px -12px rgba(0,0,0,0.35)",border:"1px solid rgba(255,255,255,0.06)"},"aria-label":"Explore Zenith Water Dispense Market Reports 2026",children:c.jsx("img",{src:QW.url,alt:"Water Dispense Market Reports 2026 — Europe & US market intelligence for operators, investors and brand team
614s",className:"block w-full h-auto transition-transform duration-500 group-hover:scale-[1.015]",loading:"eager"})}),n?c.jsx("div",{className:"grid gap-6 lg:grid-cols-2",children:[0,1,2,3].map(y=>c.jsxs("div",{className:"rounded-xl overflow-hidden animate-pulse",style:{backgroundColor:"#FFFFFF",border:"1px solid rgba(0,0,0,0.12)",minHeight:360},children:[c.jsx("div",{className:"h-48 w-full bg-neutral-200"}),c.jsxs("div",{className:"p-7",children:[c.jsx("div",{className:"h-3 w-24 mb-5 rounded bg-neutral-200"}),c.jsx("div",{className:"h-6 w-5/6 mb-3 rounded bg-neutral-200"}),c.jsx("div",{className:"h-3 w-full mb-2 rounded bg-neutral-100"}),c.jsx("div",{className:"h-3 w-2/3 rounded bg-neutral-100"})]})]},y))}):s?c.jsxs("div",{className:"text-center py-20",children:[c.jsx("p",{className:"mb-6",style:{color:"#5A5A66"},children:"Couldn't load articles right now."}),c.jsx("button",{onClick:d,className:"px-5 py-2 rounded-md text-sm font-medium transition-colors",style:{backgroundColor:"hsl(200 80% 15%)",color:"#FFFFFF"},children:"Retry"})]}):p.length===0?c.jsx("p",{className:"text-center py-20",style:{color:"#5A5A66"},children:a==="All"?"No articles published yet. Check back tomorrow.":`No articles tagged "${a}" yet.`}):(()=>{const g=f.length,b=["smart","newsletter","infographs","china","enquiry"],x=(v,S)=>v==="smart"?c.jsx(n_,{className:"my-4"},S):v==="infographs"?c.jsx("div",{className:"my-4",children:c.jsx(vN,{variant:"featured"})},S):v==="china"?c.jsx("div",{className:"my-4",children:c.jsx(w8,{variant:"featured"})},S):v==="enquiry"?c.jsx("div",{className:"my-4",children:c.jsx(k8,{})},S):c.jsx("a",{href:"https://waterdispenseinsights.com/#demo-section",target:"_blank",rel:"noopener noreferrer",className:"my-4 group relative block overflow-hidden rounded-2xl border no-underline transition-transform hover:-translate-y-0.5",style:{background:"linear-gradient(135deg, #0A0F1F 0%, #0F1729 60%, #0A0F1F 100%)",borderColor:"rgba(212,245,70,0.25)",boxShadow:"0 20px 50px -20px rgba(0,0,0,0.5)"},"aria-label":"Get the US Water Dispense Investment Guide and insider briefing",children:c.jsxs("div",{className:"grid gap-6 p-6 sm:p-8 md:grid-cols-[1.4fr_auto] md:items-center md:gap-10 md:p-10",children:[c.jsxs("div",{children:[c.jsx("span",{className:"inline-block text-[11px] font-semibold tracking-[0.18em] uppercase mb-3",style:{color:"#D4F546"},children:"Daily Intelligence"}),c.jsxs("h3",{className:"text-2xl md:text-3xl font-bold leading-tight tracking-tight",style:{color:"#FFFFFF"},children:["You're ",g," issues in. Insider insights, straight to your inbox."]}),c.jsx("p",{className:"mt-3 max-w-2xl text-sm md:text-base leading-7",style:{color:"rgba(255,255,255,0.75)"},children:"What we hear from operators before it becomes an article — plus the US Water Dispense Investment Guide, free when you join."})]}),c.jsx("span",{className:"inline-flex w-fit items-center gap-2 rounded-full px-6 py-3.5 text-sm font-semibold transition-all group-hover:-translate-y-0.5",style:{backgroundColor:"#D4F546",color:"#0A0F1F"},children:"Get the guide + insider briefing →"})]})},S),w=[];for(let v=0;v<p.length;v+=8){const S=p.slice(v,v+8);if(w.push(c.jsx("div",{className:"grid gap-6 lg:grid-cols-2",children:S.map(E=>{const C=m(E.id),T=_4(E.excerpt||"",200)||_4(E.content,200);return c.jsxs("a",{href:`/intelligence/${E.slug}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>bN(E.slug,"click"),onAuxClick:()=>bN(E.slug,"click"),className:"group block rounded-xl overflow-hidden transition-all duration-200",style:{backgroundColor:"#FFFFFF",border:"1px solid rgba(0,0,0,0.12)",boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},onMouseEnter:P=>{P.currentTarget.style.borderColor="rgba(0,0,0,0.25)",P.currentTarget.style.transform="translateY(-2px)",P.currentTarget.style.boxShadow="0 8px 20px -8px rgba(0,0,0,0.18)"},onMouseLeave:P=>{P.currentTarget.style.borderColor="rgba(0,0,0,0.12)",P.currentTarget.style.transform="translateY(0)",P.currentTarget.style.boxShadow="0 1px 3px rgba(0,0,0,0.06)"},children:[c.jsxs("div",{className:"relative w-full h-48 overflow-hidden",style:{backgroundColor:"#EDEAE5"},children:[E.cover_image_url?c.jsx("img",{src:E.thumbnail_url||E.cover_image_url,alt:E.title,width:600,height:400,loading:"lazy",decoding:"async",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"}):c.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs uppercase tracking-widest",style:{color:"#9A9AA5"},children:"Zenith Intelligence"}),c.jsxs("span",{className:"absolute top-3 left-3 text-xs font-bold px-2.5 py-1 rounded-md",style:{backgroundColor:"hsl(200 80% 15%)",color:"#FFFFFF"},children:["#",String(C).padStart(2,"0")]}),c.jsx("span",{className:"absolute top-3 right-3 text-[10px] tracking-widest font-bold uppercase px-2 py-1 rounded",style:{backgroundColor:"#FFFFFF",color:"#0A0A0F",border:"1px solid rgba(0,0,0,0.1)"},children:E.resolvedTopic})]}),c.jsxs("div",{className:"p-7",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx("p",{className:"text-xs tracking-widest font-semibold uppercase",style:{color:"hsl(200 80% 15%)"},children:Qge(E.published_at)}),!E.is_published&&c.jsx("span",{className:"text-[10px] tracking-widest font-bold uppercase px-2 py-0.5 rounded",style:{backgroundColor:"#FFD166",color:"#0A0A0F"},children:"Draft"})]}),c.jsx("h2",{className:"text-2xl font-bold leading-tight mb-3",style:{color:"#0A0A0F",letterSpacing:"-0.01em",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:E.title}),c.jsx("p",{className:"text-sm leading-relaxed mb-6",style:{color:"#4A4A55",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},children:T}),c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx(S8,{url:`${typeof window<"u"?window.location.origin:"https://waterdispenseinsights.com"}/intelligence/${E.slug}`,title:E.title,variant:"compact"}),c.jsx("span",{className:"text-sm font-semibold transition-opacity",style:{color:"hsl(200 80% 15%)"},children:"Read analysis →"})]})]})]},E.id)})},`chunk-${v}`)),v+8<p.length){const E=Math.floor(v/8)%b.length;w.push(x(b[E],`cta-${v}`))}}return c.jsx("div",{className:"space-y-8",children:w})})()]}),c.jsx(Cc,{})]})};function eye(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const tye=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nye=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rye={};function E4(t,e){return(rye.jsx?nye:tye).test(t)}const sye=/[ \t\n\f\r]/g;function iye(t){return typeof t=="object"?t.type==="text"?C4(t.value):!1:C4(t)}function C4(t){return t.replace(sye,"")===""}class O0{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}O0.prototype.normal={};O0.prototype.property={};O0.prototype.space=void 0;function E8(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new O0(n,r,e)}function wN(t){return t.toLowerCase()}class Zs{constructor(e,n){this.attribute=n,this.property=e}}Zs.prototype.attribute="";Zs.prototype.booleanish=!1;Zs.prototype.boolean=!1;Zs.prototype.commaOrSpaceSeparated=!1;Zs.prototype.commaSeparated=!1;Zs.prototype.defined=!1;Zs.prototype.mustUseProperty=!1;Zs.prototype.number=!1;Zs.prototype.overloadedBoolean=!1;Zs.prototype.property="";Zs.prototype.spaceSeparated=!1;Zs.prototype.space=void 0;let aye=0;const Ze=up(),Ln=up(),kN=up(),re=up(),Wt=up(),Nm=up(),Js=up();function up(){return 2**++aye}const SN=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:Ln,commaOrSpaceSeparated:Js,commaSeparated:Nm,number:re,overloadedBoolean:kN,spaceSeparated:Wt},Symbol.toStringTag,{value:"Module"})),NA=Object.keys(SN);class zI extends Zs{constructor(e,n,r,s){let i=-1;
vendor: 4,264 bytes, line 614
614if(super(e,n),A4(this,"space",s),typeof r=="number")for(;++i<NA.length;){const a=NA[i];A4(this,NA[i],(r&SN[a])===SN[a])}}}zI.prototype.defined=!0;function A4(t,e,n){n&&(t[e]=n)}function tx(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const i=new zI(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,n[wN(r)]=r,n[wN(i.attribute)]=r}return new O0(e,n,t.space)}const C8=tx({properties:{ariaActiveDescendant:null,ariaAtomic:Ln,ariaAutoComplete:null,ariaBusy:Ln,ariaChecked:Ln,ariaColCount:re,ariaColIndex:re,ariaColSpan:re,ariaControls:Wt,ariaCurrent:null,ariaDescribedBy:Wt,ariaDetails:null,ariaDisabled:Ln,ariaDropEffect:Wt,ariaErrorMessage:null,ariaExpanded:Ln,ariaFlowTo:Wt,ariaGrabbed:Ln,ariaHasPopup:null,ariaHidden:Ln,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wt,ariaLevel:re,ariaLive:null,ariaModal:Ln,ariaMultiLine:Ln,ariaMultiSelectable:Ln,ariaOrientation:null,ariaOwns:Wt,ariaPlaceholder:null,ariaPosInSet:re,ariaPressed:Ln,ariaReadOnly:Ln,ariaRelevant:null,ariaRequired:Ln,ariaRoleDescription:Wt,ariaRowCount:re,ariaRowIndex:re,ariaRowSpan:re,ariaSelected:Ln,ariaSetSize:re,ariaSort:null,ariaValueMax:re,ariaValueMin:re,ariaValueNow:re,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function A8(t,e){return e in t?t[e]:e}function T8(t,e){return A8(t,e.toLowerCase())}const oye=tx({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nm,acceptCharset:Wt,accessKey:Wt,action:null,allow:null,allowFullScreen:Ze,allowPaymentRequest:Ze,allowUserMedia:Ze,alt:null,as:null,async:Ze,autoCapitalize:null,autoComplete:Wt,autoFocus:Ze,autoPlay:Ze,blocking:Wt,capture:null,charSet:null,checked:Ze,cite:null,className:Wt,cols:re,colSpan:null,content:null,contentEditable:Ln,controls:Ze,controlsList:Wt,coords:re|Nm,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ze,defer:Ze,dir:null,dirName:null,disabled:Ze,download:kN,draggable:Ln,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ze,formTarget:null,headers:Wt,height:re,hidden:kN,high:re,href:null,hrefLang:null,htmlFor:Wt,httpEquiv:Wt,id:null,imageSizes:null,imageSrcSet:null,inert:Ze,inputMode:null,integrity:null,is:null,isMap:Ze,itemId:null,itemProp:Wt,itemRef:Wt,itemScope:Ze,itemType:Wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ze,low:re,manifest:null,max:null,maxLength:re,media:null,method:null,min:null,minLength:re,multiple:Ze,muted:Ze,name:null,nonce:null,noModule:Ze,noValidate:Ze,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:Ze,optimum:re,pattern:null,ping:Wt,placeholder:null,playsInl
614ine:Ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ze,referrerPolicy:null,rel:Wt,required:Ze,reversed:Ze,rows:re,rowSpan:re,sandbox:Wt,scope:null,scoped:Ze,seamless:Ze,selected:Ze,shadowRootClonable:Ze,shadowRootDelegatesFocus:Ze,shadowRootMode:null,shape:null,size:re,sizes:null,slot:null,span:re,spellCheck:Ln,src:null,srcDoc:null,srcLang:null,srcSet:null,start:re,step:null,style:null,tabIndex:re,target:null,title:null,translate:null,type:null,typeMustMatch:Ze,useMap:null,value:Ln,width:re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wt,axis:null,background:null,bgColor:null,border:re,borderColor:null,bottomMargin:re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ze,declare:Ze,event:null,face:null,frame:null,frameBorder:null,hSpace:re,leftMargin:re,link:null,longDesc:null,lowSrc:null,marginHeight:re,marginWidth:re,noResize:Ze,noHref:Ze,noShade:Ze,noWrap:Ze,object:null,profile:null,prompt:null,rev:null,rightMargin:re,rules:null,scheme:null,scrolling:Ln,standby:null,summary:null,text:null,topMargin:re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ze,disableRemotePlayback:Ze,prefix:null,property:null,results:re,security:null,unselectable:null},space:"html",transform:T8}),lye=tx({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
614-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:Js,accentHeight:re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:re,amplitude:re,arabicForm:null,ascent:re,attributeName:null,attributeType:null,azimuth:re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:re,by:null,calcMode:null,capHeight:re,className:Wt,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:re,diffuseConstant:re,direction:null,display:null,dur:null,divisor:re,dominantBaseline:null,download:Ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:re,enableBackground:null,end:null,event:null,exponent:re,externalResourcesRequired:null,fill:null,fillOpacity:re,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:Nm,g2:Nm,glyphName:Nm,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:re,horizOriginX:re,horizOriginY:re,id:null,ideographic:re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:re,k:re,k1:re,k2:re,k3:re,k4:re,kernelMatrix:Js,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:re,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:re,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,964 bytes, lines 614-615
614Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:re,overlineThickness:re,paintOrder:null,panose1:null,path:null,pathLength:re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:re,pointsAtY:re,pointsAtZ:re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Js,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Js,rev:Js,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Js,requiredFeatures:Js,requiredFonts:Js,requiredFormats:Js,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:re,specularExponent:re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:re,strikethroughThickness:re,string:null,stroke:null,strokeDashArray:Js,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:re,strokeOpacity:re,strokeWidth:null,style:null,surfaceScale:re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Js,tabIndex:re,tableValues:null,target:null,targetX:re,targetY:re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Js,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:re,underlineThickness:re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:re,values:null,vAlphabetic:re,vMathematical:re,vectorEffect:null,vHanging:re,vIdeographic:re,version:null,vertAdvY:re,vertOriginX:re,vertOriginY:re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A8}),j8=tx({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()}}),N8=tx({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:T8}),P8=tx({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),cye={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"},uye=/[A-Z]/g,T4=/-[a-z]/g,dye=/^data[-\w.:]+$/i;function hye(t,e){const n=wN(e);let r=e,s=Zs;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&dye.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(T4,pye);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!T4.test(i)){let a=i.replace(uye,fye);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=zI}return new s(r,e)}function fye(t){return"-"+t.toLowerCase()}function pye(t){return t.charAt(1).toUpperCase()}const mye=E8([C8,oye,j8,N8,P8],"html"),VI=E8([C8,lye,j8,N8,P8],"svg");function gye(t){return t.join(" ").trim()}var WI={},j4=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,yye=/\n/g,xye=/^\s*/,vye=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,bye=/^:\s*/,wye=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,kye=/^[;\s]*/,Sye=/^\s+|\s+$/g,_ye=`
615`,N4="/",P4="*",ah="",Eye="comment",Cye="declaration";function Aye(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 s(y){var g=y.match(yye);g&&(n+=g.length);var b=y.lastIndexOf(_ye);r=~b?y.length-b:r+y.length}function i(){var y={line:n,column:r};return function(g){return g.position=new a(y),u(),g}}function a(y){this.start=y,this.end={line:n,column:r},this.source=e.source}a.prototype.content=t;function o(y){var g=new Error(e.source+":"+n+":"+r+": "+y);if(g.reason=y,g.filename=e.source,g.line=n,g.column=r,g.source=t,!e.silent)throw g}function l(y){var g=y.exec(t);if(g){var b=g[0];return s(b),t=t.slice(b.length),g}}function u(){l(xye)}function d(y){var g;for(y=y||[];g=f();)g!==!1&&y.push(g);return y}function f(){var y=i();if(!(N4!=t.charAt(0)||P4!=t.charAt(1))){for(var g=2;ah!=t.charAt(g)&&(P4!=t.charAt(g)||N4!=t.charAt(g+1));)++g;if(g+=2,ah===t.charAt(g-1))return o("End of comment missing");var b=t.slice(2,g-2);return r+=2,s(b),t=t.slice(g),r+=2,y({type:Eye,comment:b})}}function p(){var y=i(),g=l(vye);
vendor: 4,055 bytes, line 615
615if(g){if(f(),!l(bye))return o("property missing ':'");var b=l(wye),x=y({type:Cye,property:R4(g[0].replace(j4,ah)),value:b?R4(b[0].replace(j4,ah)):ah});return l(kye),x}}function m(){var y=[];d(y);for(var g;g=p();)g!==!1&&(y.push(g),d(y));return y}return u(),m()}function R4(t){return t?t.replace(Sye,ah):ah}var Tye=Aye,jye=Xr&&Xr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(WI,"__esModule",{value:!0});WI.default=Pye;const Nye=jye(Tye);function Pye(t,e){let n=null;if(!t||typeof t!="string")return n;const r=(0,Nye.default)(t),s=typeof e=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:a,value:o}=i;s?e(a,o,i):o&&(n=n||{},n[a]=o)}),n}var $E={};Object.defineProperty($E,"__esModule",{value:!0});$E.camelCase=void 0;var Rye=/^--[a-zA-Z0-9_-]+$/,Iye=/-([a-z])/g,Dye=/^[^-]+$/,Mye=/^-(webkit|moz|ms|o|khtml)-/,Oye=/^-(ms)-/,Lye=function(t){return!t||Dye.test(t)||Rye.test(t)},Fye=function(t,e){return e.toUpperCase()},I4=function(t,e){return"".concat(e,"-")},Bye=function(t,e){return e===void 0&&(e={}),Lye(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(Oye,I4):t=t.replace(Mye,I4),t.replace(Iye,Fye))};$E.camelCase=Bye;var $ye=Xr&&Xr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Uye=$ye(WI),zye=$E;function _N(t,e){var n={};return!t||typeof t!="string"||(0,Uye.default)(t,function(r,s){r&&s&&(n[(0,zye.camelCase)(r,e)]=s)}),n}_N.default=_N;var Vye=_N;const Wye=Sc(Vye),R8=I8("end"),HI=I8("start");function I8(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 Hye(t){const e=HI(t),n=R8(t);if(e&&n)return{start:e,end:n}}function Iv(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?D4(t.position):"start"in t||"end"in t?D4(t):"line"in t||"column"in t?EN(t):""}function EN(t){return M4(t&&t.line)+":"+M4(t&&t.column)}function D4(t){return EN(t&&t.start)+"-"+EN(t&&t.end)}function M4(t){return t&&typeof t=="number"?t:1}class Qr extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(a=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Iv(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qr.prototype.file="";Qr.prototype.name="";Qr.prototype.reason="";Qr.prototype.message="";Qr.prototype.stack="";Qr.prototype.column=void 0;Qr.prototype.line=void 0;Qr.prototype.ancestors=void 0;Qr.prototype.cause=void 0;Qr.prototype.fatal=void 0;Qr.prototype.place=void 0;Qr.prototype.ruleId=void 0;Qr.prototype.source=void 0;const qI={}.hasOwnProperty,qye=new Map,Gye=/[A-Z]/g,Kye=new Set(["table","tbody","thead","tfoot","tr"]),Yye=new Set(["td","th"]),D8="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Xye(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=sxe(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 6,346 bytes, line 615
615if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=rxe(n,e.jsx,e.jsxs)}const s={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"?VI:mye,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=M8(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function M8(t,e,n){if(e.type==="element")return Zye(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Qye(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return exe(t,e,n);if(e.type==="mdxjsEsm")return Jye(t,e);if(e.type==="root")return txe(t,e,n);if(e.type==="text")return nxe(t,e)}function Zye(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=VI,t.schema=s),t.ancestors.push(e);const i=L8(t,e.tagName,!1),a=ixe(t,e);let o=KI(t,e);return Kye.has(e.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!iye(l):!0})),O8(t,a,i,e),GI(a,o),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Qye(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)}kb(t,e.position)}function Jye(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);kb(t,e.position)}function exe(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=VI,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:L8(t,e.name,!0),a=axe(t,e),o=KI(t,e);return O8(t,a,i,e),GI(a,o),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function txe(t,e,n){const r={};return GI(r,KI(t,e)),t.create(e,t.Fragment,r,n)}function nxe(t,e){return e.value}function O8(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function GI(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function rxe(t,e,n){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?n:e;return o?u(i,a,o):u(i,a)}}function sxe(t,e){return n;function n(r,s,i,a){const o=Array.isArray(i.children),l=HI(r);return e(s,i,a,o,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function ixe(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&qI.call(e.properties,s)){const i=oxe(t,s,e.properties[s]);if(i){const[a,o]=i;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Yye.has(e.tagName)?r=o:n[a]=o}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function axe(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else kb(t,e.position);else{const s=r.name;let i;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,i=t.evaluater.evaluateExpression(o.expression)}else kb(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function KI(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:qye;for(;++r<e.children.length;){const i=e.children[r];let a;if(t.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const u=s.get(l)||0;a=l+"-"+u,s.set(l,u+1)}}const o=M8(t,i,a);o!==void 0&&n.push(o)}return n}function oxe(t,e,n){const r=hye(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?eye(n):gye(n)),r.property==="style"){let s=typeof n=="object"?n:lxe(t,String(n));return t.stylePropertyNameCase==="css"&&(s=cxe(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&r.space?cye[r.property]||r.property:r.attribute,n]}}function lxe(t,e){try{return Wye(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,s=new Qr("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=D8+"#cannot-parse-style-attribute",s}}function L8(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,a;for(;++i<s.length;){const o=E4(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}r=a}else r=E4(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const s=r.value;return qI.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(r);kb(t)}function kb(t,e){const n=new Qr("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=D8+"#cannot-handle-mdx-estrees-without-createevaluater",n}function cxe(t){const e={};let n;for(n in t)qI.call(t,n)&&(e[uxe(n)]=t[n]);return e}function uxe(t){let e=t.replace(Gye,dxe);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function dxe(t){return"-"+t.toLowerCase()}const PA={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"]},hxe={};function YI(t,e){const n=hxe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return F8(t,r,s)}function F8(t,e,n){if(fxe(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 O4(t.children,e,n)}return Array.isArray(t)?O4(t,e,n):""}function O4(t,e,n){const r=[];let s=-1;for(;++s<t.length;)r[s]=F8(t[s],e,n);return r.join("")}function fxe(t){return!!(t&&typeof t=="object")}const L4=document.createElement("i");function XI(t){const e="&"+t+";";L4.innerHTML=e;const n=L4.textContent;
vendor: 10,920 bytes, line 615
615return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function ji(t,e,n,r){const s=t.length;let i=0,a;if(e<0?e=-e>s?0:s+e:e=e>s?s: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);i<r.length;)a=r.slice(i,i+1e4),a.unshift(e,0),t.splice(...a),i+=1e4,e+=1e4}function ra(t,e){return t.length>0?(ji(t,t.length,0,e),t):e}const F4={}.hasOwnProperty;function B8(t){const e={};let n=-1;for(;++n<t.length;)pxe(e,t[n]);return e}function pxe(t,e){let n;for(n in e){const s=(F4.call(t,n)?t[n]:void 0)||(t[n]={}),i=e[n];let a;if(i)for(a in i){F4.call(s,a)||(s[a]=[]);const o=i[a];mxe(s[a],Array.isArray(o)?o:o?[o]:[])}}}function mxe(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);ji(t,0,0,r)}function $8(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 eo(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hs=Ld(/[A-Za-z]/),Kr=Ld(/[\dA-Za-z]/),gxe=Ld(/[#-'*+\--9=?A-Z^-~]/);function o_(t){return t!==null&&(t<32||t===127)}const CN=Ld(/\d/),yxe=Ld(/[\dA-Fa-f]/),xxe=Ld(/[!-/:-@[-`{-~]/);function je(t){return t!==null&&t<-2}function Ft(t){return t!==null&&(t<0||t===32)}function it(t){return t===-2||t===-1||t===32}const UE=Ld(new RegExp("\\p{P}|\\p{S}","u")),ep=Ld(/\s/);function Ld(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function nx(t){const e=[];let n=-1,r=0,s=0;for(;++n<t.length;){const i=t.charCodeAt(n);let a="";if(i===37&&Kr(t.charCodeAt(n+1))&&Kr(t.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const o=t.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function ct(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return it(l)?(t.enter(n),o(l)):e(l)}function o(l){return it(l)&&i++<s?(t.consume(l),o):(t.exit(n),e(l))}}const vxe={tokenize:bxe};function bxe(t){const e=t.attempt(this.parser.constructs.contentInitial,r,s);let n;return e;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),ct(t,e,"linePrefix")}function s(o){return t.enter("paragraph"),i(o)}function i(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 je(o)?(t.consume(o),t.exit("chunkText"),i):(t.consume(o),a)}}const wxe={tokenize:kxe},B4={tokenize:Sxe};function kxe(t){const e=this,n=[];let r=0,s,i,a;return o;function o(v){if(r<n.length){const S=n[r];return e.containerState=S[1],t.attempt(S[0].continuation,l,u)(v)}return u(v)}function l(v){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&w();const S=e.events.length;let E=S,C;for(;E--;)if(e.events[E][0]==="exit"&&e.events[E][1].type==="chunkFlow"){C=e.events[E][1].end;break}x(r);let T=S;for(;T<e.events.length;)e.events[T][1].end={...C},T++;return ji(e.events,E+1,0,e.events.slice(S)),e.events.length=T,u(v)}return o(v)}function u(v){if(r===n.length){if(!s)return p(v);if(s.currentConstruct&&s.currentConstruct.concrete)return y(v);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(B4,d,f)(v)}function d(v){return s&&w(),x(r),p(v)}function f(v){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,y(v)}function p(v){return e.containerState={},t.attempt(B4,m,y)(v)}function m(v){return r++,n.push([e.currentConstruct,e.containerState]),p(v)}function y(v){if(v===null){s&&w(),x(0),t.consume(v);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),g(v)}function g(v){if(v===null){b(t.exit("chunkFlow"),!0),x(0),t.consume(v);return}return je(v)?(t.consume(v),b(t.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(t.consume(v),g)}function b(v,S){const E=e.sliceStream(v);if(S&&E.push(null),v.previous=i,i&&(i.next=v),i=v,s.defineSkip(v.start),s.write(E),e.parser.lazy[v.start.line]){let C=s.events.length;for(;C--;)if(s.events[C][1].start.offset<a&&(!s.events[C][1].end||s.events[C][1].end.offset>a))return;const T=e.events.length;let P=T,M,R;for(;P--;)if(e.events[P][0]==="exit"&&e.events[P][1].type==="chunkFlow"){if(M){R=e.events[P][1].end;break}M=!0}for(x(r),C=T;C<e.events.length;)e.events[C][1].end={...R},C++;ji(e.events,P+1,0,e.events.slice(T)),e.events.length=C}}function x(v){let S=n.length;for(;S-- >v;){const E=n[S];e.containerState=E[1],E[0].exit.call(e,t)}n.length=v}function w(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function Sxe(t,e,n){return ct(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function My(t){if(t===null||Ft(t)||ep(t))return 1;if(UE(t))return 2}function zE(t,e,n){const r=[];let s=-1;for(;++s<t.length;){const i=t[s].resolveAll;i&&!r.includes(i)&&(e=i(e,n),r.push(i))}return e}const AN={name:"attention",resolveAll:_xe,tokenize:Exe};function _xe(t,e){let n=-1,r,s,i,a,o,l,u,d;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 f={...t[r][1].end},p={...t[n][1].start};$4(f,-l),$4(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},t[r][1].end={...a.start},t[n][1].start={...o.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=ra(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=ra(u,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),u=ra(u,zE(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=ra(u,[["exit",i,e],["enter",o,e],["exit",o,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,u=ra(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,ji(t,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function Exe(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=My(r);let i;return a;function a(l){return i=l,t.enter("attentionSequence"),o(l)}function o(l){if(l===i)return t.consume(l),o;const u=t.exit("attentionSequence"),d=My(l),f=!d||d===2&&s||n.includes(l),p=!s||s===2&&d||n.includes(r);return u._open=!!(i===42?f:f&&(s||!p)),u._close=!!(i===42?p:p&&(d||!f)),e(l)}}function $4(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Cxe={name:"autolink",tokenize:Axe};function Axe(t,e,n){let r=0;return s;function s(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),i}function i(m){return hs(m)?(t.consume(m),a):m===64?n(m):u(m)}function a(m){return m===43||m===45||m===46||Kr(m)?(r=1,o(m)):u(m)}function o(m){return m===58?(t.consume(m),r=0,l):(m===43||m===45||m===46||Kr(m))&&r++<32?(t.consume(m),o):(r=0,u(m))}function l(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):m===null||m===32||m===60||o_(m)?n(m):(t.consume(m),l)}function u(m){return m===64?(t.consume(m),d):gxe(m)?(t.consume(m),u):n(m)}function d(m){return Kr(m)?f(m):n(m)}function f(m){return m===46?(t.consume(m),r=0,d):m===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):p(m)}function p(m){if((m===45||Kr(m))&&r++<63){const y=m===45?p:f;return t.consume(m),y}return n(m)}}const L0={partial:!0,tokenize:Txe};function Txe(t,e,n){return r;function r(i){return it(i)?ct(t,s,"linePrefix")(i):s(i)}function s(i){return i===null||je(i)?e(i):n(i)}}const U8={continuation:{tokenize:Nxe},exit:Pxe,name:"blockQuote",tokenize:jxe};function jxe(t,e,n){const r=this;return s;function s(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"),i}return n(a)}function i(a){return it(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Nxe(t,e,n){const r=this;return s;function s(a){return it(a)?ct(t,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return t.attempt(U8,e,n)(a)}}function Pxe(t){t.exit("blockQuote")}const z8={name:"characterEscape",tokenize:Rxe};function Rxe(t,e,n){return r;function r(i){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(i),t.exit("escapeMarker"),s}function s(i){return xxe(i)?(t.enter("characterEscapeValue"),t.consume(i),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(i)}}const V8={name:"characterReference",tokenize:Ixe};function Ixe(t,e,n){const r=this;let s=0,i,a;return o;function o(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),i=31,a=Kr,d(f))}function u(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),i=6,a=yxe,d):(t.enter("characterReferenceValue"),i=7,a=CN,d(f))}function d(f){if(f===59&&s){const p=t.exit("characterReferenceValue");return a===Kr&&!XI(r.sliceSerialize(p))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(f)&&s++<i?(t.consume(f),d):n(f)}}const U4={partial:!0,tokenize:Mxe},z4={concrete:!0,name:"codeFenced",tokenize:Dxe};function Dxe(t,e,n){const r=this,s={partial:!0,tokenize:E};let i=0,a=0,o;return l;function l(C){return u(C)}function u(C){const T=r.events[r.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,o=C,t.enter("co
615deFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===o?(a++,t.consume(C),d):a<3?n(C):(t.exit("codeFencedFenceSequence"),it(C)?ct(t,f,"whitespace")(C):f(C))}function f(C){return C===null||je(C)?(t.exit("codeFencedFence"),r.interrupt?e(C):t.check(U4,g,S)(C)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||je(C)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(C)):it(C)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ct(t,m,"whitespace")(C)):C===96&&C===o?n(C):(t.consume(C),p)}function m(C){return C===null||je(C)?f(C):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||je(C)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(C)):C===96&&C===o?n(C):(t.consume(C),y)}function g(C){return t.attempt(s,S,b)(C)}function b(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),x}function x(C){return i>0&&it(C)?ct(t,w,"linePrefix",i+1)(C):w(C)}function w(C){return C===null||je(C)?t.check(U4,g,S)(C):(t.enter("codeFlowValue"),v(C))}function v(C){return C===null||je(C)?(t.exit("codeFlowValue"),w(C)):(t.consume(C),v)}function S(C){return t.exit("codeFenced"),e(C)}function E(C,T,P){let M=0;return R;
vendor: 5,892 bytes, line 615
615function R(H){return C.enter("lineEnding"),C.consume(H),C.exit("lineEnding"),O}function O(H){return C.enter("codeFencedFence"),it(H)?ct(C,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):L(H)}function L(H){return H===o?(C.enter("codeFencedFenceSequence"),U(H)):P(H)}function U(H){return H===o?(M++,C.consume(H),U):M>=a?(C.exit("codeFencedFenceSequence"),it(H)?ct(C,B,"whitespace")(H):B(H)):P(H)}function B(H){return H===null||je(H)?(C.exit("codeFencedFence"),T(H)):P(H)}}}function Mxe(t,e,n){const r=this;return s;function s(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const RA={name:"codeIndented",tokenize:Lxe},Oxe={partial:!0,tokenize:Fxe};function Lxe(t,e,n){const r=this;return s;function s(u){return t.enter("codeIndented"),ct(t,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):je(u)?t.attempt(Oxe,a,l)(u):(t.enter("codeFlowValue"),o(u))}function o(u){return u===null||je(u)?(t.exit("codeFlowValue"),a(u)):(t.consume(u),o)}function l(u){return t.exit("codeIndented"),e(u)}}function Fxe(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):je(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):ct(t,i,"linePrefix",5)(a)}function i(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):je(a)?s(a):n(a)}}const Bxe={name:"codeText",previous:Uxe,resolve:$xe,tokenize:zxe};function $xe(t){let e=t.length-4,n=3,r,s;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;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="codeTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function Uxe(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zxe(t,e,n){let r=0,s,i;return a;function a(f){return t.enter("codeText"),t.enter("codeTextSequence"),o(f)}function o(f){return f===96?(t.consume(f),r++,o):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(i=t.enter("codeTextSequence"),s=0,d(f)):je(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||je(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),u)}function d(f){return f===96?(t.consume(f),s++,d):s===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(i.type="codeTextData",u(f))}}class Vxe{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 s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&_x(this.left,r),i.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),_x(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),_x(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);_x(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);_x(this.left,n.reverse())}}}function _x(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 W8(t){const e={};let n=-1,r,s,i,a,o,l,u;const d=new Vxe(t);for(;++n<d.length;){for(;n in e;)n=e[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,Wxe(d,n)),n=e[n],u=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(a=d.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...d.get(s)[1].start},o=d.slice(s,n),o.unshift(r),d.splice(s,n-s+1,o))}}return ji(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Wxe(t,e){const n=t.get(e)[1],r=t.get(e)[2];let s=e-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],u={};let d,f,p=-1,m=n,y=0,g=0;const b=[g];for(;m;){for(;t.get(++s)[1]!==m;);i.push(s),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),f&&a.defineSki
vendor: 18,629 bytes, line 615
615p(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=m,m=m.next}for(m=n;++p<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(g=p+1,b.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),p=b.length;p--;){const x=o.slice(b[p],b[p+1]),w=i.pop();l.push([w,w+x.length-1]),t.splice(w,2,x)}for(l.reverse(),p=-1;++p<l.length;)u[y+l[p][0]]=y+l[p][1],y+=l[p][1]-l[p][0]-1;return u}const Hxe={resolve:Gxe,tokenize:Kxe},qxe={partial:!0,tokenize:Yxe};function Gxe(t){return W8(t),t}function Kxe(t,e){let n;return r;function r(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),s(o)}function s(o){return o===null?i(o):je(o)?t.check(qxe,a,i)(o):(t.consume(o),s)}function i(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,s}}function Yxe(t,e,n){const r=this;return s;function s(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ct(t,i,"linePrefix")}function i(a){if(a===null||je(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 H8(t,e,n,r,s,i,a,o,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(x){return x===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(x),t.exit(i),p):x===null||x===32||x===41||o_(x)?n(x):(t.enter(r),t.enter(a),t.enter(o),t.enter("chunkString",{contentType:"string"}),g(x))}function p(x){return x===62?(t.enter(i),t.consume(x),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(t.exit("chunkString"),t.exit(o),p(x)):x===null||x===60||je(x)?n(x):(t.consume(x),x===92?y:m)}function y(x){return x===60||x===62||x===92?(t.consume(x),m):m(x)}function g(x){return!d&&(x===null||x===41||Ft(x))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(r),e(x)):d<u&&x===40?(t.consume(x),d++,g):x===41?(t.consume(x),d--,g):x===null||x===32||x===40||o_(x)?n(x):(t.consume(x),x===92?b:g)}function b(x){return x===40||x===41||x===92?(t.consume(x),g):g(x)}}function q8(t,e,n,r,s,i){const a=this;let o=0,l;return u;function u(m){return t.enter(r),t.enter(s),t.consume(m),t.exit(s),t.enter(i),d}function d(m){return o>999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(t.exit(i),t.enter(s),t.consume(m),t.exit(s),t.exit(r),e):je(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||je(m)||o++>999?(t.exit("chunkString"),d(m)):(t.consume(m),l||(l=!it(m)),m===92?p:f)}function p(m){return m===91||m===92||m===93?(t.consume(m),o++,f):f(m)}}function G8(t,e,n,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(t.enter(r),t.enter(s),t.consume(p),t.exit(s),a=p===40?41:p,l):n(p)}function l(p){return p===a?(t.enter(s),t.consume(p),t.exit(s),t.exit(r),e):(t.enter(i),u(p))}function u(p){return p===a?(t.exit(i),l(a)):p===null?n(p):je(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),ct(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===a||p===null||je(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?f:d)}function f(p){return p===a||p===92?(t.consume(p),d):d(p)}}function Dv(t,e){let n;return r;function r(s){return je(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):it(s)?ct(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const Xxe={name:"definition",tokenize:Qxe},Zxe={partial:!0,tokenize:Jxe};function Qxe(t,e,n){const r=this;let s;return i;function i(m){return t.enter("definition"),a(m)}function a(m){return q8.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=eo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),l):n(m)}function l(m){return Ft(m)?Dv(t,u)(m):u(m)}function u(m){return H8(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return t.attempt(Zxe,f,f)(m)}function f(m){return it(m)?ct(t,p,"whitespace")(m):p(m)}function p(m){return m===null||je(m)?(t.exit("definition"),r.parser.defined.push(s),e(m)):n(m)}}function Jxe(t,e,n){return r;function r(o){return Ft(o)?Dv(t,s)(o):n(o)}function s(o){return G8(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return it(o)?ct(t,a,"whitespace")(o):a(o)}function a(o){return o===null||je(o)?e(o):n(o)}}const eve={name:"hardBreakEscape",tokenize:tve};function tve(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return je(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const nve={name:"headingAtx",resolve:rve,tokenize:sve};function rve(t,e){let n=t.length-2,r=3,s,i;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&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ji(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function sve(t,e,n){let r=0;return s;function s(d){return t.enter("atxHeading"),i(d)}function i(d){return t.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(t.consume(d),a):d===null||Ft(d)?(t.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(t.enter("atxHeadingSequence"),l(d)):d===null||je(d)?(t.exit("atxHeading"),e(d)):it(d)?ct(t,o,"whitespace")(d):(t.enter("atxHeadingText"),u(d))}function l(d){return d===35?(t.consume(d),l):(t.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||Ft(d)?(t.exit("atxHeadingText"),o(d)):(t.consume(d),u)}}const ive=["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"],V4=["pre","script","style","textarea"],ave={concrete:!0,name:"htmlFlow",resolveTo:cve,tokenize:uve},ove={partial:!0,tokenize:hve},lve={partial:!0,tokenize:dve};function cve(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 uve(t,e,n){const r=this;let s,i,a,o,l;return u;function u(D){return d(D)}function d(D){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(D),f}function f(D){return D===33?(t.consume(D),p):D===47?(t.consume(D),i=!0,g):D===63?(t.consume(D),s=3,r.interrupt?e:N):hs(D)?(t.consume(D),a=String.fromCharCode(D),b):n(D)}function p(D){return D===45?(t.consume(D),s=2,m):D===91?(t.consume(D),s=5,o=0,y):hs(D)?(t.consume(D),s=4,r.interrupt?e:N):n(D)}function m(D){return D===45?(t.consume(D),r.interrupt?e:N):n(D)}function y(D){const Q="CDATA[";return D===Q.charCodeAt(o++)?(t.consume(D),o===Q.length?r.interrupt?e:L:y):n(D)}function g(D){return hs(D)?(t.consume(D),a=String.fromCharCode(D),b):n(D)}function b(D){if(D===null||D===47||D===62||Ft(D)){const Q=D===47,X=a.toLowerCase();return!Q&&!i&&V4.includes(X)?(s=1,r.interrupt?e(D):L(D)):ive.includes(a.toLowerCase())?(s=6,Q?(t.consume(D),x):r.interrupt?e(D):L(D)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):i?w(D):v(D))}return D===45||Kr(D)?(t.consume(D),a+=String.fromCharCode(D),b):n(D)}function x(D){return D===62?(t.consume(D),r.interrupt?e:L):n(D)}function w(D){return it(D)?(t.consume(D),w):R(D)}function v(D){return D===47?(t.consume(D),R):D===58||D===95||hs(D)?(t.consume(D),S):it(D)?(t.consume(D),v):R(D)}function S(D){return D===45||D===46||D===58||D===95||Kr(D)?(t.consume(D),S):E(D)}function E(D){return D===61?(t.consume(D),C):it(D)?(t.consume(D),E):v(D)}function C(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(t.consume(D),l=D,T):it(D)?(t.consume(D),C):P(D)}function T(D){return D===l?(t.consume(D),l=null,M):D===null||je(D)?n(D):(t.consume(D),T)}function P(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Ft(D)?E(D):(t.consume(D),P)}function M(D){return D===47||D===62||it(D)?v(D):n(D)}function R(D){return D===62?(t.consume(D),O):n(D)}function O(D){return D===null||je(D)?L(D):it(D)?(t.consume(D),O):n(D)}function L(D){return D===45&&s===2?(t.consume(D),z):D===60&&s===1?(t.consume(D),V):D===62&&s===4?(t.consume(D),W):D===63&&s===3?(t.consume(D),N):D===93&&s===5?(t.consume(D),I):je(D)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(ove,q,U)(D)):D===null||je(D)?(t.exit("htmlFlowData"),U(D)):(t.consume(D),L)}function U(D){return t.check(lve,B,q)(D)}function B(D){return t.enter("lineEnding"),t.consume(D),t.exit("lineEnding"),H}function H(D){return D===null||je(D)?U(D):(t.enter("htmlFlowData"),L(D))}function z(D){return D===45?(t.consume(D),N):L(D)}function V(D){return D===47?(t.consume(D),a="",$):L(D)}function $(D){if(D===62){const Q=a.toLowerCase();return V4.includes(Q)?(t.consume(D),W):L(D)}return hs(D)&&a.length<8?(t.consume(D),a+=String.fromCharCode(D),$):L(D)}function I(D){return D===93?(t.consume(D),N):L(D)}function N(D){return D===62?(t.consume(D),W):D===45&&s===2?(t.consume(D),N):L(D)}function W(D){return D===null||je(D)?(t.exit("htmlFlowData"),q(D)):(t.consume(D),W)}function q(D){return t.exit("htmlFlow"),e(D)}}function dve(t,e,n){const r=this;return s;function s(a){return je(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function hve(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(L0,e,n)}}const fve={name:"htmlText",tokenize:pve};function pve(t,e,n){const r=this;let s,i,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),u):N===47?(t.consume(N),E):N===63?(t.consume(N),v):hs(N)?(t.consume(N),P):n(N)}function u(N){return N===45?(t.consume(N),d):N===91?(t.consume(N),i=0,y):hs(N)?(t.consume(N),w):n(N)}function d(N){return N===45?(t.consume(N),m):n(N)}function f(N){return N===null?n(N):N===45?(t.consume(N),p):je(N)?(a=f,V(N)):(t.consume(N),f)}function p(N){return N===45?(t.consume(N),m):f(N)}function m(N){return N===62?z(N):N===45?p(N):f(N)}function y(N){const W="CDATA[";return N===W.charCodeAt(i++)?(t.consume(N),i===W.length?g:y):n(N)}function g(N){return N===null?n(N):N===93?(t.consume(N),b):je(N)?(a=g,V(N)):(t.consume(N),g)}function b(N){return N===93?(t.consume(N),x):g(N)}function x(N){return N===62?z(N):N===93?(t.consume(N),x):g(N)}function w(N){return N===null||N===62?z(N):je(N)?(a=w,V(N)):(t.consume(N),w)}function v(N){return N===null?n(N):N===63?(t.consume(N),S):je(N)?(a=v,V(N)):(t.consume(N),v)}function S(N){return N===62?z(N):v(N)}function E(N){return hs(N)?(t.consume(N),C):n(N)}function C(N){return N===45||Kr(N)?(t.consume(N),C):T(N)}function T(N){return je(N)?(a=T,V(N)):it(N)?(t.consume(N),T):z(N)}function P(N){return N===45||Kr(N)?(t.consume(N),P):N===47||N===62||Ft(N)?M(N):n(N)}function M(N){return N===47?(t.consume(N),z):N===58||N===95||hs(N)?(t.consume(N),R):je(N)?(a=M,V(N)):it(N)?(t.consume(N),M):z(N)}function R(N){return N===45||N===46||N===58||N===95||Kr(N)?(t.consume(N),R):O(N)}function O(N){return N===61?(t.consume(N),L):je(N)?(a=O,V(N)):it(N)?(t.consume(N),O):M(N)}function L(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),s=N,U):je(N)?(a=L,V(N)):it(N)?(t.consume(N),L):(t.consume(N),B)}function U(N){return N===s?(t.consume(N),s=void 0,H):N===null?n(N):je(N)?(a=U,V(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||Ft(N)?M(N):(t.consume(N),B)}function H(N){return N===47||N===62||Ft(N)?M(N):n(N)}function z(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),e):n(N)}function V(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),$}function $(N){return it(N)?ct(t,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):I(N)}function I(N){return t.enter("htmlTextData"),a(N)}}const ZI={name:"labelEnd",resolveAll:xve,resolveTo:vve,tokenize:bve},mve={tokenize:wve},gve={tokenize:kve},yve={tokenize:Sve};function xve(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 s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return t.length!==n.length&&ji(t,0,t.length,n),t}function vve(t,e){let n=t.length,r=0,s,i,a,o;for(;n--;)if(s=t[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const l={type:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[i][1].start},end:{...t[a][1].end}},d={type:"labelText",start:{...t[i+r+2][1].end},end:{...t[a-2][1].start}};return o=[["enter",l,e],["enter",u,e]],o=ra(o,t.slice(i+1,i+r+3)),o=ra(o,[["enter",d,e]]),o=ra(o,zE(e.parser.constructs.insideSpan.null,t.slice(i+r+4,a-3),e)),o=ra(o,[["exit",d,e],t[a-2],t[a-1],["exit",u,e]]),o=ra(o,t.slice(a+1)),o=ra(o,[["exit",l,e]]),ji(t,i,t.length,o),t}function bve(t,e,n){const r=this;let s=r.events.length,i,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return o;function o(p){return i?i._inactive?f(p):(a=r.parser.defined.includes(eo(r.sliceSerialize({start:i.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):n(p)}function l(p){return p===40?t.attempt(mve,d,a?d:f)(p):p===91?t.attempt(gve,d,a?u:f)(p):a?d(p):f(p)}function u(p){return t.attempt(yve,d,f)(p)}function d(p){return e(p)}function f(p){return i._balanced=!0,n(p)}}function wve(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),s}function s(f){return Ft(f)?Dv(t,i)(f):i(f)}function i(f){return f===41?d(f):H8(t,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return Ft(f)?Dv(t,l)(f):d(f)}function o(f){return n(f)}function l(f){return f===34||f===39||f===40?G8(t,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return Ft(f)?Dv(t,d)(f):d(f)}function d(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function kve(t,e,n){const r=this;return s;function s(o){return q8.call(r,t,i,a,"reference","referenceMarker","referenceString")(o)}function i(o){return r.parser.defined.includes(eo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function a(o){return n(o)}}function Sve(t,e,n){return r;function r(i){return t.enter("reference"),t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),s}function s(i){return i===93?(t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),t.exit("reference"),e):n(i)}}const _ve={name:"labelStartImage",resolveAll:ZI.resolveAll,tokenize:Eve};function Eve(t,e,n){const r=this;return s;function s(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),i}function i(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 Cve={name:"labelStartLink",resolveAll:ZI.resolveAll,tokenize:Ave};function Ave(t,e,n){const r=this;return s;function s(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const IA={name:"lineEnding",tokenize:Tve};function Tve(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),ct(t,e,"linePrefix")}}const Sk={name:"thematicBreak",tokenize:jve};function jve(t,e,n){let r=0,s;return i;function i(u){return t.enter("thematicBreak"),a(u)}function a(u){return s=u,o(u)}function o(u){return u===s?(t.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||je(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===s?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),it(u)?ct(t,o,"whitespace")(u):o(u))}}const Ts={continuation:{tokenize:Ive},exit:Mve,name:"list",tokenize:Rve},Nve={partial:!0,tokenize:Ove},Pve={partial:!0,tokenize:Dve};function Rve(t,e,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const y=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:CN(m)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(Sk,n,u)(m):u(m);if(!r.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(m)}return n(m)}function l(m){return CN(m)&&++a<10?(t.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),u(m)):n(m)}function u(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,t.check(L0,r.interrupt?n:d,t.attempt(Nve,p,f))}
vendor: 9,967 bytes, lines 615-617
615function d(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function f(m){return it(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function Ive(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(L0,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ct(t,e,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!it(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(Pve,e,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ct(t,t.attempt(Ts,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Dve(t,e,n){const r=this;return ct(t,s,"listItemIndent",r.containerState.size+1);function s(i){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(i):n(i)}}function Mve(t){t.exit(this.containerState.type)}function Ove(t,e,n){const r=this;return ct(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!it(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const W4={name:"setextUnderline",resolveTo:Lve,tokenize:Fve};function Lve(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",a,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function Fve(t,e,n){const r=this;let s;return i;function i(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),s=u,a(u)):n(u)}function a(u){return t.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(t.consume(u),o):(t.exit("setextHeadingLineSequence"),it(u)?ct(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||je(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Bve={tokenize:$ve};function $ve(t){const e=this,n=t.attempt(L0,r,t.attempt(this.parser.constructs.flowInitial,s,ct(t,t.attempt(this.parser.constructs.flow,s,t.attempt(Hxe,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Uve={resolveAll:Y8()},zve=K8("string"),Vve=K8("text");function K8(t){return{resolveAll:Y8(t==="text"?Wve:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,o);return a;function a(d){return u(d)?i(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=s[d];let p=-1;if(f)for(;++p<f.length;){const m=f[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Y8(t){return e;function e(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return t?t(n,r):n}}function Wve(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],s=e.sliceStream(r);let i=s.length,a=-1,o=0,l;for(;i--;){const u=s[i];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)l=!0,o++;else if(u!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const u={type:n===t.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(t.splice(n,0,["enter",u,e],["exit",u,e]),n+=2)}n++}return t}const Hve={42:Ts,43:Ts,45:Ts,48:Ts,49:Ts,50:Ts,51:Ts,52:Ts,53:Ts,54:Ts,55:Ts,56:Ts,57:Ts,62:U8},qve={91:Xxe},Gve={[-2]:RA,[-1]:RA,32:RA},Kve={35:nve,42:Sk,45:[W4,Sk],60:ave,61:W4,95:Sk,96:z4,126:z4},Yve={38:V8,92:z8},Xve={[-5]:IA,[-4]:IA,[-3]:IA,33:_ve,38:V8,42:AN,60:[Cxe,fve],91:Cve,92:[eve,z8],93:ZI,95:AN,96:Bxe},Zve={null:[AN,Uve]},Qve={null:[42,95]},Jve={null:[]},ebe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Qve,contentInitial:qve,disable:Jve,document:Hve,flow:Kve,flowInitial:Gve,insideSpan:Zve,string:Yve,text:Xve},Symbol.toStringTag,{value:"Module"}));function tbe(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 s={},i=[];let a=[],o=[];const l={attempt:T(E),check:T(C),consume:w,enter:v,exit:S,interrupt:T(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:y,parser:t,previous:null,sliceSerialize:p,sliceStream:m,write:f};let d=e.tokenize.call(u,l);return e.resolveAll&&i.push(e),u;function f(O){return a=ra(a,O),b(),a[a.length-1]!==null?[]:(P(e,0),u.events=zE(i,u.events,u),u.events)}function p(O,L){return rbe(m(O),L)}function m(O){return nbe(a,O)}function y(){const{_bufferIndex:O,_index:L,line:U,column:B,offset:H}=r;return{_bufferIndex:O,_index:L,line:U,column:B,offset:H}}function g(O){s[O.line]=O.column,R()}function b(){let O;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<L.length;)x(L.charCodeAt(r._bufferIndex));else x(L)}}function x(O){d=d(O)}function w(O){je(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,R()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function v(O,L){const U=L||{};return U.type=O,U.start=y(),u.events.push(["enter",U,u]),o.push(U),U}function S(O){const L=o.pop();return L.end=y(),u.events.push(["exit",L,u]),L}function E(O,L){P(O,L.from)}function C(O,L){L.restore()}function T(O,L){return U;function U(B,H,z){let V,$,I,N;return Array.isArray(B)?q(B):"tokenize"in B?q([B]):W(B);function W(se){return Y;function Y(de){const Ie=de!==null&&se[de],_e=de!==null&&se.null,Ee=[...Array.isArray(Ie)?Ie:Ie?[Ie]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return q(Ee)(de)}}function q(se){return V=se,$=0,se.length===0?z:D(se[$])}function D(se){return Y;function Y(de){return N=M(),I=se,se.partial||(u.currentConstruct=se),se.name&&u.parser.constructs.disable.null.includes(se.name)?X():se.tokenize.call(L?Object.assign(Object.create(u),L):u,l,Q,X)(de)}}function Q(se){return O(I,N),H}function X(se){return N.restore(),++$<V.length?D(V[$]):z}}}function P(O,L){O.resolveAll&&!i.includes(O)&&i.push(O),O.resolve&&ji(u.events,L,u.events.length-L,O.resolve(u.events.slice(L),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function M(){const O=y(),L=u.previous,U=u.currentConstruct,B=u.events.length,H=Array.from(o);return{from:B,restore:z};function z(){r=O,u.previous=L,u.currentConstruct=U,u.events.length=B,o=H,R()}}function R(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function nbe(t,e){const n=e.start._index,r=e.start._bufferIndex,s=e.end._index,i=e.end._bufferIndex;let a;if(n===s)a=[t[n].slice(r,i)];else{if(a=t.slice(n,s),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function rbe(t,e){let n=-1;const r=[];let s;for(;++n<t.length;){const i=t[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
616`;break}case-3:{a=`\r
617`;break}case-2:{a=e?" ":"	";break}case-1:{if(!e&&s)continue;a=" ";break}default:a=String.fromCharCode(i)}s=i===-2,r.push(a)}return r.join("")}function sbe(t){const r={constructs:B8([ebe,...(t||{}).extensions||[]]),content:s(vxe),defined:[],document:s(wxe),flow:s(Bve),lazy:{},string:s(zve),text:s(Vve)};return r;function s(i){return a;function a(o){return tbe(r,i,o)}}}function ibe(t){for(;!W8(t););return t}const H4=/[\0\t\n\r]/g;function abe(){let t=1,e="",n=!0,r;return s;function s(i,a,o){const l=[];let u,d,f,p,m;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),f=0,e="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(H4.lastIndex=f,u=H4.exec(i),p=u&&u.index!==void 0?u.index:i.length,m=i.charCodeAt(p),!u){e=i.slice(f);break}if(m===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),t+=p-f),m){case 0:{l.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,l.push(-2);t++<d;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}f=p+1}return o&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const obe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lbe(t){return t.replace(obe,cbe)}function cbe(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return $8(n.slice(i?2:1),i?16:10)}return XI(n)||t}const X8={}.hasOwnProperty;function ube(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),dbe(n)(ibe(sbe(n).document().write(abe()(t,e,!0))))}function dbe(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter
vendor: 10,146 bytes, line 617
617:{autolink:i(Pr),autolinkProtocol:M,autolinkEmail:M,atxHeading:i(qe),blockQuote:i(_e),characterEscape:M,characterReference:M,codeFenced:i(Ee),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Ee,a),codeText:i(xe,a),codeTextData:M,data:M,codeFlowValue:M,definition:i(Ne),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(tt),hardBreakEscape:i(pt),hardBreakTrailing:i(pt),htmlFlow:i(Et,a),htmlFlowData:M,htmlText:i(Et,a),htmlTextData:M,image:i(Bt),label:a,link:i(Pr),listItem:i(ks),listItemValue:p,listOrdered:i(Oi,f),listUnordered:i(Oi),paragraph:i(ll),reference:D,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(qe),strong:i(fr),thematicBreak:i(va)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:Ie,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:se,characterReference:Y,codeFenced:l(b),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:y,codeFlowValue:R,codeIndented:l(x),codeText:l(H),codeTextData:R,data:R,definition:l(),definitionDestinationString:S,definitionLabelString:w,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(U),htmlFlowData:R,htmlText:l(B),htmlTextData:R,image:l(V),label:I,labelText:$,lineEnding:O,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Q,resourceDestinationString:N,resourceTitleString:W,resource:q,setextHeading:l(P),setextHeadingLineSequence:T,setextHeadingText:C,strong:l(),thematicBreak:l()}};Z8(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(G){let ee={type:"root",children:[]};const Pe={stack:[ee],tokenStack:[],config:e,enter:o,exit:u,buffer:a,resume:d,data:n},De=[];let Ge=-1;for(;++Ge<G.length;)if(G[Ge][1].type==="listOrdered"||G[Ge][1].type==="listUnordered")if(G[Ge][0]==="enter")De.push(Ge);else{const $t=De.pop();Ge=s(G,$t,Ge)}for(Ge=-1;++Ge<G.length;){const $t=e[G[Ge][0]];X8.call($t,G[Ge][1].type)&&$t[G[Ge][1].type].call(Object.assign({sliceSerialize:G[Ge][2].sliceSerialize},Pe),G[Ge][1])}if(Pe.tokenStack.length>0){const $t=Pe.tokenStack[Pe.tokenStack.length-1];($t[1]||q4).call(Pe,void 0,$t[0])}for(ee.position={start:Ic(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:Ic(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<e.transforms.length;)ee=e.transforms[Ge](ee)||ee;return ee}function s(G,ee,Pe){let De=ee-1,Ge=-1,$t=!1,pr,tr,mr,Hn;for(;++De<=Pe;){const Pt=G[De];switch(Pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pt[0]==="enter"?Ge++:Ge--,Hn=void 0;break}case"lineEndingBlank":{Pt[0]==="enter"&&(pr&&!Hn&&!Ge&&!mr&&(mr=De),Hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Hn=void 0}if(!Ge&&Pt[0]==="enter"&&Pt[1].type==="listItemPrefix"||Ge===-1&&Pt[0]==="exit"&&(Pt[1].type==="listUnordered"||Pt[1].type==="listOrdered")){if(pr){let Li=De;for(tr=void 0;Li--;){const Jr=G[Li];if(Jr[1].type==="lineEnding"||Jr[1].type==="lineEndingBlank"){if(Jr[0]==="exit")continue;tr&&(G[tr][1].type="lineEndingBlank",$t=!0),Jr[1].type="lineEnding",tr=Li}else if(!(Jr[1].type==="linePrefix"||Jr[1].type==="blockQuotePrefix"||Jr[1].type==="blockQuotePrefixWhitespace"||Jr[1].type==="blockQuoteMarker"||Jr[1].type==="listItemIndent"))break}mr&&(!tr||mr<tr)&&(pr._spread=!0),pr.end=Object.assign({},tr?G[tr][1].start:Pt[1].end),G.splice(tr||De,0,["exit",pr,Pt[2]]),De++,Pe++}if(Pt[1].type==="listItemPrefix"){const Li={type:"listItem",_spread:!1,start:Object.assign({},Pt[1].start),end:void 0};pr=Li,G.splice(De,0,["enter",Li,Pt[2]]),De++,Pe++,mr=void 0,Hn=!0}}}return G[ee][1]._spread=$t,Pe}function i(G,ee){return Pe;function Pe(De){o.call(this,G(De),De),ee&&ee.call(this,De)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(G,ee,Pe){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([ee,Pe||void 0]),G.position={start:Ic(ee.start),end:void 0}}function l(G){return ee;function ee(Pe){G&&G.call(this,Pe),u.call(this,Pe)}}function u(G,ee){const Pe=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==G.type&&(ee?ee.call(this,G,De[0]):(De[1]||q4).call(this,G,De[0]));else throw new Error("Cannot close `"+G.type+"` ("+Iv({start:G.start,end:G.end})+"): it’s not open");Pe.position.end=Ic(G.end)}function d(){return YI(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(G){if(this.data.expectingFirstListItemValue){const ee=this.stack[this.stack.length-2];ee.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function m(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.lang=G}function y(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.meta=G}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G.replace(/(\r?\n|\r)$/g,"")}function w(G){const ee=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ee,Pe.identifier=eo(this.sliceSerialize(G)).toLowerCase()}function v(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.title=G}function S(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.url=G}function E(G){const ee=this.stack[this.stack.length-1];if(!ee.depth){const Pe=this.sliceSerialize(G).length;ee.depth=Pe}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(G){const ee=this.stack[this.stack.length-1];ee.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function M(G){const Pe=this.stack[this.stack.length-1].children;let De=Pe[Pe.length-1];(!De||De.type!=="text")&&(De=cl(),De.position={start:Ic(G.start),end:void 0},Pe.push(De)),this.stack.push(De)}function R(G){const ee=this.stack.pop();ee.value+=this.sliceSerialize(G),ee.position.end=Ic(G.end)}function O(G){const ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=ee.children[ee.children.length-1];Pe.position.end=Ic(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ee.type)&&(M.call(this,G),R.call(this,G))}function L(){this.data.atHardBreak=!0}function U(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G}function B(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G}function H(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.value=G}function z(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ee,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function V(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ee=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ee,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function $(G){const ee=this.sliceSerialize(G),Pe=this.stack[this.stack.length-2];Pe.label=lbe(ee),Pe.identifier=eo(ee).toLowerCase()}function I(){const G=this.stack[this.stack.length-1],ee=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const De=G.children;Pe.children=De}else Pe.alt=ee}function N(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.url=G}function W(){const G=this.resume(),ee=this.stack[this.stack.length-1];ee.title=G}function q(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function Q(G){const ee=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ee,Pe.identifier=eo(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function X(G){this.data.characterReferenceType=G.type}function se(G){const ee=this.sliceSerialize(G),Pe=this.data.characterReferenceType;let De;Pe?(De=$8(ee,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=XI(ee);const Ge=this.stack[this.stack.length-1];Ge.value+=De}function Y(G){const ee=this.stack.pop();ee.position.end=Ic(G.end)}function de(G){R.call(this,G);const ee=this.stack[this.stack.length-1];ee.url=this.sliceSerialize(G)}function Ie(G){R.call(this,G);const ee=this.stack[this.stack.length-1];ee.url="mailto:"+this.sliceSerialize(G)}function _e(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function xe(){return{type:"inlineCode",value:""}}function Ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function tt(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function pt(){return{type:"break"}}function Et(){return{type:"html",value:""}}function Bt(){return{type:"image",title:null,url:"",alt:null}}function Pr(){return{type:"link",title:null,url:"",children:[]}}function Oi(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function ks(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function ll(){return{type:"paragraph",children:[]}}function fr(){return{type:"strong",children:[]}}function cl(){return{type:"text",value:""}}function va(){return{type:"thematicBreak"}}}function Ic(t){return{line:t.line,column:t.column,offset:t.offset}}function Z8(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Z8(t,r):hbe(t,r)}}function hbe(t,e){let n;for(n in e)if(X8.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 q4(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Iv({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Iv({start:e.start,end:e.end}
vendor: 12,222 bytes, lines 617-622
617)+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Iv({start:e.start,end:e.end})+") is still open")}function fbe(t){const e=this;e.parser=n;function n(r){return ube(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function pbe(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 mbe(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
618`}]}function gbe(t,e){const n=e.value?e.value+`
619`:"",r={},s=e.lang?e.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(i.data={meta:e.meta}),t.patch(e,i),i=t.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},t.patch(e,i),i}function ybe(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function xbe(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function vbe(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),s=nx(r.toLowerCase()),i=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=i+1,o+=1,t.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function bbe(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 wbe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Q8(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 s=t.all(e),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function kbe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Q8(t,e);const s={src:nx(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return t.patch(e,i),t.applyData(e,i)}function Sbe(t,e){const n={src:nx(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 _be(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 Ebe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Q8(t,e);const s={href:nx(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Cbe(t,e){const n={href:nx(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 Abe(t,e,n){const r=t.all(e),s=n?Tbe(n):J8(e),i={},a=[];if(typeof e.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(s||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
620`}),d.type==="element"&&d.tagName==="p"&&!s?a.push(...d.children):a.push(d)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
621`});const u={type:"element",tagName:"li",properties:i,children:a};return t.patch(e,u),t.applyData(e,u)}function Tbe(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=J8(n[r])}return e}function J8(t){const e=t.spread;return e??t.children.length>1}function jbe(t,e){const n={},r=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++s<r.length;){const a=r[s];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 i={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,i),t.applyData(e,i)}function Nbe(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Pbe(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Rbe(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Ibe(t,e){const n=t.all(e),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=HI(e.children[1]),l=R8(e.children[e.children.length-1]);o&&l&&(a.position={start:o,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(e,i),t.applyData(e,i)}function Dbe(t,e,n){const r=n?n.children:void 0,i=(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 u=[];for(;++l<o;){const f=e.children[l],p={},m=a?a[l]:void 0;m&&(p.align=m);let y={type:"element",tagName:i,properties:p,children:[]};f&&(y.children=t.all(f),t.patch(f,y),y=t.applyData(f,y)),u.push(y)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(e,d),t.applyData(e,d)}function Mbe(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const G4=9,K4=32;function Obe(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),s=0;const i=[];for(;r;)i.push(Y4(e.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(e);return i.push(Y4(e.slice(s),s>0,!1)),i.join("")}function Y4(t,e,n){let r=0,s=t.length;if(e){let i=t.codePointAt(r);for(;i===G4||i===K4;)r++,i=t.codePointAt(r)}if(n){let i=t.codePointAt(s-1);for(;i===G4||i===K4;)s--,i=t.codePointAt(s-1)}return s>r?t.slice(r,s):""}function Lbe(t,e){const n={type:"text",value:Obe(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Fbe(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Bbe={blockquote:pbe,break:mbe,code:gbe,delete:ybe,emphasis:xbe,footnoteReference:vbe,heading:bbe,html:wbe,imageReference:kbe,image:Sbe,inlineCode:_be,linkReference:Ebe,link:Cbe,listItem:Abe,list:jbe,paragraph:Nbe,root:Pbe,strong:Rbe,table:Ibe,tableCell:Mbe,tableRow:Dbe,text:Lbe,thematicBreak:Fbe,toml:R1,yaml:R1,definition:R1,footnoteDefinition:R1};function R1(){}const e9=-1,VE=0,Mv=1,l_=2,QI=3,JI=4,eD=5,tD=6,t9=7,n9=8,X4=typeof self=="object"?self:globalThis,$be=(t,e)=>{const n=(s,i)=>(t.set(i,s),s),r=s=>{if(t.has(s))return t.get(s);const[i,a]=e[s];switch(i){case VE:case e9:return n(a,s);case Mv:{const o=n([],s);for(const l of a)o.push(r(l));return o}case l_:{const o=n({},s);for(const[l,u]of a)o[r(l)]=r(u);return o}case QI:return n(new Date(a),s);case JI:{const{source:o,flags:l}=a;return n(new RegExp(o,l),s)}case eD:{const o=n(new Map,s);for(const[l,u]of a)o.set(r(l),r(u));return o}case tD:{const o=n(new Set,s);for(const l of a)o.add(r(l));return o}case t9:{const{name:o,message:l}=a;return n(new X4[o](l),s)}case n9:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);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(new X4[i](a),s)};return r},Z4=t=>$be(new Map,t)(0),Ap="",{toString:Ube}={},{keys:zbe}=Object,Ex=t=>{const e=typeof t;if(e!=="object"||!t)return[VE,e];const n=Ube.call(t).slice(8,-1);switch(n){case"Array":return[Mv,Ap];case"Object":return[l_,Ap];case"Date":return[QI,Ap];case"RegExp":return[JI,Ap];case"Map":return[eD,Ap];case"Set":return[tD,Ap];case"DataView":return[Mv,n]}return n.includes("Array")?[Mv,n]:n.includes("Error")?[t9,n]:[l_,n]},I1=([t,e])=>t===VE&&(e==="function"||e==="symbol"),Vbe=(t,e,n,r)=>{const s=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},i=a=>{if(n.has(a))return n.get(a);let[o,l]=Ex(a);switch(o){case VE:{let d=a;switch(l){case"bigint":o=n9,d=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return s([e9],a)}return s([o,d],a)}case Mv:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const d=[],f=s([o,d],a);for(const p of a)d.push(i(p));return f}case l_:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(e&&"toJSON"in a)return i(a.toJSON());const d=[],f=s([o,d],a);for(const p of zbe(a))(t||!I1(Ex(a[p])))&&d.push([i(p),i(a[p])]);return f}case QI:return s([o,a.toISOString()],a);case JI:{const{source:d,flags:f}=a;return s([o,{source:d,flags:f}],a)}case eD:{const d=[],f=s([o,d],a);for(const[p,m]of a)(t||!(I1(Ex(p))||I1(Ex(m))))&&d.push([i(p),i(m)]);return f}case tD:{const d=[],f=s([o,d],a);for(const p of a)(t||!I1(Ex(p)))&&d.push(i(p));return f}}const{message:u}=a;return s([o,{name:l,message:u}],a)};return i},Q4=(t,{json:e,lossy:n}={})=>{const r=[];return Vbe(!(e||n),!!e,new Map,r)(t),r},c_=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Z4(Q4(t,e)):structuredClone(t):(t,e)=>Z4(Q4(t,e));function Wbe(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 Hbe(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function qbe(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Wbe,r=t.options.footnoteBackLabel||Hbe,s=t.options.footnoteLabel||"Footnotes",i=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[l]);if(!u)continue;const d=t.all(u),f=String(u.identifier).toUpperCase(),p=nx(f.toLowerCase());let m=0;const y=[],g=t.footnoteCounts.get(f);for(;g!==void 0&&++m<=g;){y.length>0&&y.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,m);typeof w=="string"&&(w={type:"text",value:w}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const b=d[d.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const w=b.children[b.children.length-1];w&&w.type==="text"?w.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...y)}else d.push(...y);const x={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(d,!0)};t.patch(u,x),o.push(x)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...c_(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
622`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)}
vendor: 18,012 bytes, lines 622-627
622,{type:"text",value:`
623`}]}}const WE=function(t){if(t==null)return Xbe;if(typeof t=="function")return HE(t);if(typeof t=="object")return Array.isArray(t)?Gbe(t):Kbe(t);if(typeof t=="string")return Ybe(t);throw new Error("Expected function, string, or object as test")};function Gbe(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=WE(t[n]);return HE(r);function r(...s){let i=-1;for(;++i<e.length;)if(e[i].apply(this,s))return!0;return!1}}function Kbe(t){const e=t;return HE(n);function n(r){const s=r;let i;for(i in t)if(s[i]!==e[i])return!1;return!0}}function Ybe(t){return HE(e);function e(n){return n&&n.type===t}}function HE(t){return e;function e(n,r,s){return!!(Zbe(n)&&t.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function Xbe(){return!0}function Zbe(t){return t!==null&&typeof t=="object"&&"type"in t}const r9=[],Qbe=!0,TN=!1,Jbe="skip";function s9(t,e,n,r){let s;typeof e=="function"&&typeof n!="function"?(r=n,n=e):s=e;const i=WE(s),a=r?-1:1;o(t,void 0,[])();function o(l,u,d){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const m=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=r9,y,g,b;if((!e||i(l,u,d[d.length-1]||void 0))&&(m=ewe(n(l,d)),m[0]===TN))return m;if("children"in l&&l.children){const x=l;if(x.children&&m[0]!==Jbe)for(g=(r?x.children.length:-1)+a,b=d.concat(x);g>-1&&g<x.children.length;){const w=x.children[g];if(y=o(w,g,b)(),y[0]===TN)return y;g=typeof y[1]=="number"?y[1]:g+a}}return m}}}function ewe(t){return Array.isArray(t)?t:typeof t=="number"?[Qbe,t]:t==null?r9:[t]}function nD(t,e,n,r){let s,i,a;typeof e=="function"&&typeof n!="function"?(i=void 0,a=e,s=n):(i=e,a=n,s=r),s9(t,i,o,s);function o(l,u){const d=u[u.length-1],f=d?d.children.indexOf(l):void 0;return a(l,f,d)}}const jN={}.hasOwnProperty,twe={};function nwe(t,e){const n=e||twe,r=new Map,s=new Map,i=new Map,a={...Bbe,...n.handlers},o={all:u,applyData:swe,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:a,one:l,options:n,patch:rwe,wrap:awe};return nD(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:s,p=String(d.identifier).toUpperCase();f.has(p)||f.set(p,d)}}),o;function l(d,f){const p=d.type,m=o.handlers[p];if(jN.call(o.handlers,p)&&m)return m(o,d,f);if(o.options.passThrough&&o.options.passThrough.includes(p)){if("children"in d){const{children:g,...b}=d,x=c_(b);return x.children=o.all(d),x}return c_(d)}return(o.options.unknownHandler||iwe)(o,d,f)}function u(d){const f=[];if("children"in d){const p=d.children;let m=-1;for(;++m<p.length;){const y=o.one(p[m],d);if(y){if(m&&p[m-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=J4(y.value)),!Array.isArray(y)&&y.type==="element")){const g=y.children[0];g&&g.type==="text"&&(g.value=J4(g.value))}Array.isArray(y)?f.push(...y):f.push(y)}}}return f}}function rwe(t,e){t.position&&(e.position=Hye(t))}function swe(t,e){let n=e;if(t&&t.data){const r=t.data.hName,s=t.data.hChildren,i=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"&&i&&Object.assign(n.properties,c_(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function iwe(t,e){const n=e.data||{},r="value"in e&&!(jN.call(n,"hProperties")||jN.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 awe(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
624`});++r<t.length;)r&&n.push({type:"text",value:`
625`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
626`}),n}function J4(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function e3(t,e){const n=nwe(t,e),r=n.one(t,void 0),s=qbe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
627`},s),i}function owe(t,e){return t&&"run"in t?async function(n,r){const s=e3(n,{file:r,...e});await t.run(s,r)}:function(n,r){return e3(n,{file:r,...t||e})}}function t3(t){if(t)throw t}var _k=Object.prototype.hasOwnProperty,i9=Object.prototype.toString,n3=Object.defineProperty,r3=Object.getOwnPropertyDescriptor,s3=function(e){return typeof Array.isArray=="function"?Array.isArray(e):i9.call(e)==="[object Array]"},i3=function(e){if(!e||i9.call(e)!=="[object Object]")return!1;var n=_k.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&_k.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;var s;for(s in e);return typeof s>"u"||_k.call(e,s)},a3=function(e,n){n3&&n.name==="__proto__"?n3(e,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):e[n.name]=n.newValue},o3=function(e,n){if(n==="__proto__")if(_k.call(e,n)){if(r3)return r3(e,n).value}else return;return e[n]},lwe=function t(){var e,n,r,s,i,a,o=arguments[0],l=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<u;++l)if(e=arguments[l],e!=null)for(n in e)r=o3(o,n),s=o3(e,n),o!==s&&(d&&s&&(i3(s)||(i=s3(s)))?(i?(i=!1,a=r&&s3(r)?r:[]):a=r&&i3(r)?r:{},a3(o,{name:n,newValue:t(d,a,s)})):typeof s<"u"&&a3(o,{name:n,newValue:s}));return o};const DA=Sc(lwe);function NN(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 cwe(){const t=[],e={run:n,use:r};return e;function n(...s){let i=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...s);function o(l,...u){const d=t[++i];let f=-1;if(l){a(l);return}for(;++f<s.length;)(u[f]===null||u[f]===void 0)&&(u[f]=s[f]);s=u,d?uwe(d,o)(...u):a(null,...u)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function uwe(t,e){let n;return r;function r(...a){const o=t.length>a.length;let l;o&&a.push(s);try{l=t.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return s(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...o){n||(n=!0,e(a,...o))}function i(a){s(null,a)}}const yo={basename:dwe,dirname:hwe,extname:fwe,join:pwe,sep:"/"};function dwe(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');F0(t);let n=0,r=-1,s=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,o=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(t.codePointAt(s)===e.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function hwe(t){if(F0(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 fwe(t){F0(t);let e=t.length,n=-1,r=0,s=-1,i=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?s<0?s=e:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function pwe(...t){let e=-1,n;for(;++e<t.length;)F0(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":mwe(n)}function mwe(t){F0(t);const e=t.codePointAt(0)===47;let n=gwe(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function gwe(t,e){let n="",r=0,s=-1,i=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(!(s===a-1||i===1))if(s!==a-1&&i===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("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return n}function F0(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const ywe={cwd:xwe};function xwe(){return"/"}function PN(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function vwe(t){if(typeof t=="string")t=new URL(t);else if(!PN(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 bwe(t)}function bwe(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const MA=["history","path","basename","stem","extname","dirname"];class a9{constructor(e){let n;e?PN(e)?n={path:e}:typeof e=="string"||wwe(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":ywe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<MA.length;){const i=MA[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)MA.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?yo.basename(this.path):void 0}set basename(e){LA(e,"basename"),OA(e,"basename"),this.path=yo.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?yo.dirname(this.path):void 0}set dirname(e){l3(this.basename,"dirname"),this.path=yo.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?yo.extname(this.path):void 0}set extname(e){if(OA(e,"extname"),l3(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=yo.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){PN(e)&&(e=vwe(e)),LA(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?yo.basename(this.path,this.extname):void 0}set stem(e){LA(e,"stem"),OA(e,"stem"),this.path=yo.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const s=this.message(e,n,r);throw s.fatal=!0,s}info(e,n,r){const s=this.message(e,n,r);return s.fatal=void 0,s}message(e,n,r){const s=new Qr(e,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function OA(t,e){if(t&&t.includes(yo.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+yo.sep+"`")}function LA(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function l3(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function wwe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const kwe=function(t){const r=this.constructor.prototype,s=r[t],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},Swe={}.hasOwnProperty;class rD extends kwe{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=cwe()}copy(){const e=new rD;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(DA(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?($A("data",this.frozen),this.namespace[e]=n,this):Swe.call(this.namespace,e)&&this.namespace[e]||void 0:e?($A("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 s=n.call(e,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=D1(e),r=this.parser||this.Parser;return FA("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),FA("process",this.parser||this.Parser),BA("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,a){const o=D1(e),l=r.parse(o);r.run(l,o,function(d,f,p){if(d||!f||!p)return u(d);const m=f,y=r.stringify(m,p);Cwe(y)?p.value=y:p.result=y,u(d,p)});function u(d,f){d||!f?a(d):i?i(f):n(void 0,f)}}}processSync(e){let n=!1,r;return this.freeze(),FA("processSync",this.parser||this.Parser),BA("processSync",this.compiler||this.Compiler),this.process(e,s),u3("processSync","process",n),r;function s(i,a){n=!0,t3(i),r=a}}run(e,n,r){c3(e),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(a,o){const l=D1(n);s.run(e,l,u);function u(d,f,p){const m=f||e;d?o(d):a?a(m):r(void 0,m,p)}}}runSync(e,n){let r=!1,s;return this.run(e,n,i),u3("runSync","run",r),s;function i(a,o){t3(a),s=o,r=!0}}stringify(e,n){this.freeze();const r=D1(n),s=this.compiler||this.Compiler;return BA("stringify",s),c3(e),s(e,r)}use(e,...n){const r=this.attachers,s=this.namespace;if($A("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 i(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;l(d,f)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(s.settings=DA(!0,s.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];i(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===u){p=f;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[m,...y]=d;const g=r[p][1];NN(g)&&NN(m)&&(m=DA(!0,g,m)),r[p]=[u,m,...y]}}}}const _we=new rD().freeze();function FA(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function BA(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function $A(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 c3(t){if(!NN(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function u3(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function D1(t){return Ewe(t)?t:new a9(t)}function Ewe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Cwe(t){return typeof t=="string"||Awe(t)}function Awe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Twe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",d3=[],h3={allowDangerousHtml:!0},jwe=/^(https?|ircs?|mailto|xmpp)$/i,Nwe=[{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 Wd(t){const e=Pwe(t),n=Rwe(t);return Iwe(e.runSync(e.parse(n),n),t)}function Pwe(t){const e=t.rehypePlugins||d3,n=t.remarkPlugins||d3,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...h3}:h3;return _we().use(fbe).use(n).use(owe,r).use(e)}function Rwe(t){const e=t.children||"",n=new a9;return typeof e=="string"&&(n.value=e),n}function Iwe(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,l=e.urlTransform||Dwe;for(const d of Nwe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Twe+d.id,void 0);return nD(t,u),Xye(t,{Fragment:c.Fragment,components:s,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return a?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;
vendor: 18,253 bytes, lines 627-640
627if(d.type==="element"){let m;for(m in PA)if(Object.hasOwn(PA,m)&&Object.hasOwn(d.properties,m)){const y=d.properties[m],g=PA[m];(g===null||g.includes(d.tagName))&&(d.properties[m]=l(String(y||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!m&&r&&typeof f=="number"&&(m=!r(d,f,p)),m&&p&&typeof f=="number")return o&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function Dwe(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||jwe.test(t.slice(0,e))?t:""}function f3(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function Mwe(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Owe(t,e,n){const s=WE((n||{}).ignore||[]),i=Lwe(e);let a=-1;for(;++a<i.length;)s9(t,"text",o);function o(u,d){let f=-1,p;for(;++f<d.length;){const m=d[f],y=p?p.children:void 0;if(s(m,y?y.indexOf(m):void 0,p))return;p=m}if(p)return l(u,d)}function l(u,d){const f=d[d.length-1],p=i[a][0],m=i[a][1];let y=0;const b=f.children.indexOf(u);let x=!1,w=[];p.lastIndex=0;let v=p.exec(u.value);for(;v;){const S=v.index,E={index:v.index,input:v.input,stack:[...d,u]};let C=m(...v,E);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?p.lastIndex=S+1:(y!==S&&w.push({type:"text",value:u.value.slice(y,S)}),Array.isArray(C)?w.push(...C):C&&w.push(C),y=S+v[0].length,x=!0),!p.global)break;v=p.exec(u.value)}return x?(y<u.value.length&&w.push({type:"text",value:u.value.slice(y)}),f.children.splice(b,1,...w)):w=[u],b+w.length}}function Lwe(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const s=n[r];e.push([Fwe(s[0]),Bwe(s[1])])}return e}function Fwe(t){return typeof t=="string"?new RegExp(Mwe(t),"g"):t}function Bwe(t){return typeof t=="function"?t:function(){return t}}const UA="phrasing",zA=["autolink","link","image","label"];function $we(){return{transforms:[Gwe],enter:{literalAutolink:zwe,literalAutolinkEmail:VA,literalAutolinkHttp:VA,literalAutolinkWww:VA},exit:{literalAutolink:qwe,literalAutolinkEmail:Hwe,literalAutolinkHttp:Vwe,literalAutolinkWww:Wwe}}}function Uwe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:UA,notInConstruct:zA},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:UA,notInConstruct:zA},{character:":",before:"[ps]",after:"\\/",inConstruct:UA,notInConstruct:zA}]}}function zwe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function VA(t){this.config.enter.autolinkProtocol.call(this,t)}function Vwe(t){this.config.exit.autolinkProtocol.call(this,t)}function Wwe(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function Hwe(t){this.config.exit.autolinkEmail.call(this,t)}function qwe(t){this.exit(t)}function Gwe(t){Owe(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Kwe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Ywe]],{ignore:["link","linkReference"]})}function Kwe(t,e,n,r,s){let i="";if(!o9(s)||(/^w/i.test(e)&&(n=e+n,e="",i="http://"),!Xwe(n)))return!1;const a=Zwe(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:i+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function Ywe(t,e,n,r){return!o9(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function Xwe(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function Zwe(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const s=f3(t,"(");let i=f3(t,")");for(;r!==-1&&s>i;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[t,n]}function o9(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||ep(n)||UE(n))&&(!e||n!==47)}l9.peek=a0e;function Qwe(){this.buffer()}function Jwe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function e0e(){this.buffer()}function t0e(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function n0e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=eo(this.sliceSerialize(t)).toLowerCase(),n.label=e}function r0e(t){this.exit(t)}function s0e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=eo(this.sliceSerialize(t)).toLowerCase(),n.label=e}function i0e(t){this.exit(t)}function a0e(){return"["}function l9(t,e,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return i+=s.move(n.safe(n.associationId(t),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function o0e(){return{enter:{gfmFootnoteCallString:Qwe,gfmFootnoteCall:Jwe,gfmFootnoteDefinitionLabelString:e0e,gfmFootnoteDefinition:t0e},exit:{gfmFootnoteCallString:n0e,gfmFootnoteCall:r0e,gfmFootnoteDefinitionLabelString:s0e,gfmFootnoteDefinition:i0e}}}function l0e(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:l9},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let l=o.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return l+=o.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((e?`
628`:" ")+i.indentLines(i.containerFlow(r,o.current()),e?c9:c0e))),u(),l}}function c0e(t,e,n){return e===0?t:c9(t,e,n)}function c9(t,e,n){return(n?"":"    ")+t}const u0e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];u9.peek=m0e;function d0e(){return{canContainEols:["delete"],enter:{strikethrough:f0e},exit:{strikethrough:p0e}}}function h0e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:u0e}],handlers:{delete:u9}}}function f0e(t){this.enter({type:"delete",children:[]},t)}function p0e(t){this.exit(t)}function u9(t,e,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(t,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function m0e(){return"~"}function g0e(t){return t.length}function y0e(t,e){const n=e||{},r=(n.align||[]).concat(),s=n.stringLength||g0e,i=[],a=[],o=[],l=[];let u=0,d=-1;for(;++d<t.length;){const g=[],b=[];let x=-1;for(t[d].length>u&&(u=t[d].length);++x<t[d].length;){const w=x0e(t[d][x]);if(n.alignDelimiters!==!1){const v=s(w);b[x]=v,(l[x]===void 0||v>l[x])&&(l[x]=v)}g.push(w)}a[d]=g,o[d]=b}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)i[f]=p3(r[f]);else{const g=p3(r);for(;++f<u;)i[f]=g}f=-1;const p=[],m=[];for(;++f<u;){const g=i[f];let b="",x="";g===99?(b=":",x=":"):g===108?b=":":g===114&&(x=":");let w=n.alignDelimiters===!1?1:Math.max(1,l[f]-b.length-x.length);const v=b+"-".repeat(w)+x;n.alignDelimiters!==!1&&(w=b.length+w+x.length,w>l[f]&&(l[f]=w),m[f]=w),p[f]=v}a.splice(1,0,p),o.splice(1,0,m),d=-1;const y=[];for(;++d<a.length;){const g=a[d],b=o[d];f=-1;const x=[];for(;++f<u;){const w=g[f]||"";let v="",S="";if(n.alignDelimiters!==!1){const E=l[f]-(b[f]||0),C=i[f];C===114?v=" ".repeat(E):C===99?E%2?(v=" ".repeat(E/2+.5),S=" ".repeat(E/2-.5)):(v=" ".repeat(E/2),S=v):S=" ".repeat(E)}n.delimiterStart!==!1&&!f&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||f)&&x.push(" "),n.alignDelimiters!==!1&&x.push(v),x.push(w),n.alignDelimiters!==!1&&x.push(S),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&x.push("|")}y.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return y.join(`
629`)}function x0e(t){return t==null?"":String(t)}function p3(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function v0e(t,e,n,r){const s=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(t,i.current()),b0e);return s(),a}function b0e(t,e,n){return">"+(n?"":" ")+t}function w0e(t,e){return m3(t,e.inConstruct,!0)&&!m3(t,e.notInConstruct,!1)}function m3(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function g3(t,e,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
630`&&w0e(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
631`}function k0e(t,e){const n=String(t);let r=n.indexOf(e),s=r,i=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++i>a&&(a=i):i=1,s=r+e.length,r=n.indexOf(e,s);return a}function S0e(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function _0e(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function E0e(t,e,n,r){const s=_0e(n),i=t.value||"",a=s==="`"?"GraveAccent":"Tilde";if(S0e(t,n)){const f=n.enter("codeIndented"),p=n.indentLines(i,C0e);return f(),p}const o=n.createTracker(r),l=s.repeat(Math.max(k0e(i,s)+1,3)),u=n.enter("codeFenced");let d=o.move(l);if(t.lang){const f=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(t.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(t.lang&&t.meta){const f=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(t.meta,{before:d,after:`
632`,encode:["`"],...o.current()})),f()}return d+=o.move(`
633`),i&&(d+=o.move(i+`
634`)),d+=o.move(l),u(),d}function C0e(t,e,n){return(n?"":"    ")+t}function sD(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function A0e(t,e,n,r){const s=sD(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(t),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(t.url,{before:u,after:t.title?" ":`
635`,...l.current()}))),o(),t.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(t.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),a(),u}function T0e(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Sb(t){return"&#x"+t.toString(16).toUpperCase()+";"}function u_(t,e,n){const r=My(t),s=My(e);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}d9.peek=j0e;function d9(t,e,n,r){const s=T0e(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let l=a.move(n.containerPhrasing(t,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=u_(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Sb(u)+l.slice(1));const f=l.charCodeAt(l.length-1),p=u_(r.after.charCodeAt(0),f,s);p.inside&&(l=l.slice(0,-1)+Sb(f));const m=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},o+l+m}function j0e(t,e,n){return n.options.emphasis||"*"}function N0e(t,e){let n=!1;return nD(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,TN}),!!((!t.depth||t.depth<3)&&YI(t)&&(e.options.setext||n))}function P0e(t,e,n,r){const s=Math.max(Math.min(6,t.depth||1),1),i=n.createTracker(r);if(N0e(t,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),p=n.containerPhrasing(t,{...i.current(),before:`
636`,after:`
637`});return f(),d(),p+`
638`+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
639`))+1))}const a="#".repeat(s),o=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let u=n.containerPhrasing(t,{before:"# ",after:`
640`,...i.current()});return/^[\t ]/.test(u)&&(u=Sb(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}h9.peek=R0e;function h9(t){return t.value||""}function R0e(){return"<"}f9.peek=I0e;function f9(t,e,n,r){const s=sD(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(t.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(t.url,{before:u,after:t.title?" ":")",...l.current()}))),o(),t.title&&(o=n.enter(`title${i}`),u+=l.move(" "+s),u+=l.move(n.safe(t.title,{before:u,after:s,...l.current()})),u+=l.move(s),o()),u+=l.move(")"),a(),u}function I0e(){return"!"}p9.peek=D0e;function p9(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(t.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function D0e(){return"!"}m9.peek=M0e;function m9(t,e,n){let r=t.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],o=n.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return s+r+s}function M0e(){return"`"}function g9(t,e){const n=YI(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}y9.peek=O0e;function y9(t,e,n,r){const s=sD(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(g9(t,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(t,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=d,f}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(t,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(t.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(t.url,{before:u,after:t.title?" ":")",...a.current()}))),l(),t.title&&(l=n.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(n.safe(t.title,{before:u,after:s,...a.current()})),u+=a.move(s),l()),u+=a.move(")"),o(),u}function O0e(t,e,n){return g9(t,n)?"<":"["}x9.peek=L0e;function x9(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(t,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...o.current()});return a(),n.stack=d,i(),s==="full"||!u||u!==f?l+=o.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function L0e(){return"["}function iD(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function F0e(t){const e=iD(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function B0e(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function v9(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function $0e(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?B0e(n):iD(n);const o=t.ordered?a==="."?")":".":F0e(n);let l=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),v9(n)===a&&d){let f=-1;for(;++f<t.children.length;){const p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=i,s(),u}function U0e(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function z0e(t,e,n,r){const s=U0e(n);let i=n.bulletCurrent||iD(n);e&&e.type==="list"&&e.ordered&&(i=(typeof e.start=="number"&&e.start>
vendor: 6,651 bytes, lines 640-642
640-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(t,o.current()),d);return l(),u;function d(f,p,m){return p?(m?"":" ".repeat(a))+f:(m?i:i+" ".repeat(a-i.length))+f}}function V0e(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const W0e=WE(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function H0e(t,e,n,r){return(t.children.some(function(a){return W0e(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function q0e(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}b9.peek=G0e;function b9(t,e,n,r){const s=q0e(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let l=a.move(n.containerPhrasing(t,{after:s,before:o,...a.current()}));const u=l.charCodeAt(0),d=u_(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(l=Sb(u)+l.slice(1));const f=l.charCodeAt(l.length-1),p=u_(r.after.charCodeAt(0),f,s);p.inside&&(l=l.slice(0,-1)+Sb(f));const m=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},o+l+m}function G0e(t,e,n){return n.options.strong||"*"}function K0e(t,e,n,r){return n.safe(t.value,r)}function Y0e(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function X0e(t,e,n){const r=(v9(n)+(n.options.ruleSpaces?" ":"")).repeat(Y0e(n));return n.options.ruleSpaces?r.slice(0,-1):r}const w9={blockquote:v0e,break:g3,code:E0e,definition:A0e,emphasis:d9,hardBreak:g3,heading:P0e,html:h9,image:f9,imageReference:p9,inlineCode:m9,link:y9,linkReference:x9,list:$0e,listItem:z0e,paragraph:V0e,root:H0e,strong:b9,text:K0e,thematicBreak:X0e};function Z0e(){return{enter:{table:Q0e,tableData:y3,tableHeader:y3,tableRow:e1e},exit:{codeText:t1e,table:J0e,tableData:WA,tableHeader:WA,tableRow:WA}}}function Q0e(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function J0e(t){this.exit(t),this.data.inTable=void 0}function e1e(t){this.enter({type:"tableRow",children:[]},t)}function WA(t){this.exit(t)}function y3(t){this.enter({type:"tableCell",children:[]},t)}function t1e(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,n1e));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function n1e(t,e){return e==="|"?e:t}function r1e(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
641`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:o}};function a(m,y,g,b){return u(d(m,g,b),m.align)}function o(m,y,g,b){const x=f(m,g,b),w=u([x]);return w.slice(0,w.indexOf(`
642`))}function l(m,y,g,b){const x=g.enter("tableCell"),w=g.enter("phrasing"),v=g.containerPhrasing(m,{...b,before:i,after:i});return w(),x(),v}function u(m,y){return y0e(m,{align:y,alignDelimiters:r,padding:n,stringLength:s})}function d(m,y,g){const b=m.children;let x=-1;const w=[],v=y.enter("table");for(;++x<b.length;)w[x]=f(b[x],y,g);return v(),w}function f(m,y,g){const b=m.children;let x=-1;const w=[],v=y.enter("tableRow");for(;++x<b.length;)w[x]=l(b[x],m,y,g);return v(),w}function p(m,y,g){let b=w9.inlineCode(m,y,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function s1e(){return{exit:{taskListCheckValueChecked:x3,taskListCheckValueUnchecked:x3,paragraph:a1e}}}function i1e(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:o1e}}}function x3(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function a1e(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,a;for(;++i<s.length;){const o=s[i];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function o1e(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",o=n.createTracker(r);i&&o.move(a);let l=w9.listItem(t,e,n,{...r,...o.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+a}}function l1e(){return[$we(),o0e(),d0e(),Z0e(),s1e()]}function c1e(t){return{extensions:[Uwe(),l0e(t),h0e(),r1e(t),i1e()]}}const u1e={tokenize:g1e,partial:!0},k9={tokenize:y1e,partial:!0},S9={tokenize:x1e,partial:!0},_9={tokenize:v1e,partial:!0},d1e={tokenize:b1e,partial:!0},E9={name:"wwwAutolink",tokenize:p1e,previous:A9},C9={name:"protocolAutolink",tokenize:m1e,previous:T9},Ac={name:"emailAutolink",tokenize:f1e,previous:j9},ol={};function h1e(){return{text:ol}}let Hd=48;for(;Hd<123;)ol[Hd]=Ac,Hd++,Hd===58?Hd=65:Hd===91&&(Hd=97);ol[43]=Ac;ol[45]=Ac;ol[46]=Ac;ol[95]=Ac;ol[72]=[Ac,C9];ol[104]=[Ac,C9];ol[87]=[Ac,E9];ol[119]=[Ac,E9];function f1e(t,e,n){const r=this;let s,i;return a;function a(f){return!RN(f)||!j9.call(r,r.previous)||aD(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(f))}function o(f){return RN(f)?(t.consume(f),o):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check(d1e,d,u)(f):f===45||f===95||Kr(f)?(i=!0,t.consume(f),l):d(f)}function u(f){return t.consume(f),s=!0,l}function d(f){return i&&s&&hs(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function p1e(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!A9.call(r,r.previous)||aD(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(u1e,t.attempt(k9,t.attempt(S9,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(
vendor: 5,036 bytes, line 642
642a)}}function m1e(t,e,n){const r=this;let s="",i=!1;return a;function a(f){return(f===72||f===104)&&T9.call(r,r.previous)&&!aD(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(f),t.consume(f),o):n(f)}function o(f){if(hs(f)&&s.length<5)return s+=String.fromCodePoint(f),t.consume(f),o;if(f===58){const p=s.toLowerCase();if(p==="http"||p==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),i?u:(i=!0,l)):n(f)}function u(f){return f===null||o_(f)||Ft(f)||ep(f)||UE(f)?n(f):t.attempt(k9,t.attempt(S9,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function g1e(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function y1e(t,e,n){let r,s,i;return a;function a(u){return u===46||u===95?t.check(_9,l,o)(u):u===null||Ft(u)||ep(u)||u!==45&&UE(u)?l(u):(i=!0,t.consume(u),a)}function o(u){return u===95?r=!0:(s=r,r=void 0),t.consume(u),a}function l(u){return s||r||!i?n(u):e(u)}}function x1e(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(_9,e,i)(a):a===null||Ft(a)||ep(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function v1e(t,e,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),r):o===38?(t.consume(o),i):o===93?(t.consume(o),s):o===60||o===null||Ft(o)||ep(o)?e(o):n(o)}function s(o){return o===null||o===40||o===91||Ft(o)||ep(o)?e(o):r(o)}function i(o){return hs(o)?a(o):n(o)}function a(o){return o===59?(t.consume(o),r):hs(o)?(t.consume(o),a):n(o)}}function b1e(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return Kr(i)?n(i):e(i)}}function A9(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ft(t)}function T9(t){return!hs(t)}function j9(t){return!(t===47||RN(t))}function RN(t){return t===43||t===45||t===46||t===95||Kr(t)}function aD(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const w1e={tokenize:j1e,partial:!0};function k1e(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:C1e,continuation:{tokenize:A1e},exit:T1e}},text:{91:{name:"gfmFootnoteCall",tokenize:E1e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:S1e,resolveTo:_1e}}}}function S1e(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=eo(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function _1e(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...o),t}function E1e(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!a||f===null||f===91||Ft(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return s.includes(eo(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return Ft(f)||(a=!0),i++,t.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(t.consume(f),i++,u):u(f)}
vendor: 11,946 bytes, line 642
642}function C1e(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return l;function l(y){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(y){return y===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(y)}function d(y){if(a>999||y===93&&!o||y===null||y===91||Ft(y))return n(y);if(y===93){t.exit("chunkString");const g=t.exit("gfmFootnoteDefinitionLabelString");return i=eo(r.sliceSerialize(g)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return Ft(y)||(o=!0),a++,t.consume(y),y===92?f:d}function f(y){return y===91||y===92||y===93?(t.consume(y),a++,d):d(y)}function p(y){return y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),s.includes(i)||s.push(i),ct(t,m,"gfmFootnoteDefinitionWhitespace")):n(y)}function m(y){return e(y)}}function A1e(t,e,n){return t.check(L0,e,t.attempt(w1e,e,n))}function T1e(t){t.exit("gfmFootnoteDefinition")}function j1e(t,e,n){const r=this;return ct(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function N1e(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",f,o]],m=o.parser.constructs.insideSpan.null;m&&ji(p,p.length,0,zE(m,a.slice(u+1,l),o)),ji(p,p.length,0,[["exit",f,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",d,o]]),ji(a,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,o,l){const u=this.previous,d=this.events;let f=0;return p;function p(y){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(y):(a.enter("strikethroughSequenceTemporary"),m(y))}function m(y){const g=My(u);if(y===126)return f>1?l(y):(a.consume(y),f++,m);if(f<2&&!n)return l(y);const b=a.exit("strikethroughSequenceTemporary"),x=My(y);return b._open=!x||x===2&&!!g,b._close=!g||g===2&&!!x,o(y)}}}class P1e{constructor(){this.map=[]}add(e,n,r){R1e(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function R1e(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function I1e(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function D1e(){return{flow:{null:{name:"table",tokenize:M1e,resolveAll:O1e}}}}function M1e(t,e,n){const r=this;let s=0,i=0,a;return o;function o(R){let O=r.events.length-1;for(;O>-1;){const B=r.events[O][1].type;if(B==="lineEnding"||B==="linePrefix")O--;else break}const L=O>-1?r.events[O][1].type:null,U=L==="tableHead"||L==="tableRow"?C:l;return U===C&&r.parser.lazy[r.now().line]?n(R):U(R)}function l(R){return t.enter("tableHead"),t.enter("tableRow"),u(R)}function u(R){return R===124||(a=!0,i+=1),d(R)}function d(R){return R===null?n(R):je(R)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),m):n(R):it(R)?ct(t,d,"whitespace")(R):(i+=1,a&&(a=!1,s+=1),R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),f(R)))}function f(R){return R===null||R===124||Ft(R)?(t.exit("data"),d(R)):(t.consume(R),R===92?p:f)}function p(R){return R===92||R===124?(t.consume(R),f):f(R)}function m(R){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(R):(t.enter("tableDelimiterRow"),a=!1,it(R)?ct(t,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):y(R))}function y(R){return R===45||R===58?b(R):R===124?(a=!0,t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),g):E(R)}function g(R){return it(R)?ct(t,b,"whitespace")(R):b(R)}function b(R){return R===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),x):R===45?(i+=1,x(R)):R===null||je(R)?S(R):E(R)}function x(R){return R===45?(t.enter("tableDelimiterFiller"),w(R)):E(R)}function w(R){return R===45?(t.consume(R),w):R===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),v):(t.exit("tableDelimiterFiller"),v(R))}function v(R){return it(R)?ct(t,S,"whitespace")(R):S(R)}function S(R){return R===124?y(R):R===null||je(R)?!a||s!==i?E(R):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(R)):E(R)}function E(R){return n(R)}function C(R){return t.enter("tableRow"),T(R)}function T(R){return R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),T):R===null||je(R)?(t.exit("tableRow"),e(R)):it(R)?ct(t,T,"whitespace")(R):(t.enter("data"),P(R))}function P(R){return R===null||R===124||Ft(R)?(t.exit("data"),T(R)):(t.consume(R),R===92?M:P)}function M(R){return R===92||R===124?(t.consume(R),P):P(R)}}function O1e(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,d,f;const p=new P1e;for(;++n<t.length;){const m=t[n],y=m[1];m[0]==="enter"?y.type==="tableHead"?(o=!1,l!==0&&(v3(p,e,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",u,e]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",d,e]])),s=y.type==="tableDelimiterRow"?2:d?3:1):s&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=M1(p,e,i,s,void 0,f),i=[0,0,0,0]),a[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],f=M1(p,e,i,s,void 0,f)),i=a,a=[i[1],n,0,0])):y.type==="tableHead"?(o=!0,l=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],f=M1(p,e,i,s,n,f)):a[1]!==0&&(f=M1(p,e,a,s,n,f)),s=0):s&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&v3(p,e,l,u,d),p.consume(e.events),n=-1;++n<e.events.length;){const m=e.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=I1e(e.events,n))}return t}function M1(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(i.end=Object.assign({},Dp(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const l=Dp(e.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const u=Dp(e.events,n[2]),d=Dp(e.events,n[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],m=e.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,g=n[3]-n[2]-1;t.add(y,g,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return s!==void 0&&(i.end=Object.assign({},Dp(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function v3(t,e,n,r,s){const i=[],a=Dp(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function Dp(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const L1e={name:"tasklistCheck",tokenize:B1e};function F1e(){return{text:{91:L1e}}}function B1e(t,e,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),i)}function i(l){return Ft(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):n(l)}function o(l){return je(l)?e(l):it(l)?t.check({tokenize:$1e},e,n)(l):n(l)}}function $1e(t,e,n){return ct(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function U1e(t){return B8([h1e(),k1e(),N1e(t),D1e(),F1e()])}const z1e={};function qd(t){const e=this,n=t||z1e,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(U1e(n)),i.push(l1e()),a.push(c1e(n))}/*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */const{entries:N9,setPrototypeOf:b3,isFrozen:V1e,getPrototypeOf:W1e,getOwnPropertyDescriptor:H1e}=Object;let{freeze:vs,seal:ya,create:Mp}=Object,{apply:IN,construct:DN}=typeof Reflect<"u"&&Reflect;vs||(vs=function(e){return e});ya||(ya=function(e){return e});IN||(IN=function(e,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i];return e.apply(n,s)});DN||(DN=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new e(...r)});const Cx=Vn(Array.prototype.forEach),q1e=Vn(Array.prototype.lastIndexOf),w3=Vn(Array.prototype.pop),Ax=Vn(Array.prototype.push),G1e=Vn(Array.prototype.splice),ns=Array.isArray,Wx=Vn(String.prototype.toLowerCase),HA=Vn(String.prototype.toString),k3=Vn(String.prototype.match),Tp=Vn(String.prototype.replace),S3=Vn(String.prototype.indexOf),K1e=Vn(String.prototype.trim),Y1e=Vn(Number.prototype.toString),X1e=Vn(Boolean.prototype.toString),_3=typeof BigInt>"u"?null:Vn(BigInt.prototype.toString),E3=typeof Symbol>"u"?null:Vn(Symbol.prototype.toString),mn=Vn(Object.prototype.hasOwnProperty),Tx=Vn(Object.prototype.toString),gr=Vn(RegExp.prototype.test),O1=Z1e(TypeError);function Vn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return IN(t,e,r)}}function Z1e(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return DN(t,n)}}function Xe(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wx;if(b3&&b3(t,null),!ns(e))return t;let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const i=n(s);i!==s&&(V1e(e)||(e[r]=i),s=i)}t[s]=!0}return t}function Q1e(t){for(let e=0;e<t.length;e++)mn(t,e)||(t[e]=null);return t}function js(t){const e=Mp(null);
vendor: 4,173 bytes, line 642
642for(const[n,r]of N9(t))mn(t,n)&&(ns(r)?e[n]=Q1e(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=js(r):e[n]=r);return e}function J1e(t){switch(typeof t){case"string":return t;case"number":return Y1e(t);case"boolean":return X1e(t);case"bigint":return _3?_3(t):"0";case"symbol":return E3?E3(t):"Symbol()";case"undefined":return Tx(t);case"function":case"object":{if(t===null)return Tx(t);const e=t,n=Op(e,"toString");if(typeof n=="function"){const r=n(e);return typeof r=="string"?r:Tx(r)}return Tx(t)}default:return Tx(t)}}function Op(t,e){for(;t!==null;){const r=H1e(t,e);if(r){if(r.get)return Vn(r.get);if(typeof r.value=="function")return Vn(r.value)}t=W1e(t)}function n(){return null}return n}function eke(t){try{return gr(t,""),!0}catch{return!1}}const C3=vs(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),qA=vs(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),GA=vs(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),tke=vs(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),KA=vs(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),nke=vs(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),A3=vs(["#text"]),T3=vs(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
642spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),YA=vs(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j3=vs(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),L1=vs(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rke=ya(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ske=ya(/<%[\w\W]*|[\w\W]*%>/gm),ike=ya(/\$\{[\w\W]*/gm),ake=ya(/^data-[\-\w.\u00B7-\uFFFF]+$/),oke=ya(/^aria-[\-\w]+$/),P9=ya(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lke=ya(/^(?:\w+script|data):/i),cke=ya(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),R9=ya(/^html$/i),uke=ya(/^[a-z][.\w]*(-[.\w]+)+$/i);var N3=Object.freeze({__proto__:null,ARIA_ATTR:oke,ATTR_WHITESPACE:cke,CUSTOM_ELEMENT:uke,DATA_ATTR:ake,DOCTYPE_NAME:R9,ERB_EXPR:ske,IS_ALLOWED_URI:P9,IS_SCRIPT_OR_DATA:lke,MUSTACHE_EXPR:rke,TMPLIT_EXPR:ike});const jx={element:1,text:3,progressingInstruction:7,comment:8,document:9},dke=function(){return typeof window>"u"?null:window},hke=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;
vendor: 4,671 bytes, line 642
642const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const i="dompurify"+(r?"#"+r:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},P3=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function I9(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dke();const e=Ae=>I9(Ae);if(e.version="3.4.2",e.removed=[],!t||!t.document||t.document.nodeType!==jx.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,s=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:p,trustedTypes:m}=t,y=l.prototype,g=Op(y,"cloneNode"),b=Op(y,"remove"),x=Op(y,"nextSibling"),w=Op(y,"childNodes"),v=Op(y,"parentNode");if(typeof a=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let S,E="";const{implementation:C,createNodeIterator:T,createDocumentFragment:P,getElementsByTagName:M}=n,{importNode:R}=r;let O=P3();e.isSupported=typeof N9=="function"&&typeof v=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:L,ERB_EXPR:U,TMPLIT_EXPR:B,DATA_ATTR:H,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:$,CUSTOM_ELEMENT:I}=N3;let{IS_ALLOWED_URI:N}=N3,W=null;const q=Xe({},[...C3,...qA,...GA,...KA,...A3]);let D=null;const Q=Xe({},[...T3,...YA,...j3,...L1]);let X=Object.seal(Mp(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),se=null,Y=null;const de=Object.seal(Mp(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ie=!0,_e=!0,Ee=!1,xe=!0,Ne=!1,tt=!0,qe=!1,pt=!1,Et=!1,Bt=!1,Pr=!1,Oi=!1,ks=!0,ll=!1;const fr="user-content-";let cl=!0,va=!1,G={},ee=null;const Pe=Xe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let De=null;const Ge=Xe({},["audio","video","img","source","image","track"]);let $t=null;const pr=Xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tr="http://www.w3.org/1998/Math/MathML",mr="http://www.w3.org/2000/svg",Hn="http://www.w3.org/1999/xhtml";let Pt=Hn,Li=!1,Jr=null;const K0=Xe({},[tr,mr,Hn],HA);let fp=Xe({},["mi","mo","mn","ms","mtext"]),ix=Xe({},["annotation-xml"]);const ax=Xe({},["title","style","font","a","script"]);let Ss=null;const nC=["application/xhtml+xml","text/html"],Le="text/html";let Me=null,gt=null;const Qs=n.createElement("form"),_s=function(F){return F instanceof RegExp||F instanceof Function},Fi=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(gt&&gt===F)return;(!F||typeof F!="object")&&(F={}),F=js(F),Ss=nC.indexOf(F.PARSER_MEDIA_TYPE)===-1?Le:F.PARSER_MEDIA_TYPE,Me=Ss==="application/xhtml+xml"?HA:Wx,W=mn(F,"ALLOWED_TAGS")&&ns(F.ALLOWED_TAGS)?Xe({},F.ALLOWED_TAGS,Me):q,D=mn(F,"ALLOWED_ATTR")&&ns(F.ALLOWED_ATTR)?Xe({},F.ALLOWED_ATTR,Me):Q,Jr=mn(F,"ALLOWED_NAMESPACES")&&ns(F.ALLOWED_NAMESPACES)?Xe({},F.ALLOWED_NAMESPACES,HA):K0,$t=mn(F,"ADD_URI_SAFE_ATTR")&&ns(F.ADD_URI_SAFE_ATTR)?Xe(js(pr),F.ADD_URI_SAFE_ATTR,Me):pr,De=mn(F,"ADD_DATA_URI_TAGS")&&ns(F.ADD_DATA_URI_TAGS)?Xe(js(Ge),F.ADD_DATA_URI_TAGS,Me):Ge,ee=mn(F,"FORBID_CONTENTS")&&ns(F.FORBID_CONTENTS)?Xe({},F.FORBID_CONTENTS,Me):Pe,se=mn(F,"FORBID_TAGS")&&ns(F.FORBID_TAGS)?Xe({},F.FORBID_TAGS,Me):js({}),Y=mn(F,"FORBID_ATTR")&&ns(F.FORBID_ATTR)?Xe({},F.FORBID_ATTR,Me):js({}),G=mn(F,"USE_PROFILES")?F.USE_PROFILES&&typeof F.USE_PROFILES=="object"?js(F.USE_PROFILES):F.USE_PROFILES:!1,Ie=F.ALLOW_ARIA_ATTR!==!1,_e=F.ALLOW_DATA_ATTR!==!1,Ee=F.ALLOW_UNKNOWN_PROTOCOLS||!1,xe=F.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=F.SAFE_FOR_TEMPLATES||!1,tt=F.SAFE_FOR_XML!==!1,qe=F.WHOLE_DOCUMENT||!1,Bt=F.RETURN_DOM||!1,Pr=F.RETURN_DOM_FRAGMENT||!1,Oi=F.RETURN_TRUSTED_TYPE||!1,Et=F.FORCE_BODY||!1,ks=F.SANITIZE_DOM!==!1,ll=F.SANITIZE_NAMED_PROPS||!1,cl=F.KEEP_CONTENT!==!1,va=F.IN_PLACE||!1,N=eke(F.ALLOWED_URI_REGEXP)?F.ALLOWED_URI_REGEXP:P9,Pt=typeof F.NAMESPACE=="str
642ing"?F.NAMESPACE:Hn,fp=mn(F,"MATHML_TEXT_INTEGRATION_POINTS")&&F.MATHML_TEXT_INTEGRATION_POINTS&&typeof F.MATHML_TEXT_INTEGRATION_POINTS=="object"?js(F.MATHML_TEXT_INTEGRATION_POINTS):Xe({},["mi","mo","mn","ms","mtext"]),ix=mn(F,"HTML_INTEGRATION_POINTS")&&F.HTML_INTEGRATION_POINTS&&typeof F.HTML_INTEGRATION_POINTS=="object"?js(F.HTML_INTEGRATION_POINTS):Xe({},["annotation-xml"]);const J=mn(F,"CUSTOM_ELEMENT_HANDLING")&&F.CUSTOM_ELEMENT_HANDLING&&typeof F.CUSTOM_ELEMENT_HANDLING=="object"?js(F.CUSTOM_ELEMENT_HANDLING):Mp(null);if(X=Mp(null),mn(J,"tagNameCheck")&&_s(J.tagNameCheck)&&(X.tagNameCheck=J.tagNameCheck),mn(J,"attributeNameCheck")&&_s(J.attributeNameCheck)&&(X.attributeNameCheck=J.attributeNameCheck),mn(J,"allowCustomizedBuiltInElements")&&typeof J.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=J.allowCustomizedBuiltInElements),Ne&&(_e=!1),Pr&&(Bt=!0),G&&(W=Xe({},A3),D=Mp(null),G.html===!0&&(Xe(W,C3),Xe(D,T3)),G.svg===!0&&(Xe(W,qA),Xe(D,YA),Xe(D,L1)),G.svgFilters===!0&&(Xe(W,GA),Xe(D,YA),Xe(D,L1)),G.mathMl===!0&&(Xe(W,KA),Xe(D,j3),Xe(D,L1))),de.tagCheck=null,de.attributeCheck=null,mn(F,"ADD_TAGS")&&(typeof F.ADD_TAGS=="function"?de.tagCheck=F.ADD_TAGS:ns(F.ADD_TAGS)&&(W===q&&(W=js(W)),Xe(W,F.ADD_TAGS,Me))),mn(F,"ADD_ATTR")&&(typeof F.ADD_ATTR=="function"?de.attributeCheck=F.ADD_ATTR:ns(F.ADD_ATTR)&&(D===Q&&(D=js(D)),Xe(D,F.ADD_ATTR,Me))),mn(F,"ADD_URI_SAFE_ATTR")&&ns(F.ADD_URI_SAFE_ATTR)&&Xe($t,F.ADD_URI_SAFE_ATTR,Me),mn(F,"FORBID_CONTENTS")&&ns(F.FORBID_CONTENTS)&&(ee===Pe&&(ee=js(ee)),Xe(ee,F.FORBID_CONTENTS,Me)),mn(F,"ADD_FORBID_CONTENTS")&&ns(F.ADD_FORBID_CONTENTS)&&(ee===Pe&&(ee=js(ee)),Xe(ee,F.ADD_FORBID_CONTENTS,Me)),cl&&(W["#text"]=!0),qe&&Xe(W,["html","head","body"]),W.table&&(Xe(W,["tbody"]),delete se.tbody),F.TRUSTED_TYPES_POLICY){if(typeof F.TRUSTED_TYPES_POLICY.createHTML!="function")throw O1('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof F.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw O1('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=F.TRUSTED_TYPES_POLICY,E=S.createHTML("")}else S===void 0&&(S=hke(m,s)),S!==null&&typeof E=="string"&&(E=S.createHTML(""));vs&&vs(F),gt=F},oo=Xe({},[...qA,...GA,...tke]),Es=Xe({},[...KA,...nke]),lo=function(F){let J=v(F);(!J||!J.tagName)&&(J={namespaceURI:Pt,tagName:"template"});const ve=Wx(F.tagName),Ut=Wx(J.tagName);return Jr[F.namespaceURI]?F.namespaceURI===mr?J.namespaceURI===Hn?ve==="svg":J.namespaceURI===tr?ve==="svg"&&(Ut==="annotation-xml"||fp[Ut]):!!oo[ve]:F.namespaceURI===tr?J.namespaceURI===Hn?ve==="math":J.namespaceURI===mr?ve==="math"&&ix[Ut]:!!Es[ve]:F.namespaceURI===Hn?J.namespaceURI===mr&&!ix[Ut]||J.namespaceURI===tr&&!fp[Ut]?!1:!Es[ve]&&(ax[ve]||!oo[ve]):!!(Ss==="application/xhtml+xml"&&Jr[F.namespaceURI]):!1},ba=function(F){Ax(e.removed,{element:F});try{v(F).removeChild(F)}catch{b(F)}},Fd=function(F,J){try{Ax(e.removed,{attribute:J.getAttributeNode(F),from:J})}catch{Ax(e.removed,{attribute:null,from:J})}if(J.removeAttribute(F),F==="is")if(Bt||Pr)try{ba(J)}catch{}else try{J.setAttribute(F,"")}catch{}},ID=function(F){let J=null,ve=null;if(Et)F="<remove></remove>"+F;else{const Dn=k3(F,/^[\r\n\t ]+/);ve=Dn&&Dn[0]}Ss==="application/xhtml+xml"&&Pt===Hn&&(F='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+F+"</body></html>");const Ut=S?S.createHTML(F):F;if(Pt===Hn)try{J=new p().parseFromString(Ut,Ss)}catch{}if(!J||!J.documentElement){J=C.createDocument(Pt,"template",null);try{J.documentElement.innerHTML=Li?E:Ut}catch{}}const Rr=J.body||J.documentElement;return F&&ve&&Rr.insertBefore(n.createTextNode(ve),Rr.childNodes[0]||null),Pt===Hn?M.call(J,qe?"html":"body")[0]:qe?J.documentElement:Rr},DD=function(F){return T.call(F.ownerDocument||F,F,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},rC=function(F){return F instanceof f&&(typeof F.nodeName!="string"||typeof F.textContent!="string"||typeof F.removeChild!="function"||!(F.attributes instanceof d)||typeof F.removeAttribute!="function"||typeof F.setAttribute!="function"||typeof F.namespaceURI!="string"||typeof F.insertBefore!="function"||typeof F.hasChildNodes!="function")},sC=function(F){return typeof o=="function"&&F instanceof o};function ul(Ae,F,J){Cx(Ae,ve=>{ve.call(e,F,J,gt)})}const MD=function(F){let J=null;if(ul(O.beforeSanitizeElements,F,null),rC(F))return ba(F),!0;const ve=Me(F.nodeName);if(ul(O.uponSanitizeElement,F,{tagName:ve,allowedTags:W}),tt&&F.hasChildNodes()&&!sC(F.firstElementChild)&&gr(/<[/\w!]/g,F.innerHTML)&&gr(/<[/\w!]/g,F.textContent)||tt&&F.namespaceURI===Hn&&ve==="style"&&sC(F.firstElementChild)||F.nodeType===jx.progressingInstruction||tt&&F.nodeType===jx.comment&&gr(/<[/\w]/g,F.data))return ba(F),!0;if(se[ve]||!(de.tagCheck instanceof Function&&de.tagCheck(ve))&&!W[ve]){
vendor: 5,504 bytes, lines 642-643
642if(!se[ve]&&LD(ve)&&(X.tagNameCheck instanceof RegExp&&gr(X.tagNameCheck,ve)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ve)))return!1;if(cl&&!ee[ve]){const Ut=v(F)||F.parentNode,Rr=w(F)||F.childNodes;if(Rr&&Ut){const Dn=Rr.length;for(let Cs=Dn-1;Cs>=0;--Cs){const Bi=g(Rr[Cs],!0);Ut.insertBefore(Bi,x(F))}}}return ba(F),!0}return F instanceof l&&!lo(F)||(ve==="noscript"||ve==="noembed"||ve==="noframes")&&gr(/<\/no(script|embed|frames)/i,F.innerHTML)?(ba(F),!0):(Ne&&F.nodeType===jx.text&&(J=F.textContent,Cx([L,U,B],Ut=>{J=Tp(J,Ut," ")}),F.textContent!==J&&(Ax(e.removed,{element:F.cloneNode()}),F.textContent=J)),ul(O.afterSanitizeElements,F,null),!1)},OD=function(F,J,ve){if(Y[J]||ks&&(J==="id"||J==="name")&&(ve in n||ve in Qs))return!1;const Ut=D[J]||de.attributeCheck instanceof Function&&de.attributeCheck(J,F);if(!(_e&&!Y[J]&&gr(H,J))){if(!(Ie&&gr(z,J))){if(!Ut||Y[J]){if(!(LD(F)&&(X.tagNameCheck instanceof RegExp&&gr(X.tagNameCheck,F)||X.tagNameCheck instanceof Function&&X.tagNameCheck(F))&&(X.attributeNameCheck instanceof RegExp&&gr(X.attributeNameCheck,J)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(J,F))||J==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&gr(X.tagNameCheck,ve)||X.tagNameCheck instanceof Function&&X.tagNameCheck(ve))))return!1}else if(!$t[J]){if(!gr(N,Tp(ve,$,""))){if(!((J==="src"||J==="xlink:href"||J==="href")&&F!=="script"&&S3(ve,"data:")===0&&De[F])){if(!(Ee&&!gr(V,Tp(ve,$,"")))){if(ve)return!1}}}}}}return!0},N7=Xe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),LD=function(F){return!N7[Wx(F)]&&gr(I,F)},FD=function(F){ul(O.beforeSanitizeAttributes,F,null);const{attributes:J}=F;if(!J||rC(F))return;const ve={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let Ut=J.length;for(;Ut--;){const Rr=J[Ut],{name:Dn,namespaceURI:Cs,value:Bi}=Rr,wa=Me(Dn),iC=Bi;let nr=Dn==="value"?iC:K1e(iC);if(ve.attrName=wa,ve.attrValue=nr,ve.keepAttr=!0,ve.forceKeepAttr=void 0,ul(O.uponSanitizeAttribute,F,ve),nr=ve.attrValue,ll&&(wa==="id"||wa==="name")&&S3(nr,fr)!==0&&(Fd(Dn,F),nr=fr+nr),tt&&gr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,nr)){Fd(Dn,F);continue}if(wa==="attributename"&&k3(nr,"href")){Fd(Dn,F);continue}if(ve.forceKeepAttr)continue;if(!ve.keepAttr){Fd(Dn,F);continue}if(!xe&&gr(/\/>/i,nr)){Fd(Dn,F);continue}Ne&&Cx([L,U,B],UD=>{nr=Tp(nr,UD," ")});const $D=Me(F.nodeName);if(!OD($D,wa,nr)){Fd(Dn,F);continue}if(S&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!Cs)switch(m.getAttributeType($D,wa)){case"TrustedHTML":{nr=S.createHTML(nr);break}case"TrustedScriptURL":{nr=S.createScriptURL(nr);break}}if(nr!==iC)try{Cs?F.setAttributeNS(Cs,Dn,nr):F.setAttribute(Dn,nr),rC(F)?ba(F):w3(e.removed)}catch{Fd(Dn,F)}}ul(O.afterSanitizeAttributes,F,null)},BD=function(F){let J=null;const ve=DD(F);for(ul(O.beforeSanitizeShadowDOM,F,null);J=ve.nextNode();)ul(O.uponSanitizeShadowNode,J,null),MD(J),FD(J),J.content instanceof i&&BD(J.content);ul(O.afterSanitizeShadowDOM,F,null)};return e.sanitize=function(Ae){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,ve=null,Ut=null,Rr=null;if(Li=!Ae,Li&&(Ae="<!-->"),typeof Ae!="string"&&!sC(Ae)&&(Ae=J1e(Ae),typeof Ae!="string"))throw O1("dirty is not a string, aborting");if(!e.isSupported)return Ae;if(pt||Fi(F),e.removed=[],typeof Ae=="string"&&(va=!1),va){const Bi=Ae.nodeName;if(typeof Bi=="string"){const wa=Me(Bi);if(!W[wa]||se[wa])throw O1("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof o)J=ID("<!---->"),ve=J.ownerDocument.importNode(Ae,!0),ve.nodeType===jx.element&&ve.nodeName==="BODY"||ve.nodeName==="HTML"?J=ve:J.appendChild(ve);else{if(!Bt&&!Ne&&!qe&&Ae.indexOf("<")===-1)return S&&Oi?S.createHTML(Ae):Ae;if(J=ID(Ae),!J)return Bt?null:Oi?E:""}J&&Et&&ba(J.firstChild);const Dn=DD(va?Ae:J);for(;Ut=Dn.nextNode();)MD(Ut),FD(Ut),Ut.content instanceof i&&BD(Ut.content);if(va)return Ae;if(Bt){if(Ne){J.normalize();let Bi=J.innerHTML;Cx([L,U,B],wa=>{Bi=Tp(Bi,wa," ")}),J.innerHTML=Bi}if(Pr)for(Rr=P.call(J.ownerDocument);J.firstChild;)Rr.appendChild(J.firstChild);else Rr=J;return(D.shadowroot||D.shadowrootmode)&&(Rr=R.call(r,Rr,!0)),Rr}let Cs=qe?J.outerHTML:J.innerHTML;return qe&&W["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&gr(R9,J.ownerDocument.doctype.name)&&(Cs="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
643`+Cs),Ne&&Cx([L,U,B],Bi=>{Cs=Tp(Cs,Bi," ")}),S&&Oi?S.createHTML(Cs):Cs},e.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fi(Ae),pt=!0},e.clearConfig=function(){gt=null,pt=!1},e.isValidAttribute=function(Ae,F,J){gt||Fi({});const ve=Me(Ae),Ut=Me(F);return OD(ve,Ut,J)},e.addHook=function(Ae,F){typeof F=="function"&&Ax(O[Ae],F)},e.removeHook=function(Ae,F){if(F!==void 0){const J=q1e(O[Ae],F);return J===-1?void 0:G1e(O[Ae],J,1)[0]}return w3(O[Ae])},e.removeHooks=function(Ae){O[Ae]=[]},e.removeAllHooks=function(){O=P3()},e}var fke=I9();function qE(t){const[e,n]=k.useState([]),[r,s]=k.useState(!0),[i,a]=k.useState(null);return k.useEffect(()=>{let o=!1;return(async()=>{s(!0);let u=ce.from("reports").select("*").order("display_order",{ascending:!0});(t==null?void 0:t.published)!==!1&&(u=u.eq("published",!0)),t!=null&&t.region&&(u=u.eq("region",t.region));const{data:d,error:f}=await u;o||(f?a(f.message):n(d||[]),s(!1))})(),()=>{o=!0}}
643,[t==null?void 0:t.published,t==null?void 0:t.region]),{reports:e,isLoading:r,error:i}}function pke(t){const[e,n]=k.useState(null),[r,s]=k.useState(!0),[i,a]=k.useState(null);return k.useEffect(()=>{if(!t)return;let o=!1;return(async()=>{s(!0);const{data:u,error:d}=await ce.from("reports").select("*").eq("slug",t).maybeSingle();o||(d?a(d.message):n(u),s(!1))})(),()=>{o=!0}},[t]),{report:e,isLoading:r,error:i}}const R3=[...Array.from(xb),...Array.from(vb)],_b=[{id:"europe",slug:"europe-water-dispenser-market",name:"Europe water dispenser market",h1:"Europe Water Dispenser Market",seoTitle:"Europe Water Dispenser Market 2026 | Size, Companies & Reports",seoDescription:"Europe water dispenser market intelligence across 31 European markets: BWD, POU and ITS volumes, revenue, operators and pricing, plus country-level market reports from Zenith Global Commercial.",intro:"Independent market intelligence on bottled water dispensers (BWD), point-of-use systems (POU) and integrated tap systems (ITS) across 31 European markets, USA, UAE, Turkey, Japan and South Korea — volumes, revenue, value, operators, channels and pricing, with a 2020–2030 outlook.",body:["Europe is the most fragmented water dispense region in the world. Installed base, contract structures and pricing differ sharply between Western and Eastern markets, and POU continues to take share from traditional bottled water coolers as corporate buyers reprice long-standing rental contracts.","Every country report follows the same structure, so markets can be compared directly: segment splits by BWD, POU and ITS, operator shares, channel mix, average revenue per unit and installed base development. Each is delivered as a PDF report plus an Excel database.","Regional bundles combine all country reports in the region and add the Power BI dashboard, the full Zenith Infographs library, private consulting support and early access to the next annual update."],stats:[{label:"European markets covered",value:"32"},{label:"Segments tracked",value:"BWD · POU · ITS"},{label:"Outlook horizon",value:"2020–2030"}],regions:["pan-europe","west-europe","east-europe","country","data"],countries:R3,keywords:["europe","european","eu ","eurozone","western europe","eastern europe","nordic",...R3.map(t=>t.toLowerCase())]},{id:"usa",slug:"usa-water-dispenser-market",name:"USA water dispenser market",h1:"USA Water Dispenser Market",seoTitle:"USA Water Dispenser Market 2026 | Size, Companies & Report",seoDescription:"United States water dispenser market research: BWD, POU and ITS installed base, operators, channels, pricing and 2020–2030 outlook, with the full USA market report from Zenith Global Commercial.",intro:"Market intelligence on the United States water dispense category — home and office delivery (HOD), point-of-use systems and integrated taps — covering installed base, operator landscape, channel structure and pricing.",body:["The US market is the largest single water dispense market globally and the most consolidated at the top end, with national operators competing against a long tail of regional route businesses. Route density, service economics and filter subscription models decide account profitability.","POU conversion is running ahead of Europe in large corporate accounts, while HOD retains strength in residential and small business. The report quantifies both, with revenue, volume and value splits and a 2020–2030 outlook.","Delivered as a PDF report plus an Excel database, structured identically to the European country reports so US and European markets can be benchmarked side by side."],stats:[{label:"Market",value:"United States"},{label:"Segments tracked",value:"BWD/HOD · POU · ITS"},{label:"Outlook horizon",value:"2020–2030"}],regions:["usa"],countries:["United States","USA"],keywords:["united states","usa","u.s.","us market","american","north america","hod"]},{id:"asia-middle-east",slug:"asia-middle-east-water-dispenser-market",name:"Asia & Middle East water dispenser market",h1:"Asia & Middle East Water Dispenser Market",seoTitle:"Asia & Middle East Water Dispenser Market 2026 | Size & Reports",seoDescription:"Water dispenser market intelligence for Japan, South Korea, the UAE and Turkey: BWD, POU and ITS operators, channels, pricing and 2020–2030 outlook from Zenith Global Commercial.",intro:"Market intelligence on the fastest-moving water dispense markets outside Europe and the US — Japan, South Korea, the UAE and Turkey — 
643covering operators, channels, pricing and segment development.",body:["These markets behave very differently from Europe. South Korea is one of the most POU-penetrated markets in the world, Japan is dominated by domestic bottled water delivery brands, the UAE combines high bottled water consumption with rapid premium POU growth, and Turkey sits between European and Middle Eastern dynamics.","Coverage follows the same framework used across all Zenith water dispense reports: BWD, POU and ITS operators, channels, pricing and the 2020–2030 outlook.","These markets are supplied as an Excel database with qualitative insights on request — get in touch and we scope the deliverable around the decision you need to make."],stats:[{label:"Markets covered",value:"Japan · South Korea · UAE · Turkey"},{label:"Segments tracked",value:"BWD · POU · ITS"},{label:"Delivery",value:"Excel + insights on request"}],regions:["japan","south-korea","uae","turkey"],countries:["Japan","South Korea","UAE","United Arab Emirates","Turkey"],keywords:["japan","japanese","south korea","korea","korean","uae","united arab emirates","dubai","abu dhabi","middle east","gulf","turkey","turkish","asia","apac"]}],mke=t=>_b.find(e=>e.id===t),MN=t=>`/${t.slug}`;function oD(t,e){return t.regions.includes(e.region)?e.region==="country"||e.region==="data"?!!e.country&&t.countries.includes(e.country):!0:!1}function gke(t,e){const n=` ${e.toLowerCase()} `;return t.countries.filter(r=>n.includes(` ${r.toLowerCase()}`))}function D9(t,e){const n=` ${(t||"").toLowerCase()} `,r=` ${(e||"").slice(0,8e3).toLowerCase()} `;let s=_b[0],i=0;for(const a of _b){let o=0;for(const l of a.keywords)n.includes(l)&&(o+=5),r.includes(l)&&(o+=1);o>i&&(i=o,s=a)}return s}function yke({title:t,body:e}){const{reports:n}=qE({published:!0}),{pillar:r,picks:s}=k.useMemo(()=>{const i=D9(t,e),a=`${t} ${e}`,o=new Set(gke(i,a)),l=n.filter(d=>oD(i,d)),u=[...bb(l.filter(d=>d.country&&o.has(d.country))),...bb(l.filter(d=>!(d.country&&o.has(d.country))))];return{pillar:i,picks:u.slice(0,4)}},[n,t,e]);return c.jsx("section",{className:"mt-12 rounded-lg overflow-hidden",style:{backgroundColor:"hsl(200 80% 15%)"},"aria-label":"Related market research",children:c.jsxs("div",{className:"p-6 md:p-8",children:[c.jsxs("p",{className:"text-[11px] uppercase tracking-widest font-semibold mb-3 flex items-center gap-2",style:{color:"hsl(80 70% 60%)"},children:[c.jsx(k0,{className:"w-3.5 h-3.5"}),"Related market research"]}),c.jsx("h2",{className:"text-xl md:text-2xl font-bold leading-snug text-white mb-3",children:r.h1}),c.jsxs("p",{className:"text-sm md:text-base leading-relaxed mb-5 text-white/80",children:["Our latest ",r.name," research tracks BWD, POU and ITS volumes, operators, channels and pricing behind the trend in this article."," ",c.jsxs(rt,{to:MN(r),target:"_blank",rel:"noopener noreferrer",className:"font-semibold underline text-white",children:["See the ",r.name," hub"]}),"."]}),s.length>0&&c.jsx("ul",{className:"grid sm:grid-cols-2 gap-2 mb-5",children:s.map(i=>c.jsx("li",{children:c.jsxs(rt,{to:`/reports/${i.slug}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between gap-3 rounded-md px-3.5 py-2.5 text-sm font-medium text-white transition-colors",style:{backgroundColor:"rgba(255,255,255,0.08)"},children:[c.jsx("span",{className:"truncate",children:i.title}),c.jsx(Jn,{className:"w-4 h-4 shrink-0 opacity-70"})]})},i.id))}),c.jsxs("div",{className:"flex flex-wrap gap-3",children:[c.jsxs(rt,{to:MN(r),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-md px-4 py-2.5 text-sm font-semibold",style:{backgroundColor:"hsl(80 70% 60%)",color:"hsl(200 80% 12%)"},children:["Explore the ",r.name,c.jsx(Jn,{className:"w-4 h-4"})]}),c.jsx(rt,{to:"/reports",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-md px-4 py-2.5 text-sm font-semibold text-white",style:{border:"1px solid rgba(255,255,255,0.35)"},children:"Browse all market reports"})]})]})})}const Gd=t=>fke.sanitize(t,{ALLOWED_TAGS:["p","h1","h2","h3","h4","h5","h6","ul","ol","li","strong","em","b","i","u","a","blockquote","hr","br","img","table","thead","tbody","tr","td","th","span","div","code","pre","figure","figcaption"],ALLOWED_ATTR:["href","src","alt","target","rel","title","class","id"],ALLOW_DATA_ATTR:!1}),xke=t=>new Date(t).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).toUpperCase(),I3=t=>/<\/?(p|h[1-6]|div|span|ul|ol|li|br|hr|strong|em|a|img|blockquote|table)\b/i.test(t),vke=()=>{const{slug:t}=OR(),{isAdmin:e,loading:n}=v8(),[r,s]=k.useState(null),[i,a]=k.useState([]),[o,l]=k.useState(!0),[u,d]=k.useState(!1);if(k.useEffect(()=>{if(!t||n)return;(async()=>{let S=ce.from("news_articles").select("*").eq("slug",t);e||(S=S.eq("is_published",!0));const{data:E,error:C}=await S.maybeSingle();if(C||!E)d(!0);else{s(E);const T=E.topic;let P=[];if(T){const{data:M}=await ce.from("news_articles").select("slug, title, topic, published_at").eq("is_published",!0).eq("topic",T).neq("slug",E.slug).order("published_at",{ascending:!1}).limit(3);P=M??[]}if(P.length<3){const M=[E.slug,...P.map(O=>O.slug)],{data:R}=await ce.from("news_articles").select("slug, title, topic, published_at").eq("is_published",!0).not("slug","in",`(${M.map(O=>`"${O}"`).join(",")})`).order("published_at",{ascending:!1}).limit(3-P.length);P=[...P,...R??[]]}a(P.slice(0,3))}l(!1)})()},[t,e,n]),k.useEffect(()=>{t&&r&&!n&&!e&&bN(t,"view")},[t,r,e,n]),o)return c.jsx("main",{className:"min-h-screen",style:{backgroundColor:"#0A0A0F",color:"#1A1A1A"},children:c.jsx("div",{className:"max-w-3xl mx-auto px-4 lg:px-6 pt-10",children:c.jsxs("div",{className:"bg-white rounded-lg p-10 animate-pulse",style:{border:"1px solid rgba(0,0,0,0.08)"},children:[c.jsx("div",{className:"h-3 w-48 mb-8 rounded bg-neutral-200"}),c.jsx("div",{className:"h-10 w-5/6 mb-4 rounded bg-neutral-200"}),c.jsx("div",{className:"h-10 w-2/3 mb-10 rounded bg-neutral-200"}
643),c.jsx("div",{className:"space-y-3",children:[0,1,2,3,4].map(v=>c.jsx("div",{className:"h-3 w-full rounded bg-neutral-100"},v))})]})})});if(u||!r)return c.jsxs("main",{className:"min-h-screen flex flex-col items-center justify-center gap-4 px-6 text-center",style:{backgroundColor:"#0A0A0F",color:"#E8E8F0"},children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Article not found | Zenith News"}),c.jsx("meta",{name:"robots",content:"noindex"})]}),c.jsx("h1",{className:"text-3xl font-bold",style:{color:"#FFFFFF"},children:"Article not found"}),c.jsx(rt,{to:"/intelligence",target:"_blank",rel:"noopener noreferrer",style:{color:"#6B7FD4"},className:"hover:underline",children:"← Back to all articles"})]});const f=`https://waterdispenseinsights.com/intelligence/${r.slug}`,p=r.content.replace(/[#*`>\-\n]/g," ").replace(/\s+/g," ").trim(),m=r.excerpt||p.slice(0,155),y=p.split(/\s+/).filter(Boolean).length,g=r.cover_image_url||"https://storage.googleapis.com/gpt-engineer-file-uploads/xPOPHnyw89dKLtBAPfGsOEsvPnh2/uploads/1761076682105-zenith consulting logo template (1).png",b=!r.is_published,x={"@context":"https://schema.org","@type":"NewsArticle",headline:r.title,description:m,image:[{"@type":"ImageObject",url:g,width:1200,height:630}],datePublished:r.published_at,dateModified:r.updated_at||r.published_at,author:{"@type":"Person",name:"Akos Petri, MSc",url:"https://www.linkedin.com/in/akospetri/",jobTitle:"Founder & Managing Director",worksFor:{"@type":"Organization",name:"Zenith Global Commercial",url:"https://waterdispenseinsights.com"}},publisher:{"@type":"Organization",name:"Zenith Global Commercial",logo:{"@type":"ImageObject",url:"https://storage.googleapis.com/gpt-engineer-file-uploads/xPOPHnyw89dKLtBAPfGsOEsvPnh2/uploads/1761076682105-zenith consulting logo template (1).png"}},mainEntityOfPage:{"@type":"WebPage","@id":f},articleSection:"Water Dispense Industry Intelligence",inLanguage:"en-GB",wordCount:y,isAccessibleForFree:!0},w={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://waterdispenseinsights.com/"},{"@type":"ListItem",position:2,name:"Intelligence",item:"https://waterdispenseinsights.com/intelligence"},{"@type":"ListItem",position:3,name:r.title,item:f}]};return c.jsxs("main",{className:"min-h-screen",style:{backgroundColor:"#F4F2EE",color:"#1A1A1A"},children:[c.jsxs(xs,{children:[c.jsxs("title",{children:[r.title," | Zenith Industry Intelligence"]}),c.jsx("meta",{name:"description",content:m}),c.jsx("meta",{name:"author",content:"Akos Petri, MSc"}),c.jsx("meta",{name:"news_keywords",content:"water dispense, water cooler, POU, HOD, market intelligence, Europe, M&A"}),c.jsx("meta",{name:"keywords",content:"water dispense, water cooler, POU, HOD, market intelligence, Europe, M&A"}),b?c.jsx("meta",{name:"robots",content:"noindex, nofollow"}):c.jsx("meta",{name:"robots",content:"index, follow, max-image-preview:large, max-snippet:-1"}),c.jsx("link",{rel:"canonical",href:f}),c.jsx("meta",{property:"og:type",content:"article"}),c.jsx("meta",{property:"og:site_name",content:"Zenith Global Commercial"}),c.jsx("meta",{property:"og:title",content:r.title}),c.jsx("meta",{property:"og:description",content:m}),c.jsx("meta",{property:"og:url",content:f}),c.jsx("meta",{property:"og:image",content:g}),c.jsx("meta",{property:"og:image:secure_url",content:g}),c.jsx("meta",{property:"og:image:width",content:"1200"}),c.jsx("meta",{property:"og:image:height",content:"630"}),c.jsx("meta",{property:"og:image:alt",content:r.title}),c.jsx("meta",{property:"og:locale",content:"en_GB"}),c.jsx("meta",{property:"article:published_time",content:r.published_at}),c.jsx("meta",{property:"article:modified_time",content:r.updated_at||r.published_at}),c.jsx("meta",{property:"article:author",content:"Akos Petri, MSc"}),c.jsx("meta",{property:"article:section",content:"Industry Intelligence"}),c.jsx("meta",{property:"article:tag",content:"water dispense"}),c.jsx("meta",{property:"article:tag",content:"POU"}),c.jsx("meta",{property:"article:tag",content:"HOD"}),c.jsx("meta",{property:"article:tag",content:"Europe"}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("meta",{name:"twitter:title",content:r.title}),c.jsx("meta",{name:"twitter:description",content:m}),c.jsx("meta",{name:"twitter:image",content:g}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify(x)}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify(w)}),c.jsx("style",{children:`
644          .article-prose h2 { color: #0A0A0F; font-size: 1.5rem; font-weight: 700; margin-top: 2.25rem; margin-bottom: 0.85rem; letter-spacing: -0.01em; }
645          .article-prose h3 { color: #1A1A1A; font-size: 1.2rem; font-weight: 600; margin-top: 1.6rem; margin-bottom: 0.55rem; }
646          .article-prose p { color: #1A1A1A; font-size: 1.05rem; line-height: 1.8; margin-bottom: 1.2rem; }
647          .article-prose ul, .article-prose ol { color: #1A1A1A; line-height: 1.8; padding-left: 1.5rem; margin-bottom: 1.2rem; }
648          .article-prose li { margin-bottom: 0.4rem; }
649          .article-prose ul { list-style: disc; }
650          .article-prose ol { list-style: decimal; }
651          .article-prose strong { color: #0A0A0F; font-weight: 700; }
652          .article-prose a { color: #1F4FD4; text-decoration: underline; text-underline-offset: 2px; }
653          .article-prose a:hover { color: #0A2E9C; }
654          .article-prose blockquote { border-left: 3px solid #0A0A0F; padding-left: 1rem; color: #4A4A55; font-style: italic; margin: 1.4rem 0; }
655          .article-prose code { background: #F2F2F4; color: #0A0A0F; padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
656          .article-prose hr { border-color: rgba(0,0,0,0.1); margin: 2rem 0; }
657          .article-prose table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; }
658          .article-prose th, .article-prose td { border: 1px solid rgba(0,0,0,0.12); padding: 0.5rem 0.75rem; text-align: left; }
659          .article-prose th { background: #F5F5F7; color: #0A0A0F; font-weight: 600; }
660          .article-prose .not-prose { color: #ffffff; }
661          .article-prose .not-prose p,
662          .article-prose .not-prose span:not([style*="color"]) { color: #ffffff; }
663          .article-prose .not-prose a,
664          .article-prose .not-prose a:hover { color: #ffffff; text-decoration: none; }
665
666          .analytics-body h2, .analytics-body h3 { color: #0A0A0F; font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; margin-top: 1.25rem; }
667          .analytics-body h2:first-child, .analytics-body h3:first-child { margin-top: 0; }
668          .analytics-body p { color: #1A1A1A; line-height: 1.85; margin-bottom: 1rem; font-size: 1rem; }
669          .analytics-body strong { color: #0A0A0F; font-weight: 700; }
670          .analytics-body ul, .analytics-body ol { color: #1A1A1A; line-height: 1.85; padding-left: 1.5rem; margin-bottom: 1rem; }
671          .analytics-body li { margin-bottom: 0.5rem; }
672          .analytics-body a { color: #1F4FD4; text-decoration: underline; }
673          .analytics-body a:hover { color: #0A2E9C; }
674        `})]}),e&&r&&!r.is_published&&c.jsx("div",{style:{backgroundColor:"#1a1530",borderBottom:"2px s
674olid #FFD166",padding:"0.75rem 1rem",position:"sticky",top:0,zIndex:50},children:c.jsxs("div",{className:"max-w-3xl mx-auto flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{style:{color:"#E8E8F0",fontSize:"0.85rem"},children:[c.jsx("span",{style:{color:"#FFD166",fontWeight:600},children:"● DRAFT"}),c.jsx("span",{style:{marginLeft:"0.75rem",color:"#A0A8C8"},children:"Not visible publicly. Approve or reject in the admin dashboard."})]}),c.jsx(rt,{to:"/admin",target:"_blank",rel:"noopener noreferrer",style:{color:"#6B7FD4",fontSize:"0.85rem",fontWeight:600,textDecoration:"underline"},children:"Go to admin →"})]})}),c.jsx("header",{className:"border-b",style:{borderColor:"rgba(255,255,255,0.1)",backgroundColor:"hsl(200 80% 15%)"},children:c.jsxs("div",{className:"max-w-5xl mx-auto px-4 lg:px-6 py-5 flex items-center justify-between gap-4",children:[c.jsx(rt,{to:"/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center min-w-0",children:c.jsxs("span",{className:"text-base md:text-xl font-bold tracking-tight truncate",style:{color:"#FFFFFF"},children:["Zenith ",c.jsx("span",{className:"text-accent",children:"Articles"})]})}),c.jsx("nav",{className:"text-xs tracking-wider uppercase shrink-0",children:c.jsx("a",{href:"/intelligence",target:"_blank",rel:"noopener noreferrer",onClick:v=>{typeof window<"u"&&window.history.length>1&&(v.preventDefault(),window.history.back())},className:"transition-colors",onMouseEnter:v=>v.currentTarget.style.color="#FFFFFF",onMouseLeave:v=>v.currentTarget.style.color="rgba(255,255,255,0.75)",style:{color:"rgba(255,255,255,0.75)"},children:"← All articles"})})]})}),c.jsxs("div",{className:"max-w-5xl mx-auto px-4 lg:px-6 py-10",children:[c.jsx("div",{className:"bg-white rounded-lg overflow-hidden",style:{border:"1px solid rgba(0,0,0,0.15)",boxShadow:"0 1px 3px rgba(0,0,0,0.08)"},children:c.jsxs("article",{className:"px-6 md:px-12 pt-10 md:pt-14 pb-10",itemScope:!0,itemType:"https://schema.org/NewsArticle",children:[c.jsx("meta",{itemProp:"author",content:"Akos Petri, MSc"}),c.jsx("meta",{itemProp:"datePublished",content:r.published_at}),c.jsx("meta",{itemProp:"dateModified",content:r.updated_at||r.published_at}),c.jsx("time",{dateTime:r.published_at,className:"text-xs tracking-widest font-semibold uppercase mb-5 block",style:{color:"#1F4FD4"},children:xke(r.published_at)}),c.jsx("h1",{itemProp:"headline",className:"text-3xl md:text-5xl font-bold leading-tight mb-6",style:{color:"#0A0A0F",letterSpacing:"-0.02em"},children:r.title}),c.jsxs("p",{className:"text-sm mb-8",style:{color:"#5A5A66"},children:["By ",c.jsx("a",{href:"https://www.linkedin.com/in/akospetri",target:"_blank",rel:"noopener noreferrer",style:{color:"#0A0A0F",fontWeight:600,textDecoration:"underline"},children:"Akos Petri, MSc"})," · Zenith Global Commercial"]}),c.jsx("hr",{style:{borderColor:"rgba(0,0,0,0.1)",marginBottom:"2rem"}}),r.cover_image_url&&c.jsx("img",{src:r.cover_image_url,alt:r.title,className:"w-full rounded-md mb-10 aspect-video object-cover",loading:"eager",style:{border:"1px solid rgba(0,0,0,0.08)"}}),c.jsx("div",{className:"article-prose",itemProp:"articleBody",children:(()=>{const v=r.content,S=I3(v),E=c.jsx("div",{className:"my-8",children:c.jsx(n_,{})}),C=c.jsx("div",{className:"my-8",children:c.jsx(vN,{})});if(S){const T=/<h[23]\b[^>]*>/gi,P=[];let M;for(;(M=T.exec(v))!==null;)P.push(M.index);let R=-1,O=-1;if(P.length>=2&&(R=P[1]),P.length>=4?O=P[3]:P.length>=3&&(O=P[P.length-1]),R<=0||R>=v.length-20)return c.jsxs(c.Fragment,{children:[c.jsx("div",{dangerouslySetInnerHTML:{__html:Gd(v)}}),E,C]});if(O<=R||O>=v.length-20){const H=v.slice(0,R),z=v.slice(R);return c.jsxs(c.Fragment,{children:[c.jsx("div",{dangerouslySetInnerHTML:{__html:Gd(H)}}),E,c.jsx("div",{dangerouslySetInnerHTML:{__html:Gd(z)}}),C]})}const L=v.slice(0,R),U=v.slice(R,O),B=v.slice(O);return c.jsxs(c.Fragment,{children:[c.jsx("div",{dangerouslySetInnerHTML:{__html:Gd(L)}}),E,c.jsx("div",{dangerouslySetInnerHTML:{__html:Gd(U)}}),C,c.jsx("div",{dangerouslySetInnerHTML:{__html:Gd(B)}})]})}else{const T=v.split(/\n\s*\n/),P=[];T.forEach((B,H)=>{/^\s{0,3}#{2,3}\s+/.test(B)&&P.push(H)});let M=-1,R=-1;if(P.length>=2&&(M=P[1]),P.length>=4?R=P[3]:P.length>=3&&(R=P[P.length-1]),M<=0||M>=T.length)return c.jsxs(c.Fragment,{children:[c.jsx(Wd,{remarkPlugins:[qd],children:v}),E,C]});if(R<=M||R>=T.length){const B=T.slice(0,M).join(`
675
676`),H=T.slice(M).join(`
677
678`);return c.jsxs(c.Fragment,{children:[c.jsx(Wd,{remarkPlugins:[qd],children:B}),E,c.jsx(Wd,{remarkPlugins:[qd],children:H}),C]})}const O=T.slice(0,M).join(`
679
680`),L=T.slice(M,R).join(`
681
682`),U=T.slice(R).join(`
683
684`);return c.jsxs(c.Fragment,{children:[c.jsx(Wd,{remarkPlugins:[qd],children:O}),E,c.jsx(Wd,{remarkPlugins:[qd],children:L}),C,c.jsx(Wd,{remarkPlugins:[qd],children:U})]})}})()}),r.analytics_md&&c.jsx("div",{className:"analytics-body mt-12",style:{backgroundColor:"#F5F5F7",borderLeft:"4px solid #0A0A0F",padding:"1.75rem",borderRadius:"8px"},children:I3(r.analytics_md)?c.jsx("div",{dangerouslySetInnerHTML:{__html:Gd(r.analytics_md)}}):c.jsx(Wd,{remarkPlugins:[qd],children:r.analytics_md})}),c.jsxs("aside",{className:"mt-12 rounded-lg p-5 md:p-6",style:{backgroundColor:"#F5F5F7",border:"1px solid rgba(0,0,0,0.08)",borderLeft:"4px solid hsl(200 80% 15%)"},children:[c.jsx("p",{className:"text-xs uppercase tracking-widest font-semibold mb-2",style:{color:"hsl(200 80% 15%)"},children:"Further reading"}),c.jsxs("p",{className:"text-base leading-relaxed",style:{color:"#1A1A1A"},children:["Looking beyond water dispense? Explore"," ",c.jsx("a",{href:"https://zenithmarketintel.com/",target:"_blank",rel:"noopener noreferrer",className:"font-semibold underline",style:{color:"hsl(200 80% 15%)"},children:"Zenith Food & Beverage Market Intelligence"})," ","for cross-niche innovation ideas, category benchmarks and adjacent-market signals you can apply to your own strategy."]})]}),c.jsx(yke,{title:r.title,body:`${r.excerpt??""} ${r.content}`}),c.jsx("div",{className:"mt-12 pt-8",style:{borderTop:"1px solid rgba(0,0,0,0.1)"},children:c.jsx(S8,{url:typeof window<"u"?window.location.href:`https://waterdispenseinsights.com/intelligence/${r.slug}`,title:r.title,variant:"full"})})]})}),c.jsx("div",{className:"pt-12",children:c.jsx(n_,{})}),c.jsx("div",{className:"pt-8",children:c.jsx("div",{className:"max-w-6xl mx-auto px-4 lg:px-6",children:c.jsx(vN,{})})}),i.length>0&&c.jsx("section",{className:"pt-12","aria-label":"Related intelligence",children:c.jsxs("div",{className:"rounded-2xl p-6 md:p-8",style:{backgroundColor:"#FFFFFF",border:"1px solid rgba(0,0,0,0.12)"},children:[c.jsx("h2",{className:"text-xl md:text-2xl font-bold mb-5",style:{color:"#0A0A0F",fontFamily:"Georgia, 'Times New Roman', serif"},children:"Related water dispense intelligence"}),c.jsx("ul",{className:"space-y-3",children:i.map(v=>c.jsx("li",{children:c.jsxs("a",{href:`/intelligence/${v.slug}`,target:"_blank",rel:"noopener noreferrer",className:"group block rounded-md px-3 py-2.5 -mx-3 transition-colors hover:bg-neutral-50",children:[c.jsx("p",{className:"text-base md:text-lg font-semibold leading-snug",style:{color:"#0A0A0F"},children:v.title}),c.jsxs("p",{className:"text-xs uppercase tracking-wider mt-1",style:{color:"#5A5A66"},children:[v.topic??"Industry Intelligence"," ·"," ",c.jsx("span",{className:"group-hover:underline",style:{color:"hsl(200 80% 15%)"},children:"Read analysis →"})]})]})},v.slug))}),c.jsxs("div",{className:"mt-6 pt-5",style:{borderTop:"1px solid rgba(0,0,0,0.08)"},children:[c.jsx("a",{href:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold underline",style:{color:"hsl(200 80% 15%)"},children:"Explore more water dispense intelligence from Zenith Global Commercial →"}),c.jsxs("p",{className:"text-sm mt-3",style:{color:"#3A3A45"},children:["Strategic enquiries:"," ",c.jsx("a",{href:"mailto:[email protected]",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",style:{color:"hsl(200 80% 15%)"},children:"[email protected]"})," ","·"," ",c.jsx("a",{href:"tel:+442033690036",className:"underline font-medium",style:{color:"hsl(200 80% 15%)"},children:"+44 20 3369 0036"})]})]})]})}),c.jsx("section",{className:"pt-12",children:c.jsxs("div",{className:"rounded-2xl p-8 md:p-10 text-center",style:{background:"linear-gradient(135deg, #13131A 0%, #1a1a2e 100%)",border:"1px solid rgba(107,127,212,0.25)"},children:[c.jsx("h3",{className:"text-2xl md:text-3xl font-bold mb-3",style:{color:"#FFFFFF",fontFamily:"Georgia, 'Times New Roman', serif"},children:"Turn this intelligence into action"}),c.jsx("p",{className:"text-base mb-8 max-w-xl mx-auto",style:{color:"#A0A8C8"},children:"Get the full Water Dispense Regional Database — or speak directly with our team about your strategy."}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center items-center flex-wrap",children:[c.jsx("a",{href:"https://calendly.com/apetri-zenithglobalcommercial/30min",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center px-6 py-3 rounded-md font-semibold text-sm tracking-wide transition-transform hover:scale-105",style:{backgroundColor:"hsl(var(--accent))",color:"hsl(var(--accent-foreground))"},children:"Book a Free Consultation Call"}),c.jsx("a",{href:"/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center px-6 py-3 rounded-md font-semibold text-sm tracking-wide transition-colors",style:{backgroundColor:"transparent",color:"#FFFFFF",border:"1px solid rgba(255,255,255,0.2)"},onMouseEnter:v=>v.currentTarget.style.backgroundColor="rgba(255,255,255,0.05)",onMouseLeave:v=>v.currentTarget.style.backgroundColor="transparent",children:"Visit Water Dispense Regional Database →"}),c.jsx("a",{href:"https://waterdispenseinsights.com/reports",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center px-6 py-3 rounded-md font-semibold text-sm tracking-wide transition-transform hover:scale-105",style:{backgroundColor:"hsl(75 85% 60%)",color:"hsl(200 80% 15%)"},children:"Browse Market Reports →"})]})]})}),c.jsx("div",{className:"pt-8 pb-4",children:c.jsx("a",{href:"/intelligence",target:"_blank",rel:"noopener noreferrer",onClick:v=>{typeof window<"u"&&window.history.length>1&&(v.preventDefault(),window.history.back())},className:"inline-block text-sm font-medium transition-opacity",style:{color:"hsl(200 80% 15%)"},children:"← Back to all articles"})}),c.jsxs("div",{className:"pt-8 pb-4 space-y-8",children:[c.jsx(w8,{variant:"featured"}),c.jsx(k8,{})]})]}),c.jsx(Cc,{})]})},bke="/assets/smart-dispensers-hero-ZBaJsPZ2.png",XA="https://drive.google.com/drive/folders/122MlnDmEE1w2iJWwzLyoEGbUaCtFYjKW?usp=sharing",wke="https://www.zenithglobalcommercial.com/zenith-reports",kke="https://waterdispenseinsights.com",Ske=cp({name:Pn().trim().min(2,"Please enter your name").max(100),email:Pn().trim().email("Please enter a valid email").max(255),company:Pn().trim().min(2,"Please enter your company").max(200)}),ZA=[.25,.4,.25,1],_ke=[{icon:gZ,label:"Smart Dispenser Deep Dive"},{icon:EU,label:"Real-Time Water Intelligence"},{icon:k0,label:"Operator Economics Reimagined"},{icon:pR,label:"Procurement Confidence"}],Eke=[{bold:"How AI and IoT",rest:" are rewriting operator economics in 2026."},{bold:"Predictive maintenance,",rest:" live filtration data, and placement-level analytics — what they actually mean for procurement."},{bold:"Why 'smart' moved",rest:" from pilot to procurement standard."},{bold:"Operator vs. supplier impact",rest:" — who wins and who loses as the category re-prices."}],Cke=()=>{const[t,e]=k.useState({name:"",email:"",company:""}),[n,r]=k.useState(!1),[s,i]=k.useState(!1),a=async o=>{var d,f;o.preventDefault();const l=Ske.safeParse(t);if(!l.success){te.error("Please check your form",{description:l.error.errors[0].message});return}r(!0);const u=window.open(XA,"_blank");try{const{data:p,error:m}=await ce.functions.invoke("register-demo",{body:{name:t.name,email:t.email,company:t.company,newsletter:!0,source:"smartdispensers"}});if(m){if((d=m.message)!=null&&d.includes("Rate limit"))te.error("Too many requests",{description:"Please try again in an hour."});else throw m;return}if(!(p!=null&&p.success))throw new Error((p==null?void 0:p.error)||"Registration failed");try{await ce.functions.invoke("send-transactional-email",{body:{templateName:"smartdispensers-report",recipientEmail:t.email.trim().toLowerCase(),idempotencyKey:`smartdispensers-${((f=p.data)==null?void 0:f.id)??crypto.randomUUID()}`,templateData:{name:t.name.trim().split(" ")[0]||t.name.trim(),pdfUrl:XA,reportsUrl:wke,intelligenceUrl:kke}}})}catch(y){console.error("Email send failed (non-critical):",y)}te.success("You're in. Check your inbox.",{description:"Your report just opened in a new tab and we've emailed you the link too."}),i(!0),e({name:"",email:"",company:""}),u||te("Pop-up blocked",{description:"Click the email link or the button on the success screen to open the report."})}catch(p){console.error(p),te.error("Something went wrong",{description:"Please try again or email [email protected]."})}finally{r(!1)}};return c.jsxs(c.Fragment,{children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Smart Water Dispense Report 2026 | Zenith Global Commercial"}),c.jsx("meta",{name:"description",content:"Free 2026 report: how AI and IoT are rewriting water dispense operator economics. Get instant access — no credit card required."}),c.jsx("link",{rel:"canonical",href:"https://waterdispenseinsights.com/smartdispensers"}),c.jsx("meta",{property:"og:title",content:"Smart Water Dispense Arrives in Commercial Procurement"}),c.jsx("meta",{property:"og:description",content:"How AI and IoT are rewriting operator economics in 2026 — free instant access."}),c.jsx("meta",{property:"og:type",content:"article"})]}),c.jsx("main",{className:"min-h-screen bg-gradient-subtle",children:c.jsxs("section",{className:"container mx-auto px-6 py-12 md:py-20",children:[c.jsxs("div",{className:"grid lg:grid-cols-2 gap-10 lg:gap-16 items-center max-w-6xl mx-auto",children:[c.jsx(xt.div,{initial:{opacity:0,y:20}
684,animate:{opacity:1,y:0},transition:{duration:.7,ease:ZA},className:"order-1 lg:order-1",children:c.jsx("img",{src:bke,alt:"Smart Water Dispense Arrives in Commercial Procurement — 2026 report cover by Akos Petri",className:"w-full h-auto rounded-2xl shadow-elegant",width:1248,height:1248,loading:"eager"})}),c.jsxs(xt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,delay:.1,ease:ZA},className:"order-2 lg:order-2",children:[c.jsx("p",{className:"inline-block text-xs font-semibold tracking-widest uppercase text-accent mb-4",children:"Free 2026 Report"}),c.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-foreground leading-tight mb-4",children:"Smart Water Dispense Arrives in Commercial Procurement"}),c.jsx("p",{className:"text-lg text-muted-foreground mb-6",children:"How AI and IoT are rewriting operator economics in 2026 — by Akos Petri, MSc."}),c.jsx("ul",{className:"space-y-3 mb-8",children:Eke.map((o,l)=>c.jsxs("li",{className:"flex gap-3 text-foreground",children:[c.jsx("span",{className:"text-accent mt-1.5 shrink-0",children:"●"}),c.jsxs("span",{children:[c.jsx("strong",{children:o.bold}),o.rest]})]},l))}),s?c.jsxs("div",{className:"bg-card rounded-2xl shadow-elegant p-6 md:p-8 border border-border",children:[c.jsx("h2",{className:"text-2xl font-bold text-foreground mb-3",children:"You're all set ✅"}),c.jsx("p",{className:"text-muted-foreground mb-3",children:"The report just opened in a new tab and we've also emailed you the link. If the tab didn't open, use the button below."}),c.jsxs("p",{className:"text-sm text-muted-foreground mb-5",children:[c.jsx("strong",{children:"Don't see the email?"})," Please check your ",c.jsx("strong",{children:"SPAM / JUNK"})," folder — the report and follow-up details may land there."]}),c.jsx(oe,{asChild:!0,size:"lg",variant:"cta",className:"w-full",children:c.jsxs("a",{href:XA,target:"_blank",rel:"noopener noreferrer",children:["Open the report ",c.jsx(Yr,{className:"ml-2"})]})})]}):c.jsxs("form",{onSubmit:a,className:"bg-card rounded-2xl shadow-elegant p-6 md:p-8 border border-border space-y-4",children:[c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"sd-name",className:"font-semibold",children:"Full Name *"}),c.jsx(Ue,{id:"sd-name",type:"text",required:!0,placeholder:"John Smith",value:t.name,onChange:o=>e({...t,name:o.target.value}),className:"mt-2"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"sd-email",className:"font-semibold",children:"Business Email *"}),c.jsx(Ue,{id:"sd-email",type:"email",required:!0,placeholder:"[email protected]",value:t.email,onChange:o=>e({...t,email:o.target.value}),className:"mt-2"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"sd-company",className:"font-semibold",children:"Company Name *"}),c.jsx(Ue,{id:"sd-company",type:"text",required:!0,placeholder:"Your Company Ltd.",value:t.company,onChange:o=>e({...t,company:o.target.value}),className:"mt-2"})]}),c.jsxs(oe,{type:"submit",size:"lg",variant:"cta",className:"w-full text-lg py-6 h-auto",disabled:n,children:[c.jsx(S0,{className:"mr-2"}),n?"Sending...":"Get Access Now",!n&&c.jsx(Yr,{className:"ml-2"})]}),c.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["By submitting, you agree to our"," ",c.jsx("a",{href:"https://www.zenithglobalcommercial.com/legal",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Privacy Policy"}),"."]})]})]})]}),c.jsx(xt.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,ease:ZA},className:"mt-14 grid grid-cols-2 md:grid-cols-4 gap-4 max-w-5xl mx-auto",children:_ke.map(o=>c.jsxs("div",{className:"flex items-center gap-3 bg-card border border-border rounded-xl px-4 py-3 shadow-sm",children:[c.jsx(o.icon,{className:"w-5 h-5 text-accent shrink-0"}),c.jsx("span",{className:"text-sm font-medium text-foreground",children:o.label})]},o.label))}),c.jsxs("p",{className:"text-center text-xs text-muted-foreground mt-10",children:["Questions? Email"," ",c.jsx("a",{className:"text-accent hover:underline",href:"mailto:[email protected]",target:"_blank",rel:"noopener noreferrer",children:"[email protected]"})," ","or call"," ",c.jsx("a",{className:"text-accent hover:underline",href:"tel:+442033690036",children:"+44 20 3369 0036"})]})]})}),c.jsx(Cc,{})]})},Ake="https://aofirryrieneitjliizs.supabase.co",Tke="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFvZmlycnlyaWVuZWl0amxpaXpzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjAwMTY2NDAsImV4cCI6MjA3NTU5MjY0MH0.95iCS2r8wC5eH1Vo1uXQBLvHx6E0hg6bwvGBBh7rH-c",jke=()=>{const[t]=zz(),e=t.get("token"),[n,r]=k.useState("loading");k.useEffect(()=>{if(!e){r("invalid");return}(async()=>{try{const i=await fetch(`${Ake}/functions/v1/handle-email-unsubscribe?token=${encodeURIComponent(e)}`,{headers:{apikey:Tke}}),a=await i.json();if(i.status===404||a.error){r("invalid");return}if(a.valid===!1&&a.reason==="already_unsubscribed"){r("already");return}if(a.valid===!0){r("ready");return}r("invalid")}catch{r("error")}})()},[e]);const s=async()=>
684{if(e){r("submitting");try{const{data:i,error:a}=await ce.functions.invoke("handle-email-unsubscribe",{body:{token:e}});if(a)throw a;i!=null&&i.success?r("done"):(i==null?void 0:i.reason)==="already_unsubscribed"?r("already"):r("error")}catch{r("error")}}};return c.jsxs(c.Fragment,{children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Unsubscribe | Zenith Global Commercial"}),c.jsx("meta",{name:"robots",content:"noindex,nofollow"})]}),c.jsx("main",{className:"min-h-screen bg-gradient-subtle flex items-center justify-center px-6 py-16",children:c.jsxs("div",{className:"max-w-md w-full bg-card border border-border rounded-2xl shadow-elegant p-8 text-center",children:[c.jsx("h1",{className:"text-2xl font-bold text-foreground mb-3",children:"Unsubscribe"}),n==="loading"&&c.jsx("p",{className:"text-muted-foreground",children:"Checking your link…"}),n==="ready"&&c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-muted-foreground mb-6",children:"Click below to stop receiving emails from Zenith Global Commercial."}),c.jsx(oe,{size:"lg",variant:"cta",onClick:s,className:"w-full",children:"Confirm unsubscribe"})]}),n==="submitting"&&c.jsx("p",{className:"text-muted-foreground",children:"Processing…"}),n==="done"&&c.jsx("p",{className:"text-foreground",children:"You've been unsubscribed. We're sorry to see you go."}),n==="already"&&c.jsx("p",{className:"text-foreground",children:"You're already unsubscribed. Nothing more to do."}),n==="invalid"&&c.jsx("p",{className:"text-muted-foreground",children:"This unsubscribe link is invalid or has expired. If you keep getting unwanted email, reply to any message and we'll remove you manually."}),n==="error"&&c.jsxs("p",{className:"text-muted-foreground",children:["Something went wrong. Please try again in a moment, email"," ",c.jsx("a",{className:"text-accent hover:underline",href:"mailto:[email protected]",target:"_blank",rel:"noopener noreferrer",children:"[email protected]"})," ","or call"," ",c.jsx("a",{className:"text-accent hover:underline",href:"tel:+442033690036",children:"+44 20 3369 0036"}),"."]})]})})]})},M9=k.createContext(null),D3="zenith_reports_cart_v2";function Nke({children:t}){const[e,n]=k.useState(()=>{try{const s=localStorage.getItem(D3);if(!s)return[];const i=JSON.parse(s);return Array.isArray(i)?i.filter(a=>a&&typeof a.reportId=="string").map(a=>{const o=a.licence||"single",l=typeof a.basePriceCents=="number"?a.basePriceCents:a.priceCents;return{reportId:a.reportId,slug:a.slug,title:a.title,basePriceCents:l,priceCents:jv(l,o),currency:a.currency,coverPath:a.coverPath??null,licence:o}}):[]}catch{return[]}});k.useEffect(()=>{try{localStorage.setItem(D3,JSON.stringify(e))}catch{}},[e]);const r=k.useMemo(()=>{var i;const s=((i=e[0])==null?void 0:i.currency)||"usd";return{items:e,add:a=>{const o=a.licence||"single",l={reportId:a.reportId,slug:a.slug,title:a.title,basePriceCents:a.basePriceCents,priceCents:jv(a.basePriceCents,o),currency:a.currency,coverPath:a.coverPath,licence:o};n(u=>u.some(d=>d.reportId===l.reportId)?u.map(d=>d.reportId===l.reportId?l:d):[...u,l])},remove:a=>n(o=>o.filter(l=>l.reportId!==a)),updateLicence:(a,o)=>n(l=>l.map(u=>u.reportId===a?{...u,licence:o,priceCents:jv(u.basePriceCents,o)}:u)),clear:()=>n([]),has:a=>e.some(o=>o.reportId===a),count:e.length,subtotalCents:e.reduce((a,o)=>a+o.priceCents,0),currency:s}},[e]);return c.jsx(M9.Provider,{value:r,children:t})}function B0(){const t=k.useContext(M9);if(!t)throw new Error("useCart must be used within CartProvider");return t}function O9({report:t}){const{add:e,has:n}=B0(),r=n(t.id),[s,i]=k.useState(null),a=DI(t.region),o=MI(t.region),l=jH(t.region),u=`mailto:${ld}?subject=${encodeURIComponent(`${NH}: ${t.title}`)}`;return k.useEffect(()=>{OE(t.cover_image_url,{width:900,quality:85,resize:"contain"}).then(i)},[t.cover_image_url]),c.jsxs("article",{className:"group relative flex h-full flex-col overflow-hidden rounded-2xl border border-border/60 bg-card shadow-sm transition-shadow duration-300 hover:shadow-elegant",children:[c.jsxs(rt,{to:`/reports/${t.slug}`,target:"_blank",rel:"noopener noreferrer",className:"relative block aspect-[4/3] overflow-hidden bg-gradient-to-br from-primary/95 via-primary to-primary-dark",children:[s?c.jsx("img",{src:s,alt:`${t.title} cover`,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy",decoding:"async"}):c.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center p-6 text-center text-primary-foreground",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-[0.25em] text-accent",children:"Zenith Report"}),c.jsx("span",{className:"mt-3 font-serif text-lg leading-tight",children:t.title})]}),c.jsx("span",{className:"absolute left-3 top-3 rounded-full bg-accent px-2.5 py-1 text-[10px] font-bold uppercase tracking-wider text-accent-foreground shadow-md",children:lm(t.region,t.country)})]}),c.jsxs("div",{className:"flex flex-1 flex-col p-5",children:[c.jsx(rt,{to:`/reports/${t.slug}`,target:"_blank",rel:"noopener noreferrer",className:"block",children:c.jsx("h3",{className:"font-serif text-lg leading-tight text-foreground group-hover:text-primary",children:t.title})}),t.subtitle&&c.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground line-clamp-2",children:t.subtitle}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px] font-semibold uppercase tracking-wider",children:[a&&
684c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-primary",children:[c.jsx(dR,{className:"size-3"})," Bundle + bonuses"]}),o&&c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-primary",children:[c.jsx(ds,{className:"size-3"})," PDF + Excel on request"]}),c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-muted-foreground",children:[c.jsx(ds,{className:"size-3"})," PDF"]}),t.includes_excel&&c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-muted-foreground",children:[c.jsx(ky,{className:"size-3"})," Excel"]}),t.includes_powerbi&&c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-muted-foreground",children:[c.jsx(lE,{className:"size-3"})," Power BI"]})]}),c.jsxs("div",{className:"mt-auto flex items-end justify-between pt-5",children:[c.jsx("div",{children:l?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:a?"Tailored quote":"On request"}),c.jsx("p",{className:"font-serif text-lg font-semibold text-primary leading-tight",children:a?"Scoped to your needs":"Excel + qualitative insights"})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Price"}),c.jsx("p",{className:"font-serif text-2xl font-bold text-primary",children:bd(t.price_cents,t.currency)})]})}),c.jsxs("div",{className:"flex flex-col gap-2",children:[l?c.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:c.jsxs(oe,{size:"sm",variant:"default",className:"whitespace-nowrap",children:[c.jsx(fc,{className:"mr-1 size-4"})," Enquire"]})}):c.jsx(oe,{size:"sm",variant:r?"secondary":"default",className:"whitespace-nowrap",onClick:d=>{d.preventDefault(),!r&&e({reportId:t.id,slug:t.slug,title:t.title,basePriceCents:t.price_cents,currency:t.currency,coverPath:t.cover_image_url})},children:r?c.jsxs(c.Fragment,{children:[c.jsx(oa,{className:"mr-1 size-4"})," In basket"]}):c.jsxs(c.Fragment,{children:[c.jsx(mR,{className:"mr-1 size-4"})," Add"]})}),c.jsxs(rt,{to:`/reports/${t.slug}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs font-semibold text-primary hover:text-accent",children:["View ",c.jsx(Jn,{className:"size-3"})]})]})]})]})]})}const Pke=cp({name:Pn().trim().min(2,"Please enter your name").max(100),email:Pn().trim().email("Please enter a valid email address").max(255),message:Pn().trim().min(10,"Please tell us which markets interest you").max(2e3),privacyAccepted:Phe(!0,{errorMap:()=>({message:"Please accept the privacy policy"})})});function L9({open:t,onOpenChange:e}){const[n,r]=k.useState(""),[s,i]=k.useState(""),[a,o]=k.useState(""),[l,u]=k.useState(!1),[d,f]=k.useState(!1);async function p(m){var g;m.preventDefault();const y=Pke.safeParse({name:n,email:s,message:a,privacyAccepted:l});if(!y.success){te.error(((g=y.error.issues[0])==null?void 0:g.message)||"Please check your details");return}f(!0);try{const{data:b,error:x}=await ce.functions.invoke("submit-report-enquiry",{body:y.data});if(x||!(b!=null&&b.success))throw new Error((b==null?void 0:b.error)||"Unable to send your message");te.success("Message sent to Zenith Global Commercial"),r(""),i(""),o(""),u(!1),e(!1)}catch{te.error("We couldn't confirm delivery. Please email us directly below.")}finally{f(!1)}}return c.jsx(md,{open:t,onOpenChange:e,children:c.jsxs(yc,{className:"max-h-[90vh] overflow-y-auto sm:max-w-lg",children:[c.jsxs(gd,{children:[c.jsx(yd,{className:"font-serif text-2xl",children:"Talk to us about multi-market data"}),c.jsx(Xf,{children:"Tell us which markets or commercial questions matter to you."})]}),c.jsxs("form",{onSubmit:p,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Se,{htmlFor:"enquiry-name",children:"Name *"}),c.jsx(Ue,{id:"enquiry-name",value:n,onChange:m=>r(m.target.value),maxLength:100,required:!0,autoComplete:"name"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Se,{htmlFor:"enquiry-email",children:"Email *"}),c.jsx(Ue,{id:"enquiry-email",type:"email",value:s,onChange:m=>i(m.target.value),maxLength:255,required:!0,autoComplete:"email"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Se,{htmlFor:"enquiry-message",children:"Message *"}),c.jsx(ca,{id:"enquiry-message",value:a,onChange:m=>o(m.target.value),maxLength:2e3,required:!0,rows:5,placeholder:"Which markets are you looking at?"})]}),c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(jI,{id:"enquiry-privacy",checked:l,onCheckedChange:m=>u(m===!0),"aria-required":"true"}),c.jsxs(Se,{htmlFor:"enquiry-privacy",className:"text-sm leading-relaxed",children:["I agree to the ",c.jsx("a",{href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2",children:"privacy policy"})," *"]})]}),c.jsx(oe,{type:"submit",className:"w-full",disabled:d,children:d?"Sending…":"Send message"})]}),c.jsxs("p",{className:"border-t border-border pt-4 text-sm text-muted-foreground",children:["Prefer email? ",c.jsxs("a",{href:`mailto:${ld}`,className:"inline-flex items-center gap-1 font-medium text-primary underline underline-offset-2",children:[c.jsx(fc,{className:"size-4"}),ld]})]})]})})}function Rke({marketsCovered:t}){const[e,n]=k.useState(!1),{reviews:r,averageRating:s}=EI(20),i=s?s.toFixed(1):"5.0";return c.jsxs("section",{className:"relative overflow-hidden bg-gradient-hero pt-20 pb-28 text-primary-foreground",children:[c.jsx("div",{"aria-hidden":!0,
684className:"pointer-events-none absolute inset-0 opacity-40",style:{background:"radial-gradient(circle at 85% 15%, hsl(75 85% 60% / 0.25), transparent 55%), radial-gradient(circle at 10% 90%, hsl(200 75% 40% / 0.35), transparent 60%)"}}),c.jsxs("div",{className:"container relative z-10 mx-auto px-6",children:[c.jsx(xt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:[.25,.4,.25,1]},className:"inline-flex items-center gap-2 rounded-full border border-accent/40 bg-accent/10 px-3 py-1 text-xs font-semibold uppercase tracking-[0.2em] text-accent",children:"The Zenith Report Store"}),c.jsxs(xt.h1,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.9,delay:.1,ease:[.25,.4,.25,1]},className:"mt-6 max-w-4xl font-serif text-4xl leading-[1.05] tracking-tight sm:text-5xl md:text-6xl",children:["Know where the water dispense market is ",c.jsx("span",{className:"text-accent",children:"actually moving"})]}),c.jsxs(xt.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.9,delay:.25,ease:[.25,.4,.25,1]},className:"mt-5 max-w-3xl space-y-3 text-lg leading-relaxed text-primary-foreground/85",children:[c.jsx("p",{children:"Independent market intelligence across BWD, POU and integrated tap systems — built from operator data and three decades of Zenith Global Commercial research."}),c.jsx("p",{className:"text-base text-primary-foreground/75",children:"Understand market size, installed fleets, operator shares, revenues, pricing and growth opportunities across Europe, the USA and selected international markets."})]}),c.jsxs(xt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.8,delay:.35},className:"mt-8 flex flex-wrap items-center gap-3",children:[c.jsx(oe,{asChild:!0,children:c.jsxs("a",{href:"#research-routes",children:["Find your market ",c.jsx(kU,{className:"ml-2 size-4"})]})}),c.jsxs(oe,{variant:"hero",onClick:()=>n(!0),children:["Talk to us about multi-market data ",c.jsx(Jn,{className:"ml-2 size-4"})]})]}),c.jsx("div",{className:"mt-8 flex flex-wrap gap-x-3 gap-y-2 border-t border-primary-foreground/20 pt-5 text-xs font-semibold text-primary-foreground/85 sm:text-sm","aria-label":"Research coverage",children:["30 years of research",t===null?null:`${t} markets`,"2025 actuals","Forecasts to 2030 where included","BWD + POU + ITS"].filter(
684Boolean).map((a,o)=>c.jsxs("span",{children:[o>0&&c.jsx("span",{"aria-hidden":"true",className:"mr-3 text-accent",children:"·"}),a]},a))}),c.jsxs(xt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.8,delay:.4},className:"mt-8 flex flex-wrap items-center gap-x-6 gap-y-3 text-sm",children:[c.jsxs("a",{href:"https://www.trustpilot.com/review/zenithglobalcommercial.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-full bg-white/10 px-3 py-1.5 backdrop-blur transition-colors hover:bg-white/20",children:[c.jsx("span",{className:"inline-flex",children:[1,2,3,4,5].map(a=>c.jsx(NS,{className:"size-4 fill-[#00b67a] text-[#00b67a]"},a))}),c.jsx("span",{className:"font-semibold",children:i}),c.jsx("span",{className:"text-primary-foreground/70",children:"·"}),c.jsxs("span",{className:"text-primary-foreground/85",children:[r.length,"+ Trustpilot reviews"]}),c.jsx(Jn,{className:"size-3.5"})]}),c.jsxs("a",{href:"https://www.linkedin.com/in/akospetri/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-primary-foreground/85 transition-colors hover:text-accent",children:["Daily insights on LinkedIn ",c.jsx(Jn,{className:"size-3.5"})]}),c.jsxs(rt,{to:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-primary-foreground/85 transition-colors hover:text-accent",children:["Read the Intelligence hub ",c.jsx(Jn,{className:"size-3.5"})]})]})]}),c.jsx(L9,{open:e,onOpenChange:n})]})}function Ike({value:t,onChange:e,options:n}){return c.jsx("div",{className:"sticky top-0 z-30 -mx-4 mb-8 flex gap-2 overflow-x-auto border-b border-border bg-background/95 px-4 py-3 backdrop-blur",children:n.map(r=>{const s=r.id===t;return c.jsxs("button",{onClick:()=>e(r.id),className:`relative shrink-0 rounded-full px-4 py-1.5 text-sm font-medium transition-colors ${s?"text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:[s&&c.jsx(xt.span,{layoutId:"region-pill",className:"absolute inset-0 rounded-full bg-primary",transition:{type:"spring",stiffness:500,damping:35}}),c.jsxs("span",{className:"relative z-10",children:[r.label,typeof r.count=="number"&&c.jsx("span",{className:`ml-1.5 text-xs ${s?"text-primary-foreground/70":"text-muted-foreground/60"}`,children:r.count})]})]},r.id)})})}function F9(){const{reviews:t,averageRating:e,isLoading:n}=EI(6);return n||t.length===0?null:c.jsx("section",{className:"border-y border-border/60 bg-muted/30 py-14",children:c.jsxs("div",{className:"container mx-auto px-6",children:[c.jsxs("div",{className:"mb-8 flex flex-col items-start justify-between gap-4 md:flex-row md:items-end",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.2em] text-accent",children:"Trusted by operators, investors and suppliers"}),c.jsx("h2",{className:"mt-2 font-serif text-2xl md:text-3xl",children:"What buyers say on Trustpilot"})]}),c.jsxs("a",{href:"https://www.trustpilot.com/review/zenithglobalcommercial.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm font-semibold text-primary hover:text-accent",children:[e?e.toFixed(1):"5.0"," on Trustpilot",c.jsx(Jn,{className:"size-3.5"})]})]}),c.jsx("div",{className:"grid gap-4 md:grid-cols-3",children:t.slice(0,3).map(r=>c.jsxs("blockquote",{className:"rounded-xl border border-border/60 bg-card p-5 shadow-sm",children:[c.jsx("div",{className:"mb-3 flex",children:Array.from({length:r.rating}).map((s,i)=>c.jsx(NS,{className:"size-4 fill-[#00b67a] text-[#00b67a]"},i))}),r.title&&c.jsx("p",{className:"mb-1.5 text-sm font-semibold text-foreground",children:r.title}),c.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground line-clamp-5",children:r.content}),c.jsxs("footer",{className:"mt-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:["— ",r.author]})]},r.id))})]})})}function B9(){return c.jsx("aside",{className:"rounded-xl border border-primary/20 bg-gradient-to-br from-primary/[0.03] to-transparent p-5 sm:p-6",children:c.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:gap-5",children:[c.jsx("img",{src:b8.url,alt:"Ákos Petri, Managing Director, Zenith Global Commercial",className:"size-20 shrink-0 rounded-full object-cover ring-2 ring-primary/20 sm:size-24",loading:"lazy"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-[0.2em] text-muted-foreground",children:"Curated by"}),c.jsx("p",{className:"mt-0.5 font-serif text-lg text-foreground",children:"Ákos Petri"}),c.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:"Managing Director, Zenith Global Commercial. 8+ years in water dispense strategy and market research."}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-3 text-xs font-semibold",children:[c.jsxs("a",{href:"https://www.linkedin.com/in/akospetri/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-primary hover:text-accent",children:[c.jsx(hc,{className:"size-3.5"})," Daily insights on LinkedIn ",c.jsx(Jn,{className:"size-3"})]}),c.jsxs("a",{href:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-primary hover:text-accent",children:["Intelligence hub ",c.jsx(Jn,{className:"size-3"})]})]})]})]})})}const Dke=[{icon:EU,tag:"BWD",title:"Bottled Water Dispense (BWD)",body:"Coolers supplied with returnable bottles by a delivery operator. Revenue is driven by water volume, bottle pricing and route-based service, making operator scale and delivery density the decisive factors."},{icon:LZ,tag:"POU",title:"Point of Use (POU)",body:"Mains-fed coolers with filtration, purification or treatment on site. The POU water cooler market grows on rental and service contracts rather than water volume, and is the fastest-shifting segment in most European markets."},{icon:bZ,tag:"ITS",title:"Integrated Tap Systems (ITS)",body:"High-capacity chilled, sparkling or boiling taps built into a counter. ITS is reshaping workplace and hospital
684ity water dispense, pulling volume away from both bottled and freestanding POU equipment."}];function Mke(){return c.jsx("section",{"aria-labelledby":"market-research-heading",className:"mb-20",children:c.jsxs("div",{className:"grid gap-10 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.1fr)] lg:items-start",children:[c.jsxs("div",{className:"lg:sticky lg:top-24",children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-accent",children:"Market definitions"}),c.jsx("h2",{id:"market-research-heading",className:"mt-2 font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"How Zenith defines the market"}),c.jsx("div",{className:"mt-3 h-px w-16 bg-accent"}),c.jsx("p",{className:"mt-5 text-base leading-relaxed text-muted-foreground",children:"Every market is broken into the same three segments, so performance can be compared across countries and systems."}),c.jsx("p",{className:"mt-4 text-base leading-relaxed text-muted-foreground",children:"These definitions distinguish bottled delivery, mains-fed coolers and integrated taps in the installed market."})]}),c.jsx("div",{className:"space-y-4",children:Dke.map(t=>c.jsxs("article",{className:"group relative overflow-hidden rounded-2xl border border-border/60 bg-card p-6 shadow-sm transition-colors hover:border-primary/40",children:[c.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-1 bg-accent/70"}),c.jsxs("div",{className:"flex items-start gap-4 pl-2",children:[c.jsx("div",{className:"rounded-xl bg-primary/10 p-3 text-primary",children:c.jsx(t.icon,{className:"size-6"})}),c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-accent",children:t.tag}),c.jsx("h3",{className:"mt-1 font-serif text-xl text-foreground",children:t.title}),c.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:t.body})]})]})]},t.tag))})]})})}function Oke({europeanMarkets:t,totalReports:e}){const n=[{value:String(t),label:"European markets covered",note:"2026 edition"},{value:String(e),label:"Reports in the catalogue",note:"2026 edition"},{value:"BWD · POU · ITS",label:"Segments tracked in every market",note:"2026 edition"},{value:"2020–2030",label:"History and forecast horizon",note:"2026 edition"}];return c.jsx("section",{"aria-labelledby":"market-data-heading",className:"mb-20",children:c.jsxs("div",{className:"relative overflow-hidden rounded-3xl bg-gradient-hero p-8 text-primary-foreground shadow-elegant md:p-12",children:[c.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 opacity-50",style:{background:"radial-gradient(circle at 88% 12%, hsl(75 85% 60% / 0.22), transparent 55%), radial-gradient(circle at 8% 95%, hsl(200 75% 40% / 0.35), transparent 60%)"}}),c.jsxs("div",{className:"relative z-10",children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-accent",children:"Coverage"}),c.jsx("h2",{id:"market-data-heading",className:"mt-2 max-w-2xl font-serif text-3xl leading-tight md:text-4xl",children:"Water Dispense Market Data"}),c.jsx("p",{className:"mt-4 max-w-2xl text-base leading-relaxed text-primary-foreground/80",children:"The scope behind Zenith's water dispense market data: installed units, placements, revenues and operator activity, measured consistently market by market."}),c.jsx("dl",{className:"mt-10 grid gap-px overflow-hidden rounded-2xl border border-primary-foreground/15 bg-primary-foreground/15 sm:grid-cols-2 lg:grid-cols-4",children:n.map(r=>c.jsxs("div",{className:"bg-primary/40 p-6 backdrop-blur",children:[c.jsx("dt",{className:"sr-only",children:r.label}),c.jsxs("dd",{children:[c.jsx("p",{className:"font-serif text-2xl font-bold text-accent md:text-3xl",children:r.value}),c.jsx("p",{className:"mt-2 text-sm font-semibold text-primary-foreground",children:r.label}),c.jsx("p",{className:"mt-1 text-[10px] uppercase tracking-[0.2em] text-primary-foreground/60",children:r.note})]})]},r.label))})]})]})})}const Lke=["Installed unit base","Annual unit placements","Market revenues","BWD / POU / ITS segmentation","Operator market shares","Leading suppliers and brands","Historical market development","5-year market forecasts","Pricing and revenue trends","Competitive landscape","Market drivers","Regulatory developments","M&A and industry activity"];function Fke(){return c.jsxs("section",{"aria-labelledby":"reports-cover-heading",className:"mb-20",children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-accent",children:"Inside every report"}),c.jsx("h2",{id:"reports-cover-heading",className:"mt-2 font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"What Our Water Dispenser Market Reports Cover"}),c.jsx("div",{className:"mt-3 h-px w-16 bg-accent"}),c.jsx("p",{className:"mt-5 max-w-3xl text-base leading-relaxed text-muted-foreground",children:"Every report follows the same structure, so water cooler market data can be compared directly between markets."}),c.jsxs("div",{className:"mt-8 rounded-3xl border border-border/60 bg-card p-6 shadow-sm md:p-8",children:[c.jsx("ul",{className:"grid gap-x-8 gap-y-1 sm:grid-cols-2 lg:grid-cols-3",children:Lke.map(t=>c.jsxs("li",{className:"flex items-start gap-3 border-b border-border/40 py-3 text-sm font-medium text-foreground last:border-b-0",children:[c.jsx("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-accent/20 text-accent",children:c.jsx(oa,{className:"size-3.5"})}),t]},t))}),c.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-3 border-t border-border/60 pt-6 text-xs font-semibold uppercase tracking-wider",children:[c.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-muted px-3 py-1.5 text-muted-foreground",children:[c.jsx(ds,{className:"size-3.5"})," PDF report"]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-muted px-3 py-1.5 text-muted-foreground",children:[c.jsx(ky,{className:"size-3.5"})," Excel database"]}),c.jsx("span",{className:"text-[11px] font-medium normal-case tracking-normal text-muted-foreground",children:"Delivered by email within 24 hours of checkout."})]})]})]})}const Bke=[{icon:CZ,title:"Primary research",body:"Interviews with operators, distributors and suppliers in every market we size."},{icon:_U,title:"Bottom-up modelling",body:"Operator-reported placements and installed base reconciled against company reporting."},{icon:lE,title:"Forecasts to 2030",body:"Units, volume and revenue by segment, where included in the respective report."},{icon:NZ,title:"Consistent definitions",body:"The same method across editions, so year-on-year movement reflects the market."}];function $ke(){return c.jsx("section",{"aria-labelledby":"methodology-heading",className:"mb-20",children:c.jsx("div",{className:"overflow-hidden rounded-3xl border border-border/60 bg-muted/30",children:c.jsxs("div",{className:"grid gap-8 p-8 lg:grid-cols-[minmax(0,1.15fr)_minmax(0,1fr)] md:p-12",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-accent",children:"Methodology"}),c.jsx("h2",{id:"methodology-heading",className:"mt-2 font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Independent Water Dispenser Market Intelligence"}),c.jsx("div",{className:"mt-3 h-px w-16 bg-accent"}),c.jsxs("div",{className:"mt-5 space-y-4 text-base leading-relaxed text-muted-foreground",children:[c.jsx("p",{children:"Zenith Global's water dispense industry research is built from primary work: interviews with operators and distributors, operator-reported placement and installed-base data, supplier and manufacturer information, published company reporting, and bottom-up market modelling that reconciles those inputs market by market."}),c.jsx("p",{children:"The focus is the commercial water dispense industry — bottled water dispense, point-of-use coolers and integrated tap systems installed and serviced under contract — rather than treating the category simply as consumer appli
684ance sales. Appliance shipment estimates miss rental fleets, replacements, service revenue and operator consolidation, which are the numbers investors and strategic buyers actually need."}),c.jsxs("p",{children:["Ongoing developments are tracked in the"," ",c.jsx(rt,{to:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-primary underline underline-offset-4 hover:text-accent",children:"water dispense industry research and news hub"}),"."]})]})]}),c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-1 lg:content-start",children:Bke.map(t=>c.jsxs("div",{className:"flex items-start gap-4 rounded-2xl border border-border/60 bg-card p-5 shadow-sm",children:[c.jsx("div",{className:"rounded-lg bg-accent/15 p-2 text-accent",children:c.jsx(t.icon,{className:"size-5"})}),c.jsxs("div",{children:[c.jsx("p",{className:"font-serif text-lg text-foreground",children:t.title}),c.jsx("p",{className:"mt-1 text-sm leading-relaxed text-muted-foreground",children:t.body})]})]},t.title))})]})})})}function Uke(t){const e=t.length>0?`${t.join(", ")}.`:"European, North American, Asian and Middle Eastern markets.";return[{q:"What is the water dispenser market?",a:"The water dispenser market covers the equipment and services that deliver drinking water in workplaces, hospitality venues and homes. Zenith splits it into three segments: bottled water dispense (BWD), where coolers are supplied with returnable bottles by a delivery operator; point-of-use (POU) water coolers, which are plumbed into the mains and use filtration, purification or treatment; and integrated tap systems (ITS), high-capacity chilled, sparkling or boiling taps built into a counter."},{q:"What is included in Zenith's water dispenser market reports?",a:"Each report sizes the installed unit base and annual placements, market revenues, BWD, POU and ITS segmentation, operator market shares, leading suppliers and brands, pricing and revenue trends, historical market development and forecasts, plus market drivers, regulation and M&A activity. Every report is delivered as a PDF report with an Excel database."},{q:"Which countries are covered?",a:`The current catalogue covers ${e}`},{q:"What is the difference between BWD and POU water coolers?",a:"A BWD cooler is fed by returnable bottles delivered on a regular schedule, so revenue comes largely from water delivery. A POU water cooler is connected to the mains supply and filters or treats the water on site, so revenue comes from equipment rental and service rather than bottled water volume."},{q:"Does Zenith provide water dispenser market forecasts?",a:"Yes. Where forecasts are included in the respective market report, they run to 2030 and cover units, volume and revenue by segment."},{q:"Who uses Zenith's water dispense market research?",a:"Water dispense operators, equipment manufacturers, component and filtration suppliers, investors and private equity teams, consultants and strategic decision-makers evaluating market entry, acquisitions or competitive position."}]}function zke({items:t}){return c.jsxs("section",{"aria-labelledby":"faq-heading",className:"mb-4",children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-accent",children:"Questions"}),c.jsx("h2",{id:"faq-heading",className:"mt-2 font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Water Dispenser Market Reports FAQ"}),c.jsx("div",{className:"mt-3 h-px w-16 bg-accent"}),c.jsx("div",{className:"mt-8 grid gap-4 md:grid-cols-2",children:t.map((e,n)=>c.jsx("article",{className:"rounded-2xl border border-border/60 bg-card p-6 shadow-sm transition-colors hover:border-primary/40",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("span",{className:"mt-0.5 font-serif text-sm font-bold text-accent",children:String(n+1).padStart(2,"0")}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-serif text-lg leading-snug text-foreground",children:e.q}),c.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:e.a})]})]})},e.q))})]})}
684const Vke=[{region:"japan",label:"Japan",detail:"Operator rankings, B2B/B2C split and 2030 outlook"},{region:"south-korea",label:"South Korea",detail:"Operators, channels and outlook"},{region:"turkey",label:"Turkey",detail:"Operator shares, channel mix and 2030 outlook"},{region:"uae",label:"UAE",detail:"Operators, channels and outlook"}];function Wke({reports:t}){const e=t.find(i=>i.region==="usa"),[n,r]=k.useState(null);k.useEffect(()=>{let i=!0;return r(null),e!=null&&e.cover_image_url&&OE(e.cover_image_url,{width:700,quality:85,resize:"contain"}).then(a=>{i&&r(a)}),()=>{i=!1}},[e==null?void 0:e.cover_image_url]);const s=Vke.map(i=>({...i,report:t.find(a=>a.region===i.region)})).filter(i=>i.report);return!e&&s.length===0?null:c.jsxs("div",{className:"mb-20 space-y-14",children:[e&&c.jsx("section",{"aria-labelledby":"featured-usa-heading",className:"overflow-hidden border border-border bg-primary text-primary-foreground",children:c.jsxs("div",{className:"grid md:grid-cols-[minmax(0,1fr)_minmax(220px,0.65fr)]",children:[c.jsxs("div",{className:"p-7 md:p-10 lg:p-12",children:[c.jsx("p",{className:"text-xs font-bold uppercase text-accent",children:"Featured report"}),c.jsx("h2",{id:"featured-usa-heading",className:"mt-3 font-serif text-3xl leading-tight md:text-4xl",children:"United States 2026"}),c.jsx("p",{className:"mt-4 text-lg font-semibold",children:"Built with direct HQ data from Culligan, Quench and Primo"}),c.jsx("p",{className:"mt-4 text-primary-foreground/85",children:"BWD · POU · ITS"}),c.jsx("p",{className:"mt-2 text-primary-foreground/85",children:"20+ operators · pricing benchmarks · 2030 outlook"}),c.jsxs("p",{className:"mt-4 flex items-center gap-3 text-sm text-primary-foreground/85",children:[c.jsx(ds,{className:"size-4 shrink-0 text-accent"})," PDF report",c.jsx("span",{"aria-hidden":"true",children:"+"}),c.jsx(ky,{className:"size-4 shrink-0 text-accent"})," Excel database"]}),c.jsx(oe,{asChild:!0,className:"mt-7",children:c.jsxs(rt,{to:`/reports/${e.slug}`,target:"_blank",rel:"noopener noreferrer",children:["Explore the US report ",c.jsx(Jn,{className:"ml-2 size-4"})]})})]}),c.jsx(rt,{to:`/reports/${e.slug}`,target:"_blank",rel:"noopener noreferrer","aria-label":"Explore the US report",className:"flex min-h-64 items-center justify-center bg-primary-dark p-7",children:n?c.jsx("img",{src:n,alt:`${e.title} cover`,className:"max-h-80 w-full object-contain",loading:"eager"}):c.jsx(ds,{className:"size-16 text-accent","aria-hidden":"true"})})]})}),s.length>0&&c.jsxs("section",{"aria-labelledby":"new-markets-heading",children:[c.jsx("p",{className:"text-xs font-bold uppercase text-accent",children:"New for 2026"}),c.jsx("h2",{id:"new-markets-heading",className:"mt-2 font-serif text-3xl text-foreground md:text-4xl",children:"Japan · South Korea · Turkey · UAE"}),c.jsx("div",{className:"mt-3 h-px w-16 bg-accent"}),c.jsx("div",{className:"mt-7 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:s.map(({region:i,label:a,detail:o,report:l})=>l&&c.jsxs(rt,{to:`/reports/${l.slug}`,target:"_blank",rel:"noopener noreferrer",className:"group flex flex-col border border-border bg-card p-5 transition-colors hover:border-primary/40",children:[c.jsx("span",{className:"font-serif text-xl text-foreground group-hover:text-primary",children:a}),c.jsx("span",{className:"mt-2 text-sm text-muted-foreground",children:o}),c.jsxs("span",{className:"mt-auto flex items-center justify-between gap-2 pt-6 text-sm font-semibold text-primary",children:[bd(l.price_cents,l.currency)," ",c.jsx(Jn,{className:"size-4 shrink-0"})]})]},i))})]})]})}const Hke=[{icon:cR,title:"Operators",body:"Benchmark your fleet, pricing and market share. Identify expansion and acquisition opportunities."},{icon:AU,title:"Equipment & filtration suppliers",body:"See where installed fleets and placements are growing and which operators control demand."},{icon:gR,title:"Investors & private equity",body:"Size markets, understand competitive concentration and identify operators and consolidation opportunities."},{icon:vZ,title:"Corporate strategy & M&A",body:"Compare markets and operators before entering, acquiring or allocating investment."},{icon:PU,title:"Industry suppliers",body:"Understand where BWD, POU and ITS demand is developing."}];function qke(){return c.jsxs("section",{"aria-labelledby":"report-buyers-heading",className:"mb-20",children:[c.jsx("p",{className:"text-xs font-bold uppercase text-accent",children:"Who uses the research"}),c.jsx("h2",{id:"report-buyers-heading",className:"mt-2 max-w-3xl font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Built for companies making decisions in water dispense"}),c.jsx("div",{className:"mt-3 h-px w-16 bg-accent"}),c.jsx("div",{className:"mt-7 grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:Hke.map(({icon:t,title:e,body:n})=>c.jsxs("article",{className:"border-t border-border pt-5",children:[c.jsx(t,{className:"size-6 text-accent","aria-hidden":"true"}),c.jsx("h3",{className:"mt-3 font-serif text-xl text-foreground",children:e}),c.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:n})]},e))})]})}const Gke="Multi-market water dispense research enquiry",Kke=`Hello Zenith Global Commercial,
685
686I'm looking at several markets. The countries that matter to us are:
687
688Our research needs / questions are:
689
690Thank you,`,Yke=`mailto:${ld}?subject=${encodeURIComponent(Gke)}&body=${encodeURIComponent(Kke)}`;function $9({className:t=""}){const[e,n]=k.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsxs("section",{"aria-labelledby":"multi-market-heading",className:`border-y border-border bg-muted/30 py-8 ${t}`,children:[c.jsxs("div",{className:"flex flex-col gap-5 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("div",{children:[c.jsx("h2",{id:"multi-market-heading",className:"font-serif text-2xl text-foreground",children:"Looking at several markets?"}),c.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-muted-foreground",children:"Tell us which countries matter. We can build the appropriate regional or multi-market package."})]}),c.jsxs(oe,{onClick:()=>n(!0),className:"shrink-0 self-start sm:self-auto",children:[c.jsx(fc,{className:"mr-2 size-4"})," Discuss your requirements"]})]}),c.jsxs("p",{className:"mt-4 text-sm text-muted-foreground",children:["Prefer email? ",c.jsx("a",{href:Yke,className:"font-medium text-primary underline underline-offset-2",children:ld})]})]}),c.jsx(L9,{open:e,onOpenChange:n})]})}const Xke=["How large is the installed POU opportunity in Germany?","Which operators are gaining share?","How quickly is POU replacing bottled water dispense?","Where are integrated tap systems becoming commercially significant?","What are operators charging for rentals, bottles and service?","Which European markets offer the strongest expansion opportunities?","Which independent operators could be acquisition targets?","How does our installed fleet compare with the market?","Where should we prioritise sales, acquisition or investment?"],Zke=[{icon:_y,title:"Operator intelligence",body:"Operator and distributor interviews, company reporting and local industry relationships."},{icon:cR,title:"Installed-base measurement",body:"BWD, POU and ITS fleets, placements, cancellations and conversions."},{icon:wZ,title:"30-year market history",body:"Consistent definitions and long-term market tracking."},{icon:k0,title:"Company-level analysis",body:"Operator rankings, shares, pricing, channels and competitive positioning."}];
690function Qke(){return c.jsxs("section",{"aria-labelledby":"commercial-problem-heading",className:"mb-20",children:[c.jsxs("div",{className:"border-b border-border pb-12",children:[c.jsx("p",{className:"text-xs font-bold uppercase text-accent",children:"The commercial picture"}),c.jsx("h2",{id:"commercial-problem-heading",className:"mt-3 max-w-4xl font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Shipment data doesn't tell you who controls the installed market"}),c.jsxs("div",{className:"mt-6 grid gap-5 text-base leading-relaxed text-muted-foreground md:grid-cols-2",children:[c.jsxs("p",{children:[c.jsx("strong",{className:"text-foreground",children:"Water dispense is a service-led business."})," An equipment shipment does not necessarily represent a new customer. Installed fleets, rental contracts, replacements, cancellations, bottle volumes and operator consolidation all affect the real commercial picture."]}),c.jsxs("p",{children:[c.jsx("strong",{className:"text-foreground",children:"Zenith measures the market from the installed base upward."})," We track operators, placements, revenues and market shares across bottled water dispense, point-of-use and integrated tap systems — using consistent definitions market by market."]})]})]}),c.jsxs("div",{className:"py-12",children:[c.jsx("p",{className:"text-xs font-bold uppercase text-accent",children:"What are you trying to answer?"}),c.jsx("h2",{className:"mt-2 max-w-3xl font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Make the next commercial decision with better market evidence"}),c.jsx("ul",{className:"mt-7 grid gap-x-10 gap-y-0 sm:grid-cols-2 lg:grid-cols-3",children:Xke.map(t=>c.jsx("li",{className:"border-t border-border py-4 text-sm font-medium leading-relaxed text-foreground",children:t},t))})]}),c.jsxs("div",{className:"border-t border-border pt-12",children:[c.jsx("p",{className:"text-xs font-bold uppercase text-accent",children:"How Zenith works"}),c.jsx("h2",{className:"mt-2 max-w-3xl font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Built from the market up — not from equipment shipments down"}),c.jsx("div",{className:"mt-8 grid gap-6 sm:grid-cols-2 lg:grid-cols-4",children:Zke.map(({icon:t,title:e,body:n})=>c.jsxs("article",{className:"border-t border-border pt-5",children:[c.jsx(t,{"aria-hidden":"true",className:"size-6 text-accent"}),c.jsx("h3",{className:"mt-4 font-serif text-xl text-foreground",children:e}),c.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:n})]},e))})]})]})}const Jke=[{title:"One country",icon:NU,audience:"For teams assessing one specific market.",product:"Country Report + Excel Database",detail:"Market size · BWD/POU/ITS · Operator shares · Pricing · Channels · Forecasts to 2030",label:"Browse individual markets",target:"european-individual",href:"#country-reports"},{title:"Europe",icon:jU,audience:"For businesses managing multiple European markets.",product:"West Europe · East Europe · Pan-Europe",detail:"Country reports + regional database + Power BI + executive insights.",label:"Compare European options",target:null,href:"#european-packages"},{title:"International / strategic",icon:CU,audience:"For global strategy, investment and expansion work.",product:"USA · Japan · South Korea · Turkey · UAE + European coverage",detail:"Explore international reports or discuss a tailored multi-market package.",label:"See international markets",target:"international",href:"#country-reports"}];function eSe({onChoose:t}){return c.jsxs("section",{id:"research-routes","aria-labelledby":"research-routes-heading",className:"mb-20 scroll-mt-24",children:[c.jsx("p",{className:"text-xs font-bold uppercase text-accent",children:"Find your research"}),c.jsx("h2",{id:"research-routes-heading",className:"mt-2 font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Choose the level of intelligence you need"}),c.jsx("div",{className:"mt-8 grid gap-5 md:grid-cols-3",children:Jke.map(({title:e,icon:n,audience:r,product:s,detail:i,label:a,target:o,href:l})=>c.jsxs("article",{className:"flex flex-col border border-border bg-card p-6",children:[c.jsx(n,{"aria-hidden":"true",className:"size-7 text-accent"}),c.jsx("h3",{className:"mt-5 font-serif text-2xl text-foreground",children:e}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:r}),c.jsx("p",{className:"mt-6 font-semibold text-foreground",children:s}),c.jsx("p",{className:"mt-2 flex-1 text-sm leading-relaxed text-muted-foreground",children:i}),c.jsx(oe,{asChild:!0,variant:"outline",className:"mt-7 self-start",children:c.jsxs("a",{href:l,onClick:()=>{o&&t(o)},children:[a,c.jsx(kU,{"aria-hidden":"true",className:"ml-2 size-4"})]})})]},e))})]})}const tSe=["Full regional Excel database","Interactive Power BI dashboard","Executive insights deck","Infographics","2020–2025 actuals","Forecasts to 2030"],nSe=[{region:"west-europe",name:"West Europe",countries:xb},{region:"east-europe",name:"East Europe",countries:vb}];function rSe({reports:t}){const e=t.find(i=>i.region==="pan-europe"),n=i=>new Set(t.filter(a=>(a.region==="country"||a.region==="data")&&a.country&&i.has(a.country)).map(a=>a.country)).size,r=n(new Set([...xb,...vb])),s=nSe.map(i=>({...i,report:t.find(a=>a.region===i.region)})).filter(i=>i.report);return!e&&s.length===0?null:c.jsxs("section",{id:"european-packages","aria-labelledby":"european-packages-heading",className:"mb-20 scroll-mt-24",children:[c.jsx("p",{className:"text-xs font-bold uppercase text-accent",children:"European packages"}),c.jsx("h2",{id:"european-packages-heading",className:"mt-2 font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Managing more than one European market?"}),e&&c.jsxs("article",{className:"mt-7 grid gap-7 border border-border bg-primary p-7 text-primary-foreground md:grid-cols-[1fr_1fr] md:p-10",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-bold uppercase text-accent",children:"Complete European coverage"}),c.jsx("h3",{className:"mt-3 font-serif text-3xl md:text-4xl",children:"Pan-Europe 2026"}),c.jsxs("p",{className:"mt-3 text-lg",children:[r," country markets in one intelligence package"]}
690),c.jsx("p",{className:"mt-5 text-sm text-primary-foreground/80",children:"Every European country report, plus regional tools for comparing markets and operators."}),c.jsx(oe,{asChild:!0,className:"mt-7",children:c.jsxs(rt,{to:`/reports/${e.slug}`,target:"_blank",rel:"noopener noreferrer",children:["Explore Pan-Europe",c.jsx(Jn,{"aria-hidden":"true",className:"ml-2 size-4"})]})})]}),c.jsx("ul",{className:"grid gap-x-5 gap-y-4 self-center sm:grid-cols-2","aria-label":"Package inclusions",children:tSe.filter(i=>!i.includes("Power BI")||e.includes_powerbi).filter(i=>!i.includes("Excel")||e.includes_excel).map(i=>c.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[c.jsx(oa,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0 text-accent"}),i]},i))})]}),s.length>0&&c.jsx("div",{className:"mt-5 grid gap-5 md:grid-cols-2",children:s.map(({region:i,name:a,countries:o,report:l})=>l&&c.jsxs("article",{className:"border border-border bg-card p-6",children:[c.jsxs("h3",{className:"font-serif text-2xl text-foreground",children:[a," 2026"]}),c.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[n(o)," country markets in one regional package."]}),c.jsxs("p",{className:"mt-4 flex flex-wrap gap-x-4 gap-y-2 text-sm text-foreground",children:[c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(ky,{className:"size-4 text-accent"})," Excel database"]}),l.includes_powerbi&&c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx(lE,{className:"size-4 text-accent"})," Power BI"]})]}),c.jsxs(rt,{to:`/reports/${l.slug}`,target:"_blank",rel:"noopener noreferrer",className:"mt-6 inline-flex items-center gap-1 text-sm font-semibold text-primary hover:text-accent",children:["Explore ",a,c.jsx(Jn,{"aria-hidden":"true",className:"size-4"})]})]},i))})]})}function lD(){const{count:t}=B0();return c.jsxs(rt,{to:"/reports/cart",target:"_blank",rel:"noopener noreferrer",className:"fixed bottom-6 right-6 z-40 inline-flex items-center gap-2 rounded-full bg-primary px-5 py-3 text-primary-foreground shadow-elegant transition-transform hover:scale-105 md:bottom-8 md:right-8","aria-label":`Basket, ${t} item${t===1?"":"s"}`,children:[c.jsx(mR,{className:"size-5"}),c.jsx("span",{className:"hidden sm:inline text-sm font-semibold",children:"Basket"}),c.jsx(SV,{children:t>0&&c.jsx(xt.span,{initial:{scale:.5,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.5,opacity:0},className:"inline-flex min-w-[22px] items-center justify-center rounded-full bg-accent px-1.5 py-0.5 text-xs font-bold text-accent-foreground",children:t},t)})]})}
690const sSe="pk_live_51MwpTSC5PotsabW2GawHuGlOIf354mHIGPsEVs6wkfTpAugYnButa8gAQY55WJJrydzg4tD39O5Baj6rNb9GMfiP00Teh5SC9t";function cD(){return sSe.startsWith("pk_test_")?c.jsx("div",{className:"w-full bg-orange-100 border-b border-orange-300 px-4 py-2 text-center text-sm text-orange-800",children:"All payments made in the preview are in test mode. Use card 4242 4242 4242 4242 to test checkout."}):null}const U9="zg_sample_access",iSe="https://waterdispenseinsights.com/reports",aSe="https://waterdispenseinsights.com/intelligence",oSe="https://www.linkedin.com/in/akospetri/";function z9(){try{return localStorage.getItem(U9)==="granted"}catch{return!1}}function lSe(){try{localStorage.setItem(U9,"granted")}catch{}}const cSe=cp({name:Pn().trim().min(2,"Please enter your full name").max(100),email:Pn().trim().email("Please enter a valid business email").max(255),company:Pn().trim().min(2,"Please enter your company name").max(200)});function V9({open:t,onOpenChange:e,onGranted:n,sampleLabel:r}){const[s,i]=k.useState({name:"",email:"",company:""}),[a,o]=k.useState(!1),l=async u=>{var f,p;u.preventDefault();const d=cSe.safeParse(s);if(!d.success){te.error("Please check your details",{description:d.error.errors[0].message});return}o(!0);try{const{data:m,error:y}=await ce.functions.invoke("register-demo",{body:{name:s.name,email:s.email,company:s.company,newsletter:!0,source:"sample"}});if(y){if((f=y.message)!=null&&f.includes("Rate limit")){te.error("Too many requests",{description:"Please try again in an hour."});return}throw y}if(!(m!=null&&m.success))throw new Error((m==null?void 0:m.error)||"Registration failed");const g=((p=m.data)==null?void 0:p.id)??crypto.randomUUID(),b=s.name.trim().split(" ")[0]||s.name.trim();ce.functions.invoke("send-transactional-email",{body:{templateName:"report-sample-access",recipientEmail:s.email.trim().toLowerCase(),idempotencyKey:`sample-access-${g}`,templateData:{name:b,reportsUrl:iSe,intelligenceUrl:aSe,linkedinUrl:oSe}}}).catch(x=>console.error("Sample welcome email failed:",x)),ce.functions.invoke("send-transactional-email",{body:{templateName:"report-sample-admin",recipientEmail:"[email protected]",idempotencyKey:`sample-admin-${g}`,templateData:{name:s.name.trim(),email:s.email.trim().toLowerCase(),company:s.company.trim(),sample:r??"Report sample"}}}).catch(x=>console.error("Sample admin notification failed:",x)),lSe(),te.success("Access unlocked",{description:"We've also emailed you the details."}),i({name:"",email:"",company:""}),e(!1),n()}catch(m){console.error(m),te.error("Something went wrong",{description:"Please try again or email [email protected]."})}finally{o(!1)}};return c.jsx(md,{open:t,onOpenChange:e,children:c.jsxs(yc,{className:"sm:max-w-md",children:[c.jsxs(gd,{children:[c.jsx(yd,{className:"font-serif text-2xl",children:"Get the free sample"}),c.jsx(Xf,{children:"Tell us who you are and the sample opens straight away. We'll email you the links too."})]}),c.jsxs("form",{onSubmit:l,className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"sample-name",className:"font-semibold",children:"Full Name *"}),c.jsx(Ue,{id:"sample-name",required:!0,placeholder:"John Smith",value:s.name,onChange:u=>i({...s,name:u.target.value}),className:"mt-2"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"sample-email",className:"font-semibold",children:"Business Email *"}),c.jsx(Ue,{id:"sample-email",type:"email",required:!0,placeholder:"[email protected]",value:s.email,onChange:u=>i({...s,email:u.target.value}),className:"mt-2"})]}),c.jsxs("div",{children:[c.jsx(Se,{htmlFor:"sample-company",className:"font-semibold",children:"Company Name *"}),c.jsx(Ue,{id:"sample-company",required:!0,placeholder:"Your Company Ltd.",value:s.company,onChange:u=>i({...s,company:u.target.value}),className:"mt-2"})]}),c.jsxs(oe,{type:"submit",size:"lg",variant:"cta",className:"w-full",disabled:a,children:[c.jsx(S0,{className:"mr-2 size-4"}),a?"Unlocking...":"Unlock the sample"]}),c.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["By submitting, you agree to our"," ",c.jsx("a",{href:"https://www.zenithglobalcommercial.com/legal",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Privacy Policy"}),"."]})]})]})})}const uSe=["all","pan-europe","west-europe","east-europe","west-markets","east-markets","country","data","usa","japan","south-korea","uae","turkey"],dSe={all:"All reports","pan-europe":"Pan-European bundle","west-europe":"West Europe bundle","east-europe":"East Europe bundle","west-markets":"West European markets","east-markets":"East European markets",country:"Country reports",data:"Data reports",usa:"USA",japan:"Japan","south-korea":"South Korea",uae:"UAE",turkey:"Turkey"};function hSe(){const{reports:t,isLoading:e}=qE({published:!0}),[n,r]=k.useState("all"),[s,i]=k.useState(!1),[a,o]=k.useState(null),l=(v,S)=>{if(z9()){window.open(v,"_blank","noopener,noreferrer");return}o({href:v,label:S}),i(!0)},u=v=>
690(v.region==="country"||v.region==="data")&&!!v.country&&xb.has(v.country),d=v=>(v.region==="country"||v.region==="data")&&!!v.country&&vb.has(v.country),f=k.useMemo(()=>{const v={all:t.length,"west-markets":0,"east-markets":0};for(const S of t)v[S.region]=(v[S.region]||0)+1,u(S)&&v["west-markets"]++,d(S)&&v["east-markets"]++;return v},[t]),p=uSe.map(v=>({id:v,label:dSe[v],count:f[v]||0}));n==="european-individual"&&p.splice(1,0,{id:n,label:"Individual European markets",count:(f.country||0)+(f.data||0)}),n==="international"&&p.splice(1,0,{id:n,label:"International markets",count:["usa","japan","south-korea","turkey","uae"].reduce((v,S)=>v+(f[S]||0),0)});const m=k.useMemo(()=>{const v=n==="all"?t:n==="european-individual"?t.filter(S=>S.region==="country"||S.region==="data"):n==="international"?t.filter(S=>["usa","japan","south-korea","turkey","uae"].includes(S.region)):n==="west-markets"?t.filter(u):n==="east-markets"?t.filter(d):t.filter(S=>S.region===n);return bb(v)},[t,n]),y=k.useMemo(()=>Array.from(new Set(t.map(v=>v.country).filter(Boolean))).sort((v,S)=>v.localeCompare(S)),[t]),g=k.useMemo(()=>y.filter(v=>xb.has(v)||vb.has(v)).length,[y]),b=g+new Set(t.filter(v=>["usa","japan","south-korea","turkey","uae"].includes(v.region)).map(v=>v.country||v.region)).size,x=k.useMemo(()=>Uke(y),[y]),w={"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://waterdispenseinsights.com/reports#webpage",name:"Water Dispenser Market Reports 2026",url:"https://waterdispenseinsights.com/reports",description:"Independent water dispenser market reports covering BWD, POU and integrated tap systems across Europe, the USA and global markets.",isPartOf:{"@type":"WebSite",name:"Water Dispense Insights",url:"https://waterdispenseinsights.com"},publisher:{"@type":"Organization",name:"Zenith Global Commercial",url:"https://waterdispenseinsights.com"}},{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://waterdispenseinsights.com/"},{"@type":"ListItem",position:2,name:"Reports",item:"https://waterdispenseinsights.com/reports"}]},{"@type":"ItemList",name:"Water dispenser market reports by country",itemListElement:bb(t).slice(0,100).map((v,S)=>({"@type":"ListItem",position:S+1,url:`https://waterdispenseinsights.com/reports/${v.slug}`,name:v.title}))},{"@type":"FAQPage",mainEntity:x.map(v=>({"@type":"Question",name:v.q,acceptedAnswer:{"@type":"Answer",text:v.a}}))}]};return c.jsxs(c.Fragment,{children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Water Dispenser Market Reports 2026 | Water Dispense Research | Zenith"}),c.jsx("meta",{name:"description",content:"Independent water dispenser market reports covering BWD, POU and integrated tap systems across Europe, the USA and global markets. Market size, installed base, revenues, forecasts and competitor data from Zenith Global."}),c.jsx("link",{rel:"canonical",href:"https://waterdispenseinsights.com/reports"}),c.jsx("meta",{property:"og:title",content:"Water Dispenser Market Reports 2026 | Water Dispense Research | Zenith"}),c.jsx("meta",{property:"og:description",content:"Independent water dispenser market reports covering BWD, POU and integrated tap systems across Europe, the USA and global markets. Market size, installed base, revenues, forecasts and competitor data from Zenith Global."}),c.jsx("meta",{property:"og:url",content:"https://waterdispenseinsights.com/reports"}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify(w)})]}),c.jsx(cD,{}),c.jsxs("main",{className:"min-h-screen bg-background",children:[c.jsx(Rke,{marketsCovered:e?null:b}),c.jsx("div",{className:"container mx-auto px-6 pt-14 pb-2",children:c.jsx(JW,{})}),c.jsxs("section",{className:"container mx-auto px-6 pt-16 pb-16",children:[c.jsx(Qke,{}),c.jsx(eSe,{onChoose:r}),c.jsx(rSe,{reports:t}),c.jsx(Wke,{reports:t}),c.jsx(qke,{}),c.jsx("div",{className:"mb-10 max-w-4xl",children:c.jsx(IE,{variant:"muted"})}),c.jsx(Oke,{europeanMarkets:g,totalReports:t.length}),c.jsx(Fke,{}),c.jsxs("section",{"aria-labelledby":"regional-hubs-heading",className:"mb-20",children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-accent",children:"Regions"}),c.jsx("h2",{id:"regional-hubs-heading",className:"mt-2 font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Regional Water Dispenser Market Research"}),c.jsx("div",{className:"mt-3 h-px w-16 bg-accent"}),c.jsx("p",{className:"mt-5 max-w-3xl text-base leading-relaxed text-muted-foreground",children:"Regional hubs bring together the market data, operators and country reports for each region, from the European water dispenser market to the USA and Asia-Pacific & Middle East."}),c.jsx("div",{className:"mt-8 grid gap-4 sm:grid-cols-3",children:_b.map(v=>c.jsxs(rt,{to:`/${v.slug}`,className:"group relative overflow-hidden rounded-2xl border border-border/60 bg-card p-6 shadow-sm transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-elegant",children:[c.jsx("span",{"aria-hidden":!0,
690className:"absolute inset-x-0 top-0 h-1 bg-accent/70"}),c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-accent",children:"Market hub"}),c.jsx("p",{className:"mt-2 font-serif text-lg text-foreground group-hover:text-primary",children:v.h1}),c.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[v.stats[0].value," · market data, reports and latest intelligence"]}),c.jsxs("span",{className:"mt-4 inline-flex items-center gap-1 text-xs font-semibold text-primary group-hover:text-accent",children:["Explore hub ",c.jsx(Jn,{className:"size-3.5"})]})]},v.id))}),c.jsxs("p",{className:"mt-5 text-sm leading-relaxed text-muted-foreground",children:["Within Europe you can also filter the catalogue below to the"," ",c.jsx("button",{type:"button",onClick:()=>r("west-markets"),className:"font-semibold text-primary underline underline-offset-4 hover:text-accent",children:"Western Europe water dispenser market"})," ","or the"," ",c.jsx("button",{type:"button",onClick:()=>r("east-markets"),className:"font-semibold text-primary underline underline-offset-4 hover:text-accent",children:"Eastern Europe water dispenser market"}),", and follow the latest analysis in the"," ",c.jsx(rt,{to:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-primary underline underline-offset-4 hover:text-accent",children:"water dispense intelligence hub"}),"."]})]}),c.jsx("div",{id:"report-samples",className:"mb-14 grid scroll-mt-24 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[{label:"Country report sample",desc:"See how a full written country report is structured.",href:CH},{label:"Data report sample",desc:"Preview the depth of our Excel-driven data reports.",href:AH},{label:"USA report sample",desc:"Preview the USA Water Dispense Market Report.",href:TH}].map(v=>c.jsxs("button",{type:"button",onClick:()=>l(v.href,v.label),className:"group flex items-center justify-between gap-4 rounded-2xl border border-border/60 bg-card p-5 text-left shadow-sm transition-colors hover:border-primary/40",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"rounded-lg bg-accent/15 p-2 text-accent",children:c.jsx(ds,{className:"size-5"})}),c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-accent",children:"Free sample PDF"}),c.jsx("p",{className:"mt-1 font-serif text-lg text-foreground group-hover:text-primary",children:v.label}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:v.desc})]})]}),c.jsx("span",{className:"shrink-0 rounded-full bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground group-hover:bg-primary/90",children:"Download"})]},v.label))}),c.jsx(V9,{open:s,onOpenChange:i,onGranted:()=>{a&&window.open(a.href,"_blank","noopener,noreferrer")},sampleLabel:a==null?void 0:a.label}),c.jsxs("div",{className:"mb-6 scroll-mt-24",id:"country-reports",children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-accent",children:"The catalogue"}),c.jsx("h2",{className:"mt-2 font-serif text-3xl leading-tight text-foreground md:text-4xl",children:"Choose the Market You Need."}),c.jsx("div",{className:"mt-3 h-px w-16 bg-accent"}),c.jsx("p",{className:"mt-5 max-w-3xl text-base leading-relaxed text-muted-foreground",children:"Get detailed market size, competitor, pricing and forecast data for individual countries or compare markets across regions."})]}),c.jsx($9,{className:"mb-10"}),c.jsx(Ike,{value:n,onChange:r,options:p}),e?c.jsx("div",{className:"flex justify-center py-24",children:c.jsx(ap,{className:"size-6 animate-spin text-muted-foreground"})}):m.length===0?c.jsxs(xt.div,{initial:{opacity:0}
690,animate:{opacity:1},className:"rounded-2xl border border-dashed border-border py-20 text-center",children:[c.jsx("p",{className:"text-lg font-serif text-muted-foreground",children:"No published reports in this region yet."}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground/80",children:"Reports appear here once published in the admin."})]}):c.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:m.map(v=>c.jsx(O9,{report:v},v.id))}),c.jsx("div",{className:"mt-16",children:c.jsx(B9,{})}),c.jsxs("div",{className:"mt-16",children:[c.jsx(Mke,{}),c.jsx($ke,{}),c.jsx(zke,{items:x})]})]}),c.jsx(F9,{}),c.jsx(Cc,{})]}),c.jsx(lD,{})]})}const ls=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),ON=[.001,0,0,.001,0,0],QA=1.35,wi={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},qo={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Eb="pdfjs_internal_editor_",$e={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},ot={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},W9={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},yr={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},Ov={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},En={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},Lp={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},$0={ERRORS:0,WARNINGS:1,INFOS:5},Oy={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},F1={moveTo:0,lineTo:1,curveTo:2,closePath:3},H9={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let GE=$0.WARNINGS;function fSe(t){Number.isInteger(t)&&(GE=t)}function pSe(){return GE}function KE(t){GE>=$0.INFOS&&console.info(`Info: ${t}`)}function ze(t){GE>=$0.WARNINGS&&console.warn(`Warning: ${t}`)}function Lt(t){throw new Error(t)}function lt(t,e){t||Lt(e)}function mSe(t){switch(t==null?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function uD(t,e=null,n=null){if(!t)return null;if(n&&typeof t=="string"){if(n.addDefaultProtocol&&t.startsWith("www.")){const s=t.match(/\./g);(s==null?void 0:s.length)>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{t=bSe(t)}catch{}}const r=e?URL.parse(t,e):URL.parse(t);return mSe(r)?r:null}function dD(t,e,n=!1){const r=URL.parse(t);return r?(r.hash=e,r.href):n&&uD(t,"http://example.com")?t.split("#",1)[0]+`${e?`#${e}`:""}`:""}function Qe(t,e,n,r=!1){return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const dp=function(){function e(n,r){this.message=n,this.name=r}return e.prototype=new Error,e.constructor=e,e}();class M3 extends dp{constructor(e,n){super(e,"PasswordException"),this.code=n}}class JA extends dp{constructor(e,n){super(e,"UnknownErrorException"),this.details=n}}class d_ extends dp{constructor(e){super(e,"InvalidPDFException")}}class Cb extends dp{constructor(e,n,r){super(e,"ResponseException"),this.status=n,this.missing=r}}class gSe extends dp{constructor(e){super(e,"FormatError")}}class vc extends dp{constructor(e){super(e,"AbortException")}}function q9(t){(typeof t!="object"||(t==null?void 0:t.length)===void 0)&&Lt("Invalid argument for bytesToString");const e=t.length,n=8192;if(e<n)return String.fromCharCode.apply(null,t);const r=[];for(let s=0;s<e;s+=n){const i=Math.min(s+n,e),a=t.subarray(s,i);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function U0(t){typeof t!="string"&&Lt("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 ySe(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function xSe(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function vSe(){try{return new Function(""),!0}catch{return!1}}class hr{static get isLittleEndian(){return Qe(this,"isLittleEndian",xSe()
690)}static get isEvalSupported(){return Qe(this,"isEvalSupported",vSe())}static get isOffscreenCanvasSupported(){return Qe(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Qe(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:e,userAgent:n}=navigator;return Qe(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 Qe(this,"isCSSRoundSupported",(n=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:n.call(e,"width: round(1.5px, 1px)"))}}const eT=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));var ac,Ek,LN;class pe{static makeHexColor(e,n,r){return`#${eT[e]}${eT[n]}${eT[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 s=e[r],i=e[r+1];e[r]=s*n[0]+i*n[2]+n[4],e[r+1]=s*n[1]+i*n[3]+n[5]}static applyTransformToBezier(e,n,r=0){const s=n[0],i=n[1],a=n[2],o=n[3],l=n[4],u=n[5];for(let d=0;d<6;d+=2){const f=e[r+d],p=e[r+d+1];e[r+d]=f*s+p*a+l,e[r+d+1]=f*i+p*o+u}}static applyInverseTransform(e,n){const r=e[0],s=e[1],i=n[0]*n[3]-n[1]*n[2];e[0]=(r*n[3]-s*n[2]+n[2]*n[5]-n[4]*n[3])/i,e[1]=(-r*n[1]+s*n[0]+n[4]*n[1]-n[5]*n[0])/i}static axialAlignedBoundingBox(e,n,r){const s=n[0],i=n[1],a=n[2],o=n[3],l=n[4],u=n[5],d=e[0],f=e[1],p=e[2],m=e[3];let y=s*d+l,g=y,b=s*p+l,x=b,w=o*f+u,v=w,S=o*m+u,E=S;if(i!==0||a!==0){const C=i*d,T=i*p,P=a*f,M=a*m;y+=P,x+=P,b+=M,g+=M,w+=C,E+=C,S+=T,v+=T}r[0]=Math.min(r[0],y,b,g,x),r[1]=Math.min(r[1],w,S,v,E),r[2]=Math.max(r[2],y,b,g,x),r[3]=Math.max(r[3],w,S,v,E)}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],s=e[1],i=e[2],a=e[3],o=r**2+s**2,l=r*i+s*a,u=i**2+a**2,d=(o+u)/2,f=Math.sqrt(d**2-(o*u-l**2));n[0]=Math.sqrt(d+f||1),n[1]=Math.sqrt(d-f||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])),s=Math.min(Math.max(e[0],e[2]),Math.max(n[0],n[2]));if(r>s)return null;const i=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 i>a?null:[r,i,s,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,s,i){i[0]=Math.min(i[0],e,r),i[1]=Math.min(i[1],n,s),i[2]=Math.max(i[2],e,r),i[3]=Math.max(i[3],n,s)}static bezierBoundingBox(e,n,r,s,i,a,o,l,u){u[0]=Math.min(u[0],e,o),u[1]=Math.min(u[1],n,l),u[2]=Math.max(u[2],e,o),u[3]=Math.max(u[3],n,l),j(this,ac,LN).call(this,e,r,i,o,n,s,a,l,3*(-e+3*(r-i)+o),6*(e-2*r+i),3*(r-e),u),j(this,ac,LN).call(this,e,r,i,o,n,s,a,l,3*(-n+3*(s-a)+l),6*(n-2*s+a),3*(s-n),u)}}ac=new WeakSet,Ek=function(e,n,r,s,i,a,o,l,u,d){if(u<=0||u>=1)return;const f=1-u,p=u*u,m=p*u,y=f*(f*(f*e+3*u*n)+3*p*r)+m*s,g=f*(f*(f*i+3*u*a)+3*p*o)+m*l;d[0]=Math.min(d[0],y),d[1]=Math.min(d[1],g),d[2]=Math.max(d[2],y),d[3]=Math.max(d[3],g)},LN=function(e,n,r,s,i,a,o,l,u,d,f,p){if(Math.abs(u)<1e-12){Math.abs(d)>=1e-12&&j(this,ac,Ek).call(this,e,n,r,s,i,a,o,l,-f/d,p);return}const m=d**2-4*f*u;if(m<0)return;const y=Math.sqrt(m),g=2*u;j(this,ac,Ek).call(this,e,n,r,s,i,a,o,l,(-d+y)/g,p),j(this,ac,Ek).call(this,e,n,r,s,i,a,o,l,(-d-y)/g,p)},A(pe,ac);function bSe(t){return decodeURIComponent(escape(t))}let tT=null,O3=null;function G9(t){return tT||(tT=/([\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,O3=new Map([["ſt","ſt"]])),t.replaceAll(tT,(e,n,r)=>n?n.normalize("NFKC"):O3.get(r))}function hD(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),q9(t)}const fD="pdfjs_internal_id_";function wSe(t,e,n){if(!Array.isArray(n)||n.length<2)return!1;const[r,s,...i]=n;if(!t(r)&&!Number.isInteger(r)||!e(s))return!1;const a=i.length;let o=!0;switch(s.name){case"XYZ":if(a<2||a>3)return!1;break;case"Fit":case"FitB":return a===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(a>1)return!1;break;case"FitR":if(a!==4)return!1;o=!1;break;default:return!1}for(const l of i)if(!(typeof l=="number"||o&&l===null))return!1;return!0}function Wr(t,e,n){return Math.min(Math.max(t,e),n)}function K9(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(q9(t))}function kSe(t){return Uint8Array.fromBase64?Uint8Array.fromBase64(t):U0(atob(t))}typeof Promise.try!="function"&&(Promise.try=function(t,...e){return new Promise(n=>{n(t(...e))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(t){return t.reduce((e,n)=>e+n,0)});class Ab{static textContent(e){const n=[],r={items:n,styles:Object.create(null)};function s(i){var l;if(!i)return;let a=null;const o=i.name;if(o==="#text")a=i.value;
690else if(Ab.shouldBuildText(o))(l=i==null?void 0:i.attributes)!=null&&l.textContent?a=i.attributes.textContent:i.value&&(a=i.value);else return;if(a!==null&&n.push({str:a}),!!i.children)for(const u of i.children)s(u)}return s(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}class pD{static setupStorage(e,n,r,s,i){const a=s.getValue(n,{value:null});switch(r.name){case"textarea":if(a.value!==null&&(e.textContent=a.value),i==="print")break;e.addEventListener("input",o=>{s.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"),i==="print")break;e.addEventListener("change",o=>{s.setValue(n,{value:o.target.checked?o.target.getAttribute("xfaOn"):o.target.getAttribute("xfaOff")})})}else{if(a.value!==null&&e.setAttribute("value",a.value),i==="print")break;e.addEventListener("input",o=>{s.setValue(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:o.attributes.hasOwnProperty("selected")&&delete o.attributes.selected}e.addEventListener("input",o=>{const l=o.target.options,u=l.selectedIndex===-1?"":l[l.selectedIndex].value;s.setValue(n,{value:u})});break}}static setAttributes({html:e,element:n,storage:r=null,intent:s,linkService:i}){const{attributes:a}=n,o=e instanceof HTMLAnchorElement;a.type==="radio"&&(a.name=`${a.name}-${s}`);for(const[l,u]of Object.entries(a))if(u!=null)switch(l){case"class":u.length&&e.setAttribute(l,u.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",u);break;case"style":Object.assign(e.style,u);break;case"textContent":e.textContent=u;break;default:(!o||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,u)}o&&i.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,n,r)}static render(e){var f,p;const n=e.annotationStorage,r=e.linkService,s=e.xfaHtml,i=e.intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:i,linkService:r});const o=i!=="richText",l=e.div;if(l.append(a),e.viewport){const m=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=m}o&&l.setAttribute("class","xfaLayer xfaFont");const u=[];if(s.children.length===0){if(s.value){const m=document.createTextNode(s.value);a.append(m),o&&Ab.shouldBuildText(s.name)&&u.push(m)}return{textDivs:u}}const d=[[s,-1,a]];for(;d.length>0;){const[m,y,g]=d.at(-1);if(y+1===m.children.length){d.pop();continue}const b=m.children[++d.at(-1)[1]];if(b===null)continue;const{name:x}=b;if(x==="#text"){const v=document.createTextNode(b.value);u.push(v),g.append(v);continue}const w=(f=b==null?void 0:b.attributes)!=null&&f.xmlns?document.createElementNS(b.attributes.xmlns,x):document.createElement(x);if(g.append(w),b.attributes&&this.setAttributes({html:w,element:b,storage:n,intent:i,linkService:r}),((p=b.children)==null?void 0:p.length)>0)d.push([b,-1,w]);else if(b.value){const v=document.createTextNode(b.value);o&&Ab.shouldBuildText(x)&&u.push(v),w.append(v)}}for(const m of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))m.setAttribute("readOnly",!0);return{textDivs:u}}static update(e){const n=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=n,e.div.hidden=!1}}const fl="http://www.w3.org/2000/svg",oh=class oh{};Z(oh,"CSS",96),Z(oh,"PDF",72),Z(oh,"PDF_TO_CSS_UNITS",oh.CSS/oh.PDF);let bc=oh;async function rx(t,e="text"){if(Hx(t,document.baseURI)){const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);switch(e){case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"json":return n.json()}return n.text()}return new Promise((n,r)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(s.status===200||s.status===0){switch(e){case"arraybuffer":case"blob":case"json":n(s.response);return}n(s.responseText);return}r(new Error(s.statusText))}},s.send(null)})}class z0{constructor({viewBox:e,userUnit:n,scale:r,rotation:s,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=n,this.scale=r,this.rotation=s,this.offsetX=i,this.offsetY=a,r*=n;const l=(e[2]+e[0])/2,u=(e[3]+e[1])/2;let d,f,p,m;switch(s%=360,s<0&&(s+=360),s){case 180:d=-1,f=0,p=0,m=1;break;case 90:d=0,f=1,p=1,m=0;break;case 270:d=0,f=-1,p=-1,m=0;break;case 0:d=1,f=0,p=0,m=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(p=-p,m=-m);let y,g,b,x;d===0?(y=Math.abs(u-e[1])*r+i,g=Math.abs(l-e[0])*r+a,b=(e[3]-e[1])*r,x=(e[2]-e[0])*r):(y=Math.abs(l-e[0])*r+i,g=Math.abs(u-e[1])*r+a,b=(e[2]-e[0])*r,x=(e[3]-e[1])*r),this.transform=[d*r,f*r,p*r,m*r,y-d*r*l-p*r*u,g-f*r*l-m*r*u],this.width=b,this.height=x}get rawDims(){const e=this.viewBox;return Qe(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:s=this.offsetY,dontFlip:i=!1}={}){return new z0({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:n,offsetX:r,offsetY:s,dontFlip:i})}convertToViewportPoint(e,n){const r=[e,n];return pe.applyTransform(r,this.transform),r}convertToViewportRectangle(e){const n=[e[0],e[1]];pe.applyTransform(n,this.transform);const r=[e[2],e[3]];return pe.applyTransform(r,this.transform),[n[0],n[1],r[0],r[1]]}convertToPdfPoint(e,n){const r=[e,n];return pe.applyInverseTransform(r,this.transform),r}}class YE extends dp{constructor(e,n=0){super(e,"RenderingCancelledException"),this.extraDelay=n}}function V0(t){const e=t.length;let n=0;for(;n<e&&t[n].trim()==="";)n++;return t.substring(n,n+5).toLowerCase()==="data:"}function XE(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function Y9(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function X9(t,e="document.pdf"){if(typeof t!="string")return e;if(V0(t))return ze('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 s=o=>{try{let l=decodeURIComponent(o);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\.pdf$/i)?l:o):l}catch{return o}},i=/\.pdf$/i,a=r.pathname.split("/").at(-1);if(i.test(a))return s(a);if(r.searchParams.size>0){const o=Array.from(r.searchParams.values()).reverse();for(const u of o)if(i.test(u))return s(u);const l=Array.from(r.searchParams.keys()).reverse();for(const u of l)if(i.test(u))return s(u)}if(r.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(r.hash);if(l)return s(l[0])}return e}class L3{constructor(){Z(this,"started",Object.create(null));Z(this,"times",[])}time(e){e in this.started&&ze(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||ze(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let n=0;for(const{name:r}of this.times)n=Math.max(r.length,n);for(const{name:r,start:s,end:i}of this.times)e.push(`${r.padEnd(n)} ${i-s}ms
691`);return e.join("")}}function Hx(t,e){const n=e?URL.parse(t,e):URL.parse(t);return(n==null?void 0:n.protocol)==="http:"||(n==null?void 0:n.protocol)==="https:"}function Ii(t){t.preventDefault()}function ln(t){t.preventDefault(),t.stopPropagation()}function SSe(t){console.log("Deprecated API usage: "+t)}var Mb;class Tb{static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;
691h(this,Mb)||_(this,Mb,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const n=h(this,Mb).exec(e);if(!n)return null;const r=parseInt(n[1],10);let s=parseInt(n[2],10);s=s>=1&&s<=12?s-1:0;let i=parseInt(n[3],10);i=i>=1&&i<=31?i: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 u=n[7]||"Z";let d=parseInt(n[8],10);d=d>=0&&d<=23?d:0;let f=parseInt(n[9],10)||0;return f=f>=0&&f<=59?f:0,u==="-"?(a+=d,o+=f):u==="+"&&(a-=d,o-=f),new Date(Date.UTC(r,s,i,a,o,l))}}Mb=new WeakMap,A(Tb,Mb);function Z9(t,{scale:e=1,rotation:n=0}){const{width:r,height:s}=t.attributes.style,i=[0,0,parseInt(r),parseInt(s)];return new z0({viewBox:i,userUnit:1,scale:e,rotation:n})}function sx(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(ze(`Not a valid color format: "${t}"`),[0,0,0])}function _Se(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,sx(r))}e.remove()}function sn(t){const{a:e,b:n,c:r,d:s,e:i,f:a}=t.getTransform();return[e,n,r,s,i,a]}function uo(t){const{a:e,b:n,c:r,d:s,e:i,f:a}=t.getTransform().invertSelf();return[e,n,r,s,i,a]}function kd(t,e,n=!1,r=!0){if(e instanceof z0){const{pageWidth:s,pageHeight:i}=e.rawDims,{style:a}=t,o=hr.isCSSRoundSupported,l=`var(--total-scale-factor) * ${s}px`,u=`var(--total-scale-factor) * ${i}px`,d=o?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,f=o?`round(down, ${u}, var(--scale-round-y))`:`calc(${u})`;!n||e.rotation%180===0?(a.width=d,a.height=f):(a.width=f,a.height=d)}r&&t.setAttribute("data-main-rotation",e.rotation)}class so{constructor(){const{pixelRatio:e}=so;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,s,i=-1){let a=1/0,o=1/0,l=1/0;r=so.capPixels(r,i),r>0&&(a=Math.sqrt(r/(e*n))),s!==-1&&(o=s/e,l=s/n);const u=Math.min(a,o,l);return this.sx>u||this.sy>u?(this.sx=u,this.sy=u,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,n){if(n>=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 h_=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class ESe{static get isDarkMode(){var e;return Qe(this,"isDarkMode",!!((e=window==null?void 0:window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: dark)").matches))}}class Q9{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(),Qe(this,"commentForegroundColor",sx(r))}}function J9(t,e,n,r){r=Math.min(Math.max(r??1,0),1);const s=255*(1-r);return t=Math.round(t*r+s),e=Math.round(e*r+s),n=Math.round(n*r+s),[t,e,n]}function F3(t,e){const n=t[0]/255,r=t[1]/255,s=t[2]/255,i=Math.max(n,r,s),a=Math.min(n,r,s),o=(i+a)/2;if(i===a)e[0]=e[1]=0;else{const l=i-a;switch(e[1]=o<.5?l/(i+a):l/(2-i-a),i){case n:e[0]=((r-s)/l+(r<s?6:0))*60;break;case r:e[0]=((s-n)/l+2)*60;break;case s:e[0]=((n-r)/l+4)*60;break}}e[2]=o}function FN(t,e){const n=t[0],r=t[1],s=t[2],i=(1-Math.abs(2*s-1))*r,a=i*(1-Math.abs(n/60%2-1)),o=s-i/2;switch(Math.floor(n/60)){case 0:e[0]=i+o,e[1]=a+o,e[2]=o;break;case 1:e[0]=a+o,e[1]=i+o,e[2]=o;break;case 2:e[0]=o,e[1]=i+o,e[2]=a+o;break;case 3:e[0]=o,e[1]=a+o,e[2]=i+o;break;case 4:e[0]=a+o,e[1]=o,e[2]=i+o;break;case 5:case 6:e[0]=i+o,e[1]=o,e[2]=a+o;break}}function B3(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function $3(t,e,n){FN(t,n),n.map(B3);const r=.2126*n[0]+.7152*n[1]+.0722*n[2];FN(e,n),n.map(B3);const s=.2126*n[0]+.7152*n[1]+.0722*n[2];return r>s?(r+.05)/(s+.05):(s+.05)/(r+.05)}const U3=new Map;function eq(t,e){const n=t[0]+t[1]*256+t[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776;let r=U3.get(n);if(r)return r;const s=new Float32Array(9),i=s.subarray(0,3),a=s.subarray(3,6);F3(t,a);const o=s.subarray(6,9);F3(e,o);const l=o[2]<.5,u=l?12:4.5;if(a[2]=l?Math.sqrt(a[2]):1-Math.sqrt(1-a[2]),$3(a,o,i)<u){let d,f;l?(d=a[2],f=1):(d=0,f=a[2]);const p=.005;for(;f-d>p;){const m=a[2]=(d+f)/2;l===$3(a,o,i)<u?d=m:f=m}a[2]=l?f:d}return FN(a,i),r=pe.makeHexColor(Math.round(i[0]*255),Math.round(i[1]*255),Math.round(i[2]*255
691)),U3.set(n,r),r}function mD({html:t,dir:e,className:n},r){const s=document.createDocumentFragment();if(typeof t=="string"){const i=document.createElement("p");i.dir=e||"auto";const a=t.split(/(?:\r\n?|\n)/);for(let o=0,l=a.length;o<l;++o){const u=a[o];i.append(document.createTextNode(u)),o<l-1&&i.append(document.createElement("br"))}s.append(i)}else pD.render({xfaHtml:t,div:s,intent:"richText"});s.firstChild.classList.add("richText",n),r.append(s)}var Zc,Qc,Wi,Hi,Ob,Jc,zm,Vm,Lb,S_,tq,Ar,nq,rq,Fp,qx;const xl=class xl{constructor(e){A(this,Ar);A(this,Zc,null);A(this,Qc,null);A(this,Wi);A(this,Hi,null);A(this,Ob,null);A(this,Jc,null);A(this,zm,null);A(this,Vm,null);_(this,Wi,e),h(xl,Lb)||_(xl,Lb,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=_(this,Zc,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const n=h(this,Wi)._uiManager._signal;n instanceof AbortSignal&&!n.aborted&&(e.addEventListener("contextmenu",Ii,{signal:n}),e.addEventListener("pointerdown",j(xl,S_,tq),{signal:n}));const r=_(this,Hi,document.createElement("div"));r.className="buttons",e.append(r);const s=h(this,Wi).toolbarPosition;if(s){const{style:i}=e,a=h(this,Wi)._uiManager.direction==="ltr"?1-s[0]:s[0];i.insetInlineEnd=`${100*a}%`,i.top=`calc(${100*s[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return h(this,Zc)}hide(){var e;h(this,Zc).classList.add("hidden"),(e=h(this,Qc))==null||e.hideDropdown()}show(){var e,n;h(this,Zc).classList.remove("hidden"),(e=h(this,Ob))==null||e.shown(),(n=h(this,Jc))==null||n.shown()}addDeleteButton(){const{editorType:e,_uiManager:n}=h(this,Wi),r=document.createElement("button");r.classList.add("basic","deleteButton"),r.tabIndex=0,r.setAttribute("data-l10n-id",h(xl,Lb)[e]),j(this,Ar,Fp).call(this,r)&&r.addEventListener("click",s=>{n.delete()},{signal:n._signal}),h(this,Hi).append(r)}async addAltText(e){const n=await e.render();j(this,Ar,Fp).call(this,n),h(this,Hi).append(n,h(this,Ar,qx)),_(this,Ob,e)}addComment(e,n=null){if(h(this,Jc))return;const r=e.renderForToolbar();if(!r)return;j(this,Ar,Fp).call(this,r);const s=_(this,zm,h(this,Ar,qx));n?(h(this,Hi).insertBefore(r,n),h(this,Hi).insertBefore(s,n)):h(this,Hi).append(r,s),_(this,Jc,e),e.toolbar=this}addColorPicker(e){if(h(this,Qc))return;_(this,Qc,e);const n=e.renderButton();j(this,Ar,Fp).call(this,n),h(this,Hi).append(n,h(this,Ar,qx))}async addEditSignatureButton(e){const n=_(this,Vm,await e.renderEditButton(h(this,Wi)));j(this,Ar,Fp).call(this,n),h(this,Hi).append(n,h(this,Ar,qx))}removeButton(e){var n,r;switch(e){case"comment":(n=h(this,Jc))==null||n.removeToolbarCommentButton(),_(this,Jc,null),(r=h(this,zm))==null||r.remove(),_(this,zm,null);break}}async addButton(e,n){switch(e){case"colorPicker":this.addColorPicker(n);break;case"altText":await this.addAltText(n);break;case"editSignature":await this.addEditSignatureButton(n);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(n);break}}async addButtonBefore(e,n,r){const s=h(this,Hi).querySelector(r);s&&e==="comment"&&this.addComment(n,s)}updateEditSignatureButton(e){h(this,Vm)&&(h(this,Vm).title=e)}remove(){var e;h(this,Zc).remove(),(e=h(this,Qc))==null||e.destroy(),_(this,Qc,null)}};Zc=new WeakMap,Qc=new WeakMap,Wi=new WeakMap,Hi=new WeakMap,Ob=new WeakMap,Jc=new WeakMap,zm=new WeakMap,Vm=new WeakMap,Lb=new WeakMap,S_=new WeakSet,tq=function(e){e.stopPropagation()},Ar=new WeakSet,nq=function(e){h(this,Wi)._focusEventsAllowed=!1,ln(e)},rq=function(e){h(this,Wi)._focusEventsAllowed=!0,ln(e)},Fp=function(e){const n=h(this,Wi)._uiManager._signal;return!(n instanceof AbortSignal)||n.aborted?!1:(e.addEventListener("focusin",j(this,Ar,nq).bind(this),{capture:!0,signal:n}),e.addEventListener("focusout",j(this,Ar,rq).bind(this),{capture:!0,signal:n}),e.addEventListener("contextmenu",Ii,{signal:n}),!0)},qx=function(){const e=document.createElement("div");return e.className="divider",e},A(xl,S_),A(xl,Lb,null);let BN=xl;var Fb,_h,kl,wc,sq,iq,$N;
691class CSe{constructor(e){A(this,wc);A(this,Fb,null);A(this,_h,null);A(this,kl);_(this,kl,e)}show(e,n,r){const[s,i]=j(this,wc,iq).call(this,n,r),{style:a}=h(this,_h)||_(this,_h,j(this,wc,sq).call(this));e.append(h(this,_h)),a.insetInlineEnd=`${100*s}%`,a.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){h(this,_h).remove()}}Fb=new WeakMap,_h=new WeakMap,kl=new WeakMap,wc=new WeakSet,sq=function(){const e=_(this,_h,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");const n=h(this,kl)._signal;n instanceof AbortSignal&&!n.aborted&&e.addEventListener("contextmenu",Ii,{signal:n});const r=_(this,Fb,document.createElement("div"));return r.className="buttons",e.append(r),h(this,kl).hasCommentManager()&&j(this,wc,$N).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{h(this,kl).commentSelection("floating_button")}),j(this,wc,$N).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{h(this,kl).highlightSelection("floating_button")}),e},iq=function(e,n){let r=0,s=0;for(const i of e){const a=i.y+i.height;if(a<r)continue;const o=i.x+(n?i.width:0);if(a>r){s=o,r=a;continue}n?o>s&&(s=o):o<s&&(s=o)}return[n?1-s:s,r]},$N=function(e,n,r,s){const i=document.createElement("button");i.classList.add("basic",e),i.tabIndex=0,i.setAttribute("data-l10n-id",n);const a=document.createElement("span");i.append(a),a.className="visuallyHidden",a.setAttribute("data-l10n-id",r);const o=h(this,kl)._signal;o instanceof AbortSignal&&!o.aborted&&(i.addEventListener("contextmenu",Ii,{signal:o}),i.addEventListener("click",s,{signal:o})),h(this,Fb).append(i)};function aq(t,e,n){for(const r of n)e.addEventListener(r,t[r].bind(t))}var __;class ASe{constructor(){A(this,__,0)}get id(){return`${Eb}${pn(this,__)._++}`}}__=new WeakMap;var Wm,Bb,Lr,Hm,Ck;const TD=class TD{constructor(){A(this,Hm);A(this,Wm,hD());A(this,Bb,0);A(this,Lr,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}),s=new Image;s.src=e;const i=s.decode().then(()=>(r.drawImage(s,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return Qe(this,"_isSVGFittingCanvas",i)}async getFromFile(e){const{lastModified:n,name:r,size:s,type:i}=e;return j(this,Hm,Ck).call(this,`${n}_${r}_${s}_${i}`,e)}async getFromUrl(e){return j(this,Hm,Ck).call(this,e,e)}async getFromBlob(e,n){const r=await n;return j(this,Hm,Ck).call(this,e,r)}async getFromId(e){h(this,Lr)||_(this,Lr,new Map);const n=h(this,Lr).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){h(this,Lr)||_(this,Lr,new Map);let r=h(this,Lr).get(e);if(r!=null&&r.bitmap)return r.refCounter+=1,r;const s=new OffscreenCanvas(n.width,n.height);return s.getContext("2d").drawImage(n,0,0),r={bitmap:s.transferToImageBitmap(),id:`image_${h(this,Wm)}_${pn(this,Bb)._++}`,refCounter:1,isSvg:!1},h(this,Lr).set(e,r),h(this,Lr).set(r.id,r),r}getSvgUrl(e){const n=h(this,Lr).get(e);return n!=null&&n.isSvg?n.svgUrl:null}deleteId(e){var s;h(this,Lr)||_(this,Lr,new Map);const n=h(this,Lr).get(e);if(!n||(n.refCounter-=1,n.refCounter!==0))return;const{bitmap:r}=n;if(!n.url&&!n.file){const i=new OffscreenCanvas(r.width,r.height);i.getContext("bitmaprenderer").transferFromImageBitmap(r),n.blobPromise=i.convertToBlob()}(s=r.close)==null||s.call(r),n.bitmap=null}isValidId(e){return e.startsWith(`image_${h(this,Wm)}_`)}};Wm=new WeakMap,Bb=new WeakMap,Lr=new WeakMap,Hm=new WeakSet,Ck=async function(e,n){h(this,Lr)||_(this,Lr,new Map);let r=h(this,Lr).get(e);if(r===null)return null;if(r!=null&&r.bitmap)return r.refCounter+=1,r;try{r||(r={bitmap:null,id:`image_${h(this,Wm)}_${pn(this,Bb)._++}`,refCounter:0,isSvg:!1});let s;if(typeof n=="string"?(r.url=n,s=await rx(n,"blob")):n instanceof File?s=r.file=n:n instanceof Blob&&(s=n),s.type==="image/svg+xml"){const i=TD._isSVGFittingCanvas,a=new FileReader,o=new Image,l=new Promise((u,d)=>{o.onload=()=>{r.bitmap=o,r.isSvg=!0,u()},a.onload=async()=>{const f=r.svgUrl=a.result;o.src=await i?`${f}#svgView(preserveAspectRatio(none))`:f},o.onerror=a.onerror=d});a.readAsDataURL(s),await l}else r.bitmap=await createImageBitmap(s);r.refCounter=1}catch(s){ze(s),r=null}return h(this,Lr).set(e,r),r&&h(this,Lr).set(r.id,r),r};let UN=TD;var An,eu,$b,rn;class TSe{constructor(e=128){A(this,An,[]);A(this,eu,!1);A(this,$b);A(this,rn,-1);_(this,$b,e)}add({cmd:e,undo:n,post:r,mustExec:s,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(s&&e(),h(this,eu))return;const l={cmd:e,undo:n,post:r,type:i};if(h(this,rn)===-1){h(this,An).length>0&&(h(this,An).length=0),_(this,rn,0),h(this,An).push(l);return}if(a&&h(this,An)[h(this,rn)].type===i){o&&(l.undo=h(this,An)[h(this,rn)].undo),h(this,An)[h(this,rn)]=l;return}const u=h(this,rn)+1;u===h(this,$b)?h(this,An).splice(0,1):(_(this,rn,u),u<h(this,An).length&&h(this,An).splice(u)),h(this,An).push(l)}undo(){if(h(this,rn)===-1)return;_(this,eu,!0);const{undo:e,post:n}=h(this,An)[h(this,rn)];e(),n==null||n(),_(this,eu,!1),_(this,rn,h(this,rn)-1)}redo(){if(h(this,rn)<h(this,An).length-1){_(this,rn,h(this,rn)+1),_(this,eu,!0);const{cmd:e,post:n}=h(this,An)[h(this,rn)];e(),n==null||n(),_(this,eu,!1)}}hasSomethingToUndo(){return h(this,rn)!==-1}hasSomethingToRedo(){return h(this,rn)<h(this,An).length-1}cleanType(e){if(h(this,rn)!==-1){for(let n=h(this,rn);n>=0;n--)if(h(this,An)[n].type!==e){h(this,An).splice(n+1,h(this,rn)-n),_(this,rn,n);return}h(this,An).length=0,_(this,rn,-1)}}destroy(){_(this,An,null)}}An=new WeakMap,eu=new WeakMap,$b=new WeakMap,rn=new WeakMap;var E_,oq;
691class W0{constructor(e){A(this,E_);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:n}=hr.platform;for(const[r,s,i={}]of e)for(const a of r){const o=a.startsWith("mac+");n&&o?(this.callbacks.set(a.slice(4),{callback:s,options:i}),this.allKeys.add(a.split("+").at(-1))):!n&&!o&&(this.callbacks.set(a,{callback:s,options:i}),this.allKeys.add(a.split("+").at(-1)))}}exec(e,n){if(!this.allKeys.has(n.key))return;const r=this.callbacks.get(j(this,E_,oq).call(this,n));if(!r)return;const{callback:s,options:{bubbles:i=!1,args:a=[],checker:o=null}}=r;o&&!o(e,n)||(s.bind(e,...a,n)(),i||ln(n))}}E_=new WeakSet,oq=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 C_=class C_{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return _Se(e),Qe(this,"_colors",e)}convert(e){const n=sx(e);if(!window.matchMedia("(forced-colors: active)").matches)return n;for(const[r,s]of this._colors)if(s.every((i,a)=>i===n[a]))return C_._colorsMapping.get(r);return n}getHexCode(e){const n=this._colors.get(e);return n?pe.makeHexColor(...n):e}};Z(C_,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let zN=C_;var qm,si,Gm,yn,Kn,Km,qi,Ym,Gi,Fr,tu,nu,Xm,ru,wo,Ki,Eh,Ub,zb,Zm,Vb,ko,su,Qm,iu,So,A_,au,Jm,Wb,ou,Ch,eg,lu,Hb,On,wt,Sl,cu,uu,qb,tg,Gb,du,_o,_l,Kb,Yb,Yi,le,Ak,VN,lq,cq,Gx,uq,dq,hq,WN,fq,HN,qN,pq,ts,pl,mq,gq,GN,yq,Kx,KN;const um=class um{constructor(e,n,r,s,i,a,o,l,u,d,f,p,m,y,g,b){A(this,le);A(this,qm,new AbortController);A(this,si,null);A(this,Gm,null);A(this,yn,new Map);A(this,Kn,new Map);A(this,Km,null);A(this,qi,null);A(this,Ym,null);A(this,Gi,new TSe);A(this,Fr,null);A(this,tu,null);A(this,nu,null);A(this,Xm,0);A(this,ru,new Set);A(this,wo,null);A(this,Ki,null);A(this,Eh,new Set);Z(this,"_editorUndoBar",null);A(this,Ub,!1);A(this,zb,!1);A(this,Zm,!1);A(this,Vb,null);A(this,ko,null);A(this,su,null);A(this,Qm,null);A(this,iu,!1);A(this,So,null);A(this,A_,new ASe);A(this,au,!1);A(this,Jm,!1);A(this,Wb,!1);A(this,ou,null);A(this,Ch,null);A(this,eg,null);A(this,lu,null);A(this,Hb,null);A(this,On,$e.NONE);A(this,wt,new Set);A(this,Sl,null);A(this,cu,null);A(this,uu,null);A(this,qb,null);A(this,tg,null);A(this,Gb,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});A(this,du,[0,0]);A(this,_o,null);A(this,_l,null);A(this,Kb,null);A(this,Yb,null);A(this,Yi,null);const x=this._signal=h(this,qm).signal;_(this,_l,e),_(this,Kb,n),_(this,Yb,r),_(this,Km,s),_(this,Fr,i),_(this,cu,a),_(this,tg,l),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:x}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:x}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:x}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:x}),o._on("setpreference",this.onSetPreference.bind(this),{signal:x}),o._on("switchannotationeditorparams",w=>this.updateParams(w.type,w.value),{signal:x}),window.addEventListener("pointerdown",()=>{_(this,Jm,!0)},{capture:!0,signal:x}),window.addEventListener("pointerup",()=>{_(this,Jm,!1)},{capture:!0,signal:x}),j(this,le,uq).call(this),j(this,le,pq).call(this),j(this,le,WN).call(this),_(this,qi,l.annotationStorage),_(this,Vb,l.filterFactory),_(this,uu,u),_(this,Qm,d||null),_(this,Ub,f),_(this,zb,p),_(this,Zm,m),_(this,Hb,y||null),this.viewParameters={realScale:bc.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=g||null,this._supportsPinchToZoom=b!==!1,i==null||i.setSidebarUiManager(this)}static get _keyboardManager(){const e=um.prototype,n=a=>h(a,_l).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},s=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return Qe(this,"_keyboardManager",new W0([[["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}
691],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&h(a,_l).contains(o)&&!a.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(a,{target:o})=>!(o instanceof HTMLButtonElement)&&h(a,_l).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-s,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:n}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[s,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:n}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-s],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:n}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,s],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:n}]]))}destroy(){var e,n,r,s,i,a,o,l,u;(e=h(this,Yi))==null||e.resolve(),_(this,Yi,null),(n=h(this,qm))==null||n.abort(),_(this,qm,null),this._signal=null;for(const d of h(this,Kn).values())d.destroy();h(this,Kn).clear(),h(this,yn).clear(),h(this,Eh).clear(),(r=h(this,lu))==null||r.clear(),_(this,si,null),h(this,wt).clear(),h(this,Gi).destroy(),(s=h(this,Km))==null||s.destroy(),(i=h(this,Fr))==null||i.destroy(),(a=h(this,cu))==null||a.destroy(),(o=h(this,So))==null||o.hide(),_(this,So,null),(l=h(this,eg))==null||l.destroy(),_(this,eg,null),_(this,Gm,null),h(this,ko)&&(clearTimeout(h(this,ko)),_(this,ko,null)),h(this,_o)&&(clearTimeout(h(this,_o)),_(this,_o,null)),(u=this._editorUndoBar)==null||u.destroy(),_(this,tg,null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return h(this,Hb)}get useNewAltTextFlow(){return h(this,zb)}get useNewAltTextWhenAddingImage(){return h(this,Zm)}get hcmFilter(){return Qe(this,"hcmFilter",h(this,uu)?h(this,Vb).addHCMFilter(h(this,uu).foreground,h(this,uu).background):"none")}get direction(){return Qe(this,"direction",getComputedStyle(h(this,_l)).direction)}get _highlightColors(){return Qe(this,"_highlightColors",h(this,Qm)?new Map(h(this,Qm).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 Qe(this,"highlightColors",null);const n=new Map,r=!!h(this,uu);for(const[s,i]of e){const a=s.endsWith("_HCM");if(r&&a){n.set(s.replace("_HCM",""),i);continue}!r&&!a&&n.set(s,i)}return Qe(this,"highlightColors",n)}get highlightColorNames(){return Qe(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),_(this,nu,e)}setMainHighlightColorPicker(e){_(this,eg,e)}editAltText(e,n=!1){var r;(r=h(this,Km))==null||r.editAltText(this,e,n)}hasCommentManager(){return!!h(this,Fr)}editComment(e,n,r,s){var i;(i=h(this,Fr))==null||i.showDialog(this,e,n,r,s)}selectComment(e,n){const r=h(this,Kn).get(e),s=r==null?void 0:r.getEditorByUID(n);s==null||s.toggleComment(!0,!0)}updateComment(e){var n;(n=h(this,Fr))==null||n.updateComment(e.getData())}updatePopupColor(e){var n;(n=h(this,Fr))==null||n.updatePopupColor(e)}removeComment(e){var n;(n=h(this,Fr))==null||n.removeComments([e.uid])}toggleComment(e,n,r=void 0){var s;(s=h(this,Fr))==null||s.toggleCommentPopup(e,n,r)}makeCommentColor(e,n){var r;return e&&((r=h(this,Fr))==null?void 0:r.makeCommentColor(e,n))||null}getCommentDialogElement(){var e;return((e=h(this,Fr))==null?void 0:e.dialogElement)||null}async waitForEditorsRendered(e){if(h(this,Kn).has(e-1))return;const{resolve:n,promise:r}=Promise.withResolvers(),s=i=>{i.pageNumber===e&&(this._eventBus._off("editorsrendered",s),n())};this._eventBus.on("editorsrendered",s),await r}getSignature(e){var n;(n=h(this,cu))==null||n.getSignature({uiManager:this,editor:e})}get signatureManager(){return h(this,cu)}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":_(this,Zm,n);break}}onPageChanging({pageNumber:e}){_(this,Xm,e-1)}focusMainContainer(){h(this,_l).focus()}findParent(e,n){for(const r of h(this,Kn).values()){const{x:s,y:i,width:a,height:o}=r.div.getBoundingClientRect();if(e>=s&&e<=s+a&&n>=i&&n<=i+o)return r}return null}disableUserSelect(e=!1){h(this,Kb).classList.toggle("noUserSelect",e)}addShouldRescale(e){h(this,Eh).add(e)}removeShouldRescale(e){h(this,Eh).delete(e)}onScaleChanging({scale:e}){var n;this.commitOrRemove(),this.viewParameters.realScale=e*bc.PDF_TO_CSS_UNITS;for(const r of h(this,Eh))r.onScaleChanging();(n=h(this,nu))==null||n.onScaleChanging()}
691onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e="",n=!1){const r=document.getSelection();if(!r||r.isCollapsed)return;const{anchorNode:s,anchorOffset:i,focusNode:a,focusOffset:o}=r,l=r.toString(),d=j(this,le,Ak).call(this,r).closest(".textLayer"),f=this.getSelectionBoxes(d);if(!f)return;r.empty();const p=j(this,le,VN).call(this,d),m=h(this,On)===$e.NONE,y=()=>{const g=p==null?void 0:p.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:f,anchorNode:s,anchorOffset:i,focusNode:a,focusOffset:o,text:l});m&&this.showAllEditors("highlight",!0,!0),n&&(g==null||g.editComment())};if(m){this.switchToMode($e.HIGHLIGHT,y);return}y()}commentSelection(e=""){this.highlightSelection(e,!0)}getAndRemoveDataFromAnnotationStorage(e){if(!h(this,qi))return null;const n=`${Eb}${e}`,r=h(this,qi).getRawValue(n);return r&&h(this,qi).remove(n),r}addToAnnotationStorage(e){!e.isEmpty()&&h(this,qi)&&!h(this,qi).has(e.id)&&h(this,qi).setValue(e.id,e)}a11yAlert(e,n=null){const r=h(this,Yb);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,h(this,iu)&&(_(this,iu,!1),j(this,le,Gx).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const n of h(this,wt))if(n.div.contains(e)){_(this,Ch,[n,e]),n._focusEventsAllowed=!1;break}}focus(){if(!h(this,Ch))return;const[e,n]=h(this,Ch);_(this,Ch,null),n.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),n.focus()}addEditListeners(){j(this,le,WN).call(this),j(this,le,HN).call(this)}removeEditListeners(){j(this,le,fq).call(this),j(this,le,qN).call(this)}dragOver(e){for(const{type:n}of e.dataTransfer.items)for(const r of h(this,Ki))if(r.isHandlingMimeForPasting(n)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const n of e.dataTransfer.items)for(const r of h(this,Ki))if(r.isHandlingMimeForPasting(n.type)){r.paste(n,this.currentLayer),e.preventDefault();return}}copy(e){var r;if(e.preventDefault(),(r=h(this,si))==null||r.commitOrRemove(),!this.hasSelection)return;const n=[];for(const s of h(this,wt)){const i=s.serialize(!0);i&&n.push(i)}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 i of n.items)for(const a of h(this,Ki))if(a.isHandlingMimeForPasting(i.type)){a.paste(i,this.currentLayer);return}let r=n.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(i){ze(`paste: "${i.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const s=this.currentLayer;try{const i=[];for(const l of r){const u=await s.deserialize(l);if(!u)return;i.push(u)}const a=()=>{for(const l of i)j(this,le,GN).call(this,l);j(this,le,KN).call(this,i)},o=()=>{for(const l of i)l.remove()};this.addCommands({cmd:a,undo:o,mustExec:!0})}catch(i){ze(`paste: "${i.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),h(this,On)!==$e.NONE&&!this.isEditorHandlingKeyboard&&um._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,h(this,iu)&&(_(this,iu,!1),j(this,le,Gx).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}setEditingState(e){e?(j(this,le,dq).call(this),j(this,le,HN).call(this),j(this,le,ts).call(this,{isEditing:h(this,On)!==$e.NONE,isEmpty:j(this,le,Kx).call(this),hasSomethingToUndo:h(this,Gi).hasSomethingToUndo(),hasSomethingToRedo:h(this,Gi).hasSomethingToRedo(),hasSelectedEditor:!1})):(j(this,le,hq).call(this),j(this,le,qN).call(this),j(this,le,ts).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!h(this,Ki)){_(this,Ki,e);for(const n of h(this,Ki))j(this,le,pl).call(this,n.defaultPropertiesToUpdate)}}getId(){return h(this,A_).id}get currentLayer(){return h(this,Kn).get(h(this,Xm))}getLayer(e){return h(this,Kn).get(e)}get currentPageIndex(){return h(this,Xm)}addLayer(e){h(this,Kn).set(e.pageIndex,e),h(this,au)?e.enable():e.disable()}removeLayer(e){h(this,Kn).delete(e.pageIndex)}async updateMode(e,n=null,r=!1,s=!1,i=!1){var a,o,l,u,d,f;if(h(this,On)!==e&&!(h(this,Yi)&&(await h(this,Yi).promise,!h(this,Yi)))){if(_(this,Yi,Promise.withResolvers()),(a=h(this,nu))==null||a.commitOrRemove(),h(this,On)===$e.POPUP&&((o=h(this,Fr))==null||o.hideSidebar()),(l=h(this,Fr))==null||l.destroyPopup(),_(this,On,e),e===$e.NONE){this.setEditingState(!1),j(this,le,gq).call(this);for(const p of h(this,yn).values())p.hideStandaloneCommentButton();(u=this._editorUndoBar)==null||u.hide(),this.toggleComment(null),h(this,Yi).resolve();return}for(const p of h(this,yn).values())p.addStandaloneCommentButton();e===$e.SIGNATURE&&await((d=h(this,cu))==null?void 0:d.loadSignatures()),this.setEditingState(!0),await j(this,le,mq).call(this),this.unselectAll();for(const p of h(this,Kn).values())p.updateMode(e);if(e===$e.POPUP){h(this,Gm)||_(this,Gm,await h(this,tg).getAnnotationsByType(new Set(h(this,Ki).map(y=>y._editorType))));const p=new Set,m=[];for(const y of h(this,yn).values()){const{annotationElementId:g,hasComment:b,deleted:x}=y;g&&p.add(g),b&&!x&&m.push(y.getData())}for(const y of h(this,Gm)){const{id:g,popupRef:b,contentsObj:x}=y;b&&(x!=null&&x.str)&&!p.has(g)&&!h(this,ru).has(g)&&m.push(y)}(f=h(this,Fr))==null||f.showSidebar(m)}if(!n){r&&this.addNewEditorFromKeyboard(),h(this,Yi).resolve();return}for(const p of h(this,yn).values())p.uid===n?(this.setSelected(p),i?p.editComment():s?p.enterInEditMode():p.focus()):p.unselect();h(this,Yi).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==h(this,On)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,n){if(h(this,Ki)){switch(e){case ot.CREATE:this.currentLayer.addNewEditor(n);return;case ot.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(h(this,qb)||_(this,qb,new Map)).set(e,n),this.showAllEditors("highlight",n);break}if(this.hasSelection)for(const r of h(this,wt))r.updateParams(e,n);else for(const r of h(this,Ki))r.updateDefaultParams(e,n)}}showAllEditors(e,n,r=!1){var i;for(const a of h(this,yn).values())a.editorType===e&&a.show(n);(((i=h(this,qb))==null?void 0:i.get(ot.HIGHLIGHT_SHOW_ALL))??!0)!==n&&j(this,le,pl).call(this,[[ot.HIGHLIGHT_SHOW_ALL,n]])}enableWaiting(e=!1){if(h(this,Wb)!==e){_(this,Wb,e);for(const n of h(this,Kn).values())e?n.disableClick():n.enableClick(),n.div.classList.toggle("waiting",e)}}*getEditors(e){for(const n of h(this,yn).values())n.pageIndex===e&&(yield n)}getEditor(e){return h(this,yn).get(e)}addEditor(e){h(this,yn).set(e.id,e)}removeEditor(e){var n,r;e.div.contains(document.activeElement)&&(h(this,ko)&&clearTimeout(h(this,ko)),_(this,ko,setTimeout(()=>{this.focusMainContainer(),_(this,ko,null)},0))),h(this,yn).delete(e.id),e.annotationElementId&&((n=h(this,lu))==null||n.delete(e.annotationElementId)),this.unselect(e),(!e.annotationElementId||!h(this,ru).has(e.annotationElementId))&&((r=h(this,qi))==null||r.remove(e.id))}addDeletedAnnotationElement(e){h(this,ru).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}
691isDeletedAnnotationElement(e){return h(this,ru).has(e)}removeDeletedAnnotationElement(e){h(this,ru).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){h(this,si)!==e&&(_(this,si,e),e&&j(this,le,pl).call(this,e.propertiesToUpdate))}updateUI(e){h(this,le,yq)===e&&j(this,le,pl).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){j(this,le,pl).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(h(this,wt).has(e)){h(this,wt).delete(e),e.unselect(),j(this,le,ts).call(this,{hasSelectedEditor:this.hasSelection});return}h(this,wt).add(e),e.select(),j(this,le,pl).call(this,e.propertiesToUpdate),j(this,le,ts).call(this,{hasSelectedEditor:!0})}setSelected(e){var n;this.updateToolbar({mode:e.mode,editId:e.id}),(n=h(this,nu))==null||n.commitOrRemove();for(const r of h(this,wt))r!==e&&r.unselect();h(this,wt).clear(),h(this,wt).add(e),e.select(),j(this,le,pl).call(this,e.propertiesToUpdate),j(this,le,ts).call(this,{hasSelectedEditor:!0})}isSelected(e){return h(this,wt).has(e)}get firstSelectedEditor(){return h(this,wt).values().next().value}unselect(e){e.unselect(),h(this,wt).delete(e),j(this,le,ts).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return h(this,wt).size!==0}get isEnterHandled(){return h(this,wt).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var e;h(this,Gi).undo(),j(this,le,ts).call(this,{hasSomethingToUndo:h(this,Gi).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:j(this,le,Kx).call(this)}),(e=this._editorUndoBar)==null||e.hide()}redo(){h(this,Gi).redo(),j(this,le,ts).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:h(this,Gi).hasSomethingToRedo(),isEmpty:j(this,le,Kx).call(this)})}addCommands(e){h(this,Gi).add(e),j(this,le,ts).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:j(this,le,Kx).call(this)})}cleanUndoStack(e){h(this,Gi).cleanType(e)}delete(){var i;this.commitOrRemove();const e=(i=this.currentLayer)==null?void 0:i.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const n=e?[e]:[...h(this,wt)],r=()=>{var a;(a=this._editorUndoBar)==null||a.show(s,n.length===1?n[0].editorType:n.length);for(const o of n)o.remove()},s=()=>{for(const a of n)j(this,le,GN).call(this,a)};this.addCommands({cmd:r,undo:s,mustExec:!0})}commitOrRemove(){var e;(e=h(this,si))==null||e.commitOrRemove()}hasSomethingToControl(){return h(this,si)||this.hasSelection}selectAll(){for(const e of h(this,wt))e.commit();j(this,le,KN).call(this,h(this,yn).values())}unselectAll(){var e;if(!(h(this,si)&&(h(this,si).commitOrRemove(),h(this,On)!==$e.NONE))&&!((e=h(this,nu))!=null&&e.commitOrRemove())&&this.hasSelection){for(const n of h(this,wt))n.unselect();h(this,wt).clear(),j(this,le,ts).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,n,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;h(this,du)[0]+=e,h(this,du)[1]+=n;const[s,i]=h(this,du),a=[...h(this,wt)],o=1e3;h(this,_o)&&clearTimeout(h(this,_o)),_(this,_o,setTimeout(()=>{_(this,_o,null),h(this,du)[0]=h(this,du)[1]=0,this.addCommands({cmd:()=>{for(const l of a)h(this,yn).has(l.id)&&(l.translateInPage(s,i),l.translationDone())},undo:()=>{for(const l of a)h(this,yn).has(l.id)&&(l.translateInPage(-s,-i),l.translationDone())},mustExec:!1})},o));for(const l of a)l.translateInPage(e,n),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),_(this,wo,new Map);for(const e of h(this,wt))h(this,wo).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!h(this,wo))return!1;this.disableUserSelect(!1);const e=h(this,wo);_(this,wo,null);let n=!1;for(const[{x:s,y:i,pageIndex:a},o]of e)o.newX=s,o.newY=i,o.newPageIndex=a,n||(n=s!==o.savedX||i!==o.savedY||a!==o.savedPageIndex);if(!n)return!1;const r=(s,i,a,o)=>{if(h(this,yn).has(s.id)){const l=h(this,Kn).get(o);l?s._setParentAndPosition(l,i,a):(s.pageIndex=o,s.x=i,s.y=a)}};return this.addCommands({cmd:()=>{for(const[s,{newX:i,newY:a,newPageIndex:o}]of e)r(s,i,a,o)},undo:()=>{for(const[s,{savedX:i,savedY:a,savedPageIndex:o}]of e)r(s,i,a,o)},mustExec:!0}),!0}dragSelectedEditors(e,n){if(h(this,wo))for(const r of h(this,wo).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())||h(this,wt).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return h(this,si)===e}getActive(){return h(this,si)}getMode(){return h(this,On)}isEditingMode(){return h(this,On)!==$e.NONE}get imageManager(){return Qe(this,"imageManager",new UN)}getSelectionBoxes(e){if(!e)return null;const n=document.getSelection();for(let u=0,d=n.rangeCount;u<d;u++)if(!e.contains(n.getRangeAt(u).commonAncestorContainer))return null;const{x:r,y:s,width:i,height:a}=e.getBoundingClientRect();let o;switch(e.getAttribute("data-main-rotation")){case"90":o=(u,d,f,p)=>({x:(d-s)/a,y:1-(u+f-r)/i,width:p/a,height:f/i});break;case"180":o=(u,d,f,p)=>({x:1-(u+f-r)/i,y:1-(d+p-s)/a,width:f/i,height:p/a});break;case"270":o=(u,d,f,p)=>({x:1-(d+p-s)/a,y:(u-r)/i,width:p/a,height:f/i});break;default:o=(u,d,f,p)=>({x:(u-r)/i,y:(d-s)/a,width:f/i,height:p/a});break}const l=[];for(let u=0,d=n.rangeCount;u<d;u++){const f=n.getRangeAt(u);if(!f.collapsed)for(const{x:p,y:m,width:y,height:g}of f.getClientRects())y===0||g===0||l.push(o(p,m,y,g))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:n}){(h(this,Ym)||_(this,Ym,new Map)).set(e,n)}removeChangedExistingAnnotation({annotationElementId:e}){var n;(n=h(this,Ym))==null||n.delete(e)}renderAnnotationElement(e){var s;const n=(s=h(this,Ym))==null?void 0:s.get(e.data.id);if(!n)return;const r=h(this,qi).getRawValue(n);r&&(h(this,On)===$e.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}setMissingCanvas(e,n,r){var i;const s=(i=h(this,lu))==null?void 0:i.get(e);s&&(s.setCanvas(n,r),h(this,lu).delete(e))}addMissingCanvas(e,n){(h(this,lu)||_(this,lu,new Map)).set(e,n)}};qm=new WeakMap,si=new WeakMap,Gm=new WeakMap,yn=new WeakMap,Kn=new WeakMap,Km=new WeakMap,qi=new WeakMap,Ym=new WeakMap,Gi=new WeakMap,Fr=new WeakMap,tu=ne
691w WeakMap,nu=new WeakMap,Xm=new WeakMap,ru=new WeakMap,wo=new WeakMap,Ki=new WeakMap,Eh=new WeakMap,Ub=new WeakMap,zb=new WeakMap,Zm=new WeakMap,Vb=new WeakMap,ko=new WeakMap,su=new WeakMap,Qm=new WeakMap,iu=new WeakMap,So=new WeakMap,A_=new WeakMap,au=new WeakMap,Jm=new WeakMap,Wb=new WeakMap,ou=new WeakMap,Ch=new WeakMap,eg=new WeakMap,lu=new WeakMap,Hb=new WeakMap,On=new WeakMap,wt=new WeakMap,Sl=new WeakMap,cu=new WeakMap,uu=new WeakMap,qb=new WeakMap,tg=new WeakMap,Gb=new WeakMap,du=new WeakMap,_o=new WeakMap,_l=new WeakMap,Kb=new WeakMap,Yb=new WeakMap,Yi=new WeakMap,le=new WeakSet,Ak=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},VN=function(e){const{currentLayer:n}=this;if(n.hasTextLayer(e))return n;for(const r of h(this,Kn).values())if(r.hasTextLayer(e))return r;return null},lq=function(){const e=document.getSelection();if(!e||e.isCollapsed)return;const r=j(this,le,Ak).call(this,e).closest(".textLayer"),s=this.getSelectionBoxes(r);s&&(h(this,So)||_(this,So,new CSe(this)),h(this,So).show(r,s,this.direction==="ltr"))},cq=function(){var i,a,o;const e=document.getSelection();if(!e||e.isCollapsed){h(this,Sl)&&((i=h(this,So))==null||i.hide(),_(this,Sl,null),j(this,le,ts).call(this,{hasSelectedText:!1}));return}const{anchorNode:n}=e;if(n===h(this,Sl))return;const s=j(this,le,Ak).call(this,e).closest(".textLayer");if(!s){h(this,Sl)&&((a=h(this,So))==null||a.hide(),_(this,Sl,null),j(this,le,ts).call(this,{hasSelectedText:!1}));return}if((o=h(this,So))==null||o.hide(),_(this,Sl,n),j(this,le,ts).call(this,{hasSelectedText:!0}),!(h(this,On)!==$e.HIGHLIGHT&&h(this,On)!==$e.NONE)&&(h(this,On)===$e.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),_(this,iu,this.isShiftKeyDown),!this.isShiftKeyDown)){const l=h(this,On)===$e.HIGHLIGHT?j(this,le,VN).call(this,s):null;if(l==null||l.toggleDrawing(),h(this,Jm)){const u=new AbortController,d=this.combinedSignal(u),f=p=>{p.type==="pointerup"&&p.button!==0||(u.abort(),l==null||l.toggleDrawing(!0),p.type==="pointerup"&&j(this,le,Gx).call(this,"main_toolbar"))};window.addEventListener("pointerup",f,{signal:d}),window.addEventListener("blur",f,{signal:d})}else l==null||l.toggleDrawing(!0),j(this,le,Gx).call(this,"main_toolbar")}},Gx=function(e=""){h(this,On)===$e.HIGHLIGHT?this.highlightSelection(e):h(this,Ub)&&j(this,le,lq).call(this)},uq=function(){document.addEventListener("selectionchange",j(this,le,cq).bind(this),{signal:this._signal})},dq=function(){if(h(this,su))return;_(this,su,new AbortController);const e=this.combinedSignal(h(this,su));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},hq=function(){var e;(e=h(this,su))==null||e.abort(),_(this,su,null)},WN=function(){if(h(this,ou))return;_(this,ou,new AbortController);const e=this.combinedSignal(h(this,ou));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},fq=function(){var e;(e=h(this,ou))==null||e.abort(),_(this,ou,null)},HN=function(){if(h(this,tu))return;_(this,tu,new AbortController);const e=this.combinedSignal(h(this,tu));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})},qN=function(){var e;(e=h(this,tu))==null||e.abort(),_(this,tu,null)},pq=function(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},ts=function(e){Object.entries(e).some(([r,s])=>h(this,Gb)[r]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(h(this,Gb),e)}),h(this,On)===$e.HIGHLIGHT&&e.hasSelectedEditor===!1&&j(this,le,pl).call(this,[[ot.HIGHLIGHT_FREE,!0]]))},pl=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},mq=async function(){if(!h(this,au)){_(this,au,!0);const e=[];for(const n of h(this,Kn).values())e.push(n.enable());await Promise.all(e);for(const n of h(this,yn).values())n.enable()}},gq=function(){if(this.unselectAll(),h(this,au)){_(this,au,!1);for(const e of h(this,Kn).values())e.disable();for(const e of h(this,yn).values())e.disable()}},GN=function(e){const n=h(this,Kn).get(e.pageIndex);n?n.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},yq=function(){let e=null;for(e of h(this,wt));return e},Kx=function(){if(h(this,yn).size===0)return!0;
691if(h(this,yn).size===1)for(const e of h(this,yn).values())return e.isEmpty();return!1},KN=function(e){for(const n of h(this,wt))n.unselect();h(this,wt).clear();for(const n of e)n.isEmpty()||(h(this,wt).add(n),n.select());j(this,le,ts).call(this,{hasSelectedEditor:this.hasSelection})},Z(um,"TRANSLATE_SMALL",1),Z(um,"TRANSLATE_BIG",10);let Sd=um;var rr,Eo,Da,ng,Co,ii,rg,Ao,Rs,El,Ah,To,hu,Xa,Yx,Tk;const rs=class rs{constructor(e){A(this,Xa);A(this,rr,null);A(this,Eo,!1);A(this,Da,null);A(this,ng,null);A(this,Co,null);A(this,ii,null);A(this,rg,!1);A(this,Ao,null);A(this,Rs,null);A(this,El,null);A(this,Ah,null);A(this,To,!1);_(this,Rs,e),_(this,To,e._uiManager.useNewAltTextFlow),h(rs,hu)||_(rs,hu,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){rs._l10n??(rs._l10n=e)}async render(){const e=_(this,Da,document.createElement("button"));e.className="altText",e.tabIndex="0";const n=_(this,ng,document.createElement("span"));e.append(n),h(this,To)?(e.classList.add("new"),e.setAttribute("data-l10n-id",h(rs,hu).missing),n.setAttribute("data-l10n-id",h(rs,hu)["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=h(this,Rs)._uiManager._signal;e.addEventListener("contextmenu",Ii,{signal:r}),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:r});const s=i=>{i.preventDefault(),h(this,Rs)._uiManager.editAltText(h(this,Rs)),h(this,To)&&h(this,Rs)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:h(this,Xa,Yx)}})};return e.addEventListener("click",s,{capture:!0,signal:r}),e.addEventListener("keydown",i=>{i.target===e&&i.key==="Enter"&&(_(this,rg,!0),s(i))},{signal:r}),await j(this,Xa,Tk).call(this),e}finish(){h(this,Da)&&(h(this,Da).focus({focusVisible:h(this,rg)}),_(this,rg,!1))}isEmpty(){return h(this,To)?h(this,rr)===null:!h(this,rr)&&!h(this,Eo)}hasData(){return h(this,To)?h(this,rr)!==null||!!h(this,El):this.isEmpty()}get guessedText(){return h(this,El)}async setGuessedText(e){h(this,rr)===null&&(_(this,El,e),_(this,Ah,await rs._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),j(this,Xa,Tk).call(this))}toggleAltTextBadge(e=!1){var n;if(!h(this,To)||h(this,rr)){(n=h(this,Ao))==null||n.remove(),_(this,Ao,null);return}if(!h(this,Ao)){const r=_(this,Ao,document.createElement("div"));r.className="noAltTextBadge",h(this,Rs).div.append(r)}h(this,Ao).classList.toggle("hidden",!e)}serialize(e){let n=h(this,rr);return!e&&h(this,El)===n&&(n=h(this,Ah)),{altText:n,decorative:h(this,Eo),guessedText:h(this,El),textWithDisclaimer:h(this,Ah)}}get data(){return{altText:h(this,rr),decorative:h(this,Eo)}}set data({altText:e,decorative:n,guessedText:r,textWithDisclaimer:s,cancel:i=!1}){r&&(_(this,El,r),_(this,Ah,s)),!(h(this,rr)===e&&h(this,Eo)===n)&&(i||(_(this,rr,e),_(this,Eo,n)),j(this,Xa,Tk).call(this))}toggle(e=!1){h(this,Da)&&(!e&&h(this,ii)&&(clearTimeout(h(this,ii)),_(this,ii,null)),h(this,Da).disabled=!e)}shown(){h(this,Rs)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:h(this,Xa,Yx)}})}destroy(){var e,n;(e=h(this,Da))==null||e.remove(),_(this,Da,null),_(this,ng,null),_(this,Co,null),(n=h(this,Ao))==null||n.remove(),_(this,Ao,null)}};rr=new WeakMap,Eo=new WeakMap,Da=new WeakMap,ng=new WeakMap,Co=new WeakMap,ii=new WeakMap,rg=new WeakMap,Ao=new WeakMap,Rs=new WeakMap,El=new WeakMap,Ah=new WeakMap,To=new WeakMap,hu=new WeakMap,Xa=new WeakSet,Yx=function(){return h(this,rr)&&"added"||h(this,rr)===null&&this.guessedText&&"review"||"missing"},Tk=async function(){var s,i,a;const e=h(this,Da);if(!e)return;if(h(this,To)){if(e.classList.toggle("done",!!h(this,rr)),e.setAttribute("data-l10n-id",h(rs,hu)[h(this,Xa,Yx)]),(s=h(this,ng))==null||s.setAttribute("data-l10n-id",h(rs,hu)[`${h(this,Xa,Yx)}
691-label`]),!h(this,rr)){(i=h(this,Co))==null||i.remove();return}}else{if(!h(this,rr)&&!h(this,Eo)){e.classList.remove("done"),(a=h(this,Co))==null||a.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let n=h(this,Co);if(!n){_(this,Co,n=document.createElement("span")),n.className="tooltip",n.setAttribute("role","tooltip"),n.id=`alt-text-tooltip-${h(this,Rs).id}`;const o=100,l=h(this,Rs)._uiManager._signal;l.addEventListener("abort",()=>{clearTimeout(h(this,ii)),_(this,ii,null)},{once:!0}),e.addEventListener("mouseenter",()=>{_(this,ii,setTimeout(()=>{_(this,ii,null),h(this,Co).classList.add("show"),h(this,Rs)._reportTelemetry({action:"alt_text_tooltip"})},o))},{signal:l}),e.addEventListener("mouseleave",()=>{var u;h(this,ii)&&(clearTimeout(h(this,ii)),_(this,ii,null)),(u=h(this,Co))==null||u.classList.remove("show")},{signal:l})}h(this,Eo)?n.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(n.removeAttribute("data-l10n-id"),n.textContent=h(this,rr)),n.parentNode||e.append(n);const r=h(this,Rs).getElementForAltText();r==null||r.setAttribute("aria-describedby",n.id)},A(rs,hu,null),Z(rs,"_l10n",null);let f_=rs;var xr,Xi,Th,Vt,Xb,jh,Ma,Nh,Ph,Rh,Zb,YN;class B1{constructor(e){A(this,Zb);A(this,xr,null);A(this,Xi,null);A(this,Th,!1);A(this,Vt,null);A(this,Xb,null);A(this,jh,null);A(this,Ma,null);A(this,Nh,null);A(this,Ph,!1);A(this,Rh,null);_(this,Vt,e)}renderForToolbar(){const e=_(this,Xi,document.createElement("button"));return e.className="comment",j(this,Zb,YN).call(this,e,!1)}renderForStandalone(){const e=_(this,xr,document.createElement("button"));e.className="annotationCommentButton";const n=h(this,Vt).commentButtonPosition;if(n){const{style:r}=e;r.insetInlineEnd=`calc(${100*(h(this,Vt)._uiManager.direction==="ltr"?1-n[0]:n[0])}% - var(--comment-button-dim))`,r.top=`calc(${100*n[1]}% - var(--comment-button-dim))`;const s=h(this,Vt).commentButtonColor;s&&(r.backgroundColor=s)}return j(this,Zb,YN).call(this,e,!0)}focusButton(){setTimeout(()=>{var e;(e=h(this,xr)??h(this,Xi))==null||e.focus()},0)}onUpdatedColor(){if(!h(this,xr))return;const e=h(this,Vt).commentButtonColor;e&&(h(this,xr).style.backgroundColor=e),h(this,Vt)._uiManager.updatePopupColor(h(this,Vt))}get commentButtonWidth(){var e;return(((e=h(this,xr))==null?void 0:e.getBoundingClientRect().width)??0)/h(this,Vt).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(h(this,Rh))return h(this,Rh);if(!h(this,xr))return null;const{x:e,y:n,height:r}=h(this,xr).getBoundingClientRect(),{x:s,y:i,width:a,height:o}=h(this,Vt).parent.boundingClientRect;return[(e-s)/a,(n+r-i)/o]}set commentPopupPositionInLayer(e){_(this,Rh,e)}hasDefaultPopupPosition(){return h(this,Rh)===null}removeStandaloneCommentButton(){var e;(e=h(this,xr))==null||e.remove(),_(this,xr,null)}removeToolbarCommentButton(){var e;(e=h(this,Xi))==null||e.remove(),_(this,Xi,null)}setCommentButtonStates({selected:e,hasPopup:n}){h(this,xr)&&(h(this,xr).classList.toggle("selected",e),h(this,xr).ariaExpanded=n)}edit(e){const n=this.commentPopupPositionInLayer;let r,s;if(n)[r,s]=n;else{[r,s]=h(this,Vt).commentButtonPosition;const{width:d,height:f,x:p,y:m}=h(this,Vt);r=p+r*d,s=m+s*f}const i=h(this,Vt).parent.boundingClientRect,{x:a,y:o,width:l,height:u}=i;h(this,Vt)._uiManager.editComment(h(this,Vt),a+r*l,o+s*u,{...e,parentDimensions:i})}finish(){h(this,Xi)&&(h(this,Xi).focus({focusVisible:h(this,Th)}),_(this,Th,!1))}isDeleted(){return h(this,Ph)||h(this,Ma)===""}isEmpty(){return h(this,Ma)===null}hasBeenEdited(){return this.isDeleted()||h(this,Ma)!==h(this,Xb)}serialize(){return this.data}get data(){return{text:h(this,Ma),richText:h(this,jh),date:h(this,Nh),deleted:this.isDeleted()}}set data(e){if(e!==h(this,Ma)&&_(this,jh,null),e===null){_(this,Ma,""),_(this,Ph,!0);return}_(this,Ma,e),_(this,Nh,new Date),_(this,Ph,!1)}setInitialText(e,n=null){_(this,Xb,e),this.data=e,_(this,Nh,null),_(this,jh,n)}shown(){}destroy(){var e,n;(e=h(this,Xi))==null||e.remove(),_(this,Xi,null),(n=h(this,xr))==null||n.remove(),_(this,xr,null),_(this,Ma,""),_(this,jh,null),_(this,Nh,null),_(this,Vt,null),_(this,Th,!1),_(this,Ph,!1)}}xr=new WeakMap,Xi=new WeakMap,Th=new WeakMap,Vt=new WeakMap,Xb=ne
691w WeakMap,jh=new WeakMap,Ma=new WeakMap,Nh=new WeakMap,Ph=new WeakMap,Rh=new WeakMap,Zb=new WeakSet,YN=function(e,n){if(!h(this,Vt)._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=[h(this,Vt)._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const r=h(this,Vt)._uiManager._signal;if(!(r instanceof AbortSignal)||r.aborted)return e;e.addEventListener("contextmenu",Ii,{signal:r}),n&&(e.addEventListener("focusin",i=>{h(this,Vt)._focusEventsAllowed=!1,ln(i)},{capture:!0,signal:r}),e.addEventListener("focusout",i=>{h(this,Vt)._focusEventsAllowed=!0,ln(i)},{capture:!0,signal:r})),e.addEventListener("pointerdown",i=>i.stopPropagation(),{signal:r});const s=i=>{i.preventDefault(),e===h(this,Xi)?this.edit():h(this,Vt).toggleComment(!0)};return e.addEventListener("click",s,{capture:!0,signal:r}),e.addEventListener("keydown",i=>{i.target===e&&i.key==="Enter"&&(_(this,Th,!0),s(i))},{signal:r}),e.addEventListener("pointerenter",()=>{h(this,Vt).toggleComment(!1,!0)},{signal:r}),e.addEventListener("pointerleave",()=>{h(this,Vt).toggleComment(!1,!1)},{signal:r}),e};var sg,Ih,Qb,Jb,ew,tw,nw,Cl,Dh,Al,Mh,Tl,_d,xq,vq,bq;const jD=class jD{constructor({container:e,isPinchingDisabled:n=null,isPinchingStopped:r=null,onPinchStart:s=null,onPinching:i=null,onPinchEnd:a=null,signal:o}){A(this,_d);A(this,sg);A(this,Ih,!1);A(this,Qb,null);A(this,Jb);A(this,ew);A(this,tw);A(this,nw);A(this,Cl,null);A(this,Dh);A(this,Al,null);A(this,Mh);A(this,Tl,null);_(this,sg,e),_(this,Qb,r),_(this,Jb,n),_(this,ew,s),_(this,tw,i),_(this,nw,a),_(this,Mh,new AbortController),_(this,Dh,AbortSignal.any([o,h(this,Mh).signal])),e.addEventListener("touchstart",j(this,_d,xq).bind(this),{passive:!1,signal:h(this,Dh)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/so.pixelRatio}destroy(){var e,n;(e=h(this,Mh))==null||e.abort(),_(this,Mh,null),(n=h(this,Cl))==null||n.abort(),_(this,Cl,null)}};sg=new WeakMap,Ih=new WeakMap,Qb=new WeakMap,Jb=new WeakMap,ew=new WeakMap,tw=new WeakMap,nw=new WeakMap,Cl=new WeakMap,Dh=new WeakMap,Al=new WeakMap,Mh=new WeakMap,Tl=new WeakMap,_d=new WeakSet,xq=function(e){var s,i,a;if((s=h(this,Jb))!=null&&s.call(this))return;if(e.touches.length===1){if(h(this,Cl))return;const o=_(this,Cl,new AbortController),l=AbortSignal.any([h(this,Dh),o.signal]),u=h(this,sg),d={capture:!0,signal:l,passive:!1},f=p=>{var m;p.pointerType==="touch"&&((m=h(this,Cl))==null||m.abort(),_(this,Cl,null))};u.addEventListener("pointerdown",p=>{p.pointerType==="touch"&&(ln(p),f(p))},d),u.addEventListener("pointerup",f,d),u.addEventListener("pointercancel",f,d);return}if(!h(this,Tl)){_(this,Tl,new AbortController);const o=AbortSignal.any([h(this,Dh),h(this,Tl).signal]),l=h(this,sg),u={signal:o,capture:!1,passive:!1};l.addEventListener("touchmove",j(this,_d,vq).bind(this),u);const d=j(this,_d,bq).bind(this);l.addEventListener("touchend",d,u),l.addEventListener("touchcancel",d,u),u.capture=!0,l.addEventListener("pointerdown",ln,u),l.addEventListener("pointermove",ln,u),l.addEventListener("pointercancel",ln,u),l.addEventListener("pointerup",ln,u),(i=h(this,ew))==null||i.call(this)}if(ln(e),e.touches.length!==2||(a=h(this,Qb))!=null&&a.call(this)){_(this,Al,null);return}let[n,r]=e.touches;n.identifier>r.identifier&&([n,r]=[r,n]),_(this,Al,{touch0X:n.screenX,touch0Y:n.screenY,touch1X:r.screenX,touch1Y:r.screenY})},vq=function(e){var S;if(!h(this,Al)||e.touches.length!==2)return;ln(e);let[n,r]=e.touches;n.identifier>r.identifier&&([n,r]=[r,n]);const{screenX:s,screenY:i}=n,{screenX:a,screenY:o}=r,l=h(this,Al),{touch0X:u,touch0Y:d,touch1X:f,touch1Y:p}=l,m=f-u,y=p-d,g=a-s,b=o-i,x=Math.hypot(g,b)||1,w=Math.hypot(m,y)||1;if(!h(this,Ih)&&Math.abs(w-x)<=jD.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=s,l.touch0Y=i,l.touch1X=a,l.touch1Y=o,!h(this,Ih)){_(this,Ih,!0);return}const v=[(s+a)/2,(i+o)/2];(S=h(this,tw))==null||S.call(this,v,w,x)},bq=function(e){var n;e.touches.length>=2||(h(this,Tl)&&(h(this,Tl).abort(),_(this,Tl,null),(n=h(this,nw))==null||n.call(this)),h(this,Al)&&(ln(e),_(this,Al,null),_(this,Ih,!1)))};let jb=jD;var Oh,Oa,en,Rt,jl,ig,fu,rw,vr,Lh,Nl,jo,pu,sw,Fh,ai,iw,Bh,Pl,No,ag,og,Zi,$h,aw,T_,Re,XN,ow,ZN,jk,wq,kq,QN,Nk,JN,Sq,_q,Eq,e2,Cq,t2,Aq,Tq,jq,n2,Xx;
691const He=class He{constructor(e){A(this,Re);A(this,Oh,null);A(this,Oa,null);A(this,en,null);A(this,Rt,null);A(this,jl,null);A(this,ig,!1);A(this,fu,null);A(this,rw,"");A(this,vr,null);A(this,Lh,null);A(this,Nl,null);A(this,jo,null);A(this,pu,null);A(this,sw,"");A(this,Fh,!1);A(this,ai,null);A(this,iw,!1);A(this,Bh,!1);A(this,Pl,!1);A(this,No,null);A(this,ag,0);A(this,og,0);A(this,Zi,null);A(this,$h,null);Z(this,"isSelected",!1);Z(this,"_isCopy",!1);Z(this,"_editToolbar",null);Z(this,"_initialOptions",Object.create(null));Z(this,"_initialData",null);Z(this,"_isVisible",!0);Z(this,"_uiManager",null);Z(this,"_focusEventsAllowed",!0);A(this,aw,!1);A(this,T_,He._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;const{rotation:n,rawDims:{pageWidth:r,pageHeight:s,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=n,this.pageRotation=(360+n-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,s],this.pageTranslation=[i,a];const[o,l]=this.parentDimensions;this.x=e.x/o,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=He.prototype._resizeWithKeyboard,n=Sd.TRANSLATE_SMALL,r=Sd.TRANSLATE_BIG;return Qe(this,"_resizerKeyboardManager",new W0([[["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"],He.prototype._stopResizingWithKeyboard]]))}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 Qe(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const n=new jSe({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});n.annotationElementId=e.annotationElementId,n.deleted=!0,n._uiManager.addToAnnotationStorage(n)}static initialize(e,n){if(He._l10n??(He._l10n=e),He._l10nResizer||(He._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"})),He._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);He._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,n){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,n){Lt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return h(this,aw)}set _isDraggable(e){var n;_(this,aw,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}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=h(this,T_)}setParent(e){var n;e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(j(this,Re,Xx).c
691all(this),(n=h(this,jo))==null||n.remove(),_(this,jo,null)),this.parent=e}focusin(e){this._focusEventsAllowed&&(h(this,Fh)?_(this,Fh,!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,s){const[i,a]=this.parentDimensions;[r,s]=this.screenToPageTranslation(r,s),this.x=(e+r)/i,this.y=(n+s)/a,this.fixAndSetPosition()}_moveAfterPaste(e,n){const[r,s]=this.parentDimensions;this.setAt(e*r,n*s,this.width*r,this.height*s),this._onTranslated()}translate(e,n){j(this,Re,XN).call(this,this.parentDimensions,e,n)}translateInPage(e,n){h(this,ai)||_(this,ai,[this.x,this.y,this.width,this.height]),j(this,Re,XN).call(this,this.pageDimensions,e,n),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,n){h(this,ai)||_(this,ai,[this.x,this.y,this.width,this.height]);const{div:r,parentDimensions:[s,i]}=this;if(this.x+=e/s,this.y+=n/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:f,y:p}=this.div.getBoundingClientRect();this.parent.findNewParent(this,f,p)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this;const[l,u]=this.getBaseTranslation();a+=l,o+=u;const{style:d}=r;d.left=`${(100*a).toFixed(2)}%`,d.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o),r.scrollIntoView({block:"nearest"})}_onTranslating(e,n){}_onTranslated(e,n){}get _hasBeenMoved(){return!!h(this,ai)&&(h(this,ai)[0]!==this.x||h(this,ai)[1]!==this.y)}get _hasBeenResized(){return!!h(this,ai)&&(h(this,ai)[2]!==this.width||h(this,ai)[3]!==this.height)}getBaseTranslation(){const[e,n]=this.parentDimensions,{_borderLineWidth:r}=He,s=r/e,i=r/n;switch(this.rotation){case 90:return[-s,i];case 180:return[s,i];case 270:return[s,-i];default:return[-s,-i]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:n},pageDimensions:[r,s]}=this;let{x:i,y:a,width:o,height:l}=this;if(o*=r,l*=s,i*=r,a*=s,this._mustFixPosition)switch(e){case 0:i=Wr(i,0,r-o),a=Wr(a,0,s-l);break;case 90:i=Wr(i,0,r-l),a=Wr(a,o,s);break;case 180:i=Wr(i,o,r),a=Wr(a,l,s);break;case 270:i=Wr(i,l,r),a=Wr(a,0,s-o);break}this.x=i/=r,this.y=a/=s;const[u,d]=this.getBaseTranslation();i+=u,a+=d,n.left=`${(100*i).toFixed(2)}%`,n.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,n){var r;return j(r=He,ow,ZN).call(r,e,n,this.parentRotation)}pageTranslationToScreen(e,n){var r;return j(r=He,ow,ZN).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=h(this,en))==null||e.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||h(this,Bh))return this._editToolbar;this._editToolbar=new BN(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")}removeCommentButtonFromToolbar(){var e;(e=this._editToolbar)==null||e.removeButton("comment")}removeEditToolbar(){var e,n;(e=this._editToolbar)==null||e.remove(),this._editToolbar=null,(n=h(this,en))==null||n.destroy()}
691addContainer(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 h(this,en)||(f_.initialize(He._l10n),_(this,en,new f_(this)),h(this,Oh)&&(h(this,en).data=h(this,Oh),_(this,Oh,null))),h(this,en)}get altTextData(){var e;return(e=h(this,en))==null?void 0:e.data}set altTextData(e){h(this,en)&&(h(this,en).data=e)}get guessedAltText(){var e;return(e=h(this,en))==null?void 0:e.guessedText}async setGuessedAltText(e){var n;await((n=h(this,en))==null?void 0:n.setGuessedText(e))}serializeAltText(e){var n;return(n=h(this,en))==null?void 0:n.serialize(e)}hasAltText(){return!!h(this,en)&&!h(this,en).isEmpty()}hasAltTextData(){var e;return((e=h(this,en))==null?void 0:e.hasData())??!1}focusCommentButton(){var e;(e=h(this,Rt))==null||e.focusButton()}addCommentButton(){return h(this,Rt)||_(this,Rt,new B1(this))}addStandaloneCommentButton(){if(h(this,jl)){this._uiManager.isEditingMode()&&h(this,jl).classList.remove("hidden");return}this.hasComment&&(_(this,jl,h(this,Rt).renderForStandalone()),this.div.append(h(this,jl)))}removeStandaloneCommentButton(){h(this,Rt).removeStandaloneCommentButton(),_(this,jl,null)}hideStandaloneCommentButton(){var e;(e=h(this,jl))==null||e.classList.add("hidden")}get comment(){const{data:{richText:e,text:n,date:r,deleted:s}}=h(this,Rt);return{text:n,richText:e,date:r,deleted:s,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){h(this,Rt)||_(this,Rt,new B1(this)),h(this,Rt).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||(h(this,Rt)||_(this,Rt,new B1(this)),h(this,Rt).setInitialText(e,r),!this.annotationElementId))return;const s=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);s&&this.updateFromAnnotationLayer(s)}get hasEditedComment(){var e;return(e=h(this,Rt))==null?void 0:e.hasBeenEdited()}get hasDeletedComment(){var e;return(e=h(this,Rt))==null?void 0:e.isDeleted()}get hasComment(){return!!h(this,Rt)&&!h(this,Rt).isEmpty()&&!h(this,Rt).isDeleted()}async editComment(e){h(this,Rt)||_(this,Rt,new B1(this)),h(this,Rt).edit(e)}toggleComment(e,n=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,n)}setSelectedCommentButton(e){h(this,Rt).setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const[,,,s]=e.rect,[i]=this.pageDimensions,[a]=this.pageTranslation,o=a+i+1,l=s-100,u=o+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[o,l,u,s]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:n}}){h(this,Rt).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=h(this,ig)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),j(this,Re,t2).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[s,i]=this.getInitialTranslation();return this.translate(s,i),aq(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(h(this,$h)||_(this,$h,new jb({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:j(this,Re,Sq).bind(this),onPinching:j(this,Re,_q).bind(this),onPinchEnd:j(this,Re,Eq).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),(a=this._uiManager._editorUndoBar)==null||a.hide(),e}pointerdown(e){const{isMac:n}=hr.platform;if(e.button!==0||e.ctrlKey&&n){e.preventDefault();return}if(_(this,Fh,!0),this._isDraggable){j(this,Re,Cq).call(this,e);return}
691j(this,Re,e2).call(this,e)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){h(this,No)&&clearTimeout(h(this,No)),_(this,No,setTimeout(()=>{var e;_(this,No,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 s=this.parentScale,[i,a]=this.pageDimensions,[o,l]=this.pageTranslation,u=e/s,d=n/s,f=this.x*i,p=this.y*a,m=this.width*i,y=this.height*a;switch(r){case 0:return[f+u+o,a-p-d-y+l,f+u+m+o,a-p-d+l];case 90:return[f+d+o,a-p+u+l,f+d+y+o,a-p+u+m+l];case 180:return[f-u-m+o,a-p+d+l,f-u+o,a-p+d+y+l];case 270:return[f-d-y+o,a-p-u-m+l,f-d+o,a-p-u+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,n){const[r,s,i,a]=e,o=i-r,l=a-s;switch(this.rotation){case 0:return[r,n-a,o,l];case 90:return[r,n-s,l,o];case 180:return[i,n-s,o,l];case 270:return[i,n-a,l,o];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&He._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){var e;(e=h(this,Rt))==null||e.onUpdatedColor()}getData(){const{comment:{text:e,color:n,date:r,opacity:s,deleted:i,richText:a},uid:o,pageIndex:l,creationDate:u,modificationDate:d}=this;return{id:o,pageIndex:l,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:u,modificationDate:r||d,popupRef:!i,color:n,opacity:s}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),_(this,Bh,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),_(this,Bh,!1),!0):!1}isInEditMode(){return h(this,Bh)}shouldGetKeyboardEvents(){return h(this,Pl)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:n,bottom:r,right:s}=this.getClientDimensions(),{innerHeight:i,innerWidth:a}=window;return n<a&&s>0&&e<i&&r>0}rebuild(){j(this,Re,t2).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 s=new this.prototype.constructor({parent:n,id:n.getNextId(),uiManager:r,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});s.rotation=e.rotation,_(s,Oh,e.accessibilityData),s._isCopy=e.isCopy||!1;const[i,a]=s.pageDimensions,[o,l,u,d]=s.getRectInCurrentCoords(e.rect,a);return s.x=o/i,s.y=l/a,s.width=u/i,s.height=d/a,s}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e,n;if((e=h(this,pu))==null||e.abort(),_(this,pu,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),h(this,No)&&(clearTimeout(h(this,No)),_(this,No,null)),j(this,Re,Xx).call(this),this.removeEditToolbar(),h(this,Zi)){for(const r of h(this,Zi).values())clearTimeout(r);_(this,Zi,null)}this.parent=null,(n=h(this,$h))==null||n.destroy(),_(this,$h,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(j(this,Re,wq).call(this),h(this,vr).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,s,i,a]=this.getPDFRect();return[He._round(r+(i-r)*e),He._round(s+(a-s)*(1-n))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return h(this,Rt).commentPopupPositionInLayer}set commentPopupPosition(e){h(this,Rt).commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return h(this,Rt).hasDefaultPopupPosition()}get commentButtonWidth(){return h(this,Rt).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){h(this,Rt).setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),_(this,Nl,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const n=h(this,vr).children;if(!h(this,Oa)){_(this,Oa,Array.from(n));const a=j(this,Re,Aq).bind(this),o=j(this,Re,Tq).bind(this),l=this._uiManager._signal;for(const u of h(this,Oa)){const d=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",a,{signal:l}),u.addEventListener("blur",o,{signal:l}),u.addEventListener("focus",j(this,Re,jq).bind(this,d),{signal:l}),u.setAttribute("data-l10n-id",He._l10nResizer[d])}}const r=h(this,Oa)[0];let s=0;for(const a of n){if(a===r)break;s++}
691const i=(360-this.rotation+this.parentRotation)%360/90*(h(this,Oa).length/4);if(i!==s){if(i<s)for(let o=0;o<s-i;o++)h(this,vr).append(h(this,vr).firstChild);else if(i>s)for(let o=0;o<i-s;o++)h(this,vr).firstChild.before(h(this,vr).lastChild);let a=0;for(const o of n){const u=h(this,Oa)[a++].getAttribute("data-resizer-name");o.setAttribute("data-l10n-id",He._l10nResizer[u])}}j(this,Re,n2).call(this,0),_(this,Pl,!0),h(this,vr).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,n){h(this,Pl)&&j(this,Re,JN).call(this,h(this,sw),{deltaX:e,deltaY:n,fromKeyboard:!0})}_stopResizingWithKeyboard(){j(this,Re,Xx).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 s,i;(s=this.div)!=null&&s.classList.contains("selectedEditor")&&((i=this._editToolbar)==null||i.show())});return}(n=this._editToolbar)==null||n.show(),(r=h(this,en))==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,s,i;this.isSelected&&(this.isSelected=!1,(e=h(this,vr))==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}),(s=this._editToolbar)==null||s.hide(),(i=h(this,en))==null||i.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,!1))}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.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return h(this,iw)}set isEditing(e){_(this,iw,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){h(this,Zi)||_(this,Zi,new Map);const{action:r}=e;let s=h(this,Zi).get(r);s&&clearTimeout(s),s=setTimeout(()=>{this._reportTelemetry(e),h(this,Zi).delete(r),h(this,Zi).size===0&&_(this,Zi,null)},He._telemetryTimeout),h(this,Zi).set(r,s);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),_(this,ig,!1)}disable(){this.div&&(this.div.tabIndex=-1),_(this,ig,!0)}updateFakeAnnotationElement(e){if(!h(this,jo)&&!this.deleted){_(this,jo,e.addFakeAnnotation(this));return}if(this.deleted){h(this,jo).remove(),_(this,jo,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&h(this,jo).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{firstChild:n}=e.container;(n==null?void 0:n.nodeName)==="DIV"&&n.classList.contains("annotationContent")&&n.remove()}};Oh=new WeakMap,Oa=new WeakMap,en=new WeakMap,Rt=new WeakMap,jl=new WeakMap,ig=new WeakMap,fu=new WeakMap,rw=new WeakMap,vr=new WeakMap,Lh=new WeakMap,Nl=new WeakMap,jo=new WeakMap,pu=new WeakMap,sw=new WeakMap,Fh=new WeakMap,ai=new WeakMap,iw=new WeakMap,Bh=new WeakMap,Pl=new WeakMap,No=new WeakMap,ag=new WeakMap,og=new WeakMap,Zi=new WeakMap,$h=new WeakMap,aw=new WeakMap,T_=new WeakMap,Re=new WeakSet,XN=function([e,n],r,s){[r,s]=this.screenToPageTranslation(r,s),this.x+=r/e,this.y+=s/n,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},ow=new WeakSet,ZN=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]}},jk=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]}},wq=function(){if(h(this,vr))return;_(this,vr,document.createElement("div")),h(this,vr).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 s=document.createElement("div");h(this,vr).append(s),s.classList.add("resizer",r),s.setAttribute("data-resizer-name",r),s.addEventListener("pointerdown",j(this,Re,kq).bind(this,r),{signal:n}),s.addEventListener("contextmenu",Ii,{signal:n}),s.tabIndex=-1}this.div.prepend(h(this,vr))},kq=function(e,n){var d;n.preventDefault();const{isMac:r}=hr.platform;if(n.button!==0||n.ctrlKey&&r)return;(d=h(this,en))==null||d.toggle(!1);const s=this._isDraggable;this._isDraggable=!1,_(this,Lh,[n.screenX,n.screenY]);const i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",j(this,Re,JN).bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("touchmove",ln,{passive:!1,signal:a}),window.addEventListener("contextmenu",Ii,{signal:a}),_(this,Nl,{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 u=()=>{var f;i.abort(),this.parent.togglePointerEvents(!0),(f=h(this,en))==null||f.toggle(!0),this._isDraggable=s,this.parent.div.style.cursor=o,this.div.style.cursor=l,j(this,Re,Nk).call(this)};window.addEventListener("pointerup",u,{signal:a}),window.addEventListener("blur",u,{signal:a})}
vendor: 4,446 bytes, line 691
691,QN=function(e,n,r,s){this.width=r,this.height=s,this.x=e,this.y=n,this.setDims(),this.fixAndSetPosition(),this._onResized()},Nk=function(){if(!h(this,Nl))return;const{savedX:e,savedY:n,savedWidth:r,savedHeight:s}=h(this,Nl);_(this,Nl,null);const i=this.x,a=this.y,o=this.width,l=this.height;i===e&&a===n&&o===r&&l===s||this.addCommands({cmd:j(this,Re,QN).bind(this,i,a,o,l),undo:j(this,Re,QN).bind(this,e,n,r,s),mustExec:!0})},JN=function(e,n){const[r,s]=this.parentDimensions,i=this.x,a=this.y,o=this.width,l=this.height,u=He.MIN_SIZE/r,d=He.MIN_SIZE/s,f=j(this,Re,jk).call(this,this.rotation),p=(z,V)=>[f[0]*z+f[2]*V,f[1]*z+f[3]*V],m=j(this,Re,jk).call(this,360-this.rotation),y=(z,V)=>[m[0]*z+m[2]*V,m[1]*z+m[3]*V];let g,b,x=!1,w=!1;switch(e){case"topLeft":x=!0,g=(z,V)=>[0,0],b=(z,V)=>[z,V];break;case"topMiddle":g=(z,V)=>[z/2,0],b=(z,V)=>[z/2,V];break;case"topRight":x=!0,g=(z,V)=>[z,0],b=(z,V)=>[0,V];break;case"middleRight":w=!0,g=(z,V)=>[z,V/2],b=(z,V)=>[0,V/2];break;case"bottomRight":x=!0,g=(z,V)=>[z,V],b=(z,V)=>[0,0];break;case"bottomMiddle":g=(z,V)=>[z/2,V],b=(z,V)=>[z/2,0];break;case"bottomLeft":x=!0,g=(z,V)=>[0,V],b=(z,V)=>[z,0];break;case"middleLeft":w=!0,g=(z,V)=>[0,V/2],b=(z,V)=>[z,V/2];break}const v=g(o,l),S=b(o,l);let E=p(...S);const C=He._round(i+E[0]),T=He._round(a+E[1]);let P=1,M=1,R,O;if(n.fromKeyboard)({deltaX:R,deltaY:O}=n);else{const{screenX:z,screenY:V}=n,[$,I]=h(this,Lh);[R,O]=this.screenToPageTranslation(z-$,V-I),h(this,Lh)[0]=z,h(this,Lh)[1]=V}if([R,O]=y(R/r,O/s),x){const z=Math.hypot(o,l);P=M=Math.max(Math.min(Math.hypot(S[0]-v[0]-R,S[1]-v[1]-O)/z,1/o,1/l),u/o,d/l)}else w?P=Wr(Math.abs(S[0]-v[0]-R),u,1)/o:M=Wr(Math.abs(S[1]-v[1]-O),d,1)/l;const L=He._round(o*P),U=He._round(l*M);E=p(...b(L,U));const B=C-E[0],H=T-E[1];h(this,ai)||_(this,ai,[this.x,this.y,this.width,this.height]),this.width=L,this.height=U,this.x=B,this.y=H,this.setDims(),this.fixAndSetPosition(),this._onResizing()},Sq=function(){var e;_(this,Nl,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(e=h(this,en))==null||e.toggle(!1),this.parent.togglePointerEvents(!1)},_q=function(e,n,r){let i=.7*(r/n)+1-.7;if(i===1)return;const a=j(this,Re,jk).call(this,this.rotation),o=(C,T)=>[a[0]*C+a[2]*T,a[1]*C+a[3]*T],[l,u]=this.parentDimensions,d=this.x,f=this.y,p=this.width,m=this.height,y=He.MIN_SIZE/l,g=He.MIN_SIZE/u;i=Math.max(Math.min(i,1/p,1/m),y/p,g/m);const b=He._round(p*i),x=He._round(m*i);if(b===p&&x===m)return;h(this,ai)||_(this,ai,[d,f,p,m]);const w=o(p/2,m/2),v=He._round(d+w[0]),S=He._round(f+w[1]),E=o(b/2,x/2);this.x=v-E[0],this.y=S-E[1],this.width=b,this.height=x,this.setDims(),this.fixAndSetPosition(),this._onResizing()},Eq=function(){var e;(e=h(this,en))==null||e.toggle(!0),this.parent.togglePointerEvents(!0),j(this,Re,Nk).call(this)},e2=function(e){const{isMac:n}=hr.platform;e.ctrlKey&&!n||e.shiftKey||e.metaKey&&n?this.parent.toggleSelected(this):this.parent.setSelected(this)},Cq=function(e){const{isSelected:n}=this;this._uiManager.setUpDragSession();let r=!1;const s=new AbortController,i=this._uiManager.combinedSignal(s),a={capture:!0,passive:!1,signal:i},o=u=>{s.abort(),_(this,fu,null),_(this,Fh,!1),this._uiManager.endDragSession()||j(this,Re,e2).call(this,u),r&&this._onStopDragging()};n&&(_(this,ag,e.clientX),_(this,og,e.clientY),_(this,fu,e.pointerId),_(this,rw,e.pointerType),window.addEventListener("pointermove",u=>{r||(r=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:d,clientY:f,pointerId:p}=u;if(p!==h(this,fu)){ln(u);return}const[m,y]=this.screenToPageTranslation(d-h(this,ag),f-h(this,og));_(this,ag,d),_(this,og,f),this._uiManager.dragSelectedEditors(m,y)},a),window.addEventListener("touchmove",ln,a),window.addEventListener("pointerdown",u=>{u.pointerType===h(this,rw)&&(h(this,$h)||u.isPrimary)&&o(u),ln(u)},a));const l=u=>{if(!h(this,fu)||h(this,fu)===u.pointerId){o(u);return}ln(u)};window.addEventListener("pointerup",l,{signal:i}),window.addEventListener("blur",l,{signal:i})},t2=function(){if(h(this,pu)||!this.div)return;_(this,pu,new AbortController);const e=this._uiManager.combinedSignal(h(this,pu));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},Aq=function(e){He._resizerKeyboardManager.exec(this,e)},Tq=function(e){var n;h(this,Pl)&&((n=e.relatedTarget)==null?void 0:n.parentNode)!==h(this,vr)&&j(this,Re,Xx).c
691all(this)},jq=function(e){_(this,sw,h(this,Pl)?e:"")},n2=function(e){if(h(this,Oa))for(const n of h(this,Oa))n.tabIndex=e},Xx=function(){_(this,Pl,!1),j(this,Re,n2).call(this,-1),j(this,Re,Nk).call(this)},A(He,ow),Z(He,"_l10n",null),Z(He,"_l10nResizer",null),Z(He,"_borderLineWidth",-1),Z(He,"_colorManager",new zN),Z(He,"_zIndex",1),Z(He,"_telemetryTimeout",1e3);let Gt=He;class jSe extends Gt{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const z3=3285377520,$i=4294901760,ho=65535;class Nq{constructor(e){this.h1=e?e&4294967295:z3,this.h2=e?e&4294967295:z3}update(e){let n,r;if(typeof e=="string"){n=new Uint8Array(e.length*2),r=0;for(let g=0,b=e.length;g<b;g++){const x=e.charCodeAt(g);x<=255?n[r++]=x:(n[r++]=x>>>8,n[r++]=x&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 s=r>>2,i=r-s*4,a=new Uint32Array(n.buffer,0,s);let o=0,l=0,u=this.h1,d=this.h2;const f=3432918353,p=461845907,m=f&ho,y=p&ho;for(let g=0;g<s;g++)g&1?(o=a[g],o=o*f&$i|o*m&ho,o=o<<15|o>>>17,o=o*p&$i|o*y&ho,u^=o,u=u<<13|u>>>19,u=u*5+3864292196):(l=a[g],l=l*f&$i|l*m&ho,l=l<<15|l>>>17,l=l*p&$i|l*y&ho,d^=l,d=d<<13|d>>>19,d=d*5+3864292196);switch(o=0,i){case 3:o^=n[s*4+2]<<16;case 2:o^=n[s*4+1]<<8;case 1:o^=n[s*4],o=o*f&$i|o*m&ho,o=o<<15|o>>>17,o=o*p&$i|o*y&ho,s&1?u^=o:d^=o}this.h1=u,this.h2=d}hexdigest(){let e=this.h1,n=this.h2;return e^=n>>>1,e=e*3981806797&$i|e*36045&ho,n=n*4283543511&$i|((n<<16|e>>>16)*2950163797&$i)>>>16,e^=n>>>1,e=e*444984403&$i|e*60499&ho,n=n*3301882366&$i|((n<<16|e>>>16)*3120437893&$i)>>>16,e^=n>>>1,(e>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")}}const r2=Object.freeze({map:null,hash:"",transfer:void 0});var Uh,zh,Rl,br,j_,Pq;class gD{constructor(){A(this,j_);A(this,Uh,!1);A(this,zh,null);A(this,Rl,null);A(this,br,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,n){const r=h(this,br).get(e);return r===void 0?n:Object.assign(n,r)}getRawValue(e){return h(this,br).get(e)}remove(e){const n=h(this,br).get(e);if(n!==void 0&&(n instanceof Gt&&h(this,Rl).delete(n.annotationElementId),h(this,br).delete(e),h(this,br).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(const r of h(this,br).values())if(r instanceof Gt)return;this.onAnnotationEditor(null)}}setValue(e,n){const r=h(this,br).get(e);let s=!1;if(r!==void 0)for(const[i,a]of Object.entries(n))r[i]!==a&&(s=!0,r[i]=a);else s=!0,h(this,br).set(e,n);s&&j(this,j_,Pq).call(this),n instanceof Gt&&((h(this,Rl)||_(this,Rl,new Map)).set(n.annotationElementId,n),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(n.constructor._type))}has(e){return h(this,br).has(e)}get size(){return h(this,br).size}resetModified(){h(this,Uh)&&(_(this,Uh,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new Rq(this)}get serializable(){if(h(this,br).size===0)return r2;const e=new Map,n=new Nq,r=[],s=Object.create(null);let i=!1;for(const[a,o]of h(this,br)){const l=o instanceof Gt?o.serialize(!1,s):o;l&&(e.set(a,l),n.update(`${a}:${JSON.stringify(l)}`),i||(i=!!l.bitmap))}if(i)for(const a of e.values())a.bitmap&&r.push(a.bitmap);return e.size>0?{map:e,hash:n.hexdigest(),transfer:r}:r2}get editorStats(){let e=null;const n=new Map;let r=0,s=0;for(const i of h(this,br).values()){if(!(i instanceof Gt)){i.popup&&(i.popup.deleted?s+=1:r+=1);continue}i.isCommentDeleted?s+=1:i.hasEditedComment&&(r+=1);const a=i.telemetryFinalData;if(!a)continue;const{type:o}=a;n.has(o)||n.set(o,Object.getPrototypeOf(i).constructor),e||(e=Object.create(null));const l=e[o]||(e[o]=new Map);for(const[u,d]of Object.entries(a)){if(u==="type")continue;let f=l.get(u);f||(f=new Map,l.set(u,f));const p=f.get(d)??0;f.set(d,p+1)}}if((s>0||r>0)&&(e||(e=Object.create(null)),e.comments={deleted:s,edited:r}),!e)return null;for(const[i,a]of n)e[i]=a.computeTelemetryFinalData(e[i]);return e}resetModifiedIds(){_(this,zh,null)}updateEditor(e,n){var s;const r=(s=h(this,Rl))==null?void 0:s.get(e);return r?(r.updateFromAnnotationLayer(n),!0):!1}getEditor(e){var n;return((n=h(this,Rl))==null?void 0:n.get(e))||null}get modifiedIds(){if(h(this,zh))return h(this,zh);const e=[];
691if(h(this,Rl))for(const n of h(this,Rl).values())n.serialize()&&e.push(n.annotationElementId);return _(this,zh,{ids:new Set(e),hash:e.join(",")})}[Symbol.iterator](){return h(this,br).entries()}}Uh=new WeakMap,zh=new WeakMap,Rl=new WeakMap,br=new WeakMap,j_=new WeakSet,Pq=function(){h(this,Uh)||(_(this,Uh,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var lw;class Rq extends gD{constructor(n){super();A(this,lw);const{map:r,hash:s,transfer:i}=n.serializable,a=structuredClone(r,i?{transfer:i}:null);_(this,lw,{map:a,hash:s,transfer:i})}get print(){Lt("Should not call PrintAnnotationStorage.print")}get serializable(){return h(this,lw)}get modifiedIds(){return Qe(this,"modifiedIds",{ids:new Set,hash:""})}}lw=new WeakMap;var lg;class NSe{constructor({ownerDocument:e=globalThis.document,styleElement:n=null}){A(this,lg,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(),h(this,lg).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:n,_inspectFont:r}){if(!(!e||h(this,lg).has(e.loadedName))){if(lt(!n,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:s,src:i,style:a}=e,o=new FontFace(s,i,a);this.addNativeFontFace(o);try{await o.load(),h(this,lg).add(s),r==null||r(e)}catch{ze(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(o)}return}Lt("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(s){throw ze(`Failed to load font '${r.family}': '${s}'.`),e.disableFontFace=!0,s}}return}const n=e.createFontFaceRule();if(n){if(this.insertRule(n),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const s=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,s)})}}get isFontLoadingAPISupported(){var n;const e=!!((n=this._document)!=null&&n.fonts);return Qe(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return Qe(this,"isSyncFontLoadingSupported",ls||hr.platform.isFirefox)}_queueLoadingCallback(e){function n(){for(lt(!s.done,"completeRequest() cannot be called twice."),s.done=!0;r.length>0&&r[0].done;){const i=r.shift();setTimeout(i.callback,0)}}const{loadingRequests:r}=this,s={done:!1,complete:n,callback:e};return r.push(s),s}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Qe(this,"_loadTestFont",e)}
691_prepareFontLoadEvent(e,n){function r(S,E){return S.charCodeAt(E)<<24|S.charCodeAt(E+1)<<16|S.charCodeAt(E+2)<<8|S.charCodeAt(E+3)&255}function s(S,E,C,T){const P=S.substring(0,E),M=S.substring(E+C);return P+T+M}let i,a;const o=this._document.createElement("canvas");o.width=1,o.height=1;const l=o.getContext("2d");let u=0;function d(S,E){if(++u>30){ze("Load test font never loaded."),E();return}if(l.font="30px "+S,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){E();return}setTimeout(d.bind(null,S,E))}const f=`lt${Date.now()}${this.loadTestFontId++}`;let p=this._loadTestFont;p=s(p,976,f.length,f);const y=16,g=1482184792;let b=r(p,y);for(i=0,a=f.length-3;i<a;i+=4)b=b-g+r(f,i)|0;i<f.length&&(b=b-g+r(f+"XXX",i)|0),p=s(p,y,4,ySe(b));const x=`url(data:font/opentype;base64,${btoa(p)});`,w=`@font-face {font-family:"${f}";src:${x}}`;this.insertRule(w);const v=this._document.createElement("div");v.style.visibility="hidden",v.style.width=v.style.height="10px",v.style.position="absolute",v.style.top=v.style.left="0px";for(const S of[e.loadedName,f]){const E=this._document.createElement("span");E.textContent="Hi",E.style.fontFamily=S,v.append(E)}this._document.body.append(v),d(f,()=>{v.remove(),n.complete()})}}lg=new WeakMap;var Ct;class PSe{constructor(e,n=null,r,s){A(this,Ct);this.compiledGlyphs=Object.create(null),_(this,Ct,e),this._inspectFont=n,r&&Object.assign(this,r),s&&(this.charProcOperatorList=s)}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,${K9(this.data)});`;let n;if(!this.cssFontInfo)n=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let s=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(s+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${s}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 s;try{s=e.get(r)}catch(a){ze(`getPathGenerator - ignoring character: "${a}".`)}const i=new Path2D(s||"");return this.fontExtraProperties||e.delete(r),this.compiledGlyphs[n]=i}get black(){return h(this,Ct).black}get bold(){return h(this,Ct).bold}get disableFontFace(){return h(this,Ct).disableFontFace??!1}get fontExtraProperties(){return h(this,Ct).fontExtraProperties??!1}get isInvalidPDFjsFont(){return h(this,Ct).isInvalidPDFjsFont}get isType3Font(){return h(this,Ct).isType3Font}get italic(){return h(this,Ct).italic}get missingFile(){return h(this,Ct).missingFile}get remeasure(){return h(this,Ct).remeasure}get vertical(){return h(this,Ct).vertical}get ascent(){return h(this,Ct).ascent}get defaultWidth(){return h(this,Ct).defaultWidth}get descent(){return h(this,Ct).descent}get bbox(){return h(this,Ct).bbox}get fontMatrix(){return h(this,Ct).fontMatrix}get fallbackName(){return h(this,Ct).fallbackName}get loadedName(){return h(this,Ct).loadedName}get mimetype(){return h(this,Ct).mimetype}get name(){return h(this,Ct).name}get data(){return h(this,Ct).data}clearData(){h(this,Ct).clearData()}get cssFontInfo(){return h(this,Ct).cssFontInfo}get systemFontInfo(){return h(this,Ct).systemFontInfo}get defaultVMetrics(){return h(this,Ct).defaultVMetrics}}Ct=new WeakMap;function RSe(t){if(t instanceof URL)return t.href;if(typeof t=="string"){if(ls)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function ISe(t){if(ls&&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 U0(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 $1(t){if(typeof t!="string")return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const s2=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,DSe=t=>
691typeof t=="object"&&typeof(t==null?void 0:t.name)=="string",Iq=wSe.bind(null,s2,DSe);var Il,N_;class MSe{constructor(){A(this,Il,new Map);A(this,N_,Promise.resolve())}postMessage(e,n){const r={data:structuredClone(e,n?{transfer:n}:null)};h(this,N_).then(()=>{for(const[s]of h(this,Il))s.call(this,r)})}addEventListener(e,n,r=null){let s=null;if((r==null?void 0:r.signal)instanceof AbortSignal){const{signal:i}=r;if(i.aborted){ze("LoopbackPort - cannot use an `aborted` signal.");return}const a=()=>this.removeEventListener(e,n);s=()=>i.removeEventListener("abort",a),i.addEventListener("abort",a)}h(this,Il).set(n,s)}removeEventListener(e,n){const r=h(this,Il).get(n);r==null||r(),h(this,Il).delete(n)}terminate(){for(const[,e]of h(this,Il))e==null||e();h(this,Il).clear()}}Il=new WeakMap,N_=new WeakMap;const U1={DATA:1,ERROR:2},Mn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function V3(){}function Ns(t){if(t instanceof vc||t instanceof d_||t instanceof M3||t instanceof Cb||t instanceof JA)return t;switch(t instanceof Error||typeof t=="object"&&t!==null||Lt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new vc(t.message);case"InvalidPDFException":return new d_(t.message);case"PasswordException":return new M3(t.message,t.code);case"ResponseException":return new Cb(t.message,t.status,t.missing);case"UnknownErrorException":return new JA(t.message,t.details)}return new JA(t.message,t.toString())}var cg,fa,Dq,Mq,Oq,Pk;class Zx{constructor(e,n,r){A(this,fa);A(this,cg,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",j(this,fa,Dq).bind(this),{signal:h(this,cg).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)}sendWithPromise(e,n,r){const s=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[s]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:s,data:n},r)}catch(a){i.reject(a)}return i.promise}sendWithStream(e,n,r,s){const i=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:u=>{const d=Promise.withResolvers();return this.streamControllers[i]={controller:u,startCall:d,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:n,desiredSize:u.desiredSize},s),d.promise},pull:u=>{const d=Promise.withResolvers();return this.streamControllers[i].pullCall=d,l.postMessage({sourceName:a,targetName:o,stream:Mn.PULL,streamId:i,desiredSize:u.desiredSize}),d.promise},cancel:u=>{lt(u instanceof Error,"cancel must have a valid reason");const d=Promise.withResolvers();return this.streamControllers[i].cancelCall=d,this.streamControllers[i].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:Mn.CANCEL,streamId:i,reason:Ns(u)}),d.promise}},r)}destroy(){var e;(e=h(this,cg))==null||e.abort(),_(this,cg,null)}}cg=new WeakMap,fa=new WeakSet,Dq=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){j(this,fa,Oq).call(this,e);return}if(e.callback){const r=e.callbackId,s=this.callbackCapabilities[r];if(!s)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],e.callback===U1.DATA)s.resolve(e.data);else if(e.callback===U1.ERROR)s.reject(Ns(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,s=e.sourceName,i=this.comObj;Promise.try(n,e.data).then(function(a){i.postMessage({sourceName:r,targetName:s,callback:U1.DATA,callbackId:e.callbackId,data:a})},function(a){i.postMessage({sourceName:r,targetName:s,callback:U1.ERROR,callbackId:e.callbackId,reason:Ns(a)})});return}if(e.streamId){j(this,fa,Mq).call(this,e);return}n(e.data)},Mq=function(e){const n=e.streamId,r=this.sourceName,s=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[e.action],l={enqueue(u,d=1,f){if(this.isCancelled)return;const p=this.desiredSize;this.desiredSize-=d,p>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:r,targetName:s,stream:Mn.ENQUEUE,streamId:n,chunk:u},f)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:s,stream:Mn.CLOSE,streamId:n}),delete a.streamSinks[n])},error(u){lt(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:s,stream:Mn.ERROR,streamId:n,reason:Ns(u)}))},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(){i.postMessage({sourceName:r,targetName:s,stream:Mn.START_COMPLETE,streamId:n,success:!0})},function(u){i.postMessage({sourceName:r,targetName:s,stream:Mn.START_COMPLETE,streamId:n,reason:Ns(u)})})},Oq=function(e){const n=e.streamId,r=this.sourceName,s=e.sourceName,i=this.comObj,a=this.streamControllers[n],o=this.streamSinks[n];switch(e.stream){case Mn.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(Ns(e.reason));break;case Mn.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(Ns(e.reason));break;case Mn.PULL:if(!o){i.postMessage({sourceName:r,targetName:s,stream:Mn.PULL_COMPLETE,streamId:n,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||V3).then(function(){i.postMessage({sourceName:r,targetName:s,stream:Mn.PULL_COMPLETE,streamId:n,success:!0})},function(u){i.postMessage({sourceName:r,targetName:s,stream:Mn.PULL_COMPLETE,streamId:n,reason:Ns(u)})});break;case Mn.ENQUEUE:if(lt(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case Mn.CLOSE:if(lt(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),j(this,fa,Pk).call(this,a,n);break;case Mn.ERROR:lt(a,"error should have stream controller"),a.controller.error(Ns(e.reason)),j(this,fa,Pk).call(this,a,n);break;case Mn.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(Ns(e.reason)),j(this,fa,Pk).call(this,a,n);break;case Mn.CANCEL:if(!o)break;const l=Ns(e.reason);Promise.try(o.onCancel||V3,l).then(function(){i.postMessage({sourceName:r,targetName:s,stream:Mn.CANCEL_COMPLETE,streamId:n,success:!0})},function(u){i.postMessage({sourceName:r,targetName:s,stream:Mn.CANCEL_COMPLETE,streamId:n,reason:Ns(u)})}),o.sinkCapability.reject(l),o.isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}},Pk=async function(e,n){var r,s,i;await Promise.allSettled([(r=e.startCall)==null?void 0:r.promise,(s=e.pullCall)==null?void 0:s.promise,(i=e.cancelCall)==null?void 0:i.promise]),delete this.streamControllers[n]};var cw;class Lq{constructor({enableHWA:e=!1}){A(this,cw,!1);_(this,cw,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:!h(this,cw)})}}reset(e,n,r){if(!e.canvas)throw new Error("Canvas is not specified");if(n<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=n,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,n){Lt("Abstract method `_createCanvas` called.")}}cw=new WeakMap;class OSe extends Lq{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}}
691class Fq{constructor({baseUrl:e=null,isCompressed:n=!0}){this.baseUrl=e,this.isCompressed=n}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const n=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(n).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)})}async _fetch(e){Lt("Abstract method `_fetch` called.")}}class W3 extends Fq{async _fetch(e){const n=await rx(e,this.isCompressed?"arraybuffer":"text");return n instanceof ArrayBuffer?new Uint8Array(n):U0(n)}}class Bq{addFilter(e){return"none"}addHCMFilter(e,n){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,n,r,s,i){return"none"}destroy(e=!1){}}var Vh,ug,Dl,Ml,Br,Wh,Hh,he,Mr,Qx,Bp,Rk,$p,$q,i2,Up,Jx,ev,a2,tv;class LSe extends Bq{constructor({docId:n,ownerDocument:r=globalThis.document}){super();A(this,he);A(this,Vh);A(this,ug);A(this,Dl);A(this,Ml);A(this,Br);A(this,Wh);A(this,Hh,0);_(this,Ml,n),_(this,Br,r)}addFilter(n){if(!n)return"none";let r=h(this,he,Mr).get(n);if(r)return r;const[s,i,a]=j(this,he,Rk).call(this,n),o=n.length===1?s:`${s}${i}${a}`;if(r=h(this,he,Mr).get(o),r)return h(this,he,Mr).set(n,r),r;const l=`g_${h(this,Ml)}_transfer_map_${pn(this,Hh)._++}`,u=j(this,he,$p).call(this,l);h(this,he,Mr).set(n,u),h(this,he,Mr).set(o,u);const d=j(this,he,Up).call(this,l);return j(this,he,ev).call(this,s,i,a,d),u}addHCMFilter(n,r){var y;const s=`${n}-${r}`,i="base";let a=h(this,he,Qx).get(i);if((a==null?void 0:a.key)===s||(a?((y=a.filter)==null||y.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},h(this,he,Qx).set(i,a)),!n||!r))return a.url;const o=j(this,he,tv).call(this,n);n=pe.makeHexColor(...o);const l=j(this,he,tv).call(this,r);if(r=pe.makeHexColor(...l),h(this,he,Bp).style.color="",n==="#000000"&&r==="#ffffff"||n===r)return a.url;const u=new Array(256);for(let g=0;g<=255;g++){const b=g/255;u[g]=b<=.03928?b/12.92:((b+.055)/1.055)**2.4}const d=u.join(","),f=`g_${h(this,Ml)}_hcm_filter`,p=a.filter=j(this,he,Up).call(this,f);j(this,he,ev).call(this,d,d,d,p),j(this,he,i2).call(this,p);const m=(g,b)=>{const x=o[g]/255,w=l[g]/255,v=new Array(b+1);for(let S=0;S<=b;S++)v[S]=x+S/b*(w-x);return v.join(",")};return j(this,he,ev).call(this,m(0,5),m(1,5),m(2,5),p),a.url=j(this,he,$p).call(this,f),a.url}addAlphaFilter(n){let r=h(this,he,Mr).get(n);if(r)return r;const[s]=j(this,he,Rk).call(this,[n]),i=`alpha_${s}`;if(r=h(this,he,Mr).get(i),r)return h(this,he,Mr).set(n,r),r;const a=`g_${h(this,Ml)}_alpha_map_${pn(this,Hh)._++}`,o=j(this,he,$p).call(this,a);h(this,he,Mr).set(n,o),h(this,he,Mr).set(i,o);const l=j(this,he,Up).call(this,a);return j(this,he,a2).call(this,s,l),o}addLuminosityFilter(n){let r=h(this,he,Mr).get(n||"luminosity");if(r)return r;let s,i;if(n?([s]=j(this,he,Rk).call(this,[n]),i=`luminosity_${s}`):i="luminosity",r=h(this,he,Mr).get(i),r)return h(this,he,Mr).set(n,r),r;const a=`g_${h(this,Ml)}_luminosity_map_${pn(this,Hh)._++}`,o=j(this,he,$p).call(this,a);h(this,he,Mr).set(n,o),h(this,he,Mr).set(i,o);const l=j(this,he,Up).call(this,a);return j(this,he,$q).call(this,l),n&&j(this,he,a2).call(this,s,l),o}addHighlightHCMFilter(n,r,s,i,a){var w;const o=`${r}-${s}-${i}-${a}`;let l=h(this,he,Qx).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},h(this,he,Qx).set(n,l)),!r||!s))return l.url;const[u,d]=[r,s].map(j(this,he,tv).bind(this));let f=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),p=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),[m,y]=[i,a].map(j(this,he,tv).bind(this));p<f&&([f,p,m,y]=[p,f,y,m]),h(this,he,Bp).style.color="";const g=(v,S,E)=>{const C=new Array(256),T=(p-f)/E,P=v/255,M=(S-v)/(255*E);let R=0;for(let O=0;O<=E;O++){const L=Math.round(f+O*T),U=P+O*M;for(let B=R;B<=L;B++)C[B]=U;R=L+1}for(let O=R;O<256;O++)C[O]=C[R-1];return C.join(",")},b=`g_${h(this,Ml)}_hcm_${n}
691_filter`,x=l.filter=j(this,he,Up).call(this,b);return j(this,he,i2).call(this,x),j(this,he,ev).call(this,g(m[0],y[0],5),g(m[1],y[1],5),g(m[2],y[2],5),x),l.url=j(this,he,$p).call(this,b),l.url}destroy(n=!1){var r,s,i,a;n&&((r=h(this,Wh))!=null&&r.size)||((s=h(this,Dl))==null||s.parentNode.parentNode.remove(),_(this,Dl,null),(i=h(this,ug))==null||i.clear(),_(this,ug,null),(a=h(this,Wh))==null||a.clear(),_(this,Wh,null),_(this,Hh,0))}}Vh=new WeakMap,ug=new WeakMap,Dl=new WeakMap,Ml=new WeakMap,Br=new WeakMap,Wh=new WeakMap,Hh=new WeakMap,he=new WeakSet,Mr=function(){return h(this,ug)||_(this,ug,new Map)},Qx=function(){return h(this,Wh)||_(this,Wh,new Map)},Bp=function(){if(!h(this,Dl)){const n=h(this,Br).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 s=h(this,Br).createElementNS(fl,"svg");s.setAttribute("width",0),s.setAttribute("height",0),_(this,Dl,h(this,Br).createElementNS(fl,"defs")),n.append(s),s.append(h(this,Dl)),h(this,Br).body.append(n)}return h(this,Dl)},Rk=function(n){if(n.length===1){const u=n[0],d=new Array(256);for(let p=0;p<256;p++)d[p]=u[p]/255;const f=d.join(",");return[f,f,f]}const[r,s,i]=n,a=new Array(256),o=new Array(256),l=new Array(256);for(let u=0;u<256;u++)a[u]=r[u]/255,o[u]=s[u]/255,l[u]=i[u]/255;return[a.join(","),o.join(","),l.join(",")]},$p=function(n){if(h(this,Vh)===void 0){_(this,Vh,"");const r=h(this,Br).URL;r!==h(this,Br).baseURI&&(V0(r)?ze('#createUrl: ignore "data:"-URL for performance reasons.'):_(this,Vh,dD(r,"")))}return`url(${h(this,Vh)}#${n})`},$q=function(n){const r=h(this,Br).createElementNS(fl,"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)},i2=function(n){const r=h(this,Br).createElementNS(fl,"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)},Up=function(n){const r=h(this,Br).createElementNS(fl,"filter");return r.setAttribute("color-interpolation-filters","sRGB"),r.setAttribute("id",n),h(this,he,Bp).append(r),r},Jx=function(n,r,s){const i=h(this,Br).createElementNS(fl,r);i.setAttribute("type","discrete"),i.setAttribute("tableValues",s),n.append(i)},ev=function(n,r,s,i){const a=h(this,Br).createElementNS(fl,"feComponentTransfer");i.append(a),j(this,he,Jx).call(this,a,"feFuncR",n),j(this,he,Jx).call(this,a,"feFuncG",r),j(this,he,Jx).call(this,a,"feFuncB",s)},a2=function(n,r){const s=h(this,Br).createElementNS(fl,"feComponentTransfer");r.append(s),j(this,he,Jx).call(this,s,"feFuncA",n)},tv=function(n){return h(this,he,Bp).style.color=n,sx(getComputedStyle(h(this,he,Bp)).getPropertyValue("color"))};class Uq{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const n=`${this.baseUrl}${e}`;return this._fetch(n).catch(r=>{throw new Error(`Unable to load font data at: ${n}`)})}async _fetch(e){Lt("Abstract method `_fetch` called.")}}class H3 extends Uq{async _fetch(e){const n=await rx(e,"arraybuffer");return new Uint8Array(n)}}class zq{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const n=`${this.baseUrl}${e}`;return this._fetch(n).catch(r=>{throw new Error(`Unable to load wasm data at: ${n}`)})}async _fetch(e){Lt("Abstract method `_fetch` called.")}}class q3 extends zq{async _fetch(e){const n=await rx(e,"arraybuffer");return new Uint8Array(n)}}ls&&ze("Please use the `legacy` build in Node.js environments.");async function yD(t){const n=await process.getBuiltinModule("fs").promises.readFile(t);return new Uint8Array(n)}class FSe extends Bq{}class BSe extends Lq{_createCanvas(e,n){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(e,n)}}class $Se extends Fq{async _fetch(e){return yD(e)}}class USe extends Uq{async _fetch(e){return yD(e)}}class zSe extends zq{async _fetch(e){return yD(e)}}const jp="__forcedDependency",{floor:G3,ceil:K3}=Math;function z1(t,e,n,r,s,i){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],s),t[e*4+3]=Math.max(t[e*4+3],i)}const o2=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];var dg,mu;class VSe{constructor(e,n){A(this,dg);A(this,mu);_(this,dg,e),_(this,mu,n)}get length(){return h(this,dg).length}isEmpty(e){return h(this,dg)[e]===o2}minX(e){return h(this,mu)[e*4+0]/256}minY(e){return h(this,mu)[e*4+1]/256}
691maxX(e){return(h(this,mu)[e*4+2]+1)/256}maxY(e){return(h(this,mu)[e*4+3]+1)/256}}dg=new WeakMap,mu=new WeakMap;const V1=(t,e)=>{if(!t)return;let n=t.get(e);return n||(n={dependencies:new Set,isRenderingOperation:!1},t.set(e,n)),n};var Is,Ds,qh,La,Gh,Ol,kt,At,Ll,Ms,uw,hg,Kh,Yh,Fl,$r,Po,dw,l2;class WSe{constructor(e,n,r=!1){A(this,dw);A(this,Is,{__proto__:null});A(this,Ds,{__proto__:null,transform:[],moveText:[],sameLineText:[],[jp]:[]});A(this,qh,new Map);A(this,La,[]);A(this,Gh,[]);A(this,Ol,[[1,0,0,1,0,0]]);A(this,kt,[-1/0,-1/0,1/0,1/0]);A(this,At,new Float64Array([1/0,1/0,-1/0,-1/0]));A(this,Ll,-1);A(this,Ms,new Set);A(this,uw,new Map);A(this,hg,new Map);A(this,Kh);A(this,Yh);A(this,Fl);A(this,$r);A(this,Po);_(this,Kh,e.width),_(this,Yh,e.height),j(this,dw,l2).call(this,n),r&&_(this,Po,new Map)}growOperationsCount(e){e>=h(this,$r).length&&j(this,dw,l2).call(this,e,h(this,$r))}save(e){return _(this,Is,{__proto__:h(this,Is)}),_(this,Ds,{__proto__:h(this,Ds),transform:{__proto__:h(this,Ds).transform},moveText:{__proto__:h(this,Ds).moveText},sameLineText:{__proto__:h(this,Ds).sameLineText},[jp]:{__proto__:h(this,Ds)[jp]}}),_(this,kt,{__proto__:h(this,kt)}),h(this,La).push(e),this}restore(e){var s;const n=Object.getPrototypeOf(h(this,Is));if(n===null)return this;_(this,Is,n),_(this,Ds,Object.getPrototypeOf(h(this,Ds))),_(this,kt,Object.getPrototypeOf(h(this,kt)));const r=h(this,La).pop();return r!==void 0&&((s=V1(h(this,Po),e))==null||s.dependencies.add(r),h(this,$r)[e]=h(this,$r)[r]),this}recordOpenMarker(e){return h(this,La).push(e),this}getOpenMarker(){return h(this,La).length===0?null:h(this,La).at(-1)}recordCloseMarker(e){var r;const n=h(this,La).pop();return n!==void 0&&((r=V1(h(this,Po),e))==null||r.dependencies.add(n),h(this,$r)[e]=h(this,$r)[n]),this}beginMarkedContent(e){return h(this,Gh).push(e),this}endMarkedContent(e){var r;const n=h(this,Gh).pop();return n!==void 0&&((r=V1(h(this,Po),e))==null||r.dependencies.add(n),h(this,$r)[e]=h(this,$r)[n]),this}pushBaseTransform(e){return h(this,Ol).push(pe.multiplyByDOMMatrix(h(this,Ol).at(-1),e.getTransform())),this}popBaseTransform(){return h(this,Ol).length>1&&h(this,Ol).pop(),this}recordSimpleData(e,n){return h(this,Is)[e]=n,this}recordIncrementalData(e,n){return h(this,Ds)[e].push(n),this}resetIncrementalData(e,n){return h(this,Ds)[e].length=0,this}recordNamedData(e,n){return h(this,qh).set(e,n),this}recordSimpleDataFromNamed(e,n,r){h(this,Is)[e]=h(this,qh).get(n)??r}recordFutureForcedDependency(e,n){return this.recordIncrementalData(jp,n),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const n of e)n in h(this,Is)&&this.recordFutureForcedDependency(n,h(this,Is)[n]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of h(this,Ms))this.recordFutureForcedDependency(jp,e);return this}resetBBox(e){return h(this,Ll)!==e&&(_(this,Ll,e),h(this,At)[0]=1/0,h(this,At)[1]=1/0,h(this,At)[2]=-1/0,h(this,At)[3]=-1/0),this}recordClipBox(e,n,r,s,i,a){const o=pe.multiplyByDOMMatrix(h(this,Ol).at(-1),n.getTransform()),l=[1/0,1/0,-1/0,-1/0];pe.axialAlignedBoundingBox([r,i,s,a],o,l);const u=pe.intersect(h(this,kt),l);return u?(h(this,kt)[0]=u[0],h(this,kt)[1]=u[1],h(this,kt)[2]=u[2],h(this,kt)[3]=u[3]):(h(this,kt)[0]=h(this,kt)[1]=1/0,h(this,kt)[2]=h(this,kt)[3]=-1/0),this}recordBBox(e,n,r,s,i,a){const o=h(this,kt);if(o[0]===1/0)return this;const l=pe.multiplyByDOMMatrix(h(this,Ol).at(-1),n.getTransform());if(o[0]===-1/0)return pe.axialAlignedBoundingBox([r,i,s,a],l,h(this,At)),this;const u=[1/0,1/0,-1/0,-1/0];return pe.axialAlignedBoundingBox([r,i,s,a],l,u),h(this,At)[0]=Math.min(h(this,At)[0],Math.max(u[0],o[0])),h(this,At)[1]=Math.min(h(this,At)[1],Math.max(u[1],o[1])),h(this,At)[2]=Math.max(h(this,At)[2],Math.min(u[2],o[2])),h(this,At)[3]=Math.max(h(this,At)[3],Math.min(u[3],o[3])),this}recordCharacterBBox(e,n,r,s=1,i=0,a=0,o){const l=r.bbox;let u,d;if(l&&(u=l[2]!==l[0]&&l[3]!==l[1]&&h(this,hg).get(r),u!==!1&&(d=[0,0,0,0],pe.axialAlignedBoundingBox(l,r.fontMatrix,d),(s!==1||i!==0||a!==0)&&pe.scaleMinMax([s,0,0,-s,i,a],d),u)))return this.recordBBox(e,n,d[0],d[2],d[1],d[3]);if(!o)return this.recordFullPageBBox(e);const f=o();return l&&d&&u===void 0&&(u=d[0]<=i-f.actualBoundingBoxLeft&&d[2]>=i+f.actualBoundingBoxRight&&d[1]<=a-f.actualBoundingBoxAscent&&d[3]>=a+f.actualBoundingBoxDescent,h(this,hg).set(r,u),u)?this.recordBBox(e,n,d[0],d[2],d[1],d[3]):this.recordBBox(e,n,i-f.actualBoundingBoxLeft,i+f.actualBoundingBoxRight,a-f.actualBoundingBoxAscent,a+f.actualBoundingBoxDescent)}recordFullPageBBox(e){return h(this,At)[0]=Math.max(0,h(this,kt)[0]),h(this,At)[1]=Math.max(0,h(this,kt)[1]),h(this,At)[2]=Math.min(h(this,Kh),h(this,kt)[2]),h(this,At)[3]=Math.min(h(this,Yh),h(this,kt)[3]),this}getSimpleIndex(e){return h(this,Is)[e]}recordDependencies(e,n){const r=h(this,Ms),s=h(this,Is),i=h(this,Ds);
691for(const a of n)a in h(this,Is)?r.add(s[a]):a in i&&i[a].forEach(r.add,r);return this}recordNamedDependency(e,n){return h(this,qh).has(n)&&h(this,Ms).add(h(this,qh).get(n)),this}recordOperation(e,n=!1){if(this.recordDependencies(e,[jp]),h(this,Po)){const r=V1(h(this,Po),e),{dependencies:s}=r;h(this,Ms).forEach(s.add,s),h(this,La).forEach(s.add,s),h(this,Gh).forEach(s.add,s),s.delete(e),r.isRenderingOperation=!0}if(h(this,Ll)===e){const r=G3(h(this,At)[0]*256/h(this,Kh)),s=G3(h(this,At)[1]*256/h(this,Yh)),i=K3(h(this,At)[2]*256/h(this,Kh)),a=K3(h(this,At)[3]*256/h(this,Yh));z1(h(this,Fl),e,r,s,i,a);for(const o of h(this,Ms))o!==e&&z1(h(this,Fl),o,r,s,i,a);for(const o of h(this,La))o!==e&&z1(h(this,Fl),o,r,s,i,a);for(const o of h(this,Gh))o!==e&&z1(h(this,Fl),o,r,s,i,a);n||(h(this,Ms).clear(),_(this,Ll,-1))}return this}recordShowTextOperation(e,n=!1){const r=Array.from(h(this,Ms));this.recordOperation(e,n),this.recordIncrementalData("sameLineText",e);for(const s of r)this.recordIncrementalData("sameLineText",s);return this}bboxToClipBoxDropOperation(e,n=!1){return h(this,Ll)===e&&(_(this,Ll,-1),h(this,kt)[0]=Math.max(h(this,kt)[0],h(this,At)[0]),h(this,kt)[1]=Math.max(h(this,kt)[1],h(this,At)[1]),h(this,kt)[2]=Math.min(h(this,kt)[2],h(this,At)[2]),h(this,kt)[3]=Math.min(h(this,kt)[3],h(this,At)[3]),n||h(this,Ms).clear()),this}_takePendingDependencies(){const e=h(this,Ms);return _(this,Ms,new Set),e}_extractOperation(e){const n=h(this,uw).get(e);return h(this,uw).delete(e),n}_pushPendingDependencies(e){for(const n of e)h(this,Ms).add(n)}take(){return h(this,hg).clear(),new VSe(h(this,$r),h(this,Fl))}takeDebugMetadata(){return h(this,Po)}}Is=new WeakMap,Ds=new WeakMap,qh=new WeakMap,La=new WeakMap,Gh=new WeakMap,Ol=new WeakMap,kt=new WeakMap,At=new WeakMap,Ll=new WeakMap,Ms=new WeakMap,uw=new WeakMap,hg=new WeakMap,Kh=new WeakMap,Yh=new WeakMap,Fl=new WeakMap,$r=new WeakMap,Po=new WeakMap,dw=new WeakSet,l2=function(e,n){const r=new ArrayBuffer(e*4);_(this,Fl,new Uint8ClampedArray(r)),_(this,$r,new Uint32Array(r)),n&&n.length>0?(h(this,$r).set(n),h(this,$r).fill(o2,n.length)):h(this,$r).fill(o2)};var It,xn,Fa,fg,pg;const ND=class ND{constructor(e,n,r){A(this,It);A(this,xn);A(this,Fa);A(this,fg,0);A(this,pg,0);if(e instanceof ND&&h(e,Fa)===!!r)return e;_(this,It,e),_(this,xn,n),_(this,Fa,!!r)}growOperationsCount(){throw new Error("Unreachable")}save(e){return pn(this,pg)._++,h(this,It).save(h(this,xn)),this}restore(e){return h(this,pg)>0&&(h(this,It).restore(h(this,xn)),pn(this,pg)._--),this}recordOpenMarker(e){return pn(this,fg)._++,this}getOpenMarker(){return h(this,fg)>0?h(this,xn):h(this,It).getOpenMarker()}recordCloseMarker(e){return pn(this,fg)._--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return h(this,It).pushBaseTransform(e),this}popBaseTransform(){return h(this,It).popBaseTransform(),this}recordSimpleData(e,n){return h(this,It).recordSimpleData(e,h(this,xn)),this}recordIncrementalData(e,n){return h(this,It).recordIncrementalData(e,h(this,xn)),this}resetIncrementalData(e,n){return h(this,It).resetIncrementalData(e,h(this,xn)),this}recordNamedData(e,n){return this}recordSimpleDataFromNamed(e,n,r){return h(this,It).recordSimpleDataFromNamed(e,n,h(this,xn)),this}recordFutureForcedDependency(e,n){return h(this,It).recordFutureForcedDependency(e,h(this,xn)),this}inheritSimpleDataAsFutureForcedDependencies(e){return h(this,It).inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return h(this,It).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return h(this,Fa)||h(this,It).resetBBox(h(this,xn)),this}recordClipBox(e,n,r,s,i,a){return h(this,Fa)||h(this,It).recordClipBox(h(this,xn),n,r,s,i,a),this}recordBBox(e,n,r,s,i,a){return h(this,Fa)||h(this,It).recordBBox(h(this,xn),n,r,s,i,a),this}recordCharacterBBox(e,n,r,s,i,a,o){return h(this,Fa)||h(this,It).recordCharacterBBox(h(this,xn),n,r,s,i,a,o),this}recordFullPageBBox(e){return h(this,Fa)||h(this,It).recordFullPageBBox(h(this,xn)),this}getSimpleIndex(e){return h(this,It).getSimpleIndex(e)}recordDependencies(e,n){return h(this,It).recordDependencies(h(this,xn),n),this}recordNamedDependency(e,n){return h(this,It).recordNamedDependency(h(this,xn),n),this}recordOperation(e){return h(this,It).recordOperation(h(this,xn),!0),this}recordShowTextOperation(e){return h(this,It).recordShowTextOperation(h(this,xn),!0),this}bboxToClipBoxDropOperation(e){return h(this,Fa)||h(this,It).bboxToClipBoxDropOperation(h(this,xn),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};It=new WeakMap,xn=new WeakMap,Fa=new WeakMap,fg=new WeakMap,pg=new WeakMap;let p_=ND;const Ui={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
691ilter","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"]},Er={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function c2(t,e){if(!e)return;const n=e[2]-e[0],r=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],n,r),t.clip(s)}class xD{isModifyingCurrentTransform(){return!1}getPattern(){Lt("Abstract method `getPattern` called.")}}class HSe extends xD{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let n;this._type==="axial"?n=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(n=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)n.addColorStop(r[0],r[1]);return n}getPattern(e,n,r,s){let i;if(s===Er.STROKE||s===Er.FILL){const a=n.current.getClippedPathBoundingBox(s,sn(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,l=Math.ceil(a[3]-a[1])||1,u=n.cachedCanvases.getCanvas("pattern",o,l),d=u.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-a[0],-a[1]),r=pe.transform(r,[1,0,0,1,a[0],a[1]]),d.transform(...n.baseTransform),this.matrix&&d.transform(...this.matrix),c2(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),i=e.createPattern(u.canvas,"no-repeat");const f=new DOMMatrix(r);i.setTransform(f)}else c2(e,this._bbox),i=this._createGradient(e);return i}}function nT(t,e,n,r,s,i,a,o){const l=e.coords,u=e.colors,d=t.data,f=t.width*4;let p;l[n+1]>l[r+1]&&(p=n,n=r,r=p,p=i,i=a,a=p),l[r+1]>l[s+1]&&(p=r,r=s,s=p,p=a,a=o,o=p),l[n+1]>l[r+1]&&(p=n,n=r,r=p,p=i,i=a,a=p);const m=(l[n]+e.offsetX)*e.scaleX,y=(l[n+1]+e.offsetY)*e.scaleY,g=(l[r]+e.offsetX)*e.scaleX,b=(l[r+1]+e.offsetY)*e.scaleY,x=(l[s]+e.offsetX)*e.scaleX,w=(l[s+1]+e.offsetY)*e.scaleY;if(y>=w)return;const v=u[i],S=u[i+1],E=u[i+2],C=u[a],T=u[a+1],P=u[a+2],M=u[o],R=u[o+1],O=u[o+2],L=Math.round(y),U=Math.round(w);let B,H,z,V,$,I,N,W;for(let q=L;q<=U;q++){if(q<b){const Y=q<y?0:(y-q)/(y-b);B=m-(m-g)*Y,H=v-(v-C)*Y,z=S-(S-T)*Y,V=E-(E-P)*Y}else{let Y;q>w?Y=1:b===w?Y=0:Y=(b-q)/(b-w),B=g-(g-x)*Y,H=C-(C-M)*Y,z=T-(T-R)*Y,V=P-(P-O)*Y}let D;q<y?D=0:q>w?D=1:D=(y-q)/(y-w),$=m-(m-x)*D,I=v-(v-M)*D,N=S-(S-R)*D,W=E-(E-O)*D;const Q=Math.round(Math.min(B,$)),X=Math.round(Math.max(B,$));let se=f*q+Q*4;for(let Y=Q;Y<=X;Y++)D=(B-Y)/(B-$),D<0?D=0:D>1&&(D=1),d[se++]=H-(H-I)*D|0,d[se++]=z-(z-N)*D|0,d[se++]=V-(V-W)*D|0,d[se++]=255}}function qSe(t,e,n){const r=e.coords,s=e.colors;let i,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(r.length/o)-1,u=o-1;for(i=0;i<l;i++){let d=i*o;for(let f=0;f<u;f++,d++)nT(t,n,r[d],r[d+1],r[d+o],s[d],s[d+1],s[d+o]),nT(t,n,r[d+o+1],r[d+1],r[d+o],s[d+o+1],s[d+1],s[d+o])}break;case"triangles":for(i=0,a=r.length;i<a;i+=3)nT(t,n,r[i],r[i+1],r[i+2],s[i],s[i+1],s[i+2]);break;default:throw new Error("illegal figure")}}class GSe extends xD{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,n,r){const o=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-o,d=Math.ceil(this._bounds[3])-l,f=Math.min(Math.ceil(Math.abs(u*e[0]*1.1)),3e3),p=Math.min(Math.ceil(Math.abs(d*e[1]*1.1)),3e3),m=u/f,y=d/p,g={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-l,scaleX:1/m,scaleY:1/y},b=f+2*2,x=p+2*2,w=r.getCanvas("mesh",b,x),v=w.context,S=v.createImageData(f,p);if(n){const C=S.data;for(let T=0,P=C.length;T<P;T+=4)C[T]=n[0],C[T+1]=n[1],C[T+2]=n[2],C[T+3]=255}for(const C of this._figures)qSe(S,C,g);return v.putImageData(S,2,2),{canvas:w.canvas,offsetX:o-2*m,offsetY:l-2*y,scaleX:m,scaleY:y}}isModifyingCurrentTransform(){return!0}getPattern(e,n,r,s){c2(e,this._bbox);const i=new Float32Array(2);if(s===Er.SHADING)pe.singularValueDecompose2dScale(sn(e),i);
691else if(this.matrix){pe.singularValueDecompose2dScale(this.matrix,i);const[o,l]=i;pe.singularValueDecompose2dScale(n.baseTransform,i),i[0]*=o,i[1]*=l}else pe.singularValueDecompose2dScale(n.baseTransform,i);const a=this._createMeshCanvas(i,s===Er.SHADING?null:this._background,n.cachedCanvases);return s!==Er.SHADING&&(e.setTransform(...n.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,"no-repeat")}}class KSe extends xD{getPattern(){return"hotpink"}}function YSe(t){switch(t[0]){case"RadialAxial":return new HSe(t);case"Mesh":return new GSe(t);case"Dummy":return new KSe}throw new Error(`Unknown IR type: ${t[0]}`)}const Y3={COLORED:1,UNCOLORED:2},P_=class P_{constructor(e,n,r,s){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=n,this.canvasGraphicsFactory=r,this.baseTransform=s}createPatternCanvas(e,n){var I,N;const{bbox:r,operatorList:s,paintType:i,tilingType:a,color:o,canvasGraphicsFactory:l}=this;let{xstep:u,ystep:d}=this;u=Math.abs(u),d=Math.abs(d),KE("TilingType: "+a);const f=r[0],p=r[1],m=r[2],y=r[3],g=m-f,b=y-p,x=new Float32Array(2);pe.singularValueDecompose2dScale(this.matrix,x);const[w,v]=x;pe.singularValueDecompose2dScale(this.baseTransform,x);const S=w*x[0],E=v*x[1];let C=g,T=b,P=!1,M=!1;const R=Math.ceil(u*S),O=Math.ceil(d*E),L=Math.ceil(g*S),U=Math.ceil(b*E);R>=L?C=u:P=!0,O>=U?T=d:M=!0;const B=this.getSizeAndScale(C,this.ctx.canvas.width,S),H=this.getSizeAndScale(T,this.ctx.canvas.height,E),z=e.cachedCanvases.getCanvas("pattern",B.size,H.size),V=z.context,$=l.createCanvasGraphics(V,n);if($.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext($,i,o),V.translate(-B.scale*f,-H.scale*p),$.transform(0,B.scale,0,0,H.scale,0,0),V.save(),(I=$.dependencyTracker)==null||I.save(),this.clipBbox($,f,p,m,y),$.baseTransform=sn($.ctx),$.executeOperatorList(s),$.endDrawing(),(N=$.dependencyTracker)==null||N.restore(),V.restore(),P||M){const W=z.canvas;P&&(C=u),M&&(T=d);const q=this.getSizeAndScale(C,this.ctx.canvas.width,S),D=this.getSizeAndScale(T,this.ctx.canvas.height,E),Q=q.size,X=D.size,se=e.cachedCanvases.getCanvas("pattern-workaround",Q,X),Y=se.context,de=P?Math.floor(g/u):0,Ie=M?Math.floor(b/d):0;for(let _e=0;_e<=de;_e++)for(let Ee=0;Ee<=Ie;Ee++)Y.drawImage(W,Q*_e,X*Ee,Q,X,0,0,Q,X);return{canvas:se.canvas,scaleX:q.scale,scaleY:D.scale,offsetX:f,offsetY:p}}return{canvas:z.canvas,scaleX:B.scale,scaleY:H.scale,offsetX:f,offsetY:p}}getSizeAndScale(e,n,r){const s=Math.max(P_.MAX_PATTERN_SIZE,n);let i=Math.ceil(e*r);return i>=s?i=s:r=i/e,{scale:r,size:i}}clipBbox(e,n,r,s,i){const a=s-n,o=i-r;e.ctx.rect(n,r,a,o),pe.axialAlignedBoundingBox([n,r,s,i],sn(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,n,r){const s=e.ctx,i=e.current;switch(n){case Y3.COLORED:const{fillStyle:a,strokeStyle:o}=this.ctx;s.fillStyle=i.fillColor=a,s.strokeStyle=i.strokeColor=o;break;case Y3.UNCOLORED:s.fillStyle=s.strokeStyle=r,i.fillColor=i.strokeColor=r;break;default:throw new gSe(`Unsupported paint type: ${n}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,n,r,s,i){let a=r;s!==Er.SHADING&&(a=pe.transform(a,n.baseTransform),this.matrix&&(a=pe.transform(a,this.matrix)));const o=this.createPatternCanvas(n,i);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY),l=l.scale(1/o.scaleX,1/o.scaleY);const u=e.createPattern(o.canvas,"repeat");return u.setTransform(l),u}};Z(P_,"MAX_PATTERN_SIZE",3e3);let u2=P_;function XSe({src:t,srcPos:e=0,dest:n,width:r,height:s,nonBlackColor:i=4294967295,inverseDecode:a=!1}){const o=hr.isLittleEndian?4278190080:255,[l,u]=a?[i,o]:[o,i],d=r>>3,f=r&7,p=t.length;n=new Uint32Array(n.buffer);let m=0;for(let y=0;y<s;y++){for(const b=e+d;e<b;e++){const x=e<p?t[e]:255;n[m++]=x&128?u:l,n[m++]=x&64?u:l,n[m++]=x&32?u:l,n[m++]=x&16?u:l,n[m++]=x&8?u:l,n[m++]=x&4?u:l,n[m++]=x&2?u:l,n[m++]=x&1?u:l}if(f===0)continue;const g=e<p?t[e++]:255;for(let b=0;b<f;b++)n[m++]=g&1<<7-b?u:l}return{srcPos:e,destPos:m}}const X3=16,Z3=100,ZSe=15,Q3=10,$s=16,rT=new DOMMatrix,Si=new Float32Array(2),cm=new Float32Array([1/0,1/0,-1/0,-1/0]);function QSe(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()}
691,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,s,i,a,o){e.transform(n,r,s,i,a,o),this.__originalTransform(n,r,s,i,a,o)},t.setTransform=function(n,r,s,i,a,o){e.setTransform(n,r,s,i,a,o),this.__originalSetTransform(n,r,s,i,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,s,i,a,o){e.bezierCurveTo(n,r,s,i,a,o),this.__originalBezierCurveTo(n,r,s,i,a,o)},t.rect=function(n,r,s,i){e.rect(n,r,s,i),this.__originalRect(n,r,s,i)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class JSe{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,n,r){let s;return this.cache[e]!==void 0?(s=this.cache[e],this.canvasFactory.reset(s,n,r)):(s=this.canvasFactory.create(n,r),this.cache[e]=s),s}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const n=this.cache[e];this.canvasFactory.destroy(n),delete this.cache[e]}}}function W1(t,e,n,r,s,i,a,o,l,u){const[d,f,p,m,y,g]=sn(t);if(f===0&&p===0){const w=a*d+y,v=Math.round(w),S=o*m+g,E=Math.round(S),C=(a+l)*d+y,T=Math.abs(Math.round(C)-v)||1,P=(o+u)*m+g,M=Math.abs(Math.round(P)-E)||1;return t.setTransform(Math.sign(d),0,0,Math.sign(m),v,E),t.drawImage(e,n,r,s,i,0,0,T,M),t.setTransform(d,f,p,m,y,g),[T,M]}if(d===0&&m===0){const w=o*p+y,v=Math.round(w),S=a*f+g,E=Math.round(S),C=(o+u)*p+y,T=Math.abs(Math.round(C)-v)||1,P=(a+l)*f+g,M=Math.abs(Math.round(P)-E)||1;return t.setTransform(0,Math.sign(f),Math.sign(p),0,v,E),t.drawImage(e,n,r,s,i,0,0,M,T),t.setTransform(d,f,p,m,y,g),[M,T]}t.drawImage(e,n,r,s,i,a,o,l,u);const b=Math.hypot(d,f),x=Math.hypot(p,m);return[b*l,x*u]}class J3{constructor(e,n,r){Z(this,"alphaIsShape",!1);Z(this,"fontSize",0);Z(this,"fontSizeScale",1);Z(this,"textMatrix",null);Z(this,"textMatrixScale",1);Z(this,"fontMatrix",ON);Z(this,"leading",0);Z(this,"x",0);Z(this,"y",0);Z(this,"lineX",0);Z(this,"lineY",0);Z(this,"charSpacing",0);Z(this,"wordSpacing",0);Z(this,"textHScale",1);Z(this,"textRenderingMode",yr.FILL);Z(this,"textRise",0);Z(this,"fillColor","#000000");Z(this,"strokeColor","#000000");Z(this,"patternFill",!1);Z(this,"patternStroke",!1);Z(this,"fillAlpha",1);Z(this,"strokeAlpha",1);Z(this,"lineWidth",1);Z(this,"activeSMask",null);Z(this,"transferMaps","none");r==null||r(this),this.clipBox=new Float32Array([0,0,e,n]),this.minMax=cm.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=Er.FILL,n=null){const r=this.minMax.slice();if(e===Er.STROKE){n||Lt("Stroke bounding box must include transform."),pe.singularValueDecompose2dScale(n,Si);const s=Si[0]*this.lineWidth/2,i=Si[1]*this.lineWidth/2;r[0]-=s,r[1]-=i,r[2]+=s,r[3]+=i}return r}updateClipFromPath(){const e=pe.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(cm,0)}getClippedPathBoundingBox(e=Er.FILL,n=null){return pe.intersect(this.clipBox,this.getPathBoundingBox(e,n))}}function e5(t,e){if(e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,r=e.width,s=n%$s,i=(n-s)/$s,a=s===0?i:i+1,o=t.createImageData(r,$s);let l=0,u;const d=e.data,f=o.data;let p,m,y,g;if(e.kind===Ov.GRAYSCALE_1BPP){const b=d.byteLength,x=new Uint32Array(f.buffer,0,f.byteLength>>2),w=x.length,v=r+7>>3,S=4294967295,E=hr.isLittleEndian?4278190080:255;for(p=0;p<a;p++){for(y=p<i?$s:s,u=0,m=0;m<y;m++){const C=b-l;let T=0;const P=C>v?r:C*8-7,M=P&-8;let R=0,O=0;for(;T<M;T+=8)O=d[l++],x[u++]=O&128?S:E,x[u++]=O&64?S:E,x[u++]=O&32?S:E,x[u++]=O&16?S:E,x[u++]=O&8?S:E,x[u++]=O&4?S:E,x[u++]=O&2?S:E,x[u++]=O&1?S:E;for(;T<P;T++)R===0&&(O=d[l++],R=128),x[u++]=O&R?S:E,R>>=1}for(;u<w;)x[u++]=0;t.putImageData(o,0,p*$s)}}else if(e.kind===Ov.RGBA_32BPP){for(m=0,g=r*$s*4,p=0;p<i;p++)f.set(d.subarray(l,l+g)),l+=g,t.putImageData(o,0,m),m+=$s;p<a&&(g=r*s*4,f.set(d.subarray(l,l+g)),t.putImageData(o,0,m))}else if(e.kind===Ov.RGB_24BPP)for(y=$s,g=r*y,p=0;p<a;p++){for(p>=i&&(y=s,g=r*y),u=0,m=g;m--;)f[u++]=d[l++],f[u++]=d[l++],f[u++]=d[l++],f[u++]=255;t.putImageData(o,0,p*$s)}else throw new Error(`bad image kind: ${e.kind}`)}function t5(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const n=e.height,r=e.width,s=n%$s,i=(n-s)/$s,a=s===0?i:i+1,o=t.createImageData(r,$s);let l=0;const u=e.data,d=o.data;for(let f=0;f<a;f++){const p=f<i?$s:s;({srcPos:l}=XSe({src:u,srcPos:l,dest:d,width:r,height:p,nonBlackColor:0})),t.putImageData(o,0,f*$s)}}function Nx(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 H1(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miter
691Limit=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 n5(t,e){if(e)return!0;pe.singularValueDecompose2dScale(t,Si);const n=Math.fround(so.pixelRatio*bc.PDF_TO_CSS_UNITS);return Si[0]<=n&&Si[1]<=n}const e_e=["butt","round","square"],t_e=["miter","round","bevel"],n_e={},r5={};var io,d2,h2,f2;const PD=class PD{constructor(e,n,r,s,i,{optionalContentConfig:a,markedContentStack:o=null},l,u,d){A(this,io);this.ctx=e,this.current=new J3(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=n,this.objs=r,this.canvasFactory=s,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedCanvases=new JSe(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=d??null}getObject(e,n,r=null){var s;return typeof n=="string"?((s=this.dependencyTracker)==null||s.recordNamedDependency(e,n),n.startsWith("g_")?this.commonObjs.get(n):this.objs.get(n)):r}beginDrawing({transform:e,viewport:n,transparency:r=!1,background:s=null}){const i=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=o,r){const l=this.cachedCanvases.getCanvas("transparent",i,a);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...sn(this.compositeCtx))}this.ctx.save(),H1(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=sn(this.ctx)}executeOperatorList(e,n,r,s,i){var x;const a=e.argsArray,o=e.fnArray;let l=n||0;const u=a.length;if(u===l)return l;const d=u-l>Q3&&typeof r=="function",f=d?Date.now()+ZSe:0;let p=0;const m=this.commonObjs,y=this.objs;let g,b;for(;;){if(s!==void 0&&l===s.nextBreakPoint)return s.breakIt(l,r),l;if(!i||i(l))if(g=o[l],b=a[l]??null,g!==Oy.dependency)b===null?this[g](l):this[g](l,...b);else for(const w of b){(x=this.dependencyTracker)==null||x.recordNamedData(w,l);const v=w.startsWith("g_")?m:y;if(!v.has(w))return v.get(w,r),l}if(l++,l===u)return l;if(d&&++p>Q3){if(Date.now()>f)return r(),l;p=0}}}endDrawing(){j(this,io,d2).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const n of e.values())typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&(n.width=n.height=0);e.clear()}this._cachedBitmapsMap.clear(),j(this,io,h2).call(this)}_scaleImage(e,n){const r=e.width??e.displayWidth,s=e.height??e.displayHeight;let i=Math.max(Math.hypot(n[0],n[1]),1),a=Math.max(Math.hypot(n[2],n[3]),1),o=r,l=s,u="prescale1",d,f;for(;i>2&&o>1||a>2&&l>1;){let p=o,m=l;i>2&&o>1&&(p=o>=16384?Math.floor(o/2)-1||1:Math.ceil(o/2),i/=o/p),a>2&&l>1&&(m=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,a/=l/m),d=this.cachedCanvases.getCanvas(u,p,m),f=d.context,f.clearRect(0,0,p,m),f.drawImage(e,0,0,o,l,0,0,p,m),e=d.canvas,o=p,l=m,u=u==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:l}}_createMaskCanvas(e,n){var R,O;const r=this.ctx,{width:s,height:i}=n,a=this.current.fillColor,o=this.current.patternFill,l=sn(r);let u,d,f,p;if((n.bitmap||n.data)&&n.count>1){const L=n.bitmap||n.data.buffer;d=JSON.stringify(o?l:[l.slice(0,4),a]),u=this._cachedBitmapsMap.get(L),u||(u=new Map,this._cachedBitmapsMap.set(L,u));const U=u.get(d);if(U&&!o){const B=Math.round(Math.min(l[0],l[2])+l[4]),H=Math.round(Math.min(l[1],l[3])+l[5]);return(R=this.dependencyTracker)==null||R.recordDependencies(e,Ui.transformAndFill),{canvas:U,offsetX:B,offsetY:H}}f=U}f||(p=this.cachedCanvases.getCanvas("maskCanvas",s,i),t5(p.context,n));let m=pe.transform(l,[1/s,0,0,-1/i,0,0]);m=pe.transform(m,[1,0,0,1,0,-i]);const y=cm.slice();pe.axialAlignedBoundingBox([0,0,s,i],m,y);const[g,b,x,w]=y,v=Math.round(x-g)||1,S=Math.round(w-b)||1,E=this.cachedCanvases.getCanvas("fillCanvas",v,S),C=E.context,T=g,P=b;C.translate(-T,-P),C.transform(...m),f||(f=this._scaleImage(p.canvas,uo(C)),f=f.img,u&&o&&u.set(d,f)),C.imageSmoothingEnabled=n5(sn(C),n.interpolate),W1(C,f,0,0,f.width,f.height,0,0,s,i),C.globalCompositeOperation="source-in";const M=pe.transform(uo(C),[1,0,0,1,-T,-P]);return C.fillStyle=o?a.getPattern(r,this,M,Er.FILL,e):a,C.fillRect(0,0,s,i),u&&!o&&(this.cachedCanvases.delete("fillCanvas"),u.set(d,E.canvas)),(O=this.dependencyTracker)==null||O.recordDependencies(e,Ui.transformAndFill),{canvas:E.canvas,offsetX:Math.round(T),offsetY:Math.round(P)}}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=e_e[n]}setLineJoin(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("lineJoin",e),this.ctx.lineJoin=t_e[n]}setMiterLimit(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("miterLimit",e),this.ctx.miterLimit=n}setDash(e,n,r){var i;(i=this.dependencyTracker)==null||i.recordSimpleData("dash",e);const s=this.ctx;s.setLineDash!==void 0&&(s.setLineDash(n),s.lineDashOffset=r)}
691setRenderingIntent(e,n){}setFlatness(e,n){}setGState(e,n){var r,s,i,a,o;for(const[l,u]of n)switch(l){case"LW":this.setLineWidth(e,u);break;case"LC":this.setLineCap(e,u);break;case"LJ":this.setLineJoin(e,u);break;case"ML":this.setMiterLimit(e,u);break;case"D":this.setDash(e,u[0],u[1]);break;case"RI":this.setRenderingIntent(e,u);break;case"FL":this.setFlatness(e,u);break;case"Font":this.setFont(e,u[0],u[1]);break;case"CA":(r=this.dependencyTracker)==null||r.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=u;break;case"ca":(s=this.dependencyTracker)==null||s.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=u;break;case"BM":(i=this.dependencyTracker)==null||i.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=u;break;case"SMask":(a=this.dependencyTracker)==null||a.recordSimpleData("SMask",e),this.current.activeSMask=u?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":(o=this.dependencyTracker)==null||o.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(u);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const n=this.ctx.canvas.width,r=this.ctx.canvas.height,s="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(s,n,r);this.suspendedCtx=this.ctx;const a=this.ctx=i.context;a.setTransform(this.suspendedCtx.getTransform()),Nx(this.suspendedCtx,a),QSe(a,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Nx(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const n=this.current.activeSMask,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(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,n,r,s){const i=s[0],a=s[1],o=s[2]-i,l=s[3]-a;o===0||l===0||(this.genericComposeSMask(n.context,r,o,l,n.subtype,n.backdrop,n.transferMap,i,a,n.offsetX,n.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,n,r,s,i,a,o,l,u,d,f){let p=e.canvas,m=l-d,y=u-f;if(a)if(m<0||y<0||m+r>p.width||y+s>p.height){const b=this.cachedCanvases.getCanvas("maskExtension",r,s),x=b.context;x.drawImage(p,-m,-y),x.globalCompositeOperation="destination-atop",x.fillStyle=a,x.fillRect(0,0,r,s),x.globalCompositeOperation="source-over",p=b.canvas,m=y=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const b=new Path2D;b.rect(m,y,r,s),e.clip(b),e.globalCompositeOperation="destination-atop",e.fillStyle=a,e.fillRect(m,y,r,s),e.restore()}n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0),i==="Alpha"&&o?n.filter=this.filterFactory.addAlphaFilter(o):i==="Luminosity"&&(n.filter=this.filterFactory.addLuminosityFilter(o));const g=new Path2D;g.rect(l,u,r,s),n.clip(g),n.globalCompositeOperation="destination-in",n.drawImage(p,m,y,r,s,l,u,r,s),n.restore()}save(e){var r;this.inSMaskMode&&Nx(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&&Nx(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,n,r,s,i,a,o){var l;(l=this.dependencyTracker)==null||l.recordIncrementalData("transform",e),this.ctx.transform(n,r,s,i,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}
691constructPath(e,n,r,s){let[i]=r;if(!s){i||(i=r[0]=new Path2D),this[n](e,i);return}if(this.dependencyTracker!==null){const a=n===Oy.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,s[0]-a,s[2]+a,s[1]-a,s[3]+a).recordDependencies(e,["transform"])}if(!(i instanceof Path2D)){const a=r[0]=new Path2D;for(let o=0,l=i.length;o<l;)switch(i[o++]){case F1.moveTo:a.moveTo(i[o++],i[o++]);break;case F1.lineTo:a.lineTo(i[o++],i[o++]);break;case F1.curveTo:a.bezierCurveTo(i[o++],i[o++],i[o++],i[o++],i[o++],i[o++]);break;case F1.closePath:a.closePath();break;default:ze(`Unrecognized drawing path operator: ${i[o-1]}`);break}i=a}pe.axialAlignedBoundingBox(s,sn(this.ctx),this.current.minMax),this[n](e,i),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,n,r=!0){var a;const s=this.ctx,i=this.current.strokeColor;if(s.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof i=="object"&&(i!=null&&i.getPattern)){const o=i.isModifyingCurrentTransform()?s.getTransform():null;if(s.save(),s.strokeStyle=i.getPattern(s,this,uo(s),Er.STROKE,e),o){const l=new Path2D;l.addPath(n,s.getTransform().invertSelf().multiplySelf(o)),n=l}this.rescaleAndStroke(n,!1),s.restore()}else this.rescaleAndStroke(n,!0);(a=this.dependencyTracker)==null||a.recordDependencies(e,Ui.stroke),r&&this.consumePath(e,n,this.current.getClippedPathBoundingBox(Er.STROKE,sn(this.ctx))),s.globalAlpha=this.current.fillAlpha}closeStroke(e,n){this.stroke(e,n)}fill(e,n,r=!0){var u,d,f;
691const s=this.ctx,i=this.current.fillColor,a=this.current.patternFill;let o=!1;if(a){const p=i.isModifyingCurrentTransform()?s.getTransform():null;if((u=this.dependencyTracker)==null||u.save(e),s.save(),s.fillStyle=i.getPattern(s,this,uo(s),Er.FILL,e),p){const m=new Path2D;m.addPath(n,s.getTransform().invertSelf().multiplySelf(p)),n=m}o=!0}const l=this.current.getClippedPathBoundingBox();this.contentVisible&&l!==null&&(this.pendingEOFill?(s.fill(n,"evenodd"),this.pendingEOFill=!1):s.fill(n)),(d=this.dependencyTracker)==null||d.recordDependencies(e,Ui.fill),o&&(s.restore(),(f=this.dependencyTracker)==null||f.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,Ui.rawFillPath).recordOperation(e)}clip(e){var n;(n=this.dependencyTracker)==null||n.recordFutureForcedDependency("clipMode",e),this.pendingClip=n_e}eoClip(e){var n;(n=this.dependencyTracker)==null||n.recordFutureForcedDependency("clipMode",e),this.pendingClip=r5}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,(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:s}=this;n!==void 0&&s.recordFutureForcedDependency("textClip",s.getOpenMarker()).recordFutureForcedDependency("textClip",e),s.recordCloseMarker(e)}if(n!==void 0){const s=new Path2D,i=r.getTransform().invertSelf();for(const{transform:a,x:o,y:l,fontSize:u,path:d}of n)d&&s.addPath(d,new DOMMatrix(a).preMultiplySelf(i).translate(o,l).scale(u,-u));r.clip(s)}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 f,p;(f=this.dependencyTracker)==null||f.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",n,e);const s=this.commonObjs.get(n),i=this.current;if(!s)throw new Error(`Can't find font for ${n}`);if(i.fontMatrix=s.fontMatrix||ON,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&ze("Invalid font matrix for font "+n),r<0?(r=-r,i.fontDirection=-1):i.fontDirection=1,this.current.font=s,this.current.fontSize=r,s.isType3Font)return;const a=s.loadedName||"sans-serif",o=((p=s.systemFontInfo)==null?void 0:p.css)||`"${a}", ${s.fallbackName}`;let l="normal";s.black?l="900":s.bold&&(l="bold");const u=s.italic?"italic":"normal";let d=r;r<X3?d=X3:r>Z3&&(d=Z3),this.current.fontSizeScale=r/d,this.ctx.font=`${u} ${l} ${d}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 s;(s=this.dependencyTracker)==null||s.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 s;(s=this.dependencyTracker)==null||s.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,s,i,a){var x,w,v,S;const o=this.ctx,l=this.current,u=l.font,d=l.textRenderingMode,f=l.fontSize/l.fontSizeScale,p=d&yr.FILL_STROKE_MASK,m=!!(d&yr.ADD_TO_PATH_FLAG),y=l.patternFill&&!u.missingFile,g=l.patternStroke&&!u.missingFile;let b;if((u.disableFontFace||m||y||g)&&!u.missingFile&&(b=u.getPathGenerator(this.commonObjs,n)),b&&(u.disableFontFace||y||g)){o.save(),o.translate(r,s),o.scale(f,-f),(x=this.dependencyTracker)==null||x.recordCharacterBBox(e,o,u);let E;if(p===yr.FILL||p===yr.FILL_STROKE)if(i){E=o.getTransform(),o.setTransform(...i);const C=j(this,io,f2).call(this,b,E,i);o.fill(C)}else o.fill(b);if(p===yr.STROKE||p===yr.FILL_STROKE)if(a){E||(E=o.getTransform()),o.setTransform(...a);const{a:C,b:T,c:P,d:M}=E,R=pe.inverseTransform(a),O=pe.transform([C,T,P,M,0,0],R);pe.singularValueDecompose2dScale(O,Si),o.lineWidth*=Math.max(Si[0],Si[1])/f,o.stroke(j(this,io,f2).call(this,b,E,a))}else o.lineWidth/=f,o.stroke(b);
691o.restore()}else(p===yr.FILL||p===yr.FILL_STROKE)&&(o.fillText(n,r,s),(w=this.dependencyTracker)==null||w.recordCharacterBBox(e,o,u,f,r,s,()=>o.measureText(n))),(p===yr.STROKE||p===yr.FILL_STROKE)&&(this.dependencyTracker&&((v=this.dependencyTracker)==null||v.recordCharacterBBox(e,o,u,f,r,s,()=>o.measureText(n)).recordDependencies(e,Ui.stroke)),o.strokeText(n,r,s));m&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:sn(o),x:r,y:s,fontSize:f,path:b}),(S=this.dependencyTracker)==null||S.recordCharacterBBox(e,o,u,f,r,s))}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const n=e.getImageData(0,0,10,10).data;let r=!1;for(let s=3;s<n.length;s+=4)if(n[s]>0&&n[s]<255){r=!0;break}return Qe(this,"isFontSubpixelAAEnabled",r)}showText(e,n){var P,M,R,O;this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Ui.showText).resetBBox(e),this.current.textRenderingMode&yr.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const r=this.current,s=r.font;if(s.isType3Font){this.showType3Text(e,n),(P=this.dependencyTracker)==null||P.recordShowTextOperation(e);return}const i=r.fontSize;if(i===0){(M=this.dependencyTracker)==null||M.recordOperation(e);return}const a=this.ctx,o=r.fontSizeScale,l=r.charSpacing,u=r.wordSpacing,d=r.fontDirection,f=r.textHScale*d,p=n.length,m=s.vertical,y=m?1:-1,g=s.defaultVMetrics,b=i*r.fontMatrix[0],x=r.textRenderingMode===yr.FILL&&!s.disableFontFace&&!r.patternFill;a.save(),r.textMatrix&&a.transform(...r.textMatrix),a.translate(r.x,r.y+r.textRise),d>0?a.scale(f,-1):a.scale(f,1);let w,v;if(r.patternFill){a.save();const L=r.fillColor.getPattern(a,this,uo(a),Er.FILL,e);w=sn(a),a.restore(),a.fillStyle=L}if(r.patternStroke){a.save();const L=r.strokeColor.getPattern(a,this,uo(a),Er.STROKE,e);v=sn(a),a.restore(),a.strokeStyle=L}let S=r.lineWidth;const E=r.textMatrixScale;if(E===0||S===0){const L=r.textRenderingMode&yr.FILL_STROKE_MASK;(L===yr.STROKE||L===yr.FILL_STROKE)&&(S=this.getSinglePixelWidth())}else S/=E;if(o!==1&&(a.scale(o,o),S/=o),a.lineWidth=S,s.isInvalidPDFjsFont){const L=[];let U=0;for(const H of n)L.push(H.unicode),U+=H.width;const B=L.join("");if(a.fillText(B,0,0),this.dependencyTracker!==null){const H=a.measureText(B);this.dependencyTracker.recordBBox(e,this.ctx,-H.actualBoundingBoxLeft,H.actualBoundingBoxRight,-H.actualBoundingBoxAscent,H.actualBoundingBoxDescent).recordShowTextOperation(e)}r.x+=U*b*f,a.restore(),this.compose();return}let C=0,T;for(T=0;T<p;++T){const L=n[T];if(typeof L=="number"){C+=y*L*i/1e3;continue}let U=!1;const B=(L.isSpace?u:0)+l,H=L.fontChar,z=L.accent;let V,$,I=L.width;if(m){const q=L.vmetric||g,D=-(L.vmetric?q[1]:I*.5)*b,Q=q[2]*b;I=q?-q[0]:I,V=D/o,$=(C+Q)/o}else V=C/o,$=0;let N;if(s.remeasure&&I>0){N=a.measureText(H);const q=N.width*1e3/i*o;if(I<q&&this.isFontSubpixelAAEnabled){const D=I/q;U=!0,a.save(),a.scale(D,1),V/=D}else I!==q&&(V+=(I-q)/2e3*i/o)}if(this.contentVisible&&(L.isInFont||s.missingFile)){if(x&&!z)a.fillText(H,V,$),(R=this.dependencyTracker)==null||R.recordCharacterBBox(e,a,N?{bbox:null}:s,i/o,V,$,()=>N??a.measureText(H));else if(this.paintChar(e,H,V,$,w,v),z){const q=V+i*z.offset.x/o,D=$-i*z.offset.y/o;this.paintChar(e,z.fontChar,q,D,w,v)}}const W=m?I*b-B*d:I*b+B*d;C+=W,U&&a.restore()}m?r.y-=C:r.x+=C*f,a.restore(),this.compose(),(O=this.dependencyTracker)==null||O.recordShowTextOperation(e)}showType3Text(e,n){const r=this.ctx,s=this.current,i=s.font,a=s.fontSize,o=s.fontDirection,l=i.vertical?1:-1,u=s.charSpacing,d=s.wordSpacing,f=s.textHScale*o,p=s.fontMatrix||ON,m=n.length,y=s.textRenderingMode===yr.INVISIBLE;let g,b,x,w;if(y||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),s.textMatrix&&r.transform(...s.textMatrix),r.translate(s.x,s.y+s.textRise),r.scale(f,o);const v=this.dependencyTracker;for(this.dependencyTracker=v?new p_(v,e):null,g=0;g<m;++g){if(b=n[g],typeof b=="number"){w=l*b*a/1e3,this.ctx.translate(w,0),s.x+=w*f;continue}const S=(b.isSpace?d:0)+u,E=i.charProcOperatorList[b.operatorListId];E?this.contentVisible&&(this.save(),r.scale(a,a),r.transform(...p),this.executeOperatorList(E),this.restore(
691)):ze(`Type3 character "${b.operatorListId}" is not available.`);const C=[b.width,0];pe.applyTransform(C,p),x=C[0]*a+S,r.translate(x,0),s.x+=x*f}r.restore(),v&&(this.dependencyTracker=v)}setCharWidth(e,n,r){}setCharWidthAndBounds(e,n,r,s,i,a,o){var u;const l=new Path2D;l.rect(s,i,a-s,o-i),this.ctx.clip(l),(u=this.dependencyTracker)==null||u.recordBBox(e,this.ctx,s,a,i,o).recordClipBox(e,this.ctx,s,a,i,o),this.endPath(e)}getColorN_Pattern(e,n){let r;if(n[0]==="TilingPattern"){const s=this.baseTransform||sn(this.ctx),i={createCanvasGraphics:(a,o)=>new PD(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new p_(this.dependencyTracker,o,!0):null)};r=new u2(n,this.ctx,i,s)}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 r;(r=this.dependencyTracker)==null||r.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,n),this.current.patternFill=!0}setStrokeRGBColor(e,n){var r;(r=this.dependencyTracker)==null||r.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=n,this.current.patternStroke=!1}
691setStrokeTransparent(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}setFillTransparent(e){var n;(n=this.dependencyTracker)==null||n.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,n,r=null){let s;return this.cachedPatterns.has(n)?s=this.cachedPatterns.get(n):(s=YSe(this.getObject(e,n)),this.cachedPatterns.set(n,s)),r&&(s.matrix=r),s}shadingFill(e,n){var a;if(!this.contentVisible)return;const r=this.ctx;this.save(e);const s=this._getPattern(e,n);r.fillStyle=s.getPattern(r,this,uo(r),Er.SHADING,e);const i=uo(r);if(i){const{width:o,height:l}=r.canvas,u=cm.slice();pe.axialAlignedBoundingBox([0,0,o,l],i,u);const[d,f,p,m]=u;this.ctx.fillRect(d,f,p-d,m-f)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);(a=this.dependencyTracker)==null||a.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,Ui.transform).recordDependencies(e,Ui.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){Lt("Should not call beginInlineImage")}beginImageData(){Lt("Should not call beginImageData")}paintFormXObjectBegin(e,n,r){var s;if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),n&&this.transform(e,...n),this.baseTransform=sn(this.ctx),r)){pe.axialAlignedBoundingBox(r,this.baseTransform,this.current.minMax);const[i,a,o,l]=r,u=new Path2D;u.rect(i,a,o-i,l-a),this.ctx.clip(u),(s=this.dependencyTracker)==null||s.recordClipBox(e,this.ctx,i,o,a,l),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,n){var v;if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const r=this.ctx;n.isolated||KE("TODO: Support non-isolated groups."),n.knockout&&ze("Knockout groups not supported.");const s=sn(r);if(n.matrix&&r.transform(...n.matrix),!n.bbox)throw new Error("Bounding box is required.");let i=cm.slice();pe.axialAlignedBoundingBox(n.bbox,sn(r),i);const a=[0,0,r.canvas.width,r.canvas.height];i=pe.intersect(i,a)||[0,0,0,0];const o=Math.floor(i[0]),l=Math.floor(i[1]),u=Math.max(Math.ceil(i[2])-o,1),d=Math.max(Math.ceil(i[3])-l,1);this.current.startNewPathAndClipBox([0,0,u,d]);let f="groupAt"+this.groupLevel;n.smask&&(f+="_smask_"+this.smaskCounter++%2);const p=this.cachedCanvases.getCanvas(f,u,d),m=p.context;m.translate(-o,-l),m.transform(...s);let y=new Path2D;const[g,b,x,w]=n.bbox;if(y.rect(g,b,x-g,w-b),n.matrix){const S=new Path2D;S.addPath(y,new DOMMatrix(n.matrix)),y=S}m.clip(y),n.smask&&this.smaskStack.push({canvas:p.canvas,context:m,offsetX:o,offsetY:l,subtype:n.smask.subtype,backdrop:n.smask.backdrop,transferMap:n.smask.transferMap||null,startTransformInverse:null}),(!n.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(o,l),r.save()),Nx(r,m),this.ctx=m,(v=this.dependencyTracker)==null||v.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(r),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(e,n){var i;if(!this.contentVisible)return;this.groupLevel--;const r=this.ctx,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,(i=this.dependencyTracker)==null||i.popBaseTransform(),n.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const a=sn(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...a);const o=cm.slice();pe.axialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],a,o),this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(o)}}beginAnnotation(e,n,r,s,i,a){if(j(this,io,d2).call(this),H1(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){s=s.slice(),s[4]-=r[0],s[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=o,r[3]=l,pe.singularValueDecompose2dScale(sn(this.ctx),Si);const{viewportScale:u}=this,d=Math.ceil(o*this.outputScaleX*u),f=Math.ceil(l*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(d,f);const{canvas:p,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(n,p),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(Si[0],0,0,-Si[1],0,l*Si[1]),H1(this.ctx)}else{H1(this.ctx),this.endPath(e);const u=new Path2D;u.rect(r[0],r[1],o,l),this.ctx.clip(u)}}
691this.current=new J3(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...s),this.transform(e,...i)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),j(this,io,h2).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,n){var o;if(!this.contentVisible)return;const r=n.count;n=this.getObject(e,n.data,n),n.count=r;const s=this.ctx,i=this._createMaskCanvas(e,n),a=i.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(a,i.offsetX,i.offsetY),(o=this.dependencyTracker)==null||o.resetBBox(e).recordBBox(e,this.ctx,i.offsetX,i.offsetX+a.width,i.offsetY,i.offsetY+a.height).recordOperation(e),s.restore(),this.compose()}paintImageMaskXObjectRepeat(e,n,r,s=0,i=0,a,o){var f,p,m;if(!this.contentVisible)return;n=this.getObject(e,n.data,n);const l=this.ctx;l.save();const u=sn(l);l.transform(r,s,i,a,0,0);const d=this._createMaskCanvas(e,n);l.setTransform(1,0,0,1,d.offsetX-u[4],d.offsetY-u[5]),(f=this.dependencyTracker)==null||f.resetBBox(e);for(let y=0,g=o.length;y<g;y+=2){const b=pe.transform(u,[r,s,i,a,o[y],o[y+1]]);l.drawImage(d.canvas,b[4],b[5]),(p=this.dependencyTracker)==null||p.recordBBox(e,this.ctx,b[4],b[4]+d.canvas.width,b[5],b[5]+d.canvas.height)}l.restore(),this.compose(),(m=this.dependencyTracker)==null||m.recordOperation(e)}paintImageMaskXObjectGroup(e,n){var a,o,l;if(!this.contentVisible)return;const r=this.ctx,s=this.current.fillColor,i=this.current.patternFill;(a=this.dependencyTracker)==null||a.resetBBox(e).recordDependencies(e,Ui.transformAndFill);for(const u of n){const{data:d,width:f,height:p,transform:m}=u,y=this.cachedCanvases.getCanvas("maskCanvas",f,p),g=y.context;g.save();const b=this.getObject(e,d,u);t5(g,b),g.globalCompositeOperation="source-in",g.fillStyle=i?s.getPattern(g,this,uo(r),Er.FILL,e):s,g.fillRect(0,0,f,p),g.restore(),r.save(),r.transform(...m),r.scale(1,-1),W1(r,y.canvas,0,0,f,p,0,-1,1,1),(o=this.dependencyTracker)==null||o.recordBBox(e,r,0,f,0,p),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){ze("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e,r)}paintImageXObjectRepeat(e,n,r,s,i){if(!this.contentVisible)return;const a=this.getObject(e,n);if(!a){ze("Dependent image isn't ready yet");return}const o=a.width,l=a.height,u=[];for(let d=0,f=i.length;d<f;d+=2)u.push({transform:[r,0,0,s,i[d],i[d+1]],x:0,y:0,w:o,h:l});this.paintInlineImageXObjectGroup(e,a,u)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:n,width:r,height:s}=e,i=this.cachedCanvases.getCanvas("inlineImage",r,s),a=i.context;return a.filter=this.current.transferMaps,a.drawImage(n,0,0),a.filter="none",i.canvas}paintInlineImageXObject(e,n){var u;if(!this.contentVisible)return;const r=n.width,s=n.height,i=this.ctx;this.save(e);const{filter:a}=i;a!=="none"&&a!==""&&(i.filter="none"),i.scale(1/r,-1/s);let o;if(n.bitmap)o=this.applyTransferMapsToBitmap(n);else if(typeof HTMLElement=="function"&&n instanceof HTMLElement||!n.data)o=n;else{const f=this.cachedCanvases.getCanvas("inlineImage",r,s).context;e5(f,n),o=this.applyTransferMapsToCanvas(f)}const l=this._scaleImage(o,uo(i));i.imageSmoothingEnabled=n5(sn(i),n.interpolate),(u=this.dependencyTracker)==null||u.resetBBox(e).recordBBox(e,i,0,r,-s,0).recordDependencies(e,Ui.imageXObject).recordOperation(e),W1(i,l.img,0,0,l.paintWidth,l.paintHeight,0,-s,r,s),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,n,r){var a,o,l;if(!this.contentVisible)return;const s=this.ctx;let i;if(n.bitmap)i=n.bitmap;else{const u=n.width,d=n.height,p=this.cachedCanvases.getCanvas("inlineImage",u,d).context;e5(p,n),i=this.applyTransferMapsToCanvas(p)}(a=this.dependencyTracker)==null||a.resetBBox(e);for(const u of r)s.save(),s.transform(...u.transform),s.scale(1,-1),W1(s,i,u.x,u.y,u.w,u.h,0,-1,1,1),(o=this.dependencyTracker)==null||o.recordBBox(e,s,0,1,-1,0),s.restore(
691);(l=this.dependencyTracker)==null||l.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,Ui.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 s;(s=this.dependencyTracker)==null||s.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 s=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(r);const i=this.ctx;this.pendingClip?(s||(this.pendingClip===r5?i.clip(n,"evenodd"):i.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=sn(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]),s=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,s)/n}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:n,b:r,c:s,d:i}=this.ctx.getTransform();let a,o;if(r===0&&s===0){const l=Math.abs(n),u=Math.abs(i);if(l===u)if(e===0)a=o=1/l;else{const d=l*e;a=o=d<1?1/d:1}else if(e===0)a=1/l,o=1/u;else{const d=l*e,f=u*e;a=d<1?1/d:1,o=f<1?1/f:1}}else{const l=Math.abs(n*i-r*s),u=Math.hypot(n,r),d=Math.hypot(s,i);if(e===0)a=d/l,o=u/l;else{const f=e*l;a=d>f?d/f:1,o=u>f?u/f:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(e,n){const{ctx:r,current:{lineWidth:s}}=this,[i,a]=this.getScaleForStroking();if(i===a){r.lineWidth=(s||1)*i,r.stroke(e);return}const o=r.getLineDash();n&&r.save(),r.scale(i,a),rT.a=1/i,rT.d=1/a;const l=new Path2D;if(l.addPath(e,rT),o.length>0){const u=Math.max(i,a);r.setLineDash(o.map(d=>d/u)),r.lineDashOffset/=u}r.lineWidth=s||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}};io=new WeakSet,d2=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},h2=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}}},f2=function(e,n,r){const s=new Path2D;return s.addPath(e,new DOMMatrix(r).invertSelf().multiplySelf(n)),s};let Pm=PD;for(const t in Oy)Pm.prototype[t]!==void 0&&(Pm.prototype[Oy[t]]=Pm.prototype[t]);var mg,gg,hw,yg,Ik;const dm=class dm{constructor(e){A(this,yg);A(this,mg);A(this,gg);A(this,hw);_(this,mg,e),_(this,gg,new DataView(h(this,mg))),_(this,hw,new TextDecoder)}static write(e){const n=new TextEncoder,r={};let s=0;for(const u of dm.strings){const d=n.encode(e[u]);r[u]=d,s+=4+d.length}const i=new ArrayBuffer(s),a=new Uint8Array(i),o=new DataView(i);let l=0;for(const u of dm.strings){const d=r[u],f=d.length;o.setUint32(l,f),a.set(d,l+4),l+=4+f}return lt(l===i.byteLength,"CssFontInfo.write: Buffer overflow"),i}get fontFamily(){return j(this,yg,Ik).call(this,0)}get fontWeight(){return j(this,yg,Ik).call(this,1)}get italicAngle(){return j(this,yg,Ik).call(this,2)}};mg=new WeakMap,gg=new WeakMap,hw=new WeakMap,yg=new WeakSet,Ik=function(e){lt(e<dm.strings.length,"Invalid string index");let n=0;for(let s=0;s<e;s++)n+=h(this,gg).getUint32(n)+4;const r=h(this,gg).getUint32(n);return h(this,hw).decode(new Uint8Array(h(this,mg),n+4,r))},Z(dm,"strings",["fontFamily","fontWeight","italicAngle"]);let m_=dm;var gu,Ro,Xh,Zh,nv;
691const hm=class hm{constructor(e){A(this,Zh);A(this,gu);A(this,Ro);A(this,Xh);_(this,gu,e),_(this,Ro,new DataView(h(this,gu))),_(this,Xh,new TextDecoder)}static write(e){const n=new TextEncoder,r={};let s=0;for(const p of hm.strings){const m=n.encode(e[p]);r[p]=m,s+=4+m.length}s+=4;let i,a,o=1+s;e.style&&(i=n.encode(e.style.style),a=n.encode(e.style.weight),o+=4+i.length+4+a.length);const l=new ArrayBuffer(o),u=new Uint8Array(l),d=new DataView(l);let f=0;d.setUint8(f++,e.guessFallback?1:0),d.setUint32(f,0),f+=4,s=0;for(const p of hm.strings){const m=r[p],y=m.length;s+=4+y,d.setUint32(f,y),u.set(m,f+4),f+=4+y}return d.setUint32(f-s-4,s),e.style&&(d.setUint32(f,i.length),u.set(i,f+4),f+=4+i.length,d.setUint32(f,a.length),u.set(a,f+4),f+=4+a.length),lt(f<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(f)}get guessFallback(){return h(this,Ro).getUint8(0)!==0}get css(){return j(this,Zh,nv).call(this,0)}get loadedName(){return j(this,Zh,nv).call(this,1)}get baseFontName(){return j(this,Zh,nv).call(this,2)}get src(){return j(this,Zh,nv).call(this,3)}get style(){let e=1;e+=4+h(this,Ro).getUint32(e);const n=h(this,Ro).getUint32(e),r=h(this,Xh).decode(new Uint8Array(h(this,gu),e+4,n));e+=4+n;const s=h(this,Ro).getUint32(e),i=h(this,Xh).decode(new Uint8Array(h(this,gu),e+4,s));return{style:r,weight:i}}};gu=new WeakMap,Ro=new WeakMap,Xh=new WeakMap,Zh=new WeakSet,nv=function(e){lt(e<hm.strings.length,"Invalid string index");let n=5;for(let s=0;s<e;s++)n+=h(this,Ro).getUint32(n)+4;const r=h(this,Ro).getUint32(n);return h(this,Xh).decode(new Uint8Array(h(this,gu),n+4,r))},Z(hm,"strings",["css","loadedName","baseFontName","src"]);let g_=hm;var xg,vg,bg,wg,oi,Io,fw,Tt,kn,Ca,Dk,rv;const Ke=class Ke{constructor({data:e,extra:n}){A(this,kn);A(this,Io);A(this,fw);A(this,Tt);_(this,Io,e),_(this,fw,new TextDecoder),_(this,Tt,new DataView(h(this,Io))),n&&Object.assign(this,n)}get black(){return j(this,kn,Ca).call(this,0)}get bold(){return j(this,kn,Ca).call(this,1)}get disableFontFace(){return j(this,kn,Ca).call(this,2)}get fontExtraProperties(){return j(this,kn,Ca).call(this,3)}get isInvalidPDFjsFont(){return j(this,kn,Ca).call(this,4)}get isType3Font(){return j(this,kn,Ca).call(this,5)}get italic(){return j(this,kn,Ca).call(this,6)}get missingFile(){return j(this,kn,Ca).call(this,7)}get remeasure(){return j(this,kn,Ca).call(this,8)}get vertical(){return j(this,kn,Ca).call(this,9)}get ascent(){return j(this,kn,Dk).call(this,0)}get defaultWidth(){return j(this,kn,Dk).call(this,1)}get descent(){return j(this,kn,Dk).call(this,2)}get bbox(){let e=h(Ke,vg);if(h(this,Tt).getUint8(e)===0)return;e+=1;const r=[];for(let s=0;s<4;s++)r.push(h(this,Tt).getInt16(e,!0)),e+=2;return r}get fontMatrix(){let e=h(Ke,bg);if(h(this,Tt).getUint8(e)===0)return;e+=1;const r=[];for(let s=0;s<6;s++)r.push(h(this,Tt).getFloat64(e,!0)),e+=8;return r}get defaultVMetrics(){let e=h(Ke,wg);if(h(this,Tt).getUint8(e)===0)return;e+=1;const r=[];for(let s=0;s<3;s++)r.push(h(this,Tt).getInt16(e,!0)),e+=2;return r}get fallbackName(){return j(this,kn,rv).call(this,0)}get loadedName(){return j(this,kn,rv).call(this,1)}get mimetype(){return j(this,kn,rv).call(this,2)}get name(){return j(this,kn,rv).call(this,3)}get data(){let e=h(Ke,oi);const n=h(this,Tt).getUint32(e);e+=4+n;const r=h(this,Tt).getUint32(e);e+=4+r;const s=h(this,Tt).getUint32(e);e+=4+s;const i=h(this,Tt).getUint32(e);if(i!==0)return new Uint8Array(h(this,Io),e+4,i)}clearData(){let e=h(Ke,oi);const n=h(this,Tt).getUint32(e);e+=4+n;const r=h(this,Tt).getUint32(e);e+=4+r;const s=h(this,Tt).getUint32(e);e+=4+s;const i=h(this,Tt).getUint32(e);new Uint8Array(h(this,Io),e+4,i).fill(0),h(this,Tt).setUint32(e,0)}get cssFontInfo(){let e=h(Ke,oi);const n=h(this,Tt).getUint32(e);e+=4+n;const r=h(this,Tt).getUint32(e);e+=4+r;const s=h(this,Tt).getUint32(e);if(s===0)return null;const i=new Uint8Array(s);return i.set(new Uint8Array(h(this,Io),e+4,s)),new m_(i.buffer)}get systemFontInfo(){let e=h(Ke,oi);const n=h(this,Tt).getUint32(e);e+=4+n;const r=h(this,Tt).getUint32(e);if(r===0)return null;const s=new Uint8Array(r);return s.set(new Uint8Array(h(this,Io),e+4,r)),new g_(s.buffer)}static write(e){const n=e.systemFontInfo?g_.write(e.systemFontInfo):null,r=e.cssFontInfo?m_.write(e.cssFontInfo):null,s=new TextEncoder,i={};let a=0;for(const g of Ke.strings)i[g]=s.encode(e[g]),a+=4+i[g].length;const o=h(Ke,oi)+4+a+4+(n?n.byteLength:0)+4+(r?r.byteLength:0)+4+(e.data?e.data.length:0),l=new ArrayBuffer(o),u=new Uint8Array(l),d=new DataView(l);let f=0;const p=Ke.bools.length;let m=0,y=0;for(let g=0;g<p;g++){const b=e[Ke.bools[g]];m|=(b===void 0?0:b?2:1)<<y,y+=2,(y===8||g===p-1)&&(d.setUint8(f++,m),m=0,y=0)}lt(f===h(Ke,xg),"FontInfo.write: Boolean properties offset mismatch");for(const g of Ke.numbers)d.setFloat64(f,e[g]),f+=8;if(lt(f===h(Ke,vg),"FontInfo.write: Number properties offset mismatch"),e.bbox){d.setUint8(f++,4);for(const g of e.bbox)d.setInt16(f,g,!0),f+=2}else d.setUint8(f++,0),f+=2*4;if(lt(f===h(Ke,bg),"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){d.setUint8(f++,6);for(const g of e.fontMatrix)d.setFloat64(f,g,!0),f+=8}else d.setUint8(f++,0),f+=8*6;if(lt(f===h(Ke,wg),"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){d.setUint8(f++,1);for(const g of e.defaultVMetrics)d.setInt16(f,g,!0),f+=2}else d.setUint8(f++,0),f+=3*2;lt(f===h(Ke,oi),"FontInfo.write: DefaultVMetrics properties offset mismatch"),d.setUint32(h(Ke,oi),0
691),f+=4;for(const g of Ke.strings){const b=i[g],x=b.length;d.setUint32(f,x),u.set(b,f+4),f+=4+x}if(d.setUint32(h(Ke,oi),f-h(Ke,oi)-4),!n)d.setUint32(f,0),f+=4;else{const g=n.byteLength;d.setUint32(f,g),lt(f+4+g<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),u.set(new Uint8Array(n),f+4),f+=4+g}if(!r)d.setUint32(f,0),f+=4;else{const g=r.byteLength;d.setUint32(f,g),lt(f+4+g<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),u.set(new Uint8Array(r),f+4),f+=4+g}return e.data===void 0?(d.setUint32(f,0),f+=4):(d.setUint32(f,e.data.length),u.set(e.data,f+4),f+=4+e.data.length),lt(f<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(f)}};xg=new WeakMap,vg=new WeakMap,bg=new WeakMap,wg=new WeakMap,oi=new WeakMap,Io=new WeakMap,fw=new WeakMap,Tt=new WeakMap,kn=new WeakSet,Ca=function(e){lt(e<Ke.bools.length,"Invalid boolean index");const n=Math.floor(e/4),r=e*2%8,s=h(this,Tt).getUint8(n)>>r&3;return s===0?void 0:s===2},Dk=function(e){return lt(e<Ke.numbers.length,"Invalid number index"),h(this,Tt).getFloat64(h(Ke,xg)+e*8)},rv=function(e){lt(e<Ke.strings.length,"Invalid string index");let n=h(Ke,oi)+4;for(let i=0;i<e;i++)n+=h(this,Tt).getUint32(n)+4;const r=h(this,Tt).getUint32(n),s=new Uint8Array(r);return s.set(new Uint8Array(h(this,Io),n+4,r)),h(this,fw).decode(s)},Z(Ke,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),Z(Ke,"numbers",["ascent","defaultWidth","descent"]),Z(Ke,"strings",["fallbackName","loadedName","mimetype","name"]),A(Ke,xg,Math.ceil(Ke.bools.length*2/8)),A(Ke,vg,h(Ke,xg)+Ke.numbers.length*8),A(Ke,bg,h(Ke,vg)+1+2*4),A(Ke,wg,h(Ke,bg)+1+8*6),A(Ke,oi,h(Ke,wg)+1+2*3);let p2=Ke;var pw,mw;class sa{static get workerPort(){return h(this,pw)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");_(this,pw,e)}static get workerSrc(){return h(this,mw)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");_(this,mw,e)}}pw=new WeakMap,mw=new WeakMap,A(sa,pw,null),A(sa,mw,"");var kg,gw;class r_e{constructor({parsedData:e,rawData:n}){A(this,kg);A(this,gw);_(this,kg,e),_(this,gw,n)}getRaw(){return h(this,gw)}get(e){return h(this,kg).get(e)??null}[Symbol.iterator](){return h(this,kg).entries()}}kg=new WeakMap,gw=new WeakMap;const zp=Symbol("INTERNAL");var yw,xw,vw,Sg;class s_e{constructor(e,{name:n,intent:r,usage:s,rbGroups:i}){A(this,yw,!1);A(this,xw,!1);A(this,vw,!1);A(this,Sg,!0);_(this,yw,!!(e&wi.DISPLAY)),_(this,xw,!!(e&wi.PRINT)),this.name=n,this.intent=r,this.usage=s,this.rbGroups=i}get visible(){if(h(this,vw))return h(this,Sg);if(!h(this,Sg))return!1;const{print:e,view:n}=this.usage;return h(this,yw)?(n==null?void 0:n.viewState)!=="OFF":h(this,xw)?(e==null?void 0:e.printState)!=="OFF":!0}_setVisible(e,n,r=!1){e!==zp&&Lt("Internal method `_setVisible` called."),_(this,vw,r),_(this,Sg,n)}}yw=new WeakMap,xw=new WeakMap,vw=new WeakMap,Sg=new WeakMap;var yu,jt,_g,Eg,bw,m2;class i_e{constructor(e,n=wi.DISPLAY){A(this,bw);A(this,yu,null);A(this,jt,new Map);A(this,_g,null);A(this,Eg,null);if(this.renderingIntent=n,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,_(this,Eg,e.order);for(const r of e.groups)h(this,jt).set(r.id,new s_e(n,r));if(e.baseState==="OFF")for(const r of h(this,jt).values())r._setVisible(zp,!1);for(const r of e.on)h(this,jt).get(r)._setVisible(zp,!0);for(const r of e.off)h(this,jt).get(r)._setVisible(zp,!1);_(this,_g,this.getHash())}}isVisible(e){if(h(this,jt).size===0)return!0;if(!e)return KE("Optional content group not defined."),!0;if(e.type==="OCG")return h(this,jt).has(e.id)?h(this,jt).get(e.id).visible:(ze(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return j(this,bw,m2).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const n of e.ids){if(!h(this,jt).has(n))return ze(`Optional content group not found: ${n}`),!0;if(h(this,jt).get(n).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const n of e.ids){if(!h(this,jt).has(n))return ze(`Optional content group not found: ${n}`),!0;if(!h(this,jt).get(n).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const n of e.ids){if(!h(this,jt).has(n))return ze(`Optional content group not found: ${n}`),!0;if(!h(this,jt).get(n).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const n of e.ids){if(!h(this,jt).has(n))return ze(`Optional content group not found: ${n}`),!0;if(h(this,jt).get(n).visible)return!1}return!0}return ze(`Unknown optional content policy ${e.policy}.`),!0}return ze(`Unknown group type ${e.type}.`),!0}setVisibility(e,n=!0,r=!0){var i;const s=h(this,jt).get(e);if(!s){ze(`Optional content group not found: ${e}`);return}if(r&&n&&s.rbGroups.length)for(const a of s.rbGroups)for(const o of a)o!==e&&((i=h(this,jt).get(o))==null||i._setVisible(zp,!1,!0));s._setVisible(zp,!!n,!0),_(this,yu,null)}setOCGState({state:e,preserveRB:n}){let r;for(const s of e){switch(s){case"ON":case"OFF":case"Toggle":r=s;continue}const i=h(this,jt).get(s);if(i)switch(r){case"ON":this.setVisibility(s,!0,n);break;case"OFF":this.setVisibility(s,!1,n);break;case"Toggle":this.setVisibility(s,!i.visible,n);break}}_(this,yu,null)}get hasInitialVisibility(){return h(this,_g)===null||this.getHash()===h(this,_g)}getOrder(){return h(this,jt).size?h(this,Eg)?h(this,Eg).slice():[...h(this,jt).keys()]:null}getGroup(e){return h(this,jt).get(e)||null}getHash(){if(h(this,yu)!==null)return h(this,yu);const e=new Nq;for(const[n,r]of h(this,jt))e.update(`${n}:${r.visible}`);return _(this,yu,e.hexdigest())}[Symbol.iterator](){return h(this,jt).entries()}}yu=new WeakMap,jt=new WeakMap,_g=new WeakMap,Eg=new WeakMap,bw=new WeakSet,m2=function(e){const n=e.length;if(n<2)return!0;const r=e[0];for(let s=1;s<n;s++){const i=e[s];let a;
691if(Array.isArray(i))a=j(this,bw,m2).call(this,i);else if(h(this,jt).has(i))a=h(this,jt).get(i).visible;else return ze(`Optional content group not found: ${i}`),!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"};class a_e{constructor(e,{disableRange:n=!1,disableStream:r=!1}){lt(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:i,progressiveDone:a,contentDispositionFilename:o}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=o,(i==null?void 0:i.length)>0){const l=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!n,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,u)=>{this._onReceiveData({begin:l,chunk:u})}),e.addProgressListener((l,u)=>{this._onProgress({loaded:l,total:u})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:n}){const r=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const s=this._rangeReaders.some(function(i){return i._begin!==e?!1:(i._enqueue(r),!0)});lt(s,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}_onProgress(e){var n,r,s,i;e.total===void 0?(r=(n=this._rangeReaders[0])==null?void 0:n.onProgress)==null||r.call(n,{loaded:e.loaded}):(i=(s=this._fullRequestReader)==null?void 0:s.onProgress)==null||i.call(s,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;(e=this._fullRequestReader)==null||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const n=this._rangeReaders.indexOf(e);n>=0&&this._rangeReaders.splice(n,1)}getFullReader(){lt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new o_e(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new l_e(this,e,n);return this._pdfDataRangeTransport.requestDataRange(e,n),this._rangeReaders.push(r),r}cancelAllRequests(e){var n;(n=this._fullRequestReader)==null||n.cancel(e);for(const r of this._rangeReaders.slice(0))r.cancel(e);this._pdfDataRangeTransport.abort()}}class o_e{constructor(e,n,r=!1,s=null){this._stream=e,this._done=r||!1,this._filename=XE(s)?s:null,this._queuedChunks=n||[],this._loaded=0;for(const i of this._queuedChunks)this._loaded+=i.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class l_e{constructor(e,n,r){this._stream=e,this._begin=n,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function c_e(t){let e=!0,n=r("filename\\*","i").exec(t);if(n){n=n[1];let d=o(n);return d=unescape(d),d=l(d),d=u(d),i(d)}if(n=a(t),n){const d=u(n);return i(d)}
691if(n=r("filename","i").exec(t),n){n=n[1];let d=o(n);return d=u(d),i(d)}function r(d,f){return new RegExp("(?:^|;)\\s*"+d+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',f)}function s(d,f){if(d){if(!/^[\x00-\xFF]+$/.test(f))return f;try{const p=new TextDecoder(d,{fatal:!0}),m=U0(f);f=p.decode(m),e=!1}catch{}}return f}function i(d){return e&&/[\x80-\xff]/.test(d)&&(d=s("utf-8",d),e&&(d=s("iso-8859-1",d))),d}function a(d){const f=[];let p;const m=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(p=m.exec(d))!==null;){let[,g,b,x]=p;if(g=parseInt(g,10),g in f){if(g===0)break;continue}f[g]=[b,x]}const y=[];for(let g=0;g<f.length&&g in f;++g){let[b,x]=f[g];x=o(x),b&&(x=unescape(x),g===0&&(x=l(x))),y.push(x)}return y.join("")}function o(d){if(d.startsWith('"')){const f=d.slice(1).split('\\"');for(let p=0;p<f.length;++p){const m=f[p].indexOf('"');m!==-1&&(f[p]=f[p].slice(0,m),f.length=p+1),f[p]=f[p].replaceAll(/\\(.)/g,"$1")}d=f.join('"')}return d}function l(d){const f=d.indexOf("'");if(f===-1)return d;const p=d.slice(0,f),y=d.slice(f+1).replace(/^[^']*'/,"");return s(p,y)}function u(d){return!d.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(d)?d:d.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(f,p,m,y){if(m==="q"||m==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(g,b){return String.fromCharCode(parseInt(b,16))}),s(p,y);try{y=atob(y)}catch{}return s(p,y)})}return""}function Vq(t,e){const n=new Headers;if(!t||!e||typeof e!="object")return n;for(const r in e){const s=e[r];s!==void 0&&n.append(r,s)}return n}function ZE(t){var e;return((e=URL.parse(t))==null?void 0:e.origin)??null}function Wq({responseHeaders:t,isHttp:e,rangeChunkSize:n,disableRange:r}){const s={allowRangeRequests:!1,suggestedLength:void 0},i=parseInt(t.get("Content-Length"),10);return!Number.isInteger(i)||(s.suggestedLength=i,i<=2*n)||r||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")!=="identity"||(s.allowRangeRequests=!0),s}function Hq(t){const e=t.get("Content-Disposition");if(e){let n=c_e(e);if(n.includes("%"))try{n=decodeURIComponent(n)}catch{}if(XE(n))return n}return null}function H0(t,e){return new Cb(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t,t===404||t===0&&e.startsWith("file:"))}function qq(t){return t===200||t===206}function Gq(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Kq(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(ze(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class u_e{constructor(e){Z(this,"_responseOrigin",null);this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=Vq(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return lt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new d_e(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new h_e(this,e,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var n;(n=this._fullRequestReader)==null||n.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class d_e{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const n=e.source;this._withCredentials=n.withCredentials||!1,this._contentLength=n.length,this._headersCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange;const r=new Headers(e.headers),s=n.url;fetch(s,Gq(r,this._withCredentials,this._abortController)).then(i=>{if(e._responseOrigin=ZE(i.url),!qq(i.status))throw H0(i.status,s);this._reader=i.body.getReader(),this._headersCapability.resolve();const a=i.headers,{allowRangeRequests:o,suggestedLength:l}=Wq({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=l||this._contentLength,this._filename=Hq(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new vc("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;await this._headersCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Kq(e),done:!1})}cancel(e){var n;(n=this._reader)==null||n.cancel(e),this._abortController.abort()}}class h_e{constructor(e,n,r){this._stream=e,this._reader=null,this._loaded=0;const s=e.source;this._withCredentials=s.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!s.disableStream,this._abortController=new AbortController;const i=new Headers(e.headers);i.append("Range",`bytes=${n}-${r-1}`);const a=s.url;fetch(a,Gq(i,this._withCredentials,this._abortController)).then(o=>{const l=ZE(o.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!qq(o.status))throw H0(o.status,a);this._readCapability.resolve(),this._reader=o.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;await this._readCapability.promise;const{value:e,done:n}=await this._reader.read();return n?{value:e,done:n}:(this._loaded+=e.byteLength,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:Kq(e),done:!1})}cancel(e){var n;(n=this._reader)==null||n.cancel(e),this._abortController.abort()}}const sT=200,iT=206;function f_e(t){const e=t.response;return typeof e!="string"?e:U0(e).buffer}class p_e{constructor({url:e,httpHeaders:n,withCredentials:r}){Z(this,"_responseOrigin",null);this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=Vq(this.isHttp,n),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const n=new XMLHttpRequest,r=this.currXhrId++,s=this.pendingRequests[r]={x
691hr:n};n.open("GET",this.url),n.withCredentials=this.withCredentials;for(const[i,a]of this.headers)n.setRequestHeader(i,a);return this.isHttp&&"begin"in e&&"end"in e?(n.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),s.expectedStatus=iT):s.expectedStatus=sT,n.responseType="arraybuffer",lt(e.onError,"Expected `onError` callback to be provided."),n.onerror=()=>{e.onError(n.status)},n.onreadystatechange=this.onStateChange.bind(this,r),n.onprogress=this.onProgress.bind(this,r),s.onHeadersReceived=e.onHeadersReceived,s.onDone=e.onDone,s.onError=e.onError,s.onProgress=e.onProgress,n.send(null),r}onProgress(e,n){var s;const r=this.pendingRequests[e];r&&((s=r.onProgress)==null||s.call(r,n))}onStateChange(e,n){const r=this.pendingRequests[e];if(!r)return;const s=r.xhr;if(s.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),s.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],s.status===0&&this.isHttp){r.onError(s.status);return}const i=s.status||sT;if(!(i===sT&&r.expectedStatus===iT)&&i!==r.expectedStatus){r.onError(s.status);return}const o=f_e(s);if(i===iT){const l=s.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);u?r.onDone({begin:parseInt(u[1],10),chunk:o}):(ze('Missing or invalid "Content-Range" header.'),r.onError(0))}else o?r.onDone({begin:0,chunk:o}):r.onError(s.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const n=this.pendingRequests[e].xhr;delete this.pendingRequests[e],n.abort()}}class m_e{constructor(e){this._source=e,this._manager=new p_e(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const n=this._rangeRequestReaders.indexOf(e);n>=0&&this._rangeRequestReaders.splice(n,1)}getFullReader(){return lt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new g_e(this._manager,this._source),this._fullRequestReader}getRangeReader(e,n){const r=new y_e(this._manager,e,n);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var n;(n=this._fullRequestReader)==null||n.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class g_e{constructor(e,n){this._manager=e,this._url=n.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=n.disableRange||!1,this._contentLength=n.length,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,n=this._manager.getRequestXhr(e);this._manager._responseOrigin=ZE(n.responseURL);const r=n.getAllResponseHeaders(),s=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(o=>{const[l,...u]=o.split(": ");return[l,u.join(": ")]}):[]),{allowRangeRequests:i,suggestedLength:a}=Wq({responseHeaders:s,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=a||this._contentLength,this._filename=Hq(s),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=H0(e,this._url),this._headersCapability.reject(this._storedError);for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var n;(n=this.onProgress)==null||n.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest
691(this._fullRequestId),this._fullRequestReader=null}}class y_e{constructor(e,n,r){this._manager=e,this._url=e.url,this._requestId=e.request({begin:n,end:r,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var n;const e=ZE((n=this._manager.getRequestXhr(this._requestId))==null?void 0:n.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var e;(e=this.onClosed)==null||e.call(this,this)}_onDone(e){const n=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:n,done:!1}):this._queuedChunk=n,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??(this._storedError=H0(e,this._url));for(const n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var n;this.isStreamingSupported||(n=this.onProgress)==null||n.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const x_e=/^[a-z][a-z0-9\-+.]+:/i;function v_e(t){if(x_e.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}class b_e{constructor(e){this.source=e,this.url=v_e(e.url),lt(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return lt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new w_e(this),this._fullRequestReader}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const r=new k_e(this,e,n);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var n;(n=this._fullRequestReader)==null||n.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class w_e{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const n=e.source;this._contentLength=n.length,this._loaded=0,this._filename=null,this._disableRange=n.disableRange||!1,this._rangeChunkSize=n.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!n.disableStream,this._isRangeSupported=!n.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const r=process.getBuiltinModule("fs");r.promises.lstat(this._url).then(s=>{this._contentLength=s.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},s=>{s.code==="ENOENT"&&(s=H0(0,this._url.href)),this._storedError=s,this._headersCapability.reject(s)})}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(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new vc("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class k_e{constructor(e,n,r){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const s=e.source;this._isStreamingSupported=!s.disableStream;const i=process.getBuiltinModule("fs");this._setReadableStream(i.createReadStream(this._url,{start:n,end:r-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var r;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,(r=this.onProgress)==null||r.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",n=>{this._error(n)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Px=Symbol("INITIAL_DATA");var li,ww,g2;class Yq{constructor(){A(this,ww);A(this,li,Object.create(null))}get(e,n=null){if(n){const s=j(this,ww,g2).call(this,e);return s.promise.then(()=>n(s.data)),null}const r=h(this,li)[e];if(!r||r.data===Px)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const n=h(this,li)[e];return!!n&&n.data!==Px}delete(e){const n=h(this,li)[e];return!n||n.data===Px?!1:(delete h(this,li)[e],!0)}resolve(e,n=null){const r=j(this,ww,g2).call(this,e);r.data=n,r.resolve()}clear(){var e;
691for(const n in h(this,li)){const{data:r}=h(this,li)[n];(e=r==null?void 0:r.bitmap)==null||e.close()}_(this,li,Object.create(null))}*[Symbol.iterator](){for(const e in h(this,li)){const{data:n}=h(this,li)[e];n!==Px&&(yield[e,n])}}}li=new WeakMap,ww=new WeakSet,g2=function(e){var n;return(n=h(this,li))[e]||(n[e]={...Promise.withResolvers(),data:Px})};const S_e=1e5,s5=30;var R5,xu,Os,kw,Sw,Qh,Bl,_w,Ew,Jh,Cg,Ag,vu,Tg,Cw,jg,ef,Aw,Tw,bn,Ng,tf,jw,bu,Pg,kc,Xq,Zq,y2,Ni,Mk,x2,Qq,Jq;let Nb=(bn=class{constructor({textContentSource:e,container:n,viewport:r}){A(this,kc);A(this,xu,Promise.withResolvers());A(this,Os,null);A(this,kw,!1);A(this,Sw,!!((R5=globalThis.FontInspector)!=null&&R5.enabled));A(this,Qh,null);A(this,Bl,null);A(this,_w,0);A(this,Ew,0);A(this,Jh,null);A(this,Cg,null);A(this,Ag,0);A(this,vu,0);A(this,Tg,Object.create(null));A(this,Cw,[]);A(this,jg,null);A(this,ef,[]);A(this,Aw,new WeakMap);A(this,Tw,null);var l;if(e instanceof ReadableStream)_(this,jg,e);else if(typeof e=="object")_(this,jg,new ReadableStream({start(u){u.enqueue(e),u.close()}}));else throw new Error('No "textContentSource" parameter specified.');_(this,Os,_(this,Cg,n)),_(this,vu,r.scale*so.pixelRatio),_(this,Ag,r.rotation),_(this,Bl,{div:null,properties:null,ctx:null});const{pageWidth:s,pageHeight:i,pageX:a,pageY:o}=r.rawDims;_(this,Tw,[1,0,0,-1,-a,o+i]),_(this,Ew,s),_(this,_w,i),j(l=bn,Ni,Qq).call(l),kd(n,r),h(this,xu).promise.finally(()=>{h(bn,Pg).delete(this),_(this,Bl,null),_(this,Tg,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:n}=hr.platform;return Qe(this,"fontFamilyMap",new Map([["sans-serif",`${e&&n?"Calibri, ":""}sans-serif`],["monospace",`${e&&n?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{h(this,Jh).read().then(({value:n,done:r})=>{if(r){h(this,xu).resolve();return}h(this,Qh)??_(this,Qh,n.lang),Object.assign(h(this,Tg),n.styles),j(this,kc,Xq).call(this,n.items),e()},h(this,xu).reject)};return _(this,Jh,h(this,jg).getReader()),h(bn,Pg).add(this),e(),h(this,xu).promise}update({viewport:e,onBefore:n=null}){var i;const r=e.scale*so.pixelRatio,s=e.rotation;if(s!==h(this,Ag)&&(n==null||n(),_(this,Ag,s),kd(h(this,Cg),{rotation:s})),r!==h(this,vu)){n==null||n(),_(this,vu,r);const a={div:null,properties:null,ctx:j(i=bn,Ni,Mk).call(i,h(this,Qh))};for(const o of h(this,ef))a.properties=h(this,Aw).get(o),a.div=o,j(this,kc,y2).call(this,a)}}cancel(){var n;const e=new vc("TextLayer task cancelled.");(n=h(this,Jh))==null||n.cancel(e).catch(()=>{}),_(this,Jh,null),h(this,xu).reject(e)}get textDivs(){return h(this,ef)}get textContentItemsStr(){return h(this,Cw)}static cleanup(){if(!(h(this,Pg).size>0)){h(this,Ng).clear();for(const{canvas:e}of h(this,tf).values())e.remove();h(this,tf).clear()}}},xu=new WeakMap,Os=new WeakMap,kw=new WeakMap,Sw=new WeakMap,Qh=new WeakMap,Bl=new WeakMap,_w=new WeakMap,Ew=new WeakMap,Jh=new WeakMap,Cg=new WeakMap,Ag=new WeakMap,vu=new WeakMap,Tg=new WeakMap,Cw=new WeakMap,jg=new WeakMap,ef=new WeakMap,Aw=new WeakMap,Tw=new WeakMap,Ng=new WeakMap,tf=new WeakMap,jw=new WeakMap,bu=new WeakMap,Pg=new WeakMap,kc=new WeakSet,Xq=function(e){var s,i;if(h(this,kw))return;(i=h(this,Bl)).ctx??(i.ctx=j(s=bn,Ni,Mk).call(s,h(this,Qh)));const n=h(this,ef),r=h(this,Cw);for(const a of e){if(n.length>S_e){ze("Ignoring additional textDivs for performance reasons."),_(this,kw,!0);return}if(a.str===void 0){if(a.type==="beginMarkedContentProps"||a.type==="beginMarkedContent"){const o=h(this,Os);_(this,Os,document.createElement("span")),h(this,Os).classList.add("markedContent"),a.id&&h(this,Os).setAttribute("id",`${a.id}`),o.append(h(this,Os))}else a.type==="endMarkedContent"&&_(this,Os,h(this,Os).parentNode);continue}r.push(a.str),j(this,kc,Zq).call(this,a)}},Zq=function(e){var g;const n=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};h(this,ef).push(n);const s=pe.transform(h(this,Tw),e.transform);let i=Math.atan2(s[1],s[0]);const a=h(this,Tg)[e.fontName];a.vertical&&(i+=Math.PI/2);let o=h(this,Sw)&&a.fontSubstitution||a.fontFamily;o=bn.fontFamilyMap.get(o)||o;const l=Math.hypot(s[2],s[3]),u=l*j(g=bn,Ni,Jq).call(g,o,a,h(this,Qh));let d,f;i===0?(d=s[4],f=s[5]-u):(d=s[4]+u*Math.sin(i),f=s[5]-u*Math.cos(i));const p="calc(var(--total-scale-factor) *",m=n.style;h(this,Os)===h(this,Cg)?(m.left=`${(100*d/h(this,Ew)).toFixed(2)}%`,m.top=`${(100*f/h(this,_w)).toFixed(2)}%`):(m.left=`${p}${d.toFixed(2)}px)`,m.top=`${p}${f.toFixed(2)}px)`),m.fontSize=`${p}${(h(bn,bu)*l).toFixed(2)}px)`,m.fontFamily=o,r.fontSize=l,n.setAttribute("role","presentation"),n.textContent=e.str,n.dir=e.dir,h(this,Sw)&&(n.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),i!==0&&(r.angle=i*(180/Math.PI));let y=!1;if(e.str.length>1)y=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const b=Math.abs(e.transform[0]),x=Math.abs(e.transform[3]);b!==x&&Math.max(b,x)/Math.min(b,x)>1.5&&(y=!0)}if(y&&(r.canvasWidth=a.vertical?e.height:e.width),h(this,Aw).set(n,r),h(this,Bl).div=n,h(this,Bl).properties=r,j(this,kc,y2).call(this,h(this,Bl)),r.hasText&&h(this,Os).append(n),r.hasEOL){const b=document.createElement("br");b.setAttribute("role","presentation"),h(this,Os).append(b)}},y2=function(e){var o;const{div:n,properties:r,ctx:s}=e,{style:i}=n;let a="";if(h(bn,bu)>1&&(a=`scale(${1/h(bn,bu)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:l}=i,{canvasWidth:u,fontSize:d}=r;j(o=bn,Ni,x2).call(o,s,d*h(this,vu),l);const{width:f}=s.measureText(n.textContent);f>0&&(a=`scaleX(${u*h(this,vu)/f}) ${a}`)}r.angle!==0&&(a=`rotate(${r.angle}deg) ${a}`),a.length>0&&(i.transform=a)},Ni=new WeakSet,Mk=function(e=null){let n=h(this,tf).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}),h(this,tf).set(e,n),h(this,jw).set(n,{size:0,family:""})}return n},x2=function(e,n,r){const s=h(this,jw).get(e);n===s.size&&r===s.family||(e.font=`${n}px ${r}`,s.size=n,s.family=r)},Qq=function(){if(h(this,bu)!==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),_(this,bu,e.getBoundingClientRect().height),e.remove()},Jq=function(e,n,r){const s=h(this,Ng).get(e);if(s)return s;const i=j(this,Ni,Mk).call(this,r);i.canvas.width=i.canvas.height=s5,j(this,Ni,x2).call(this,i,s5,e);const a=i.measureText(""),o=a.fontBoundingBoxAscent,l=Math.abs(a.fontBoundingBoxDescent);i.canvas.width=i.canvas.height=0;let u=.8;return o?u=o/(o+l):(hr.platform.isFirefox&&ze("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),n.ascent?u=n.ascent:n.descent&&(u=1+n.descent)),h(this,Ng).set(e,u),u},A(bn,Ni),A(bn,Ng,new Map),A(bn,tf,new Map),A(bn,jw,new WeakMap),A(bn,bu,null),A(bn,Pg,new Set),bn);const __e=100;function vD(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new v2,{docId:n}=e,r=t.url?RSe(t.url):null,s=t.data?ISe(t.data):null,i=t.httpHeaders||null,a=t.withCredentials===!0,o=t.password??null,l=t.range instanceof bD?t.range:null,u=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:2**16;let d=t.worker instanceof Ly?t.worker:null;const f=t.verbosity,p=typeof t.docBaseUrl=="string"&&!V0(t.docBaseUrl)?t.docBaseUrl:null,m=$1(t.cMapUrl),y=t.cMapPacked!==!1,g=t.CMapReaderFactory||(ls?$Se:W3),b=$1(t.iccUrl),x=$1(t.standardFontDataUrl),w=t.StandardFontDataFactory||(ls?USe:H3),v=$1(t.wasmUrl),S=t.WasmFactory||(ls?zSe:q3),E=t.stopAtErrors!==!0,C=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,T=t.isEvalSupported!==!1,P=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!ls,M=typeof t.isImageDecoderSupported=="boolean"?t.isImageDecoderSupported:!ls&&(hr.platform.isFirefox||!globalThis.chrome),R=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,O=typeof t.disableFontFace=="boolean"?t.disableFontFace:ls,L=t.fontE
691xtraProperties===!0,U=t.enableXfa===!0,B=t.ownerDocument||globalThis.document,H=t.disableRange===!0,z=t.disableStream===!0,V=t.disableAutoFetch===!0,$=t.pdfBug===!0,I=t.CanvasFactory||(ls?BSe:OSe),N=t.FilterFactory||(ls?FSe:LSe),W=t.enableHWA===!0,q=t.useWasm!==!1,D=l?l.length:t.length??NaN,Q=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!ls&&!O,X=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:!!(g===W3&&w===H3&&S===q3&&m&&x&&v&&Hx(m,document.baseURI)&&Hx(x,document.baseURI)&&Hx(v,document.baseURI)),se=null;fSe(f);const Y={canvasFactory:new I({ownerDocument:B,enableHWA:W}),filterFactory:new N({docId:n,ownerDocument:B}),cMapReaderFactory:X?null:new g({baseUrl:m,isCompressed:y}),standardFontDataFactory:X?null:new w({baseUrl:x}),wasmFactory:X?null:new S({baseUrl:v})};d||(d=Ly.create({verbosity:f,port:sa.workerPort}),e._worker=d);const de={docId:n,apiVersion:"5.4.296",data:s,password:o,disableAutoFetch:V,rangeChunkSize:u,length:D,docBaseUrl:p,enableXfa:U,evaluatorOptions:{maxImageSize:C,disableFontFace:O,ignoreErrors:E,isEvalSupported:T,isOffscreenCanvasSupported:P,isImageDecoderSupported:M,canvasMaxAreaInBytes:R,fontExtraProperties:L,useSystemFonts:Q,useWasm:q,useWorkerFetch:X,cMapUrl:m,iccUrl:b,standardFontDataUrl:x,wasmUrl:v}},Ie={ownerDocument:B,pdfBug:$,styleElement:se,loadingParams:{disableAutoFetch:V,enableXfa:U}};return d.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const _e=d.messageHandler.sendWithPromise("GetDocRequest",de,s?[s.buffer]:null);let Ee;if(l)Ee=new a_e(l,{disableRange:H,disableStream:z});else if(!s){if(!r)throw new Error("getDocument - no `url` parameter provided.");const xe=Hx(r)?u_e:ls?b_e:m_e;Ee=new xe({url:r,length:D,httpHeaders:i,withCredentials:a,rangeChunkSize:u,disableRange:H,disableStream:z})}return _e.then(xe=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const Ne=new Zx(n,xe,d.port),tt=new A_e(Ne,e,Ee,Ie,Y,W);e._transport=tt,Ne.send("Ready",null)})}).catch(e._capability.reject),e}var R_;const I_=class I_{constructor(){Z(this,"_capability",Promise.withResolvers());Z(this,"_transport",null);Z(this,"_worker",null);Z(this,"docId",`d${pn(I_,R_)._++}`);Z(this,"destroyed",!1);Z(this,"onPassword",null);Z(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var e,n,r,s;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((n=this._transport)==null?void 0:n.destroy())}catch(i){throw(r=this._worker)!=null&&r.port&&delete this._worker._pendingDestroy,i}this._transport=null,(s=this._worker)==null||s.destroy(),this._worker=null}async getData(){return this._transport.getData()}};R_=new WeakMap,A(I_,R_,0);let v2=I_;var nf,Nw,Pw,Rw,Iw,I5;let bD=(I5=class{constructor(e,n,r=!1,s=null){A(this,nf,Promise.withResolvers());A(this,Nw,[]);A(this,Pw,[]);A(this,Rw,[]);A(this,Iw,[]);this.length=e,this.initialData=n,this.progressiveDone=r,this.contentDispositionFilename=s}addRangeListener(e){h(this,Iw).push(e)}addProgressListener(e){h(this,Rw).push(e)}addProgressiveReadListener(e){h(this,Pw).push(e)}addProgressiveDoneListener(e){h(this,Nw).push(e)}onDataRange(e,n){for(const r of h(this,Iw))r(e,n)}onDataProgress(e,n){h(this,nf).promise.then(()=>{for(const r of h(this,Rw))r(e,n)})}onDataProgressiveRead(e){h(this,nf).promise.then(()=>{for(const n of h(this,Pw))n(e)})}onDataProgressiveDone(){h(this,nf).promise.then(()=>{for(const e of h(this,Nw))e()})}transportReady(){h(this,nf).resolve()}requestDataRange(e,n){Lt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},nf=new WeakMap,Nw=new WeakMap,Pw=new WeakMap,Rw=new WeakMap,Iw=new WeakMap,I5);class E_e{constructor(e,n){this._pdfInfo=e,this._transport=n}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 Qe(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)}
691getDestinations(){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()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var $l,rf,sv;class C_e{constructor(e,n,r,s=!1){A(this,rf);A(this,$l,!1);this._pageIndex=e,this._pageInfo=n,this._transport=r,this._stats=s?new L3:null,this._pdfBug=s,this.commonObjs=r.commonObjs,this.objs=new Yq,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:n=this.rotate,offsetX:r=0,offsetY:s=0,dontFlip:i=!1}={}){return new z0({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:n,offsetX:r,offsetY:s,dontFlip:i})}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 Qe(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:s="display",annotationMode:i=qo.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:u=null,pageColors:d=null,printAnnotationStorage:f=null,isEditing:p=!1,recordOperations:m=!1,operationsFilter:y=null}){var M,R,O;(M=this._stats)==null||M.time("Overall");const g=this._transport.getRenderingIntent(s,i,f,p),{renderingIntent:b,cacheKey:x}=g;_(this,$l,!1),l||(l=this._transport.getOptionalContentConfig(b));let w=this._intentStates.get(x);w||(w=Object.create(null),this._intentStates.set(x,w)),w.streamReaderCancelTimeout&&(clearTimeout(w.streamReaderCancelTimeout),w.streamReaderCancelTimeout=null);const v=!!(b&wi.PRINT);w.displayReadyCapability||(w.displayReadyCapability=Promise.withResolvers(),w.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(R=this._stats)==null||R.time("Page Request"),this._pumpOperatorList(g));const S=!!(this._pdfBug&&((O=globalThis.StepperManager)!=null&&O.enabled)),E=!this.recordedBBoxes&&(m||S),C=L=>{var U,B;if(w.renderTasks.delete(T),E){const H=(U=T.gfx)==null?void 0:U.dependencyTracker.take();H&&(T.stepper&&T.stepper.setOperatorBBoxes(H,T.gfx.dependencyTracker.takeDebugMetadata()),m&&(this.recordedBBoxes=H))}v&&_(this,$l,!0),j(this,rf,sv).call(this),L?(T.capability.reject(L),this._abortOperatorList({intentState:w,reason:L instanceof Error?L:new Error(L)})):T.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(B=globalThis.Stats)!=null&&B.enabled&&globalThis.Stats.add(this.pageNumber,this._stats)
691)},T=new b2({callback:C,params:{canvas:n,canvasContext:e,dependencyTracker:E?new WSe(n,w.operatorList.length,S):null,viewport:r,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:u,operatorList:w.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:d,enableHWA:this._transport.enableHWA,operationsFilter:y});(w.renderTasks||(w.renderTasks=new Set)).add(T);const P=T.task;return Promise.all([w.displayReadyCapability.promise,l]).then(([L,U])=>{var B;if(this.destroyed){C();return}if((B=this._stats)==null||B.time("Rendering"),!(U.renderingIntent&b))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");T.initializeGraphics({transparency:L,optionalContentConfig:U}),T.operatorListChanged()}).catch(C),P}getOperatorList({intent:e="display",annotationMode:n=qo.ENABLE,printAnnotationStorage:r=null,isEditing:s=!1}={}){var u;function i(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(l))}const a=this._transport.getRenderingIntent(e,n,r,s,!0);let o=this._intentStates.get(a.cacheKey);o||(o=Object.create(null),this._intentStates.set(a.cacheKey,o));let l;return o.opListReadCapability||(l=Object.create(null),l.operatorListChanged=i,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||(o.renderTasks=new Set)).add(l),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(u=this._stats)==null||u.time("Page Request"),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:n===!0},{highWaterMark:100,size(s){return s.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>Ab.textContent(r));const n=this.streamTextContent(e);return new Promise(function(r,s){function i(){a.read().then(function({value:l,done:u}){if(u){r(o);return}o.lang??(o.lang=l.lang),Object.assign(o.styles,l.styles),o.items.push(...l.items),i()},s)}const a=n.getReader(),o={items:[],styles:Object.create(null),lang:null};i()})}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(),_(this,$l,!1),Promise.all(e)}cleanup(e=!1){_(this,$l,!0);const n=j(this,rf,sv).call(this);return e&&n&&this._stats&&(this._stats=new L3),n}_startRenderPage(e,n){var s,i;const r=this._intentStates.get(n);r&&((s=this._stats)==null||s.timeEnd("Page Request"),(i=r.displayReadyCapability)==null||i.resolve(e))}_renderPageChunk(e,n){for(let r=0,s=e.length;r<s;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&&j(this,rf,sv).call(this)}_pumpOperatorList({renderingIntent:e,cacheKey:n,annotationStorageSerializable:r,modifiedIds:s}){const{map:i,transfer:a}=r,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:n,annotationStorage:i,modifiedIds:s},a).getReader(),u=this._intentStates.get(n);u.streamReader=l;const d=()=>{l.read().then(({value:f,done:p})=>{if(p){u.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(f,u),d())},f=>{if(u.streamReader=null,!this._transport.destroyed){if(u.operatorList){u.operatorList.lastChunk=!0;for(const p of u.renderTasks)p.operatorListChanged();j(this,rf,sv).call(this)}if(u.displayReadyCapability)u.displayReadyCapability.reject(f);else if(u.opListReadCapability)u.opListReadCapability.reject(f);else throw f}})};d()}_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 YE){let s=__e;n.extraDelay>0&&n.extraDelay<1e3&&(s+=n.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:n,force:!0})},s);return}}if(e.streamReader.cancel(new vc(n.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[s,i]of this._intentStates)if(i===e){this._intentStates.delete(s);break}this.cleanup()}}}get stats(){return this._stats}}$l=new WeakMap,rf=new WeakSet,sv=function(){if(!h(this,$l)||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(),_(this,$l,!1),!0};var wu,Ba,Ul,sf,D_,af,of,ms,Ok,eG,tG,iv,Rg,Lk;const Jt=class Jt{constructor({name:e=null,port:n=null,verbosity:r=pSe()}={}){A(this,ms);A(this,wu,Promise.withResolvers());A(this,Ba,null);A(this,Ul,null);A(this,sf,null);if(this.name=e,this.destroyed=!1,this.verbosity=r,n){if(h(Jt,of).has(n))throw new Error("Cannot use more than one PDFWorker per port.");h(Jt,of).set(n,this),j(this,ms,eG).call(this,n)}else j(this,ms,tG).call(this)}get promise(){return h(this,wu).promise}get port(){return h(this,Ul)}get messageHandler(){return h(this,Ba)}destroy(){var e,n;this.destroyed=!0,(e=h(this,sf))==null||e.terminate(),_(this,sf,null),h(Jt,of).delete(h(this,Ul)),_(this,Ul,null),(n=h(this,Ba))==null||n.destroy(),_(this,Ba,null)}static create(e){const n=h(this,of).get(e==null?void 0:e.port);
691if(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 Jt(e)}static get workerSrc(){if(sa.workerSrc)return sa.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Qe(this,"_setupFakeWorkerGlobal",(async()=>h(this,Rg,Lk)?h(this,Rg,Lk):(await import(this.workerSrc)).WorkerMessageHandler)())}};wu=new WeakMap,Ba=new WeakMap,Ul=new WeakMap,sf=new WeakMap,D_=new WeakMap,af=new WeakMap,of=new WeakMap,ms=new WeakSet,Ok=function(){h(this,wu).resolve(),h(this,Ba).send("configure",{verbosity:this.verbosity})},eG=function(e){_(this,Ul,e),_(this,Ba,new Zx("main","worker",e)),h(this,Ba).on("ready",()=>{}),j(this,ms,Ok).call(this)},tG=function(){if(h(Jt,af)||h(Jt,Rg,Lk)){j(this,ms,iv).call(this);return}let{workerSrc:e}=Jt;try{Jt._isSameOrigin(window.location,e)||(e=Jt._createCDNWrapper(new URL(e,window.location).href));const n=new Worker(e,{type:"module"}),r=new Zx("main","worker",n),s=()=>{i.abort(),r.destroy(),n.terminate(),this.destroyed?h(this,wu).reject(new Error("Worker was destroyed")):j(this,ms,iv).call(this)},i=new AbortController;n.addEventListener("error",()=>{h(this,sf)||s()},{signal:i.signal}),r.on("test",o=>{if(i.abort(),this.destroyed||!o){s();return}_(this,Ba,r),_(this,Ul,n),_(this,sf,n),j(this,ms,Ok).call(this)}),r.on("ready",o=>{if(i.abort(),this.destroyed){s();return}try{a()}catch{j(this,ms,iv).call(this)}});const a=()=>{const o=new Uint8Array;r.send("test",o,[o.buffer])};a();return}catch{KE("The worker has been disabled.")}j(this,ms,iv).call(this)},iv=function(){h(Jt,af)||(ze("Setting up fake worker."),_(Jt,af,!0)),Jt._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){h(this,wu).reject(new Error("Worker was destroyed"));return}const n=new MSe;_(this,Ul,n);const r=`fake${pn(Jt,D_)._++}`,s=new Zx(r+"_worker",r,n);e.setup(s,n),_(this,Ba,new Zx(r,r+"_worker",n)),j(this,ms,Ok).call(this)}).catch(e=>{h(this,wu).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},Rg=new WeakSet,Lk=function(){var e;try{return((e=globalThis.pdfjsWorker)==null?void 0:e.WorkerMessageHandler)||null}catch{return null}},A(Jt,Rg),A(Jt,D_,0),A(Jt,af,!1),A(Jt,of,new WeakMap),ls&&(_(Jt,af,!0),sa.workerSrc||(sa.workerSrc="./pdf.worker.mjs")),Jt._isSameOrigin=(e,n)=>{const r=URL.parse(e);if(!(r!=null&&r.origin)||r.origin==="null")return!1;const s=new URL(n,r);return r.origin===s.origin},Jt._createCDNWrapper=e=>{const n=`await import("${e}");`;return URL.createObjectURL(new Blob([n],{type:"text/javascript"}))},Jt.fromPort=e=>{if(SSe("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Jt.create(e)};let Ly=Jt;var zl,Do,Ig,Dg,Vl,lf,av;class A_e{constructor(e,n,r,s,i,a){A(this,lf);A(this,zl,new Map);A(this,Do,new Map);A(this,Ig,new Map);A(this,Dg,new Map);A(this,Vl,null);this.messageHandler=e,this.loadingTask=n,this.commonObjs=new Yq,this.fontLoader=new NSe({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this.loadingParams=s.loadingParams,this._params=s,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.wasmFactory=i.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=a,this.setupMessageHandler()}get annotationStorage(){return Qe(this,"annotationStorage",new gD)}getRenderingIntent(e,n=qo.ENABLE,r=null,s=!1,i=!1){let a=wi.DISPLAY,o=r2;switch(e){case"any":a=wi.ANY;break;case"display":break;case"print":a=wi.PRINT;break;default:ze(`getRenderingIntent - invalid intent: ${e}`)}const l=a&wi.PRINT&&r instanceof Rq?r:this.annotationStorage;switch(n){case qo.DISABLE:a+=wi.ANNOTATIONS_DISABLE;break;case qo.ENABLE:break;case qo.ENABLE_FORMS:a+=wi.ANNOTATIONS_FORMS;break;case qo.ENABLE_STORAGE:a+=wi.ANNOTATIONS_STORAGE,o=l.serializable;break;default:ze(`getRenderingIntent - invalid annotationMode: ${n}`)}s&&(a+=wi.IS_EDITING),i&&(a+=wi.OPLIST);const{ids:u,hash:d}=l.modifiedIds,f=[a,o.hash,d];return{renderingIntent:a,cacheKey:f.join("_"),annotationStorageSerializable:o,modifiedIds:u}}destroy(){var r;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(r=h(this,Vl))==null||r.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const s of h(this,Do).values())e.push(s._destroy());h(this,Do).clear(),h(this,Ig).clear(),h(this,Dg).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();
691const n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(()=>{var s,i;this.commonObjs.clear(),this.fontLoader.clear(),h(this,zl).clear(),this.filterFactory.destroy(),Nb.cleanup(),(s=this._networkStream)==null||s.cancelAllRequests(new vc("Worker was terminated.")),(i=this.messageHandler)==null||i.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:n}=this;e.on("GetReader",(r,s)=>{lt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=i=>{this._lastProgress={loaded:i.loaded,total:i.total}},s.onPull=()=>{this._fullReader.read().then(function({value:i,done:a}){if(a){s.close();return}lt(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(i),1,[i])}).catch(i=>{s.error(i)})},s.onCancel=i=>{this._fullReader.cancel(i),s.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("ReaderHeadersReady",async r=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:s,isRangeSupported:i,contentLength:a}=this._fullReader;return(!s||!i)&&(this._lastProgress&&((o=n.onProgress)==null||o.call(n,this._lastProgress)),this._fullReader.onProgress=l=>{var u;(u=n.onProgress)==null||u.call(n,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:s,isRangeSupported:i,contentLength:a}}),e.on("GetRangeReader",(r,s)=>{lt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(r.begin,r.end);if(!i){s.close();return}s.onPull=()=>{i.read().then(function({value:a,done:o}){if(o){s.close();return}lt(a instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),s.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{s.error(a)})},s.onCancel=a=>{i.cancel(a),s.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,n._capability.resolve(new E_e(r,this))}),e.on("DocException",r=>{n._capability.reject(Ns(r))}),e.on("PasswordRequest",r=>{_(this,Vl,Promise.withResolvers());try{if(!n.onPassword)throw Ns(r);const s=i=>{i instanceof Error?h(this,Vl).reject(i):h(this,Vl).resolve({password:i})};n.onPassword(s,r.code)}catch(s){h(this,Vl).reject(s)}return h(this,Vl).promise}),e.on("DataLoaded",r=>{var s;(s=n.onProgress)==null||s.call(n,{loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{if(this.destroyed)return;h(this,Do).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,s,i])=>{var a;if(this.destroyed||this.commonObjs.has(r))return null;switch(s){case"Font":if("error"in i){const f=i.error;ze(`Error during font loading: ${f}`),this.commonObjs.resolve(r,f);break}const o=new p2(i),l=this._params.pdfBug&&((a=globalThis.FontInspector)!=null&&a.enabled)?(f,p)=>globalThis.FontInspector.fontAdded(f,p):null,u=new PSe(o,l,i.extra,i.charProcOperatorList);this.fontLoader.bind(u).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!u.fontExtraProperties&&u.data&&u.clearData(),this.commonObjs.resolve(r,u)});break;case"CopyLocalImage":const{imageRef:d}=i;lt(d,"The imageRef must be defined.");for(const f of h(this,Do).values())for(const[,p]of f.objs)if((p==null?void 0:p.ref)===d)return p.dataLen?(this.commonObjs.resolve(r,structuredClone(p)),p.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,i);break;default:throw new Error(`Got unknown common object type ${s}`)}return null}),e.on("obj",([r,s,i,a])=>{var l;if(this.destroyed)return;const o=h(this,Do).get(s);if(!o.objs.has(r)){if(o._intentStates.size===0){(l=a==null?void 0:a.bitmap)==null||l.close();return}switch(i){case"Image":case"Pattern":o.objs.resolve(r,a);break;default:throw new Error(`Got unknown object type ${i}`)}}}),e.on("DocProgress",r=>{var s;this.destroyed||(s=n.onProgress)==null||s.call(n,{loaded:r.loaded,total:r.total})}),e.on("FetchBinaryData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");const s=this[r.type];if(!s)throw new Error(`${r.type} not initialized, see the \`useWorkerFetch\` parameter.`);return s.fetch(r)})}
691getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var r;this.annotationStorage.size<=0&&ze("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=this._fullReader)==null?void 0:r.filename)??null},n).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const n=e-1,r=h(this,Ig).get(n);if(r)return r;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&h(this,Dg).set(i.refStr,e);const a=new C_e(n,i,this,this._params.pdfBug);return h(this,Do).set(n,a),a});return h(this,Ig).set(n,s),s}getPageIndex(e){return s2(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,n){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:n})}getFieldObjects(){return j(this,lf,av).call(this,"GetFieldObjects")}hasJSActions(){return j(this,lf,av).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 j(this,lf,av).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return j(this,lf,av).call(this,"GetOptionalContentConfig").then(n=>new i_e(n,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",n=h(this,zl).get(e);if(n)return n;const r=this.messageHandler.sendWithPromise(e,null).then(s=>{var i,a;return{info:s[0],metadata:s[1]?new r_e(s[1]):null,contentDispositionFilename:((i=this._fullReader)==null?void 0:i.filename)??null,contentLength:((a=this._fullReader)==null?void 0:a.contentLength)??null}});return h(this,zl).set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const n of h(this,Do).values())if(!n.cleanup())throw new Error(`startCleanup: Page ${n.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),h(this,zl).clear(),this.filterFactory.destroy(!0),Nb.cleanup()}}cachedPageNumber(e){if(!s2(e))return null;const n=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return h(this,Dg).get(n)??null}}zl=new WeakMap,Do=new WeakMap,Ig=new WeakMap,Dg=new WeakMap,Vl=new WeakMap,lf=new WeakSet,av=function(e,n=null){const r=h(this,zl).get(e);if(r)return r;const s=this.messageHandler.sendWithPromise(e,n);return h(this,zl).set(e,s),s};var ku;class T_e{constructor(e){A(this,ku,null);Z(this,"onContinue",null);Z(this,"onError",null);_(this,ku,e)}get promise(){return h(this,ku).capability.promise}cancel(e=0){h(this,ku).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=h(this,ku).operatorList;if(!e)return!1;const{annotationCanvasMap:n}=h(this,ku);return e.form||e.canvas&&(n==null?void 0:n.size)>0}}ku=new WeakMap;var Su,cf;const lh=class lh{constructor({callback:e,params:n,objs:r,commonObjs:s,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:u,useRequestAnimationFrame:d=!1,pdfBug:f=!1,pageColors:p=null,enableHWA:m=!1,operationsFilter:y=null}){A(this,Su,null);this.callback=e,this.params=n,this.objs=r,this.commonObjs=s,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=u,this._pdfBug=f,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=d===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new T_e(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=m,this._dependencyTracker=n.dependencyTracker,this._operationsFilter=y}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:n}){var l,u;if(this.cancelled)return;
691if(this._canvas){if(h(lh,cf).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");h(lh,cf).add(this._canvas)}this._pdfBug&&((l=globalThis.StepperManager)!=null&&l.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:r,transform:s,background:i,dependencyTracker:a}=this.params,o=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Pm(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors,a),this.gfx.beginDrawing({transform:s,viewport:r,transparency:e,background:i}),this.operatorListIdx=0,this.graphicsReady=!0,(u=this.graphicsReadyCallback)==null||u.call(this)}cancel(e=null,n=0){var r,s,i;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),h(this,Su)&&(window.cancelAnimationFrame(h(this,Su)),_(this,Su,null)),h(lh,cf).delete(this._canvas),e||(e=new YE(`Rendering cancelled, page ${this._pageIndex+1}`,n)),this.callback(e),(i=(s=this.task).onError)==null||i.call(s,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?_(this,Su,window.requestAnimationFrame(()=>{_(this,Su,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),h(lh,cf).delete(this._canvas),this.callback())))}};Su=new WeakMap,cf=new WeakMap,A(lh,cf,new WeakSet);let b2=lh;const wD="5.4.296",nG="f56dc8601";var ci,uf,Mg,Yn,Dw,Og,Wl,Mw,_u,$a,Ow,Nt,w2,k2,S2,eh,rG,Bc;const Ps=class Ps{constructor({editor:e=null,uiManager:n=null}){A(this,Nt);A(this,ci,null);A(this,uf,null);A(this,Mg);A(this,Yn,null);A(this,Dw,!1);A(this,Og,!1);A(this,Wl,null);A(this,Mw);A(this,_u,null);A(this,$a,null);var r,s;e?(_(this,Og,!1),_(this,Wl,e)):_(this,Og,!0),_(this,$a,(e==null?void 0:e._uiManager)||n),_(this,Mw,h(this,$a)._eventBus),_(this,Mg,((r=e==null?void 0:e.color)==null?void 0:r.toUpperCase())||((s=h(this,$a))==null?void 0:s.highlightColors.values().next().value)||"#FFFF98"),h(Ps,Ow)||_(Ps,Ow,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 Qe(this,"_keyboardManager",new W0([[["Escape","mac+Escape"],Ps.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Ps.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Ps.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Ps.prototype._moveToPrevious],[["Home","mac+Home"],Ps.prototype._moveToBeginning],[["End","mac+End"],Ps.prototype._moveToEnd]]))}renderButton(){const e=_(this,ci,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",h(this,Wl)&&(e.ariaControls=`${h(this,Wl).id}_colorpicker_dropdown`);const n=h(this,$a)._signal;e.addEventListener("click",j(this,Nt,eh).bind(this),{signal:n}),e.addEventListener("keydown",j(this,Nt,S2).bind(this),{signal:n});const r=_(this,uf,document.createElement("span"));return r.className="swatch",r.ariaHidden="true",r.style.backgroundColor=h(this,Mg),e.append(r),e}renderMainDropdown(){const e=_(this,Yn,j(this,Nt,w2).call(this));return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}_colorSelectFromKeyboard(e){if(e.target===h(this,ci)){j(this,Nt,eh).call(this,e);return}const n=e.target.getAttribute("data-color");n&&j(this,Nt,k2).call(this,n,e)}_moveToNext(e){var n,r;if(!h(this,Nt,Bc)){j(this,Nt,eh).call(this,e);return}if(e.target===h(this,ci)){(n=h(this,Yn).firstChild)==null||n.focus();return}(r=e.target.nextSibling)==null||r.focus()}_moveToPrevious(e){var n,r;if(e.target===((n=h(this,Yn))==null?void 0:n.firstChild)||e.target===h(this,ci)){h(this,Nt,Bc)&&this._hideDropdownFromKeyboard();return}h(this,Nt,Bc)||j(this,Nt,eh).call(this,e),(r=e.target.previousSibling)==null||r.focus()}_moveToBeginning(e){var n;if(!h(this,Nt,Bc)){j(this,Nt,eh).call(this,e);return}(n=h(this,Yn).firstChild)==null||n.focus()}_moveToEnd(e){var n;if(!h(this,Nt,Bc)){j(this,Nt,eh).call(this,e);return}(n=h(this,Yn).lastChild)==null||n.focus()}hideDropdown(){var e,n;(e=h(this,Yn))==null||e.classList.add("hidden"),h(this,ci).ariaExpanded="false",(n=h(this,_u))==null||n.abort(),_(this,_u,null)}_hideDropdownFromKeyboard(){var e;
691if(!h(this,Og)){if(!h(this,Nt,Bc)){(e=h(this,Wl))==null||e.unselect();return}this.hideDropdown(),h(this,ci).focus({preventScroll:!0,focusVisible:h(this,Dw)})}}updateColor(e){if(h(this,uf)&&(h(this,uf).style.backgroundColor=e),!h(this,Yn))return;const n=h(this,$a).highlightColors.values();for(const r of h(this,Yn).children)r.ariaSelected=n.next().value===e.toUpperCase()}destroy(){var e,n;(e=h(this,ci))==null||e.remove(),_(this,ci,null),_(this,uf,null),(n=h(this,Yn))==null||n.remove(),_(this,Yn,null)}};ci=new WeakMap,uf=new WeakMap,Mg=new WeakMap,Yn=new WeakMap,Dw=new WeakMap,Og=new WeakMap,Wl=new WeakMap,Mw=new WeakMap,_u=new WeakMap,$a=new WeakMap,Ow=new WeakMap,Nt=new WeakSet,w2=function(){const e=document.createElement("div"),n=h(this,$a)._signal;e.addEventListener("contextmenu",Ii,{signal:n}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),h(this,Wl)&&(e.id=`${h(this,Wl).id}_colorpicker_dropdown`);for(const[r,s]of h(this,$a).highlightColors){const i=document.createElement("button");i.tabIndex="0",i.role="option",i.setAttribute("data-color",s),i.title=r,i.setAttribute("data-l10n-id",h(Ps,Ow)[r]);const a=document.createElement("span");i.append(a),a.className="swatch",a.style.backgroundColor=s,i.ariaSelected=s===h(this,Mg),i.addEventListener("click",j(this,Nt,k2).bind(this,s),{signal:n}),e.append(i)}return e.addEventListener("keydown",j(this,Nt,S2).bind(this),{signal:n}),e}
691,k2=function(e,n){n.stopPropagation(),h(this,Mw).dispatch("switchannotationeditorparams",{source:this,type:ot.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)},S2=function(e){Ps._keyboardManager.exec(this,e)},eh=function(e){if(h(this,Nt,Bc)){this.hideDropdown();return}if(_(this,Dw,e.detail===0),h(this,_u)||(_(this,_u,new AbortController),window.addEventListener("pointerdown",j(this,Nt,rG).bind(this),{signal:h(this,$a).combinedSignal(h(this,_u))})),h(this,ci).ariaExpanded="true",h(this,Yn)){h(this,Yn).classList.remove("hidden");return}const n=_(this,Yn,j(this,Nt,w2).call(this));h(this,ci).append(n)},rG=function(e){var n;(n=h(this,Yn))!=null&&n.contains(e.target)||this.hideDropdown()},Bc=function(){return h(this,Yn)&&!h(this,Yn).classList.contains("hidden")},A(Ps,Ow,null);let Pb=Ps;var Mo,Lw,Lg,Fw;const ch=class ch{constructor(e){A(this,Mo,null);A(this,Lw,null);A(this,Lg,null);_(this,Lw,e),_(this,Lg,e._uiManager),h(ch,Fw)||_(ch,Fw,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(h(this,Mo))return h(this,Mo);const{editorType:e,colorType:n,colorValue:r}=h(this,Lw),s=_(this,Mo,document.createElement("input"));return s.type="color",s.value=r||"#000000",s.className="basicColorPicker",s.tabIndex=0,s.setAttribute("data-l10n-id",h(ch,Fw)[e]),s.addEventListener("input",()=>{h(this,Lg).updateParams(n,s.value)},{signal:h(this,Lg)._signal}),s}update(e){h(this,Mo)&&(h(this,Mo).value=e)}destroy(){var e;(e=h(this,Mo))==null||e.remove(),_(this,Mo,null)}hideDropdown(){}};Mo=new WeakMap,Lw=new WeakMap,Lg=new WeakMap,Fw=new WeakMap,A(ch,Fw,null);let y_=ch;function i5(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function Rx(t){return Math.max(0,Math.min(255,255*t))}class a5{static CMYK_G([e,n,r,s]){return["G",1-Math.min(1,.3*e+.59*r+.11*n+s)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=Rx(e),[e,e,e]}static G_HTML([e]){const n=i5(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(Rx)}static RGB_HTML(e){return`#${e.map(i5).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,n,r,s]){return["RGB",1-Math.min(1,e+s),1-Math.min(1,r+s),1-Math.min(1,n+s)]}static CMYK_rgb([e,n,r,s]){return[Rx(1-Math.min(1,e+s)),Rx(1-Math.min(1,r+s)),Rx(1-Math.min(1,n+s))]}static CMYK_HTML(e){const n=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(n)}static RGB_CMYK([e,n,r]){const s=1-e,i=1-n,a=1-r,o=Math.min(s,i,a);return["CMYK",s,i,a,o]}}class j_e{create(e,n,r=!1){if(e<=0||n<=0)throw new Error("Invalid SVG dimensions");const s=this._createSVG("svg:svg");return s.setAttribute("version","1.1"),r||(s.setAttribute("width",`${e}px`),s.setAttribute("height",`${n}px`)),s.setAttribute("preserveAspectRatio","none"),s.setAttribute("viewBox",`0 0 ${e} ${n}`),s}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Lt("Abstract method `_createSVG` called.")}}class Rb extends j_e{_createSVG(e){return document.createElementNS(fl,e)}}const N_e=9,tp=new WeakSet,P_e=new Date().getTimezoneOffset()*60*1e3;class o5{static create(e){switch(e.data.annotationType){case En.LINK:return new kD(e);case En.TEXT:return new I_e(e);case En.WIDGET:switch(e.data.fieldType){case"Tx":return new D_e(e);case"Btn":return e.data.radioButton?new aG(e):e.data.checkBox?new O_e(e):new L_e(e);case"Ch":return new F_e(e);case"Sig":return new M_e(e)}return new hp(e);case En.POPUP:return new E2(e);case En.FREETEXT:return new dG(e);case En.LINE:return new $_e(e);case En.SQUARE:return new U_e(e);case En.CIRCLE:return new z_e(e);case En.POLYLINE:return new hG(e);case En.CARET:return new W_e(e);case En.INK:return new SD(e);case En.POLYGON:return new V_e(e);case En.HIGHLIGHT:return new fG(e);case En.UNDERLINE:return new H_e(e);case En.SQUIGGLY:return new q_e(e);case En.STRIKEOUT:return new G_e(e);case En.STAMP:return new pG(e);case En.FILEATTACHMENT:return new K_e(e);default:return new hn(e)}}}var df,Fg,Qi,Bw,_2;const RD=class RD{constructor(e,{isRenderable:n=!1,ignoreBorder:r=!1,createQuadrilaterals:s=!1}={}){A(this,Bw);A(this,df,null);A(this,Fg,!1);A(this,Qi,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,n&&
691(this.container=this._createContainer(r)),s&&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 RD._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}get 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:s}=this.data;let i=-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],i=n[l+2]):n[l+1]===a&&(i=Math.max(i,n[l+2]));return[i,a]}if((r==null?void 0:r.length)>=1){for(const l of r)for(let u=0,d=l.length;u<d;u+=2)l[u+1]>a?(a=l[u+1],i=l[u]):l[u+1]===a&&(i=Math.max(i,l[u]));if(i!==1/0)return[i,a]}return s?[s[2],s[3]]:null}_normalizePoint(e){const{page:{view:n},viewport:{rawDims:{pageWidth:r,pageHeight:s,pageX:i,pageY:a}}}=this.parent;return e[1]=n[3]-e[1]+n[1],e[0]=100*(e[0]-i)/r,e[1]=100*(e[1]-a)/s,e}get commentText(){var n,r,s;const{data:e}=this;return((r=(n=this.annotationStorage.getRawValue(`${Eb}${e.id}`))==null?void 0:n.popup)==null?void 0:r.contents)||((s=e.contentsObj)==null?void 0:s.str)||""}set commentText(e){const{data:n}=this,r={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(n.id,{popup:r})||this.annotationStorage.setValue(`${Eb}${n.id}`,{id:n.id,annotationType:n.annotationType,pageIndex:this.parent.page._pageIndex,popup:r,popupRef:n.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){var e,n;(n=((e=h(this,Qi))==null?void 0:e.popup)||this.popup)==null||n.remove(),_(this,Qi,this.popup=null)}updateEdited(e){var i;if(!this.container)return;e.rect&&(h(this,df)||_(this,df,{rect:this.data.rect.slice(0)}));const{rect:n,popup:r}=e;n&&j(this,Bw,_2).call(this,n);let s=((i=h(this,Qi))==null?void 0:i.popup)||this.popup;!s&&(r!=null&&r.text)&&(this._createPopup(r),s=h(this,Qi).popup),s&&(s.updateEdited(e),r!=null&&r.deleted&&(s.remove(),_(this,Qi,null),this.popup=null))}resetEdited(){var e;h(this,df)&&(j(this,Bw,_2).call(this,h(this,df).rect),(e=h(this,Qi))==null||e.popup.resetEdited(),_(this,df,null))}_createContainer(e){const{data:n,parent:{page:r,viewport:s}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",n.id),!(this instanceof hp)&&!(this instanceof kD)&&(i.tabIndex=0);const{style:a}=i;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,n.alternativeText&&(i.title=n.alternativeText),n.noRotate&&i.classList.add("norotate"),!n.rect||this instanceof E2){const{rotation:g}=n;return!n.hasOwnCanvas&&g!==0&&this.setRotation(g,i),i}const{width:o,height:l}=this;if(!e&&n.borderStyle.width>0){a.borderWidth=`${n.borderStyle.width}px`;const g=n.borderStyle.horizontalCornerRadius,b=n.borderStyle.verticalCornerRadius;if(g>0||b>0){const w=`calc(${g}px * var(--total-scale-factor)) / calc(${b}px * var(--total-scale-factor))`;a.borderRadius=w}else if(this instanceof aG){const w=`calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;a.borderRadius=w}switch(n.borderStyle.style){case Lp.SOLID:a.borderStyle="solid";break;case Lp.DASHED:a.borderStyle="dashed";break;case Lp.BEVELED:ze("Unimplemented border style: beveled");break;case Lp.INSET:ze("Unimplemented border style: inset");break;case Lp.UNDERLINE:a.borderBottomStyle="solid";break}const x=n.borderColor||null;x?(_(this,Fg,!0),a.borderColor=pe.makeHexColor(x[0]|0,x[1]|0,x[2]|0)):a.borderWidth=0}const u=pe.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:d,pageHeight:f,pageX:p,pageY:m}=s.rawDims;a.left=`${100*(u[0]-p)/d}%`,a.top=`${100*(u[1]-m)/f}%`;const{rotation:y}=n;return n.hasOwnCanvas||y===0?(a.width=`${100*o/d}%`,a.height=`${100*l/f}%`):this.setRotation(y,i),i}setRotation(e,n=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:s}=this.parent.viewport.rawDims;let{width:i,height:a}=this;e%180!==0&&([i,a]=[a,i]),n.style.width=`${100*i/r}%`,n.style.height=`${100*a/s}%`,n.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(n,r,s)=>{const i=s.detail[n],a=i[0],o=i.slice(1);s.target.style[r]=a5[`${a}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[r]:a5[`${a}_rgb`](o)})};return Qe(this,"_commonActions",{display:n=>{const{display:r}=n.detail,s=r%2===1;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:s,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(()=>
691n.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 s of Object.keys(n.detail)){const i=e[s]||r[s];i==null||i(n)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const n=this.annotationStorage.getRawValue(this.data.id);if(!n)return;const r=this._commonActions;for(const[s,i]of Object.entries(n)){const a=r[s];if(a){const o={detail:{[s]:i},target:e};a(o),delete n[s]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[n,r,s,i]=this.data.rect.map(g=>Math.fround(g));if(e.length===8){const[g,b,x,w]=e.subarray(2,6);if(s===g&&i===b&&n===x&&r===w)return}const{style:a}=this.container;let o;if(h(this,Fg)){const{borderColor:g,borderWidth:b}=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="${g}" stroke-width="${b}">`],this.container.classList.add("hasBorder")}const l=s-n,u=i-r,{svgFactory:d}=this,f=d.createElement("svg");f.classList.add("quadrilateralsContainer"),f.setAttribute("width",0),f.setAttribute("height",0),f.role="none";const p=d.createElement("defs");f.append(p);const m=d.createElement("clipPath"),y=`clippath_${this.data.id}`;m.setAttribute("id",y),m.setAttribute("clipPathUnits","objectBoundingBox"),p.append(m);for(let g=2,b=e.length;g<b;g+=8){const x=e[g],w=e[g+1],v=e[g+2],S=e[g+3],E=d.createElement("rect"),C=(v-n)/l,T=(i-w)/u,P=(x-v)/l,M=(w-S)/u;E.setAttribute("x",C),E.setAttribute("y",T),E.setAttribute("width",P),E.setAttribute("height",M),m.append(E),o==null||o.push(`<rect vector-effect="non-scaling-stroke" x="${C}" y="${T}" width="${P}" height="${M}"/>`)}h(this,Fg)&&(o.push("</g></svg>')"),a.backgroundImage=o.join("")),this.container.append(f),this.container.style.clipPath=`url(#${y})`}_createPopup(e=null){const{data:n}=this;let r,s;e?(r={str:e.text},s=e.date):(r=n.contentsObj,s=n.modificationDate);const i=_(this,Qi,new E2({data:{color:n.color,titleObj:n.titleObj,modificationDate:s,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]}));this.parent._commentManager||this.parent.div.append(i.render())}get hasPopupElement(){return!!(h(this,Qi)||this.popup||this.data.popupRef)}get extraPopupElement(){return h(this,Qi)}render(){Lt("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,n=null){const r=[];if(this._fieldObjects){const s=this._fieldObjects[e];if(s)for(const{page:i,id:a,exportValues:o}of s){if(i===-1||a===n)continue;const l=typeof o=="string"?o:null,u=document.querySelector(`[data-element-id="${a}"]`);if(u&&!tp.has(u)){ze(`_getElementsByName - element not allowed: ${a}`);continue}r.push({id:a,exportValue:l,domElement:u})}return r}for(const s of document.getElementsByName(e)){const{exportValue:i}=s,a=s.getAttribute("data-element-id");a!==n&&tp.has(s)&&r.push({id:a,exportValue:i,domElement:s})}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]}};df=new WeakMap,Fg=new WeakMap,Qi=new WeakMap,Bw=new WeakSet,_2=function(e){const{container:{style:n},data:{rect:r,rotation:s},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:l}}}}=this;r==null||r.splice(0,4,...e),n.left=`${100*(e[0]-o)/i}%`,n.top=`${100*(a-e[3]+l)/a}%`,s===0?(n.width=`${100*(e[2]-e[0])/i}%`,n.height=`${100*(e[3]-e[1])/a}%`):this.setRotation(s)};let hn=RD;class R_e extends hn{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),this.extraPopupElement.popup.renderCommentButton())}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}
691get 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.container.remove(),this.container=null,this.removePopup()}}var Ei,th,sG,iG;class kD extends hn{constructor(n,r=null){super(n,{isRenderable:!0,ignoreBorder:!!(r!=null&&r.ignoreBorder),createQuadrilaterals:!0});A(this,Ei);this.isTooltipOnly=n.data.isTooltipOnly}render(){const{data:n,linkService:r}=this,s=document.createElement("a");s.setAttribute("data-element-id",n.id);let i=!1;return n.url?(r.addLinkAttributes(s,n.url,n.newWindow),i=!0):n.action?(this._bindNamedAction(s,n.action,n.overlaidText),i=!0):n.attachment?(j(this,Ei,sG).call(this,s,n.attachment,n.overlaidText,n.attachmentDest),i=!0):n.setOCGState?(j(this,Ei,iG).call(this,s,n.setOCGState,n.overlaidText),i=!0):n.dest?(this._bindLink(s,n.dest,n.overlaidText),i=!0):(n.actions&&(n.actions.Action||n.actions["Mouse Up"]||n.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(s,n),i=!0),n.resetForm?(this._bindResetFormAction(s,n.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(s,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(s),this.container}_bindLink(n,r,s=""){n.href=this.linkService.getDestinationHash(r),n.onclick=()=>(r&&this.linkService.goToDestination(r),!1),(r||r==="")&&j(this,Ei,th).call(this),s&&(n.title=s)}_bindNamedAction(n,r,s=""){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeNamedAction(r),!1),s&&(n.title=s),j(this,Ei,th).call(this)}_bindJSAction(n,r){n.href=this.linkService.getAnchorUrl("");const s=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(r.actions)){const a=s.get(i);a&&(n[a]=()=>{var o;return(o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:i}}),!1})}r.overlaidText&&(n.title=r.overlaidText),n.onclick||(n.onclick=()=>!1),j(this,Ei,th).call(this)}_bindResetFormAction(n,r){const s=n.onclick;if(s||(n.href=this.linkService.getAnchorUrl("")),j(this,Ei,th).call(this),!this._fieldObjects){ze('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),s||(n.onclick=()=>!1);return}n.onclick=()=>{var f;s==null||s();const{fields:i,refs:a,include:o}=r,l=[];if(i.length!==0||a.length!==0){const p=new Set(a);for(const m of i){const y=this._fieldObjects[m]||[];for(const{id:g}of y)p.add(g)}for(const m of Object.values(this._fieldObjects))for(const y of m)p.has(y.id)===o&&l.push(y)}else for(const p of Object.values(this._fieldObjects))l.push(...p);const u=this.annotationStorage,d=[];for(const p of l){const{id:m}=p;switch(d.push(m),p.type){case"text":{const g=p.defaultValue||"";u.setValue(m,{value:g});break}case"checkbox":case"radiobutton":{const g=p.defaultValue===p.exportValues;u.setValue(m,{value:g});break}case"combobox":case"listbox":{const g=p.defaultValue||"";u.setValue(m,{value:g});break}default:continue}const y=document.querySelector(`[data-element-id="${m}"]`);if(y){if(!tp.has(y)){ze(`_bindResetFormAction - element not allowed: ${m}`);continue}}else continue;y.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((f=this.linkService.eventBus)==null||f.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:d,name:"ResetForm"}})),!1}}}Ei=new WeakSet,th=function(){this.container.setAttribute("data-internal-link","")},sG=function(n,r,s="",i=null){n.href=this.linkService.getAnchorUrl(""),r.description?n.title=r.description:s&&(n.title=s),n.onclick=()=>{var a;return(a=this.downloadManager)==null||a.openOrDownloadData(r.content,r.filename,i),!1},j(this,Ei,th).call(this)},iG=function(n,r,s=""){n.href=this.linkService.getAnchorUrl(""),n.onclick=()=>(this.linkService.executeSetOCGState(r),!1),s&&(n.title=s),j(this,Ei,th).call(this)};class I_e extends hn{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}
691class hp extends hn{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 hr.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,n,r,s,i){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:s,value:i(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}i&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:i(a)}}))})}_setEventListeners(e,n,r,s){var i,a,o;for(const[l,u]of r)(u==="Action"||(i=this.data.actions)!=null&&i[u])&&((u==="Focus"||u==="Blur")&&(n||(n={focused:!1})),this._setEventListener(e,n,l,u,s),u==="Focus"&&!((a=this.data.actions)!=null&&a.Blur)?this._setEventListener(e,n,"blur","Blur",null):u==="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":pe.makeHexColor(n[0],n[1],n[2])}_setTextStyle(e){const n=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||N_e,i=e.style;let a;const o=2,l=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-o),d=Math.round(u/(QA*s))||1,f=u/d;a=Math.min(s,l(f/QA))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-o);a=Math.min(s,l(u/QA))}i.fontSize=`calc(${a}px * var(--total-scale-factor))`,i.color=pe.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(i.textAlign=n[this.data.textAlignment])}_setRequired(e,n){n?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",n)}}class D_e extends hp{constructor(e){const n=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:n})}setPropertyOnSiblings(e,n,r,s){const i=this.annotationStorage;
691for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[n]=r),i.setValue(a.id,{[s]:r})}render(){var s,i;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 u=a.formattedValue||((s=this.data.textContent)==null?void 0:s.join(`
692`))||null;u&&this.data.comb&&(u=u.replaceAll(/\s+/g,""));const d={userValue:o,formattedValue:u,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=u??o,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type=this.data.password?"password":"text",r.setAttribute("value",u??o),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),tp.add(r),r.setAttribute("data-element-id",n),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=0;const{datetimeFormat:f,datetimeType:p,timeStep:m}=this.data,y=!!p&&this.enableScripting;f&&(r.title=f),this._setRequired(r,this.data.required),l&&(r.maxLength=l),r.addEventListener("input",b=>{e.setValue(n,{value:b.target.value}),this.setPropertyOnSiblings(r,"value",b.target.value,"value"),d.formattedValue=null}),r.addEventListener("resetform",b=>{const x=this.data.defaultFieldValue??"";r.value=d.userValue=x,d.formattedValue=null});let g=b=>{const{formattedValue:x}=d;x!=null&&(b.target.value=x),b.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",x=>{var v;if(d.focused)return;const{target:w}=x;if(y&&(w.type=p,m&&(w.step=m)),d.userValue){const S=d.userValue;if(y)if(p==="time"){const E=new Date(S),C=[E.getHours(),E.getMinutes(),E.getSeconds()];w.value=C.map(T=>T.toString().padStart(2,"0")).join(":")}else w.value=new Date(S-P_e).toISOString().split(p==="date"?"T":".",1)[0];else w.value=S}d.lastCommittedValue=w.value,d.commitKey=1,(v=this.data.actions)!=null&&v.Focus||(d.focused=!0)}),r.addEventListener("updatefromsandbox",x=>{this.showElementAndHideCanvas(x.target);const w={value(v){d.userValue=v.detail.value??"",y||e.setValue(n,{value:d.userValue.toString()}),v.target.value=d.userValue},formattedValue(v){const{formattedValue:S}=v.detail;d.formattedValue=S,S!=null&&v.target!==document.activeElement&&(v.target.value=S);const E={formattedValue:S};y&&(E.value=S),e.setValue(n,E)},selRange(v){v.target.setSelectionRange(...v.detail.selRange)},charLimit:v=>{var T;const{charLimit:S}=v.detail,{target:E}=v;if(S===0){E.removeAttribute("maxLength");return}E.setAttribute("maxLength",S);let C=d.userValue;!C||C.length<=S||(C=C.slice(0,S),E.value=d.userValue=C,e.setValue(n,{value:C}),(T=this.linkService.eventBus)==null||T.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:C,willCommit:!0,commitKey:1,selStart:E.selectionStart,selEnd:E.selectionEnd}}))}};this._dispatchEventFromSandbox(w,x)}),r.addEventListener("keydown",x=>{var S;d.commitKey=1;let w=-1;
692if(x.key==="Escape"?w=0:x.key==="Enter"&&!this.data.multiLine?w=2:x.key==="Tab"&&(d.commitKey=3),w===-1)return;const{value:v}=x.target;d.lastCommittedValue!==v&&(d.lastCommittedValue=v,d.userValue=v,(S=this.linkService.eventBus)==null||S.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:v,willCommit:!0,commitKey:w,selStart:x.target.selectionStart,selEnd:x.target.selectionEnd}}))});const b=g;g=null,r.addEventListener("blur",x=>{var S,E;if(!d.focused||!x.relatedTarget)return;(S=this.data.actions)!=null&&S.Blur||(d.focused=!1);const{target:w}=x;let{value:v}=w;if(y){if(v&&p==="time"){const C=v.split(":").map(T=>parseInt(T,10));v=new Date(2e3,0,1,C[0],C[1],C[2]||0).valueOf(),w.step=""}else v.includes("T")||(v=`${v}T00:00`),v=new Date(v).valueOf();w.type="text"}d.userValue=v,d.lastCommittedValue!==v&&((E=this.linkService.eventBus)==null||E.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:v,willCommit:!0,commitKey:d.commitKey,selStart:x.target.selectionStart,selEnd:x.target.selectionEnd}})),b(x)}),(i=this.data.actions)!=null&&i.Keystroke&&r.addEventListener("beforeinput",x=>{var M;d.lastCommittedValue=null;const{data:w,target:v}=x,{value:S,selectionStart:E,selectionEnd:C}=v;let T=E,P=C;switch(x.inputType){case"deleteWordBackward":{const R=S.substring(0,E).match(/\w*[^\w]*$/);R&&(T-=R[0].length);break}
vendor: 4,162 bytes, line 692
692case"deleteWordForward":{const R=S.substring(E).match(/^[^\w]*\w*/);R&&(P+=R[0].length);break}case"deleteContentBackward":E===C&&(T-=1);break;case"deleteContentForward":E===C&&(P+=1);break}x.preventDefault(),(M=this.linkService.eventBus)==null||M.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:S,change:w||"",willCommit:!1,selStart:T,selEnd:P}})}),this._setEventListeners(r,d,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],x=>x.target.value)}if(g&&r.addEventListener("blur",g),this.data.comb){const x=(this.data.rect[2]-this.data.rect[0])/l;r.classList.add("comb"),r.style.letterSpacing=`calc(${x}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 M_e extends hp{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class O_e extends hp{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,n=this.data,r=n.id;let s=e.getValue(r,{value:n.exportValue===n.fieldValue}).value;typeof s=="string"&&(s=s!=="Off",e.setValue(r,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const i=document.createElement("input");return tp.add(i),i.setAttribute("data-element-id",r),i.disabled=n.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=n.fieldName,s&&i.setAttribute("checked",!0),i.setAttribute("exportValue",n.exportValue),i.tabIndex=0,i.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const u of this._getElementsByName(o,r)){const d=l&&u.exportValue===n.exportValue;u.domElement&&(u.domElement.checked=d),e.setValue(u.id,{value:d})}e.setValue(r,{value:l})}),i.addEventListener("resetform",a=>{const o=n.defaultFieldValue||"Off";a.target.checked=o===n.exportValue}),this.enableScripting&&this.hasJSActions&&(i.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(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class aG extends hp{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 s=e.getValue(r,{value:n.fieldValue===n.buttonValue}).value;if(typeof s=="string"&&(s=s!==n.buttonValue,e.setValue(r,{value:s})),s)for(const a of this._getElementsByName(n.fieldName,r))e.setValue(a.id,{value:!1});const i=document.createElement("input");if(tp.add(i),i.setAttribute("data-element-id",r),i.disabled=n.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=n.fieldName,s&&i.setAttribute("checked",!0),i.tabIndex=0,i.addEventListener("change",a=>{const{name:o,checked:l}=a.target;for(const u of this._getElementsByName(o,r))e.setValue(u.id,{value:!1});e.setValue(r,{value:l})}),i.addEventListener("resetform",a=>{const o=n.defaultFieldValue;a.target.checked=o!=null&&o===n.buttonValue}),this.enableScripting&&this.hasJSActions){const a=n.buttonValue;i.addEventListener("updatefromsandbox",o=>{const l={value:u=>{const d=a===u.detail.value;for(const f of this._getElementsByName(u.target.name)){const p=d&&f.id===r;f.domElement&&(f.domElement.checked=p),e.setValue(f.id,{value:p})}}};this._dispatchEventFromSandbox(l,o)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)}
692return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class L_e extends kD{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 F_e extends hp{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}),s=document.createElement("select");tp.add(s),s.setAttribute("data-element-id",n),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=0;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",d=>{const f=this.data.defaultFieldValue;for(const p of s.options)p.selected=p.value===f});for(const d of this.data.options){const f=document.createElement("option");f.textContent=d.displayValue,f.value=d.exportValue,r.value.includes(d.exportValue)&&(f.setAttribute("selected",!0),i=!1),s.append(f)}let a=null;if(i){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),s.prepend(d),a=()=>{d.remove(),s.removeEventListener("input",a),a=null},s.addEventListener("input",a)}const o=d=>{const f=d?"value":"textContent",{options:p,multiple:m}=s;return m?Array.prototype.filter.call(p,y=>y.selected).map(y=>y[f]):p.selectedIndex===-1?null:p[p.selectedIndex][f]};let l=o(!1);const u=d=>{const f=d.target.options;return Array.prototype.map.call(f,p=>({displayValue:p.textContent,exportValue:p.value}))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",d=>{const f={value(p){a==null||a();const m=p.detail.value,y=new Set(Array.isArray(m)?m:[m]);for(const g of s.options)g.selected=y.has(g.value);e.setValue(n,{value:o(!0)}),l=o(!1)},multipleSelection(p){s.multiple=!0},remove(p){const m=s.options,y=p.detail.remove;m[y].selected=!1,s.remove(y),m.length>0&&Array.prototype.findIndex.call(m,b=>b.selected)===-1&&(m[0].selected=!0),e.setValue(n,{value:o(!0),items:u(p)}),l=o(!1)},clear(p){for(;s.length!==0;)s.remove(0);e.setValue(n,{value:null,items:[]}),l=o(!1)},insert(p){const{index:m,displayValue:y,exportValue:g}=p.detail.insert,b=s.children[m],x=document.createElement("option");x.textContent=y,x.value=g,b?b.before(x):s.append(x),e.setValue(n,{value:o(!0),items:u(p)}),l=o(!1)},items(p){const{items:m}=p.detail;for(;s.length!==0;)s.remove(0);for(const y of m){const{displayValue:g,exportValue:b}=y,x=document.createElement("option");x.textContent=g,x.value=b,s.append(x)}s.options.length>0&&(s.options[0].selected=!0),e.setValue(n,{value:o(!0),items:u(p)}),l=o(!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:o(!0)}),l=o(!1)},editable(p){p.target.disabled=!p.detail.editable}};this._dispatchEventFromSandbox(f,d)}),s.addEventListener("input",d=>{var m;const f=o(!0),p=o(!1);e.setValue(n,{value:f}),d.preventDefault(),(m=this.linkService.eventBus)==null||m.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:l,change:p,changeEx:f,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):s.addEventListener("input",function(d){e.setValue(n,{value:o(!0)})}),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}var $w,C2;class E2 extends hn{constructor(n){const{data:r,elements:s,parent:i}=n,a=!!i._commentManager;super(n,{isRenderable:!a&&hn._hasPopupData(r)}
692);A(this,$w);if(this.elements=s,a&&hn._hasPopupData(r)){const o=this.popup=j(this,$w,C2).call(this);for(const l of s)l.popup=o}else this.popup=null}render(){const{container:n}=this;n.classList.add("popupAnnotation"),n.role="comment";const r=this.popup=j(this,$w,C2).call(this),s=[];for(const i of this.elements)i.popup=r,i.container.ariaHasPopup="dialog",s.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",s.map(i=>`${fD}${i}`).join(",")),this.container}}$w=new WeakSet,C2=function(){return new B_e({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 ui,Eu,M_,O_,Bg,$g,vn,Oo,Cu,hf,Ug,zg,Lo,di,Hl,ql,sr,Gl,Au,Uw,Kl,Vg,ff,Tu,Ur,ju,et,Fk,A2,T2,j2,Bk,N2,oG,lG,cG,uG,$k,Uk,P2;class B_e{constructor({container:e,color:n,elements:r,titleObj:s,modificationDate:i,contentsObj:a,richText:o,parent:l,rect:u,parentRect:d,open:f,commentManager:p=null}){A(this,et);A(this,ui,null);A(this,Eu,j(this,et,cG).bind(this));A(this,M_,j(this,et,P2).bind(this));A(this,O_,j(this,et,Uk).bind(this));A(this,Bg,j(this,et,$k).bind(this));A(this,$g,null);A(this,vn,null);A(this,Oo,null);A(this,Cu,null);A(this,hf,null);A(this,Ug,null);A(this,zg,null);A(this,Lo,!1);A(this,di,null);A(this,Hl,null);A(this,ql,null);A(this,sr,null);A(this,Gl,null);A(this,Au,null);A(this,Uw,null);A(this,Kl,null);A(this,Vg,null);A(this,ff,null);A(this,Tu,!1);A(this,Ur,null);A(this,ju,null);_(this,vn,e),_(this,Vg,s),_(this,Oo,a),_(this,Kl,o),_(this,Ug,l),_(this,$g,n),_(this,Uw,u),_(this,zg,d),_(this,hf,r),_(this,ui,p),_(this,Ur,r[0]),_(this,Cu,Tb.toDateObject(i)),this.trigger=r.flatMap(m=>m.getElementsToTriggerPopup()),p?this.renderCommentButton():(j(this,et,Fk).call(this),h(this,vn).hidden=!0,f&&j(this,et,$k).call(this))}renderCommentButton(){if(h(this,sr)||(h(this,Gl)||j(this,et,A2).call(this),!h(this,Gl)))return;const{signal:e}=_(this,Hl,new AbortController),n=!!h(this,Ur).extraPopupElement,r=()=>{h(this,ui).toggleCommentPopup(this,!0,void 0,!n)},s=()=>{h(this,ui).toggleCommentPopup(this,!1,!0,!n)},i=()=>{h(this,ui).toggleCommentPopup(this,!1,!1)};if(n){_(this,sr,h(this,Ur).container);for(const a of this.trigger)a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.addEventListener("keydown",h(this,Eu),{signal:e}),a.addEventListener("click",r,{signal:e}),a.addEventListener("pointerenter",s,{signal:e}),a.addEventListener("pointerleave",i,{signal:e}),a.classList.add("popupTriggerArea")}else{const a=_(this,sr,document.createElement("button"));a.className="annotationCommentButton";const o=h(this,Ur).container;a.style.zIndex=o.style.zIndex+1,a.tabIndex=0,a.ariaHasPopup="dialog",a.ariaControls="commentPopup",a.setAttribute("data-l10n-id","pdfjs-show-comment-button"),j(this,et,j2).call(this),j(this,et,T2).call(this),a.addEventListener("keydown",h(this,Eu),{signal:e}),a.addEventListener("click",r,{signal:e}),a.addEventListener("pointerenter",s,{signal:e}),a.addEventListener("pointerleave",i,{signal:e}),o.after(a)}}get commentButtonColor(){const{color:e,opacity:n}=h(this,Ur).commentData;return e?h(this,Ug)._commentManager.makeCommentColor(e,n):null}focusCommentButton(){setTimeout(()=>{var e;(e=h(this,sr))==null||e.focus()},0)}getData(){const{richText:e,color:n,opacity:r,creationDate:s,modificationDate:i}=h(this,Ur).commentData;return{contentsObj:{str:this.comment},richText:e,color:n,opacity:r,creationDate:s,modificationDate:i}}get elementBeforePopup(){return h(this,sr)}get comment(){return h(this,ju)||_(this,ju,h(this,Ur).commentText),h(this,ju)}set comment(e){e!==this.comment&&(h(this,Ur).commentText=_(this,ju,e))}get parentBoundingClientRect(){return h(this,Ur).layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:n}){h(this,sr)&&(h(this,sr).classList.toggle("selected",e),h(this,sr).ariaExpanded=n)}setSelectedCommentButton(e){h(this,sr).classList.toggle("selected",e)}get commentPopupPosition(){if(h(this,Au))return h(this,Au);const{x:e,y:n,height:r}=h(this,sr).getBoundingClientRect(),{x:s,y:i,width:a,height:o}=h(this,Ur).layer.getBoundingClientRect();return[(e-s)/a,(n+r-i)/o]}set commentPopupPosition(e){_(this,Au,e)}hasDefaultPopupPosition(){return h(this,Au)===null}get commentButtonPosition(){return h(this,Gl)}get commentButtonWidth(){return h(this,sr).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){const[n,r]=h(this,Au)||this.commentButtonPosition.map(u=>u/100),s=this.parentBoundingClientRect,{x:i,y:a,width:o,height:l}=s;h(this,ui).showDialog(null,this,i+n*o,a+r*l,{...e,parentDimensions:s})}render(){var r,s;if(h(this,di))return;const e=_(this,di,document.createElement("div"));if(e.className="popup",h(this,$g)){const i=e.style.outlineColor=pe.makeHexColor(...h(this,$g));e.style.backgroundColor=`color-mix(in srgb, ${i} 30%, white)`}const n=document.createElement("span");if(n.className="header",(r=h(this,Vg))!=null&&r.str){const i=document.createElement("span");i.className="title",n.append(i),{dir:i.dir,str:i.textContent}=h(this,Vg)}if(e.append(n),h(this,Cu)){const i=document.createElement("time");i.className="popupDate",i.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),i.setAttribute("data-l10n-args",JSON.stringify({dateObj:h(this,Cu).valueOf()})),i.dateTime=h(this,Cu).toISOString(),n.append(i)}mD({html:h(this,et,Bk)||h(this,Oo).str,dir:(s=h(this,Oo))==null?void 0:s.dir,className:"popupContent"},e),h(this,vn).append(e)}updateEdited({rect:e,popup:n,deleted:r}){var s;if(h(this,ui)){r?(this.remove(),_(this,ju,null)):n&&(n.deleted?this.remove():(j(this,et,j2).call(this),_(this,ju,n.text))),e&&(_(this,Gl,null),j(this,et,A2).call(this),j(this,et,T2).call(this));return}if(r||n!=null&&n.deleted){this.remove();return}j(this,et,Fk).call(this),h(this,ff)||_(this,ff,{contentsObj:h(this,Oo),richText:h(this,Kl)}),e&&_(this,ql,null),n&&n.text&&(_(this,Kl,j(this,et,lG).call(this,n.text)),_(this,Cu,Tb.toDateObject(n.date)),_(this,Oo,null)),(s=h(this,di))==null||s.remove(),_(this,di,null)}resetEdited(){var e;h(this,ff)&&({contentsObj:pn(this,Oo)._,richText:pn(this,Kl)._}=h(this,ff),_(this,ff,null),(e=h(this,di))==null||e.remove(),_(this,di,null),_(this,ql,null))}remove(){var e,n,r;if((e=h(this,Hl))==null||e.abort(),_(this,Hl,null),(n=h(this,di))==null||n.remove(),_(this,di,null),_(this,Tu,!1),_(this,Lo,!1),(r=h(this,sr))==null||r.remove(),_(this,sr,null),this.trigger)for(const s of this.trigger)s.classList.remove("popupTriggerArea")}forceHide(){_(this,Tu,this.isVisible),h(this,Tu)&&(h(this,vn).hidden=!0)}maybeShow(){h(this,ui)||(j(this,et,Fk).call(this),h(this,Tu)&&(h(this,di)||j(this,et,Uk).call(this),_(this,Tu,!1),h(this,vn).hidden=!1))}get isVisible(){return h(this,ui)?!1:h(this,vn).hidden===!1}}ui=new WeakMap,Eu=new WeakMap,M_=new WeakMap,O_=new WeakMap,Bg=new WeakMap,$g=new WeakMap,vn=new WeakMap,Oo=new WeakMap,Cu=new WeakMap,hf=new WeakMap,Ug=new WeakMap,zg=new WeakMap,Lo=new WeakMap,di=new WeakMap,Hl
692=new WeakMap,ql=new WeakMap,sr=new WeakMap,Gl=new WeakMap,Au=new WeakMap,Uw=new WeakMap,Kl=new WeakMap,Vg=new WeakMap,ff=new WeakMap,Tu=new WeakMap,Ur=new WeakMap,ju=new WeakMap,et=new WeakSet,Fk=function(){var n;if(h(this,Hl))return;_(this,Hl,new AbortController);const{signal:e}=h(this,Hl);for(const r of this.trigger)r.addEventListener("click",h(this,Bg),{signal:e}),r.addEventListener("pointerenter",h(this,O_),{signal:e}),r.addEventListener("pointerleave",h(this,M_),{signal:e}),r.classList.add("popupTriggerArea");for(const r of h(this,hf))(n=r.container)==null||n.addEventListener("keydown",h(this,Eu),{signal:e})},A2=function(){const e=h(this,hf).find(n=>n.hasCommentButton);e&&_(this,Gl,e._normalizePoint(e.commentButtonPosition))},T2=function(){if(h(this,Ur).extraPopupElement&&!h(this,Ur).editor)return;this.renderCommentButton();const[e,n]=h(this,Gl),{style:r}=h(this,sr);r.left=`calc(${e}%)`,r.top=`calc(${n}% - var(--comment-button-dim))`},j2=function(){h(this,Ur).extraPopupElement||(this.renderCommentButton(),h(this,sr).style.backgroundColor=this.commentButtonColor||"")},Bk=function(){const e=h(this,Kl),n=h(this,Oo);return e!=null&&e.str&&(!(n!=null&&n.str)||n.str===e.str)&&h(this,Kl).html||null},N2=function(){var e,n,r;return((r=(n=(e=h(this,et,Bk))==null?void 0:e.attributes)==null?void 0:n.style)==null?void 0:r.fontSize)||0},oG=function(){var e,n,r;return((r=(n=(e=h(this,et,Bk))==null?void 0:e.attributes)==null?void 0:n.style)==null?void 0:r.color)||null},lG=function(e){const n=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:n}]}},s={style:{color:h(this,et,oG),fontSize:h(this,et,N2)?`calc(${h(this,et,N2)}px * var(--total-scale-factor))`:""}};for(const i of e.split(`
693`))n.push({name:"span",value:i,attributes:s});return r},cG=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&h(this,Lo))&&j(this,et,$k).call(this)},uG=function(){if(h(this,ql)!==null)return;const{page:{view:e},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:s,pageY:i}}}=h(this,Ug);let a=!!h(this,zg),o=a?h(this,zg):h(this,Uw);for(const y of h(this,hf))if(!o||pe.intersect(y.data.rect,o)!==null){o=y.data.rect,a=!0;break}const l=pe.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),d=a?o[2]-o[0]+5:0,f=l[0]+d,p=l[1];_(this,ql,[100*(f-s)/n,100*(p-i)/r]);const{style:m}=h(this,vn);m.left=`${h(this,ql)[0]}%`,m.top=`${h(this,ql)[1]}%`},$k=function(){if(h(this,ui)){h(this,ui).toggleCommentPopup(this,!1);return}_(this,Lo,!h(this,Lo)),h(this,Lo)?(j(this,et,Uk).call(this),h(this,vn).addEventListener("click",h(this,Bg)),h(this,vn).addEventListener("keydown",h(this,Eu))):(j(this,et,P2).call(this),h(this,vn).removeEventListener("click",h(this,Bg)),h(this,vn).removeEventListener("keydown",h(this,Eu)))},Uk=function(){h(this,di)||this.render(),this.isVisible?h(this,Lo)&&h(this,vn).classList.add("focused"):(j(this,et,uG).call(this),h(this,vn).hidden=!1,h(this,vn).style.zIndex=parseInt(h(this,vn).style.zIndex)+1e3)},P2=function(){h(this,vn).classList.remove("focused"),!(h(this,Lo)||!this.isVisible)&&(h(this,vn).hidden=!0,h(this,vn).style.zIndex=parseInt(h(this,vn).style.zIndex)-1e3)};class dG extends hn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=$e.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const n of this.textContent){const r=document.createElement("span");r.textContent=n,e.append(r)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var zw;class $_e extends hn{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});A(this,zw,null)}render(){this.container.classList.add("lineAnnotation");const{data:n,width:r,height:s}=this,i=this.svgFactory.create(r,s,!0),a=_(this,zw,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"),i.append(a),this.container.append(i),!n.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return h(this,zw)}addHighlightArea(){this.container.classList.add("highlightArea")}}zw=new WeakMap;var Vw;class U_e extends hn{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});A(this,Vw,null)}render(){this.container.classList.add("squareAnnotation");const{data:n,width:r,height:s}=this,i=this.svgFactory.create(r,s,!0),a=n.borderStyle.width,o=_(this,Vw,this.svgFactory.createElement("svg:rect"));return o.setAttribute("x",a/2),o.setAttribute("y",a/2),o.setAttribute("width",r-a),o.setAttribute("height",s-a),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),i.append(o),this.container.append(i),!n.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return h(this,Vw)}addHighlightArea(){this.container.classList.add("highlightArea")}}Vw=new WeakMap;var Ww;class z_e extends hn{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});A(this,Ww,null)}render(){this.container.classList.add("circleAnnotation");const{data:n,width:r,height:s}=this,i=this.svgFactory.create(r,s,!0),a=n.borderStyle.width,o=_(this,Ww,this.svgFactory.createElement("svg:ellipse"));return o.setAttribute("cx",r/2),o.setAttribute("cy",s/2),o.setAttribute("rx",r/2-a/2),o.setAttribute("ry",s/2-a/2),o.setAttribute("stroke-width",a||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),i.append(o),this.container.append(i),!n.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return h(this,Ww)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ww=new WeakMap;var Hw;class hG extends hn{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});A(this,Hw,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,vertices:r,borderStyle:s,popupRef:i},width:a,height:o}=this;if(!r)return this.container;const l=this.svgFactory.create(a,o,!0);let u=[];for(let f=0,p=r.length;f<p;f+=2){const m=r[f]-n[0],y=n[3]-r[f+1];u.push(`${m},${y}`)}u=u.join(" ");const d=_(this,Hw,this.svgFactory.createElement(this.svgElementName));return d.setAttribute("points",u),d.setAttribute("stroke-width",s.width||1),d.setAttribute("stroke","transparent"),d.setAttribute("fill","transparent"),l.append(d),this.container.append(l),!i&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return h(this,Hw)}addHighlightArea(){this.container.classList.add("highlightArea")}}Hw=new WeakMap;class V_e extends hG{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class W_e extends hn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}
693var qw,pf,Gw,R2;class SD extends hn{constructor(n){super(n,{isRenderable:!0,ignoreBorder:!0});A(this,Gw);A(this,qw,null);A(this,pf,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?$e.HIGHLIGHT:$e.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:n,rotation:r,inkLists:s,borderStyle:i,popupRef:a}}=this,{transform:o,width:l,height:u}=j(this,Gw,R2).call(this,r,n),d=this.svgFactory.create(l,u,!0),f=_(this,qw,this.svgFactory.createElement("svg:g"));d.append(f),f.setAttribute("stroke-width",i.width||1),f.setAttribute("stroke-linecap","round"),f.setAttribute("stroke-linejoin","round"),f.setAttribute("stroke-miterlimit",10),f.setAttribute("stroke","transparent"),f.setAttribute("fill","transparent"),f.setAttribute("transform",o);for(let p=0,m=s.length;p<m;p++){const y=this.svgFactory.createElement(this.svgElementName);h(this,pf).push(y),y.setAttribute("points",s[p].join(",")),f.append(y)}return!a&&this.hasPopupData&&this._createPopup(),this.container.append(d),this._editOnDoubleClick(),this.container}updateEdited(n){super.updateEdited(n);const{thickness:r,points:s,rect:i}=n,a=h(this,qw);if(r>=0&&a.setAttribute("stroke-width",r||1),s)for(let o=0,l=h(this,pf).length;o<l;o++)h(this,pf)[o].setAttribute("points",s[o].join(","));if(i){const{transform:o,width:l,height:u}=j(this,Gw,R2).call(this,this.data.rotation,i);a.parentElement.setAttribute("viewBox",`0 0 ${l} ${u}`),a.setAttribute("transform",o)}}getElementsToTriggerPopup(){return h(this,pf)}addHighlightArea(){this.container.classList.add("highlightArea")}}qw=new WeakMap,pf=new WeakMap,Gw=new WeakSet,R2=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 fG extends hn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=$e.HIGHLIGHT}render(){const{data:{overlaidText:e,popupRef:n}}=this;if(!n&&this.hasPopupData&&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 H_e extends hn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:n}}=this;if(!n&&this.hasPopupData&&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 q_e extends hn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:n}}=this;if(!n&&this.hasPopupData&&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 G_e extends hn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:e,popupRef:n}}=this;if(!n&&this.hasPopupData&&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 pG extends hn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=$e.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}
693var Kw,Yw,I2;class K_e extends hn{constructor(n){var s;super(n,{isRenderable:!0});A(this,Yw);A(this,Kw,null);const{file:r}=this.data;this.filename=r.filename,this.content=r.content,(s=this.linkService.eventBus)==null||s.dispatch("fileattachmentannotation",{source:this,...r})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:n,data:r}=this;let s;r.hasAppearance||r.fillAlpha===0?s=document.createElement("div"):(s=document.createElement("img"),s.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(r.name)?"paperclip":"pushpin"}.svg`,r.fillAlpha&&r.fillAlpha<1&&(s.style=`filter: opacity(${Math.round(r.fillAlpha*100)}%);`)),s.addEventListener("dblclick",j(this,Yw,I2).bind(this)),_(this,Kw,s);const{isMac:i}=hr.platform;return n.addEventListener("keydown",a=>{a.key==="Enter"&&(i?a.metaKey:a.ctrlKey)&&j(this,Yw,I2).call(this)}),!r.popupRef&&this.hasPopupData?this._createPopup():s.classList.add("popupTriggerArea"),n.append(s),n}getElementsToTriggerPopup(){return h(this,Kw)}addHighlightArea(){this.container.classList.add("highlightArea")}}Kw=new WeakMap,Yw=new WeakSet,I2=function(){var n;(n=this.downloadManager)==null||n.openOrDownloadData(this.content,this.filename)};var Wg,mf,Hg,Nu,Xw,gf,Ed,D2,M2,qg;let _D=(qg=class{constructor({div:e,accessibilityManager:n,annotationCanvasMap:r,annotationEditorUIManager:s,page:i,viewport:a,structTreeLayer:o,commentManager:l,linkService:u,annotationStorage:d}){A(this,Ed);A(this,Wg,null);A(this,mf,null);A(this,Hg,null);A(this,Nu,new Map);A(this,Xw,null);A(this,gf,null);this.div=e,_(this,Wg,n),_(this,mf,r),_(this,Xw,o||null),_(this,gf,u||null),_(this,Hg,d||new gD),this.page=i,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=s,this._commentManager=l||null}hasEditableAnnotations(){return h(this,Nu).size>0}async render(e){var a,o,l;const{annotations:n}=e,r=this.div;kd(r,this.viewport);const s=new Map,i={data:null,layer:r,linkService:h(this,gf),downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new Rb,annotationStorage:h(this,Hg),enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const u of n){if(u.noHTML)continue;const d=u.annotationType===En.POPUP;if(d){const m=s.get(u.id);if(!m)continue;i.elements=m}else if(u.rect[2]===u.rect[0]||u.rect[3]===u.rect[1])continue;i.data=u;const f=o5.create(i);if(!f.isRenderable)continue;if(!d&&u.popupRef){const m=s.get(u.popupRef);m?m.push(f):s.set(u.popupRef,[f])}const p=f.render();u.hidden&&(p.style.visibility="hidden"),await j(this,Ed,D2).call(this,p,u.id,i.elements),(o=(a=f.extraPopupElement)==null?void 0:a.popup)==null||o.renderCommentButton(),f._isEditable&&(h(this,Nu).set(f.data.id,f),(l=this._annotationEditorUIManager)==null||l.renderAnnotationElement(f))}j(this,Ed,M2).call(this)}async addLinkAnnotations(e){const n={data:null,layer:this.div,linkService:h(this,gf),svgFactory:new Rb,parent:this};for(const r of e){r.borderStyle||(r.borderStyle=qg._defaultBorderStyle),n.data=r;const s=o5.create(n);if(!s.isRenderable)continue;const i=s.render();await j(this,Ed,D2).call(this,i,r.id,null)}}update({viewport:e}){const n=this.div;this.viewport=e,kd(n,{rotation:e.rotation}),j(this,Ed,M2).call(this),n.hidden=!1}getEditableAnnotations(){return Array.from(h(this,Nu).values())}getEditableAnnotation(e){return h(this,Nu).get(e)}addFakeAnnotation(e){var o;const{div:n}=this,{id:r,rotation:s}=e,i=new R_e({data:{id:r,rect:e.getPDFRect(),rotation:s},editor:e,layer:n,parent:this,enableComment:!!this._commentManager,linkService:h(this,gf),annotationStorage:h(this,Hg)}),a=i.render();return n.append(a),(o=h(this,Wg))==null||o.moveElementInDOM(n,a,a,!1),i.createOrUpdatePopup(),i}static get _defaultBorderStyle(){return Qe(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Lp.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},Wg=new WeakMap,mf=new WeakMap,Hg=new WeakMap,Nu=new WeakMap,Xw=new WeakMap,gf=new WeakMap,Ed=new WeakSet,D2=async function(e,n,r){var o,l;const s=e.firstChild||e,i=s.id=`${fD}${n}`,a=await((o=h(this,Xw))==null?void 0:o.getAriaAttributes(i));if(a)for(const[u,d]of a)s.setAttribute(u,d);r?r.at(-1).container.after(e):(this.div.append(e),(l=h(this,Wg))==null||l.moveElementInDOM(this.div,e,s,!1))},M2=function(){var n;if(!h(this,mf))return;const e=this.div;for(const[r,s]of h(this,mf)){const i=e.querySelector(`[data-annotation-id="${r}"]`);if(!i)continue;s.className="annotationContent";const{firstChild:a}=i;a?a.nodeName==="CANVAS"?a.replaceWith(s):a.classList.contains("annotationContent")?a.after(s):a.before(s):i.append(s);const o=h(this,Nu).get(r);o&&(o._hasNoCanvas?((n=this._annotationEditorUIManager)==null||n.setMissingCanvas(r,i.id,s),o._hasNoCanvas=!1):o.canvas=s)}h(this,mf).clear()},qg);const q1=/\r\n?|\n/g;var hi,Zw,yf,fi,zn,mG,gG,yG,zk,oc,Vk,Wk,xG,L2,vG;const Zt=class Zt extends Gt{constructor(n){super({...n,name:"freeTextEditor"});A(this,zn);A(this,hi,"");A(this,Zw,`${this.id}-editor`);A(this,yf,null);A(this,fi);Z(this,"_colorPicker",null);this.color=n.color||Zt._defaultColor||Gt._defaultLineColor,_(this,fi,n.fontSize||Zt._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const n=Zt.prototype,r=a=>a.isEmpty(),s=Sd.TRANSLATE_SMALL,i=Sd.TRANSLATE_BIG;return Qe(this,"_keyboardManager",new W0([[["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:[-s,0],checker:r}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],n._translateEmpty,{args:[-i,0],checker:r}],[["ArrowRight","mac+ArrowRight"],n._translateEmpty,{args:[s,0],checker:r}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],n._translateEmpty,{args:[i,0],checker:r}],[["ArrowUp","mac+ArrowUp"],n._translateEmpty,{args:[0,-s],checker:r}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],n._translateEmpty,{args:[0,-i],checker:r}],[["ArrowDown","mac+ArrowDown"],n._translateEmpty,{args:[0,s],checker:r}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],n._translateEmpty,{args:[0,i],checker:r}]]))}static initialize(n,r){Gt.initialize(n,r);const s=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(s.getPropertyValue("--freetext-padding"))}
693static updateDefaultParams(n,r){switch(n){case ot.FREETEXT_SIZE:Zt._defaultFontSize=r;break;case ot.FREETEXT_COLOR:Zt._defaultColor=r;break}}updateParams(n,r){switch(n){case ot.FREETEXT_SIZE:j(this,zn,mG).call(this,r);break;case ot.FREETEXT_COLOR:j(this,zn,gG).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[ot.FREETEXT_SIZE,Zt._defaultFontSize],[ot.FREETEXT_COLOR,Zt._defaultColor||Gt._defaultLineColor]]}get propertiesToUpdate(){return[[ot.FREETEXT_SIZE,h(this,fi)],[ot.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new y_(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ot.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[-Zt._internalPadding*n,-(Zt._internalPadding+h(this,fi))*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"),_(this,yf,new AbortController);const n=this._uiManager.combinedSignal(h(this,yf));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",h(this,Zw)),this._isDraggable=!0,(n=h(this,yf))==null||n.abort(),_(this,yf,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=h(this,hi),r=_(this,hi,j(this,zn,yG).call(this).trimEnd());if(n===r)return;const s=i=>{if(_(this,hi,i),!i){this.remove();return}j(this,zn,Wk).call(this),this._uiManager.rebuild(this),j(this,zn,zk).call(this)};this.addCommands({cmd:()=>{s(r)},undo:()=>{s(n)},mustExec:!1}),j(this,zn,zk).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){Zt._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",h(this,Zw)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:s}=this.editorDiv;if(s.fontSize=`calc(${h(this,fi)}px * var(--total-scale-factor))`,s.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[i,a]=this.parentDimensions;
693if(this.annotationElementId){const{position:o}=this._initialData;let[l,u]=this.getInitialTranslation();[l,u]=this.pageTranslationToScreen(l,u);const[d,f]=this.pageDimensions,[p,m]=this.pageTranslation;let y,g;switch(this.rotation){case 0:y=n+(o[0]-p)/d,g=r+this.height-(o[1]-m)/f;break;case 90:y=n+(o[0]-p)/d,g=r-(o[1]-m)/f,[l,u]=[u,-l];break;case 180:y=n-this.width+(o[0]-p)/d,g=r-(o[1]-m)/f,[l,u]=[-l,-u];break;case 270:y=n+(o[0]-p-this.height*f)/d,g=r+(o[1]-m-this.width*d)/f,[l,u]=[-u,l];break}this.setAt(y*i,g*a,l,u)}else this._moveAfterPaste(n,r);j(this,zn,Wk).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(n){var y,g,b;const r=n.clipboardData||window.clipboardData,{types:s}=r;if(s.length===1&&s[0]==="text/plain")return;n.preventDefault();const i=j(y=Zt,oc,L2).call(y,r.getData("text")||"").replaceAll(q1,`
694`);if(!i)return;const a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();const o=a.getRangeAt(0);if(!i.includes(`
695`)){o.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),a.collapseToStart();return}const{startContainer:l,startOffset:u}=o,d=[],f=[];if(l.nodeType===Node.TEXT_NODE){const x=l.parentElement;if(f.push(l.nodeValue.slice(u).replaceAll(q1,"")),x!==this.editorDiv){let w=d;for(const v of this.editorDiv.childNodes){if(v===x){w=f;continue}w.push(j(g=Zt,oc,Vk).call(g,v))}}d.push(l.nodeValue.slice(0,u).replaceAll(q1,""))}else if(l===this.editorDiv){let x=d,w=0;for(const v of this.editorDiv.childNodes)w++===u&&(x=f),x.push(j(b=Zt,oc,Vk).call(b,v))}_(this,hi,`${d.join(`
696`)}${i}${f.join(`
697`)}`),j(this,zn,Wk).call(this);const p=new Range;let m=Math.sumPrecise(d.map(x=>x.length));for(const{firstChild:x}of this.editorDiv.childNodes)if(x.nodeType===Node.TEXT_NODE){const w=x.nodeValue.length;if(m<=w){p.setStart(x,m),p.setEnd(x,m);break}m-=w}a.removeAllRanges(),a.addRange(p)}get contentDiv(){return this.editorDiv}getPDFRect(){const n=Zt._internalPadding*this.parentScale;return this.getRect(n,n)}static async deserialize(n,r,s){var o;let i=null;if(n instanceof dG){const{data:{defaultAppearanceData:{fontSize:l,fontColor:u},rect:d,rotation:f,id:p,popupRef:m,richText:y,contentsObj:g,creationDate:b,modificationDate:x},textContent:w,textPosition:v,parent:{page:{pageNumber:S}}}=n;if(!w||w.length===0)return null;i=n={annotationType:$e.FREETEXT,color:Array.from(u),fontSize:l,value:w.join(`
698`),position:v,pageIndex:S-1,rect:d.slice(0),rotation:f,annotationElementId:p,id:p,deleted:!1,popupRef:m,comment:(g==null?void 0:g.str)||null,richText:y,creationDate:b,modificationDate:x}}const a=await super.deserialize(n,r,s);return _(a,fi,n.fontSize),a.color=pe.makeHexColor(...n.color),_(a,hi,j(o=Zt,oc,L2).call(o,n.value)),a._initialData=i,n.comment&&a.setCommentData(n),a}serialize(n=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r=Gt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),s=Object.assign(super.serialize(n),{color:r,fontSize:h(this,fi),value:j(this,zn,xG).call(this)});return this.addComment(s),n?(s.isCopy=!0,s):this.annotationElementId&&!j(this,zn,vG).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(n){const r=super.renderAnnotationElement(n);if(!r)return null;const{style:s}=r;s.fontSize=`calc(${h(this,fi)}px * var(--total-scale-factor))`,s.color=this.color,r.replaceChildren();for(const i of h(this,hi).split(`
699`)){const a=document.createElement("div");a.append(i?document.createTextNode(i):document.createElement("br")),r.append(a)}return n.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:h(this,hi)}}),r}resetAnnotationElement(n){super.resetAnnotationElement(n),n.resetEdited()}};hi=new WeakMap,Zw=new WeakMap,yf=new WeakMap,fi=new WeakMap,zn=new WeakSet,mG=function(n){const r=i=>{this.editorDiv.style.fontSize=`calc(${i}px * var(--total-scale-factor))`,this.translate(0,-(i-h(this,fi))*this.parentScale),_(this,fi,i),j(this,zn,zk).call(this)},s=h(this,fi);this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ot.FREETEXT_S
vendor: 8,270 bytes, lines 699-701
699IZE,overwriteIfSameType:!0,keepUndo:!0})},gG=function(n){const r=i=>{this.color=i,this.onUpdatedColor()},s=this.color;this.addCommands({cmd:r.bind(this,n),undo:r.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ot.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},yG=function(){var s;const n=[];this.editorDiv.normalize();let r=null;for(const i of this.editorDiv.childNodes)(r==null?void 0:r.nodeType)===Node.TEXT_NODE&&i.nodeName==="BR"||(n.push(j(s=Zt,oc,Vk).call(s,i)),r=i);return n.join(`
700`)},zk=function(){const[n,r]=this.parentDimensions;let s;if(this.isAttachedToDOM)s=this.div.getBoundingClientRect();else{const{currentLayer:i,div:a}=this,o=a.style.display,l=a.classList.contains("hidden");a.classList.remove("hidden"),a.style.display="hidden",i.div.append(this.div),s=a.getBoundingClientRect(),a.remove(),a.style.display=o,a.classList.toggle("hidden",l)}this.rotation%180===this.parentRotation%180?(this.width=s.width/n,this.height=s.height/r):(this.width=s.height/n,this.height=s.width/r),this.fixAndSetPosition()},oc=new WeakSet,Vk=function(n){return(n.nodeType===Node.TEXT_NODE?n.nodeValue:n.innerText).replaceAll(q1,"")},Wk=function(){if(this.editorDiv.replaceChildren(),!!h(this,hi))for(const n of h(this,hi).split(`
701`)){const r=document.createElement("div");r.append(n?document.createTextNode(n):document.createElement("br")),this.editorDiv.append(r)}},xG=function(){return h(this,hi).replaceAll(" "," ")},L2=function(n){return n.replaceAll(" "," ")},vG=function(n){const{value:r,fontSize:s,color:i,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||n.value!==r||n.fontSize!==s||n.color.some((o,l)=>o!==i[l])||n.pageIndex!==a},A(Zt,oc),Z(Zt,"_freeTextDefaultContent",""),Z(Zt,"_internalPadding",0),Z(Zt,"_defaultColor",null),Z(Zt,"_defaultFontSize",10),Z(Zt,"_type","freetext"),Z(Zt,"_editorType",$e.FREETEXT);let O2=Zt;class fe{toSVGPath(){Lt("Abstract method `toSVGPath` must be implemented.")}get box(){Lt("Abstract getter `box` must be implemented.")}serialize(e,n){Lt("Abstract method `serialize` must be implemented.")}static _rescale(e,n,r,s,i,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=n+e[o]*s,a[o+1]=r+e[o+1]*i;return a}static _rescaleAndSwap(e,n,r,s,i,a){a||(a=new Float32Array(e.length));for(let o=0,l=e.length;o<l;o+=2)a[o]=n+e[o+1]*s,a[o+1]=r+e[o]*i;return a}static _translate(e,n,r,s){s||(s=new Float32Array(e.length));for(let i=0,a=e.length;i<a;i+=2)s[i]=n+e[i],s[i+1]=r+e[i+1];return s}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,n,r,s,i){switch(i){case 90:return[1-n/r,e/s];case 180:return[1-e/r,1-n/s];case 270:return[n/r,1-e/s];default:return[e/r,n/s]}}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,s,i,a){return[(e+5*r)/6,(n+5*s)/6,(5*r+i)/6,(5*s+a)/6,(r+i)/2,(s+a)/2]}}Z(fe,"PRECISION",1e-4);var pi,Ua,Gg,Kg,Fo,nt,xf,vf,Qw,Jw,Yg,Xg,Pu,e0,L_,F_,er,ov,bG,wG,kG,SG,_G,EG;const vl=class vl{constructor({x:e,y:n},r,s,i,a,o=0){A(this,er);A(this,pi);A(this,Ua,[]);A(this,Gg);A(this,Kg);A(this,Fo,[]);A(this,nt,new Float32Array(18));A(this,xf);A(this,vf);A(this,Qw);A(this,Jw);A(this,Yg);A(this,Xg);A(this,Pu,[]);_(this,pi,r),_(this,Xg,i*s),_(this,Kg,a),h(this,nt).set([NaN,NaN,NaN,NaN,e,n],6),_(this,Gg,o),_(this,Jw,h(vl,e0)*s),_(this,Qw,h(vl,F_)*s),_(this,Yg,s),h(this,Pu).push(e,n)}isEmpty(){return isNaN(h(this,nt)[8])}add({x:e,y:n}){var M;_(this,xf,e),_(this,vf,n);const[r,s,i,a]=h(this,pi);let[o,l,u,d]=h(this,nt).subarray(8,12);const f=e-u,p=n-d,m=Math.hypot(f,p);if(m<h(this,Qw))return!1;const y=m-h(this,Jw),g=y/m,b=g*f,x=g*p;let w=o,v=l;o=u,l=d,u+=b,d+=x,(M=h(this,Pu))==null||M.push(e,n);const S=-x/y,E=b/y,C=S*h(this,Xg),T=E*h(this,Xg);return h(this,nt).set(h(this,nt).subarray(2,8),0),h(this,nt).set([u+C,d+T],4),h(this,nt).set(h(this,nt).subarray(14,18),12),h(this,nt).set([u-C,d-T],16),isNaN(h(this,nt)[6])?(h(this,Fo).length===0&&(h(this,nt).set([o+C,l+T],2),h(this,Fo).push(NaN,NaN,NaN,NaN,(o+C-r)/i,(l+T-s)/a),h(this,nt).set([o-C,l-T],14),h(this,Ua).push(NaN,NaN,NaN,NaN,(o-C-r)/i,(l-T-s)/a)),h(this,nt).set([w,v,o,l,u,d],6),!this.isEmpty()):(h(this,nt).set([w,v,o,l,u,d],6),Math.abs(Math.atan2(v-l,w-o)-Math.atan2(x,b))<Math.PI/2?([o,l,u,d]=h(this,nt).subarray(2,6),h(this,Fo).push(NaN,NaN,NaN,NaN,((o+u)/2-r)/i,((l+d)/2-s)/a),[o,l,w,v]=h(this,nt).subarray(14,18),h(this,Ua).push(NaN,NaN,NaN,NaN,((w+o)/2-r)/i,((v+l)/2-s)/a),!0):([w,v,o,l,u,d]=h(this,nt).subarray(0,6),h(this,Fo).push(((w+5*o)/6-r)/i,((v+5*l)/6-s)/a,((5*o+u)/6-r)/i,((5*l+d)/6-s)/a,((o+u)/2-r)/i,((l+d)/2-s)/a),[u,d,o,l,w,v]=h(this,nt).subarray(12,18),h(this,Ua).push(((w+5*o)/6-r)/i,((v+5*l)/6-s)/a,((5*o+u)/6-r)/i,((5*l+d)/6-s)/a,((o+u)/2-r)/i,((l+d)/2-s)/a),!0))}toSVGPath(){if(this.isEmpty())return"";const e=h(this,Fo),n=h(this,Ua);if(isNaN(h(this,nt)[6])&&!this.isEmpty())return j(this,er,bG).call(this);const r=[];r.push(`M${e[4]} ${e[5]}`);for(let s=6;s<e.length;s+=6)isNaN(e[s])?r.push(`L${e[s+4]} ${e[s+5]}`):r.push(`C${e[s]} ${e[s+1]} ${e[s+2]} ${e[s+3]} ${e[s+4]} ${e[s+5]}`);j(this,er,kG).call(this,r);for(let s=n.length-6;s>=6;s-=6)isNaN(n[s])?r.push(`L${n[s+4]} ${n[s+5]}`):r.push(`C${n[s]} ${n[s+1]} ${n[s+2]} ${n[s+3]} ${n[s+4]} ${n[s+5]}`);return j(this,er,wG).call(this,r),r.join(" ")}newFreeDrawOutline(e,n,r,s,i,a){return new CG(e,n,r,s,i,a)}getOutlines(){var f;const e=h(this,Fo),n=h(this,Ua),r=h(this,nt),[s,i,a,o]=h(this,pi),l=new Float32Array((((f=h(this,Pu))==null?void 0:f.length)??0)+2);for(let p=0,m=l.length-2;p<m;p+=2)l[p]=(h(this,Pu)[p]-s)/a,l[p+1]=(h(this,Pu)[p+1]-i)/o;if(l[l.length-2]=(h(this,xf)-s)/a,l[l.length-1]=(h(this,vf)-i)/o,isNaN(r[6])&&!this.isEmpty())return j(this,er,SG).call(this,l);const u=new Float32Array(h(this,Fo).length+24+h(this,Ua).length);let d=e.length;for(let p=0;p<d;p+=2){if(isNaN(e[p])){u[p]=u[p+1]=NaN;continue}u[p]=e[p],u[p+1]=e[p+1]}d=j(this,er,EG).call(this,u,d);for(let p=n.length-6;p>=6;p-=6)for(let m=0;m<6;m+=2){if(isNaN(n[p+m])){u[d]=u[d+1]=NaN,d+=2;continue}u[d]=n[p+m],u[d+1]=n[p+m+1],d+=2}return j(this,er,_G).call(this,u,d),this.newFreeDrawOutline(u,l,h(this,pi),h(this,Yg),h(this,Gg),h(this,Kg))}};pi=new WeakMap,Ua=new WeakMap,Gg=new WeakMap,Kg=new WeakMap,Fo=new WeakMap,nt=new WeakMap,xf=new WeakMap,vf=new WeakMap,Qw=new WeakMap,Jw=new WeakMap,Yg=new WeakMap,Xg=new WeakMap,Pu=new WeakMap,e0=new WeakMap,L_=new WeakMap,F_=new WeakMap,er=new WeakSet,ov=function(){const e=h(this,nt).subarray(4,6),n=h(this,nt).subarray(16,18),[r,s,i,a]=h(this,pi);return[(h(this,xf)+(e[0]-n[0])/2-r)/i,(h(this,vf)+(e[1]-n[1])/2-s)/a,(h(this,xf)+(n[0]-e[0])/2-r)/i,(h(this,vf)+(n[1]-e[1])/2-s)/a]},bG=function(){const[e,n,r,s]=h(this,pi),[i,a,o,l]=j(this,er,ov).call(this);return`M${(h(this,nt)[2]-e)/r} ${(h(this,nt)[3]-n)/s} L${(h(this,nt)[4]-e)/r} ${(h(this,nt)[5]-n)/s} L${i} ${a} L${o} ${l} L${(h(this,nt)[16]-e)/r} ${(h(this,nt)[17]-n)/s} L${(h(this,nt)[14]-e)/r} ${(h(this,nt)[15]-n)/s} Z`},wG=function(e){const n=h(this,Ua);e.push(`L${n[4]} ${n[5]} Z`)},kG=function(e){const[n,r,s,i]=h(this,pi),a=h(this,nt).subarray(4,6),o=h(this,nt).subarray(16,18),[l,u,d,f]=j(this,er,ov).call(this);e.push(`L${(a[0]-n)/s} ${(a[1]-r)/i} L${l} ${u} L${d} ${f} L${(o[0]-n)/s} ${(o[1]-r)/i}`)},SG=function(e){const n=h(this,nt),[r,s,i,a]=h(this,pi),[o,l,u,d]=j(this,er,ov).call(this),f=new Float32Array(36);return f.set([NaN,NaN,NaN,NaN,(n[2]-r)/i,(n[3]-s)/a,NaN,NaN,NaN,NaN,(n[4]-r)/i,(n[5]-s)/a,NaN,NaN,NaN,NaN,o,l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,(n[16]-r)/i,(n[17]-s)/a,NaN,NaN,NaN,NaN,(n[14]-r)/i,(n[15]-s)/a],0),this.newFreeDrawOutline(f,e,h(this,pi),h(this,Yg),h(this,Gg),h(this,Kg))},_G=function(e,n){const r=h(this,Ua);return e.set([NaN,NaN,NaN,NaN,r[4],r[5]],n),n+=6},EG=function(e,n){const r=h(this,nt).subarray(4,6),s=h(this,nt).subarray(16,18),[i,a,o,l]=h(this,pi),[u,d,f,p]=j(this,er,ov).call(this);return e.set([NaN,NaN,NaN,NaN,(r[0]-i)/o,(r[1]-a)/l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,f,p,NaN,NaN,NaN,NaN,(s[0]-i)/o,(s[1]-a)/l],n),n+=24},A(vl,e0,8),A(vl,L_,2),A(vl,F_,h(vl,e0)+h(vl,L_));let x_=vl;var Zg,bf,Yl,t0,mi,n0,Tn,B_,AG;class CG extends fe{constructor(n,r,s,i,a,o){super();A(this,B_);A(this,Zg);A(this,bf,new Float32Array(4));
701A(this,Yl);A(this,t0);A(this,mi);A(this,n0);A(this,Tn);_(this,Tn,n),_(this,mi,r),_(this,Zg,s),_(this,n0,i),_(this,Yl,a),_(this,t0,o),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],j(this,B_,AG).call(this,o);const[l,u,d,f]=h(this,bf);for(let p=0,m=n.length;p<m;p+=2)n[p]=(n[p]-l)/d,n[p+1]=(n[p+1]-u)/f;for(let p=0,m=r.length;p<m;p+=2)r[p]=(r[p]-l)/d,r[p+1]=(r[p+1]-u)/f}toSVGPath(){const n=[`M${h(this,Tn)[4]} ${h(this,Tn)[5]}`];for(let r=6,s=h(this,Tn).length;r<s;r+=6){if(isNaN(h(this,Tn)[r])){n.push(`L${h(this,Tn)[r+4]} ${h(this,Tn)[r+5]}`);continue}n.push(`C${h(this,Tn)[r]} ${h(this,Tn)[r+1]} ${h(this,Tn)[r+2]} ${h(this,Tn)[r+3]} ${h(this,Tn)[r+4]} ${h(this,Tn)[r+5]}`)}return n.push("Z"),n.join(" ")}serialize([n,r,s,i],a){const o=s-n,l=i-r;let u,d;switch(a){case 0:u=fe._rescale(h(this,Tn),n,i,o,-l),d=fe._rescale(h(this,mi),n,i,o,-l);break;case 90:u=fe._rescaleAndSwap(h(this,Tn),n,r,o,l),d=fe._rescaleAndSwap(h(this,mi),n,r,o,l);break;case 180:u=fe._rescale(h(this,Tn),s,r,-o,l),d=fe._rescale(h(this,mi),s,r,-o,l);break;case 270:u=fe._rescaleAndSwap(h(this,Tn),s,i,-o,-l),d=fe._rescaleAndSwap(h(this,mi),s,i,-o,-l);break}return{outline:Array.from(u),points:[Array.from(d)]}}get box(){return h(this,bf)}newOutliner(n,r,s,i,a,o=0){return new x_(n,r,s,i,a,o)}getNewOutline(n,r){const[s,i,a,o]=h(this,bf),[l,u,d,f]=h(this,Zg),p=a*d,m=o*f,y=s*d+l,g=i*f+u,b=this.newOutliner({x:h(this,mi)[0]*p+y,y:h(this,mi)[1]*m+g},h(this,Zg),h(this,n0),n,h(this,t0),r??h(this,Yl));for(let x=2;x<h(this,mi).length;x+=2)b.add({x:h(this,mi)[x]*p+y,y:h(this,mi)[x+1]*m+g});return b.getOutlines()}}Zg=new WeakMap,bf=new WeakMap,Yl=new WeakMap,t0=new WeakMap,mi=new WeakMap,n0=new WeakMap,Tn=new WeakMap,B_=new WeakSet,AG=function(n){const r=h(this,Tn);let s=r[4],i=r[5];const a=[s,i,s,i];let o=s,l=i,u=s,d=i;const f=n?Math.max:Math.min,p=new Float32Array(4);for(let y=6,g=r.length;y<g;y+=6){const b=r[y+4],x=r[y+5];isNaN(r[y])?(pe.pointBoundingBox(b,x,a),l>x?(o=b,l=x):l===x&&(o=f(o,b)),d<x?(u=b,d=x):d===x&&(u=f(u,b))):(p[0]=p[1]=1/0,p[2]=p[3]=-1/0,pe.bezierBoundingBox(s,i,...r.slice(y,y+6),p),pe.rectBoundingBox(p[0],p[1],p[2],p[3],a),l>p[1]?(o=p[0],l=p[1]):l===p[1]&&(o=f(o,p[0])),d<p[3]?(u=p[2],d=p[3]):d===p[3]&&(u=f(u,p[2]))),s=b,i=x}const m=h(this,bf);m[0]=a[0]-h(this,Yl),m[1]=a[1]-h(this,Yl),m[2]=a[2]-a[0]+2*h(this,Yl),m[3]=a[3]-a[1]+2*h(this,Yl),this.firstPoint=[o,l],this.lastPoint=[u,d]};var r0,s0,i0,Ru,za,ys,TG,Hk,jG,NG,B2;class F2{constructor(e,n=0,r=0,s=!0){A(this,ys);A(this,r0);A(this,s0);A(this,i0);A(this,Ru,[]);A(this,za,[]);const i=[1/0,1/0,-1/0,-1/0],o=10**-4;for(const{x:b,y:x,width:w,height:v}of e){const S=Math.floor((b-n)/o)*o,E=Math.ceil((b+w+n)/o)*o,C=Math.floor((x-n)/o)*o,T=Math.ceil((x+v+n)/o)*o,P=[S,C,T,!0],M=[E,C,T,!1];h(this,Ru).push(P,M),pe.rectBoundingBox(S,C,E,T,i)}const l=i[2]-i[0]+2*r,u=i[3]-i[1]+2*r,d=i[0]-r,f=i[1]-r;let p=s?-1/0:1/0,m=1/0;const y=h(this,Ru).at(s?-1:-2),g=[y[0],y[2]];for(const b of h(this,Ru)){const[x,w,v,S]=b;!S&&s?w<m?(m=w,p=x):w===m&&(p=Math.max(p,x)):S&&!s&&(w<m?(m=w,p=x):w===m&&(p=Math.min(p,x))),b[0]=(x-d)/l,b[1]=(w-f)/u,b[2]=(v-f)/u}_(this,r0,new Float32Array([d,f,l,u])),_(this,s0,[p,m]),_(this,i0,g)}getOutlines(){h(this,Ru).sort((n,r)=>n[0]-r[0]||n[1]-r[1]||n[2]-r[2]);const e=[];for(const n of h(this,Ru))n[3]?(e.push(...j(this,ys,B2).call(this,n)),j(this,ys,jG).call(this,n)):(j(this,ys,NG).call(this,n),e.push(...j(this,ys,B2).call(this,n)));return j(this,ys,TG).call(this,e)}}r0=new WeakMap,s0=new WeakMap,i0=new WeakMap,Ru=new WeakMap,za=new WeakMap,ys=new WeakSet,TG=function(e){const n=[],r=new Set;for(const a of e){const[o,l,u]=a;n.push([o,l,a],[o,u,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],u=n[a+1][2];l.push(u),u.push(l),r.add(l),r.add(u)}const s=[];let i;for(;r.size>0;){const a=r.values().next().value;let[o,l,u,d,f]=a;r.delete(a);let p=o,m=l;for(i=[o,u],s.push(i);;){let y;if(r.has(d))y=d;else if(r.has(f))y=f;else break;r.delete(y),[o,l,u,d,f]=y,p!==o&&(i.push(p,m,o,m===l?l:u),p=o),m=m===l?u:l}i.push(p,m)}return new Y_e(s,h(this,r0),h(this,s0),h(this,i0))},Hk=function(e){const n=h(this,za);let r=0,s=n.length-1;for(;r<=s;){const i=r+s>>1,a=n[i][0];if(a===e)return i;a<e?r=i+1:s=i-1}return s+1},jG=function([,e,n]){const r=j(this,ys,Hk).call(this,e);h(this,za).splice(r,0,[e,n])},NG=function([,e,n]){const r=j(this,ys,Hk).call(this,e);for(let s=r;s<h(this,za).length;s++){const[i,a]=h(this,za)[s];if(i!==e)break;if(i===e&&a===n){h(this,za).splice(s,1);return}}for(let s=r-1;s>=0;s--){const[i,a]=h(this,za)[s];if(i!==e)break;if(i===e&&a===n){h(this,za).splice(s,1);return}}},B2=function(e){const[n,r,s]=e,i=[[n,r,s]],a=j(this,ys,Hk).call(this,s);for(let o=0;o<a;o++){const[l,u]=h(this,za)[o];for(let d=0,f=i.length;d<f;d++){const[,p,m]=i[d];if(!(u<=p||m<=l)){if(p>=l){if(m>u)i[d][1]=u;else{if(f===1)return[];i.splice(d,1),d--,f--}continue}i[d][2]=l,m>u&&i.push([n,u,m])}}}return i};var a0,Qg;class Y_e extends fe{constructor(n,r,s,i){super();A(this,a0);
701A(this,Qg);_(this,Qg,n),_(this,a0,r),this.firstPoint=s,this.lastPoint=i}toSVGPath(){const n=[];for(const r of h(this,Qg)){let[s,i]=r;n.push(`M${s} ${i}`);for(let a=2;a<r.length;a+=2){const o=r[a],l=r[a+1];o===s?(n.push(`V${l}`),i=l):l===i&&(n.push(`H${o}`),s=o)}n.push("Z")}return n.join(" ")}serialize([n,r,s,i],a){const o=[],l=s-n,u=i-r;for(const d of h(this,Qg)){const f=new Array(d.length);for(let p=0;p<d.length;p+=2)f[p]=n+d[p]*l,f[p+1]=i-d[p+1]*u;o.push(f)}return o}get box(){return h(this,a0)}get classNamesForOutlining(){return["highlightOutline"]}}a0=new WeakMap,Qg=new WeakMap;class $2 extends x_{newFreeDrawOutline(e,n,r,s,i,a){return new X_e(e,n,r,s,i,a)}}class X_e extends CG{newOutliner(e,n,r,s,i,a=0){return new $2(e,n,r,s,i,a)}}var Jg,o0,Xl,wf,l0,Ls,c0,u0,kf,gi,yi,wr,ey,ty,zr,ny,Ji,d0,Je,U2,qk,PG,RG,IG,z2,nh,ia,Vp,DG,Gk,Kk,MG,OG,LG,FG,BG;const yt=class yt extends Gt{constructor(n){super({...n,name:"highlightEditor"});A(this,Je);A(this,Jg,null);A(this,o0,0);A(this,Xl);A(this,wf,null);A(this,l0,null);A(this,Ls,null);A(this,c0,null);A(this,u0,0);A(this,kf,null);A(this,gi,null);A(this,yi,null);A(this,wr,!1);A(this,ey,null);A(this,ty,null);A(this,zr,null);A(this,ny,"");A(this,Ji);A(this,d0,"");this.color=n.color||yt._defaultColor,_(this,Ji,n.thickness||yt._defaultThickness),this.opacity=n.opacity||yt._defaultOpacity,_(this,Xl,n.boxes||null),_(this,d0,n.methodOfCreation||""),_(this,ny,n.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",n.highlightId>-1?(_(this,wr,!0),j(this,Je,qk).call(this,n),j(this,Je,nh).call(this)):h(this,Xl)&&(_(this,Jg,n.anchorNode),_(this,o0,n.anchorOffset),_(this,c0,n.focusNode),_(this,u0,n.focusOffset),j(this,Je,U2).call(this),j(this,Je,nh).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const n=yt.prototype;return Qe(this,"_keyboardManager",new W0([[["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:h(this,wr)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:h(this,Ji),methodOfCreation:h(this,d0)}}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 s;Gt.initialize(n,r),yt._defaultColor||(yt._defaultColor=((s=r.highlightColors)==null?void 0:s.values().next().value)||"#fff066")}static updateDefaultParams(n,r){switch(n){case ot.HIGHLIGHT_COLOR:yt._defaultColor=r;break;case ot.HIGHLIGHT_THICKNESS:yt._defaultThickness=r;break}}translateInPage(n,r){}get toolbarPosition(){return h(this,ty)}get commentButtonPosition(){return h(this,ey)}updateParams(n,r){switch(n){case ot.HIGHLIGHT_COLOR:j(this,Je,PG).call(this,r);break;case ot.HIGHLIGHT_THICKNESS:j(this,Je,RG).call(this,r);break}}static get defaultPropertiesToUpdate(){return[[ot.HIGHLIGHT_COLOR,yt._defaultColor],[ot.HIGHLIGHT_THICKNESS,yt._defaultThickness]]}get propertiesToUpdate(){return[[ot.HIGHLIGHT_COLOR,this.color||yt._defaultColor],[ot.HIGHLIGHT_THICKNESS,h(this,Ji)||yt._defaultThickness],[ot.HIGHLIGHT_FREE,h(this,wr)]]}onUpdatedColor(){var n,r;(n=this.parent)==null||n.drawLayer.updateProperties(h(this,yi),{root:{fill:this.color,"fill-opacity":this.opacity}}),(r=h(this,l0))==null||r.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",_(this,l0,new Pb({editor:this}))]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(j(this,Je,Kk).call(this))}getBaseTranslation(){return[0,0]}getRect(n,r){return super.getRect(n,r,j(this,Je,Kk).call(this))}onceAdded(n){this.annotationElementId||this.parent.addUndoableEditor(this),n&&this.div.focus()}remove(){j(this,Je,z2).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(j(this,Je,nh).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(n){var s;let r=!1;this.parent&&!n?j(this,Je,z2).call(this):n&&(j(this,Je,nh).call(this,n),r=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(n),this.show(this._isVisible),r&&this.select()}rotate(n){var i,a,o;const{drawLayer:r}=this.parent;let s;h(this,wr)?(n=(n-this.rotation+360)%360,s=j(i=yt,ia,Vp).call(i,h(this,gi).box,n)):s=j(a=yt,ia,Vp).call(a,[this.x,this.y,this.width,this.height],n),r.updateProperties(h(this,yi),{bbox:s,root:{"data-main-rotation":n}}),r.updateProperties(h(this,zr),{bbox:j(o=yt,ia,Vp).call(o,h(this,Ls).box,n),root:{"data-main-rotation":n}})}
701render(){if(this.div)return this.div;const n=super.render();h(this,ny)&&(n.setAttribute("aria-label",h(this,ny)),n.setAttribute("role","mark")),h(this,wr)?n.classList.add("free"):this.div.addEventListener("keydown",j(this,Je,DG).bind(this),{signal:this._uiManager._signal});const r=_(this,kf,document.createElement("div"));return n.append(r),r.setAttribute("aria-hidden","true"),r.className="internal",r.style.clipPath=h(this,wf),this.setDims(this.width,this.height),aq(this,h(this,kf),["pointerover","pointerleave"]),this.enableEditing(),n}pointerover(){var n;this.isSelected||(n=this.parent)==null||n.drawLayer.updateProperties(h(this,zr),{rootClass:{hovered:!0}})}pointerleave(){var n;this.isSelected||(n=this.parent)==null||n.drawLayer.updateProperties(h(this,zr),{rootClass:{hovered:!1}})}_moveCaret(n){switch(this.parent.unselect(this),n){case 0:case 2:j(this,Je,Gk).call(this,!0);break;case 1:case 3:j(this,Je,Gk).call(this,!1);break}}select(){var n;super.select(),h(this,zr)&&((n=this.parent)==null||n.drawLayer.updateProperties(h(this,zr),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var n;super.unselect(),h(this,zr)&&((n=this.parent)==null||n.drawLayer.updateProperties(h(this,zr),{rootClass:{selected:!1}}),h(this,wr)||j(this,Je,Gk).call(this,!1))}get _mustFixPosition(){return!h(this,wr)}show(n=this._isVisible){super.show(n),this.parent&&(this.parent.drawLayer.updateProperties(h(this,yi),{rootClass:{hidden:!n}}),this.parent.drawLayer.updateProperties(h(this,zr),{rootClass:{hidden:!n}}))}static startHighlighting(n,r,{target:s,x:i,y:a}){const{x:o,y:l,width:u,height:d}=s.getBoundingClientRect(),f=new AbortController,p=n.combinedSignal(f),m=y=>{f.abort(),j(this,ia,FG).call(this,n,y)};window.addEventListener("blur",m,{signal:p}),window.addEventListener("pointerup",m,{signal:p}),window.addEventListener("pointerdown",ln,{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",Ii,{signal:p}),s.addEventListener("pointermove",j(this,ia,LG).bind(this,n),{signal:p}),this._freeHighlight=new $2({x:i,y:a},[o,l,u,d],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,s){var g,b,x,w;let i=null;if(n instanceof fG){const{data:{quadPoints:v,rect:S,rotation:E,id:C,color:T,opacity:P,popupRef:M,richText:R,contentsObj:O,creationDate:L,modificationDate:U},parent:{page:{pageNumber:B}}}=n;i=n={annotationType:$e.HIGHLIGHT,color:Array.from(T),opacity:P,quadPoints:v,boxes:null,pageIndex:B-1,rect:S.slice(0),rotation:E,annotationElementId:C,id:C,deleted:!1,popupRef:M,richText:R,comment:(O==null?void 0:O.str)||null,creationDate:L,modificationDate:U}}else if(n instanceof SD){const{data:{inkLists:v,rect:S,rotation:E,id:C,color:T,borderStyle:{rawWidth:P},popupRef:M,richText:R,contentsObj:O,creationDate:L,modificationDate:U},parent:{page:{pageNumber:B}}}=n;i=n={annotationType:$e.HIGHLIGHT,color:Array.from(T),thickness:P,inkLists:v,boxes:null,pageIndex:B-1,rect:S.slice(0),rotation:E,annotationElementId:C,id:C,deleted:!1,popupRef:M,richText:R,comment:(O==null?void 0:O.str)||null,creationDate:L,modificationDate:U}}const{color:a,quadPoints:o,inkLists:l,opacity:u}=n,d=await super.deserialize(n,r,s);d.color=pe.makeHexColor(...a),d.opacity=u||1,l&&_(d,Ji,n.thickness),d._initialData=i,n.comment&&d.setCommentData(n);const[f,p]=d.pageDimensions,[m,y]=d.pageTranslation;if(o){const v=_(d,Xl,[]);for(let S=0;S<o.length;S+=8)v.push({x:(o[S]-m)/f,y:1-(o[S+1]-y)/p,width:(o[S+2]-o[S])/f,height:(o[S+1]-o[S+5])/p});j(g=d,Je,U2).call(g),j(b=d,Je,nh).call(b),d.rotate(d.rotation)}else if(l){_(d,wr,!0);const v=l[0],S={x:v[0]-m,y:p-(v[1]-y)},E=new $2(S,[0,0,f,p],1,h(d,Ji)/2,!0,.001);for(let P=0,M=v.length;P<M;P+=2)S.x=v[P]-m,S.y=p-(v[P+1]-y),E.add(S);const{id:C,clipPathId:T}=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:E.toSVGPath()}},!0,!0);j(x=d,Je,qk).call(x,{highlightOutlines:E.getOutlines(),highlightId:C,clipPathId:T}),j(w=d,Je,nh).call(w),d.rotate(d.parentRotation)}return d}serialize(n=!1){if(this.isEmpty()||n)return null;if(this.deleted)return this.serializeDeleted();const r=Gt._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),s=super.serialize(n);return Object.assign(s,{color:r,opacity:this.opacity,thickness:h(this,Ji),quadPoints:j(this,Je,MG).call(this),outlines:j(this,Je,OG).call(this,s.rect)}),this.addComment(s),this.annotationElementId&&!j(this,Je,BG).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(n){return this.deleted?(n.hide(),null):(n.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}};Jg=new WeakMap,o0=new WeakMap,Xl=new WeakMap,wf=new WeakMap,l0=new WeakMap,Ls=new WeakMap,c0=new WeakMap,u0=new WeakMap,kf=new WeakMap,gi=new WeakMap,yi=new WeakMap,wr=new WeakMap,ey=new WeakMap,ty=new WeakMap,zr=new WeakMap,ny=new WeakMap,Ji=new WeakMap,d0=new WeakMap,Je=new WeakSet,U2=function(){const n=new F2(h(this,Xl),.001);_(this,gi,n.getOutlines()),[this.x,this.y,this.width,this.height]=h(this,gi).box;const r=new F2(h(this,Xl),.0025,.001,this._uiManager.direction==="ltr");_(this,Ls,r.getOutlines());const{firstPoint:s}=h(this,gi);_(this,ey,[(s[0]-this.x)/this.width,(s[1]-this.y)/this.height]);const{lastPoint:i}=h(this,Ls);_(this,ty,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])},qk=function({highlightOutlines:n,highlightId:r,clipPathId:s}){var p,m;if(_(this,gi,n),_(this,Ls,n.getNewOutline(h(this,Ji)/2+1.5,.0025)),r>=0)_(this,yi,r),_(this,wf,s),this.parent.drawLayer.finalizeDraw(r,{bbox:n.box,path:{d:n.toSVGPath()}}),_(this,zr,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:h(this,Ls).box,path:{d:h(this,Ls).toSVGPath()}},!0));else if(this.parent){const y=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(h(this,yi),{bbox:j(p=yt,ia,Vp).call(p,h(this,gi).box,(y-this.rotation+360)%360),path:{d:n.toSVGPath()}}),this.parent.drawLayer.updateProperties(h(this,zr),{bbox:j(m=yt,ia,Vp).call(m,h(this,Ls).box,y),path:{d:h(this,Ls).toSVGPath()}})}const[a,o,l,u]=n.box;switch(this.rotation){case 0:this.x=a,this.y=o,this.width=l,this.height=u;break;case 90:{const[y,g]=this.parentDimensions;this.x=o,this.y=1-a,this.width=l*g/y,this.height=u*y/g;break}case 180:this.x=1-a,this.y=1-o,this.width=l,this.height=u;break;case 270:{const[y,g]=this.parentDimensions;this.x=1-o,this.y=a,this.width=l*g/y,this.height=u*y/g;break}}const{firstPoint:d}=n;_(this,ey,[(d[0]-a)/l,(d[1]-o)/u]);const{lastPoint:f}=h(this,Ls);_(this,ty,[(f[0]-a)/l,(f[1]-o)/u])},PG=function(n){const r=(a,o)=>{this.color=a,this.opacity=o,this.onUpdatedColor()},s=this.color,i=this.opacity;this.addCommands({cmd:r.bind(this,n,yt._defaultOpacity),undo:r.bind(this,s,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ot.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(n)},!0)},RG=function(n){const r=h(this,Ji),s=i=>{_(this,Ji,i),j(this,Je,IG).call(this,i)};this.addCommands({cmd:s.bind(this,n),undo:s.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:ot.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:n},!0)},IG=function(n){h(this,wr)&&(j(this,Je,qk).call(this,{highlightOutlines:h(this,gi).getNewOutline(n/2)}),this.fixAndSetPosition(),this.setDims(this.width,this.height))},z2=function(){h(this,yi)===null||!this.parent||(this.parent.drawLayer.remove(h(this,yi)),_(this,yi,null),this.parent.drawLayer.remove(h(this,zr)),_(this,zr,null))},nh=function(n=this.parent){h(this,yi)===null&&({id:pn(this,yi)._,clipPathId:pn(this,wf)._}=n.drawLayer.draw({bbox:h(this,gi).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:h(this,wr)},path:{d:h(this,gi).toSVGPath()}},!1,!0),_(this,zr,n.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:h(this,wr)},bbox:h(this,Ls).box,path:{d:h(this,Ls).toSVGPath()}},h(this,wr))),h(this,kf)&&(h(this,kf).style.clipPath=h(this,wf)))},ia=new WeakSet,Vp=function([n,r,s,i],a){switch(a){case 90:return[1-r-i,n,i,s];case 180:return[1-n-s,1-r-i,s,i];case 270:return[r,1-n-s,i,s]}return[n,r,s,i]},DG=function(n){yt._keyboardManager.exec(this,n)}
701,Gk=function(n){if(!h(this,Jg))return;const r=window.getSelection();n?r.setPosition(h(this,Jg),h(this,o0)):r.setPosition(h(this,c0),h(this,u0))},Kk=function(){return h(this,wr)?this.rotation:0},MG=function(){if(h(this,wr))return null;const[n,r]=this.pageDimensions,[s,i]=this.pageTranslation,a=h(this,Xl),o=new Float32Array(a.length*8);let l=0;for(const{x:u,y:d,width:f,height:p}of a){const m=u*n+s,y=(1-d)*r+i;o[l]=o[l+4]=m,o[l+1]=o[l+3]=y,o[l+2]=o[l+6]=m+f*n,o[l+5]=o[l+7]=y-p*r,l+=8}return o},OG=function(n){return h(this,gi).serialize(n,j(this,Je,Kk).call(this))},LG=function(n,r){this._freeHighlight.add(r)&&n.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},FG=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=""},BG=function(n){const{color:r}=this._initialData;return this.hasEditedComment||n.color.some((s,i)=>s!==r[i])},A(yt,ia),Z(yt,"_defaultColor",null),Z(yt,"_defaultOpacity",1),Z(yt,"_defaultThickness",12),Z(yt,"_type","highlight"),Z(yt,"_editorType",$e.HIGHLIGHT),Z(yt,"_freeHighlightId",-1),Z(yt,"_freeHighlight",null),Z(yt,"_freeHighlightClipId","");let v_=yt;var Sf;class $G{constructor(){A(this,Sf,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){h(this,Sf)[e]=n}toSVGProperties(){const e=h(this,Sf);return _(this,Sf,Object.create(null)),{root:e}}reset(){_(this,Sf,Object.create(null))}updateAll(e=this){this.updateProperties(e)}clone(){Lt("Not implemented")}}Sf=new WeakMap;var xi,ry,ir,_f,Ef,Iu,Du,Mu,Cf,dt,V2,W2,H2,lv,UG,Yk,cv,Wp;const ge=class ge extends Gt{constructor(n){super(n);A(this,dt);A(this,xi,null);A(this,ry);Z(this,"_colorPicker",null);Z(this,"_drawId",null);_(this,ry,n.mustBeCommitted||!1),this._addOutlines(n)}onUpdatedColor(){var n;(n=this._colorPicker)==null||n.update(this.color),super.onUpdatedColor()}_addOutlines(n){n.drawOutlines&&(j(this,dt,V2).call(this,n),j(this,dt,lv).call(this))}static _mergeSVGProperties(n,r){const s=new Set(Object.keys(n));for(const[i,a]of Object.entries(r))s.has(i)?Object.assign(n[i],a):n[i]=a;return n}static getDefaultDrawingOptions(n){Lt("Not implemented")}static get typesMap(){Lt("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(n,r){const s=this.typesMap.get(n);s&&this._defaultDrawingOptions.updateProperty(s,r),this._currentParent&&(h(ge,ir).updateProperty(s,r),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(n,r){const s=this.constructor.typesMap.get(n);s&&this._updateProperty(n,s,r)}static get defaultPropertiesToUpdate(){const n=[],r=this._defaultDrawingOptions;for(const[s,i]of this.typesMap)n.push([s,r[i]]);return n}get propertiesToUpdate(){const n=[],{_drawingOptions:r}=this;for(const[s,i]of this.constructor.typesMap)n.push([s,r[i]]);return n}_updateProperty(n,r,s){const i=this._drawingOptions,a=i[r],o=l=>{var d;i.updateProperty(r,l);const u=h(this,xi).updateProperty(r,l);u&&j(this,dt,cv).call(this,u),(d=this.parent)==null||d.drawLayer.updateProperties(this._drawId,i.toSVGProperties()),n===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:o.bind(this,s),undo:o.bind(this,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,ge._mergeSVGProperties(h(this,xi).getPathResizingSVGProperties(j(this,dt,Yk).call(this)),{bbox:j(this,dt,Wp).call(this)}))}_onResized(){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,ge._mergeSVGProperties(h(this,xi).getPathResizedSVGProperties(j(this,dt,Yk).call(this)),{bbox:j(this,dt,Wp).call(this)}))}_onTranslating(n,r){var s;(s=this.parent)==null||s.drawLayer.updateProperties(this._drawId,{bbox:j(this,dt,Wp).call(this)})}_onTranslated(){var n;(n=this.parent)==null||n.drawLayer.updateProperties(this._drawId,ge._mergeSVGProperties(h(this,xi).getPathTranslatedSVGProperties(j(this,dt,Yk).call(this),this.parentDimensions),{bbox:j(this,dt,Wp).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,h(this,ry)&&(_(this,ry,!1),this.commit(),this.parent.setSelected(this),n&&this.isOnScreen&&this.div.focus())}remove(){j(this,dt,H2).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(j(this,dt,lv).call(this),j(this,dt,cv).call(this,h(this,xi).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(n){var s;let r=!1;this.parent&&!n?(this._uiManager.removeShouldRescale(this),j(this,dt,H2).call(this)):n&&(this._uiManager.addShouldRescale(this),j(this,dt,lv).call(this,n),r=!this.parent&&((s=this.div)==null?void 0:s.classList.contains("selectedEditor"))),super.setParent(n),r&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,ge._mergeSVGProperties({bbox:j(this,dt,Wp).call(this)},h(this,xi).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&j(this,dt,cv).call(this,h(this,xi).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}
701render(){if(this.div)return this.div;let n,r;this._isCopy&&(n=this.x,r=this.y);const s=super.render();s.classList.add("draw");const i=document.createElement("div");return s.append(i),i.setAttribute("aria-hidden","true"),i.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(n,r),s}static createDrawerInstance(n,r,s,i,a){Lt("Not implemented")}static startDrawing(n,r,s,i){var b;const{target:a,offsetX:o,offsetY:l,pointerId:u,pointerType:d}=i;if(h(ge,Du)&&h(ge,Du)!==d)return;const{viewport:{rotation:f}}=n,{width:p,height:m}=a.getBoundingClientRect(),y=_(ge,_f,new AbortController),g=n.combinedSignal(y);if(h(ge,Iu)||_(ge,Iu,u),h(ge,Du)??_(ge,Du,d),window.addEventListener("pointerup",x=>{var w;h(ge,Iu)===x.pointerId?this._endDraw(x):(w=h(ge,Mu))==null||w.delete(x.pointerId)},{signal:g}),window.addEventListener("pointercancel",x=>{var w;h(ge,Iu)===x.pointerId?this._currentParent.endDrawingSession():(w=h(ge,Mu))==null||w.delete(x.pointerId)},{signal:g}),window.addEventListener("pointerdown",x=>{h(ge,Du)===x.pointerType&&((h(ge,Mu)||_(ge,Mu,new Set)).add(x.pointerId),h(ge,ir).isCancellable()&&(h(ge,ir).removeLastElement(),h(ge,ir).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener("contextmenu",Ii,{signal:g}),a.addEventListener("pointermove",this._drawMove.bind(this),{signal:g}),a.addEventListener("touchmove",x=>{x.timeStamp===h(ge,Cf)&&ln(x)},{signal:g}),n.toggleDrawing(),(b=r._editorUndoBar)==null||b.hide(),h(ge,ir)){n.drawLayer.updateProperties(this._currentDrawId,h(ge,ir).startNew(o,l,p,m,f));return}r.updateUIForDefaultProperties(this),_(ge,ir,this.createDrawerInstance(o,l,p,m,f)),_(ge,Ef,this.getDefaultDrawingOptions()),this._currentParent=n,{id:this._currentDrawId}=n.drawLayer.draw(this._mergeSVGProperties(h(ge,Ef).toSVGProperties(),h(ge,ir).defaultSVGProperties),!0,!1)}static _drawMove(n){var a;if(_(ge,Cf,-1),!h(ge,ir))return;const{offsetX:r,offsetY:s,pointerId:i}=n;if(h(ge,Iu)===i){if(((a=h(ge,Mu))==null?void 0:a.size)>=1){this._endDraw(n);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,h(ge,ir).add(r,s)),_(ge,Cf,n.timeStamp),ln(n)}}static _cleanup(n){n&&(this._currentDrawId=-1,this._currentParent=null,_(ge,ir,null),_(ge,Ef,null),_(ge,Du,null),_(ge,Cf,NaN)),h(ge,_f)&&(h(ge,_f).abort(),_(ge,_f,null),_(ge,Iu,NaN),_(ge,Mu,null))}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,h(ge,ir).end(n.offsetX,n.offsetY)),this.supportMultipleDrawings){const s=h(ge,ir),i=this._currentDrawId,a=s.getLastElement();r.addCommands({cmd:()=>{r.drawLayer.updateProperties(i,s.setLastElement(a))},undo:()=>{r.drawLayer.updateProperties(i,s.removeLastElement())},mustExec:!1,type:ot.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(n){const r=this._currentParent;if(!r)return null;if(r.toggleDrawing(!0),r.cleanUndoStack(ot.DRAW_STEP),!h(ge,ir).isEmpty()){const{pageDimensions:[s,i],scale:a}=r,o=r.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:h(ge,ir).getOutlines(s*a,i*a,a,this._INNER_MARGIN),drawingOptions:h(ge,Ef),mustBeCommitted:!n});return this._cleanup(!0),o}return r.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(n){}static deserializeDraw(n,r,s,i,a,o){Lt("Not implemented")}static async deserialize(n,r,s){var f,p;const{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:l}}=r.viewport,u=this.deserializeDraw(o,l,i,a,this._INNER_MARGIN,n),d=await super.deserialize(n,r,s);return d.createDrawingOptions(n),j(f=d,dt,V2).call(f,{drawOutlines:u}),j(p=d,dt,lv).call(p),d.onScaleChanging(),d.rotate(),d}serializeDraw(n){const[r,s]=this.pageTranslation,[i,a]=this.pageDimensions;return h(this,xi).serialize([r,s,i,a],n)}renderAnnotationElement(n){return n.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};xi=new WeakMap,ry=new WeakMap,ir=new WeakMap,_f=new WeakMap,Ef=new WeakMap,Iu=new WeakMap,Du=new WeakMap,Mu=new WeakMap,Cf=new WeakMap,dt=new WeakSet,V2=function({drawOutlines:n,drawId:r,drawingOptions:s}){_(this,xi,n),this._drawingOptions||(this._drawingOptions=s),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=j(this,dt,W2).call(this,n,this.parent),j(this,dt,cv).call(this,n.box)},W2=function(n,r){const{id:s}=r.drawLayer.draw(ge._mergeSVGProperties(this._drawingOptions.toSVGProperties(),n.defaultSVGProperties),!1,!1);return s},H2=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},lv=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=j(this,dt,W2).call(this,h(this,xi),n)}},UG=function([n,r,s,i]){const{parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[r,1-n,s*(o/a),i*(a/o)];case 180:return[1-n,1-r,s,i];case 270:return[1-r,n,s*(o/a),i*(a/o)];default:return[n,r,s,i]}},Yk=function(){const{x:n,y:r,width:s,height:i,parentDimensions:[a,o],rotation:l}=this;switch(l){case 90:return[1-r,n,s*(a/o),i*(o/a)];case 180:return[1-n,1-r,s,i];case 270:return[r,1-n,s*(a/o),i*(o/a)];default:return[n,r,s,i]}},cv=function(n){[this.x,this.y,this.width,this.height]=j(this,dt,UG).call(this,n),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},Wp=function(){const{x:n,y:r,width:s,height:i,rotation:a,parentRotation:o,parentDimensions:[l,u]}=this;switch((a*4+o)/90){case 1:return[1-r-i,n,i,s];case 2:return[1-n-s,1-r-i,s,i];case 3:return[r,1-n-s,i,s];case 4:return[n,r-s*(l/u),i*(u/l),s*(l/u)];case 5:return[1-r,n,s*(l/u),i*(u/l)];case 6:return[1-n-i*(u/l),1-r,i*(u/l),s*(l/u)];case 7:return[r-s*(l/u),1-n-i*(u/l),s*(l/u),i*(u/l)];case 8:return[n-s,r-i,s,i];case 9:return[1-r,n-s,i,s];case 10:return[1-n,1-r,s,i];case 11:return[r-i,1-n,i,s];case 12:return[n-i*(u/l),r,i*(u/l),s*(l/u)];case 13:return[1-r-s*(l/u),n-i*(u/l),s*(l/u),i*(u/l)];case 14:return[1-n,1-r-s*(l/u),i*(u/l),s*(l/u)];case 15:return[r,1-n,s*(l/u),i*(u/l)];default:return[n,r,s,i]}},Z(ge,"_currentDrawId",-1),Z(ge,"_currentParent",null),A(ge,ir,null),A(ge,_f,null),A(ge,Ef,null),A(ge,Iu,NaN),A(ge,Du,null),A(ge,Mu,null),A(ge,Cf,NaN),Z(ge,"_INNER_MARGIN",3);let b_=ge;var Bo,ar,or,Af,sy,is,kr,ea,Tf,jf,Nf,iy,Xk;class Z_e{constructor(e,n,r,s,i,a){A(this,iy);
701A(this,Bo,new Float64Array(6));A(this,ar);A(this,or);A(this,Af);A(this,sy);A(this,is);A(this,kr,"");A(this,ea,0);A(this,Tf,new q0);A(this,jf);A(this,Nf);_(this,jf,r),_(this,Nf,s),_(this,Af,i),_(this,sy,a),[e,n]=j(this,iy,Xk).call(this,e,n);const o=_(this,ar,[NaN,NaN,NaN,NaN,e,n]);_(this,is,[e,n]),_(this,or,[{line:o,points:h(this,is)}]),h(this,Bo).set(o,0)}updateProperty(e,n){e==="stroke-width"&&_(this,sy,n)}isEmpty(){return!h(this,or)||h(this,or).length===0}isCancellable(){return h(this,is).length<=10}add(e,n){[e,n]=j(this,iy,Xk).call(this,e,n);const[r,s,i,a]=h(this,Bo).subarray(2,6),o=e-i,l=n-a;return Math.hypot(h(this,jf)*o,h(this,Nf)*l)<=2?null:(h(this,is).push(e,n),isNaN(r)?(h(this,Bo).set([i,a,e,n],2),h(this,ar).push(NaN,NaN,NaN,NaN,e,n),{path:{d:this.toSVGPath()}}):(isNaN(h(this,Bo)[0])&&h(this,ar).splice(6,6),h(this,Bo).set([r,s,i,a,e,n],0),h(this,ar).push(...fe.createBezierPoints(r,s,i,a,e,n)),{path:{d:this.toSVGPath()}}))}end(e,n){const r=this.add(e,n);return r||(h(this,is).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,n,r,s,i){_(this,jf,r),_(this,Nf,s),_(this,Af,i),[e,n]=j(this,iy,Xk).call(this,e,n);const a=_(this,ar,[NaN,NaN,NaN,NaN,e,n]);_(this,is,[e,n]);const o=h(this,or).at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),h(this,or).push({line:a,points:h(this,is)}),h(this,Bo).set(a,0),_(this,ea,0),this.toSVGPath(),null}getLastElement(){return h(this,or).at(-1)}setLastElement(e){return h(this,or)?(h(this,or).push(e),_(this,ar,e.line),_(this,is,e.points),_(this,ea,0),{path:{d:this.toSVGPath()}}):h(this,Tf).setLastElement(e)}removeLastElement(){if(!h(this,or))return h(this,Tf).removeLastElement();h(this,or).pop(),_(this,kr,"");for(let e=0,n=h(this,or).length;e<n;e++){const{line:r,points:s}=h(this,or)[e];
701_(this,ar,r),_(this,is,s),_(this,ea,0),this.toSVGPath()}return{path:{d:h(this,kr)}}}toSVGPath(){const e=fe.svgRound(h(this,ar)[4]),n=fe.svgRound(h(this,ar)[5]);if(h(this,is).length===2)return _(this,kr,`${h(this,kr)} M ${e} ${n} Z`),h(this,kr);if(h(this,is).length<=6){const s=h(this,kr).lastIndexOf("M");_(this,kr,`${h(this,kr).slice(0,s)} M ${e} ${n}`),_(this,ea,6)}if(h(this,is).length===4){const s=fe.svgRound(h(this,ar)[10]),i=fe.svgRound(h(this,ar)[11]);return _(this,kr,`${h(this,kr)} L ${s} ${i}`),_(this,ea,12),h(this,kr)}const r=[];h(this,ea)===0&&(r.push(`M ${e} ${n}`),_(this,ea,6));for(let s=h(this,ea),i=h(this,ar).length;s<i;s+=6){const[a,o,l,u,d,f]=h(this,ar).slice(s,s+6).map(fe.svgRound);r.push(`C${a} ${o} ${l} ${u} ${d} ${f}`)}return _(this,kr,h(this,kr)+r.join(" ")),_(this,ea,h(this,ar).length),h(this,kr)}getOutlines(e,n,r,s){const i=h(this,or).at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),h(this,Tf).build(h(this,or),e,n,r,h(this,Af),h(this,sy),s),_(this,Bo,null),_(this,ar,null),_(this,or,null),_(this,kr,null),h(this,Tf)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}Bo=new WeakMap,ar=new WeakMap,or=new WeakMap,Af=new WeakMap,sy=new WeakMap,is=new WeakMap,kr=new WeakMap,ea=new WeakMap,Tf=new WeakMap,jf=new WeakMap,Nf=new WeakMap,iy=new WeakSet,Xk=function(e,n){return fe._normalizePoint(e,n,h(this,jf),h(this,Nf),h(this,Af))};var as,h0,f0,vi,$o,Uo,ay,oy,Pf,Cr,ml,zG,VG,WG;class q0 extends fe{constructor(){super(...arguments);A(this,Cr);A(this,as);A(this,h0,0);A(this,f0);A(this,vi);A(this,$o);A(this,Uo);A(this,ay);A(this,oy);A(this,Pf)}build(n,r,s,i,a,o,l){_(this,$o,r),_(this,Uo,s),_(this,ay,i),_(this,oy,a),_(this,Pf,o),_(this,f0,l??0),_(this,vi,n),j(this,Cr,VG).call(this)}get thickness(){return h(this,Pf)}setLastElement(n){return h(this,vi).push(n),{path:{d:this.toSVGPath()}}}removeLastElement(){return h(this,vi).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const n=[];for(const{line:r}of h(this,vi)){if(n.push(`M${fe.svgRound(r[4])} ${fe.svgRound(r[5])}`),r.length===6){n.push("Z");continue}if(r.length===12&&isNaN(r[6])){n.push(`L${fe.svgRound(r[10])} ${fe.svgRound(r[11])}`);continue}for(let s=6,i=r.length;s<i;s+=6){const[a,o,l,u,d,f]=r.subarray(s,s+6).map(fe.svgRound);n.push(`C${a} ${o} ${l} ${u} ${d} ${f}`)}}return n.join("")}serialize([n,r,s,i],a){const o=[],l=[],[u,d,f,p]=j(this,Cr,zG).call(this);let m,y,g,b,x,w,v,S,E;switch(h(this,oy)){case 0:E=fe._rescale,m=n,y=r+i,g=s,b=-i,x=n+u*s,w=r+(1-d-p)*i,v=n+(u+f)*s,S=r+(1-d)*i;break;case 90:E=fe._rescaleAndSwap,m=n,y=r,g=s,b=i,x=n+d*s,w=r+u*i,v=n+(d+p)*s,S=r+(u+f)*i;break;case 180:E=fe._rescale,m=n+s,y=r,g=-s,b=i,x=n+(1-u-f)*s,w=r+d*i,v=n+(1-u)*s,S=r+(d+p)*i;break;case 270:E=fe._rescaleAndSwap,m=n+s,y=r+i,g=-s,b=-i,x=n+(1-d-p)*s,w=r+(1-u-f)*i,v=n+(1-d)*s,S=r+(1-u)*i;break}for(const{line:C,points:T}of h(this,vi))o.push(E(C,m,y,g,b,a?new Array(C.length):null)),l.push(E(T,m,y,g,b,a?new Array(T.length):null));return{lines:o,points:l,rect:[x,w,v,S]}}static deserialize(n,r,s,i,a,{paths:{lines:o,points:l},rotation:u,thickness:d}){const f=[];let p,m,y,g,b;switch(u){case 0:b=fe._rescale,p=-n/s,m=r/i+1,y=1/s,g=-1/i;break;case 90:b=fe._rescaleAndSwap,p=-r/i,m=-n/s,y=1/i,g=1/s;break;case 180:b=fe._rescale,p=n/s+1,m=-r/i,y=-1/s,g=1/i;break;case 270:b=fe._rescaleAndSwap,p=r/i+1,m=n/s+1,y=-1/i,g=-1/s;break}if(!o){o=[];for(const w of l){const v=w.length;if(v===2){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1]]));continue}if(v===4){o.push(new Float32Array([NaN,NaN,NaN,NaN,w[0],w[1],NaN,NaN,NaN,NaN,w[2],w[3]]));continue}const S=new Float32Array(3*(v-2));o.push(S);let[E,C,T,P]=w.subarray(0,4);S.set([NaN,NaN,NaN,NaN,E,C],0);for(let M=4;M<v;M+=2){const R=w[M],O=w[M+1];S.set(fe.createBezierPoints(E,C,T,P,R,O),(M-2)*3),[E,C,T,P]=[T,P,R,O]}}}for(let w=0,v=o.length;w<v;w++)f.push({line:b(o[w].map(S=>S??NaN),p,m,y,g),points:b(l[w].map(S=>S??NaN),p,m,y,g)});const x=new this.prototype.constructor;return x.build(f,s,i,1,u,d,a),x}get box(){return h(this,as)}updateProperty(n,r){return n==="stroke-width"?j(this,Cr,WG).call(this,r):null}updateParentDimensions([n,r],s){const[i,a]=j(this,Cr,ml).call(this);_(this,$o,n),_(this,Uo,r),_(this,ay,s);const[o,l]=j(this,Cr,ml).call(this),u=o-i,d=l-a,f=h(this,as);return f[0]-=u,f[1]-=d,f[2]+=2*u,f[3]+=2*d,f}updateRotation(n){return _(this,h0,n),{path:{transform:this.rotationTransform}}}get viewBox(){return h(this,as).map(fe.svgRound).join(" ")}get defaultProperties(){const[n,r]=h(this,as);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${fe.svgRound(n)} ${fe.svgRound(r)}`}}}get rotationTransform(){const[,,n,r]=h(this,as);let s=0,i=0,a=0,o=0,l=0,u=0;switch(h(this,h0)){case 90:i=r/n,a=-n/r,l=n;break;case 180:s=-1,o=-1,l=n,u=r;break;case 270:i=-r/n,a=n/r,u=r;break;default:return""}return`matrix(${s} ${i} ${a} ${o} ${fe.svgRound(l)} ${fe.svgRound(u)})`}getPathResizingSVGProperties([n,r,s,i]){const[a,o]=j(this,Cr,ml).call(this),[l,u,d,f]=h(this,as);
701if(Math.abs(d-a)<=fe.PRECISION||Math.abs(f-o)<=fe.PRECISION){const b=n+s/2-(l+d/2),x=r+i/2-(u+f/2);return{path:{"transform-origin":`${fe.svgRound(n)} ${fe.svgRound(r)}`,transform:`${this.rotationTransform} translate(${b} ${x})`}}}const p=(s-2*a)/(d-2*a),m=(i-2*o)/(f-2*o),y=d/s,g=f/i;return{path:{"transform-origin":`${fe.svgRound(l)} ${fe.svgRound(u)}`,transform:`${this.rotationTransform} scale(${y} ${g}) translate(${fe.svgRound(a)} ${fe.svgRound(o)}) scale(${p} ${m}) translate(${fe.svgRound(-a)} ${fe.svgRound(-o)})`}}}getPathResizedSVGProperties([n,r,s,i]){const[a,o]=j(this,Cr,ml).call(this),l=h(this,as),[u,d,f,p]=l;if(l[0]=n,l[1]=r,l[2]=s,l[3]=i,Math.abs(f-a)<=fe.PRECISION||Math.abs(p-o)<=fe.PRECISION){const x=n+s/2-(u+f/2),w=r+i/2-(d+p/2);for(const{line:v,points:S}of h(this,vi))fe._translate(v,x,w,v),fe._translate(S,x,w,S);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${fe.svgRound(n)} ${fe.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const m=(s-2*a)/(f-2*a),y=(i-2*o)/(p-2*o),g=-m*(u+a)+n+a,b=-y*(d+o)+r+o;if(m!==1||y!==1||g!==0||b!==0)for(const{line:x,points:w}of h(this,vi))fe._rescale(x,g,b,m,y,x),fe._rescale(w,g,b,m,y,w);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${fe.svgRound(n)} ${fe.svgRound(r)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([n,r],s){const[i,a]=s,o=h(this,as),l=n-o[0],u=r-o[1];if(h(this,$o)===i&&h(this,Uo)===a)for(const{line:d,points:f}of h(this,vi))fe._translate(d,l,u,d),fe._translate(f,l,u,f);else{const d=h(this,$o)/i,f=h(this,Uo)/a;_(this,$o,i),_(this,Uo,a);for(const{line:p,points:m}of h(this,vi))fe._rescale(p,l,u,d,f,p),fe._rescale(m,l,u,d,f,m);o[2]*=d,o[3]*=f}return o[0]=n,o[1]=r,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${fe.svgRound(n)} ${fe.svgRound(r)}`}}}get defaultSVGProperties(){const n=h(this,as);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${fe.svgRound(n[0])} ${fe.svgRound(n[1])}`,transform:this.rotationTransform||null},bbox:n}}}as=new WeakMap,h0=new WeakMap,f0=new WeakMap,vi=new WeakMap,$o=new WeakMap,Uo=new WeakMap,ay=new WeakMap,oy=new WeakMap,Pf=new WeakMap,Cr=new WeakSet,ml=function(n=h(this,Pf)){const r=h(this,f0)+n/2*h(this,ay);return h(this,oy)%180===0?[r/h(this,$o),r/h(this,Uo)]:[r/h(this,Uo),r/h(this,$o)]},zG=function(){const[n,r,s,i]=h(this,as),[a,o]=j(this,Cr,ml).call(this,0);return[n+a,r+o,s-2*a,i-2*o]},VG=function(){const n=_(this,as,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:i}of h(this,vi)){if(i.length<=12){for(let l=4,u=i.length;l<u;l+=6)pe.pointBoundingBox(i[l],i[l+1],n);continue}let a=i[4],o=i[5];for(let l=6,u=i.length;l<u;l+=6){const[d,f,p,m,y,g]=i.subarray(l,l+6);pe.bezierBoundingBox(a,o,d,f,p,m,y,g,n),a=y,o=g}}const[r,s]=j(this,Cr,ml).call(this);n[0]=Wr(n[0]-r,0,1),n[1]=Wr(n[1]-s,0,1),n[2]=Wr(n[2]+r,0,1),n[3]=Wr(n[3]+s,0,1),n[2]-=n[0],n[3]-=n[1]},WG=function(n){const[r,s]=j(this,Cr,ml).call(this);_(this,Pf,n);const[i,a]=j(this,Cr,ml).call(this),[o,l]=[i-r,a-s],u=h(this,as);return u[0]-=o,u[1]-=l,u[2]+=2*o,u[3]+=2*l,u};class QE extends $G{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:Gt._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 QE(this._viewParameters);return e.updateAll(this),e}}var $_,HG;const fm=class fm extends b_{constructor(n){super({...n,name:"inkEditor"});A(this,$_);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(n,r){Gt.initialize(n,r),this._defaultDrawingOptions=new QE(r.viewParameters)}static getDefaultDrawingOptions(n){const r=this._defaultDrawingOptions.clone();return r.updateProperties(n),r}static get supportMultipleDrawings(){return!0}static get typesMap(){return Qe(this,"typesMap",new Map([[ot.INK_THICKNESS,"stroke-width"],[ot.INK_COLOR,"stroke"],[ot.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(n,r,s,i,a){return new Z_e(n,r,s,i,a,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(n,r,s,i,a,o){return q0.deserialize(n,r,s,i,a,o)}static async deserialize(n,r,s){let i=null;if(n instanceof SD){const{data:{inkLists:o,rect:l,rotation:u,id:d,color:f,opacity:p,borderStyle:{rawWidth:m},popupRef:y,richText:g,contentsObj:b,creationDate:x,modificationDate:w},parent:{page:{pageNumber:v}}}=n;i=n={annotationType:$e.INK,color:Array.from(f),thickness:m,opacity:p,paths:{points:o},boxes:null,pageIndex:v-1,rect:l.slice(0),rotation:u,annotationElementId:d,id:d,deleted:!1,popupRef:y,richText:g,comment:(b==null?void 0:b.str)||null,creationDate:x,modificationDate:w}}const a=await super.deserialize(n,r,s);return a._initialData=i,n.comment&&a.setCommentData(n),a}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new y_(this)),[["colorPicker",this._colorPicker]]}get colorType(){return ot.INK_COLOR}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:s}=this;r.updateSVGProperty("stroke-width"),s.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:s}){this._drawingOptions=fm.getDefaultDrawingOptions({stroke:pe.makeHexColor(...n),"stroke-width":r,"stroke-opacity":s})}serialize(n=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:r,points:s}=this.serializeDraw(n),{_drawingOptions:{stroke:i,"stroke-opacity":a,"stroke-width":o}}
701=this,l=Object.assign(super.serialize(n),{color:Gt._colorManager.convert(i),opacity:a,thickness:o,paths:{lines:r,points:s}});return this.addComment(l),n?(l.isCopy=!0,l):this.annotationElementId&&!j(this,$_,HG).call(this,l)?null:(l.id=this.annotationElementId,l)}renderAnnotationElement(n){if(this.deleted)return n.hide(),null;const{points:r,rect:s}=this.serializeDraw(!1);return n.updateEdited({rect:s,thickness:this._drawingOptions["stroke-width"],points:r,popup:this.comment}),null}};$_=new WeakSet,HG=function(n){const{color:r,thickness:s,opacity:i,pageIndex:a}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||n.color.some((o,l)=>o!==r[l])||n.thickness!==s||n.opacity!==i||n.pageIndex!==a},Z(fm,"_type","ink"),Z(fm,"_editorType",$e.INK),Z(fm,"_defaultDrawingOptions",null);let q2=fm;class G2 extends q0{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}}const G1=8,Ix=3;var Rf,vt,K2,Va,qG,GG,Y2,Zk,KG,YG,XG,X2,Z2,ZG;class Go{static extractContoursFromText(e,{fontFamily:n,fontStyle:r,fontWeight:s},i,a,o,l){let u=new OffscreenCanvas(1,1),d=u.getContext("2d",{alpha:!1});const f=200,p=d.font=`${r} ${s} ${f}px ${n}`,{actualBoundingBoxLeft:m,actualBoundingBoxRight:y,actualBoundingBoxAscent:g,actualBoundingBoxDescent:b,fontBoundingBoxAscent:x,fontBoundingBoxDescent:w,width:v}=d.measureText(e),S=1.5,E=Math.ceil(Math.max(Math.abs(m)+Math.abs(y)||0,v)*S),C=Math.ceil(Math.max(Math.abs(g)+Math.abs(b)||f,Math.abs(x)+Math.abs(w)||f)*S);u=new OffscreenCanvas(E,C),d=u.getContext("2d",{alpha:!0,willReadFrequently:!0}),d.font=p,d.filter="grayscale(1)",d.fillStyle="white",d.fillRect(0,0,E,C),d.fillStyle="black",d.fillText(e,E*(S-1)/2,C*(3-S)/2);const T=j(this,vt,X2).call(this,d.getImageData(0,0,E,C).data),P=j(this,vt,XG).call(this,T),M=j(this,vt,Z2).call(this,P),R=j(this,vt,Y2).call(this,T,E,C,M);return this.processDrawnLines({lines:{curves:R,width:E,height:C},pageWidth:i,pageHeight:a,rotation:o,innerMargin:l,mustSmooth:!0,areContours:!0})}static process(e,n,r,s,i){const[a,o,l]=j(this,vt,ZG).call(this,e),[u,d]=j(this,vt,YG).call(this,a,o,l,Math.hypot(o,l)*h(this,Rf).sigmaSFactor,h(this,Rf).sigmaR,h(this,Rf).kernelSize),f=j(this,vt,Z2).call(this,d),p=j(this,vt,Y2).call(this,u,o,l,f);return this.processDrawnLines({lines:{curves:p,width:o,height:l},pageWidth:n,pageHeight:r,rotation:s,innerMargin:i,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:n,pageHeight:r,rotation:s,innerMargin:i,mustSmooth:a,areContours:o}){s%180!==0&&([n,r]=[r,n]);const{curves:l,width:u,height:d}=e,f=e.thickness??0,p=[],m=Math.min(n/u,r/d),y=m/n,g=m/r,b=[];for(const{points:w}of l){const v=a?j(this,vt,KG).call(this,w):w;if(!v)continue;b.push(v);const S=v.length,E=new Float32Array(S),C=new Float32Array(3*(S===2?2:S-2));if(p.push({line:C,points:E}),S===2){E[0]=v[0]*y,E[1]=v[1]*g,C.set([NaN,NaN,NaN,NaN,E[0],E[1]],0);continue}let[T,P,M,R]=v;T*=y,P*=g,M*=y,R*=g,E.set([T,P,M,R],0),C.set([NaN,NaN,NaN,NaN,T,P],0);for(let O=4;O<S;O+=2){const L=E[O]=v[O]*y,U=E[O+1]=v[O+1]*g;C.set(fe.createBezierPoints(T,P,M,R,L,U),(O-2)*3),[T,P,M,R]=[M,R,L,U]}}if(p.length===0)return null;const x=o?new G2:new q0;return x.build(p,n,r,1,s,o?0:f,i),{outline:x,newCurves:b,areContours:o,thickness:f,width:u,height:d}}static async compressSignature({outlines:e,areContours:n,thickness:r,width:s,height:i}){let a=1/0,o=-1/0,l=0;for(const v of e){l+=v.length;for(let S=2,E=v.length;S<E;S++){const C=v[S]-v[S-2];a=Math.min(a,C),o=Math.max(o,C)}}let u;a>=-128&&o<=127?u=Int8Array:a>=-32768&&o<=32767?u=Int16Array:u=Int32Array;const d=e.length,f=G1+Ix*d,p=new Uint32Array(f);let m=0;p[m++]=f*Uint32Array.BYTES_PER_ELEMENT+(l-2*d)*u.BYTES_PER_ELEMENT,p[m++]=0,p[m++]=s,p[m++]=i,p[m++]=n?0:1,p[m++]=Math.max(0,Math.floor(r??0)),p[m++]=d,p[m++]=u.BYTES_PER_ELEMENT;for(const v of e)p[m++]=v.length-2,p[m++]=v[0],p[m++]=v[1];const y=new CompressionStream("deflate-raw"),g=y.writable.getWriter();await g.ready,g.write(p);const b=u.prototype.constructor;for(const v of e){const S=new b(v.length-2);for(let E=2,C=v.length;E<C;E++)S[E-2]=v[E]-v[E-2];g.write(S)}g.close();const x=await new Response(y.readable).arrayBuffer(),w=new Uint8Array(x);return K9(w)}static async decompressSignature(e){try{const n=kSe(e),{readable:r,writable:s}=new DecompressionStream("deflate-raw"),i=s.getWriter();await i.ready,i.write(n).then(async()=>{await i.ready,await i.close()}).catch(()=>{});let a=null,o=0;for await(const v of r)a||(a=new Uint8Array(new Uint32Array(v.buffer,0,4)[0])),a.set(v,o),o+=v.length;const l=new Uint32Array(a.buffer,0,a.length>>2),u=l[1];if(u!==0)throw new Error(`Invalid version: ${u}`);const d=l[2],f=l[3],p=l[4]===0,m=l[5],y=l[6],g=l[7],b=[],x=(G1+Ix*y)*Uint32Array.BYTES_PER_ELEMENT;let w;switch(g){case Int8Array.BYTES_PER_ELEMENT:w=new Int8Array(a.buffer,x);break;case Int16Array.BYTES_PER_ELEMENT:w=new Int16Array(a.buffer,x);break;case Int32Array.BYTES_PER_ELEMENT:w=new Int32Array(a.buffer,x);break}o=0;for(let v=0;v<y;
701v++){const S=l[Ix*v+G1],E=new Float32Array(S+2);b.push(E);for(let C=0;C<Ix-1;C++)E[C]=l[Ix*v+G1+C+1];for(let C=0;C<S;C++)E[C+2]=E[C]+w[o++]}return{areContours:p,thickness:m,outlines:b,width:d,height:f}}catch(n){return ze(`decompressSignature: ${n}`),null}}}Rf=new WeakMap,vt=new WeakSet,K2=function(e,n,r,s){return r-=e,s-=n,r===0?s>0?0:4:r===1?s+6:2-s},Va=new WeakMap,qG=function(e,n,r,s,i,a,o){const l=j(this,vt,K2).call(this,r,s,i,a);for(let u=0;u<8;u++){const d=(-u+l-o+16)%8,f=h(this,Va)[2*d],p=h(this,Va)[2*d+1];if(e[(r+f)*n+(s+p)]!==0)return d}return-1},GG=function(e,n,r,s,i,a,o){const l=j(this,vt,K2).call(this,r,s,i,a);for(let u=0;u<8;u++){const d=(u+l+o+16)%8,f=h(this,Va)[2*d],p=h(this,Va)[2*d+1];if(e[(r+f)*n+(s+p)]!==0)return d}return-1},Y2=function(e,n,r,s){const i=e.length,a=new Int32Array(i);for(let d=0;d<i;d++)a[d]=e[d]<=s?1:0;for(let d=1;d<r-1;d++)a[d*n]=a[d*n+n-1]=0;for(let d=0;d<n;d++)a[d]=a[n*r-1-d]=0;let o=1,l;const u=[];for(let d=1;d<r-1;d++){l=1;for(let f=1;f<n-1;f++){const p=d*n+f,m=a[p];if(m===0)continue;let y=d,g=f;if(m===1&&a[p-1]===0)o+=1,g-=1;else if(m>=1&&a[p+1]===0)o+=1,g+=1,m>1&&(l=m);else{m!==1&&(l=Math.abs(m));continue}const b=[f,d],x=g===f+1,w={isHole:x,points:b,id:o,parent:0};u.push(w);let v;for(const O of u)if(O.id===l){v=O;break}v?v.isHole?w.parent=x?v.parent:l:w.parent=x?l:v.parent:w.parent=x?l:0;const S=j(this,vt,qG).call(this,a,n,d,f,y,g,0);if(S===-1){a[p]=-o,a[p]!==1&&(l=Math.abs(a[p]));continue}let E=h(this,Va)[2*S],C=h(this,Va)[2*S+1];const T=d+E,P=f+C;y=T,g=P;let M=d,R=f;for(;;){const O=j(this,vt,GG).call(this,a,n,M,R,y,g,1);E=h(this,Va)[2*O],C=h(this,Va)[2*O+1];const L=M+E,U=R+C;b.push(U,L);const B=M*n+R;if(a[B+1]===0?a[B]=-o:a[B]===1&&(a[B]=o),L===d&&U===f&&M===T&&R===P){a[p]!==1&&(l=Math.abs(a[p]));break}else y=M,g=R,M=L,R=U}}}return u},Zk=function(e,n,r,s){if(r-n<=4){for(let T=n;T<r-2;T+=2)s.push(e[T],e[T+1]);return}const i=e[n],a=e[n+1],o=e[r-4]-i,l=e[r-3]-a,u=Math.hypot(o,l),d=o/u,f=l/u,p=d*a-f*i,m=l/o,y=1/u,g=Math.atan(m),b=Math.cos(g),x=Math.sin(g),w=y*(Math.abs(b)+Math.abs(x)),v=y*(1-w+w**2),S=Math.max(Math.atan(Math.abs(x+b)*v),Math.atan(Math.abs(x-b)*v));let E=0,C=n;for(let T=n+2;T<r-2;T+=2){const P=Math.abs(p-d*e[T+1]+f*e[T]);P>E&&(C=T,E=P)}E>(u*S)**2?(j(this,vt,Zk).call(this,e,n,C+2,s),j(this,vt,Zk).call(this,e,C,r,s)):s.push(i,a)},KG=function(e){const n=[],r=e.length;return j(this,vt,Zk).call(this,e,0,r,n),n.push(e[r-2],e[r-1]),n.length<=4?null:n},YG=function(e,n,r,s,i,a){const o=new Float32Array(a**2),l=-2*s**2,u=a>>1;for(let g=0;g<a;g++){const b=(g-u)**2;for(let x=0;x<a;x++)o[g*a+x]=Math.exp((b+(x-u)**2)/l)}const d=new Float32Array(256),f=-2*i**2;for(let g=0;g<256;g++)d[g]=Math.exp(g**2/f);const p=e.length,m=new Uint8Array(p),y=new Uint32Array(256);for(let g=0;g<r;g++)for(let b=0;b<n;b++){const x=g*n+b,w=e[x];let v=0,S=0;for(let C=0;C<a;C++){const T=g+C-u;if(!(T<0||T>=r))for(let P=0;P<a;P++){const M=b+P-u;if(M<0||M>=n)continue;const R=e[T*n+M],O=o[C*a+P]*d[Math.abs(R-w)];v+=R*O,S+=O}}const E=m[x]=Math.round(v/S);y[E]++}return[m,y]},XG=function(e){const n=new Uint32Array(256);for(const r of e)n[r]++;return n},X2=function(e){const n=e.length,r=new Uint8ClampedArray(n>>2);let s=-1/0,i=1/0;for(let o=0,l=r.length;o<l;o++){const u=r[o]=e[o<<2];s=Math.max(s,u),i=Math.min(i,u)}const a=255/(s-i);for(let o=0,l=r.length;o<l;o++)r[o]=(r[o]-i)*a;return r},Z2=function(e){let n,r=-1/0,s=-1/0;const i=e.findIndex(l=>l!==0);let a=i,o=i;for(n=i;n<256;n++){const l=e[n];l>r&&(n-a>s&&(s=n-a,o=n-1),r=l,a=n)}for(n=o-1;n>=0&&!(e[n]>e[n+1]);n--);return n},ZG=function(e){const n=e,{width:r,height:s}=e,{maxDim:i}=h(this,Rf);let a=r,o=s;if(r>i||s>i){let p=r,m=s,y=Math.log2(Math.max(r,s)/i);const g=Math.floor(y);y=y===g?g-1:g;for(let x=0;x<y;x++){a=Math.ceil(p/2),o=Math.ceil(m/2);const w=new OffscreenCanvas(a,o);w.getContext("2d").drawImage(e,0,0,p,m,0,0,a,o),p=a,m=o,e!==n&&e.close(),e=w.transferToImageBitmap()}const b=Math.min(i/a,i/o);a=Math.round(a*b),o=Math.round(o*b)}const u=new OffscreenCanvas(a,o).getContext("2d",{willReadFrequently:!0});u.fillStyle="white",u.fillRect(0,0,a,o),u.filter="grayscale(1)",u.drawImage(e,0,0,e.width,e.height,0,0,a,o);const d=u.getImageData(0,0,a,o).data;return[j(this,vt,X2).call(this,d),a,o]},A(Go,vt),A(Go,Rf,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),A(Go,Va,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));class ED extends $G{constructor(){super(),super.updateProperties({fill:Gt._defaultLineColor,"stroke-width":0})}clone(){const e=new ED;return e.updateAll(this),e}}class CD extends QE{constructor(e){super(e),super.updateProperties({stroke:Gt._defaultLineColor,"stroke-width":1})}clone(){const e=new CD(this._viewParameters);return e.updateAll(this),e}}var Ou,zo,Lu,If;const ti=class ti extends b_{constructor(n){super({...n,mustBeCommitted:!0,name:"signatureEditor"});A(this,Ou,!1);A(this,zo,null);A(this,Lu,null);A(this,If,null);this._willKeepAspectRatio=!0,_(this,Lu,n.signatureData||null),_(this,zo,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(n,r){Gt.initialize(n,r),this._defaultDrawingOptions=new ED,this._defaultDrawnSignatureOptions=new CD(r.viewParameters)}static getDefaultDrawingOptions(n){const r=this._defaultDrawingOptions.clone();return r.updateProperties(n),r}static get supportMultipleDrawings(){return!1}static get typesMap(){return Qe(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!h(this,zo)}}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()}
701render(){if(this.div)return this.div;let n,r;const{_isCopy:s}=this;if(s&&(this._isCopy=!1,n=this.x,r=this.y),super.render(),this._drawId===null)if(h(this,Lu)){const{lines:i,mustSmooth:a,areContours:o,description:l,uuid:u,heightInPage:d}=h(this,Lu),{rawDims:{pageWidth:f,pageHeight:p},rotation:m}=this.parent.viewport,y=Go.processDrawnLines({lines:i,pageWidth:f,pageHeight:p,rotation:m,innerMargin:ti._INNER_MARGIN,mustSmooth:a,areContours:o});this.addSignature(y,d,l,u)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:h(this,zo)||""}));return s&&(this._isCopy=!0,this._moveAfterPaste(n,r)),this.div}setUuid(n){_(this,If,n),this.addEditToolbar()}getUuid(){return h(this,If)}get description(){return h(this,zo)}set description(n){_(this,zo,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:s,width:i,height:a}=h(this,Lu),o=Math.max(i,a),l=Go.processDrawnLines({lines:{curves:n.map(u=>({points:u})),thickness:s,width:i,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,s,i){const{x:a,y:o}=this,{outline:l}=_(this,Lu,n);_(this,Ou,l instanceof G2),this.description=s;let u;h(this,Ou)?u=ti.getDefaultDrawingOptions():(u=ti._defaultDrawnSignatureOptions.clone(),u.updateProperties({"stroke-width":l.thickness})),this._addOutlines({drawOutlines:l,drawingOptions:u});const[,d]=this.pageDimensions;let f=r/d;f=f>=1?.5:f,this.width*=f/this.height,this.width>=1&&(f*=.9/this.width,this.width=.9),this.height=f,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!i,hasDescription:!!s}}),this.div.hidden=!1}getFromImage(n){const{rawDims:{pageWidth:r,pageHeight:s},rotation:i}=this.parent.viewport;return Go.process(n,r,s,i,ti._INNER_MARGIN)}getFromText(n,r){const{rawDims:{pageWidth:s,pageHeight:i},rotation:a}=this.parent.viewport;return Go.extractContoursFromText(n,r,s,i,a,ti._INNER_MARGIN)}getDrawnSignature(n){const{rawDims:{pageWidth:r,pageHeight:s},rotation:i}=this.parent.viewport;return Go.processDrawnLines({lines:n,pageWidth:r,pageHeight:s,rotation:i,innerMargin:ti._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:n,thickness:r}){n?this._drawingOptions=ti.getDefaultDrawingOptions():(this._drawingOptions=ti._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":r}))}serialize(n=!1){if(this.isEmpty())return null;const{lines:r,points:s}=this.serializeDraw(n),{_drawingOptions:{"stroke-width":i}}=this,a=Object.assign(super.serialize(n),{isSignature:!0,areContours:h(this,Ou),color:[0,0,0],thickness:h(this,Ou)?0:i});return this.addComment(a),n?(a.paths={lines:r,points:s},a.uuid=h(this,If),a.isCopy=!0):a.lines=r,h(this,zo)&&(a.accessibilityData={type:"Figure",alt:h(this,zo)}),a}static deserializeDraw(n,r,s,i,a,o){return o.areContours?G2.deserialize(n,r,s,i,a,o):q0.deserialize(n,r,s,i,a,o)}static async deserialize(n,r,s){var a;const i=await super.deserialize(n,r,s);return _(i,Ou,n.areContours),i.description=((a=n.accessibilityData)==null?void 0:a.alt)||"",_(i,If,n.uuid),i}};Ou=new WeakMap,zo=new WeakMap,Lu=new WeakMap,If=new WeakMap,Z(ti,"_type","signature"),Z(ti,"_editorType",$e.SIGNATURE),Z(ti,"_defaultDrawingOptions",null);let Q2=ti;var tn,lr,Fu,Zl,Bu,ly,Ql,Df,Vo,bi,cy,ht,uv,dv,Qk,Jk,eS,eP,tS,QG;class J2 extends Gt{constructor(n){super({...n,name:"stampEditor"});A(this,ht);A(this,tn,null);A(this,lr,null);A(this,Fu,null);A(this,Zl,null);A(this,Bu,null);A(this,ly,"");A(this,Ql,null);A(this,Df,!1);A(this,Vo,null);A(this,bi,!1);A(this,cy,!1);_(this,Zl,n.bitmapUrl),_(this,Bu,n.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(n,r){Gt.initialize(n,r)}static isHandlingMimeForPasting(n){return h_.includes(n)}static paste(n,r){r.pasteEditor({mode:$e.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:s}=this._uiManager;if(!s)throw new Error("No ML.");if(!await s.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:i,width:a,height:o}=n||this.copyCanvas(null,null,!0).imageData,l=await s.guess({name:"altText",request:{data:i,width:a,height:o,channels:i.length/(a*o)}});if(!l)throw new Error("No response from the AI service.");if(l.error)throw new Error("Error from the AI service.");if(l.cancel)return null;if(!l.output)throw new Error("No valid response from the AI service.");const u=l.output;return await this.setGuessedAltText(u),r&&!this.hasAltTextData()&&(this.altTextData={alt:u,decorative:!1}),u}remove(){var n;h(this,lr)&&(_(this,tn,null),this._uiManager.imageManager.deleteId(h(this,lr)),(n=h(this,Ql))==null||n.remove(),_(this,Ql,null),h(this,Vo)&&(clearTimeout(h(this,Vo)),_(this,Vo,null))),super.remove()}rebuild(){if(!this.parent){h(this,lr)&&j(this,ht,Qk).call(this);return}super.rebuild(),this.div!==null&&(h(this,lr)&&h(this,Ql)===null&&j(this,ht,Qk).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(n){this._isDraggable=!0,n&&this.div.focus()}isEmpty(){return!(h(this,Fu)||h(this,tn)||h(this,Zl)||h(this,Bu)||h(this,lr)||h(this,Df))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}
701render(){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(),h(this,Df)||(h(this,tn)?j(this,ht,Jk).call(this):j(this,ht,Qk).call(this)),this._isCopy&&this._moveAfterPaste(n,r),this._uiManager.addShouldRescale(this),this.div}setCanvas(n,r){const{id:s,bitmap:i}=this._uiManager.imageManager.getFromCanvas(n,r);r.remove(),s&&this._uiManager.imageManager.isValidId(s)&&(_(this,lr,s),i&&_(this,tn,i),_(this,Df,!1),j(this,ht,Jk).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;h(this,Vo)!==null&&clearTimeout(h(this,Vo)),_(this,Vo,setTimeout(()=>{_(this,Vo,null),j(this,ht,eP).call(this)},200))}copyCanvas(n,r,s=!1){n||(n=224);const{width:i,height:a}=h(this,tn),o=new so;let l=h(this,tn),u=i,d=a,f=null;if(r){if(i>r||a>r){const T=Math.min(r/i,r/a);u=Math.floor(i*T),d=Math.floor(a*T)}f=document.createElement("canvas");const m=f.width=Math.ceil(u*o.sx),y=f.height=Math.ceil(d*o.sy);h(this,bi)||(l=j(this,ht,eS).call(this,m,y));const g=f.getContext("2d");g.filter=this._uiManager.hcmFilter;let b="white",x="#cfcfd8";this._uiManager.hcmFilter!=="none"?x="black":ESe.isDarkMode&&(b="#8f8f9d",x="#42414d");const w=15,v=w*o.sx,S=w*o.sy,E=new OffscreenCanvas(v*2,S*2),C=E.getContext("2d");C.fillStyle=b,C.fillRect(0,0,v*2,S*2),C.fillStyle=x,C.fillRect(0,0,v,S),C.fillRect(v,S,v,S),g.fillStyle=g.createPattern(E,"repeat"),g.fillRect(0,0,m,y),g.drawImage(l,0,0,l.width,l.height,0,0,m,y)}let p=null;if(s){let m,y;if(o.symmetric&&l.width<n&&l.height<n)m=l.width,y=l.height;else if(l=h(this,tn),i>n||a>n){const x=Math.min(n/i,n/a);m=Math.floor(i*x),y=Math.floor(a*x),h(this,bi)||(l=j(this,ht,eS).call(this,m,y))}const b=new OffscreenCanvas(m,y).getContext("2d",{willReadFrequently:!0});b.drawImage(l,0,0,l.width,l.height,0,0,m,y),p={width:m,height:y,data:b.getImageData(0,0,m,y).data}}return{canvas:f,width:u,height:d,imageData:p}}static async deserialize(n,r,s){var b;let i=null,a=!1;if(n instanceof pG){const{data:{rect:x,rotation:w,id:v,structParent:S,popupRef:E,richText:C,contentsObj:T,creationDate:P,modificationDate:M},container:R,parent:{page:{pageNumber:O}},canvas:L}=n;let U,B;L?(delete n.canvas,{id:U,bitmap:B}=s.imageManager.getFromCanvas(R.id,L),L.remove()):(a=!0,n._hasNoCanvas=!0);const H=((b=await r._structTree.getAriaAttributes(`${fD}${v}`))==null?void 0:b.get("aria-label"))||"";i=n={annotationType:$e.STAMP,bitmapId:U,bitmap:B,pageIndex:O-1,rect:x.slice(0),rotation:w,annotationElementId:v,id:v,deleted:!1,accessibilityData:{decorative:!1,altText:H},isSvg:!1,structParent:S,popupRef:E,richText:C,comment:(T==null?void 0:T.str)||null,creationDate:P,modificationDate:M}}const o=await super.deserialize(n,r,s),{rect:l,bitmap:u,bitmapUrl:d,bitmapId:f,isSvg:p,accessibilityData:m}=n;a?(s.addMissingCanvas(n.id,o),_(o,Df,!0)):f&&s.imageManager.isValidId(f)?(_(o,lr,f),u&&_(o,tn,u)):_(o,Zl,d),_(o,bi,p);const[y,g]=o.pageDimensions;return o.width=(l[2]-l[0])/y,o.height=(l[3]-l[1])/g,m&&(o.altTextData=m),o._initialData=i,n.comment&&o.setCommentData(n),_(o,cy,!!i),o}serialize(n=!1,r=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=Object.assign(super.serialize(n),{bitmapId:h(this,lr),isSvg:h(this,bi)});if(this.addComment(s),n)return s.bitmapUrl=j(this,ht,tS).call(this,!0),s.accessibilityData=this.serializeAltText(!0),s.isCopy=!0,s;const{decorative:i,altText:a}=this.serializeAltText(!1);if(!i&&a&&(s.accessibilityData={type:"Figure",alt:a}),this.annotationElementId){const l=j(this,ht,QG).call(this,s);return l.isSame?null:(l.isSameAltText?delete s.accessibilityData:s.accessibilityData.structParent=this._initialData.structParent??-1,s.id=this.annotationElementId,delete s.bitmapId,s)}if(r===null)return s;r.stamps||(r.stamps=new Map);const o=h(this,bi)?(s.rect[2]-s.rect[0])*(s.rect[3]-s.rect[1]):null;if(!r.stamps.has(h(this,lr)))r.stamps.set(h(this,lr),{area:o,serialized:s}),s.bitmap=j(this,ht,tS).call(this,!1);else if(h(this,bi)){const l=r.stamps.get(h(this,lr));o>l.area&&(l.area=o,l.serialized.bitmap.close(),l.serialized.bitmap=j(this,ht,tS).call(this,!1))}return s}renderAnnotationElement(n){return this.deleted?(n.hide(),null):(n.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}}tn=new WeakMap,lr=new WeakMap,Fu=new WeakMap,Zl=new WeakMap,Bu=new WeakMap,ly=new WeakMap,Ql=new WeakMap,Df=new WeakMap,Vo=new WeakMap,bi=new WeakMap,cy=new WeakMap,ht=new WeakSet,uv=function(n,r=!1){if(!n){this.remove();return}_(this,tn,n.bitmap),r||(_(this,lr,n.id),_(this,bi,n.isSvg)),n.file&&_(this,ly,n.file.name),j(this,ht,Jk).call(this)},dv=function(){if(_(this,Fu,null),this._uiManager.enableWaiting(!1),!!h(this,Ql)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&h(this,tn)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&h(this,tn)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},Qk=function(){if(h(this,lr)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(h(this,lr)).then(s=>j(this,ht,uv).call(this,s,!0)).finally(()=>j(this,ht,dv).call(this));return}if(h(this,Zl)){const s=h(this,Zl);
701_(this,Zl,null),this._uiManager.enableWaiting(!0),_(this,Fu,this._uiManager.imageManager.getFromUrl(s).then(i=>j(this,ht,uv).call(this,i)).finally(()=>j(this,ht,dv).call(this)));return}if(h(this,Bu)){const s=h(this,Bu);_(this,Bu,null),this._uiManager.enableWaiting(!0),_(this,Fu,this._uiManager.imageManager.getFromFile(s).then(i=>j(this,ht,uv).call(this,i)).finally(()=>j(this,ht,dv).call(this)));return}const n=document.createElement("input");n.type="file",n.accept=h_.join(",");const r=this._uiManager._signal;_(this,Fu,new Promise(s=>{n.addEventListener("change",async()=>{if(!n.files||n.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const i=await this._uiManager.imageManager.getFromFile(n.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),j(this,ht,uv).call(this,i)}s()},{signal:r}),n.addEventListener("cancel",()=>{this.remove(),s()},{signal:r})}).finally(()=>j(this,ht,dv).call(this))),n.click()},Jk=function(){var u;const{div:n}=this;let{width:r,height:s}=h(this,tn);const[i,a]=this.pageDimensions,o=.75;if(this.width)r=this.width*i,s=this.height*a;else if(r>o*i||s>o*a){const d=Math.min(o*i/r,o*a/s);r*=d,s*=d}this._uiManager.enableWaiting(!1);const l=_(this,Ql,document.createElement("canvas"));l.setAttribute("role","img"),this.addContainer(l),this.width=r/i,this.height=s/a,this.setDims(),(u=this._initialOptions)!=null&&u.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(n.hidden=!1),j(this,ht,eP).call(this),h(this,cy)||(this.parent.addUndoableEditor(this),_(this,cy,!0)),this._reportTelemetry({action:"inserted_image"}),h(this,ly)&&this.div.setAttribute("aria-description",h(this,ly)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},eS=function(n,r){const{width:s,height:i}=h(this,tn);let a=s,o=i,l=h(this,tn);for(;a>2*n||o>2*r;){const u=a,d=o;a>2*n&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2)),o>2*r&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const f=new OffscreenCanvas(a,o);f.getContext("2d").drawImage(l,0,0,u,d,0,0,a,o),l=f.transferToImageBitmap()}return l},eP=function(){const[n,r]=this.parentDimensions,{width:s,height:i}=this,a=new so,o=Math.ceil(s*n*a.sx),l=Math.ceil(i*r*a.sy),u=h(this,Ql);if(!u||u.width===o&&u.height===l)return;u.width=o,u.height=l;const d=h(this,bi)?h(this,tn):j(this,ht,eS).call(this,o,l),f=u.getContext("2d");f.filter=this._uiManager.hcmFilter,f.drawImage(d,0,0,d.width,d.height,0,0,o,l)},tS=function(n){if(n){if(h(this,bi)){const i=this._uiManager.imageManager.getSvgUrl(h(this,lr));if(i)return i}const r=document.createElement("canvas");return{width:r.width,height:r.height}=h(this,tn),r.getContext("2d").drawImage(h(this,tn),0,0),r.toDataURL()}if(h(this,bi)){const[r,s]=this.pageDimensions,i=Math.round(this.width*r*bc.PDF_TO_CSS_UNITS),a=Math.round(this.height*s*bc.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(i,a);return o.getContext("2d").drawImage(h(this,tn),0,0,h(this,tn).width,h(this,tn).height,0,0,i,a),o.transferToImageBitmap()}return structuredClone(h(this,tn))},QG=function(n){var o;const{pageIndex:r,accessibilityData:{altText:s}}=this._initialData,i=n.pageIndex===r,a=(((o=n.accessibilityData)==null?void 0:o.alt)||"")===s;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&i&&a,isSameAltText:a}},Z(J2,"_type","stamp"),Z(J2,"_editorType",$e.STAMP);var Mf,uy,$u,Uu,Jl,Fs,zu,dy,hy,Wa,ec,cr,tc,Vu,fy,we,Wu,Mt,tP,JG,fo,nP,rP,nS;const ja=class ja{constructor({uiManager:e,pageIndex:n,div:r,structTreeLayer:s,accessibilityManager:i,annotationLayer:a,drawLayer:o,textLayer:l,viewport:u,l10n:d}){A(this,Mt);A(this,Mf);A(this,uy,!1);A(this,$u,null);A(this,Uu,null);A(this,Jl,null);A(this,Fs,new Map);A(this,zu,!1);A(this,dy,!1);A(this,hy,!1);A(this,Wa,null);A(this,ec,null);A(this,cr,null);A(this,tc,null);A(this,Vu,null);A(this,fy,-1);A(this,we);const f=[...h(ja,Wu).values()];if(!ja._initialized){ja._initialized=!0;for(const p of f)p.initialize(d,e)}
701e.registerEditorTypes(f),_(this,we,e),this.pageIndex=n,this.div=r,_(this,Mf,i),_(this,$u,a),this.viewport=u,_(this,cr,l),this.drawLayer=o,this._structTree=s,h(this,we).addLayer(this)}get isEmpty(){return h(this,Fs).size===0}get isInvisible(){return this.isEmpty&&h(this,we).getMode()===$e.NONE}updateToolbar(e){h(this,we).updateToolbar(e)}updateMode(e=h(this,we).getMode()){switch(j(this,Mt,nS).call(this),e){case $e.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case $e.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case $e.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===$e.POPUP)n.toggle("commentEditing",!0);else{n.toggle("commentEditing",!1);for(const r of h(ja,Wu).values())n.toggle(`${r._type}Editing`,e===r._editorType)}this.div.hidden=!1}hasTextLayer(e){var n;return e===((n=h(this,cr))==null?void 0:n.div)}setEditingState(e){h(this,we).setEditingState(e)}addCommands(e){h(this,we).addCommands(e)}cleanUndoStack(e){h(this,we).cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){var n;(n=h(this,$u))==null||n.div.classList.toggle("disabled",!e)}async enable(){var r;_(this,hy,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),(r=h(this,Vu))==null||r.abort(),_(this,Vu,null);const e=new Set;for(const s of h(this,Mt,tP))s.enableEditing(),s.show(!0),s.annotationElementId&&(h(this,we).removeChangedExistingAnnotation(s),e.add(s.annotationElementId));const n=h(this,$u);if(n)for(const s of n.getEditableAnnotations()){if(s.hide(),h(this,we).isDeletedAnnotationElement(s.data.id)||e.has(s.data.id))continue;const i=await this.deserialize(s);i&&(this.addOrRebuild(i),i.enableEditing())}_(this,hy,!1),h(this,we)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){var r;if(_(this,dy,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),h(this,cr)&&!h(this,Vu)){_(this,Vu,new AbortController);const s=h(this,we).combinedSignal(h(this,Vu));h(this,cr).div.addEventListener("pointerdown",i=>{const{clientX:o,clientY:l,timeStamp:u}=i,d=h(this,fy);if(u-d>500){_(this,fy,u);return}_(this,fy,-1);const{classList:f}=this.div;f.toggle("getElements",!0);const p=document.elementsFromPoint(o,l);if(f.toggle("getElements",!1),!this.div.contains(p[0]))return;let m;const y=new RegExp(`^${Eb}[0-9]+$`);for(const b of p)if(y.test(b.id)){m=b.id;break}if(!m)return;const g=h(this,Fs).get(m);(g==null?void 0:g.annotationElementId)===null&&(i.stopPropagation(),i.preventDefault(),g.dblclick(i))},{signal:s,capture:!0})}const e=h(this,$u);if(e){const s=new Map,i=new Map;for(const o of h(this,Mt,tP)){if(o.disableEditing(),!o.annotationElementId){o.updateFakeAnnotationElement(e);continue}if(o.serialize()!==null){s.set(o.annotationElementId,o);continue}else i.set(o.annotationElementId,o);(r=this.getEditableAnnotation(o.annotationElementId))==null||r.show(),o.remove()}const a=e.getEditableAnnotations();for(const o of a){const{id:l}=o.data;if(h(this,we).isDeletedAnnotationElement(l)){o.updateEdited({deleted:!0});continue}let u=i.get(l);if(u){u.resetAnnotationElement(o),u.show(!1),o.show();continue}u=s.get(l),u&&(h(this,we).addChangedExistingAnnotation(u),u.renderAnnotationElement(o)&&u.show(!1)),o.show()}}j(this,Mt,nS).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const s of h(ja,Wu).values())n.remove(`${s._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),_(this,dy,!1)}getEditableAnnotation(e){var n;return((n=h(this,$u))==null?void 0:n.getEditableAnnotation(e))||null}setActiveEditor(e){h(this,we).getActive()!==e&&h(this,we).setActiveEditor(e)}enableTextSelection(){var e;if(this.div.tabIndex=-1,(e=h(this,cr))!=null&&e.div&&!h(this,tc)){_(this,tc,new AbortController);
701const n=h(this,we).combinedSignal(h(this,tc));h(this,cr).div.addEventListener("pointerdown",j(this,Mt,JG).bind(this),{signal:n}),h(this,cr).div.classList.add("highlighting")}}disableTextSelection(){var e;this.div.tabIndex=0,(e=h(this,cr))!=null&&e.div&&h(this,tc)&&(h(this,tc).abort(),_(this,tc,null),h(this,cr).div.classList.remove("highlighting"))}enableClick(){if(h(this,Uu))return;_(this,Uu,new AbortController);const e=h(this,we).combinedSignal(h(this,Uu));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=h(this,Uu))==null||e.abort(),_(this,Uu,null)}attach(e){h(this,Fs).set(e.id,e);const{annotationElementId:n}=e;n&&h(this,we).isDeletedAnnotationElement(n)&&h(this,we).removeDeletedAnnotationElement(e)}detach(e){var n;h(this,Fs).delete(e.id),(n=h(this,Mf))==null||n.removePointerInTextLayer(e.contentDiv),!h(this,dy)&&e.annotationElementId&&h(this,we).addDeletedAnnotationElement(e)}remove(e){this.detach(e),h(this,we).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){var n;e.parent!==this&&(e.parent&&e.annotationElementId&&(h(this,we).addDeletedAnnotationElement(e.annotationElementId),Gt.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)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),h(this,we).addEditor(e),this.attach(e),!e.isAttachedToDOM){const n=e.render();this.div.append(n),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!h(this,hy)),h(this,we).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var r;if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&!h(this,Jl)&&(e._focusEventsAllowed=!1,_(this,Jl,setTimeout(()=>{_(this,Jl,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:h(this,we)._signal}),n.focus())},0))),e._structTreeParentId=(r=h(this,Mf))==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 h(this,Fs).values())if(n.uid===e)return n;return null}getNextId(){return h(this,we).getId()}combinedSignal(e){return h(this,we).combinedSignal(e)}canCreateNewEmptyEditor(){var e;return(e=h(this,Mt,fo))==null?void 0:e.canCreateNewEmptyEditor()}async pasteEditor(e,n){this.updateToolbar(e),await h(this,we).updateMode(e.mode);const{offsetX:r,offsetY:s}=j(this,Mt,rP).call(this),i=this.getNextId(),a=j(this,Mt,nP).call(this,{parent:this,id:i,x:r,y:s,uiManager:h(this,we),isCentered:!0,...n});a&&this.add(a)}async deserialize(e){var n;return await((n=h(ja,Wu).get(e.annotationType??e.annotationEditorType))==null?void 0:n.deserialize(e,this,h(this,we)))||null}createAndAddNewEditor(e,n,r={}){const s=this.getNextId(),i=j(this,Mt,nP).call(this,{parent:this,id:s,x:e.offsetX,y:e.offsetY,uiManager:h(this,we),isCentered:n,...r});return i&&this.add(i),i}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(e={}){this.createAndAddNewEditor(j(this,Mt,rP).call(this),!0,e)}setSelected(e){h(this,we).setSelected(e)}toggleSelected(e){h(this,we).toggleSelected(e)}unselect(e){h(this,we).unselect(e)}pointerup(e){var s;const{isMac:n}=hr.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div||!h(this,zu)||(_(this,zu,!1),(s=h(this,Mt,fo))!=null&&s.isDrawer&&h(this,Mt,fo).supportMultipleDrawings))return;if(!h(this,uy)){_(this,uy,!0);return}const r=h(this,we).getMode();if(r===$e.STAMP||r===$e.SIGNATURE){h(this,we).unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){var s;if(h(this,we).getMode()===$e.HIGHLIGHT&&this.enableTextSelection(),h(this,zu)){_(this,zu,!1);return}const{isMac:n}=hr.platform;if(e.button!==0||e.ctrlKey&&n||e.target!==this.div)return;if(_(this,zu,!0),(s=h(this,Mt,fo))!=null&&s.isDrawer){this.startDrawingSession(e);return}const r=h(this,we).getActive();_(this,uy,!r||r.isEmpty())}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),h(this,Wa)){h(this,Mt,fo).startDrawing(this,h(this,we),!1,e);return}h(this,we).setCurrentDrawingSession(this),_(this,Wa,new AbortController);
701const n=h(this,we).combinedSignal(h(this,Wa));this.div.addEventListener("blur",({relatedTarget:r})=>{r&&!this.div.contains(r)&&(_(this,ec,null),this.commitOrRemove())},{signal:n}),h(this,Mt,fo).startDrawing(this,h(this,we),!1,e)}pause(e){if(e){const{activeElement:n}=document;this.div.contains(n)&&_(this,ec,n);return}h(this,ec)&&setTimeout(()=>{var n;(n=h(this,ec))==null||n.focus(),_(this,ec,null)},0)}endDrawingSession(e=!1){return h(this,Wa)?(h(this,we).setCurrentDrawingSession(null),h(this,Wa).abort(),_(this,Wa,null),_(this,ec,null),h(this,Mt,fo).endDrawing(e)):null}findNewParent(e,n,r){const s=h(this,we).findParent(n,r);return s===null||s===this?!1:(s.changeParent(e),!0)}commitOrRemove(){return h(this,Wa)?(this.endDrawingSession(),!0):!1}onScaleChanging(){h(this,Wa)&&h(this,Mt,fo).onScaleChangingWhenDrawing(this)}destroy(){var e,n;this.commitOrRemove(),((e=h(this,we).getActive())==null?void 0:e.parent)===this&&(h(this,we).commitOrRemove(),h(this,we).setActiveEditor(null)),h(this,Jl)&&(clearTimeout(h(this,Jl)),_(this,Jl,null));for(const r of h(this,Fs).values())(n=h(this,Mf))==null||n.removePointerInTextLayer(r.contentDiv),r.setParent(null),r.isAttachedToDOM=!1,r.div.remove();this.div=null,h(this,Fs).clear(),h(this,we).removeLayer(this)}render({viewport:e}){this.viewport=e,kd(this.div,e);for(const n of h(this,we).getEditors(this.pageIndex))this.add(n),n.rebuild();this.updateMode()}update({viewport:e}){h(this,we).commitOrRemove(),j(this,Mt,nS).call(this);const n=this.viewport.rotation,r=e.rotation;if(this.viewport=e,kd(this.div,{rotation:r}),n!==r)for(const s of h(this,Fs).values())s.rotate(r)}get pageDimensions(){const{pageWidth:e,pageHeight:n}=this.viewport.rawDims;return[e,n]}get scale(){return h(this,we).viewParameters.realScale}};Mf=new WeakMap,uy=new WeakMap,$u=new WeakMap,Uu=new WeakMap,Jl=new WeakMap,Fs=new WeakMap,zu=new WeakMap,dy=new WeakMap,hy=new WeakMap,Wa=new WeakMap,ec=new WeakMap,cr=new WeakMap,tc=new WeakMap,Vu=new WeakMap,fy=new WeakMap,we=new WeakMap,Wu=new WeakMap,Mt=new WeakSet,tP=function(){return h(this,Fs).size!==0?h(this,Fs).values():h(this,we).getEditors(this.pageIndex)},JG=function(e){h(this,we).unselectAll();const{target:n}=e;if(n===h(this,cr).div||(n.getAttribute("role")==="img"||n.classList.contains("endOfContent"))&&h(this,cr).div.contains(n)){const{isMac:r}=hr.platform;if(e.button!==0||e.ctrlKey&&r)return;h(this,we).showAllEditors("highlight",!0,!0),h(this,cr).div.classList.add("free"),this.toggleDrawing(),v_.startHighlighting(this,h(this,we).direction==="ltr",{target:h(this,cr).div,x:e.x,y:e.y}),h(this,cr).div.addEventListener("pointerup",()=>{h(this,cr).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:h(this,we)._signal}),e.preventDefault()}},fo=function(){return h(ja,Wu).get(h(this,we).getMode())},nP=function(e){const n=h(this,Mt,fo);return n?new n.prototype.constructor(e):null},rP=function(){const{x:e,y:n,width:r,height:s}=this.boundingClientRect,i=Math.max(0,e),a=Math.max(0,n),o=Math.min(window.innerWidth,e+r),l=Math.min(window.innerHeight,n+s),u=(i+o)/2-e,d=(a+l)/2-n,[f,p]=this.viewport.rotation%180===0?[u,d]:[d,u];return{offsetX:f,offsetY:p}},nS=function(){for(const e of h(this,Fs).values())e.isEmpty()&&e.remove()},Z(ja,"_initialized",!1),A(ja,Wu,new Map([O2,q2,J2,v_,Q2].map(e=>[e._editorType,e])));let w_=ja;var Ha,os,Of,p0,U_,e7,sl,sP,t7,iP;const Gn=class Gn{constructor({pageIndex:e}){A(this,sl);A(this,Ha,null);A(this,os,new Map);A(this,Of,new Map);this.pageIndex=e}setParent(e){if(!h(this,Ha)){_(this,Ha,e);return}if(h(this,Ha)!==e){if(h(this,os).size>0)for(const n of h(this,os).values())n.remove(),e.append(n);_(this,Ha,e)}}static get _svgFactory(){return Qe(this,"_svgFactory",new Rb)}draw(e,n=!1,r=!1){const s=pn(Gn,p0)._++,i=j(this,sl,sP).call(this),a=Gn._svgFactory.createElement("defs");i.append(a);const o=Gn._svgFactory.createElement("path");a.append(o);const l=`path_p${this.pageIndex}_${s}`;o.setAttribute("id",l),o.setAttribute("vector-effect","non-scaling-stroke"),n&&h(this,Of).set(s,o);const u=r?j(this,sl,t7).call(this,a,l):null,d=Gn._svgFactory.createElement("use");return i.append(d),d.setAttribute("href",`#${l}`),this.updateProperties(i,e),h(this,os).set(s,i),{id:s,clipPathId:`url(#${u})`}}drawOutline(e,n){const r=pn(Gn,p0)._++,s=j(this,sl,sP).call(this),i=Gn._svgFactory.createElement("defs");s.append(i);const a=Gn._svgFactory.createElement("path");i.append(a);const o=`path_p${this.pageIndex}_${r}`;a.setAttribute("id",o),a.setAttribute("vector-effect","non-scaling-stroke");let l;if(n){const f=Gn._svgFactory.createElement("mask");i.append(f),l=`mask_p${this.pageIndex}_${r}`,f.setAttribute("id",l),f.setAttribute("maskUnits","objectBoundingBox");const p=Gn._svgFactory.createElement("rect");f.append(p),p.setAttribute("width","1"),p.setAttribute("height","1"),p.setAttribute("fill","white");const m=Gn._svgFactory.createElement("use");f.append(m),m.setAttribute("href",`#${o}`),m.setAttribute("stroke","none"),m.setAttribute("fill","black"),m.setAttribute("fill-rule","nonzero"),m.classList.add("mask")}const u=Gn._svgFactory.createElement("use");s.append(u),u.setAttribute("href",`#${o}`),l&&u.setAttribute("mask",`url(#${l})`);const d=u.cloneNode();return s.append(d),u.classList.add("mainOutline"),d.classList.add("secondaryOutline"),this.updateProperties(s,e),h(this,os).set(r,s),r}finalizeDraw(e,n){h(this,Of).delete(e),this.updateProperties(e,n)}updateProperties(e,n){var l;if(!n)return;const{root:r,bbox:s,rootClass:i,path:a}=n,o=typeof e=="number"?h(this,os).get(e):e;if(o){if(r&&j(this,sl,iP).call(this,o,r),s&&j(l=Gn,U_,e7).call(l,o,s),i){const{classList:u}=o;for(const[d,f]of Object.entries(i))u.toggle(d,f)}if(a){const d=o.firstChild.firstChild;j(this,sl,iP).call(this,d,a)}}}updateParent(e,n){if(n===this)return;const r=h(this,os).get(e);r&&(h(n,Ha).append(r),h(this,os).delete(e),h(n,os).set(e,r))}remove(e){h(this,Of).delete(e),h(this,Ha)!==null&&(h(this,os).get(e).remove(),h(this,os).delete(e))}destroy(){_(this,Ha,null);for(const e of h(this,os).values())e.remove();h(this,os).clear(),h(this,Of).clear()}};Ha=new WeakMap,os=new WeakMap,Of=new WeakMap,p0=new WeakMap,U_=new WeakSet,e7=function(e,[n,r,s,i]){const{style:a}=e;a.top=`${100*r}%`,a.left=`${100*n}%`,a.width=`${100*s}%`,a.height=`${100*i}%`},sl=new WeakSet,sP=function(){const e=Gn._svgFactory.create(1,1,!0);return h(this,Ha).append(e),e.setAttribute("aria-hidden",!0),e},t7=function(e,n){const r=Gn._svgFactory.createElement("clipPath");e.append(r);const s=`clip_${n}`;r.setAttribute("id",s),r.setAttribute("clipPathUnits","objectBoundingBox");const i=Gn._svgFactory.createElement("use");return r.append(i),i.setAttribute("href",`#${n}`),i.classList.add("clip"),s},iP=function(e,n){for(const[r,s]of Object.entries(n))s===null?e.removeAttribute(r):e.setAttribute(r,s)},A(Gn,U_),A(Gn,p0,0);let k_=Gn;globalThis._pdfjsTestingUtils={HighlightOutliner:F2};globalThis.pdfjsLib={AbortException:vc,AnnotationEditorLayer:w_,AnnotationEditorParamsType:ot,AnnotationEditorType:$e,AnnotationEditorUIManager:Sd,AnnotationLayer:_D,AnnotationMode:qo,AnnotationType:En,applyOpacity:J9,build:nG,ColorPicker:Pb,createValidAbsoluteUrl:uD,CSSConstants:Q9,DOMSVGFactory:Rb,DrawLayer:k_,FeatureTest:hr,fetchData:rx,findContrastColor:eq,getDocument:vD,getFilenameFromUrl:Y9,getPdfFilenameFromUrl:X9,getRGB:sx,getUuid:hD,getXfaPageViewport:Z9,GlobalWorkerOptions:sa,ImageKind:Ov,InvalidPDFException:d_,isDataScheme:V0,isPdfFile:XE,isValidExplicitDest:Iq,MathClamp:Wr,noContextMenu:Ii,normalizeUnicode:G9,OPS:Oy,OutputScale:so,PasswordResponses:H9,PDFD
701ataRangeTransport:bD,PDFDateString:Tb,PDFWorker:Ly,PermissionFlag:W9,PixelsPerInch:bc,RenderingCancelledException:YE,renderRichText:mD,ResponseException:Cb,setLayerDimensions:kd,shadow:Qe,SignatureExtractor:Go,stopEvent:ln,SupportedImageMimeTypes:h_,TextLayer:Nb,TouchManager:jb,updateUrlHash:dD,Util:pe,VerbosityLevel:$0,version:wD,XfaLayer:pD};const Q_e=Object.freeze(Object.defineProperty({__proto__:null,AbortException:vc,AnnotationEditorLayer:w_,AnnotationEditorParamsType:ot,AnnotationEditorType:$e,AnnotationEditorUIManager:Sd,AnnotationLayer:_D,AnnotationMode:qo,AnnotationType:En,CSSConstants:Q9,ColorPicker:Pb,DOMSVGFactory:Rb,DrawLayer:k_,FeatureTest:hr,GlobalWorkerOptions:sa,ImageKind:Ov,InvalidPDFException:d_,MathClamp:Wr,OPS:Oy,OutputScale:so,PDFDataRangeTransport:bD,PDFDateString:Tb,PDFWorker:Ly,PasswordResponses:H9,PermissionFlag:W9,PixelsPerInch:bc,RenderingCancelledException:YE,ResponseException:Cb,SignatureExtractor:Go,SupportedImageMimeTypes:h_,TextLayer:Nb,TouchManager:jb,Util:pe,VerbosityLevel:$0,XfaLayer:pD,applyOpacity:J9,build:nG,createValidAbsoluteUrl:uD,fetchData:rx,findContrastColor:eq,getDocument:vD,getFilenameFromUrl:Y9,getPdfFilenameFromUrl:X9,getRGB:sx,getUuid:hD,getXfaPageViewport:Z9,isDataScheme:V0,isPdfFile:XE,isValidExplicitDest:Iq,noContextMenu:Ii,normalizeUnicode:G9,renderRichText:mD,setLayerDimensions:kd,shadow:Qe,stopEvent:ln,updateUrlHash:dD,version:wD},Symbol.toStringTag,{value:"Module"}));var l5=Object.prototype.hasOwnProperty;function c5(t,e,n){for(n of t.keys())if(Rm(n,e))return n}function Rm(t,e){var n,r,s;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&Rm(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(s=r,s&&typeof s=="object"&&(s=c5(e,s),!s)||!e.has(s))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(s=r[0],s&&typeof s=="object"&&(s=c5(e,s),!s)||!Rm(r[1],e.get(s)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(l5.call(t,n)&&++r&&!l5.call(e,n)||!(n in e)||!Rm(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}function G0(t){let e=!1;return{promise:new Promise((r,s)=>{t.then(i=>!e&&r(i)).catch(i=>!e&&s(i))}),cancel(){e=!0}}}const J_e=["onCopy","onCut","onPaste"],eEe=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],tEe=["onFocus","onBlur"],nEe=["onInput","onInvalid","onReset","onSubmit"],rEe=["onLoad","onError"],sEe=["onKeyDown","onKeyPress","onKeyUp"],iEe=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],aEe=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],oEe=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],lEe=["onSelect"],cEe=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],uEe=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],dEe=["onScroll"],hEe=["onWheel"],fEe=["onAnimationStart","onAnimationEnd","onAnimationIteration"],pEe=["onTransitionEnd"],mEe=["onToggle"],gEe=["onChange"],yEe=[...J_e,...eEe,...tEe,...nEe,...rEe,...sEe,...iEe,...aEe,...oEe,...lEe,...cEe,...uEe,...dEe,...hEe,...fEe,...pEe,...gEe,...mEe];function n7(t,e){const n={};for(const r of yEe){const s=t[r];s&&(e?n[r]=i=>s(i,e(r)):n[r]=s)}return n}var xEe="Invariant failed";function Dt(t,e){if(!t)throw new Error(xEe)}var vEe=function(){},bEe=vEe;const qr=Sc(bEe),r7=k.createContext(null),wEe="noopener noreferrer nofollow";class kEe{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(e){this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setExternalLinkRel(e){this.externalLinkRel=e}setExternalLinkTarget(e){this.externalLinkTarget=e}setHash(){}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return Dt(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(e){Dt(this.pdfViewer),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}addLinkAttributes(e,n,r){e.href=n,e.rel=this.externalLinkRel||wEe,e.target=r?"_blank":this.externalLinkTarget||""}goToDestination(e){return new Promise(n=>{Dt(this.pdfDocument),Dt(e),typeof e=="string"?this.pdfDocument.getDestination(e).then(n):Array.isArray(e)?n(e):e.then(n)}).then(n=>{Dt(Array.isArray(n));const r=n[0];new Promise(s=>{Dt(this.pdfDocument),r instanceof Object?this.pdfDocument.getPageIndex(r).then(i=>{s(i)}).catch(()=>{Dt(!1)}):typeof r=="number"?s(r):Dt(!1)}).then(s=>{const i=s+1;Dt(this.pdfViewer),Dt(i>=1&&i<=this.pagesCount),this.pdfViewer.scrollPageIntoView({dest:n,pageIndex:s,pageNumber:i})})})}goToPage(e){const n=e-1;Dt(this.pdfViewer),Dt(e>=1&&e<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:n,pageNumber:e})}goToXY(){}cachePageRef(){}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}executeNamedAction(){}executeSetOCGState(){}isPageVisible(){return!0}isPageCached(){return!0}navigateTo(e){this.goToDestination(e)}}function Im({children:t,type:e}){return c.jsx("div",{className:`react-pdf__message react-pdf__message--${e}`,children:t})}const u5={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};function SEe(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function Fy(){return k.useReducer(SEe,{value:void 0,error:void 0})}const JE=typeof window<"u",s7=JE&&window.location.protocol==="file:";function _Ee(t){return typeof t<"u"}function Kd(t){return _Ee(t)&&t!==null}function EEe(t){return typeof t=="string"}function CEe(t){return t instanceof ArrayBuffer}function AEe(t){return Dt(JE),t instanceof Blob}function aP(t){return EEe(t)&&/^data:/.test(t)}function d5(t){Dt(aP(t));const[e="",n=""]=t.split(",");return e.split(";").indexOf("base64")!==-1?atob(n):unescape(n)}function TEe(){return JE&&window.devicePixelRatio||1}const i7="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function h5(){qr(!s7,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${i7}`)}
701function jEe(){qr(!s7,`Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ${i7}`)}function np(t){t!=null&&t.cancel&&t.cancel()}function oP(t,e){return Object.defineProperty(t,"width",{get(){return this.getViewport({scale:e}).width},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.getViewport({scale:e}).height},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.getViewport({scale:1}).width},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.getViewport({scale:1}).height},configurable:!0}),t}function a7(t){return t.name==="AbortException"||t.name==="RenderingCancelledException"}function NEe(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>{if(!r.result)return n(new Error("Error while reading a file."));e(r.result)},r.onerror=s=>{if(!s.target)return n(new Error("Error while reading a file."));const{error:i}=s.target;if(!i)return n(new Error("Error while reading a file."));switch(i.code){case i.NOT_FOUND_ERR:return n(new Error("Error while reading a file: File not found."));case i.SECURITY_ERR:return n(new Error("Error while reading a file: Security error."));case i.ABORT_ERR:return n(new Error("Error while reading a file: Aborted."));default:return n(new Error("Error while reading a file."))}},r.readAsArrayBuffer(t)})}const{PDFDataRangeTransport:PEe}=Q_e,REe=(t,e)=>{switch(e){case u5.NEED_PASSWORD:{const n=prompt("Enter the password to open this PDF file.");t(n);break}case u5.INCORRECT_PASSWORD:{const n=prompt("Invalid password. Please try again.");t(n);break}}};function f5(t){return typeof t=="object"&&t!==null&&("data"in t||"range"in t||"url"in t)}const IEe=k.forwardRef(function({children:e,className:n,error:r="Failed to load PDF file.",externalLinkRel:s,externalLinkTarget:i,file:a,inputRef:o,imageResourcesPath:l,loading:u="Loading PDF…",noData:d="No PDF file specified.",onItemClick:f,onLoadError:p,onLoadProgress:m,onLoadSuccess:y,onPassword:g=REe,onSourceError:b,onSourceSuccess:x,options:w,renderMode:v,rotate:S,scale:E,...C},T){const[P,M]=Fy(),{value:R,error:O}=P,[L,U]=Fy(),{value:B,error:H}=L,z=k.useRef(new kEe),V=k.useRef([]),$=k.useRef(void 0),I=k.useRef(void 0);a&&a!==$.current&&f5(a)&&(qr(!Rm(a,$.current),`File prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),$.current=a),w&&w!==I.current&&(qr(!Rm(w,I.current),`Options prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.`),I.current=w);const N=k.useRef({scrollPageIntoView:Ne=>{const{dest:tt,pageNumber:qe,pageIndex:pt=qe-1}=Ne;if(f){f({dest:tt,pageIndex:pt,pageNumber:qe});return}const Et=V.current[pt];if(Et){Et.scrollIntoView();return}qr(!1,`An internal link leading to page ${qe} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});k.useImperativeHandle(T,()=>({linkService:z,pages:V,viewer:N}),[]);function W(){x&&x()}function q(){O&&(qr(!1,O.toString()),b&&b(O))}function D(){M({type:"RESET"})}k.useEffect(D,[a,M]);const Q=k.useCallback(async()=>{if(!a)return null;if(typeof a=="string")return aP(a)?{data:d5(a)}:(h5(),{url:a});if(a instanceof PEe)return{range:a};if(CEe(a))return{data:a};if(JE&&AEe(a))return{data:await NEe(a)};if(Dt(typeof a=="object"),Dt(f5(a)),"url"in a&&typeof a.url=="string"){if(aP(a.url)){const{url:Ne,...tt}=a;return{data:d5(Ne),...tt}}h5()}return a},[a]);k.useEffect(()=>{const Ne=G0(Q());return Ne.promise.then(tt=>{M({type:"RESOLVE",value:tt})}).catch(tt=>{M({type:"REJECT",error:tt})}),()=>{np(Ne)}},[Q,M]),k.useEffect(()=>{if(!(typeof R>"u")){if(R===!1){q();return}W()}},[R]);function X(){B&&(y&&y(B),V.current=new Array(B.numPages),z.current.setDocument(B))}function se(){H&&(qr(!1,H.toString()),p&&p(H))}k.useEffect(function(){U({type:"RESET"})},[U,R]),k.useEffect(function(){if(!R)return;const tt=w?{...R,...w}:R,qe=vD(tt);m&&(qe.onProgress=m),g&&(qe.onPassword=g);const pt=qe;return pt.promise.then(Et=>{pt.destroyed||U({type:"RESOLVE",value:Et})}).catch(Et=>{pt.destroyed||U({type:"REJECT",error:Et})}),()=>{pt.destroy()}},[w,U,R]),k.useEffect(()=>{if(!(typeof B>"u")){if(B===!1){se();return}X()}},[B]),k.useEffect(function(){z.current.setViewer(N.current),z.current.setExternalLinkRel(s),z.current.setExternalLinkTarget(i)},[s,i]);const Y=k.useCallback((Ne,tt)=>{V.current[Ne]=tt},[]),de=k.useCallback(Ne=>{delete V.current[Ne]},[]),Ie=k.useMemo(()=>({imageResourcesPath:l,linkService:z.current,onItemClick:f,pdf:B,registerPage:Y,renderMode:v,rotate:S,scale:E,unregisterPage:de}),[l,f,B,Y,v,S,E,de]),_e=k.useMemo(()=>n7(C,()=>B),[C,B]);function Ee(){function Ne(qe){return!!(qe!=null&&qe.pdf)}if(!Ne(Ie))throw new Error("pdf is undefined");const tt=typeof e=="function"?e(Ie):e;return c.jsx(r7.Provider,{value:Ie,children:tt})}function xe(){return a?B==null?c.jsx(Im,{type:"loading",children:typeof u=="function"?u():u}):B===!1?c.jsx(Im,{type:"error",children:typeof r=="function"?r():r}):Ee():c.jsx(Im,{type:"no-data",children:typeof d=="function"?d():d})}return c.jsx("div",{className:Vy("react-pdf__Document",n),ref:o,..._e,children:xe()})});function o7(){return k.useContext(r7)}function l7(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Boolean);if(n.length<=1){var r=n[0];return r||null}return function(i){for(var a=0,o=n;a<o.length;a++){var l=o[a];typeof l=="function"?l(i):l&&(l.current=i)}}}const c7=k.createContext(null);function eC(){return k.useContext(c7)}function DEe(){const t=o7(),e=eC();Dt(e);const n={...t,...e},{filterAnnotations:r,imageResourcesPath:s,linkService:i,onGetAnnotationsError:a,onGetAnnotationsSuccess:o,onRenderAnnotationLayerError:l,onRenderAnnotationLayerSuccess:u,page:d,pdf:f,renderForms:p,rotate:m,scale:y=1}=n;Dt(f),Dt(d),Dt(i);const[g,b]=Fy(),{value:x,error:w}=g,v=k.useRef(null);qr(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function S(){x&&o&&o(x)}function E(){w&&(qr(!1,w.toString()),a&&a(w))}k.useEffect(function(){b({type:"RESET"})},[b,d]),k.useEffect(function(){if(!d)return;const R=G0(d.getAnnotations()),O=R;return R.promise.then(L=>{b({type:"RESOLVE",value:L})}).catch(L=>{b({type:"REJECT",error:L})}),()=>{np(O)}},[b,d]),k.useEffect(()=>{if(x!==void 0){if(x===!1){E();return}S()}},[x]);function C(){u&&u()}function T(M){qr(!1,`${M}`),l&&l(M)}const P=k.useMemo(()=>d.getViewport({scale:y,rotation:m}),[d,m,y]);return k.useEffect(function(){if(!f||!d||!i||!x)return;const{current:R}=v;if(!R)return;const O=P.clone({dontFlip:!0}),L={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,annotationStorage:f.annotationStorage,commentManager:null,div:R,l10n:null,linkService:i,page:d,structTreeLayer:null,viewport:O},U={annotations:r?r({annotations:x}):x,annotationStorage:f.annotationStorage,div:R,imageResourcesPath:s,linkService:i,page:d,renderForms:p,viewport:O};R.innerHTML="";try{new _D(L).render(U),C()}catch(B){T(B)}return()=>{}},[x,r,s,i,d,f,p,P]),c.jsx("div",{className:Vy("react-pdf__Page__annotations","annotationLayer"),ref:v})}const u7={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P
701:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},MEe=/^H(\d+)$/;function OEe(t){return t in u7}function tC(t){return"children"in t}function d7(t){return tC(t)?t.children.length===1&&0 in t.children&&"id"in t.children[0]:!1}function LEe(t){const e={};if(tC(t)){const{role:n}=t,r=n.match(MEe);if(r)e.role="heading",e["aria-level"]=Number(r[1]);else if(OEe(n)){const s=u7[n];s&&(e.role=s)}}return e}function h7(t){const e={};if(tC(t)){if(t.alt!==void 0&&(e["aria-label"]=t.alt),t.lang!==void 0&&(e.lang=t.lang),d7(t)){const[n]=t.children;if(n){const r=h7(n);return{...e,...r}}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function FEe(t){return t?{...LEe(t),...h7(t)}:null}function f7({className:t,node:e}){const n=k.useMemo(()=>FEe(e),[e]),r=k.useMemo(()=>!tC(e)||d7(e)?null:e.children.map((s,i)=>c.jsx(f7,{node:s},i)),[e]);return c.jsx("span",{className:t,...n,children:r})}function BEe(){const t=eC();Dt(t);const{onGetStructTreeError:e,onGetStructTreeSuccess:n}=t,[r,s]=Fy(),{value:i,error:a}=r,{customTextRenderer:o,page:l}=t;function u(){i&&n&&n(i)}function d(){a&&(qr(!1,a.toString()),e&&e(a))}return k.useEffect(function(){s({type:"RESET"})},[s,l]),k.useEffect(function(){if(o||!l)return;const p=G0(l.getStructTree()),m=p;return p.promise.then(y=>{s({type:"RESOLVE",value:y})}).catch(y=>{s({type:"REJECT",error:y})}),()=>np(m)},[o,l,s]),k.useEffect(()=>{if(i!==void 0){if(i===!1){d();return}u()}},[i]),i?c.jsx(f7,{className:"react-pdf__Page__structTree structTree",node:i}):null}const p5=qo;function $Ee(t){const e=eC();Dt(e);const n={...e,...t},{_className:r,canvasBackground:s,devicePixelRatio:i=TEe(),onRenderError:a,onRenderSuccess:o,page:l,renderForms:u,renderTextLayer:d,pageColors:f,rotate:p,scale:m}=n,{canvasRef:y}=t;Dt(l);const g=k.useRef(null);function b(){l&&o&&o(oP(l,m))}function x(E){a7(E)||(qr(!1,E.toString()),a&&a(E))}const w=k.useMemo(()=>l.getViewport({scale:m*i,rotation:p}),[i,l,p,m]),v=k.useMemo(()=>l.getViewport({scale:m,rotation:p}),[l,p,m]);k.useEffect(function(){if(!l)return;l.cleanup();const{current:C}=g;if(!C)return;C.width=w.width,C.height=w.height,C.style.width=`${Math.floor(v.width)}px`,C.style.height=`${Math.floor(v.height)}px`,C.style.visibility="hidden";const T={annotationMode:u?p5.ENABLE_FORMS:p5.ENABLE,canvas:C,canvasContext:C.getContext("2d",{alpha:!1}),pageColors:f,viewport:w};s&&(T.background=s);const P=l.render(T),M=P;return P.promise.then(()=>{C.style.visibility="",b()}).catch(x),()=>np(M)},[s,l,f,u,w,v]);const S=k.useCallback(()=>{const{current:E}=g;E&&(E.width=0,E.height=0)},[]);return k.useEffect(()=>S,[S]),c.jsx("canvas",{className:`${r}__canvas`,dir:"ltr",ref:l7(y,g),style:{display:"block",userSelect:"none"},children:d?c.jsx(BEe,{}):null})}function UEe(t){return"str"in t}const zEe=new Set(["base","embed","iframe","link","meta","object","script","style","template"]),VEe=new Set(["action","formaction","href","poster","src","xlink:href"]);function WEe(t){let e="";for(const n of t){const r=n.charCodeAt(0);r<=32||r===127||(e+=n.toLowerCase())}return e.startsWith("javascript:")||e.startsWith("vbscript:")}function HEe(t){return t.nodeType===Node.ELEMENT_NODE}function p7(t){return HEe(t)&&t instanceof HTMLElement}function qEe(t){return p7(t)&&zEe.has(t.tagName.toLowerCase())}function GEe(t){const e=document.createElement(t.tagName.toLowerCase());return Array.from(t.attributes).forEach(n=>{const r=n.name.toLowerCase();r.startsWith("on")||r==="srcdoc"||VEe.has(r)&&WEe(n.value)||e.setAttribute(n.name,n.value)}),Array.from(t.childNodes).forEach(n=>{e.append(m7(n))}),e}function m7(t){var e;return p7(t)&&!qEe(t)?GEe(t):document.createTextNode((e=t.textContent)!==null&&e!==void 0?e:"")}function KEe(t,e){const n=document.createElement("template");n.innerHTML=e;const r=document.createDocumentFragment();
701Array.from(n.content.childNodes).forEach(s=>{r.append(m7(s))}),t.replaceChildren(r)}function YEe(){const t=eC();Dt(t);const{customTextRenderer:e,onGetTextError:n,onGetTextSuccess:r,onRenderTextLayerError:s,onRenderTextLayerSuccess:i,page:a,pageIndex:o,pageNumber:l,rotate:u,scale:d}=t;Dt(a);const[f,p]=Fy(),{value:m,error:y}=f,g=k.useRef(null);qr(Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function b(){m&&r&&r(m)}function x(){y&&(qr(!1,y.toString()),n&&n(y))}k.useEffect(function(){p({type:"RESET"})},[a,p]),k.useEffect(function(){if(!a)return;const P=G0(a.getTextContent()),M=P;return P.promise.then(R=>{p({type:"RESOLVE",value:R})}).catch(R=>{p({type:"REJECT",error:R})}),()=>np(M)},[a,p]),k.useEffect(()=>{if(m!==void 0){if(m===!1){x();return}b()}},[m]);const w=k.useCallback(()=>{i&&i()},[i]),v=k.useCallback(T=>{a7(T)||(qr(!1,T.toString()),s&&s(T))},[s]);function S(){const T=g.current;T&&T.classList.add("selecting")}function E(){const T=g.current;T&&T.classList.remove("selecting")}const C=k.useMemo(()=>a.getViewport({scale:d,rotation:u}),[a,u,d]);return k.useLayoutEffect(function(){if(!a||!m)return;const{current:P}=g;if(!P)return;P.innerHTML="";const M=a.streamTextContent({includeMarkedContent:!0}),R={container:P,textContentSource:M,viewport:C},O=new Nb(R),L=O;return O.render().then(()=>{const U=document.createElement("div");U.className="endOfContent",P.append(U);const B=P.querySelectorAll('[role="presentation"]');if(e){let H=0;m.items.forEach((z,V)=>{if(!UEe(z))return;const $=B[H];if(!$)return;const I=e({pageIndex:o,pageNumber:l,itemIndex:V,...z});KEe($,I),H+=z.str&&z.hasEOL?2:1})}w()}).catch(v),()=>np(L)},[e,v,w,a,o,l,m,C]),c.jsx("div",{className:Vy("react-pdf__Page__textContent","textLayer"),onMouseUp:E,onMouseDown:S,ref:g})}const m5=1;function XEe(t){const n={...o7(),...t},{_className:r="react-pdf__Page",_enableRegisterUnregisterPage:s=!0,canvasBackground:i,canvasRef:a,children:o,className:l,customRenderer:u,customTextRenderer:d,devicePixelRatio:f,error:p="Failed to load the page.",filterAnnotations:m,height:y,inputRef:g,loading:b="Loading page…",noData:x="No page specified.",onGetAnnotationsError:w,onGetAnnotationsSuccess:v,onGetStructTreeError:S,onGetStructTreeSuccess:E,onGetTextError:C,onGetTextSuccess:T,onLoadError:P,onLoadSuccess:M,onRenderAnnotationLayerError:R,onRenderAnnotationLayerSuccess:O,onRenderError:L,onRenderSuccess:U,onRenderTextLayerError:B,onRenderTextLayerSuccess:H,pageColors:z,pageIndex:V,pageNumber:$,pdf:I,registerPage:N,renderAnnotationLayer:W=!0,renderForms:q=!1,renderMode:D="canvas",renderTextLayer:Q=!0,rotate:X,scale:se=m5,unregisterPage:Y,width:de,...Ie}=n,[_e,Ee]=Fy(),{value:xe,error:Ne}=_e,tt=k.useRef(null);Dt(I);const qe=Kd($)?$-1:V??null,pt=$??(Kd(V)?V+1:null),Et=X??(xe?xe.rotate:null),Bt=k.useMemo(()=>{if(!xe)return null;let De=1;const Ge=se??m5;if(de||y){const $t=xe.getViewport({scale:1,rotation:Et});de?De=de/$t.width:y&&(De=y/$t.height)}return Ge*De},[y,xe,Et,se,de]);k.useEffect(function(){return()=>{Kd(qe)&&s&&Y&&Y(qe)}},[s,I,qe,Y]);function Pr(){if(M){if(!xe||!Bt)return;M(oP(xe,Bt))}if(s&&N){if(!Kd(qe)||!tt.current)return;N(qe,tt.current)}}function Oi(){Ne&&(qr(!1,Ne.toString()),P&&P(Ne))}k.useEffect(function(){Ee({type:"RESET"})},[Ee,I,qe]),k.useEffect(function(){if(!I||!pt)return;const Ge=G0(I.getPage(pt)),$t=Ge;return Ge.promise.then(pr=>{Ee({type:"RESOLVE",value:pr})}).catch(pr=>{Ee({type:"REJECT",error:pr})}),()=>np($t)},[Ee,I,pt]),k.useEffect(()=>{if(xe!==void 0){if(xe===!1){Oi();return}Pr()}},[xe,Bt]);const ks=k.useMemo(()=>Kd(qe)&&pt&&Kd(Et)&&Kd(Bt)?{_className:r,canvasBackground:i,customTextRenderer:d,devicePixelRatio:f,filterAnnotations:m,onGetAnnotationsError:w,onGetAnnotationsSuccess:v,onGetStructTreeError:S,onGetStructTreeSuccess:E,onGetTextError:C,onGetTextSuccess:T,onRenderAnnotationLayerError:R,onRenderAnnotationLayerSuccess:O,onRenderError:L,onRenderSuccess:U,onRenderTextLayerError:B,onRenderTextLayerSuccess:H,page:xe,pageColors:z,pageIndex:qe,pageNumber:pt,renderForms:q,renderTextLayer:Q,rotate:Et,scale:Bt}
701:null,[r,i,d,f,m,w,v,S,E,C,T,R,O,L,U,B,H,xe,z,qe,pt,q,Q,Et,Bt]),ll=k.useMemo(()=>n7(Ie,()=>xe&&(Bt?oP(xe,Bt):void 0)),[Ie,xe,Bt]),fr=`${qe}@${Bt}/${Et}`;function cl(){switch(D){case"custom":return Dt(u),c.jsx(u,{},`${fr}_custom`);case"none":return null;case"canvas":default:return c.jsx($Ee,{canvasRef:a},`${fr}_canvas`)}}function va(){return Q?c.jsx(YEe,{},`${fr}_text`):null}function G(){return W?c.jsx(DEe,{},`${fr}_annotations`):null}function ee(){function De($t){return!!($t!=null&&$t.page)}if(!De(ks))throw new Error("page is undefined");const Ge=typeof o=="function"?o(ks):o;return c.jsxs(c7.Provider,{value:ks,children:[cl(),va(),G(),Ge]})}function Pe(){return pt?I===null||xe===void 0||xe===null?c.jsx(Im,{type:"loading",children:typeof b=="function"?b():b}):I===!1||xe===!1?c.jsx(Im,{type:"error",children:typeof p=="function"?p():p}):ee():c.jsx(Im,{type:"no-data",children:typeof x=="function"?x():x})}return c.jsx("div",{className:Vy(r,l),"data-page-number":pt,ref:l7(g,tt),style:{"--scale-round-x":"1px","--scale-round-y":"1px","--scale-factor":"1","--user-unit":`${Bt}`,"--total-scale-factor":"calc(var(--scale-factor) * var(--user-unit))",backgroundColor:i||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"},...ll,children:Pe()})}jEe();sa.workerSrc="pdf.worker.mjs";sa.workerSrc=`https://unpkg.com/pdfjs-dist@${wD}/build/pdf.worker.min.mjs`;function ZEe({url:t}){const[e,n]=k.useState(0),[r,s]=k.useState(1),[i,a]=k.useState(0),o=k.useRef(null);return k.useEffect(()=>{const l=()=>{o.current&&a(o.current.clientWidth)};l();const u=new ResizeObserver(l);return o.current&&u.observe(o.current),()=>u.disconnect()},[]),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{ref:o,className:"flex min-h-[420px] w-full items-center justify-center overflow-auto bg-background p-3",children:c.jsx(IEe,{file:t,onLoadSuccess:({numPages:l})=>n(l),loading:c.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[c.jsx(ap,{className:"size-4 animate-spin"})," Loading preview…"]}),error:c.jsxs("p",{className:"p-6 text-sm text-muted-foreground",children:["Preview unavailable —"," ",c.jsx("a",{className:"text-primary underline",href:t,target:"_blank",rel:"noopener noreferrer",children:"download the sample PDF"}),"."]}),children:i>0&&c.jsx(XEe,{pageNumber:r,width:Math.min(i-24,900),renderAnnotationLayer:!1,renderTextLayer:!1})})}),e>0&&c.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border/40 bg-muted/40 px-3 py-2 text-xs",children:[c.jsxs("button",{type:"button",onClick:()=>s(l=>Math.max(1,l-1)),disabled:r<=1,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 font-semibold text-foreground hover:bg-muted disabled:opacity-40",children:[c.jsx(uZ,{className:"size-4"})," Prev"]}),c.jsxs("span",{className:"text-muted-foreground",children:["Page ",r," of ",e]}),c.jsxs("button",{type:"button",onClick:()=>s(l=>Math.min(e,l+1)),disabled:r>=e,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 font-semibold text-foreground hover:bg-muted disabled:opacity-40",children:["Next ",c.jsx(dZ,{className:"size-4"})]})]})]})}function QEe(){var O,L;const{slug:t}=OR(),{report:e,isLoading:n}=pke(t),{add:r,has:s}=B0(),[i,a]=k.useState(null),[o,l]=k.useState("single"),[u,d]=k.useState(null),[f,p]=k.useState(!1),[m,y]=k.useState(!1);k.useEffect(()=>{p(z9())},[]);const{reports:g}=qE({published:!0,region:e==null?void 0:e.region});if(k.useEffect(()=>{e&&(OE(e.cover_image_url).then(a),ipe(e.sample_pdf_url).then(d))},[e]),n)return c.jsx("div",{className:"flex min-h-screen items-center justify-center",children:c.jsx(ap,{className:"size-8 animate-spin text-muted-foreground"})});if(!e)return c.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 p-6 text-center",children:[c.jsx("p",{className:"font-serif text-2xl",children:"Report not found"}),c.jsx(rt,{to:"/reports",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-accent",children:"← Back to the store"})]});const b=s(e.id),x=u||Jfe(e.region),w=!u,v=`https://waterdispenseinsights.com/reports/${e.slug}`,S=DI(e.region),E=MI(e.region),C=jH(e.region),T=`mailto:${ld}?subject=${encodeURIComponent(`${NH}
701: ${e.title}`)}&body=${encodeURIComponent(`Hi Ákos,
702
703I'd like to discuss the ${e.title}. Could we set up a call?
704
705Thanks,`)}`,P={"@context":"https://schema.org","@type":"Product",name:e.title,description:e.short_description||e.subtitle,...i&&{image:i},brand:{"@type":"Organization",name:"Zenith Global Commercial"},offers:{"@type":"Offer",url:v,priceCurrency:e.currency.toUpperCase(),price:(e.price_cents/100).toFixed(2),availability:"https://schema.org/InStock"}},M={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Reports",item:"https://waterdispenseinsights.com/reports"},{"@type":"ListItem",position:2,name:e.title,item:v}]},R=g.filter(U=>U.id!==e.id).slice(0,3);return c.jsxs(c.Fragment,{children:[c.jsxs(xs,{children:[c.jsx("title",{children:e.seo_title||`${e.title} | Zenith`}),c.jsx("meta",{name:"description",content:e.seo_description||e.short_description||`${e.title} — water dispense market intelligence from Zenith.`}),c.jsx("link",{rel:"canonical",href:v}),c.jsx("meta",{property:"og:title",content:e.seo_title||e.title}),c.jsx("meta",{property:"og:description",content:e.seo_description||e.short_description||""}),c.jsx("meta",{property:"og:url",content:v}),c.jsx("meta",{property:"og:type",content:"product"}),i&&c.jsx("meta",{property:"og:image",content:i}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify(P)}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify(M)})]}),c.jsx(cD,{}),c.jsxs("main",{className:"min-h-screen bg-background",children:[c.jsxs("div",{className:"container mx-auto flex flex-wrap items-center gap-x-4 gap-y-2 px-6 pt-8",children:[c.jsxs(rt,{to:"/reports",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-muted-foreground hover:text-primary",children:[c.jsx(lR,{className:"size-4"})," All reports"]}),(()=>{const U=_b.find(B=>oD(B,e));return U?c.jsxs(rt,{to:`/${U.slug}`,className:"text-sm font-semibold text-primary hover:text-accent",children:[U.h1," overview →"]}):null})()]}),c.jsxs("div",{className:"container mx-auto grid gap-10 px-6 py-10 lg:grid-cols-[1fr_360px]",children:[c.jsxs("article",{children:[c.jsxs(xt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:[.25,.4,.25,1]},children:[c.jsx("span",{className:"inline-flex items-center rounded-full bg-accent px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.2em] text-accent-foreground",children:lm(e.region,e.country)}),c.jsx("h1",{className:"mt-4 font-serif text-3xl leading-tight tracking-tight text-foreground sm:text-4xl md:text-5xl",children:e.title}),e.subtitle&&c.jsx("p",{className:"mt-3 text-lg text-muted-foreground",children:e.subt
705itle})]}),c.jsx(xt.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.7,delay:.15},className:"mt-8 aspect-[16/10] w-full overflow-hidden rounded-2xl border border-border/60 bg-gradient-to-br from-primary via-primary to-primary-dark shadow-elegant",children:i?c.jsx("img",{src:i,alt:`${e.title} cover`,className:"h-full w-full object-cover"}):c.jsx("div",{className:"flex h-full w-full items-center justify-center p-8 text-center text-primary-foreground",children:c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.25em] text-accent",children:"Zenith Executive Report"}),c.jsx("p",{className:"mt-4 font-serif text-3xl leading-tight",children:e.title})]})})}),S&&c.jsxs(xt.section,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6,delay:.2},className:"mt-8",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.2em] text-accent",children:"Regional Power BI"}),c.jsx("h2",{className:"mt-1 font-serif text-2xl",children:"See the dashboard in action"}),c.jsx("div",{className:"mt-4 aspect-video w-full max-w-md overflow-hidden rounded-xl border border-border/60 shadow-elegant",children:c.jsx("iframe",{width:"100%",height:"100%",src:"https://www.youtube.com/embed/sZTis65kA1w?autoplay=1&mute=1&loop=1&playlist=sZTis65kA1w&rel=0&modestbranding=1&controls=1&disablekb=1&showinfo=0",title:"Zenith Water Dispense Power BI Dashboard",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})]}),e.market_overview&&c.jsxs("section",{className:"mt-10",children:[c.jsxs("h2",{className:"font-serif text-2xl",children:[lm(e.region,e.country)," Water Dispenser Market Overview"]}),c.jsx("div",{className:"mt-4 space-y-4 text-foreground/90",children:e.market_overview.split(/\n{2,}/).map((U,B)=>c.jsx("p",{children:U},B))})]}),e.long_description&&c.jsx("section",{className:"prose prose-lg mt-10 max-w-none whitespace-pre-wrap text-foreground/90",children:e.long_description}),((O=e.highlights)==null?void 0:O.length)>0&&c.jsxs("section",{className:"mt-10",children:[c.jsx("h2",{className:"font-serif text-2xl",children:"What's inside"}),c.jsx("ul",{className:"mt-4 space-y-2",children:e.highlights.map((U,B)=>c.jsxs("li",{className:"flex items-start gap-3 text-foreground",children:[c.jsx(oa,{className:"mt-1 size-4 shrink-0 text-accent"}),c.jsx("span",{children:U})]},B))})]}),Array.isArray(e.contents)&&e.contents.length>0&&c.jsxs("section",{className:"mt-12",children:[c.jsx("h2",{className:"font-serif text-2xl",children:"Table of contents"}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Every chart, table and metric included in this report."}),c.jsx("div",{className:"mt-5 space-y-6",children:e.contents.map((U,B)=>c.jsxs("div",{className:"rounded-xl border border-border/60 bg-card p-5",children:[c.jsx("h3",{className:"font-serif text-lg text-primary",children:U.section}),c.jsx("ul",{className:"mt-3 grid gap-1.5 sm:grid-cols-2",children:U.items.map((H,z)=>c.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground/85",children:[c.jsx("span",{className:"mt-2 size-1.5 shrink-0 rounded-full bg-accent"}),c.jsx("span",{children:H})]},z))})]},B))})]}),x&&c.jsxs("section",{className:"mt-10 rounded-2xl border border-border/60 bg-muted/30 p-6",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.2em] text-accent",children:"Sample"}),c.jsx("h3",{className:"mt-1 font-serif text-xl",children:w?`Download a sample ${e.region==="data"?"data":"country"} report`:"Preview a redacted sample"}),c.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:f?"See structure, methodology and data depth before you buy.":"Enter your name, company and email to unlock the sample."})]}),f?c.jsxs("a",{href:x,target:"_blank",rel:"noopener noreferrer",download:!0,className:"inline-flex items-center gap-2 rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground hover:bg-primary/90",children:[c.jsx(ds,{className:"size-4"})," Download sample PDF"]}):c.jsxs("button",{type:"button",onClick:()=>y(!0),className:"inline-flex items-center gap-2 rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground hover:bg-primary/90",children:[c.jsx(ds,{className:"size-4"})," Unlock sample PDF"]})]}),f&&c.jsx("div",{className:"mt-4 overflow-hidden rounded-lg border border-border/40 bg-background",children:c.jsx(ZEe,{url:x})}),c.jsx(V9,{open:m,onOpenChange:y,onGranted:()=>{p(!0),window.open(x,"_blank","noopener,noreferrer")},sampleLabel:e.title})]}),c.jsx("div",{className:"mt-12",children:c.jsx(B9,{})}),R.length>0&&c.jsxs("section",{className:"mt-16",children:[c.jsx("h2",{className:"font-serif text-2xl",children:"Related reports"}),c.jsx("div",{className:"mt-4 grid gap-4 sm:grid-cols-2",children:R.map(U=>c.jsxs(rt,{to:`/reports/${U.slug}`,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center justify-between gap-4 roun
705ded-xl border border-border/60 bg-card p-4 transition-colors hover:border-primary/40",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-accent",children:lm(U.region,U.country)}),c.jsx("p",{className:"mt-1 font-serif text-base group-hover:text-primary",children:U.title})]}),c.jsx(Jn,{className:"size-4 shrink-0 text-muted-foreground group-hover:text-primary"})]},U.id))})]})]}),c.jsx("aside",{className:"lg:sticky lg:top-6 lg:h-fit",children:C?c.jsxs("div",{className:"rounded-2xl border border-border bg-card p-6 shadow-elegant",children:[c.jsxs("p",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/10 px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.2em] text-primary",children:[c.jsx(dR,{className:"size-3"})," ",S?"Regional bundle":"Available on request"]}),c.jsx("p",{className:"mt-3 font-serif text-2xl leading-tight text-primary",children:S?"Scoped to your team's needs":"Excel delivery + qualitative insights"}),c.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:S?"Bundles are tailored — coverage, licence, and support are quoted per engagement. Book a short call or drop us a line.":`The ${lm(e.region,e.country)} market is delivered on request. Tell us what you need — Excel database and qualitative insights are scoped to your brief.`}),S&&c.jsxs("div",{className:"mt-5 space-y-2 text-sm",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Included with every bundle"}),spe.map(U=>c.jsxs("p",{className:"flex items-start gap-2 text-foreground",children:[c.jsx(oa,{className:"mt-0.5 size-4 shrink-0 text-accent"}),c.jsx("span",{children:U})]},U))]}),E&&c.jsxs("div",{className:"mt-5 space-y-2 text-sm",children:[c.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"What you can request"}),c.jsxs("p",{className:"flex items-start gap-2 text-foreground",children:[c.jsx(ky,{className:"mt-0.5 size-4 shrink-0 text-accent"}),c.jsx("span",{children:"Full Excel database (revenue, volume, pricing)"})]}),c.jsxs("p",{className:"flex items-start gap-2 text-foreground",children:[c.jsx(ds,{className:"mt-0.5 size-4 shrink-0 text-accent"}),c.jsx("span",{children:"Qualitative insights and market commentary"})]}),c.jsxs("p",{className:"flex items-start gap-2 text-foreground",children:[c.jsx(oa,{className:"mt-0.5 size-4 shrink-0 text-accent"}),c.jsx("span",{children:"Scoped to the questions your team needs answered"})]})]}),c.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[c.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer",children:c.jsxs(oe,{size:"lg",className:"w-full",children:[c.jsx(fc,{className:"mr-2 size-4"})," Email us for a quote"]})}),c.jsxs("a",{href:"https://www.linkedin.com/in/akospetri/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex w-full items-center justify-center gap-2 rounded-md border border-border bg-background px-4 py-2.5 text-sm font-semibold text-foreground hover:bg-muted",children:[c.jsx(hc,{className:"size-4"})," DM Ákos for quick questions"]}),c.jsxs("p",{className:"mt-1 text-center text-xs text-muted-foreground",children:["or write to ",c.jsx("a",{className:"text-primary underline",href:`mailto:${ld}`,target:"_blank",rel:"noopener noreferrer",children:ld})]})]})]}):c.jsxs("div",{className:"rounded-2xl border border-border bg-card p-6 shadow-elegant",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.2em] text-muted-foreground",children:"Digital delivery within 24 hours"}),c.jsx("p",{className:"mt-2 font-serif text-4xl font-bold text-primary",children:bd(jv(e.price_cents,o),e.currency)}),c.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"One-time purchase · sent by email within 24 hours of checkout"}),c.jsxs("div",{className:"mt-5 space-y-2 text-sm",children:[c.jsxs("p",{className:"flex items-center gap-2 text-foreground",children:[c.jsx(ds,{className:"size-4 text-accent"})," PDF report"]}),e.includes_excel&&c.jsxs("p",{className:"flex items-center gap-2 text-foreground",children:[c.jsx(ky,{className:"size-4 text-accent"})," Full Excel database"]}),e.includes_powerbi&&c.jsxs("p",{className:"flex items-center gap-2 text-foreground",children:[c.jsx(lE,{className:"size-4 text-accent"})," Regional Power BI dashboard"]}),e.page_count&&c.jsxs("p",{className:"flex items-center gap-2 text-foreground",children:[c.jsx(ds,{className:"size-4 text-accent"})," ",e.page_count," pages"]})]}),c.jsxs("div",{className:"mt-6",children:[c.jsx("label",{className:"mb-1.5 block text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Licence type"}),c.jsxs(Nv,{value:o,onValueChange:U=>l(U),children:[c.jsx(Am,{className:"w-full",children:c.jsx(Pv,{})}),c.jsx(Tm,{children:yb.map(U=>c.jsxs(jm,{value:U.id,children:[c.jsx("span",{className:"font-medium",children:U.label}),c.jsxs("span",{className:"ml-2 text-muted-foreground",children:["— ",bd(jv(e.price_cents,U.id),e.currency)]})]},U.id))})]}),c.jsx("p",{className:"mt-1.5 text-xs text-muted-foreground",children:(L=yb.find(U=>U.id===o))==null?void 0:L.description})]}),c.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[c.jsx(oe,{size:"lg",variant:b?"secondary":"default",className:"w-full",onClick:()=>{r({reportId:e.id,slug:e.slug,title:e.title,basePriceCents:e.price_cents,currency:e.currency,coverPath:e.cover_image_url,licence:o})},children:b?c.jsxs(c.Fragment,{children:[c.jsx(oa,{className:"mr-2 size-4"})," Update basket"]}):c.jsxs(c.Fragment,{children:[c.jsx(mR,{className:"mr-2 size-4"})," Add to basket"]})}),c.jsx(rt,{to:"/reports/cart",target:"_blank",rel:"noopener noreferrer",className:"text-center text-sm font-semibold text-primary hover:text-accent",children:"Go to checkout →"}),c.jsxs("a",{href:"https://www.linkedin.com/in/akospetri/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex w-full items-center justify-center gap-2 rounded-md border border-border bg-background px-4 py-2.5 text-sm font-semibold text-foreground hover:bg-muted",children:[c.jsx(hc,{className:"size-4"})," DM Ákos for quick questions"]})]})]})})]}),c.jsx("div",{className:"container mx-auto px-6 pb-12",children:c.jsx($9,{})}),c.jsx(F9,{}),c.jsx(Cc,{})]}),c.jsx(lD,{})]})}var g7={exports:{}},JEe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",eCe=JEe,tCe=eCe;function y7(){}function x7(){}x7.resetWarningCache=y7;var nCe=function(){function t(r,s,i,a,o,l){if(l!==tCe){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:x7,resetWarningCache:y7};return n.PropTypes=n,n};g7.exports=nCe();var rCe=g7.exports;const Cn=Sc(rCe);function g5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function y5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};
vendor: 4,998 bytes, lines 705-706
705e%2?g5(Object(n),!0).forEach(function(r){v7(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rS(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rS=function(e){return typeof e}:rS=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rS(t)}function v7(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sCe(t,e){if(t==null)return{};var n={},r=Object.keys(t),s,i;for(i=0;i<r.length;i++)s=r[i],!(e.indexOf(s)>=0)&&(n[s]=t[s]);return n}function iCe(t,e){if(t==null)return{};var n=sCe(t,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function b7(t,e){return aCe(t)||oCe(t,e)||lCe(t,e)||cCe()}function aCe(t){if(Array.isArray(t))return t}function oCe(t,e){var n=t&&(typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"]);if(n!=null){var r=[],s=!0,i=!1,a,o;try{for(n=n.call(t);!(s=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));s=!0);}catch(l){i=!0,o=l}finally{try{!s&&n.return!=null&&n.return()}finally{if(i)throw o}}return r}}function lCe(t,e){if(t){if(typeof t=="string")return x5(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x5(t,e)}}function x5(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function cCe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
706In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var es=function(e,n,r){var s=!!r,i=K.useRef(r);K.useEffect(function(){i.current=r},[r]),K.useEffect(function(){if(!s||!e)return function(){};var a=function(){i.current&&i.current.apply(i,arguments)};return e.on(n,a),function(){e.off(n,a)}},[s,n,e,i])},lP=function(e){var n=K.useRef(e);return K.useEffect(function(){n.current=e},[e]),n.current},By=function(e){return e!==null&&rS(e)==="object"},uCe=function(e){return By(e)&&typeof e.then=="function"},dCe=function(e){return By(e)&&typeof e.elements=="function"&&typeof e.createToken=="function"&&typeof e.createPaymentMethod=="function"&&typeof e.confirmCardPayment=="function"},v5="[object Object]",hCe=function t(e,n){if(!By(e)||!By(n))return e===n;var r=Array.isArray(e),s=Array.isArray(n);if(r!==s)return!1;var i=Object.prototype.toString.call(e)===v5,a=Object.prototype.toString.call(n)===v5;if(i!==a)return!1;if(!i&&!r)return e===n;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(var u={},d=0;d<o.length;d+=1)u[o[d]]=!0;for(var f=0;f<l.length;f+=1)u[l[f]]=!0;var p=Object.keys(u);if(p.length!==o.length)return!1;var m=e,y=n,g=function(x){return t(m[x],y[x])};return p.every(g)},fCe=function(e,n,r){return By(e)?Object.keys(e).reduce(function(s,i){var a=!By(n)||!hCe(e[i],n[i]);return r.includes(i)?(a&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),s):a?y5(y5({},s||{}),{},v7({},i,e[i])):s},null):null},w7="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",b5=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w7;if(e===null||dCe(e))return e;throw new Error(n)},pCe=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w7;if(uCe(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(s){return b5(s,n)})};var r=b5(e,n);return r===null?{tag:"empty"}:{tag:"sync",stripe:r}},mCe=function(e){!e||!e._registerWrapper||!e.registerAppInfo||(e._registerWrapper({name:"react-stripe-js",version:"6.2.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.2.0",url:"https://stripe.com/docs/stripe-js/react"}))},k7=K.createContext(null);k7.displayName="ElementsContext";var gCe=function(e,n){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return e};Cn.any,Cn.object;Cn.func.isRequired;var S7=K.createContext(null);S7.displayName="CheckoutContext";var w5=function(e){var n=K.useContext(S7),r=K.useContext(k7);if(n){if(r)throw new Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."));return n}else return gCe(r,e)},yCe=["mode"],xCe=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Wn=function(e,n,r){var s="".concat(xCe(e),"Element"),i=function(u){var d=u.id,f=u.className,p=u.options,m=p===void 0?{}
706:p,y=u.onBlur,g=u.onFocus,b=u.onReady,x=u.onChange,w=u.onEscape,v=u.onClick,S=u.onLoadError,E=u.onLoaderStart,C=u.onNetworksChange,T=u.onConfirm,P=u.onCancel,M=u.onShippingAddressChange,R=u.onShippingRateChange,O=u.onSavedPaymentMethodRemove,L=u.onSavedPaymentMethodUpdate,U=w5("mounts <".concat(s,">")),B="elements"in U?U.elements:null,H="checkoutState"in U?U.checkoutState:null,z=(H==null?void 0:H.type)==="success"||(H==null?void 0:H.type)==="loading"?H.sdk:null,V=K.useState(null),$=b7(V,2),I=$[0],N=$[1],W=K.useRef(null),q=K.useRef(null);es(I,"blur",y),es(I,"focus",g),es(I,"escape",w),es(I,"click",v),es(I,"loaderror",S),es(I,"loaderstart",E),es(I,"networkschange",C),es(I,"confirm",T),es(I,"cancel",P),es(I,"shippingaddresschange",M),es(I,"shippingratechange",R),es(I,"savedpaymentmethodremove",O),es(I,"savedpaymentmethodupdate",L),es(I,"change",x);var D;b&&(e==="expressCheckout"?D=b:D=function(){b(I)}),es(I,"ready",D),K.useLayoutEffect(function(){if(W.current===null&&q.current!==null&&(B||z)){var X=null;if(z){var se=z,Y=z;switch(e){case"paymentForm":X=Y.createForm(m);break;case"payment":X=se.createPaymentElement(m);break;case"address":if("mode"in m){var de=m.mode,Ie=iCe(m,yCe);if(de==="shipping")X=se.createShippingAddressElement(Ie);else if(de==="billing")X=se.createBillingAddressElement(Ie);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":X=se.createExpressCheckoutElement(m);break;case"currencySelector":X=z.createCurrencySelectorElement();break;case"taxId":X=se.createTaxIdElement(m);break;case"contactDetails":X=se.createContactDetailsElement();break;default:throw new Error("<".concat(s,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else B&&(X=B.create(e,m));W.current=X,N(X),X&&X.mount(q.current)}},[B,z,m]);var Q=lP(m);return K.useEffect(function(){if(W.current){var X=fCe(m,Q,["paymentRequest"]);X&&"update"in W.current&&W.current.update(X)}},[m,Q]),K.useLayoutEffect(function(){return function(){if(W.current&&typeof W.current.destroy=="function")try{W.current.destroy(),W.current=null}catch{}}},[]),K.createElement("div",{id:d,className:f,ref:q})},a=function(u){w5("mounts <".concat(s,">"));var d=u.id,f=u.className;return K.createElement("div",{id:d,className:f})},o=n?a:i;return o.propTypes={id:Cn.string,className:Cn.string,onChange:Cn.func,onBlur:Cn.func,onFocus:Cn.func,onReady:Cn.func,onEscape:Cn.func,onClick:Cn.func,onLoadError:Cn.func,onLoaderStart:Cn.func,onNetworksChange:Cn.func,onConfirm:Cn.func,onCancel:Cn.func,onShippingAddressChange:Cn.func,onShippingRateChange:Cn.func,onSavedPaymentMethodRemove:Cn.func,onSavedPaymentMethodUpdate:Cn.func,options:Cn.object},o.displayName=s,o.__elementType=e,o},In=typeof window>"u",AD=K.createContext(null);AD.displayName="EmbeddedCheckoutProviderContext";var _7=function(){var e=K.useContext(AD);if(!e)throw new Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");return e},vCe="Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",bCe=function(e){var n=e.stripe,r=e.options,s=e.children,i=K.useMemo(function(){return pCe(n,vCe)},[n]),a=K.useRef(null),o=K.useRef(null),l=K.useState({embeddedCheckout:null}),u=b7(l,2),d=u[0],f=u[1];K.useEffect(function(){if(!(o.current||a.current)){var y=function(b){o.current||a.current||(o.current=b,a.current=o.current.createEmbeddedCheckoutPage(r).then(function(x){f({embeddedCheckout:x})}))};i.tag==="async"&&!o.current&&(r.clientSecret||r.fetchClientSecret)?i.stripePromise.then(function(g){g&&y(g)}):i.tag==="sync"&&!o.current&&(r.clientSecret||r.fetchClientSecret)&&y(i.stripe)}},[i,r,d,o]),K.useEffect(function(){return function(){d.embeddedCheckout?(a.current=null,d.embeddedCheckout.destroy()):a.current&&a.current.then(function(){a.current=null,d.embeddedCheckout&&d.embeddedCheckout.destroy()})}},[d.embeddedCheckout]),K.useEffect(function(){mCe(o)},[o]);var p=lP(n);K.useEffect(function(){p!==null&&p!==n&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.")},[p,n]);var m=lP(r);return K.useEffect(function(){if(m!=null){if(r==null){console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");return}r.clientSecret===void 0&&r.fetchClientSecret===void 0&&console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."),m.clientSecret!=null&&r.clientSecret!==m.clientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),m.fetchClientSecret!=null&&r.fetchClientSecret!==m.fetchClientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),m.onComplete!=null&&r.onComplete!==m.onComplete&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."),m.onShippingDetailsChange!=null&&r.onShippingDetailsChange!==m.onShippingDetailsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."),m.onLineItemsChange!=null&&r.onLineItemsChange!==m.onLineItemsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.")}},[m,r]),K.createElement(AD.Provider,{value:d},s)},wCe=function(e){var n=e.id,r=e.className,s=_7(),i=s.embeddedCheckout,a=K.useRef(!1),o=K.useRef(null);return K.useLayoutEffect(function(){return!a.current&&i&&o.current!==null&&(i.mount(o.current),a.current=!0),function(){if(a.current&&i)try{i.unmount(),a.current=!1}catch{}}},[i]),K.createElement("div",{ref:o,id:n,className:r})},kCe=function(e){var n=e.id,r=e.className;return _7(),K.createElement("div",{id:n,className:r})},SCe=In?kCe:wCe;Wn("auBankAccount",In);
vendor: 3,383 bytes, line 706
706Wn("card",In);Wn("cardNumber",In);Wn("cardExpiry",In);Wn("cardCvc",In);Wn("iban",In);Wn("payment",In);Wn("expressCheckout",In);Wn("paymentRequestButton",In);Wn("linkAuthentication",In);Wn("contactDetails",In);Wn("address",In);Wn("shippingAddress",In);Wn("paymentMethodMessaging",In);Wn("taxId",In);Wn("issuingCardNumberDisplay",In);Wn("issuingCardCvcDisplay",In);Wn("issuingCardExpiryDisplay",In);Wn("issuingCardPinDisplay",In);Wn("issuingCardCopyButton",In);function sS(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?sS=function(e){return typeof e}:sS=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sS(t)}var E7="dahlia",_Ce=function(e){return e===3?"v3":e},C7="https://js.stripe.com",ECe="".concat(C7,"/").concat(E7,"/stripe.js"),CCe=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,ACe=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,k5="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",TCe=function(e){return CCe.test(e)||ACe.test(e)},jCe=function(){for(var e=document.querySelectorAll('script[src^="'.concat(C7,'"]')),n=0;n<e.length;n++){var r=e[n];if(TCe(r.src))return r}return null},S5=function(e){var n="",r=document.createElement("script");r.src="".concat(ECe).concat(n);var s=document.head||document.body;if(!s)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return s.appendChild(r),r},NCe=function(e,n){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"9.2.0",startTime:n})},Dx=null,K1=null,Y1=null,PCe=function(e){return function(n){e(new Error("Failed to load Stripe.js",{cause:n}))}},RCe=function(e,n){return function(){window.Stripe?e(window.Stripe):n(new Error("Stripe.js not available"))}},ICe=function(e){return Dx!==null?Dx:(Dx=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&e&&console.warn(k5),window.Stripe){n(window.Stripe);return}try{var s=jCe();if(s&&e)console.warn(k5);else if(!s)s=S5(e);else if(s&&Y1!==null&&K1!==null){var i;s.removeEventListener("load",Y1),s.removeEventListener("error",K1),(i=s.parentNode)===null||i===void 0||i.removeChild(s),s=S5(e)}Y1=RCe(n,r),K1=PCe(r),s.addEventListener("load",Y1),s.addEventListener("error",K1)}catch(a){r(a);return}}),Dx.catch(function(n){return Dx=null,Promise.reject(n)}))},DCe=function(e,n,r){if(e===null)return null;var s=n[0];if(typeof s!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(sS(s)," instead."));var i=s.match(/^pk_test/),a=_Ce(e.version),o=E7;i&&a!==o&&console.warn("Stripe.js@".concat(a," was loaded on the page, but @stripe/stripe-js@").concat("9.2.0"," expected Stripe.js@").concat(o,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var l=e.apply(void 0,n);return NCe(l,r),l},Mx,A7=!1,T7=function(){return Mx||(Mx=ICe(null).catch(function(e){return Mx=null,Promise.reject(e)}),Mx)};Promise.resolve().then(function(){return T7()}).catch(function(t){A7||console.warn(t)});var MCe=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];A7=!0;var s=Date.now();return T7().then(function(i){return DCe(i,n,s)})};
706const rh="pk_live_51MwpTSC5PotsabW2GawHuGlOIf354mHIGPsEVs6wkfTpAugYnButa8gAQY55WJJrydzg4tD39O5Baj6rNb9GMfiP00Teh5SC9t";function j7(){if(rh!=null&&rh.startsWith("pk_test_"))return"sandbox";if(rh!=null&&rh.startsWith("pk_live_"))return"live";throw new Error("Payments are not configured for this build. Complete go-live in your Lovable project to enable production checkout.")}let aT=null;function OCe(){return aT||(j7(),aT=MCe(rh)),aT}function LCe(){return j7()}function FCe({line:t,onRemove:e,onLicenceChange:n}){const[r,s]=k.useState(null);return k.useEffect(()=>{OE(t.coverPath,{width:160,quality:70,resize:"contain"}).then(s)},[t.coverPath]),c.jsxs(xt.li,{layout:!0,initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,x:-20},className:"flex items-start gap-4 rounded-xl border border-border/60 bg-card p-4",children:[c.jsx("div",{className:"size-16 shrink-0 overflow-hidden rounded-md bg-gradient-to-br from-primary to-primary-dark",children:r&&c.jsx("img",{src:r,alt:"",className:"h-full w-full object-cover"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx(rt,{to:`/reports/${t.slug}`,target:"_blank",rel:"noopener noreferrer",className:"block font-serif text-base leading-tight hover:text-primary",children:t.title}),c.jsx("p",{className:"mt-0.5 text-sm font-semibold text-primary",children:bd(t.priceCents,t.currency)}),c.jsx("div",{className:"mt-2",children:c.jsxs(Nv,{value:t.licence,onValueChange:i=>n(i),children:[c.jsx(Am,{className:"h-8 w-full max-w-[260px] text-xs",children:c.jsx(Pv,{})}),c.jsx(Tm,{children:yb.map(i=>c.jsxs(jm,{value:i.id,children:[i.label," (",i.multiplier,"×)"]},i.id))})]})})]}),c.jsx("button",{onClick:e,"aria-label":"Remove",className:"rounded-lg p-2 text-muted-foreground transition-colors hover:bg-muted hover:text-destructive",children:c.jsx(OU,{className:"size-4"})})]})}function BCe(){const{items:t,remove:e,updateLicence:n,subtotalCents:r,currency:s,count:i,clear:a}=B0(),[o,l]=k.useState(""),[u,d]=k.useState(!1),[f,p]=k.useState(null),[m,y]=k.useState(!1),g=Rd(),b=async()=>{if(!u){te.error("Please accept the privacy policy and terms to continue.");return}if(t.length){y(!0);try{const{data:x,error:w}=await ce.functions.invoke("create-reports-checkout",{body:{items:t.map(v=>({reportId:v.reportId,licence:v.licence})),customerEmail:o||void 0,environment:LCe(),returnUrl:`${window.location.origin}/reports/checkout/success?session_id={CHECKOUT_SESSION_ID}`}});if(w)throw w;if(!(x!=null&&x.clientSecret))throw new Error("No client secret returned");p(x.clientSecret)}catch(x){console.error(x),te.error(x.message||"Could not start checkout")}finally{y(!1)}}};return c.jsxs(c.Fragment,{children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Your basket — Zenith Reports"}),c.jsx("meta",{name:"robots",content:"noindex"}),c.jsx("link",{rel:"canonical",href:"https://waterdispenseinsights.com/reports/cart"})]}),c.jsx(cD,{}),c.jsxs("main",{className:"min-h-screen bg-background",children:[c.jsxs("div",{className:"container mx-auto max-w-4xl px-6 py-12",children:[c.jsxs(rt,{to:"/reports",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-muted-foreground hover:text-primary",children:[c.jsx(lR,{className:"size-4"})," Continue browsing"]}),c.jsx("h1",{className:"mt-6 font-serif text-3xl md:text-4xl",children:"Your basket"}),c.jsx("p",{className:"mt-1 text-muted-foreground",children:i===0?"Nothing in your basket yet.":`${i} report${i===1?"":"s"} — delivered by email within 24 hours of checkout.`}),i===0?c.jsxs("div",{className:"mt-16 rounded-2xl border border-dashed border-border py-20 text-center",children:[c.jsx(MU,{className:"mx-auto size-10 text-muted-foreground/60"}),c.jsx("p",{className:"mt-4 font-serif text-lg text-muted-foreground",children:"Your basket is empty."}),c.jsx(rt,{to:"/reports",target:"_blank",rel:"noopener noreferrer",className:"mt-4 inline-block text-sm font-semibold text-primary hover:text-accent",children:"Browse reports →"})]}):f?c.jsx("div",{className:"mt-8 overflow-hidden rounded-2xl border border-border bg-card",children:c.jsx(bCe,{stripe:OCe(),options:{fetchClientSecret:async()=>f},children:c.jsx(SCe,{})})}):c.jsxs("div",{className:"mt-8 grid gap-8 md:grid-cols-[1fr_320px]",children:[c.jsx("ul",{className:"space-y-3",children:c.jsx(SV,{children:t.map(x=>c.jsx(FCe,{line:x,onRemove:()=>e(x.reportId),onLicenceChange:w=>n(x.reportId,w)},x.reportId))})}
706),c.jsxs("aside",{className:"h-fit rounded-2xl border border-border bg-card p-6",children:[c.jsxs("div",{className:"flex items-baseline justify-between",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Subtotal"}),c.jsx("p",{className:"font-serif text-2xl font-bold text-primary",children:bd(r,s)})]}),c.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"One-time purchase · sent by email within 24 hours of checkout."}),c.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"0% VAT · UK VAT (20%) added only for UK billing addresses."}),c.jsxs("div",{className:"mt-5",children:[c.jsx("label",{className:"mb-1.5 block text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Email for delivery"}),c.jsx(Ue,{type:"email",value:o,onChange:x=>l(x.target.value),placeholder:"[email protected]"})]}),c.jsxs("label",{className:"mt-4 flex items-start gap-2 text-xs text-muted-foreground cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:u,onChange:x=>d(x.target.checked),className:"mt-0.5 size-4 shrink-0 accent-primary"}),c.jsxs("span",{children:["I agree to the"," ",c.jsx(rt,{to:"/privacy-policy",target:"_blank",className:"font-semibold text-primary hover:underline",children:"privacy policy"})," ","and understand my report will be delivered by email within 24 hours."]})]}),c.jsx(oe,{size:"lg",className:"mt-4 w-full",disabled:m||!u,onClick:b,children:m?c.jsx(ap,{className:"size-4 animate-spin"}):c.jsxs(c.Fragment,{children:[c.jsx(eb,{className:"mr-2 size-4"})," Secure checkout"]})}),c.jsxs("div",{className:"mt-4 space-y-2 rounded-lg bg-muted/50 p-3 text-xs text-muted-foreground",children:[c.jsxs("p",{className:"flex items-center gap-2",children:[c.jsx(pR,{className:"size-3.5 shrink-0 text-primary"}),"Payments processed securely by Stripe"]}),c.jsxs("p",{className:"flex items-center gap-2",children:[c.jsx(eb,{className:"size-3.5 shrink-0 text-primary"}),"256-bit SSL encryption · we never see your card details"]}),c.jsxs("p",{className:"flex items-center gap-2",children:[c.jsx(yZ,{className:"size-3.5 shrink-0 text-primary"}),"Visa, Mastercard, Amex, Apple Pay & Google Pay"]})]}),c.jsx("button",{onClick:()=>{a(),g("/reports")},className:"mt-3 w-full text-xs text-muted-foreground hover:text-destructive",children:"Clear basket"})]})]})]}),c.jsx(Cc,{})]})]})}function $Ce(){const[t]=zz(),e=t.get("session_id"),{clear:n}=B0();return k.useEffect(()=>{n()},[n]),c.jsxs(c.Fragment,{children:[c.jsxs(xs,{children:[c.jsx("title",{children:"Thank you — Zenith Reports"}),c.jsx("meta",{name:"robots",content:"noindex"})]}),c.jsxs("main",{className:"flex min-h-screen flex-col bg-background",children:[c.jsx("div",{className:"container mx-auto flex flex-1 items-center justify-center px-6 py-16",children:c.jsxs(xt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:"max-w-lg rounded-2xl border border-border bg-card p-10 text-center shadow-elegant",children:[c.jsx(jS,{className:"mx-auto size-14 text-accent"}),c.jsx("h1",{className:"mt-6 font-serif text-3xl",children:"Purchase confirmed"}),c.jsx("p",{className:"mt-3 text-muted-foreground",children:"Your report download link will be sent to your email within 24 hours. If it doesn't arrive, contact us and we'll send it directly."}),c.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:[c.jsx("a",{className:"underline",href:"mailto:[email protected]",children:"[email protected]"})," · ",c.jsx("a",{className:"underline",href:"tel:+442033690036",children:"+44 20 3369 0036"})]}),e&&c.jsxs("p",{className:"mt-4 text-xs text-muted-foreground/70",children:["Reference: ",e.slice(0,20),"…"]}),c.jsxs("div",{className:"mt-8 flex flex-col gap-2 sm:flex-row sm:justify-center",children:[c.jsx(rt,{to:"/reports",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center rounded-full bg-primary px-5 py-2.5 text-sm font-semibold text-primary-foreground hover:bg-primary/90",children:"Browse more reports"}),c.jsx(rt,{to:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center rounded-full border border-border px-5 py-2.5 text-sm font-semibold hover:bg-muted",children:"Read the Intelligence hub"})]})]})}),c.jsx(Cc,{})]})]})}
706const oT="https://waterdispenseinsights.com";function lT({pillarId:t}){const e=mke(t),{reports:n,isLoading:r}=qE({published:!0}),[s,i]=k.useState([]);k.useEffect(()=>{let u=!1;return ce.from("news_articles").select("slug, title, excerpt, published_at").eq("is_published",!0).order("published_at",{ascending:!1}).limit(120).then(({data:d})=>{if(u||!d)return;const f=d.filter(p=>D9(p.title,p.excerpt||"").id===e.id);i((f.length?f:d).slice(0,6))}),()=>{u=!0}},[e.id]);const a=k.useMemo(()=>bb(n.filter(u=>oD(e,u))),[n,e]),o=`${oT}${MN(e)}`,l={"@context":"https://schema.org","@graph":[{"@type":"CollectionPage",name:e.h1,description:e.seoDescription,url:o,inLanguage:"en-GB",hasPart:a.slice(0,40).map(u=>({"@type":"Product",name:u.title,url:`${oT}/reports/${u.slug}`}))},{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:`${oT}/`},{"@type":"ListItem",position:2,name:e.name,item:o}]}]};return c.jsxs("div",{className:"min-h-screen bg-background",children:[c.jsxs(xs,{children:[c.jsx("title",{children:e.seoTitle}),c.jsx("meta",{name:"description",content:e.seoDescription}),c.jsx("link",{rel:"canonical",href:o}),c.jsx("meta",{property:"og:type",content:"website"}),c.jsx("meta",{property:"og:title",content:e.seoTitle}),c.jsx("meta",{property:"og:description",content:e.seoDescription}),c.jsx("meta",{property:"og:url",content:o}),c.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),c.jsx("script",{type:"application/ld+json",children:JSON.stringify(l)})]}),c.jsx(lD,{}),c.jsx("header",{className:"border-b border-border bg-gradient-to-br from-primary/95 via-primary to-primary-dark text-primary-foreground",children:c.jsxs("div",{className:"container mx-auto max-w-6xl px-6 py-16 md:py-20",children:[c.jsxs("nav",{"aria-label":"Breadcrumb",className:"mb-6 text-xs uppercase tracking-[0.2em] text-primary-foreground/70",children:[c.jsx(rt,{to:"/",className:"hover:text-accent",children:"Home"}),c.jsx("span",{className:"mx-2",children:"/"}),c.jsx("span",{children:e.name})]}),c.jsx("h1",{className:"font-serif text-4xl md:text-5xl lg:text-6xl font-bold leading-tight mb-5",children:e.h1}),c.jsx("p",{className:"max-w-3xl text-base md:text-lg leading-relaxed text-primary-foreground/85",children:e.intro}),c.jsx("dl",{className:"mt-8 grid gap-4 sm:grid-cols-3 max-w-3xl",children:e.stats.map(u=>c.jsxs("div",{className:"rounded-xl border border-primary-foreground/15 bg-primary-foreground/5 p-4",children:[c.jsx("dt",{className:"text-[11px] uppercase tracking-widest text-primary-foreground/60",children:u.label}),c.jsx("dd",{className:"mt-1 font-semibold text-accent",children:u.value})]},u.label))}),c.jsxs("div",{className:"mt-8 flex flex-wrap gap-3",children:[c.jsxs("a",{href:"#reports",className:"inline-flex items-center gap-2 rounded-lg bg-accent px-5 py-3 text-sm font-semibold text-accent-foreground",children:["See the market reports",c.jsx(Yr,{className:"h-4 w-4"})]}),c.jsxs(rt,{to:"/intelligence",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-lg border border-primary-foreground/35 px-5 py-3 text-sm font-semibold",children:["Read the daily intelligence",c.jsx(Jn,{className:"h-4 w-4"})]})]})]})}),c.jsxs("section",{className:"container mx-auto max-w-3xl px-6 py-14",children:[c.jsxs("h2",{className:"font-serif text-2xl md:text-3xl font-bold text-foreground mb-5",children:["What the ",e.name," research covers"]}),c.jsx("div",{className:"space-y-4",children:e.body.map((u,d)=>c.jsx("p",{className:"text-base leading-relaxed text-muted-foreground",children:u},d))})]}),c.jsx("div",{className:"container mx-auto max-w-5xl px-6 pb-4",children:c.jsx(IE,{})}),c.jsxs("section",{id:"reports",className:"container mx-auto max-w-6xl px-6 py-14 scroll-mt-8",children:[c.jsxs("h2",{className:"font-serif text-2xl md:text-3xl font-bold text-foreground mb-2",children:[e.name," reports"]}),c.jsx("p",{className:"text-muted-foreground mb-8",children:"PDF report plus Excel database for every market. Pick a single market, or ask about the regional bundle."}),r?c.jsx("div",{className:"flex justify-center py-16",children:c.jsx(ap,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):a.length===0?c.jsx("p",{className:"text-muted-foreground",children:"No published reports in this region yet."}):c.jsx("div",{className:"grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:a.map(u=>c.jsx(O9,{report:u},u.id))}),c.jsx("div",{className:"mt-10",children:c.jsxs(rt,{to:"/reports",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-lg border border-border px-5 py-3 text-sm font-semibold text-foreground hover:bg-muted",children:["Browse the full report store",c.jsx(Jn,{className:"h-4 w-4"})]})})]}),s.length>0&&c.jsx("section",{className:"border-t border-border bg-muted/30",children:c.jsxs("div",{className:"container mx-auto max-w-6xl px-6 py-14",children:[c.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-bold text-foreground mb-2",children:"Latest intelligence on this market"}),c.jsx("p",{className:"text-muted-foreground mb-8",children:"Daily briefings from Zenith Global Commercial — free to read."}),c.jsx("ul",{className:"grid gap-4 md:grid-cols-2",children:s.map(u=>c.jsx("li",{children:c.jsxs(rt,{to:`/intelligence/${u.slug}`,target:"_blank",rel:"noopener noreferrer",className:"block h-full rounded-xl border border-border bg-card p-5 hover:border-accent",children:[c.jsx("time",{className:"text-[11px] uppercase tracking-widest text-muted-foreground",children:new Date(u.published_at).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})}),c.jsxs("h3",{className:"mt-2 font-semibold leading-snug text-foreground",children:["Read more: ",u.title]}),u.excerpt&&c.jsx("p",{className:"mt-2 line-clamp-3 text-sm text-muted-foreground",children:u.excerpt})]})},u.slug))})]})}),c.jsx(Cc,{})]})}
706const UCe=()=>{const[t,e]=k.useState(!1);k.useEffect(()=>{localStorage.getItem("cookies-consent")||e(!0)},[]);const n=()=>{localStorage.setItem("cookies-consent","accepted"),e(!1)},r=()=>{localStorage.setItem("cookies-consent","declined"),e(!1)};return t?c.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 p-4 bg-card border-t border-border shadow-elegant animate-in slide-in-from-bottom-5 duration-300",children:c.jsx("div",{className:"container mx-auto max-w-4xl",children:c.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[c.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[c.jsx(mZ,{className:"w-6 h-6 text-accent flex-shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-foreground",children:'We use cookies to enhance your browsing experience and analyze site traffic. By clicking "Accept", you consent to our use of cookies.'}),c.jsx("a",{href:"https://www.zenithglobalcommercial.com/legal",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent hover:underline",children:"Learn more in our Privacy Policy"})]})]}),c.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[c.jsx(oe,{variant:"outline",size:"sm",onClick:r,children:"Decline"}),c.jsx(oe,{variant:"cta",size:"sm",onClick:n,children:"Accept"})]})]})})}):null};function zCe(){const t=Pd(),e=Yge(t.pathname),n=k.useRef("");return k.useEffect(()=>{e&&n.current!==e&&(n.current=e,_8(e))},[e]),Zge(e),null}const VCe=()=>{const{slug:t}=OR();return c.jsx(mj,{to:`/intelligence/${t??""}`,replace:!0})},WCe=new ote,HCe=()=>c.jsx(Yz,{children:c.jsx(cte,{client:WCe,children:c.jsx(Lee,{children:c.jsxs(Nke,{children:[c.jsx(bQ,{}),c.jsx(QQ,{}),c.jsxs(ane,{children:[c.jsx(zCe,{}),c.jsxs(Qte,{children:[c.jsx(_n,{path:"/",element:c.jsx(Qhe,{})}),c.jsx(_n,{path:"/privacy-policy",element:c.jsx(Pge,{})}),c.jsx(_n,{path:"/intelligence",element:c.jsx(Jge,{})}),c.jsx(_n,{path:"/intelligence/:slug",element:c.jsx(vke,{})}),c.jsx(_n,{path:"/smartdispensers",element:c.jsx(Cke,{})}),c.jsx(_n,{path:"/unsubscribe",element:c.jsx(jke,{})}),c.jsx(_n,{path:"/reports",element:c.jsx(hSe,{})}),c.jsx(_n,{path:"/reports/cart",element:c.jsx(BCe,{})}),c.jsx(_n,{path:"/reports/checkout/success",element:c.jsx($Ce,{})}),c.jsx(_n,{path:"/reports/:slug",element:c.jsx(QEe,{})}),c.jsx(_n,{path:"/europe-water-dispenser-market",element:c.jsx(lT,{pillarId:"europe"})}),c.jsx(_n,{path:"/usa-water-dispenser-market",element:c.jsx(lT,{pillarId:"usa"})}),c.jsx(_n,{path:"/asia-middle-east-water-dispenser-market",element:c.jsx(lT,{pillarId:"asia-middle-east"})}),c.jsx(_n,{path:"/store",element:c.jsx(mj,{to:"/reports",replace:!0})}),c.jsx(_n,{path:"/news",element:c.jsx(mj,{to:"/intelligence",replace:!0})}),c.jsx(_n,{path:"/news/:slug",element:c.jsx(VCe,{})}),c.jsx(_n,{path:"/admin",element:c.jsx(tfe,{})}),c.jsx(_n,{path:"/admin/dashboard",element:c.jsx(Tge,{})}),c.jsx(_n,{path:"/reset-password",element:c.jsx(Nge,{})}),c.jsx(_n,{path:"*",element:c.jsx(Jhe,{})})]}),c.jsx(UCe,{})]})]})})})});G$(document.getElementById("root")).render(c.jsx(HCe,{}));

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.