PageSourceSearch

https://starsponsorship.org/assets/index-DEFeM6hD.js

js starsponsorship.org collected 2026-10-09 22:39:14 UTC 2,271,014 bytes, 914 lines download raw bytes

vendor: 6,879 bytes, lines 1-9
1var wre=Object.defineProperty;var h6=e=>{throw TypeError(e)};var _re=(e,t,n)=>t in e?wre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qe=(e,t,n)=>_re(e,typeof t!="symbol"?t+"":t,n),T5=(e,t,n)=>t.has(e)||h6("Cannot "+n);var be=(e,t,n)=>(T5(e,t,"read from private field"),n?n.call(e):t.get(e)),Kt=(e,t,n)=>t.has(e)?h6("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),bt=(e,t,n,r)=>(T5(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Pn=(e,t,n)=>(T5(e,t,"access private method"),n);var S1=(e,t,n,r)=>({set _(a){bt(e,t,a,n)},get _(){return be(e,t,r)}});function Z9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var ec=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gb(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var X9={exports:{}},Uj={},J9={exports:{}},Bn={};/**
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 vb=Symbol.for("react.element"),jre=Symbol.for("react.portal"),Sre=Symbol.for("react.fragment"),Nre=Symbol.for("react.strict_mode"),Are=Symbol.for("react.profiler"),kre=Symbol.for("react.provider"),Ere=Symbol.for("react.context"),Cre=Symbol.for("react.forward_ref"),Pre=Symbol.for("react.suspense"),Tre=Symbol.for("react.memo"),Ore=Symbol.for("react.lazy"),p6=Symbol.iterator;function Rre(e){return e===null||typeof e!="object"?null:(e=p6&&e[p6]||e["@@iterator"],typeof e=="function"?e:null)}var Q9={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},eU=Object.assign,tU={};function kv(e,t,n){this.props=e,this.context=t,this.refs=tU,this.updater=n||Q9}kv.prototype.isReactComponent={};kv.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};kv.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function nU(){}nU.prototype=kv.prototype;function mT(e,t,n){this.props=e,this.context=t,this.refs=tU,this.updater=n||Q9}var gT=mT.prototype=new nU;gT.constructor=mT;eU(gT,kv.prototype);gT.isPureReactComponent=!0;var m6=Array.isArray,rU=Object.prototype.hasOwnProperty,vT={current:null},aU={key:!0,ref:!0,__self:!0,__source:!0};function iU(e,t,n){var r,a={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)rU.call(t,r)&&!aU.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:vb,type:e,key:i,ref:o,props:a,_owner:vT.current}}function Ire(e,t){return{$$typeof:vb,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function yT(e){return typeof e=="object"&&e!==null&&e.$$typeof===vb}function Lre(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var g6=/\/+/g;function O5(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Lre(""+e.key):t.toString(36)}function $w(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case vb:case jre:o=!0}}if(o)return o=e,a=a(o),e=r===""?"."+O5(o,0):r,m6(a)?(n="",e!=null&&(n=e.replace(g6,"$&/")+"/"),$w(a,t,n,"",function(u){return u})):a!=null&&(yT(a)&&(a=Ire(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(g6,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",m6(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+O5(i,l);o+=$w(i,t,n,c,a)}else if(c=Rre(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+O5(i,l++),o+=$w(i,t,n,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function N1(e,t,n){if(e==null)return e;var r=[],a=0;return $w(e,r,"","",function(i){return t.call(n,i,a++)}),r}function Mre(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var xs={current:null},Dw={transition:null},$re={ReactCurrentDispatcher:xs,ReactCurrentBatchConfig:Dw,ReactCurrentOwner:vT};function sU(){throw Error("act(...) is not supported in production builds of React.")}Bn.Children={map:N1,forEach:function(e,t,n){N1(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N1(e,function(){t++}),t},toArray:function(e){return N1(e,function(t){return t})||[]},only:function(e){if(!yT(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Bn.Component=kv;Bn.Fragment=Sre;Bn.Profiler=Are;Bn.PureComponent=mT;Bn.StrictMode=Nre;Bn.Suspense=Pre;
vendor: 9,075 bytes, lines 9-33
9Bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$re;Bn.act=sU;Bn.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=eU({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=vT.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)rU.call(t,c)&&!aU.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:vb,type:e.type,key:a,ref:i,props:r,_owner:o}};Bn.createContext=function(e){return e={$$typeof:Ere,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:kre,_context:e},e.Consumer=e};Bn.createElement=iU;Bn.createFactory=function(e){var t=iU.bind(null,e);return t.type=e,t};Bn.createRef=function(){return{current:null}};Bn.forwardRef=function(e){return{$$typeof:Cre,render:e}};Bn.isValidElement=yT;Bn.lazy=function(e){return{$$typeof:Ore,_payload:{_status:-1,_result:e},_init:Mre}};Bn.memo=function(e,t){return{$$typeof:Tre,type:e,compare:t===void 0?null:t}};Bn.startTransition=function(e){var t=Dw.transition;Dw.transition={};try{e()}finally{Dw.transition=t}};Bn.unstable_act=sU;Bn.useCallback=function(e,t){return xs.current.useCallback(e,t)};Bn.useContext=function(e){return xs.current.useContext(e)};Bn.useDebugValue=function(){};Bn.useDeferredValue=function(e){return xs.current.useDeferredValue(e)};Bn.useEffect=function(e,t){return xs.current.useEffect(e,t)};Bn.useId=function(){return xs.current.useId()};Bn.useImperativeHandle=function(e,t,n){return xs.current.useImperativeHandle(e,t,n)};Bn.useInsertionEffect=function(e,t){return xs.current.useInsertionEffect(e,t)};Bn.useLayoutEffect=function(e,t){return xs.current.useLayoutEffect(e,t)};Bn.useMemo=function(e,t){return xs.current.useMemo(e,t)};Bn.useReducer=function(e,t,n){return xs.current.useReducer(e,t,n)};Bn.useRef=function(e){return xs.current.useRef(e)};Bn.useState=function(e){return xs.current.useState(e)};Bn.useSyncExternalStore=function(e,t,n){return xs.current.useSyncExternalStore(e,t,n)};Bn.useTransition=function(){return xs.current.useTransition()};Bn.version="18.3.1";J9.exports=Bn;var x=J9.exports;const ue=mr(x),xT=Z9({__proto__:null,default:ue},[x]);/**
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 Dre=x,Fre=Symbol.for("react.element"),Bre=Symbol.for("react.fragment"),Ure=Object.prototype.hasOwnProperty,zre=Dre.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Wre={key:!0,ref:!0,__self:!0,__source:!0};function oU(e,t,n){var r,a={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Ure.call(t,r)&&!Wre.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:Fre,type:e,key:i,ref:o,props:a,_owner:zre.current}}Uj.Fragment=Bre;Uj.jsx=oU;Uj.jsxs=oU;X9.exports=Uj;var s=X9.exports,lU={exports:{}},yo={},cU={exports:{}},uU={};/**
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(e){function t($,W){var ee=$.length;$.push(W);e:for(;0<ee;){var V=ee-1>>>1,O=$[V];if(0<a(O,W))$[V]=W,$[ee]=O,ee=V;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var W=$[0],ee=$.pop();if(ee!==W){$[0]=ee;e:for(var V=0,O=$.length,M=O>>>1;V<M;){var B=2*(V+1)-1,G=$[B],te=B+1,ne=$[te];if(0>a(G,ee))te<O&&0>a(ne,G)?($[V]=ne,$[te]=ee,V=te):($[V]=G,$[B]=ee,V=B);else if(te<O&&0>a(ne,ee))$[V]=ne,$[te]=ee,V=te;else break e}}return W}function a($,W){var ee=$.sortIndex-W.sortIndex;return ee!==0?ee:$.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,p=3,h=!1,m=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w($){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=$)r(u),W.sortIndex=W.expirationTime,t(c,W);else break;W=n(u)}}function j($){if(g=!1,w($),!m)if(n(c)!==null)m=!0,Z(S);else{var W=n(u);W!==null&&H(j,W.startTime-$)}}function S($,W){m=!1,g&&(g=!1,y(k),k=-1),h=!0;var ee=p;try{for(w(W),f=n(c);f!==null&&(!(f.expirationTime>W)||$&&!C());){var V=f.callback;if(typeof V=="function"){f.callback=null,p=f.priorityLevel;var O=V(f.expirationTime<=W);W=e.unstable_now(),typeof O=="function"?f.callback=O:f===n(c)&&r(c),w(W)}else r(c);f=n(c)}if(f!==null)var M=!0;else{var B=n(u);B!==null&&H(j,B.startTime-W),M=!1}return M}finally{f=null,p=ee,h=!1}}var A=!1,E=null,k=-1,P=5,R=-1;function C(){return!(e.unstable_now()-R<P)}function I(){if(E!==null){var $=e.unstable_now();R=$;var W=!0;try{W=E(!0,$)}finally{W?D():(A=!1,E=null)}}else A=!1}var D;if(typeof b=="function")D=function(){b(I)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,q=U.port2;U.port1.onmessage=I,D=function(){q.postMessage(null)}}else D=function(){v(I,0)};function Z($){E=$,A||(A=!0,D())}function H($,W){k=v(function(){$(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_continueExecution=function(){m||h||(m=!0,Z(S))},e.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"):P=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function($){switch(p){case 1:case 2:case 3:var W=3;break;default:W=p}var ee=p;p=W;try{return $()}finally{p=ee}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,W){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var ee=p;p=$;try{return W()}finally{p=ee}},e.unstable_scheduleCallback=function($,W,ee){var V=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?V+ee:V):ee=V,$){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=ee+O,$={id:d++,callback:W,priorityLevel:$,startTime:ee,expirationTime:O,sortIndex:-1},ee>V?($.sortIndex=ee,t(u,$),n(c)===null&&$===n(u)&&(g?(y(k),k=-1):g=!0,H(j,ee-V))):($.sortIndex=O,t(c,$),m||h||(m=!0,Z(S))),$},e.unstable_shouldYield=C,e.unstable_wrapCallback=function($){var W=p;return function(){var ee=p;p=W;try{return $.apply(this,arguments)}finally{p=ee}}}})(uU);cU.exports=uU;var qre=cU.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 Vre=x,po=qre;function lt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var dU=new Set,$0={};function xp(e,t){Ng(e,t),Ng(e+"Capture",t)}function Ng(e,t){for($0[e]=t,e=0;e<t.length;e++)dU.add(t[e])}var mu=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nE=Object.prototype.hasOwnProperty,Hre=/^[: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]*$/,v6={},y6={};function Gre(e){return nE.call(y6,e)?!0:nE.call(v6,e)?!1:Hre.test(e)?y6[e]=!0:(v6[e]=!0,!1)}function Yre(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Kre(e,t,n,r){if(t===null||typeof t>"u"||Yre(e,t,n,r))return!0;
vendor: 5,203 bytes, lines 33-34
33if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function bs(e,t,n,r,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Li={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Li[e]=new bs(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Li[t]=new bs(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Li[e]=new bs(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Li[e]=new bs(e,2,!1,e,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(e){Li[e]=new bs(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Li[e]=new bs(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Li[e]=new bs(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Li[e]=new bs(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Li[e]=new bs(e,5,!1,e.toLowerCase(),null,!1,!1)});var bT=/[\-:]([a-z])/g;function wT(e){return e[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(e){var t=e.replace(bT,wT);Li[t]=new bs(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(bT,wT);Li[t]=new bs(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(bT,wT);Li[t]=new bs(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Li[e]=new bs(e,1,!1,e.toLowerCase(),null,!1,!1)});Li.xlinkHref=new bs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Li[e]=new bs(e,1,!1,e.toLowerCase(),null,!0,!0)});function _T(e,t,n,r){var a=Li.hasOwnProperty(t)?Li[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Kre(t,n,a,r)&&(n=null),r||a===null?Gre(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Eu=Vre.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A1=Symbol.for("react.element"),km=Symbol.for("react.portal"),Em=Symbol.for("react.fragment"),jT=Symbol.for("react.strict_mode"),rE=Symbol.for("react.profiler"),fU=Symbol.for("react.provider"),hU=Symbol.for("react.context"),ST=Symbol.for("react.forward_ref"),aE=Symbol.for("react.suspense"),iE=Symbol.for("react.suspense_list"),NT=Symbol.for("react.memo"),sd=Symbol.for("react.lazy"),pU=Symbol.for("react.offscreen"),x6=Symbol.iterator;function wy(e){return e===null||typeof e!="object"?null:(e=x6&&e[x6]||e["@@iterator"],typeof e=="function"?e:null)}var pa=Object.assign,R5;function t0(e){if(R5===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);R5=t&&t[1]||""}return`
34`+R5+e}var I5=!1;function L5(e,t){if(!e||I5)return"";I5=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}
vendor: 18,233 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var a=u.stack.split(`
35`),i=r.stack.split(`
36`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
37`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{I5=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?t0(e):""}function Zre(e){switch(e.tag){case 5:return t0(e.type);case 16:return t0("Lazy");case 13:return t0("Suspense");case 19:return t0("SuspenseList");case 0:case 2:case 15:return e=L5(e.type,!1),e;case 11:return e=L5(e.type.render,!1),e;case 1:return e=L5(e.type,!0),e;default:return""}}function sE(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Em:return"Fragment";case km:return"Portal";case rE:return"Profiler";case jT:return"StrictMode";case aE:return"Suspense";case iE:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case hU:return(e.displayName||"Context")+".Consumer";case fU:return(e._context.displayName||"Context")+".Provider";case ST:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case NT:return t=e.displayName||null,t!==null?t:sE(e.type)||"Memo";case sd:t=e._payload,e=e._init;try{return sE(e(t))}catch{}}return null}function Xre(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sE(t);case 8:return t===jT?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function tf(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mU(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jre(e){var t=mU(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function k1(e){e._valueTracker||(e._valueTracker=Jre(e))}function gU(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=mU(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function v_(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function oE(e,t){var n=t.checked;return pa({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function b6(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=tf(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function vU(e,t){t=t.checked,t!=null&&_T(e,"checked",t,!1)}function lE(e,t){vU(e,t);var n=tf(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?cE(e,t.type,n):t.hasOwnProperty("defaultValue")&&cE(e,t.type,tf(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function w6(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function cE(e,t,n){(t!=="number"||v_(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var n0=Array.isArray;function Hm(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+tf(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function uE(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(lt(91));return pa({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _6(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(lt(92));if(n0(n)){if(1<n.length)throw Error(lt(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:tf(n)}}function yU(e,t){var n=tf(t.value),r=tf(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function j6(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function xU(e){switch(e){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 dE(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?xU(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var E1,bU=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(E1=E1||document.createElement("div"),E1.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=E1.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function D0(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var m0={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},Qre=["Webkit","ms","Moz","O"];Object.keys(m0).forEach(function(e){Qre.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),m0[t]=m0[e]})});function wU(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||m0.hasOwnProperty(e)&&m0[e]?(""+t).trim():t+"px"}function _U(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=wU(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var eae=pa({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 fE(e,t){if(t){if(eae[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(lt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(lt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(lt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(lt(62))}}function hE(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pE=null;function AT(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mE=null,Gm=null,Ym=null;function S6(e){if(e=bb(e)){if(typeof mE!="function")throw Error(lt(280));var t=e.stateNode;t&&(t=Hj(t),mE(e.stateNode,e.type,t))}}function jU(e){Gm?Ym?Ym.push(e):Ym=[e]:Gm=e}function SU(){if(Gm){var e=Gm,t=Ym;if(Ym=Gm=null,S6(e),t)for(e=0;e<t.length;e++)S6(t[e])}}function NU(e,t){return e(t)}function AU(){}var M5=!1;function kU(e,t,n){if(M5)return e(t,n);M5=!0;try{return NU(e,t,n)}finally{M5=!1,(Gm!==null||Ym!==null)&&(AU(),SU())}}function F0(e,t){var n=e.stateNode;if(n===null)return null;var r=Hj(n);if(r===null)return null;n=r[t];e:switch(t){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)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(lt(231,t,typeof n));return n}var gE=!1;if(mu)try{var _y={};Object.defineProperty(_y,"passive",{get:function(){gE=!0}}),window.addEventListener("test",_y,_y),window.removeEventListener("test",_y,_y)}catch{gE=!1}function tae(e,t,n,r,a,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var g0=!1,y_=null,x_=!1,vE=null,nae={onError:function(e){g0=!0,y_=e}};function rae(e,t,n,r,a,i,o,l,c){g0=!1,y_=null,tae.apply(nae,arguments)}function aae(e,t,n,r,a,i,o,l,c){if(rae.apply(this,arguments),g0){if(g0){var u=y_;g0=!1,y_=null}else throw Error(lt(198));x_||(x_=!0,vE=u)}}function bp(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function EU(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function N6(e){if(bp(e)!==e)throw Error(lt(188))}function iae(e){var t=e.alternate;if(!t){if(t=bp(e),t===null)throw Error(lt(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return N6(a),e;if(i===r)return N6(a),t;i=i.sibling}throw Error(lt(188))}if(n.return!==r.return)n=a,r=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o)throw Error(lt(189))}}if(n.alternate!==r)throw Error(lt(190))}if(n.tag!==3)throw Error(lt(188));return n.stateNode.current===n?e:t}function CU(e){return e=iae(e),e!==null?PU(e):null}function PU(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=PU(e);if(t!==null)return t;e=e.sibling}return null}var TU=po.unstable_scheduleCallback,A6=po.unstable_cancelCallback,sae=po.unstable_shouldYield,oae=po.unstable_requestPaint,Ca=po.unstable_now,lae=po.unstable_getCurrentPriorityLevel,kT=po.unstable_ImmediatePriority,OU=po.unstable_UserBlockingPriority,b_=po.unstable_NormalPriority,cae=po.unstable_LowPriority,RU=po.unstable_IdlePriority,zj=null,uc=null;function uae(e){if(uc&&typeof uc.onCommitFiberRoot=="function")try{uc.onCommitFiberRoot(zj,e,void 0,(e.current.flags&128)===128)}catch{}}var Sl=Math.clz32?Math.clz32:hae,dae=Math.log,fae=Math.LN2;function hae(e){return e>>>=0,e===0?32:31-(dae(e)/fae|0)|0}var C1=64,P1=4194304;function r0(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function w_(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?r=r0(l):(i&=o,i!==0&&(r=r0(i)))}else o=n&~a,o!==0?r=r0(o):i!==0&&(r=r0(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Sl(t),a=1<<n,r|=e[n],t&=~a;return r}function pae(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 mae(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Sl(i),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=pae(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function yE(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function IU(){var e=C1;return C1<<=1,!(C1&4194240)&&(C1=64),e}function $5(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yb(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sl(t),e[t]=n}function gae(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-Sl(n),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~i}}function ET(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Sl(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var _r=0;function LU(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var MU,CT,$U,DU,FU,xE=!1,T1=[],Md=null,$d=null,Dd=null,B0=new Map,U0=new Map,dd=[],vae="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 k6(e,t){switch(e){case"focusin":case"focusout":Md=null;break;case"dragenter":case"dragleave":$d=null;break;case"mouseover":case"mouseout":Dd=null;break;case"pointerover":case"pointerout":B0.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":U0.delete(t.pointerId)}}function jy(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=bb(t),t!==null&&CT(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function yae(e,t,n,r,a){switch(t){case"focusin":return Md=jy(Md,e,t,n,r,a),!0;case"dragenter":return $d=jy($d,e,t,n,r,a),!0;case"mouseover":return Dd=jy(Dd,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return B0.set(i,jy(B0.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,U0.set(i,jy(U0.get(i)||null,e,t,n,r,a)),!0}return!1}function BU(e){var t=gh(e.target);if(t!==null){var n=bp(t);if(n!==null){if(t=n.tag,t===13){if(t=EU(n),t!==null){e.blockedOn=t,FU(e.priority,function(){$U(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fw(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bE(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);pE=r,n.target.dispatchEvent(r),pE=null}else return t=bb(n),t!==null&&CT(t),e.blockedOn=n,!1;t.shift()}return!0}function E6(e,t,n){Fw(e)&&n.delete(t)}function xae(){xE=!1,Md!==null&&Fw(Md)&&(Md=null),$d!==null&&Fw($d)&&($d=null),Dd!==null&&Fw(Dd)&&(Dd=null),B0.forEach(E6),U0.forEach(E6)}function Sy(e,t){e.blockedOn===t&&(e.blockedOn=null,xE||(xE=!0,po.unstable_scheduleCallback(po.unstable_NormalPriority,xae)))}function z0(e){function t(a){return Sy(a,e)}if(0<T1.length){Sy(T1[0],e);for(var n=1;n<T1.length;n++){var r=T1[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Md!==null&&Sy(Md,e),$d!==null&&Sy($d,e),Dd!==null&&Sy(Dd,e),B0.forEach(t),U0.forEach(t),n=0;n<dd.length;n++)r=dd[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<dd.length&&(n=dd[0],n.blockedOn===null);)BU(n),n.blockedOn===null&&dd.shift()}var Km=Eu.ReactCurrentBatchConfig,__=!0;function bae(e,t,n,r){var a=_r,i=Km.transition;Km.transition=null;try{_r=1,PT(e,t,n,r)}finally{_r=a,Km.transition=i}}function wae(e,t,n,r){var a=_r,i=Km.transition;Km.transition=null;try{_r=4,PT(e,t,n,r)}finally{_r=a,Km.transition=i}}function PT(e,t,n,r){if(__){var a=bE(e,t,n,r);if(a===null)G5(e,t,r,j_,n),k6(e,r);else if(yae(a,e,t,n,r))r.stopPropagation();else if(k6(e,r),t&4&&-1<vae.indexOf(e)){for(;a!==null;){var i=bb(a);if(i!==null&&MU(i),i=bE(e,t,n,r),i===null&&G5(e,t,r,j_,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else G5(e,t,r,null,n)}}var j_=null;function bE(e,t,n,r){if(j_=null,e=AT(r),e=gh(e),e!==null)if(t=bp(e),t===null)e=null;else if(n=t.tag,n===13){if(e=EU(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return j_=e,null}
vendor: 10,457 bytes, line 37
37function UU(e){switch(e){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(lae()){case kT:return 1;case OU:return 4;case b_:case cae:return 16;case RU:return 536870912;default:return 16}default:return 16}}var Ad=null,TT=null,Bw=null;function zU(){if(Bw)return Bw;var e,t=TT,n=t.length,r,a="value"in Ad?Ad.value:Ad.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[i-r];r++);return Bw=a.slice(e,1<r?1-r:void 0)}function Uw(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function O1(){return!0}function C6(){return!1}function xo(e){function t(n,r,a,i,o){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?O1:C6,this.isPropagationStopped=C6,this}return pa(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=O1)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=O1)},persist:function(){},isPersistent:O1}),t}var Ev={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},OT=xo(Ev),xb=pa({},Ev,{view:0,detail:0}),_ae=xo(xb),D5,F5,Ny,Wj=pa({},xb,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:RT,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ny&&(Ny&&e.type==="mousemove"?(D5=e.screenX-Ny.screenX,F5=e.screenY-Ny.screenY):F5=D5=0,Ny=e),D5)},movementY:function(e){return"movementY"in e?e.movementY:F5}}),P6=xo(Wj),jae=pa({},Wj,{dataTransfer:0}),Sae=xo(jae),Nae=pa({},xb,{relatedTarget:0}),B5=xo(Nae),Aae=pa({},Ev,{animationName:0,elapsedTime:0,pseudoElement:0}),kae=xo(Aae),Eae=pa({},Ev,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cae=xo(Eae),Pae=pa({},Ev,{data:0}),T6=xo(Pae),Tae={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Oae={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"},Rae={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Iae(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rae[e])?!!t[e]:!1}function RT(){return Iae}var Lae=pa({},xb,{key:function(e){if(e.key){var t=Tae[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Uw(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Oae[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:RT,charCode:function(e){return e.type==="keypress"?Uw(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Uw(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mae=xo(Lae),$ae=pa({},Wj,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),O6=xo($ae),Dae=pa({},xb,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:RT}),Fae=xo(Dae),Bae=pa({},Ev,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uae=xo(Bae),zae=pa({},Wj,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Wae=xo(zae),qae=[9,13,27,32],IT=mu&&"CompositionEvent"in window,v0=null;mu&&"documentMode"in document&&(v0=document.documentMode);var Vae=mu&&"TextEvent"in window&&!v0,WU=mu&&(!IT||v0&&8<v0&&11>=v0),R6=" ",I6=!1;function qU(e,t){switch(e){case"keyup":return qae.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function VU(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cm=!1;function Hae(e,t){switch(e){case"compositionend":return VU(t);case"keypress":return t.which!==32?null:(I6=!0,R6);case"textInput":return e=t.data,e===R6&&I6?null:e;default:return null}}function Gae(e,t){if(Cm)return e==="compositionend"||!IT&&qU(e,t)?(e=zU(),Bw=TT=Ad=null,Cm=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return WU&&t.locale!=="ko"?null:t.data;default:return null}}var Yae={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 L6(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Yae[e.type]:t==="textarea"}function HU(e,t,n,r){jU(r),t=S_(t,"onChange"),0<t.length&&(n=new OT("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var y0=null,W0=null;function Kae(e){rz(e,0)}function qj(e){var t=Om(e);if(gU(t))return e}function Zae(e,t){if(e==="change")return t}var GU=!1;if(mu){var U5;if(mu){var z5="oninput"in document;if(!z5){var M6=document.createElement("div");M6.setAttribute("oninput","return;"),z5=typeof M6.oninput=="function"}U5=z5}else U5=!1;GU=U5&&(!document.documentMode||9<document.documentMode)}function $6(){y0&&(y0.detachEvent("onpropertychange",YU),W0=y0=null)}function YU(e){if(e.propertyName==="value"&&qj(W0)){var t=[];HU(t,W0,e,AT(e)),kU(Kae,t)}}function Xae(e,t,n){e==="focusin"?($6(),y0=t,W0=n,y0.attachEvent("onpropertychange",YU)):e==="focusout"&&$6()}function Jae(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qj(W0)}function Qae(e,t){if(e==="click")return qj(t)}function eie(e,t){if(e==="input"||e==="change")return qj(t)}function tie(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var El=typeof Object.is=="function"?Object.is:tie;function q0(e,t){if(El(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!nE.call(t,a)||!El(e[a],t[a]))return!1}return!0}function D6(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function F6(e,t){var n=D6(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=D6(n)}}function KU(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?KU(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ZU(){for(var e=window,t=v_();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=v_(e.document)}return t}function LT(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function nie(e){var t=ZU(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&KU(n.ownerDocument.documentElement,n)){if(r!==null&&LT(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=F6(n,i);var o=F6(n,r);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var rie=mu&&"documentMode"in document&&11>=document.documentMode,Pm=null,wE=null,x0=null,_E=!1;function B6(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_E||Pm==null||Pm!==v_(r)||(r=Pm,"selectionStart"in r&&LT(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,510 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),x0&&q0(x0,r)||(x0=r,r=S_(wE,"onSelect"),0<r.length&&(t=new OT("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Pm)))}function R1(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Tm={animationend:R1("Animation","AnimationEnd"),animationiteration:R1("Animation","AnimationIteration"),animationstart:R1("Animation","AnimationStart"),transitionend:R1("Transition","TransitionEnd")},W5={},XU={};mu&&(XU=document.createElement("div").style,"AnimationEvent"in window||(delete Tm.animationend.animation,delete Tm.animationiteration.animation,delete Tm.animationstart.animation),"TransitionEvent"in window||delete Tm.transitionend.transition);function Vj(e){if(W5[e])return W5[e];if(!Tm[e])return e;var t=Tm[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in XU)return W5[e]=t[n];return e}var JU=Vj("animationend"),QU=Vj("animationiteration"),ez=Vj("animationstart"),tz=Vj("transitionend"),nz=new Map,U6="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 mf(e,t){nz.set(e,t),xp(t,[e])}for(var q5=0;q5<U6.length;q5++){var V5=U6[q5],aie=V5.toLowerCase(),iie=V5[0].toUpperCase()+V5.slice(1);mf(aie,"on"+iie)}mf(JU,"onAnimationEnd");mf(QU,"onAnimationIteration");mf(ez,"onAnimationStart");mf("dblclick","onDoubleClick");mf("focusin","onFocus");mf("focusout","onBlur");mf(tz,"onTransitionEnd");Ng("onMouseEnter",["mouseout","mouseover"]);Ng("onMouseLeave",["mouseout","mouseover"]);Ng("onPointerEnter",["pointerout","pointerover"]);Ng("onPointerLeave",["pointerout","pointerover"]);xp("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xp("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xp("onBeforeInput",["compositionend","keypress","textInput","paste"]);xp("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xp("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xp("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var a0="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(" "),sie=new Set("cancel close invalid load scroll toggle".split(" ").concat(a0));function z6(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,aae(r,t,void 0,e),e.currentTarget=null}function rz(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;z6(a,l,u),i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;z6(a,l,u),i=c}}}if(x_)throw e=vE,x_=!1,vE=null,e}function Vr(e,t){var n=t[kE];n===void 0&&(n=t[kE]=new Set);var r=e+"__bubble";n.has(r)||(az(t,e,2,!1),n.add(r))}function H5(e,t,n){var r=0;t&&(r|=4),az(n,e,r,t)}var I1="_reactListening"+Math.random().toString(36).slice(2);function V0(e){if(!e[I1]){e[I1]=!0,dU.forEach(function(n){n!=="selectionchange"&&(sie.has(n)||H5(n,!1,e),H5(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[I1]||(t[I1]=!0,H5("selectionchange",!1,t))}}function az(e,t,n,r){switch(UU(t)){case 1:var a=bae;break;case 4:a=wae;break;default:a=PT}n=a.bind(null,t,n,e),a=void 0,!gE||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function G5(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;
vendor: 2,535 bytes, line 37
37if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=gh(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}kU(function(){var u=i,d=AT(n),f=[];e:{var p=nz.get(e);if(p!==void 0){var h=OT,m=e;switch(e){case"keypress":if(Uw(n)===0)break e;case"keydown":case"keyup":h=Mae;break;case"focusin":m="focus",h=B5;break;case"focusout":m="blur",h=B5;break;case"beforeblur":case"afterblur":h=B5;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":h=P6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Sae;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Fae;break;case JU:case QU:case ez:h=kae;break;case tz:h=Uae;break;case"scroll":h=_ae;break;case"wheel":h=Wae;break;case"copy":case"cut":case"paste":h=Cae;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=O6}var g=(t&4)!==0,v=!g&&e==="scroll",y=g?p!==null?p+"Capture":null:p;g=[];for(var b=u,w;b!==null;){w=b;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,y!==null&&(j=F0(b,y),j!=null&&g.push(H0(b,j,w)))),v)break;b=b.return}0<g.length&&(p=new h(p,m,null,n,d),f.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==pE&&(m=n.relatedTarget||n.fromElement)&&(gh(m)||m[gu]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=u,m=m?gh(m):null,m!==null&&(v=bp(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=u),h!==m)){if(g=P6,j="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(g=O6,j="onPointerLeave",y="onPointerEnter",b="pointer"),v=h==null?p:Om(h),w=m==null?p:Om(m),p=new g(j,b+"leave",h,n,d),p.target=v,p.relatedTarget=w,j=null,gh(d)===u&&(g=new g(y,b+"enter",m,n,d),g.target=w,g.relatedTarget=v,j=g),v=j,h&&m)t:{for(g=h,y=m,b=0,w=g;w;w=Xp(w))b++;for(w=0,j=y;j;j=Xp(j))w++;for(;0<b-w;)g=Xp(g),b--;for(;0<w-b;)y=Xp(y),w--;for(;b--;){if(g===y||y!==null&&g===y.alternate)break t;g=Xp(g),y=Xp(y)}g=null}else g=null;h!==null&&W6(f,p,h,g,!1),m!==null&&v!==null&&W6(f,v,m,g,!0)}}
vendor: 4,595 bytes, lines 37-38
37e:{if(p=u?Om(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var S=Zae;else if(L6(p))if(GU)S=eie;else{S=Jae;var A=Xae}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=Qae);if(S&&(S=S(e,u))){HU(f,S,n,d);break e}A&&A(e,p,u),e==="focusout"&&(A=p._wrapperState)&&A.controlled&&p.type==="number"&&cE(p,"number",p.value)}switch(A=u?Om(u):window,e){case"focusin":(L6(A)||A.contentEditable==="true")&&(Pm=A,wE=u,x0=null);break;case"focusout":x0=wE=Pm=null;break;case"mousedown":_E=!0;break;case"contextmenu":case"mouseup":case"dragend":_E=!1,B6(f,n,d);break;case"selectionchange":if(rie)break;case"keydown":case"keyup":B6(f,n,d)}var E;if(IT)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Cm?qU(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(WU&&n.locale!=="ko"&&(Cm||k!=="onCompositionStart"?k==="onCompositionEnd"&&Cm&&(E=zU()):(Ad=d,TT="value"in Ad?Ad.value:Ad.textContent,Cm=!0)),A=S_(u,k),0<A.length&&(k=new T6(k,e,null,n,d),f.push({event:k,listeners:A}),E?k.data=E:(E=VU(n),E!==null&&(k.data=E)))),(E=Vae?Hae(e,n):Gae(e,n))&&(u=S_(u,"onBeforeInput"),0<u.length&&(d=new T6("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=E))}rz(f,t)})}function H0(e,t,n){return{instance:e,listener:t,currentTarget:n}}function S_(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=F0(e,n),i!=null&&r.unshift(H0(e,i,a)),i=F0(e,t),i!=null&&r.push(H0(e,i,a))),e=e.return}return r}function Xp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function W6(e,t,n,r,a){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,a?(c=F0(n,i),c!=null&&o.unshift(H0(n,c,l))):a||(c=F0(n,i),c!=null&&o.push(H0(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var oie=/\r\n?/g,lie=/\u0000|\uFFFD/g;function q6(e){return(typeof e=="string"?e:""+e).replace(oie,`
38`).replace(lie,"")}function L1(e,t,n){if(t=q6(t),q6(e)!==t&&n)throw Error(lt(425))}function N_(){}var jE=null,SE=null;function NE(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var AE=typeof setTimeout=="function"?setTimeout:void 0,cie=typeof clearTimeout=="function"?clearTimeout:void 0,V6=typeof Promise=="function"?Promise:void 0,uie=typeof queueMicrotask=="function"?queueMicrotask:typeof V6<"u"?function(e){return V6.resolve(null).then(e).catch(die)}:AE;function die(e){setTimeout(function(){throw e})}function Y5(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),z0(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);z0(t)}function Fd(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function H6(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Cv=Math.random().toString(36).slice(2),tc="__reactFiber$"+Cv,G0="__reactProps$"+Cv,gu="__reactContainer$"+Cv,kE="__reactEvents$"+Cv,fie="__reactListeners$"+Cv,hie="__reactHandles$"+Cv;function gh(e){var t=e[tc];if(t)return t;for(var n=e.parentNode;n;){if(t=n[gu]||n[tc]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=H6(e);e!==null;){if(n=e[tc])return n;e=H6(e)}return t}e=n,n=e.parentNode}return null}function bb(e){return e=e[tc]||e[gu],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Om(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(lt(33))}function Hj(e){return e[G0]||null}var EE=[],Rm=-1;function gf(e){return{current:e}}function Kr(e){0>Rm||(e.current=EE[Rm],EE[Rm]=null,Rm--)}function Fr(e,t){Rm++,EE[Rm]=e.current,e.current=t}var nf={},Ji=gf(nf),Is=gf(!1),Gh=nf;function Ag(e,t){var n=e.type.contextTypes;if(!n)return nf;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a
vendor: 4,219 bytes, line 38
38),a}function Ls(e){return e=e.childContextTypes,e!=null}function A_(){Kr(Is),Kr(Ji)}function G6(e,t,n){if(Ji.current!==nf)throw Error(lt(168));Fr(Ji,t),Fr(Is,n)}function iz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(lt(108,Xre(e)||"Unknown",a));return pa({},n,r)}function k_(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||nf,Gh=Ji.current,Fr(Ji,e),Fr(Is,Is.current),!0}function Y6(e,t,n){var r=e.stateNode;if(!r)throw Error(lt(169));n?(e=iz(e,t,Gh),r.__reactInternalMemoizedMergedChildContext=e,Kr(Is),Kr(Ji),Fr(Ji,e)):Kr(Is),Fr(Is,n)}var Zc=null,Gj=!1,K5=!1;function sz(e){Zc===null?Zc=[e]:Zc.push(e)}function pie(e){Gj=!0,sz(e)}function vf(){if(!K5&&Zc!==null){K5=!0;var e=0,t=_r;try{var n=Zc;for(_r=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Zc=null,Gj=!1}catch(a){throw Zc!==null&&(Zc=Zc.slice(e+1)),TU(kT,vf),a}finally{_r=t,K5=!1}}return null}var Im=[],Lm=0,E_=null,C_=0,Io=[],Lo=0,Yh=null,nu=1,ru="";function Qf(e,t){Im[Lm++]=C_,Im[Lm++]=E_,E_=e,C_=t}function oz(e,t,n){Io[Lo++]=nu,Io[Lo++]=ru,Io[Lo++]=Yh,Yh=e;var r=nu;e=ru;var a=32-Sl(r)-1;r&=~(1<<a),n+=1;var i=32-Sl(t)+a;if(30<i){var o=a-a%5;i=(r&(1<<o)-1).toString(32),r>>=o,a-=o,nu=1<<32-Sl(t)+a|n<<a|r,ru=i+e}else nu=1<<i|n<<a|r,ru=e}function MT(e){e.return!==null&&(Qf(e,1),oz(e,1,0))}function $T(e){for(;e===E_;)E_=Im[--Lm],Im[Lm]=null,C_=Im[--Lm],Im[Lm]=null;for(;e===Yh;)Yh=Io[--Lo],Io[Lo]=null,ru=Io[--Lo],Io[Lo]=null,nu=Io[--Lo],Io[Lo]=null}var uo=null,oo=null,na=!1,_l=null;function lz(e,t){var n=Fo(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function K6(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,uo=e,oo=Fd(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,uo=e,oo=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Yh!==null?{id:nu,overflow:ru}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Fo(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,uo=e,oo=null,!0):!1;default:return!1}}function CE(e){return(e.mode&1)!==0&&(e.flags&128)===0}function PE(e){if(na){var t=oo;if(t){var n=t;if(!K6(e,t)){if(CE(e))throw Error(lt(418));t=Fd(n.nextSibling);var r=uo;t&&K6(e,t)?lz(r,n):(e.flags=e.flags&-4097|2,na=!1,uo=e)}}else{if(CE(e))throw Error(lt(418));e.flags=e.flags&-4097|2,na=!1,uo=e}}}function Z6(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;uo=e}function M1(e){if(e!==uo)return!1;if(!na)return Z6(e),na=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!NE(e.type,e.memoizedProps)),t&&(t=oo)){if(CE(e))throw cz(),Error(lt(418));for(;t;)lz(e,t),t=Fd(t.nextSibling)}if(Z6(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(lt(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){oo=Fd(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}oo=null}}else oo=uo?Fd(e.stateNode.nextSibling):null;return!0}function cz(){for(var e=oo;e;)e=Fd(e.nextSibling)}function kg(){oo=uo=null,na=!1}function DT(e){_l===null?_l=[e]:_l.push(e)}var mie=Eu.ReactCurrentBatchConfig;function Ay(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(lt(309));var r=n.stateNode}if(!r)throw Error(lt(147,e));var a=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(lt(284));if(!n._owner)throw Error(lt(290,e))}return e}function $1(e,t){throw e=Object.prototype.toString.call(t),Error(lt(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function X6(e){var t=e._init;return t(e._payload)}function uz(e){function t(y,b){if(e){var w=y.deletions;w===null?(y.deletions=[b],y.flags|=16):w.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;
vendor: 3,509 bytes, line 38
38)t(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function a(y,b){return y=Wd(y,b),y.index=0,y.sibling=null,y}function i(y,b,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<b?(y.flags|=2,b):w):(y.flags|=2,b)):(y.flags|=1048576,b)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,w,j){return b===null||b.tag!==6?(b=nA(w,y.mode,j),b.return=y,b):(b=a(b,w),b.return=y,b)}function c(y,b,w,j){var S=w.type;return S===Em?d(y,b,w.props.children,j,w.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===sd&&X6(S)===b.type)?(j=a(b,w.props),j.ref=Ay(y,b,w),j.return=y,j):(j=Yw(w.type,w.key,w.props,null,y.mode,j),j.ref=Ay(y,b,w),j.return=y,j)}function u(y,b,w,j){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=rA(w,y.mode,j),b.return=y,b):(b=a(b,w.children||[]),b.return=y,b)}function d(y,b,w,j,S){return b===null||b.tag!==7?(b=Fh(w,y.mode,j,S),b.return=y,b):(b=a(b,w),b.return=y,b)}function f(y,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=nA(""+b,y.mode,w),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case A1:return w=Yw(b.type,b.key,b.props,null,y.mode,w),w.ref=Ay(y,null,b),w.return=y,w;case km:return b=rA(b,y.mode,w),b.return=y,b;case sd:var j=b._init;return f(y,j(b._payload),w)}if(n0(b)||wy(b))return b=Fh(b,y.mode,w,null),b.return=y,b;$1(y,b)}return null}function p(y,b,w,j){var S=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:l(y,b,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case A1:return w.key===S?c(y,b,w,j):null;case km:return w.key===S?u(y,b,w,j):null;case sd:return S=w._init,p(y,b,S(w._payload),j)}if(n0(w)||wy(w))return S!==null?null:d(y,b,w,j,null);$1(y,w)}return null}function h(y,b,w,j,S){if(typeof j=="string"&&j!==""||typeof j=="number")return y=y.get(w)||null,l(b,y,""+j,S);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case A1:return y=y.get(j.key===null?w:j.key)||null,c(b,y,j,S);case km:return y=y.get(j.key===null?w:j.key)||null,u(b,y,j,S);case sd:var A=j._init;return h(y,b,w,A(j._payload),S)}if(n0(j)||wy(j))return y=y.get(w)||null,d(b,y,j,S,null);$1(b,j)}return null}function m(y,b,w,j){for(var S=null,A=null,E=b,k=b=0,P=null;E!==null&&k<w.length;k++){E.index>k?(P=E,E=null):P=E.sibling;var R=p(y,E,w[k],j);if(R===null){E===null&&(E=P);break}e&&E&&R.alternate===null&&t(y,E),b=i(R,b,k),A===null?S=R:A.sibling=R,A=R,E=P}if(k===w.length)return n(y,E),na&&Qf(y,k),S;if(E===null){for(;k<w.length;k++)E=f(y,w[k],j),E!==null&&(b=i(E,b,k),A===null?S=E:A.sibling=E,A=E);return na&&Qf(y,k),S}for(E=r(y,E);k<w.length;k++)P=h(E,y,k,w[k],j),P!==null&&(e&&P.alternate!==null&&E.delete(P.key===null?k:P.key),b=i(P,b,k),A===null?S=P:A.sibling=P,A=P);return e&&E.forEach(function(C){return t(y,C)}),na&&Qf(y,k),S}function g(y,b,w,j){var S=wy(w);if(typeof S!="function")throw Error(lt(150));if(w=S.call(w),w==null)throw Error(lt(151));for(var A=S=null,E=b,k=b=0,P=null,R=w.next();E!==null&&!R.done;k++,R=w.next()){E.index>k?(P=E,E=null):P=E.sibling;var C=p(y,E,R.value,j);if(C===null){E===null&&(E=P);break}e&&E&&C.alternate===null&&t(y,E),b=i(C,b,k),A===null?S=C:A.sibling=C,A=C,E=P}if(R.done)return n(y,E),na&&Qf(y,k),S;if(E===null){for(;!R.done;k++,R=w.next())R=f(y,R.value,j),R!==null&&(b=i(R,b,k),A===null?S=R:A.sibling=R,A=R);return na&&Qf(y,k),S}for(E=r(y,E);!R.done;
vendor: 9,945 bytes, line 38
38k++,R=w.next())R=h(E,y,k,R.value,j),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?k:R.key),b=i(R,b,k),A===null?S=R:A.sibling=R,A=R);return e&&E.forEach(function(I){return t(y,I)}),na&&Qf(y,k),S}function v(y,b,w,j){if(typeof w=="object"&&w!==null&&w.type===Em&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case A1:e:{for(var S=w.key,A=b;A!==null;){if(A.key===S){if(S=w.type,S===Em){if(A.tag===7){n(y,A.sibling),b=a(A,w.props.children),b.return=y,y=b;break e}}else if(A.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===sd&&X6(S)===A.type){n(y,A.sibling),b=a(A,w.props),b.ref=Ay(y,A,w),b.return=y,y=b;break e}n(y,A);break}else t(y,A);A=A.sibling}w.type===Em?(b=Fh(w.props.children,y.mode,j,w.key),b.return=y,y=b):(j=Yw(w.type,w.key,w.props,null,y.mode,j),j.ref=Ay(y,b,w),j.return=y,y=j)}return o(y);case km:e:{for(A=w.key;b!==null;){if(b.key===A)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(y,b.sibling),b=a(b,w.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=rA(w,y.mode,j),b.return=y,y=b}return o(y);case sd:return A=w._init,v(y,b,A(w._payload),j)}if(n0(w))return m(y,b,w,j);if(wy(w))return g(y,b,w,j);$1(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(y,b.sibling),b=a(b,w),b.return=y,y=b):(n(y,b),b=nA(w,y.mode,j),b.return=y,y=b),o(y)):n(y,b)}return v}var Eg=uz(!0),dz=uz(!1),P_=gf(null),T_=null,Mm=null,FT=null;function BT(){FT=Mm=T_=null}function UT(e){var t=P_.current;Kr(P_),e._currentValue=t}function TE(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Zm(e,t){T_=e,FT=Mm=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ps=!0),e.firstContext=null)}function qo(e){var t=e._currentValue;if(FT!==e)if(e={context:e,memoizedValue:t,next:null},Mm===null){if(T_===null)throw Error(lt(308));Mm=e,T_.dependencies={lanes:0,firstContext:e}}else Mm=Mm.next=e;return t}var vh=null;function zT(e){vh===null?vh=[e]:vh.push(e)}function fz(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,zT(t)):(n.next=a.next,a.next=n),t.interleaved=n,vu(e,r)}function vu(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var od=!1;function WT(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hz(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ou(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bd(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Qn&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,vu(e,n)}return a=r.interleaved,a===null?(t.next=t,zT(r)):(t.next=a.next,a.next=t),r.interleaved=t,vu(e,n)}function zw(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ET(e,n)}}function J6(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function O_(e,t,n,r){var a=e.updateQueue;od=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;o=0,d=u=c=null,l=i;do{var p=l.lane,h=l.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,g=l;switch(p=t,h=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(h,f,p);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,p=typeof m=="function"?m.call(h,f,p):m,p==null)break e;f=pa({},f,p);break e;case 2:od=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[l]:p.push(l))}else h={eventTime:h,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=h,c=f):d=d.next=h,o|=p;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;p=l,l=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);Zh|=o,e.lanes=o,e.memoizedState=f}}function Q6(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(lt(191,a));a.call(r)}}}var wb={},dc=gf(wb),Y0=gf(wb),K0=gf(wb);function yh(e){if(e===wb)throw Error(lt(174));return e}function qT(e,t){switch(Fr(K0,t),Fr(Y0,e),Fr(dc,wb),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:dE(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=dE(t,e)}Kr(dc),Fr(dc,t)}function Cg(){Kr(dc),Kr(Y0),Kr(K0)}function pz(e){yh(K0.current);var t=yh(dc.current),n=dE(t,e.type);t!==n&&(Fr(Y0,e),Fr(dc,n))}function VT(e){Y0.current===e&&(Kr(dc),Kr(Y0))}var oa=gf(0);function R_(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Z5=[];function HT(){for(var e=0;e<Z5.length;e++)Z5[e]._workInProgressVersionPrimary=null;Z5.length=0}var Ww=Eu.ReactCurrentDispatcher,X5=Eu.ReactCurrentBatchConfig,Kh=0,da=null,ai=null,mi=null,I_=!1,b0=!1,Z0=0,gie=0;function Ui(){throw Error(lt(321))}function GT(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!El(e[n],t[n]))return!1;return!0}function YT(e,t,n,r,a,i){if(Kh=i,da=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ww.current=e===null||e.memoizedState===null?bie:wie,e=n(r,a),b0){i=0;do{if(b0=!1,Z0=0,25<=i)throw Error(lt(301));i+=1,mi=ai=null,t.updateQueue=null,Ww.current=_ie,e=n(r,a)}while(b0)}if(Ww.current=L_,t=ai!==null&&ai.next!==null,Kh=0,mi=ai=da=null,I_=!1,t)throw Error(lt(300));return e}function KT(){var e=Z0!==0;return Z0=0,e}function Kl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mi===null?da.memoizedState=mi=e:mi=mi.next=e,mi}function Vo(){if(ai===null){var e=da.alternate;e=e!==null?e.memoizedState:null}else e=ai.next;var t=mi===null?da.memoizedState:mi.next;if(t!==null)mi=t,ai=e;else{if(e===null)throw Error(lt(310));ai=e,e={memoizedState:ai.memoizedState,baseState:ai.baseState,baseQueue:ai.baseQueue,queue:ai.queue,next:null},mi===null?da.memoizedState=mi=e:mi=mi.next=e}return mi}function X0(e,t){return typeof t=="function"?t(e):t}function J5(e){var t=Vo(),n=t.queue;if(n===null)throw Error(lt(311));n.lastRenderedReducer=e;var r=ai,a=r.baseQueue,i=n.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}r.baseQueue=a=i,n.pending=null}if(a!==null){i=a.next,r=r.baseState;var l=o=null,c=null,u=i;do{var d=u.lane;if((Kh&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=r):c=c.next=f,da.lanes|=d,Zh|=d}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=l,El(r,t.memoizedState)||(Ps=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do i=a.lane,da.lanes|=i,Zh|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Q5(e){var t=Vo(),n=t.queue;if(n===null)throw Error(lt(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);El(i,t.memoizedState)||(Ps=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function mz(){}function gz(e,t){var n=da,r=Vo(),a=t(),i=!El(r.memoizedState,a);if(i&&(r.memoizedState=a,Ps=!0),r=r.queue,ZT(xz.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||mi!==null&&mi.memoizedState.tag&1){if(n.flags|=2048,J0(9,yz.bind(null,n,r,a,t),void 0,null),xi===null)throw Error(lt(349));Kh&30||vz(n,t,a)}return a}function vz(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=da.updateQueue,t===null?(t={lastEffect:null,stores:null},da.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function yz(e,t,n,r){t.value=n,t.getSnapshot=r,bz(t)&&wz(e)}function xz(e,t,n){return n(function(){bz(t)&&wz(e)})}function bz(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!El(e,n)}catch{return!0}}function wz(e){var t=vu(e,1);t!==null&&Nl(t,e,1,-1)}function eL(e){var t=Kl();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:X0,lastRenderedState:e}
vendor: 5,036 bytes, line 38
38,t.queue=e,e=e.dispatch=xie.bind(null,da,e),[t.memoizedState,e]}function J0(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=da.updateQueue,t===null?(t={lastEffect:null,stores:null},da.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function _z(){return Vo().memoizedState}function qw(e,t,n,r){var a=Kl();da.flags|=e,a.memoizedState=J0(1|t,n,void 0,r===void 0?null:r)}function Yj(e,t,n,r){var a=Vo();r=r===void 0?null:r;var i=void 0;if(ai!==null){var o=ai.memoizedState;if(i=o.destroy,r!==null&&GT(r,o.deps)){a.memoizedState=J0(t,n,i,r);return}}da.flags|=e,a.memoizedState=J0(1|t,n,i,r)}function tL(e,t){return qw(8390656,8,e,t)}function ZT(e,t){return Yj(2048,8,e,t)}function jz(e,t){return Yj(4,2,e,t)}function Sz(e,t){return Yj(4,4,e,t)}function Nz(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Az(e,t,n){return n=n!=null?n.concat([e]):null,Yj(4,4,Nz.bind(null,t,e),n)}function XT(){}function kz(e,t){var n=Vo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&GT(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ez(e,t){var n=Vo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&GT(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Cz(e,t,n){return Kh&21?(El(n,t)||(n=IU(),da.lanes|=n,Zh|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ps=!0),e.memoizedState=n)}function vie(e,t){var n=_r;_r=n!==0&&4>n?n:4,e(!0);var r=X5.transition;X5.transition={};try{e(!1),t()}finally{_r=n,X5.transition=r}}function Pz(){return Vo().memoizedState}function yie(e,t,n){var r=zd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Tz(e))Oz(t,n);else if(n=fz(e,t,n,r),n!==null){var a=ms();Nl(n,e,r,a),Rz(n,t,r)}}function xie(e,t,n){var r=zd(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Tz(e))Oz(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(a.hasEagerState=!0,a.eagerState=l,El(l,o)){var c=t.interleaved;c===null?(a.next=a,zT(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=fz(e,t,a,r),n!==null&&(a=ms(),Nl(n,e,r,a),Rz(n,t,r))}}function Tz(e){var t=e.alternate;return e===da||t!==null&&t===da}function Oz(e,t){b0=I_=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rz(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ET(e,n)}}var L_={readContext:qo,useCallback:Ui,useContext:Ui,useEffect:Ui,useImperativeHandle:Ui,useInsertionEffect:Ui,useLayoutEffect:Ui,useMemo:Ui,useReducer:Ui,useRef:Ui,useState:Ui,useDebugValue:Ui,useDeferredValue:Ui,useTransition:Ui,useMutableSource:Ui,useSyncExternalStore:Ui,useId:Ui,unstable_isNewReconciler:!1},bie={readContext:qo,useCallback:function(e,t){return Kl().memoizedState=[e,t===void 0?null:t],e},useContext:qo,useEffect:tL,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,qw(4194308,4,Nz.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qw(4194308,4,e,t)},useInsertionEffect:function(e,t){return qw(4,2,e,t)},useMemo:function(e,t){var n=Kl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Kl();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yie.bind(null,da,e),[r.memoizedState,e]},useRef:function(e){var t=Kl();return e={current:e},t.memoizedState=e},useState:eL,useDebugValue:XT,useDeferredValue:function(e){return Kl().memoizedState=e},useTransition:function(){var e=eL(!1),t=e[0];return e=vie.bind(null,e[1]),Kl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=da,a=Kl();if(na){if(n===void 0)throw Error(lt(407));n=n()}else{if(n=t(),xi===null)throw Error(lt(349));Kh&30||vz(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,tL(xz.bind(null,r,i,e),[e]),r.flags|=2048,J0(9,yz.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Kl(),t=xi.identifierPrefix;if(na){var n=ru,r=nu;n=(r&~(1<<32-Sl(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Z0++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=gie++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},wie={readContext:qo,useCallback:kz,useContext:qo,useEffect:ZT,useImperativeHandle:Az,useInsertionEffect:jz,useLayoutEffect:Sz,useMemo:Ez,useReducer:J5,useRef:_z,useState:function(){return J5(X0)},useDebugValue:XT,useDeferredValue:function(e){var t=Vo();return Cz(t,ai.memoizedState,e)},useTransition:function(){var e=J5(X0)[0],t=Vo().memoizedState;return[e,t]},useMutableSource:mz,useSyncExternalStore:gz,useId:Pz,unstable_isNewReconciler:!1},_ie={readContext:qo,useCallback:kz,useContext:qo,useEffect:ZT,useImperativeHandle:Az,useInsertionEffect:jz,useLayoutEffect:Sz,useMemo:Ez,useReducer:Q5,useRef
vendor: 5,974 bytes, lines 38-40
38:_z,useState:function(){return Q5(X0)},useDebugValue:XT,useDeferredValue:function(e){var t=Vo();return ai===null?t.memoizedState=e:Cz(t,ai.memoizedState,e)},useTransition:function(){var e=Q5(X0)[0],t=Vo().memoizedState;return[e,t]},useMutableSource:mz,useSyncExternalStore:gz,useId:Pz,unstable_isNewReconciler:!1};function pl(e,t){if(e&&e.defaultProps){t=pa({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function OE(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:pa({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Kj={isMounted:function(e){return(e=e._reactInternals)?bp(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ms(),a=zd(e),i=ou(r,a);i.payload=t,n!=null&&(i.callback=n),t=Bd(e,i,a),t!==null&&(Nl(t,e,a,r),zw(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ms(),a=zd(e),i=ou(r,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Bd(e,i,a),t!==null&&(Nl(t,e,a,r),zw(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ms(),r=zd(e),a=ou(n,r);a.tag=2,t!=null&&(a.callback=t),t=Bd(e,a,r),t!==null&&(Nl(t,e,r,n),zw(t,e,r))}};function nL(e,t,n,r,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!q0(n,r)||!q0(a,i):!0}function Iz(e,t,n){var r=!1,a=nf,i=t.contextType;return typeof i=="object"&&i!==null?i=qo(i):(a=Ls(t)?Gh:Ji.current,r=t.contextTypes,i=(r=r!=null)?Ag(e,a):nf),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Kj,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function rL(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Kj.enqueueReplaceState(t,t.state,null)}function RE(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},WT(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=qo(i):(i=Ls(t)?Gh:Ji.current,a.context=Ag(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(OE(e,t,i,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Kj.enqueueReplaceState(a,a.state,null),O_(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Pg(e,t){try{var n="",r=t;do n+=Zre(r),r=r.return;while(r);var a=n}catch(i){a=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:e,source:t,stack:a,digest:null}}function eA(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function IE(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var jie=typeof WeakMap=="function"?WeakMap:Map;function Lz(e,t,n){n=ou(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$_||($_=!0,qE=r),IE(e,t)},n}function Mz(e,t,n){n=ou(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){IE(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){IE(e,t),typeof r!="function"&&(Ud===null?Ud=new Set([this]):Ud.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function aL(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new jie;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=$ie.bind(null,e,t,n),t.then(e,e))}function iL(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function sL(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ou(-1,1),t.tag=2,Bd(n,t,1))),n.lanes|=1),e)}var Sie=Eu.ReactCurrentOwner,Ps=!1;function ls(e,t,n,r){t.child=e===null?dz(t,null,n,r):Eg(t,e.child,n,r)}function oL(e,t,n,r,a){n=n.render;var i=t.ref;return Zm(t,a),r=YT(e,t,n,r,i,a),n=KT(),e!==null&&!Ps?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,yu(e,t,a)):(na&&n&&MT(t),t.flags|=1,ls(e,t,r,a),t.child)}function lL(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!iO(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,$z(e,t,i,r,a)):(e=Yw(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:q0,n(o,r)&&e.ref===t.ref)return yu(e,t,a)}return t.flags|=1,e=Wd(i,r),e.ref=t.ref,e.return=t,t.child=e}function $z(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(q0(i,r)&&e.ref===t.ref)if(Ps=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(Ps=!0);else return t.lanes=e.lanes,yu(e,t,a)}return LE(e,t,n,r,a)}function Dz(e,t,n){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Fr(Dm,to),to|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Fr(Dm,to),to|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Fr(Dm,to),to|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Fr(Dm,to),to|=r;return ls(e,t,a,n),t.child}function Fz(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 12,555 bytes, line 40
40function LE(e,t,n,r,a){var i=Ls(n)?Gh:Ji.current;return i=Ag(t,i),Zm(t,a),n=YT(e,t,n,r,i,a),r=KT(),e!==null&&!Ps?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,yu(e,t,a)):(na&&r&&MT(t),t.flags|=1,ls(e,t,n,a),t.child)}function cL(e,t,n,r,a){if(Ls(n)){var i=!0;k_(t)}else i=!1;if(Zm(t,a),t.stateNode===null)Vw(e,t),Iz(t,n,r),RE(t,n,r,a),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=qo(u):(u=Ls(n)?Gh:Ji.current,u=Ag(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&rL(t,o,r,u),od=!1;var p=t.memoizedState;o.state=p,O_(t,r,o,a),c=t.memoizedState,l!==r||p!==c||Is.current||od?(typeof d=="function"&&(OE(t,n,d,r),c=t.memoizedState),(l=od||nL(t,n,l,r,p,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,hz(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:pl(t.type,l),o.props=u,f=t.pendingProps,p=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=qo(c):(c=Ls(n)?Gh:Ji.current,c=Ag(t,c));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||p!==c)&&rL(t,o,r,c),od=!1,p=t.memoizedState,o.state=p,O_(t,r,o,a);var m=t.memoizedState;l!==f||p!==m||Is.current||od?(typeof h=="function"&&(OE(t,n,h,r),m=t.memoizedState),(u=od||nL(t,n,u,r,p,m,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return ME(e,t,n,r,i,a)}function ME(e,t,n,r,a,i){Fz(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&Y6(t,n,!1),yu(e,t,i);r=t.stateNode,Sie.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Eg(t,e.child,null,i),t.child=Eg(t,null,l,i)):ls(e,t,l,i),t.memoizedState=r.state,a&&Y6(t,n,!0),t.child}function Bz(e){var t=e.stateNode;t.pendingContext?G6(e,t.pendingContext,t.pendingContext!==t.context):t.context&&G6(e,t.context,!1),qT(e,t.containerInfo)}function uL(e,t,n,r,a){return kg(),DT(a),t.flags|=256,ls(e,t,n,r),t.child}var $E={dehydrated:null,treeContext:null,retryLane:0};function DE(e){return{baseLanes:e,cachePool:null,transitions:null}}function Uz(e,t,n){var r=t.pendingProps,a=oa.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Fr(oa,a&1),e===null)return PE(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Jj(o,r,0,null),e=Fh(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=DE(n),t.memoizedState=$E,e):JT(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return Nie(e,t,o,r,l,a,n);if(i){i=r.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Wd(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=Wd(l,i):(i=Fh(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?DE(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=$E,r}return i=e.child,e=i.sibling,r=Wd(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function JT(e,t){return t=Jj({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function D1(e,t,n,r){return r!==null&&DT(r),Eg(t,e.child,null,n),e=JT(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nie(e,t,n,r,a,i,o){if(n)return t.flags&256?(t.flags&=-257,r=eA(Error(lt(422))),D1(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=Jj({mode:"visible",children:r.children},a,0,null),i=Fh(i,a,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Eg(t,e.child,null,o),t.child.memoizedState=DE(o),t.memoizedState=$E,i);if(!(t.mode&1))return D1(e,t,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(lt(419)),r=eA(i,r,void 0),D1(e,t,o,r)}if(l=(o&e.childLanes)!==0,Ps||l){if(r=xi,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,vu(e,a),Nl(r,e,a,-1))}return aO(),r=eA(Error(lt(421))),D1(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=Die.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,oo=Fd(a.nextSibling),uo=t,na=!0,_l=null,e!==null&&(Io[Lo++]=nu,Io[Lo++]=ru,Io[Lo++]=Yh,nu=e.id,ru=e.overflow,Yh=t),t=JT(t,r.children),t.flags|=4096,t)}function dL(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),TE(e.return,t,n)}function tA(e,t,n,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function zz(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(ls(e,t,r.children,n),r=oa.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dL(e,n,t);else if(e.tag===19)dL(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Fr(oa,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&R_(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),tA(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&R_(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}tA(t,!0,n,null,i);break;case"together":tA(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vw(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yu(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Zh|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(lt(153));if(t.child!==null){for(e=t.child,n=Wd(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wd(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Aie(e,t,n){switch(t.tag){case 3:Bz(t),kg();break;case 5:pz(t);break;case 1:Ls(t.type)&&k_(t);break;case 4:qT(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;Fr(P_,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Fr(oa,oa.current&1),t.flags|=128,null):n&t.child.childLanes?Uz(e,t,n):(Fr(oa,oa.current&1),e=yu(e,t,n),e!==null?e.sibling:null);Fr(oa,oa.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return zz(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Fr(oa,oa.current),r)break;return null;case 22:case 23:return t.lanes=0,Dz(e,t,n)}return yu(e,t,n)}var Wz,FE,qz,Vz;Wz=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};FE=function(){};qz=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,yh(dc.current);var i=null;switch(n){case"input":a=oE(e,a),r=oE(e,r),i=[];break;case"select":a=pa({},a,{value:void 0}),r=pa({},r,{value:void 0}),i=[];break;case"textarea":a=uE(e,a),r=uE(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=N_)}fE(n,r);var o;n=null;for(u in a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&($0.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=a!=null?a[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&($0.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Vr("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Vz=function(e,t,n,r){n!==r&&(t.flags|=4)};function ky(e,t){if(!na)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zi(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function kie(e,t,n){var r=t.pendingProps;switch($T(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zi(t),null;case 1:return Ls(t.type)&&A_(),zi(t),null;case 3:return r=t.stateNode,Cg(),Kr(Is),Kr(Ji),HT(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(M1(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_l!==null&&(GE(_l),_l=null))),FE(e,t),zi(t),null;case 5:VT(t);var a=yh(K0.current);if(n=t.type,e!==null&&t.stateNode!=null)qz(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(lt(166));return zi(t),null}if(e=yh(dc.current),M1(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[tc]=t,r[G0]=i,e=(t.mode&1)!==0,n){case"dialog":Vr("cancel",r),Vr("close",r);break;case"iframe":case"object":case"embed":Vr("load",r);break;case"video":case"audio":for(a=0;a<a0.length;
vendor: 29,405 bytes, line 40
40a++)Vr(a0[a],r);break;case"source":Vr("error",r);break;case"img":case"image":case"link":Vr("error",r),Vr("load",r);break;case"details":Vr("toggle",r);break;case"input":b6(r,i),Vr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Vr("invalid",r);break;case"textarea":_6(r,i),Vr("invalid",r)}fE(n,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&L1(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&L1(r.textContent,l,e),a=["children",""+l]):$0.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Vr("scroll",r)}switch(n){case"input":k1(r),w6(r,i,!0);break;case"textarea":k1(r),j6(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=N_)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=xU(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[tc]=t,e[G0]=r,Wz(e,t,!1,!1),t.stateNode=e;e:{switch(o=hE(n,r),n){case"dialog":Vr("cancel",e),Vr("close",e),a=r;break;case"iframe":case"object":case"embed":Vr("load",e),a=r;break;case"video":case"audio":for(a=0;a<a0.length;a++)Vr(a0[a],e);a=r;break;case"source":Vr("error",e),a=r;break;case"img":case"image":case"link":Vr("error",e),Vr("load",e),a=r;break;case"details":Vr("toggle",e),a=r;break;case"input":b6(e,r),a=oE(e,r),Vr("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=pa({},r,{value:void 0}),Vr("invalid",e);break;case"textarea":_6(e,r),a=uE(e,r),Vr("invalid",e);break;default:a=r}fE(n,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?_U(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&bU(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&D0(e,c):typeof c=="number"&&D0(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&($0.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Vr("scroll",e):c!=null&&_T(e,i,c,o))}switch(n){case"input":k1(e),w6(e,r,!1);break;case"textarea":k1(e),j6(e);break;case"option":r.value!=null&&e.setAttribute("value",""+tf(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Hm(e,!!r.multiple,i,!1):r.defaultValue!=null&&Hm(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=N_)}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&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return zi(t),null;case 6:if(e&&t.stateNode!=null)Vz(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(lt(166));if(n=yh(K0.current),yh(dc.current),M1(t)){if(r=t.stateNode,n=t.memoizedProps,r[tc]=t,(i=r.nodeValue!==n)&&(e=uo,e!==null))switch(e.tag){case 3:L1(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&L1(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[tc]=t,t.stateNode=r}return zi(t),null;case 13:if(Kr(oa),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(na&&oo!==null&&t.mode&1&&!(t.flags&128))cz(),kg(),t.flags|=98560,i=!1;else if(i=M1(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(lt(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(lt(317));i[tc]=t}else kg(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zi(t),i=!1}else _l!==null&&(GE(_l),_l=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||oa.current&1?oi===0&&(oi=3):aO())),t.updateQueue!==null&&(t.flags|=4),zi(t),null);case 4:return Cg(),FE(e,t),e===null&&V0(t.stateNode.containerInfo),zi(t),null;case 10:return UT(t.type._context),zi(t),null;case 17:return Ls(t.type)&&A_(),zi(t),null;case 19:if(Kr(oa),i=t.memoizedState,i===null)return zi(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)ky(i,!1);else{if(oi!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=R_(e),o!==null){for(t.flags|=128,ky(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Fr(oa,oa.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ca()>Tg&&(t.flags|=128,r=!0,ky(i,!1),t.lanes=4194304)}else{if(!r)if(e=R_(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ky(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!na)return zi(t),null}else 2*Ca()-i.renderingStartTime>Tg&&n!==1073741824&&(t.flags|=128,r=!0,ky(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ca(),t.sibling=null,n=oa.current,Fr(oa,r?n&1|2:n&1),t):(zi(t),null);case 22:case 23:return rO(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?to&1073741824&&(zi(t),t.subtreeFlags&6&&(t.flags|=8192)):zi(t),null;case 24:return null;case 25:return null}throw Error(lt(156,t.tag))}function Eie(e,t){switch($T(t),t.tag){case 1:return Ls(t.type)&&A_(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cg(),Kr(Is),Kr(Ji),HT(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return VT(t),null;case 13:if(Kr(oa),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(lt(340));kg()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Kr(oa),null;case 4:return Cg(),null;case 10:return UT(t.type._context),null;case 22:case 23:return rO(),null;case 24:return null;default:return null}}var F1=!1,Ki=!1,Cie=typeof WeakSet=="function"?WeakSet:Set,St=null;function $m(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ba(e,t,r)}else n.current=null}function BE(e,t,n){try{n()}catch(r){ba(e,t,r)}}var fL=!1;function Pie(e,t){if(jE=__,e=ZU(),LT(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||a!==0&&f.nodeType!==3||(l=o+a),f!==i||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===a&&(l=o),p===i&&++d===r&&(c=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(SE={focusedElem:e,selectionRange:n},__=!1,St=t;St!==null;)if(t=St,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,St=e;else for(;St!==null;){t=St;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,v=m.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:pl(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(lt(163))}}catch(j){ba(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,St=e;break}St=t.return}return m=fL,fL=!1,m}function w0(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&BE(t,n,i)}a=a.next}while(a!==r)}}function Zj(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function UE(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Hz(e){var t=e.alternate;t!==null&&(e.alternate=null,Hz(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[tc],delete t[G0],delete t[kE],delete t[fie],delete t[hie])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Gz(e){return e.tag===5||e.tag===3||e.tag===4}function hL(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gz(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zE(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=N_));else if(r!==4&&(e=e.child,e!==null))for(zE(e,t,n),e=e.sibling;e!==null;)zE(e,t,n),e=e.sibling}function WE(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(WE(e,t,n),e=e.sibling;e!==null;)WE(e,t,n),e=e.sibling}var Oi=null,xl=!1;function Xu(e,t,n){for(n=n.child;n!==null;)Yz(e,t,n),n=n.sibling}function Yz(e,t,n){if(uc&&typeof uc.onCommitFiberUnmount=="function")try{uc.onCommitFiberUnmount(zj,n)}catch{}switch(n.tag){case 5:Ki||$m(n,t);case 6:var r=Oi,a=xl;Oi=null,Xu(e,t,n),Oi=r,xl=a,Oi!==null&&(xl?(e=Oi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Oi.removeChild(n.stateNode));break;case 18:Oi!==null&&(xl?(e=Oi,n=n.stateNode,e.nodeType===8?Y5(e.parentNode,n):e.nodeType===1&&Y5(e,n),z0(e)):Y5(Oi,n.stateNode));break;case 4:r=Oi,a=xl,Oi=n.stateNode.containerInfo,xl=!0,Xu(e,t,n),Oi=r,xl=a;break;case 0:case 11:case 14:case 15:if(!Ki&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&BE(n,t,o),a=a.next}while(a!==r)}Xu(e,t,n);break;case 1:if(!Ki&&($m(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){ba(n,t,l)}Xu(e,t,n);break;case 21:Xu(e,t,n);break;case 22:n.mode&1?(Ki=(r=Ki)||n.memoizedState!==null,Xu(e,t,n),Ki=r):Xu(e,t,n);break;default:Xu(e,t,n)}}function pL(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Cie),t.forEach(function(r){var a=Fie.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function ol(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Oi=l.stateNode,xl=!1;break e;case 3:Oi=l.stateNode.containerInfo,xl=!0;break e;case 4:Oi=l.stateNode.containerInfo,xl=!0;break e}l=l.return}if(Oi===null)throw Error(lt(160));Yz(i,o,a),Oi=null,xl=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){ba(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Kz(t,e),t=t.sibling}function Kz(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ol(t,e),Hl(e),r&4){try{w0(3,e,e.return),Zj(3,e)}catch(g){ba(e,e.return,g)}try{w0(5,e,e.return)}catch(g){ba(e,e.return,g)}}break;case 1:ol(t,e),Hl(e),r&512&&n!==null&&$m(n,n.return);break;case 5:if(ol(t,e),Hl(e),r&512&&n!==null&&$m(n,n.return),e.flags&32){var a=e.stateNode;try{D0(a,"")}catch(g){ba(e,e.return,g)}}if(r&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&vU(a,i),hE(l,o);var u=hE(l,i);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?_U(a,f):d==="dangerouslySetInnerHTML"?bU(a,f):d==="children"?D0(a,f):_T(a,d,f,u)}switch(l){case"input":lE(a,i);break;case"textarea":yU(a,i);break;case"select":var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Hm(a,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Hm(a,!!i.multiple,i.defaultValue,!0):Hm(a,!!i.multiple,i.multiple?[]:"",!1))}a[G0]=i}catch(g){ba(e,e.return,g)}}break;case 6:if(ol(t,e),Hl(e),r&4){if(e.stateNode===null)throw Error(lt(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(g){ba(e,e.return,g)}}break;case 3:if(ol(t,e),Hl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{z0(t.containerInfo)}catch(g){ba(e,e.return,g)}break;case 4:ol(t,e),Hl(e);break;case 13:ol(t,e),Hl(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(tO=Ca())),r&4&&pL(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ki=(u=Ki)||d,ol(t,e),Ki=u):ol(t,e),Hl(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(St=e,d=e.child;d!==null;){for(f=St=d;St!==null;){switch(p=St,h=p.child,p.tag){case 0:case 11:case 14:case 15:w0(4,p,p.return);break;case 1:$m(p,p.return);var m=p.stateNode;if(typeof m.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){ba(r,n,g)}}break;case 5:$m(p,p.return);break;case 22:if(p.memoizedState!==null){gL(f);continue}}h!==null?(h.return=p,St=h):gL(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=wU("display",o))}catch(g){ba(e,e.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){ba(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ol(t,e),Hl(e),r&4&&pL(e);break;case 21:break;default:ol(t,e),Hl(e)}}function Hl(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Gz(n)){var r=n;break e}n=n.return}throw Error(lt(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(D0(a,""),r.flags&=-33);var i=hL(e);WE(e,i,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=hL(e);zE(e,l,o);break;default:throw Error(lt(161))}}catch(c){ba(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tie(e,t,n){St=e,Zz(e)}function Zz(e,t,n){for(var r=(e.mode&1)!==0;St!==null;){var a=St,i=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||F1;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Ki;l=F1;var u=Ki;if(F1=o,(Ki=c)&&!u)for(St=a;St!==null;)o=St,c=o.child,o.tag===22&&o.memoizedState!==null?vL(a):c!==null?(c.return=o,St=c):vL(a);for(;i!==null;)St=i,Zz(i),i=i.sibling;St=a,F1=l,Ki=u}mL(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,St=i):mL(e)}}function mL(e){for(;St!==null;){var t=St;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ki||Zj(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ki)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:pl(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Q6(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Q6(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&z0(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(lt(163))}Ki||t.flags&512&&UE(t)}catch(p){ba(t,t.return,p)}}if(t===e){St=null;break}if(n=t.sibling,n!==null){n.return=t.return,St=n;break}St=t.return}}function gL(e){for(;St!==null;){var t=St;if(t===e){St=null;break}var n=t.sibling;if(n!==null){n.return=t.return,St=n;break}St=t.return}}function vL(e){for(;St!==null;){var t=St;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zj(4,t)}catch(c){ba(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){ba(t,a,c)}}var i=t.return;try{UE(t)}catch(c){ba(t,i,c)}break;case 5:var o=t.return;try{UE(t)}catch(c){ba(t,o,c)}}}catch(c){ba(t,t.return,c)}if(t===e){St=null;break}var l=t.sibling;if(l!==null){l.return=t.return,St=l;break}St=t.return}}var Oie=Math.ceil,M_=Eu.ReactCurrentDispatcher,QT=Eu.ReactCurrentOwner,zo=Eu.ReactCurrentBatchConfig,Qn=0,xi=null,Ha=null,Ii=0,to=0,Dm=gf(0),oi=0,Q0=null,Zh=0,Xj=0,eO=0,_0=null,Es=null,tO=0,Tg=1/0,Gc=null,$_=!1,qE=null,Ud=null,B1=!1,kd=null,D_=0,j0=0,VE=null,Hw=-1,Gw=0;function ms(){return Qn&6?Ca():Hw!==-1?Hw:Hw=Ca()}function zd(e){return e.mode&1?Qn&2&&Ii!==0?Ii&-Ii:mie.transition!==null?(Gw===0&&(Gw=IU()),Gw):(e=_r,e!==0||(e=window.event,e=e===void 0?16:UU(e.type)),e):1}function Nl(e,t,n,r){if(50<j0)throw j0=0,VE=null,Error(lt(185));yb(e,n,r),(!(Qn&2)||e!==xi)&&(e===xi&&(!(Qn&2)&&(Xj|=n),oi===4&&fd(e,Ii)),Ms(e,r),n===1&&Qn===0&&!(t.mode&1)&&(Tg=Ca()+500,Gj&&vf()))}function Ms(e,t){var n=e.callbackNode;mae(e,t);var r=w_(e,e===xi?Ii:0);if(r===0)n!==null&&A6(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&A6(n),t===1)e.tag===0?pie(yL.bind(null,e)):sz(yL.bind(null,e)),uie(function(){!(Qn&6)&&vf()}),n=null;else{switch(LU(r)){case 1:n=kT;break;case 4:n=OU;break;case 16:n=b_;break;case 536870912:n=RU;break;default:n=b_}n=aW(n,Xz.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Xz(e,t){if(Hw=-1,Gw=0,Qn&6)throw Error(lt(327));var n=e.callbackNode;if(Xm()&&e.callbackNode!==n)return null;var r=w_(e,e===xi?Ii:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=F_(e,r);else{t=r;var a=Qn;Qn|=2;var i=Qz();(xi!==e||Ii!==t)&&(Gc=null,Tg=Ca()+500,Dh(e,t));do try{Lie();break}catch(l){Jz(e,l)}while(!0);BT(),M_.current=i,Qn=a,Ha!==null?t=0:(xi=null,Ii=0,t=oi)}if(t!==0){if(t===2&&(a=yE(e),a!==0&&(r=a,t=HE(e,a))),t===1)throw n=Q0,Dh(e,0),fd(e,r),Ms(e,Ca()),n;if(t===6)fd(e,r);else{if(a=e.current.alternate,!(r&30)&&!Rie(a)&&(t=F_(e,r),t===2&&(i=yE(e),i!==0&&(r=i,t=HE(e,i))),t===1))throw n=Q0,Dh(e,0),fd(e,r),Ms(e,Ca()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(lt(345));case 2:eh(e,Es,Gc);break;case 3:if(fd(e,r),(r&130023424)===r&&(t=tO+500-Ca(),10<t)){if(w_(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){ms(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=AE(eh.bind(null,e,Es,Gc),t);break}eh(e,Es,Gc);break;case 4:if(fd(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-Sl(r);i=1<<o,o=t[o],o>a&&(a=o),r&=~i}if(r=a,r=Ca()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Oie(r/1960))-r,10<r){e.timeoutHandle=AE(eh.bind(null,e,Es,Gc),r);break}eh(e,Es,Gc);break;case 5:eh(e,Es,Gc);break;default:throw Error(lt(329))}}}return Ms(e,Ca()),e.callbackNode===n?Xz.bind(null,e):null}function HE(e,t){var n=_0;return e.current.memoizedState.isDehydrated&&(Dh(e,t).flags|=256),e=F_(e,t),e!==2&&(t=Es,Es=n,t!==null&&GE(t)),e}function GE(e){Es===null?Es=e:Es.push.apply(Es,e)}function Rie(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],i=a.getSnapshot;a=a.value;try{if(!El(i(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function fd(e,t){for(t&=~eO,t&=~Xj,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Sl(t),r=1<<n;e[n]=-1,t&=~r}}function yL(e){if(Qn&6)throw Error(lt(327));Xm();var t=w_(e,0);if(!(t&1))return Ms(e,Ca()),null;var n=F_(e,t);if(e.tag!==0&&n===2){var r=yE(e);r!==0&&(t=r,n=HE(e,r))}if(n===1)throw n=Q0,Dh(e,0),fd(e,t),Ms(e,Ca()),n;if(n===6)throw Error(lt(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,eh(e,Es,Gc),Ms(e,Ca()),null}function nO(e,t){var n=Qn;Qn|=1;try{return e(t)}finally{Qn=n,Qn===0&&(Tg=Ca()+500,Gj&&vf())}}function Xh(e){kd!==null&&kd.tag===0&&!(Qn&6)&&Xm();var t=Qn;Qn|=1;var n=zo.transition,r=_r;try{if(zo.transition=null,_r=1,e)return e()}finally{_r=r,zo.transition=n,Qn=t,!(Qn&6)&&vf()}}function rO(){to=Dm.current,Kr(Dm)}function Dh(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,cie(n)),Ha!==null)for(n=Ha.return;n!==null;){var r=n;switch($T(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&A_();break;case 3:Cg(),Kr(Is),Kr(Ji),HT();break;case 5:VT(r);break;case 4:Cg();break;case 13:Kr(oa);break;case 19:Kr(oa);break;case 10:UT(r.type._context);break;case 22:case 23:rO()}n=n.return}if(xi=e,Ha=e=Wd(e.current,null),Ii=to=t,oi=0,Q0=null,eO=Xj=Zh=0,Es=_0=null,vh!==null){for(t=0;t<vh.length;t++)if(n=vh[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=a,r.next=o}n.pending=r}vh=null}return e}function Jz(e,t){do{var n=Ha;try{if(BT(),Ww.current=L_,I_){for(var r=da.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}I_=!1}if(Kh=0,mi=ai=da=null,b0=!1,Z0=0,QT.current=null,n===null||n.return===null){oi=1,Q0=t,Ha=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=Ii,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,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 h=iL(o);if(h!==null){h.flags&=-257,sL(h,o,l,i,t),h.mode&1&&aL(i,u,t),t=h,c=u;var m=t.updateQueue;if(m===null){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}else{if(!(t&1)){aL(i,u,t),aO();break e}c=Error(lt(426))}}else if(na&&l.mode&1){var v=iL(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),sL(v,o,l,i,t),DT(Pg(c,l));break e}}i=c=Pg(c,l),oi!==4&&(oi=2),_0===null?_0=[i]:_0.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=Lz(i,c,t);J6(i,y);break e;case 1:l=c;var b=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ud===null||!Ud.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=Mz(i,l,t);J6(i,j);break e}}i=i.return}while(i!==null)}tW(n)}catch(S){t=S,Ha===n&&n!==null&&(Ha=n=n.return);continue}break}while(!0)}function Qz(){var e=M_.current;return M_.current=L_,e===null?L_:e}function aO(){(oi===0||oi===3||oi===2)&&(oi=4),xi===null||!(Zh&268435455)&&!(Xj&268435455)||fd(xi,Ii)}function F_(e,t){var n=Qn;Qn|=2;var r=Qz();(xi!==e||Ii!==t)&&(Gc=null,Dh(e,t));do try{Iie();break}catch(a){Jz(e,a)}while(!0);if(BT(),Qn=n,M_.current=r,Ha!==null)throw Error(lt(261));return xi=null,Ii=0,oi}function Iie(){for(;Ha!==null;)eW(Ha)}function Lie(){for(;Ha!==null&&!sae();)eW(Ha)}function eW(e){var t=rW(e.alternate,e,to);e.memoizedProps=e.pendingProps,t===null?tW(e):Ha=t,QT.current=null}function tW(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Eie(n,t),n!==null){n.flags&=32767,Ha=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{oi=6,Ha=null;return}}else if(n=kie(n,t,to),n!==null){Ha=n;return}if(t=t.sibling,t!==null){Ha=t;return}Ha=t=e}while(t!==null);oi===0&&(oi=5)}function eh(e,t,n){var r=_r,a=zo.transition;try{zo.transition=null,_r=1,Mie(e,t,n,r)}finally{zo.transition=a,_r=r}return null}function Mie(e,t,n,r){do Xm();while(kd!==null);if(Qn&6)throw Error(lt(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(lt(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(gae(e,i),e===xi&&(Ha=xi=null,Ii=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||B1||(B1=!0,aW(b_,function(){return Xm(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=zo.transition,zo.transition=null;var o=_r;_r=1;var l=Qn;Qn|=4,QT.current=null,Pie(e,n),Kz(n,e),nie(SE),__=!!jE,SE=jE=null,e.current=n,Tie(n),oae(),Qn=l,_r=o,zo.transition=i}else e.current=n;if(B1&&(B1=!1,kd=e,D_=a),i=e.pendingLanes,i===0&&(Ud=null),uae(n.stateNode),Ms(e,Ca()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if($_)throw $_=!1,e=qE,qE=null,e;return D_&1&&e.tag!==0&&Xm(),i=e.pendingLanes,i&1?e===VE?j0++:(j0=0,VE=e):j0=0,vf(),null}function Xm(){if(kd!==null){var e=LU(D_),t=zo.transition,n=_r;try{if(zo.transition=null,_r=16>e?16:e,kd===null)var r=!1;else{if(e=kd,kd=null,D_=0,Qn&6)throw Error(lt(331));var a=Qn;for(Qn|=4,St=e.current;St!==null;){var i=St,o=i.child;if(St.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(St=u;St!==null;){var d=St;switch(d.tag){case 0:case 11:case 15:w0(8,d,i)}var f=d.child;if(f!==null)f.return=d,St=f;else for(;St!==null;){d=St;var p=d.sibling,h=d.return;if(Hz(d),d===u){St=null;break}if(p!==null){p.return=h,St=p;break}St=h}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(g!==null)}}St=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,St=o;else e:for(;St!==null;){if(i=St,i.flags&2048)switch(i.tag){case 0:case 11:case 15:w0(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,St=y;break e}St=i.return}}var b=e.current;for(St=b;St!==null;){o=St;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,St=w;else e:for(o=b;St!==null;){if(l=St,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Zj(9,l)}}catch(S){ba(l,l.return,S)}if(l===o){St=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,St=j;break e}St=l.return}}if(Qn=a,vf(),uc&&typeof uc.onPostCommitFiberRoot=="function")try{uc.onPostCommitFiberRoot(zj,e)}catch{}r=!0}return r}finally{_r=n,zo.transition=t}}return!1}function xL(e,t,n){t=Pg(n,t),t=Lz(e,t,1),e=Bd(e,t,1),t=ms(),e!==null&&(yb(e,1,t),Ms(e,t))}function ba(e,t,n){if(e.tag===3)xL(e,e,n);else for(;t!==null;){if(t.tag===3){xL(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ud===null||!Ud.has(r))){e=Pg(n,e),e=Mz(t,e,1),t=Bd(t,e,1),e=ms(),t!==null&&(yb(t,1,e),Ms(t,e));break}}t=t.return}}function $ie(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ms(),e.pingedLanes|=e.suspendedLanes&n,xi===e&&(Ii&n)===n&&(oi===4||oi===3&&(Ii&130023424)===Ii&&500>Ca()-tO?Dh(e,0):eO|=n),Ms(e,t)}function nW(e,t){t===0&&(e.mode&1?(t=P1,P1<<=1,!(P1&130023424)&&(P1=4194304)):t=1);var n=ms();e=vu(e,t),e!==null&&(yb(e,t,n),Ms(e,n))}function Die(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nW(e,n)}function Fie(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(lt(314))}r!==null&&r.delete(t),nW(e,n)}var rW;rW=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Is.current)Ps=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ps=!1,Aie(e,t,n);Ps=!!(e.flags&131072)}else Ps=!1,na&&t.flags&1048576&&oz(t,C_,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Vw(e,t),e=t.pendingProps;var a=Ag(t,Ji.current);Zm(t,n),a=YT(null,t,r,e,a,n);var i=KT();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ls(r)?(i=!0,k_(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,WT(t),a.updater=Kj,t.stateNode=a,a._reactInternals=t,RE(t,r,e,n),t=ME(null,t,r,!0,i,n)):(t.tag=0,na&&i&&MT(t),ls(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Vw(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=Uie(r),e=pl(r,e),a){case 0:t=LE(null,t,r,e,n);break e;case 1:t=cL(null,t,r,e,n);break e;case 11:t=oL(null,t,r,e,n);break e;case 14:t=lL(null,t,r,pl(r.type,e),n);break e}throw Error(lt(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:pl(r,a),LE(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:pl(r,a),cL(e,t,r,a,n);case 3:e:{if(Bz(t),e===null)throw Error(lt(387));
vendor: 8,104 bytes, line 40
40r=t.pendingProps,i=t.memoizedState,a=i.element,hz(e,t),O_(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Pg(Error(lt(423)),t),t=uL(e,t,r,n,a);break e}else if(r!==a){a=Pg(Error(lt(424)),t),t=uL(e,t,r,n,a);break e}else for(oo=Fd(t.stateNode.containerInfo.firstChild),uo=t,na=!0,_l=null,n=dz(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(kg(),r===a){t=yu(e,t,n);break e}ls(e,t,r,n)}t=t.child}return t;case 5:return pz(t),e===null&&PE(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,NE(r,a)?o=null:i!==null&&NE(r,i)&&(t.flags|=32),Fz(e,t),ls(e,t,o,n),t.child;case 6:return e===null&&PE(t),null;case 13:return Uz(e,t,n);case 4:return qT(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Eg(t,null,r,n):ls(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:pl(r,a),oL(e,t,r,a,n);case 7:return ls(e,t,t.pendingProps,n),t.child;case 8:return ls(e,t,t.pendingProps.children,n),t.child;case 12:return ls(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,Fr(P_,r._currentValue),r._currentValue=o,i!==null)if(El(i.value,o)){if(i.children===a.children&&!Is.current){t=yu(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=ou(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),TE(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(lt(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),TE(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ls(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Zm(t,n),a=qo(a),r=r(a),t.flags|=1,ls(e,t,r,n),t.child;case 14:return r=t.type,a=pl(r,t.pendingProps),a=pl(r.type,a),lL(e,t,r,a,n);case 15:return $z(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:pl(r,a),Vw(e,t),t.tag=1,Ls(r)?(e=!0,k_(t)):e=!1,Zm(t,n),Iz(t,r,a),RE(t,r,a,n),ME(null,t,r,!0,e,n);case 19:return zz(e,t,n);case 22:return Dz(e,t,n)}throw Error(lt(156,t.tag))};function aW(e,t){return TU(e,t)}function Bie(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 Fo(e,t,n,r){return new Bie(e,t,n,r)}function iO(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Uie(e){if(typeof e=="function")return iO(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ST)return 11;if(e===NT)return 14}return 2}function Wd(e,t){var n=e.alternate;return n===null?(n=Fo(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Yw(e,t,n,r,a,i){var o=2;if(r=e,typeof e=="function")iO(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Em:return Fh(n.children,a,i,t);case jT:o=8,a|=8;break;case rE:return e=Fo(12,n,t,a|2),e.elementType=rE,e.lanes=i,e;case aE:return e=Fo(13,n,t,a),e.elementType=aE,e.lanes=i,e;case iE:return e=Fo(19,n,t,a),e.elementType=iE,e.lanes=i,e;case pU:return Jj(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fU:o=10;break e;case hU:o=9;break e;case ST:o=11;break e;case NT:o=14;break e;case sd:o=16,r=null;break e}throw Error(lt(130,e==null?e:typeof e,""))}return t=Fo(o,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function Fh(e,t,n,r){return e=Fo(7,e,r,t),e.lanes=n,e}function Jj(e,t,n,r){return e=Fo(22,e,r,t),e.elementType=pU,e.lanes=n,e.stateNode={isHidden:!1},e}function nA(e,t,n){return e=Fo(6,e,null,t),e.lanes=n,e}function rA(e,t,n){return t=Fo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zie(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$5(0),this.expirationTimes=$5(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$5(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function sO(e,t,n,r,a,i,o,l,c){return e=new zie(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Fo(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},WT(i),e}function Wie(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:km,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function iW(e){if(!e)return nf;e=e._reactInternals;e:{if(bp(e)!==e||e.tag!==1)throw Error(lt(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ls(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(lt(171))}if(e.tag===1){var n=e.type;if(Ls(n))return iz(e,n,t)}return t}function sW(e,t,n,r,a,i,o,l,c){return e=sO(n,r,!0,e,a,i,o,l,c),e.context=iW(null),n=e.current,r=ms(),a=zd(n),i=ou(r,a),i.callback=t??null,Bd(n,i,a),e.current.lanes=a,yb(e,a,r),Ms(e,r),e}function Qj(e,t,n,r){var a=t.current,i=ms(),o=zd(a);return n=iW(n),t.context===null?t.context=n:t.pendingContext=n,t=ou(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Bd(a,t,o),e!==null&&(Nl(e,a,o,i),zw(e,a,o)),o}function B_(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function bL(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function oO(e,t){bL(e,t),(e=e.alternate)&&bL(e,t)}function qie(){return null}var oW=typeof reportError=="function"?reportError:function(e){console.error(e)};function lO(e){this._internalRoot=e}eS.prototype.render=lO.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(lt(409));Qj(e,t,null,null)};eS.prototype.unmount=lO.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xh(function(){Qj(null,e,null,null)}),t[gu]=null}};function eS(e){this._internalRoot=e}eS.prototype.unstable_scheduleHydration=function(e){if(e){var t=DU();e={blockedOn:null,target:e,priority:t};for(var n=0;n<dd.length&&t!==0&&t<dd[n].priority;n++);dd.splice(n,0,e),n===0&&BU(e)}};function cO(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function tS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function wL(){}function Vie(e,t,n,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var u=B_(o);i.call(u)}}var o=sW(t,r,e,0,null,!1,!1,"",wL);return e._reactRootContainer=o,e[gu]=o.current,V0(e.nodeType===8?e.parentNode:e),Xh(),o}for(;
vendor: 5,173 bytes, line 40
40a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var u=B_(c);l.call(u)}}var c=sO(e,0,!1,null,null,!1,!1,"",wL);return e._reactRootContainer=c,e[gu]=c.current,V0(e.nodeType===8?e.parentNode:e),Xh(function(){Qj(t,c,n,r)}),c}function nS(e,t,n,r,a){var i=n._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=B_(o);l.call(c)}}Qj(t,o,e,a)}else o=Vie(n,t,e,a,r);return B_(o)}MU=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=r0(t.pendingLanes);n!==0&&(ET(t,n|1),Ms(t,Ca()),!(Qn&6)&&(Tg=Ca()+500,vf()))}break;case 13:Xh(function(){var r=vu(e,1);if(r!==null){var a=ms();Nl(r,e,1,a)}}),oO(e,1)}};CT=function(e){if(e.tag===13){var t=vu(e,134217728);if(t!==null){var n=ms();Nl(t,e,134217728,n)}oO(e,134217728)}};$U=function(e){if(e.tag===13){var t=zd(e),n=vu(e,t);if(n!==null){var r=ms();Nl(n,e,t,r)}oO(e,t)}};DU=function(){return _r};FU=function(e,t){var n=_r;try{return _r=e,t()}finally{_r=n}};mE=function(e,t,n){switch(t){case"input":if(lE(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=Hj(r);if(!a)throw Error(lt(90));gU(r),lE(r,a)}}}break;case"textarea":yU(e,n);break;case"select":t=n.value,t!=null&&Hm(e,!!n.multiple,t,!1)}};NU=nO;AU=Xh;var Hie={usingClientEntryPoint:!1,Events:[bb,Om,Hj,jU,SU,nO]},Ey={findFiberByHostInstance:gh,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Gie={bundleType:Ey.bundleType,version:Ey.version,rendererPackageName:Ey.rendererPackageName,rendererConfig:Ey.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Eu.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=CU(e),e===null?null:e.stateNode},findFiberByHostInstance:Ey.findFiberByHostInstance||qie,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 U1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!U1.isDisabled&&U1.supportsFiber)try{zj=U1.inject(Gie),uc=U1}catch{}}yo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hie;yo.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cO(t))throw Error(lt(200));return Wie(e,t,null,n)};yo.createRoot=function(e,t){if(!cO(e))throw Error(lt(299));var n=!1,r="",a=oW;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=sO(e,1,!1,null,null,n,!1,r,a),e[gu]=t.current,V0(e.nodeType===8?e.parentNode:e),new lO(t)};yo.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(lt(188)):(e=Object.keys(e).join(","),Error(lt(268,e)));return e=CU(t),e=e===null?null:e.stateNode,e};yo.flushSync=function(e){return Xh(e)};yo.hydrate=function(e,t,n){if(!tS(t))throw Error(lt(200));return nS(null,e,t,!0,n)};yo.hydrateRoot=function(e,t,n){if(!cO(e))throw Error(lt(405));var r=n!=null&&n.hydratedSources||null,a=!1,i="",o=oW;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=sW(t,null,e,1,n??null,a,!1,i,o),e[gu]=t.current,V0(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new eS(t)};yo.render=function(e,t,n){if(!tS(t))throw Error(lt(200));return nS(null,e,t,!1,n)};yo.unmountComponentAtNode=function(e){if(!tS(e))throw Error(lt(40));return e._reactRootContainer?(Xh(function(){nS(null,null,e,!1,function(){e._reactRootContainer=null,e[gu]=null})}),!0):!1};yo.unstable_batchedUpdates=nO;yo.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!tS(n))throw Error(lt(200));if(e==null||e._reactInternals===void 0)throw Error(lt(38));return nS(e,t,n,!1,r)};yo.version="18.3.1-next-f1338f8080-20240426";function lW(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lW)}catch(e){console.error(e)}}lW(),lU.exports=yo;var wp=lU.exports;const uO=mr(wp);var cW,_L=wp;cW=_L.createRoot,_L.hydrateRoot;const Yie=1,Kie=1e6;let aA=0;function Zie(){return aA=(aA+1)%Number.MAX_SAFE_INTEGER,aA.toString()}const iA=new Map,jL=e=>{if(iA.has(e))return;const t=setTimeout(()=>{iA.delete(e),S0({type:"REMOVE_TOAST",toastId:e})},Kie);iA.set(e,t)},Xie=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Yie)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;
40return n?jL(n):e.toasts.forEach(r=>{jL(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Kw=[];let Zw={toasts:[]};function S0(e){Zw=Xie(Zw,e),Kw.forEach(t=>{t(Zw)})}function et({...e}){const t=Zie(),n=a=>S0({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>S0({type:"DISMISS_TOAST",toastId:t});return S0({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function _c(){const[e,t]=x.useState(Zw);return x.useEffect(()=>(Kw.push(t),()=>{const n=Kw.indexOf(t);n>-1&&Kw.splice(n,1)}),[e]),{...e,toast:et,dismiss:n=>S0({type:"DISMISS_TOAST",toastId:n})}}function ht(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function SL(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rf(...e){return t=>{let n=!1;const r=e.map(a=>{const i=SL(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():SL(e[a],null)}}}}function sn(...e){return x.useCallback(rf(...e),e)}function Jie(e,t){const n=x.createContext(t),r=i=>{const{children:o,...l}=i,c=x.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function a(i){const o=x.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function ui(e,t=[]){let n=[];function r(i,o){const l=x.createContext(o),c=n.length;n=[...n,o];const u=f=>{var y;const{scope:p,children:h,...m}=f,g=((y=p==null?void 0:p[e])==null?void 0:y[c])||l,v=x.useMemo(()=>m,Object.values(m));return s.jsx(g.Provider,{value:v,children:h})};u.displayName=i+"Provider";function d(f,p){var g;const h=((g=p==null?void 0:p[e])==null?void 0:g[c])||l,m=x.useContext(h);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=n.map(o=>x.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,Qie(a,...t)]}function Qie(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Jh(e){const t=tse(e),n=x.forwardRef((r,a)=>{const{children:i,...o}=r,l=x.Children.toArray(i),c=l.find(nse);if(c){const u=c.props.children,d=l.map(f=>f===c?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:f);return s.jsx(t,{...o,ref:a,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var ese=Jh("Slot");function tse(e){const t=x.forwardRef((n,r)=>{const{children:a,...i}=n;if(x.isValidElement(a)){const o=ase(a),l=rse(i,a.props);return a.type!==x.Fragment&&(l.ref=r?rf(r,o):o),x.cloneElement(a,l)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uW=Symbol("radix.slottable");function dW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=uW,t}function nse(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uW}function rse(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function ase(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Pv(e){const t=e+"CollectionProvider",[n,r]=ui(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:v,children:y}=g,b=ue.useRef(null),w=ue.useRef(new Map).current;return s.jsx(a,{scope:v,itemMap:w,collectionRef:b,children:y})};o.displayName=t;const l=e+"CollectionSlot",c=Jh(l),u=ue.forwardRef((g,v)=>{const{scope:y,children:b}=g,w=i(l,y),j=sn(v,w.collectionRef);return s.jsx(c,{ref:j,children:b})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Jh(d),h=ue.forwardRef((g,v)=>{const{scope:y,children:b,...w}=g,j=ue.useRef(null),S=sn(v,j),A=i(d,y);return ue.useEffect(()=>(A.itemMap.set(j,{ref:j,...w}),()=>
vendor: 9,210 bytes, line 40
40void A.itemMap.delete(j))),s.jsx(p,{[f]:"",ref:S,children:b})});h.displayName=d;function m(g){const v=i(e+"CollectionConsumer",g);return ue.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((A,E)=>w.indexOf(A.ref.current)-w.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:u,ItemSlot:h},m,r]}var ise=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pt=ise.reduce((e,t)=>{const n=Jh(`Primitive.${t}`),r=x.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function U_(e,t){e&&wp.flushSync(()=>e.dispatchEvent(t))}function Pr(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function sse(e,t=globalThis==null?void 0:globalThis.document){const n=Pr(e);x.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ose="DismissableLayer",YE="dismissableLayer.update",lse="dismissableLayer.pointerDownOutside",cse="dismissableLayer.focusOutside",NL,fW=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_p=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=x.useContext(fW),[d,f]=x.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=x.useState({}),m=sn(t,E=>f(E)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),b=d?g.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=b>=y,S=dse(E=>{const k=E.target,P=[...u.branches].some(R=>R.contains(k));!j||P||(a==null||a(E),o==null||o(E),E.defaultPrevented||l==null||l())},p),A=fse(E=>{const k=E.target;[...u.branches].some(R=>R.contains(k))||(i==null||i(E),o==null||o(E),E.defaultPrevented||l==null||l())},p);return sse(E=>{b===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&l&&(E.preventDefault(),l()))},p),x.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(NL=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),AL(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=NL)}},[d,p,n,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),AL())},[d,u]),x.useEffect(()=>{const E=()=>h({});return document.addEventListener(YE,E),()=>document.removeEventListener(YE,E)},[]),s.jsx(pt.div,{...c,ref:m,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:ht(e.onFocusCapture,A.onFocusCapture),onBlurCapture:ht(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:ht(e.onPointerDownCapture,S.onPointerDownCapture)})});_p.displayName=ose;var use="DismissableLayerBranch",hW=x.forwardRef((e,t)=>{const n=x.useContext(fW),r=x.useRef(null),a=sn(t,r);return x.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(pt.div,{...e,ref:a})});hW.displayName=use;function dse(e,t=globalThis==null?void 0:globalThis.document){const n=Pr(e),r=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){pW(lse,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function fse(e,t=globalThis==null?void 0:globalThis.document){const n=Pr(e),r=x.useRef(!1);return x.useEffect(()=>{const a=i=>{i.target&&!r.current&&pW(cse,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function AL(){const e=new CustomEvent(YE);document.dispatchEvent(e)}function pW(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?U_(a,i):a.dispatchEvent(i)}var hse=_p,pse=hW,Xr=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},mse="Portal",_b=x.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,i]=x.useState(!1);Xr(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?uO.createPortal(s.jsx(pt.div,{...r,ref:t}),o):null});_b.displayName=mse;function gse(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Ka=e=>{const{present:t,children:n}=e,r=vse(t),a=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=sn(r.ref,yse(a));return typeof n=="function"||r.isPresent?x.cloneElement(a,{ref:i}):null};Ka.displayName="Presence";function vse(e){const[t,n]=x.useState(),r=x.useRef(null),a=x.useRef(e),i=x.useRef("none"),o=e?"mounted":"unmounted",[l,c]=gse(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=z1(r.current);i.current=l==="mounted"?u:"none"},[l]),Xr(()=>{const u=r.current,d=a.current;if(d!==e){const p=i.current,h=z1(u);e?c("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),Xr(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const g=z1(r.current).includes(h.animationName);if(h.target===t&&g&&(c("ANIMATION_END"),!a.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=h=>{h.target===t&&(i.current=z1(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function z1(e){return(e==null?void 0:e.animationName)||"none"}function yse(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xse=xT[" useInsertionEffect ".trim().toString()]||Xr;function vs({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=bse({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const d=x.useRef(e!==void 0);x.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"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=l},[l,r])}const u=x.useCallback(d=>{var f;if(l){const p=wse(d)?d(e):d;p!==e&&((f=o.current)==null||f.call(o,p))}else i(d)},[l,e,i,o]);return[c,u]}function bse({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),a=x.useRef(n),i=x.useRef(t);return xse(()=>{i.current=t},[t]),x.useEffect(()=>{var o;a.current!==n&&((o=i.current)==null||o.call(i,n),a.current=n)},[n,a]),[n,r,i]}function wse(e){return typeof e=="function"}var mW=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"}),_se="VisuallyHidden",rS=x.forwardRef((e,t)=>s.jsx(pt.span,{...e,ref:t,style:{...mW,...e.style}}));rS.displayName=_se;var gW=rS,dO="ToastProvider",[fO,jse,Sse]=Pv("Toast"),[vW,MXe]=ui("Toast",[Sse]),[Nse,aS]=vW(dO),yW=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=x.useState(null),[u,d]=x.useState(0),f=x.useRef(!1),p=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${dO}\`. Expected non-empty \`string\`.`),s.jsx(fO.Provider,{scope:t,children:s.jsx(Nse,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:x.useCallback(()=>d(h=>h+1),[]),onToastRemove:x.useCallback(()=>d(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:o})})};yW.displayName=dO;var xW="ToastViewport",Ase=["F8"],KE="toast.viewportPause",ZE="toast.viewportResume",bW=x.forwardRef((e,t)=>
40{const{__scopeToast:n,hotkey:r=Ase,label:a="Notifications ({hotkey})",...i}=e,o=aS(xW,n),l=jse(n),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=sn(t,f,o.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=o.toastCount>0;x.useEffect(()=>{const v=y=>{var w;r.length!==0&&r.every(j=>y[j]||y.code===j)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]),x.useEffect(()=>{const v=c.current,y=f.current;if(m&&v&&y){const b=()=>{if(!o.isClosePausedRef.current){const A=new CustomEvent(KE);y.dispatchEvent(A),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const A=new CustomEvent(ZE);y.dispatchEvent(A),o.isClosePausedRef.current=!1}},j=A=>{!v.contains(A.relatedTarget)&&w()},S=()=>{v.contains(document.activeElement)||w()};return v.addEventListener("focusin",b),v.addEventListener("focusout",j),v.addEventListener("pointermove",b),v.addEventListener("pointerleave",S),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{v.removeEventListener("focusin",b),v.removeEventListener("focusout",j),v.removeEventListener("pointermove",b),v.removeEventListener("pointerleave",S),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[m,o.isClosePausedRef]);const g=x.useCallback(({tabbingDirection:v})=>{const b=l().map(w=>{const j=w.ref.current,S=[j,...Fse(j)];return v==="forwards"?S:S.reverse()});return(v==="forwards"?b.reverse():b).flat()},[l]);return x.useEffect(()=>{const v=f.current;if(v){const y=b=>{var S,A,E;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const k=document.activeElement,P=b.shiftKey;if(b.target===v&&P){(S=u.current)==null||S.focus();return}const I=g({tabbingDirection:P?"backwards":"forwards"}),D=I.findIndex(U=>U===k);sA(I.slice(D+1))?b.preventDefault():P?(A=u.current)==null||A.focus():(E=d.current)==null||E.focus()}};return v.addEventListener("keydown",y),()=>v.removeEventListener("keydown",y)}},[l,g]),s.jsxs(pse,{ref:c,role:"region","aria-label":a.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&s.jsx(XE,{ref:u,onFocusFromOutsideViewport:()=>{const v=g({tabbingDirection:"forwards"});sA(v)}}),s.jsx(fO.Slot,{scope:n,children:s.jsx(pt.ol,{tabIndex:-1,...i,ref:p})}),m&&s.jsx(XE,{ref:d,onFocusFromOutsideViewport:()=>{const v=g({tabbingDirection:"backwards"});sA(v)}})]})});bW.displayName=xW;var wW="ToastFocusProxy",XE=x.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=aS(wW,n);return s.jsx(rS,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(l))&&r()}})});XE.displayName=wW;var jb="Toast",kse="toast.swipeStart",Ese="toast.swipeMove",Cse="toast.swipeCancel",Pse="toast.swipeEnd",_W=x.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[l,c]=vs({prop:r,defaultProp:a??!0,onChange:i,caller:jb});return s.jsx(Ka,{present:n||l,children:s.jsx(Rse,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Pr(e.onPause),onResume:Pr(e.onResume),onSwipeStart:ht(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ht(e.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:ht(e.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:ht(e.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`),c(!1)})})})});
40_W.displayName=jb;var[Tse,Ose]=vW(jb,{onClose(){}}),Rse=x.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:h,...m}=e,g=aS(jb,n),[v,y]=x.useState(null),b=sn(t,U=>y(U)),w=x.useRef(null),j=x.useRef(null),S=a||g.duration,A=x.useRef(0),E=x.useRef(S),k=x.useRef(0),{onToastAdd:P,onToastRemove:R}=g,C=Pr(()=>{var q;(v==null?void 0:v.contains(document.activeElement))&&((q=g.viewport)==null||q.focus()),o()}),I=x.useCallback(U=>{!U||U===1/0||(window.clearTimeout(k.current),A.current=new Date().getTime(),k.current=window.setTimeout(C,U))},[C]);x.useEffect(()=>{const U=g.viewport;if(U){const q=()=>{I(E.current),u==null||u()},Z=()=>{const H=new Date().getTime()-A.current;E.current=E.current-H,window.clearTimeout(k.current),c==null||c()};return U.addEventListener(KE,Z),U.addEventListener(ZE,q),()=>{U.removeEventListener(KE,Z),U.removeEventListener(ZE,q)}}},[g.viewport,S,c,u,I]),x.useEffect(()=>{i&&!g.isClosePausedRef.current&&I(S)},[i,S,g.isClosePausedRef,I]),x.useEffect(()=>(P(),()=>R()),[P,R]);const D=x.useMemo(()=>v?CW(v):null,[v]);return g.viewport?s.jsxs(s.Fragment,{children:[D&&s.jsx(Ise,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),s.jsx(Tse,{scope:n,onClose:C,children:wp.createPortal(s.jsx(fO.ItemSlot,{scope:n,children:s.jsx(hse,{asChild:!0,onEscapeKeyDown:ht(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||C(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(pt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...m,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ht(e.onKeyDown,U=>{U.key==="Escape"&&(l==null||l(U.nativeEvent),U.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,C()))}),onPointerDown:ht(e.onPointerDown,U=>{U.button===0&&(w.current={x:U.clientX,y:U.clientY})}),onPointerMove:ht(e.onPointerMove,U=>{if(!w.current)return;const q=U.clientX-w.current.x,Z=U.clientY-w.current.y,H=!!j.current,$=["left","right"].includes(g.swipeDirection),W=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,ee=$?W(0,q):0,V=$?0:W(0,Z),O=U.pointerType==="touch"?10:2,M={x:ee,y:V},B={originalEvent:U,delta:M};H?(j.current=M,W1(Ese,f,B,{discrete:!1})):kL(M,g.swipeDirection,O)?(j.current=M,W1(kse,d,B,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(q)>O||Math.abs(Z)>O)&&(w.current=null)}),onPointerUp:ht(e.onPointerUp,U=>{const q=j.current,Z=U.target;if(Z.hasPointerCapture(U.pointerId)&&Z.releasePointerCapture(U.pointerId),j.current=null,w.current=null,q){const H=U.currentTarget,$={originalEvent:U,delta:q};kL(q,g.swipeDirection,g.swipeThreshold)?W1(Pse,h,$,{discrete:!0}):W1(Cse,p,$,{discrete:!0}),H.addEventListener("click",W=>W.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),Ise=e=>{const{__scopeToast:t,children:n,...r}=e,a=aS(jb,t),[i,o]=x.useState(!1),[l,c]=x.useState(!1);return $se(()=>o(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:s.jsx(_b,{asChild:!0,children:s.jsx(rS,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},Lse="ToastTitle",jW=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(pt.div,{...r,ref:t})});jW.displayName=Lse;var Mse="ToastDescription",SW=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(pt.div,{...r,ref:t})});SW.displayName=Mse;var NW="ToastAction",AW=x.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(EW,{altText:n,asChild:!0,children:s.jsx(hO,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${NW}\`. Expected non-empty \`string\`.`),null)});AW.displayName=NW;var kW="ToastClose",hO=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=Ose(kW,n);return s.jsx(EW,{asChild:!0,children:s.jsx(pt.button,{type:"button",...r,ref:t,onClick:ht(e.onClick,a.onClose)})})});hO.displayName=kW;var EW=x.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(pt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function CW(e){const t=[];
vendor: 4,290 bytes, lines 40-65
40return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Dse(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...CW(r))}}),t}function W1(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?U_(a,i):a.dispatchEvent(i)}var kL=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function $se(e=()=>{}){const t=Pr(e);Xr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Dse(e){return e.nodeType===e.ELEMENT_NODE}function Fse(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function sA(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Bse=yW,PW=bW,TW=_W,OW=jW,RW=SW,IW=AW,LW=hO;function MW(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=MW(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Cn(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=MW(e))&&(r&&(r+=" "),r+=t);return r}const EL=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,CL=Cn,Tv=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return CL(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(u=>{const d=n==null?void 0:n[u],f=i==null?void 0:i[u];if(d===null)return null;const p=EL(d)||EL(f);return a[u][p]}),l=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(m=>{let[g,v]=m;return Array.isArray(v)?v.includes({...i,...l}[g]):{...i,...l}[g]===v})?[...u,f,p]:u},[]);return CL(e,o,c,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 Use=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$W=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===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 zse={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 Wse=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...l},c)=>x.createElement("svg",{ref:c,...zse,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$W("lucide",a),...l},[...o.map(([u,d])=>x.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 dt=(e,t)=>{const n=x.forwardRef(({className:r,...a},i)=>x.createElement(Wse,{ref:i,iconNode:t,className:$W(`lucide-${Use(e)}`,r),...a}));return n.displayName=`${e}`,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 PL=dt("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l
65-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
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 qse=dt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
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 Og=dt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
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 Rg=dt("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
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 Vse=dt("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
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 Hse=dt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
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 Gse=dt("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
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 Yse=dt("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
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 ex=dt("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
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 Kse=dt("CalendarCheck",[["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"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]]);/**
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 Ig=dt("CalendarDays",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
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 yi=dt("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"}]]);/**
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 Zse=dt("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
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 tx=dt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 af=dt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 Sb=dt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
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 Ho=dt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 DW=dt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 er=dt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
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 Nt=dt("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
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 Xse=dt("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 Jse=dt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
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 Pa=dt("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
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 Qse=dt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 TL=dt("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
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 eoe=dt("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
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 Fn=dt("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
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 oA=dt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
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 sf=dt("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
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 toe=dt("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/**
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 Lg=dt("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"}]]);/**
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 nx=dt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
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 $s=dt("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"}]]);/**
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 noe=dt("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
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 pO=dt("FileCheck",[["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:"m9 15 2 2 4-4",key:"1grp1n"}]]);/**
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 En=dt("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"}]]);/**
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 mO=dt("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
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 Bh=dt("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
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 JE=dt("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"}]]);/**
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 fc=dt("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
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 Ed=dt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 roe=dt("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
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 aoe=dt("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"}]]);/**
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 lA=dt("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
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 ioe=dt("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
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 Xt=dt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 soe=dt("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
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 Mg=dt("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 ooe=dt("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
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 Uh=dt("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"}]]);/**
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 lu=dt("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"}]]);/**
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 loe=dt("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"}]]);/**
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 gO=dt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
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 vO=dt("MessageSquare",[["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"}]]);/**
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 cA=dt("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
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 coe=dt("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
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 uoe=dt("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
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 doe=dt("PartyPopper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);/**
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 rx=dt("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"}]]);/**
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 zh=dt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 of=dt("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"}]]);/**
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 yO=dt("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"}]]);/**
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 z_=dt("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"}]]);/**
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 FW=dt("School",[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7.382a1 1 0 0 1 .553-.894L6 10",key:"1xqip1"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 7.106-3.553a2 2 0 0 1 1.788 0L20 6",key:"9d2ml
380k"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]]);/**
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 lf=dt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 OL=dt("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
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 RL=dt("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
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 QE=dt("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 Cd=dt("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
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 W_=dt("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
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 foe=dt("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
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 IL=dt("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"}]]);/**
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 uA=dt("StickyNote",[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]]);/**
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 hoe=dt("Tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]);/**
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 ax=dt("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
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 Al=dt("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"}]]);/**
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 $g=dt("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
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 fa=dt("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 q_=dt("UserCheck",[["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"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
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 poe=dt("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);/**
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 Qh=dt("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
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 ci=dt("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
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 Zr=dt("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"}]]);/**
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 moe=dt("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 yf=dt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 13,920 bytes, lines 485-505
485],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
486 * @license lucide-react v0.462.0 - ISC
487 *
488 * This source code is licensed under the ISC license.
489 * See the LICENSE file in the root directory of this source tree.
490 */const goe=dt("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);/**
491 * @license lucide-react v0.462.0 - ISC
492 *
493 * This source code is licensed under the ISC license.
494 * See the LICENSE file in the root directory of this source tree.
495 */const voe=dt("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);/**
496 * @license lucide-react v0.462.0 - ISC
497 *
498 * This source code is licensed under the ISC license.
499 * See the LICENSE file in the root directory of this source tree.
500 */const yoe=dt("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);/**
501 * @license lucide-react v0.462.0 - ISC
502 *
503 * This source code is licensed under the ISC license.
504 * See the LICENSE file in the root directory of this source tree.
505 */const xoe=dt("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),xO="-",boe=e=>{const t=_oe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(xO);return l[0]===""&&l.length!==1&&l.shift(),BW(l,t)||woe(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},BW=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?BW(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(xO);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},LL=/^\[(.+)\]$/,woe=e=>{if(LL.test(e)){const t=LL.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},_oe=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Soe(Object.entries(e.classGroups),n).forEach(([i,o])=>{eC(o,r,i,t)}),r},eC=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:ML(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(joe(a)){eC(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{eC(o,ML(t,i),n,r)})})},ML=(e,t)=>{let n=e;return t.split(xO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},joe=e=>e.isThemeGetter,Soe=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,a]}):e,Noe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},UW="!",Aoe=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let u=0,d=0,f;for(let v=0;v<l.length;v++){let y=l[v];if(u===0){if(y===a&&(r||l.slice(v,v+i)===t)){c.push(l.slice(d,v)),d=v+i;continue}if(y==="/"){f=v;continue}}y==="["?u++:y==="]"&&u--}const p=c.length===0?l:l.substring(d),h=p.startsWith(UW),m=h?p.substring(1):p,g=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:o}):o},koe=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Eoe=e=>({cache:Noe(e.cacheSize),parseClassName:Aoe(e),...boe(e)}),Coe=/\s+/,Poe=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(Coe);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let m=!!h,g=r(m?p.substring(0,h):p);if(!g){if(!m){l=u+(l.length>0?" "+l:l);continue}if(g=r(p),!g){l=u+(l.length>0?" "+l:l);continue}m=!1}const v=koe(d).join(":"),y=f?v+UW:v,b=y+g;if(i.includes(b))continue;i.push(b);const w=a(g,m);for(let j=0;j<w.length;++j){const S=w[j];i.push(y+S)}l=u+(l.length>0?" "+l:l)}return l};function Toe(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=zW(t))&&(r&&(r+=" "),r+=n);return r}const zW=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=zW(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ooe(e,...t){let n,r,a,i=o;function o(c){const u=t.reduce((d,f)=>f(d),e());return n=Eoe(u),r=n.cache.get,a=n.cache.set,i=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=Poe(c,n);return a(c,d),d}return function(){return i(Toe.apply(null,arguments))}}const qr=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},WW=/^\[(?:([a-z-]+):)?(.+)\]$/i,Roe=/^\d+\/\d+$/,Ioe=new Set(["px","full","screen"]),Loe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Moe=/\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$/,$oe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Doe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Foe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Uc=e=>Jm(e)||Ioe.has(e)||Roe.test(e),Ju=e=>Ov(e,"length",Goe),Jm=e=>!!e&&!Number.isNaN(Number(e)),dA=e=>Ov(e,"number",Jm),Cy=e=>!!e&&Number.isInteger(Number(e)),Boe=e=>e.endsWith("%")&&Jm(e.slice(0,-1)),kn=e=>WW.test(e),Qu=e=>Loe.test(e),Uoe=new Set(["length","size","percentage"]),zoe=e=>Ov(e,Uoe,qW),Woe=e=>Ov(e,"position",qW),qoe=new Set(["image","url"]),Voe=e=>Ov(e,qoe,Koe),Hoe=e=>Ov(e,"",Yoe),Py=()=>!0,Ov=(e,t,n)=>{const r=WW.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Goe=e=>Moe.test(e)&&!$oe.test(e),qW=()=>!1,Yoe=e=>Doe.test(e),Koe=e=>Foe.test(e),Zoe=()=>{const e=qr("colors"),t=qr("spacing"),n=qr("blur"),r=qr("brightness"),a=qr("borderColor"),i=qr("borderRadius"),o=qr("borderSpacing"),l=qr("borderWidth"),c=qr("contrast"),u=qr("grayscale"),d=qr("hueRotate"),f=qr("invert"),p=qr("gap"),h=qr("gradientColorStops"),m=qr("gradientColorStopPositions"),g=qr("inset"),v=qr("margin"),y=qr("opacity"),b=qr("padding"),w=qr("saturate"),j=qr("scale"),S=qr("sepia"),A=qr("skew"),E=qr("space"),k=qr("translate"),P=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto",kn,t],I=()=>[kn,t],D=()=>["",Uc,Ju],U=()=>["auto",Jm,kn],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],H=()=>["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"],W=()=>["","0",kn],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Jm,kn];return{cacheSize:500,separator:":",theme:{colors:[Py],spacing:[Uc,Ju],blur:["none","",Qu,kn],brightness:V(),borderColor:[e],borderRadius:["none","","full",Qu,kn],borderSpacing:I(),borderWidth:D(),contrast:V(),grayscale:W(),hueRotate:V(),invert:W(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Boe,Ju],inset:C(),margin:C(),opacity:V(),padding:I(),saturate:V(),scale:V(),sepia:W(),skew:V(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",kn]}],container:["container"],columns:[{columns:[Qu]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"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:[...q(),kn]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],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",Cy,kn]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",kn]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Cy,kn]}],"grid-cols":[{"grid-cols":[Py]}],"col-start-end":[{col:["auto",{span:["full",Cy,kn]},kn]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[Py]}],"row-start-end":[{row:["auto",{span:[Cy,kn]},kn]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",kn]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",kn]}],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:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",kn,t]}],"min-w":[{"min-w":[kn,t,"min","max","fit"]}],"max-w":[{"max-w":[kn,t,"none","full","min","max","fit","prose",{screen:[Qu]},Qu]}],h:[{h:[kn,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[kn,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[kn,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[kn,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qu,Ju]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dA]}],"font-family":[{font:[Py]}],"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",kn]}],"line-clamp":[{"line-clamp":["none",Jm,dA]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Uc,kn]}],"list-image":[{"list-image":["none",kn]}],"list-style-type":[{list:["none","disc","decimal",kn]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Uc,Ju]}],"underline-offset":[{"underline-offset":["auto",Uc,kn]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kn]}],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",kn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),Woe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",zoe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Voe]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}
505],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}
vendor: 4,468 bytes, line 505
505],"divide-style":[{divide:Z()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[Uc,kn]}],"outline-w":[{outline:[Uc,Ju]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Uc,Ju]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qu,Hoe]}],"shadow-color":[{shadow:[Py]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...H(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Qu,kn]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",kn]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",kn]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",kn]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Cy,kn]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",kn]}],accent:[{accent:["auto",e]}],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",kn]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",kn]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Uc,Ju,dA]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
505none"]}]},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"]}}},Xoe=Ooe(Zoe);function Ye(...e){return Xoe(Cn(e))}const Joe=Bse,VW=x.forwardRef(({className:e,...t},n)=>s.jsx(PW,{ref:n,className:Ye("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]",e),...t}));VW.displayName=PW.displayName;const Qoe=Tv("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"}}),HW=x.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(TW,{ref:r,className:Ye(Qoe({variant:t}),e),...n}));HW.displayName=TW.displayName;const ele=x.forwardRef(({className:e,...t},n)=>s.jsx(IW,{ref:n,className:Ye("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",e),...t}));ele.displayName=IW.displayName;const GW=x.forwardRef(({className:e,...t},n)=>s.jsx(LW,{ref:n,className:Ye("absolute right-2 top-2 rounded-md p-1 text-foreground
505/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",e),"toast-close":"",...t,children:s.jsx(yf,{className:"h-4 w-4"})}));GW.displayName=LW.displayName;const YW=x.forwardRef(({className:e,...t},n)=>s.jsx(OW,{ref:n,className:Ye("text-sm font-semibold",e),...t}));YW.displayName=OW.displayName;const KW=x.forwardRef(({className:e,...t},n)=>s.jsx(RW,{ref:n,className:Ye("text-sm opacity-90",e),...t}));KW.displayName=RW.displayName;function tle(){const{toasts:e}=_c();return s.jsxs(Joe,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(HW,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(YW,{children:n}),r&&s.jsx(KW,{children:r})]}),a,s.jsx(GW,{})]},t)}),s.jsx(VW,{})]})}var $L=["light","dark"],nle="(prefers-color-scheme: dark)",rle=x.createContext(void 0),ale={setTheme:e=>{},themes:[]},ile=()=>{var e;return(e=x.useContext(rle))!=null?e:ale};x.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(m=>`'${m}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=a?$L.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(m,g=!1,v=!0)=>{let y=o?o[m]:m,b=g?m+"|| ''":`'${y}'`,w="";return a&&v&&!g&&$L.includes(m)&&(w+=`d.style.colorScheme = '${m}';`),n==="class"?g||y?w+=`c.add(${b})`:w+="null":y&&(w+=`d[s](n,${b})`),w},h=e?`!function(){${d}${p(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${nle}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}${u?"":"else{"+p(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${p(o?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${f}}catch(t){}}();`;return x.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:h}})});var sle=e=>{switch(e){case"success":return cle;case"info":return dle;case"warning":return ule;case"error":return fle;default:return null}},ole=Array(12).fill(0),lle=({visible:e,className:t})=>ue.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ue.createElement("div",{className:"sonner-spinner"},ole.map((n,r)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),cle=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),ule=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.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"})),dle=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),fle=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),hle=ue.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"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ple=()=>{let[e,t]=ue.useState(document.hidden);return ue.useEffect(()=>{let n=()=>{t(document.hidden)};
505return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},tC=1,mle=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;let{message:r,...a}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:tC++,o=this.toasts.find(c=>c.id===i),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...t,id:i,title:r}),{...c,...t,id:i,dismissible:l,title:r}):c):this.addToast({title:r,...a,dismissible:l,id:i}),i},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,dismiss:!0})),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let a=t instanceof Promise?t:t(),i=r!==void 0,o,l=a.then(async u=>{if(o=["resolve",u],ue.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(vle(u)&&!u.ok){i=!1;let d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description;this.create({id:r,type:"error",message:d,description:f})}else if(n.success!==void 0){i=!1;let d=typeof n.success=="function"?await n.success(u):n.success,f=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"success",message:d,description:f})}}).catch(async u=>{if(o=["reject",u],n.error!==void 0){i=!1;let d=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"error",message:d,description:f})}}).finally(()=>{var u;i&&(this.dismiss(r),r=void 0),(u=n.finally)==null||u.call(n)}),c=()=>new Promise((u,d)=>l.then(()=>o[0]==="reject"?d(o[1]):u(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{let r=(n==null?void 0:n.id)||tC++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ks=new mle,gle=(e,t)=>{let n=(t==null?void 0:t.id)||tC++;return ks.addToast({title:e,...t,id:n}),n},vle=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",yle=gle,xle=()=>ks.toasts,ble=()=>ks.getActiveToasts(),tn=Object.assign(yle,{success:ks.success,info:ks.info,warning:ks.warning,error:ks.error,custom:ks.custom,message:ks.message,promise:ks.promise,dismiss:ks.dismiss,loading:ks.loading},{getHistory:xle,getToasts:ble});function wle(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}wle(`: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;
505left: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}
505: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%);
505--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%)}
506`);function q1(e){return e.label!==void 0}var _le=3,jle="32px",Sle="16px",DL=4e3,Nle=356,Ale=14,kle=20,Ele=200;function ll(...e){return e.filter(Boolean).join(" ")}function Cle(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Ple=e=>{var t,n,r,a,i,o,l,c,u,d,f;let{invert:p,toast:h,unstyled:m,interacting:g,setHeights:v,visibleToasts:y,heights:b,index:w,toasts:j,expanded:S,removeToast:A,defaultRichColors:E,closeButton:k,style:P,cancelButtonStyle:R,actionButtonStyle:C,className:I="",descriptionClassName:D="",duration:U,position:q,gap:Z,loadingIcon:H,expandByDefault:$,classNames:W,icons:ee,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:O}=e,[M,B]=ue.useState(null),[G,te]=ue.useState(null),[ne,ce]=ue.useState(!1),[oe,X]=ue.useState(!1),[se,Q]=ue.useState(!1),[ye,ie]=ue.useState(!1),[F,me]=ue.useState(!1),[Ae,Ne]=ue.useState(0),[ve,pe]=ue.useState(0),Pe=ue.useRef(h.duration||U||DL),Ee=ue.useRef(null),Ie=ue.useRef(null),Me=w===0,tt=w+1<=y,De=h.type,Qe=h.dismissible!==!1,vt=h.className||"",ct=h.descriptionClassName||"",ut=ue.useMemo(()=>b.findIndex(Mt=>Mt.toastId===h.id)||0,[b,h.id]),Fe=ue.useMemo(()=>{var Mt;return(Mt=h.closeButton)!=null?Mt:k},[h.closeButton,k]),It=ue.useMemo(()=>
506h.duration||U||DL,[h.duration,U]),zt=ue.useRef(0),Wt=ue.useRef(0),Jt=ue.useRef(0),Un=ue.useRef(null),[Pt,Tn]=q.split("-"),Lt=ue.useMemo(()=>b.reduce((Mt,Ht,je)=>je>=ut?Mt:Mt+Ht.height,0),[b,ut]),Vt=ple(),Mn=h.invert||p,nn=De==="loading";Wt.current=ue.useMemo(()=>ut*Z+Lt,[ut,Lt]),ue.useEffect(()=>{Pe.current=It},[It]),ue.useEffect(()=>{ce(!0)},[]),ue.useEffect(()=>{let Mt=Ie.current;if(Mt){let Ht=Mt.getBoundingClientRect().height;return pe(Ht),v(je=>[{toastId:h.id,height:Ht,position:h.position},...je]),()=>v(je=>je.filter(rt=>rt.toastId!==h.id))}},[v,h.id]),ue.useLayoutEffect(()=>{if(!ne)return;let Mt=Ie.current,Ht=Mt.style.height;Mt.style.height="auto";let je=Mt.getBoundingClientRect().height;Mt.style.height=Ht,pe(je),v(rt=>rt.find(at=>at.toastId===h.id)?rt.map(at=>at.toastId===h.id?{...at,height:je}:at):[{toastId:h.id,height:je,position:h.position},...rt])},[ne,h.title,h.description,v,h.id]);let yt=ue.useCallback(()=>{X(!0),Ne(Wt.current),v(Mt=>Mt.filter(Ht=>Ht.toastId!==h.id)),setTimeout(()=>{A(h)},Ele)},[h,A,v,Wt]);ue.useEffect(()=>{if(h.promise&&De==="loading"||h.duration===1/0||h.type==="loading")return;let Mt;return S||g||O&&Vt?(()=>{if(Jt.current<zt.current){let Ht=new Date().getTime()-zt.current;Pe.current=Pe.current-Ht}Jt.current=new Date().getTime()})():Pe.current!==1/0&&(zt.current=new Date().getTime(),Mt=setTimeout(()=>{var Ht;(Ht=h.onAutoClose)==null||Ht.call(h,h),yt()},Pe.current)),()=>clearTimeout(Mt)},[S,g,h,De,O,Vt,yt]),ue.useEffect(()=>{h.delete&&yt()},[yt,h.delete]);function hn(){var Mt,Ht,je;return ee!=null&&ee.loading?ue.createElement("div",{className:ll(W==null?void 0:W.loader,(Mt=h==null?void 0:h.classNames)==null?void 0:Mt.loader,"sonner-loader"),"data-visible":De==="loading"},ee.loading):H?ue.createElement("div",{className:ll(W==null?void 0:W.loader,(Ht=h==null?void 0:h.classNames)==null?void 0:Ht.loader,"sonner-loader"),"data-visible":De==="loading"},H):ue.createElement(lle,{className:ll(W==null?void 0:W.loader,(je=h==null?void 0:h.classNames)==null?void 0:je.loader),visible:De==="loading"})}return ue.createElement("li",{tabIndex:0,ref:Ie,className:ll(I,vt,W==null?void 0:W.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,W==null?void 0:W.default,W==null?void 0:W[De],(n=h==null?void 0:h.classNames)==null?void 0:n[De]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:E,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":ne,"data-promise":!!h.promise,"data-swiped":F,"data-removed":oe,"data-visible":tt,"data-y-position":Pt,"data-x-position":Tn,"data-index":w,"data-front":Me,"data-swiping":se,"data-dismissible":Qe,"data-type":De,"data-invert":Mn,"data-swipe-out":ye,"data-swipe-direction":G,"data-expanded":!!(S||$&&ne),style:{"--index":w,"--toasts-before":w,"--z-index":j.length-w,"--offset":`${oe?Ae:Wt.current}px`,"--initial-height":$?"auto":`${ve}px`,...P,...h.style},onDragEnd:()=>{Q(!1),B(null),Un.current=null},onPointerDown:Mt=>{nn||!Qe||(Ee.current=new Date,Ne(Wt.current),Mt.target.setPointerCapture(Mt.pointerId),Mt.target.tagName!=="BUTTON"&&(Q(!0),Un.current={x:Mt.clientX,y:Mt.clientY}))},onPointerUp:()=>{var Mt,Ht,je,rt;if(ye||!Qe)return;Un.current=null;let at=Number(((Mt=Ie.current)==null?void 0:Mt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),xn=Number(((Ht=Ie.current)==null?void 0:Ht.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),sr=new Date().getTime()-((je=Ee.current)==null?void 0:je.getTime()),Yn=M==="x"?at:xn,nr=Math.abs(Yn)/sr;if(Math.abs(Yn)>=kle||nr>.11){Ne(Wt.current),(rt=h.onDismiss)==null||rt.call(h,h),te(M==="x"?at>0?"right":"left":xn>0?"down":"up"),yt(),ie(!0),me(!1);return}Q(!1),B(null)},onPointerMove:Mt=>{var Ht,je,rt,at;if(!Un.current||!Qe||((Ht=window.getSelection())==null?void 0:Ht.toString().length)>0)return;let xn=Mt.clientY-Un.current.y,sr=Mt.clientX-Un.current.x,Yn=(je=e.swipeDirections)!=null?je:Cle(q);!M&&(Math.abs(sr)>1||Math.abs(xn)>1)&&B(Math.abs(sr)>Math.abs(xn)?"x":"y");let nr={x:0,y:0};M==="y"?(Yn.includes("top")||Yn.includes("bottom"))&&(Yn.includes("top")&&xn<0||Yn.includes("bottom")&&xn>0)&&(nr.y=xn):M==="x"&&(Yn.includes("left")||Yn.includes("right"))&&(Yn.includes("left")&&sr<0||Yn.includes("right")&&sr>0)&&(nr.x=sr),(Math.abs(nr.x)>0||Math.abs(nr.y)>0)&&me(!0),(rt=Ie.current)==null||rt.style.setProperty("--swipe-amount-x",`${nr.x}px`),(at=Ie.current)==null||at.style.setProperty("--swipe-amount-y",`${nr.y}px`)}},Fe&&!h.jsx?ue.createElement("button",{"aria-label":V,"data-disabled":nn,"data-close-button":!0,onClick:nn||!Qe?()=>{}:()=>{var Mt;yt(),(Mt=h.onDismiss)==null||Mt.call(h,h)},className:ll(W==null?void 0:W.closeButton,(a=h==null?void 0:h.classNames)==null?void 0:a.closeButton)},(i=ee==null?void 0:ee.close)!=null?i:hle):null,h.jsx||x.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:ue.createElement(ue.Fragment,null,De||h.icon||h.promise?ue.createElement("div",{"data-icon":"",className:ll(W==null?void 0:W.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||hn():null,h.type!=="loading"?h.icon||(ee==null?void 0:ee[De])||sle(De):null):null,ue.createElement("div",{"data-content":"",className:ll(W==null?void 0:W.content,(l=h==null?void 0:h.classNames)==null?void 0:l.content)},ue.createElement("div",{"data-title":"",className:ll(W==null?void 0:W.title,(c=h==null?void 0:h.classNames)==null?void 0:c.title)},typeof h.title=="function"?h.title():h.title),h.description?ue.createElement("div",{"data-description":"",className:ll(D,ct,W==null?void 0:W.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),x.isValidElement(h.cancel)?h.cancel:h.cancel&&q1(h.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||R,onClick:Mt=>{var Ht,je;q1(h.cancel)&&Qe&&((je=(Ht=h.cancel).onClick)==null||je.call(Ht,Mt),yt())},className:ll(W==null?void 0:W.cancelButton,(d=h==null?void 0:h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,x.isValidElement(h.action)?h.action:h.action&&q1(h.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||C,onClick:Mt=>{var Ht,je;q1(h.action)&&((je=(Ht=h.action).onClick)==null||je.call(Ht,Mt),!Mt.defaultPrevented&&yt())},className:ll(W==null?void 0:W.actionButton,(f=h==null?void 0:h.classNames)==null?void 0:f.actionButton)},h.action.label):null))};function FL(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Tle(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?Sle:jle;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(l)}),n}var Ole=x.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:p,style:h,visibleToasts:m=_le,toastOptions:g,dir:v=FL(),gap:y=Ale,loadingIcon:b,icons:w,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:S}=e,[A,E]=ue.useState([]),k=ue.useMemo(()=>Array.from(new Set([r].concat(A.filter(O=>O.position).map(O=>O.position)))),[A,r]),[P,R]=ue.useState([]),[C,I]=ue.useState(!1),[D,U]=ue.useState(!1),[q,Z]=ue.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
506k":"light"),H=ue.useRef(null),$=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ue.useRef(null),ee=ue.useRef(!1),V=ue.useCallback(O=>{E(M=>{var B;return(B=M.find(G=>G.id===O.id))!=null&&B.delete||ks.dismiss(O.id),M.filter(({id:G})=>G!==O.id)})},[]);return ue.useEffect(()=>ks.subscribe(O=>{if(O.dismiss){E(M=>M.map(B=>B.id===O.id?{...B,delete:!0}:B));return}setTimeout(()=>{uO.flushSync(()=>{E(M=>{let B=M.findIndex(G=>G.id===O.id);return B!==-1?[...M.slice(0,B),{...M[B],...O},...M.slice(B+1)]:[O,...M]})})})}),[]),ue.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 O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:M})=>{Z(M?"dark":"light")})}catch{O.addListener(({matches:B})=>{try{Z(B?"dark":"light")}catch(G){console.error(G)}})}},[d]),ue.useEffect(()=>{A.length<=1&&I(!1)},[A]),ue.useEffect(()=>{let O=M=>{var B,G;a.every(te=>M[te]||M.code===te)&&(I(!0),(B=H.current)==null||B.focus()),M.code==="Escape"&&(document.activeElement===H.current||(G=H.current)!=null&&G.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[a]),ue.useEffect(()=>{if(H.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,ee.current=!1)}},[H.current]),ue.createElement("section",{ref:t,"aria-label":`${j} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((O,M)=>{var B;let[G,te]=O.split("-");return A.length?ue.createElement("ol",{key:O,dir:v==="auto"?FL():v,tabIndex:-1,ref:H,className:l,"data-sonner-toaster":!0,"data-theme":q,"data-y-position":G,"data-lifted":C&&A.length>1&&!i,"data-x-position":te,style:{"--front-toast-height":`${((B=P[0])==null?void 0:B.height)||0}px`,"--width":`${Nle}px`,"--gap":`${y}px`,...h,...Tle(c,u)},onBlur:ne=>{ee.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(ee.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||ee.current||(ee.current=!0,W.current=ne.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{D||I(!1)},onDragEnd:()=>I(!1),onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},A.filter(ne=>!ne.position&&M===0||ne.position===O).map((ne,ce)=>{var oe,X;return ue.createElement(Ple,{key:ne.id,icons:w,index:ce,toast:ne,defaultRichColors:f,duration:(oe=g==null?void 0:g.duration)!=null?oe:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:m,closeButton:(X=g==null?void 0:g.closeButton)!=null?X:o,interacting:D,position:O,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:V,toasts:A.filter(se=>se.position==ne.position),heights:P.filter(se=>se.position==ne.position),setHeights:R,expandByDefault:i,gap:y,loadingIcon:b,expanded:C,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});const Rle=({...e})=>{const{theme:t="system"}=ile();return s.jsx(Ole,{theme:t,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"}},...e})};var Ile=xT[" useId ".trim().toString()]||(()=>{}),Lle=0;function Ga(e){const[t,n]=x.useState(Ile());return Xr(()=>{e||n(r=>r??String(Lle++))},[e]),e||(t?`radix-${t}`:"")}const Mle=["top","right","bottom","left"],cf=Math.min,ro=Math.max,V_=Math.round,V1=Math.floor,hc=e=>({x:e,y:e}
vendor: 10,380 bytes, line 506
506),$le={left:"right",right:"left",bottom:"top",top:"bottom"},Dle={start:"end",end:"start"};function nC(e,t,n){return ro(e,cf(t,n))}function xu(e,t){return typeof e=="function"?e(t):e}function bu(e){return e.split("-")[0]}function Rv(e){return e.split("-")[1]}function bO(e){return e==="x"?"y":"x"}function wO(e){return e==="y"?"height":"width"}const Fle=new Set(["top","bottom"]);function sc(e){return Fle.has(bu(e))?"y":"x"}function _O(e){return bO(sc(e))}function Ble(e,t,n){n===void 0&&(n=!1);const r=Rv(e),a=_O(e),i=wO(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=H_(o)),[o,H_(o)]}function Ule(e){const t=H_(e);return[rC(e),t,rC(t)]}function rC(e){return e.replace(/start|end/g,t=>Dle[t])}const BL=["left","right"],UL=["right","left"],zle=["top","bottom"],Wle=["bottom","top"];function qle(e,t,n){switch(e){case"top":case"bottom":return n?t?UL:BL:t?BL:UL;case"left":case"right":return t?zle:Wle;default:return[]}}function Vle(e,t,n,r){const a=Rv(e);let i=qle(bu(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(rC)))),i}function H_(e){return e.replace(/left|right|bottom|top/g,t=>$le[t])}function Hle(e){return{top:0,right:0,bottom:0,left:0,...e}}function ZW(e){return typeof e!="number"?Hle(e):{top:e,right:e,bottom:e,left:e}}function G_(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function zL(e,t,n){let{reference:r,floating:a}=e;const i=sc(t),o=_O(t),l=wO(o),c=bu(t),u=i==="y",d=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,p=r[l]/2-a[l]/2;let h;switch(c){case"top":h={x:d,y:r.y-a.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-a.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Rv(t)){case"start":h[o]-=p*(n&&u?-1:1);break;case"end":h[o]+=p*(n&&u?-1:1);break}return h}const Gle=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:f}=zL(u,r,c),p=r,h={},m=0;for(let g=0;g<l.length;g++){const{name:v,fn:y}=l[g],{x:b,y:w,data:j,reset:S}=await y({x:d,y:f,initialPlacement:r,placement:p,strategy:a,middlewareData:h,rects:u,platform:o,elements:{reference:e,floating:t}});d=b??d,f=w??f,h={...h,[v]:{...h[v],...j}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(u=S.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):S.rects),{x:d,y:f}=zL(u,p,c)),g=-1)}return{x:d,y:f,placement:p,strategy:a,middlewareData:h}};async function ix(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=xu(t,e),m=ZW(h),v=l[p?f==="floating"?"reference":"floating":f],y=G_(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),b=f==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},S=G_(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:w,strategy:c}):b);return{top:(y.top-S.top+m.top)/j.y,bottom:(S.bottom-y.bottom+m.bottom)/j.y,left:(y.left-S.left+m.left)/j.x,right:(S.right-y.right+m.right)/j.x}}const Yle=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=xu(e,t)||{};if(u==null)return{};const f=ZW(d),p={x:n,y:r},h=_O(a),m=wO(h),g=await o.getDimensions(u),v=h==="y",y=v?"top":"left",b=v?"bottom":"right",w=v?"clientHeight":"clientWidth",j=i.reference[m]+i.reference[h]-p[h]-i.floating[m],S=p[h]-i.reference[h],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let E=A?A[w]:0;(!E||!await(o.isElement==null?void 0:o.isElement(A)))&&(E=l.floating[w]||i.floating[m]);const k=j/2-S/2,P=E/2-g[m]/2-1,R=cf(f[y],P),C=cf(f[b],P),I=R,D=E-g[m]-C,U=E/2-g[m]/2+k,q=nC(I,U,D),Z=!c.arrow&&Rv(a)!=null&&U!==q&&i.reference[m]/2-(U<I?R:C)-g[m]/2<0,H=Z?U<I?U-I:U-D:0;return{[h]:p[h]+H,data:{[h]:q,centerOffset:U-q-H,...Z&&{alignmentOffset:H}},reset:Z}}}),Kle=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=xu(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=bu(a),b=sc(l),w=bu(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=p||(w||!g?[H_(l)]:Ule(l)),A=m!=="none";!p&&A&&S.push(...Vle(l,g,m,j));const E=[l,...S],k=await ix(t,v),P=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(k[y]),f){const U=Ble(a,o,j);P.push(k[U[0]],k[U[1]])}if(R=[...R,{placement:a,overflows:P}],!P.every(U=>U<=0)){var C,I;const U=(((C=i.flip)==null?void 0:C.index)||0)+1,q=E[U];if(q&&(!(f==="alignment"?b!==sc(q):!1)||R.every($=>$.overflows[0]>0&&sc($.placement)===b)))return{data:{index:U,overflows:R},reset:{placement:q}};let Z=(I=R.filter(H=>H.overflows[0]<=0).sort((H,$)=>H.overflows[1]-$.overflows[1])[0])==null?void 0:I.placement;if(!Z)switch(h){case"bestFit":{var D;const H=(D=R.filter($=>{if(A){const W=sc($.placement);return W===b||W==="y"}return!0}).map($=>[$.placement,$.overflows.filter(W=>W>0).reduce((W,ee)=>W+ee,0)]).sort(($,W)=>$[1]-W[1])[0])==null?void 0:D[0];H&&(Z=H);break}case"initialPlacement":Z=l;break}if(a!==Z)return{reset:{placement:Z}}}return{}}}};function WL(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qL(e){return Mle.some(t=>e[t]>=0)}const Zle=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=xu(e,t);switch(r){case"referenceHidden":{const i=await ix(t,{...a,elementContext:"reference"}),o=WL(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:qL(o)}}}case"escaped":{const i=await ix(t,{...a,altBoundary:!0}),o=WL(i,n.floating);return{data:{escapedOffsets:o,escaped:qL(o)}}}default:return{}}}}},XW=new Set(["left","top"]);async function Xle(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=bu(n),l=Rv(n),c=sc(n)==="y",u=XW.has(o)?-1:1,d=i&&c?-1:1,f=xu(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof m=="number"&&(h=l==="end"?m*-1:m),c?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const Jle=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await Xle(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},Qle=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}},...c}=xu(e,t),u={x:n,y:r},d=await ix(t,c),f=sc(bu(a)),p=bO(f);let h=u[p],m=u[f];if(i){const v=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=h+d[v],w=h-d[y];h=nC(b,h,w)}if(o){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=m+d[v],w=m-d[y];m=nC(b,m,w)}const g=l.fn({...t,[p]:h,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[f]:o}}}}}},ece=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=xu(e,t),d={x:n,y:r},f=sc(a),p=bO(f);let h=d[p],m=d[f];const g=xu(l,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=p==="y"?"height":"width",j=i.reference[p]-i.floating[w]+v.mainAxis,S=i.reference[p]+i.reference[w]-v.mainAxis;h<j?h=j:h>S&&(h=S)}if(u){var y,b;const w=p==="y"?"width":"height",j=XW.has(bu(a)),S=i.reference[f]-i.floating[w]+(j&&((y=o.offset)==null?void 0:y[f])||0)+(j?0:v.crossAxis),A=i.reference[f]+i.reference[w]+(j?0:((b=o.offset)==null?void 0:b[f])||0)-(j?v.crossAxis:0);m<S?m=S:m>A&&(m=A)}return{[p]:h,[f]:m}}}},tce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=xu(e,t),d=await ix(t,u),f=bu(a),p=Rv(a),h=sc(a)==="y",{width:m,height:g}=i.floating;let v,y;f==="top"||f==="bottom"?(v=f,y=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(y=f,v=p==="end"?"top":"bottom");const b=g-d.top-d.bottom,w=m-d.left-d.right,j=cf(g-d[v],b),S=cf(m-d[y],w),A=!t.middlewareData.shift;let E=j,k=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=b),A&&!p){const R=ro(d.left,0),C=ro(d.right,0),I=ro(d.top,0),D=ro(d.bottom,0);h?k=m-2*(R!==0||C!==0?R+C:ro(d.left,d.right)):E=g-2*(I!==0||D!==0?I+D:ro(d.top,d.bottom))}await c({...t,availableWidth:k,availableHeight:E});const P=await o.getDimensions(l.floating);return m!==P.width||g!==P.height?{reset:{rects:!0}}:{}}}};function iS(){return typeof window<"u"}function Iv(e){return JW(e)?(e.nodeName||"").toLowerCase():"#document"}function fo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function jc(e){var t;return(t=(JW(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function JW(e){return iS()?e instanceof Node||e instanceof fo(e).Node:!1}function Cl(e){return iS()?e instanceof Element||e instanceof fo(e).Element:!1}function xc(e){return iS()?e instanceof HTMLElement||e instanceof fo(e).HTMLElement:!1}function VL(e){return!iS()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fo(e).ShadowRoot}const nce=new Set(["inline","contents"]);function Nb(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Pl(e);
vendor: 4,143 bytes, line 506
506return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!nce.has(a)}const rce=new Set(["table","td","th"]);function ace(e){return rce.has(Iv(e))}const ice=[":popover-open",":modal"];function sS(e){return ice.some(t=>{try{return e.matches(t)}catch{return!1}})}const sce=["transform","translate","scale","rotate","perspective"],oce=["transform","translate","scale","rotate","perspective","filter"],lce=["paint","layout","strict","content"];function jO(e){const t=SO(),n=Cl(e)?Pl(e):e;return sce.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||oce.some(r=>(n.willChange||"").includes(r))||lce.some(r=>(n.contain||"").includes(r))}function cce(e){let t=uf(e);for(;xc(t)&&!Dg(t);){if(jO(t))return t;if(sS(t))return null;t=uf(t)}return null}function SO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const uce=new Set(["html","body","#document"]);function Dg(e){return uce.has(Iv(e))}function Pl(e){return fo(e).getComputedStyle(e)}function oS(e){return Cl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uf(e){if(Iv(e)==="html")return e;const t=e.assignedSlot||e.parentNode||VL(e)&&e.host||jc(e);return VL(t)?t.host:t}function QW(e){const t=uf(e);return Dg(t)?e.ownerDocument?e.ownerDocument.body:e.body:xc(t)&&Nb(t)?t:QW(t)}function sx(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=QW(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=fo(a);if(i){const l=aC(o);return t.concat(o,o.visualViewport||[],Nb(a)?a:[],l&&n?sx(l):[])}return t.concat(a,sx(a,[],n))}function aC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eq(e){const t=Pl(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=xc(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,l=V_(n)!==i||V_(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function NO(e){return Cl(e)?e:e.contextElement}function Qm(e){const t=NO(e);if(!xc(t))return hc(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=eq(t);let o=(i?V_(n.width):n.width)/r,l=(i?V_(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const dce=hc(0);function tq(e){const t=fo(e);return!SO()||!t.visualViewport?dce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==fo(e)?!1:t}function ep(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=NO(e);let o=hc(1);t&&(r?Cl(r)&&(o=Qm(r)):o=Qm(e));const l=fce(i,n,r)?tq(i):hc(0);let c=(a.left+l.x)/o.x,u=(a.top+l.y)/o.y,d=a.width/o.x,f=a.height/o.y;if(i){const p=fo(i),h=r&&Cl(r)?fo(r):r;let m=p,g=aC(m);for(;g&&r&&h!==m;){const v=Qm(g),y=g.getBoundingClientRect(),b=Pl(g),w=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*v.x,j=y.top+(g.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=w,u+=j,m=fo(g),g=aC(m)}}return G_({width:d,height:f,x:c,y:u})}function AO(e,t){const n=oS(e).scrollLeft;return t?t.left+n:ep(jc(e)).left+n}function nq(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:AO(e,r)),i=r.top+t.scrollTop;return{x:a,y:i}}function hce(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=jc(r),l=t?sS(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=hc(1);const d=hc(0),f=xc(r);if((f||!f&&!i)&&((Iv(r)!=="body"||Nb(o))&&(c=oS(r)),xc(r))){const h=ep(r);u=Qm(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=o&&!f&&!i?nq(o,c,!0):hc(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-c.scrollTop*u.y+d.y+p.y}}function pce(e){return Array.from(e.getClientRects())}function mce(e){const t=jc(e),n=oS(e),r=e.ownerDocument.body,a=ro(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ro(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+AO(e);const l=-n.scrollTop;return Pl(r).direction==="rtl"&&(o+=ro(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:l}}
vendor: 11,360 bytes, line 506
506function gce(e,t){const n=fo(e),r=jc(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const u=SO();(!u||u&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}const vce=new Set(["absolute","fixed"]);function yce(e,t){const n=ep(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=xc(e)?Qm(e):hc(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,u=r*i.y;return{width:o,height:l,x:c,y:u}}function HL(e,t,n){let r;if(t==="viewport")r=gce(e,n);else if(t==="document")r=mce(jc(e));else if(Cl(t))r=yce(t,n);else{const a=tq(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return G_(r)}function rq(e,t){const n=uf(e);return n===t||!Cl(n)||Dg(n)?!1:Pl(n).position==="fixed"||rq(n,t)}function xce(e,t){const n=t.get(e);if(n)return n;let r=sx(e,[],!1).filter(l=>Cl(l)&&Iv(l)!=="body"),a=null;const i=Pl(e).position==="fixed";let o=i?uf(e):e;for(;Cl(o)&&!Dg(o);){const l=Pl(o),c=jO(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&vce.has(a.position)||Nb(o)&&!c&&rq(e,o))?r=r.filter(d=>d!==o):a=l,o=uf(o)}return t.set(e,r),r}function bce(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?sS(t)?[]:xce(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const f=HL(t,d,a);return u.top=ro(f.top,u.top),u.right=cf(f.right,u.right),u.bottom=cf(f.bottom,u.bottom),u.left=ro(f.left,u.left),u},HL(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function wce(e){const{width:t,height:n}=eq(e);return{width:t,height:n}}function _ce(e,t,n){const r=xc(t),a=jc(t),i=n==="fixed",o=ep(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=hc(0);function u(){c.x=AO(a)}if(r||!r&&!i)if((Iv(t)!=="body"||Nb(a))&&(l=oS(t)),r){const h=ep(t,!0,i,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else a&&u();i&&!r&&a&&u();const d=a&&!r&&!i?nq(a,l):hc(0),f=o.left+l.scrollLeft-c.x-d.x,p=o.top+l.scrollTop-c.y-d.y;return{x:f,y:p,width:o.width,height:o.height}}function fA(e){return Pl(e).position==="static"}function GL(e,t){if(!xc(e)||Pl(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return jc(e)===n&&(n=n.ownerDocument.body),n}function aq(e,t){const n=fo(e);if(sS(e))return n;if(!xc(e)){let a=uf(e);for(;a&&!Dg(a);){if(Cl(a)&&!fA(a))return a;a=uf(a)}return n}let r=GL(e,t);for(;r&&ace(r)&&fA(r);)r=GL(r,t);return r&&Dg(r)&&fA(r)&&!jO(r)?n:r||cce(e)||n}const jce=async function(e){const t=this.getOffsetParent||aq,n=this.getDimensions,r=await n(e.floating);return{reference:_ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sce(e){return Pl(e).direction==="rtl"}const Nce={convertOffsetParentRelativeRectToViewportRelativeRect:hce,getDocumentElement:jc,getClippingRect:bce,getOffsetParent:aq,getElementRects:jce,getClientRects:pce,getDimensions:wce,getScale:Qm,isElement:Cl,isRTL:Sce};function iq(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ace(e,t){let n=null,r;const a=jc(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=u;if(l||t(),!p||!h)return;const m=V1(f),g=V1(a.clientWidth-(d+p)),v=V1(a.clientHeight-(f+h)),y=V1(d),w={rootMargin:-m+"px "+-g+"px "+-v+"px "+-y+"px",threshold:ro(0,cf(1,c))||1};let j=!0;function S(A){const E=A[0].intersectionRatio;if(E!==c){if(!j)return o();E?o(!1,E):r=setTimeout(()=>{o(!1,1e-7)},1e3)}E===1&&!iq(u,e.getBoundingClientRect())&&o(),j=!1}try{n=new IntersectionObserver(S,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(S,w)}n.observe(e)}return o(!0),i}function kce(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=NO(e),d=a||i?[...u?sx(u):[],...sx(t)]:[];d.forEach(y=>{a&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&l?Ace(u,n):null;let p=-1,h=null;o&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),u&&!c&&h.observe(u),h.observe(t));let m,g=c?ep(e):null;c&&v();function v(){const y=ep(e);g&&!iq(g,y)&&n(),g=y,m=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(b=>{a&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),f==null||f(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const Ece=Jle,Cce=Qle,Pce=Kle,Tce=tce,Oce=Zle,YL=Yle,Rce=ece,Ice=(e,t,n)=>{const r=new Map,a={platform:Nce,...n},i={...a.platform,_c:r};return Gle(e,t,{...a,platform:i})};var Lce=typeof document<"u",Mce=function(){},Xw=Lce?x.useLayoutEffect:Mce;function Y_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Y_(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Y_(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function sq(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function KL(e,t){const n=sq(e);return Math.round(t*n)/n}function hA(e){const t=x.useRef(e);return Xw(()=>{t.current=e}),t}function $ce(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=x.useState(r);Y_(p,r)||h(r);const[m,g]=x.useState(null),[v,y]=x.useState(null),b=x.useCallback($=>{$!==A.current&&(A.current=$,g($))},[]),w=x.useCallback($=>{$!==E.current&&(E.current=$,y($))},[]),j=i||m,S=o||v,A=x.useRef(null),E=x.useRef(null),k=x.useRef(d),P=c!=null,R=hA(c),C=hA(a),I=hA(u),D=x.useCallback(()=>{if(!A.current||!E.current)return;const $={placement:t,strategy:n,middleware:p};C.current&&($.platform=C.current),Ice(A.current,E.current,$).then(W=>{const ee={...W,isPositioned:I.current!==!1};U.current&&!Y_(k.current,ee)&&(k.current=ee,wp.flushSync(()=>{f(ee)}))})},[p,t,n,C,I]);Xw(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[u]);const U=x.useRef(!1);Xw(()=>(U.current=!0,()=>{U.current=!1}),[]),Xw(()=>{if(j&&(A.current=j),S&&(E.current=S),j&&S){if(R.current)return R.current(j,S,D);D()}},[j,S,D,R,P]);const q=x.useMemo(()=>({reference:A,floating:E,setReference:b,setFloating:w}),[b,w]),Z=x.useMemo(()=>({reference:j,floating:S}),[j,S]),H=x.useMemo(()=>{const $={position:n,left:0,top:0};if(!Z.floating)return $;const W=KL(Z.floating,d.x),ee=KL(Z.floating,d.y);return l?{...$,transform:"translate("+W+"px, "+ee+"px)",...sq(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:ee}},[n,l,Z.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:D,refs:q,elements:Z,floatingStyles:H}),[d,D,q,Z,H])}const Dce=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?YL({element:r.current,padding:a}).fn(n):{}:r?YL({element:r,padding:a}).fn(n):{}}}},Fce=(e,t)=>({...Ece(e),options:[e,t]}),Bce=(e,t)=>({...Cce(e),options:[e,t]}),Uce=(e,t)=>({...Rce(e),options:[e,t]}),zce=(e,t)=>({...Pce(e),options:[e,t]}),Wce=(e,t)=>({...Tce(e),options:[e,t]}),qce=(e,t)=>({...Oce(e),options:[e,t]}),Vce=(e,t)=>({...Dce(e),options:[e,t]});var Hce="Arrow",oq=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(pt.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});oq.displayName=Hce;var Gce=oq;function kO(e){const[t,n]=x.useState(void 0);return Xr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var EO="Popper",[lq,Lv]=ui(EO),[Yce,cq]=lq(EO),uq=e=>{const{__scopePopper:t,children:n}=e,[r,a]=x.useState(null);return s.jsx(Yce,{scope:t,anchor:r,onAnchorChange:a,children:n})};uq.displayName=EO;var dq="PopperAnchor",fq=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=cq(dq,n),o=x.useRef(null),l=sn(t,o);return x.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:s.jsx(pt.div,{...a,ref:l})});fq.displayName=dq;var CO="PopperContent",[Kce,Zce]=lq(CO),hq=x.forwardRef((e,t)=>{var ne,ce,oe,X,se,Q;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...g}=e,v=cq(CO,n),[y,b]=x.useState(null),w=sn(t,ye=>b(ye)),[j,S]=x.useState(null),A=kO(j),E=(A==null?void 0:A.width)??0,k=(A==null?void 0:A.height)??0,P=r+(i!=="center"?"-"+i:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},C=Array.isArray(u)?u:[u],I=C.length>0,D={padding:R,boundary:C.filter(Jce),altBoundary:I},{refs:U,floatingStyles:q,placement:Z,isPositioned:H,middlewareData:$}=$ce({strategy:"fixed",placement:P,whileElementsMounted:(...ye)=>kce(...ye,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[Fce({mainAxis:a+k,alignmentAxis:o}),c&&Bce({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Uce():void 0,...D}),c&&zce({...D}),Wce({...D,apply:({elements:ye,rects:ie,availableWidth:F,availableHeight:me})=>{const{width:Ae,height:Ne}=ie.reference,ve=ye.floating.style;ve.setProperty("--radix-popper-available-width",`${F}px`),ve.setProperty("--radix-popper-available-height",`${me}px`),ve.setProperty("--radix-popper-anchor-width",`${Ae}px`),ve.setProperty("--radix-popper-anchor-height",`${Ne}px`)}}),j&&Vce({element:j,padding:l}),Qce({arrowWidth:E,arrowHeight:k}),p&&qce({strategy:"referenceHidden",...D})]}),[W,ee]=gq(Z),V=Pr(m);Xr(()=>{H&&(V==null||V())},[H,V]);const O=(ne=$.arrow)==null?void 0:ne.x,M=(ce=$.arrow)==null?void 0:ce.y,B=((oe=$.arrow)==null?void 0:oe.centerOffset)!==0,[G,te]=x.useState();return Xr(()=>{y&&te(window.getComputedStyle(y).zIndex)},[y]),s.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:H?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(X=$.transformOrigin)==null?void 0:X.x,(se=$.transformOrigin)==null?void 0:se.y].join(" "),...((Q=$.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(Kce,{scope:n,placedSide:W,onArrowChange:S,arrowX:O,arrowY:M,shouldHideArrow:B,children:s.jsx(pt.div,{"data-side":W,"data-align":ee,...g,ref:w,style:{...g.style,animation:H?void 0:"none"}})})})});
vendor: 4,397 bytes, line 506
506hq.displayName=CO;var pq="PopperArrow",Xce={top:"bottom",right:"left",bottom:"top",left:"right"},mq=x.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=Zce(pq,r),o=Xce[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]: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:s.jsx(Gce,{...a,ref:n,style:{...a.style,display:"block"}})})});mq.displayName=pq;function Jce(e){return e!==null}var Qce=e=>({name:"transformOrigin",options:e,fn(t){var v,y,b;const{placement:n,rects:r,middlewareData:a}=t,o=((v=a.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=gq(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((y=a.arrow)==null?void 0:y.x)??0)+l/2,h=(((b=a.arrow)==null?void 0:b.y)??0)+c/2;let m="",g="";return u==="bottom"?(m=o?f:`${p}px`,g=`${-c}px`):u==="top"?(m=o?f:`${p}px`,g=`${r.floating.height+c}px`):u==="right"?(m=`${-c}px`,g=o?f:`${h}px`):u==="left"&&(m=`${r.floating.width+c}px`,g=o?f:`${h}px`),{data:{x:m,y:g}}}});function gq(e){const[t,n="center"]=e.split("-");return[t,n]}var PO=uq,lS=fq,TO=hq,OO=mq,[cS,DXe]=ui("Tooltip",[Lv]),uS=Lv(),vq="TooltipProvider",eue=700,iC="tooltip.open",[tue,RO]=cS(vq),yq=e=>{const{__scopeTooltip:t,delayDuration:n=eue,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=x.useRef(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(tue,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(u=>{l.current=u},[]),disableHoverableContent:a,children:i})};yq.displayName=vq;var ox="Tooltip",[nue,dS]=cS(ox),xq=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=RO(ox,e.__scopeTooltip),u=uS(t),[d,f]=x.useState(null),p=Ga(),h=x.useRef(0),m=o??c.disableHoverableContent,g=l??c.delayDuration,v=x.useRef(!1),[y,b]=vs({prop:r,defaultProp:a??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(iC))):c.onClose(),i==null||i(E)},caller:ox}),w=x.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),j=x.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),S=x.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),A=x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},g)},[g,b]);return x.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),s.jsx(PO,{...u,children:s.jsx(nue,{scope:t,contentId:p,open:y,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?A():j()},[c.isOpenDelayedRef,A,j]),onTriggerLeave:x.useCallback(()=>{m?S():(window.clearTimeout(h.current),h.current=0)},[S,m]),onOpen:j,onClose:S,disableHoverableContent:m,children:n})})};xq.displayName=ox;var sC="TooltipTrigger",bq=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=dS(sC,n),i=RO(sC,n),o=uS(n),l=x.useRef(null),c=sn(t,l,a.onTriggerChange),u=x.useRef(!1),d=x.useRef(!1),f=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),s.jsx(lS,{asChild:!0,...o,children:s.jsx(pt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:ht(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:ht(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:ht(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ht(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:ht(e.onBlur,a.onClose),onClick:ht(e.onClick,a.onClose)})})});bq.displayName=sC;var rue="TooltipPortal",[FXe,aue]=cS(rue,{forceMount:void 0}),Fg="TooltipContent",wq=x.forwardRef((e,t)=>
vendor: 4,312 bytes, line 506
506{const n=aue(Fg,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=dS(Fg,e.__scopeTooltip);return s.jsx(Ka,{present:r||o.open,children:o.disableHoverableContent?s.jsx(_q,{side:a,...i,ref:t}):s.jsx(iue,{side:a,...i,ref:t})})}),iue=x.forwardRef((e,t)=>{const n=dS(Fg,e.__scopeTooltip),r=RO(Fg,e.__scopeTooltip),a=x.useRef(null),i=sn(t,a),[o,l]=x.useState(null),{trigger:c,onClose:u}=n,d=a.current,{onPointerInTransitChange:f}=r,p=x.useCallback(()=>{l(null),f(!1)},[f]),h=x.useCallback((m,g)=>{const v=m.currentTarget,y={x:m.clientX,y:m.clientY},b=uue(y,v.getBoundingClientRect()),w=due(y,b),j=fue(g.getBoundingClientRect()),S=pue([...w,...j]);l(S),f(!0)},[f]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(c&&d){const m=v=>h(v,d),g=v=>h(v,c);return c.addEventListener("pointerleave",m),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",g)}}},[c,d,h,p]),x.useEffect(()=>{if(o){const m=g=>{const v=g.target,y={x:g.clientX,y:g.clientY},b=(c==null?void 0:c.contains(v))||(d==null?void 0:d.contains(v)),w=!hue(y,o);b?p():w&&(p(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,d,o,u,p]),s.jsx(_q,{...e,ref:i})}),[sue,oue]=cS(ox,{isInside:!1}),lue=dW("TooltipContent"),_q=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=dS(Fg,n),u=uS(n),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(iC,d),()=>document.removeEventListener(iC,d)),[d]),x.useEffect(()=>{if(c.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),s.jsx(_p,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:s.jsxs(TO,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.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:[s.jsx(lue,{children:r}),s.jsx(sue,{scope:n,isInside:!0,children:s.jsx(gW,{id:c.contentId,role:"tooltip",children:a||r})})]})})});wq.displayName=Fg;var jq="TooltipArrow",cue=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=uS(n);return oue(jq,n).isInside?null:s.jsx(OO,{...a,...r,ref:t})});cue.displayName=jq;function uue(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function due(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function fue(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function hue(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,d=l.y,f=c.x,p=c.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(a=!a)}return a}function pue(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),mue(t)}function mue(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var gue=yq,vue=xq,yue=bq,Sq=wq;const i0=gue,xh=vue,bh=yue,Pd=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>
vendor: 7,645 bytes, line 506
506s.jsx(Sq,{ref:r,sideOffset:t,className:Ye("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",e),...n}));Pd.displayName=Sq.displayName;var Mv=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tp=typeof window>"u"||"Deno"in globalThis;function cs(){}function xue(e,t){return typeof e=="function"?e(t):e}function oC(e){return typeof e=="number"&&e>=0&&e!==1/0}function Nq(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qd(e,t){return typeof e=="function"?e(t):e}function Ro(e,t){return typeof e=="function"?e(t):e}function ZL(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==IO(o,t.options))return!1}else if(!lx(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||i&&!i(t))}function XL(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(np(t.options.mutationKey)!==np(i))return!1}else if(!lx(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function IO(e,t){return((t==null?void 0:t.queryKeyHashFn)||np)(e)}function np(e){return JSON.stringify(e,(t,n)=>lC(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function lx(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>lx(e[n],t[n])):!1}function Aq(e,t){if(e===t)return e;const n=JL(e)&&JL(t);if(n||lC(e)&&lC(t)){const r=n?e:Object.keys(e),a=r.length,i=n?t:Object.keys(t),o=i.length,l=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<o;d++){const f=n?d:i[d];(!n&&c.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=Aq(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return a===o&&u===a?e:l}return t}function K_(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function JL(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lC(e){if(!QL(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!QL(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function QL(e){return Object.prototype.toString.call(e)==="[object Object]"}function bue(e){return new Promise(t=>{setTimeout(t,e)})}function cC(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Aq(e,t):t}function wue(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _ue(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var LO=Symbol();function kq(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===LO?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Eq(e,t){return typeof e=="function"?e(...t):!!e}var Ch,gd,hg,B9,jue=(B9=class extends Mv{constructor(){super();Kt(this,Ch);Kt(this,gd);Kt(this,hg);bt(this,hg,t=>{if(!tp&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){be(this,gd)||this.setEventListener(be(this,hg))}onUnsubscribe(){var t;this.hasListeners()||((t=be(this,gd))==null||t.call(this),bt(this,gd,void 0))}setEventListener(t){var n;bt(this,hg,t),(n=be(this,gd))==null||n.call(this),bt(this,gd,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){be(this,Ch)!==t&&(bt(this,Ch,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof be(this,Ch)=="boolean"?be(this,Ch):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ch=new WeakMap,gd=new WeakMap,hg=new WeakMap,B9),MO=new jue,pg,vd,mg,U9,Sue=(U9=class extends Mv{constructor(){super();Kt(this,pg,!0);Kt(this,vd);Kt(this,mg);bt(this,mg,t=>{if(!tp&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){be(this,vd)||this.setEventListener(be(this,mg))}onUnsubscribe(){var t;this.hasListeners()||((t=be(this,vd))==null||t.call(this),bt(this,vd,void 0))}setEventListener(t){var n;bt(this,mg,t),(n=be(this,vd))==null||n.call(this),bt(this,vd,t(this.setOnline.bind(this)))}setOnline(t){be(this,pg)!==t&&(bt(this,pg,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return be(this,pg)}},pg=new WeakMap,vd=new WeakMap,mg=new WeakMap,U9),Z_=new Sue;function uC(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}function Nue(e){return Math.min(1e3*2**e,3e4)}function Cq(e){return(e??"online")==="online"?Z_.isOnline():!0}var Pq=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pA(e){return e instanceof Pq}function Tq(e){let t=!1,n=0,r=!1,a;const i=uC(),o=g=>{var v;r||(p(new Pq(g)),(v=e.abort)==null||v.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>MO.isFocused()&&(e.networkMode==="always"||Z_.isOnline())&&e.canRun(),d=()=>Cq(e.networkMode)&&e.canRun(),f=g=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,g),a==null||a(),i.resolve(g))},p=g=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,g),a==null||a(),i.reject(g))},h=()=>new Promise(g=>{var v;a=y=>{(r||u())&&g(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var g;a=void 0,r||(g=e.onContinue)==null||g.call(e)}),m=()=>{if(r)return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(f).catch(y=>{var A;if(r)return;const b=e.retry??(tp?0:3),w=e.retryDelay??Nue,j=typeof w=="function"?w(n,y):w,S=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,y);if(t||!S){p(y);return}n++,(A=e.onFail)==null||A.call(e,n,y),bue(j).then(()=>u()?void 0:h()).then(()=>{t?p(y):m()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?m():h().then(m),i)}}var Aue=e=>setTimeout(e,0);function kue(){let e=[],t=0,n=l=>{l()},r=l=>{l()},a=Aue;const i=l=>{t?e.push(l):a(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{a=l}}}var ii=kue(),Ph,z9,Oq=(z9=class{constructor(){Kt(this,Ph)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oC(this.gcTime)&&bt(this,Ph,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tp?1/0:5*60*1e3))}clearGcTimeout(){be(this,Ph)&&(clearTimeout(be(this,Ph)),bt(this,Ph,void 0))}},Ph=new WeakMap,z9),gg,Th,Oo,Oh,Gi,fb,Rh,vl,Hc,W9,Eue=(W9=class extends Oq{
vendor: 2,704 bytes, line 506
506constructor(t){super();Kt(this,vl);Kt(this,gg);Kt(this,Th);Kt(this,Oo);Kt(this,Oh);Kt(this,Gi);Kt(this,fb);Kt(this,Rh);bt(this,Rh,!1),bt(this,fb,t.defaultOptions),this.setOptions(t.options),this.observers=[],bt(this,Oh,t.client),bt(this,Oo,be(this,Oh).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,bt(this,gg,Cue(this.options)),this.state=t.state??be(this,gg),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=be(this,Gi))==null?void 0:t.promise}setOptions(t){this.options={...be(this,fb),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&be(this,Oo).remove(this)}setData(t,n){const r=cC(this.state.data,t,this.options);return Pn(this,vl,Hc).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Pn(this,vl,Hc).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=be(this,Gi))==null?void 0:r.promise;return(a=be(this,Gi))==null||a.cancel(t),n?n.then(cs).catch(cs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(be(this,gg))}isActive(){return this.observers.some(t=>Ro(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===LO||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>qd(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Nq(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=be(this,Gi))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=be(this,Gi))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),be(this,Oo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(be(this,Gi)&&(be(this,Rh)?be(this,Gi).cancel({revert:!0}):be(this,Gi).cancelRetry()),this.scheduleGc()),be(this,Oo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Pn(this,vl,Hc).call(this,{type:"invalidate"})}
vendor: 29,081 bytes, line 506
506fetch(t,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(be(this,Gi))return be(this,Gi).continueRetry(),be(this,Gi).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(h=>h.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,a=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(bt(this,Rh,!0),r.signal)})},i=()=>{const p=kq(this.options,n),m=(()=>{const g={client:be(this,Oh),queryKey:this.queryKey,meta:this.meta};return a(g),g})();return bt(this,Rh,!1),this.options.persister?this.options.persister(p,m,this):p(m)},l=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:be(this,Oh),state:this.state,fetchFn:i};return a(p),p})();(u=this.options.behavior)==null||u.onFetch(l,this),bt(this,Th,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Pn(this,vl,Hc).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=p=>{var h,m,g,v;pA(p)&&p.silent||Pn(this,vl,Hc).call(this,{type:"error",error:p}),pA(p)||((m=(h=be(this,Oo).config).onError)==null||m.call(h,p,this),(v=(g=be(this,Oo).config).onSettled)==null||v.call(g,this.state.data,p,this)),this.scheduleGc()};return bt(this,Gi,Tq({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var h,m,g,v;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(y){c(y);return}(m=(h=be(this,Oo).config).onSuccess)==null||m.call(h,p,this),(v=(g=be(this,Oo).config).onSettled)==null||v.call(g,p,this.state.error,this),this.scheduleGc()},onError:c,onFail:(p,h)=>{Pn(this,vl,Hc).call(this,{type:"failed",failureCount:p,error:h})},onPause:()=>{Pn(this,vl,Hc).call(this,{type:"pause"})},onContinue:()=>{Pn(this,vl,Hc).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),be(this,Gi).start()}},gg=new WeakMap,Th=new WeakMap,Oo=new WeakMap,Oh=new WeakMap,Gi=new WeakMap,fb=new WeakMap,Rh=new WeakMap,vl=new WeakSet,Hc=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Rq(r.data,this.options),fetchMeta:t.meta??null};case"success":return bt(this,Th,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return pA(a)&&a.revert&&be(this,Th)?{...be(this,Th),fetchStatus:"idle"}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ii.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),be(this,Oo).notify({query:this,type:"updated",action:t})})},W9);function Rq(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Cq(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Cue(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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 Xl,q9,Pue=(q9=class extends Mv{constructor(t={}){super();Kt(this,Xl);this.config=t,bt(this,Xl,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??IO(a,n);let o=this.get(i);return o||(o=new Eue({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){be(this,Xl).has(t.queryHash)||(be(this,Xl).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=be(this,Xl).get(t.queryHash);n&&(t.destroy(),n===t&&be(this,Xl).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ii.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return be(this,Xl).get(t)}getAll(){return[...be(this,Xl).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ZL(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>ZL(t,r)):n}notify(t){ii.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ii.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ii.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xl=new WeakMap,q9),Jl,ss,Ih,Ql,ad,V9,Tue=(V9=class extends Oq{constructor(t){super();Kt(this,Ql);Kt(this,Jl);Kt(this,ss);Kt(this,Ih);this.mutationId=t.mutationId,bt(this,ss,t.mutationCache),bt(this,Jl,[]),this.state=t.state||Iq(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){be(this,Jl).includes(t)||(be(this,Jl).push(t),this.clearGcTimeout(),be(this,ss).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){bt(this,Jl,be(this,Jl).filter(n=>n!==t)),this.scheduleGc(),be(this,ss).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){be(this,Jl).length||(this.state.status==="pending"?this.scheduleGc():be(this,ss).remove(this))}continue(){var t;return((t=be(this,Ih))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,c,u,d,f,p,h,m,g,v,y,b,w,j,S,A,E,k;const n=()=>{Pn(this,Ql,ad).call(this,{type:"continue"})};bt(this,Ih,Tq({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,R)=>{Pn(this,Ql,ad).call(this,{type:"failed",failureCount:P,error:R})},onPause:()=>{Pn(this,Ql,ad).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>be(this,ss).canRun(this)}));const r=this.state.status==="pending",a=!be(this,Ih).canStart();try{if(r)n();else{Pn(this,Ql,ad).call(this,{type:"pending",variables:t,isPaused:a}),await((o=(i=be(this,ss).config).onMutate)==null?void 0:o.call(i,t,this));const R=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));R!==this.state.context&&Pn(this,Ql,ad).call(this,{type:"pending",context:R,variables:t,isPaused:a})}const P=await be(this,Ih).start();return await((d=(u=be(this,ss).config).onSuccess)==null?void 0:d.call(u,P,t,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,P,t,this.state.context)),await((m=(h=be(this,ss).config).onSettled)==null?void 0:m.call(h,P,null,this.state.variables,this.state.context,this)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,P,null,t,this.state.context)),Pn(this,Ql,ad).call(this,{type:"success",data:P}),P}catch(P){try{throw await((b=(y=be(this,ss).config).onError)==null?void 0:b.call(y,P,t,this.state.context,this)),await((j=(w=this.options).onError)==null?void 0:j.call(w,P,t,this.state.context)),await((A=(S=be(this,ss).config).onSettled)==null?void 0:A.call(S,void 0,P,this.state.variables,this.state.context,this)),await((k=(E=this.options).onSettled)==null?void 0:k.call(E,void 0,P,t,this.state.context)),P}finally{Pn(this,Ql,ad).call(this,{type:"error",error:P})}}finally{be(this,ss).runNext(this)}}},Jl=new WeakMap,ss=new WeakMap,Ih=new WeakMap,Ql=new WeakSet,ad=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ii.batch(()=>{be(this,Jl).forEach(r=>{r.onMutationUpdate(t)}),be(this,ss).notify({mutation:this,type:"updated",action:t})})},V9);function Iq(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var eu,yl,hb,H9,Oue=(H9=class extends Mv{constructor(t={}){super();Kt(this,eu);Kt(this,yl);Kt(this,hb);this.config=t,bt(this,eu,new Set),bt(this,yl,new Map),bt(this,hb,0)}build(t,n,r){const a=new Tue({mutationCache:this,mutationId:++S1(this,hb)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){be(this,eu).add(t);const n=H1(t);if(typeof n=="string"){const r=be(this,yl).get(n);r?r.push(t):be(this,yl).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(be(this,eu).delete(t)){const n=H1(t);if(typeof n=="string"){const r=be(this,yl).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&be(this,yl).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=H1(t);if(typeof n=="string"){const r=be(this,yl).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=H1(t);if(typeof n=="string"){const a=(r=be(this,yl).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ii.batch(()=>{be(this,eu).forEach(t=>{this.notify({type:"removed",mutation:t})}),be(this,eu).clear(),be(this,yl).clear()})}getAll(){return Array.from(be(this,eu))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XL(n,r))}findAll(t={}){return this.getAll().filter(n=>XL(t,n))}notify(t){ii.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ii.batch(()=>Promise.all(t.map(n=>n.continue().catch(cs))))}},eu=new WeakMap,yl=new WeakMap,hb=new WeakMap,H9);function H1(e){var t;return(t=e.options.scope)==null?void 0:t.id}function eM(e){return{onFetch:(t,n)=>{var d,f,p,h,m;const r=t.options,a=(p=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],o=((m=t.state.data)==null?void 0:m.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const v=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},y=kq(t.options,t.fetchOptions),b=async(w,j,S)=>{if(g)return Promise.reject();if(j==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:j,direction:S?"backward":"forward",meta:t.options.meta};return v(C),C})(),k=await y(E),{maxPages:P}=t.options,R=S?_ue:wue;return{pages:R(w.pages,k,P),pageParams:R(w.pageParams,j,P)}};if(a&&i.length){const w=a==="backward",j=w?Rue:tM,S={pages:i,pageParams:o},A=j(r,S);l=await b(S,A,w)}else{const w=e??i.length;do{const j=c===0?o[0]??r.initialPageParam:tM(r,l);if(c>0&&j==null)break;l=await b(l,j),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var g,v;return(v=(g=t.options).persister)==null?void 0:v.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function tM(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Rue(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var va,yd,xd,vg,yg,bd,xg,bg,G9,Iue=(G9=class{constructor(e={}){Kt(this,va);Kt(this,yd);Kt(this,xd);Kt(this,vg);Kt(this,yg);Kt(this,bd);Kt(this,xg);Kt(this,bg);bt(this,va,e.queryCache||new Pue),bt(this,yd,e.mutationCache||new Oue),bt(this,xd,e.defaultOptions||{}),bt(this,vg,new Map),bt(this,yg,new Map),bt(this,bd,0)}mount(){S1(this,bd)._++,be(this,bd)===1&&(bt(this,xg,MO.subscribe(async e=>{e&&(await this.resumePausedMutations(),be(this,va).onFocus())})),bt(this,bg,Z_.subscribe(async e=>{e&&(await this.resumePausedMutations(),be(this,va).onOnline())})))}unmount(){var e,t;S1(this,bd)._--,be(this,bd)===0&&((e=be(this,xg))==null||e.call(this),bt(this,xg,void 0),(t=be(this,bg))==null||t.call(this),bt(this,bg,void 0))}isFetching(e){return be(this,va).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return be(this,yd).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=be(this,va).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=be(this,va).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(qd(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return be(this,va).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=be(this,va).get(r.queryHash),i=a==null?void 0:a.state.data,o=xue(t,i);if(o!==void 0)return be(this,va).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ii.batch(()=>be(this,va).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=be(this,va).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=be(this,va);ii.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=be(this,va);return ii.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ii.batch(()=>be(this,va).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(cs).catch(cs)}invalidateQueries(e,t={}){return ii.batch(()=>(be(this,va).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ii.batch(()=>be(this,va).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(cs)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(cs)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=be(this,va).build(this,t);return n.isStaleByTime(qd(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cs).catch(cs)}fetchInfiniteQuery(e){return e.behavior=eM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cs).catch(cs)}ensureInfiniteQueryData(e){return e.behavior=eM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Z_.isOnline()?be(this,yd).resumePausedMutations():Promise.resolve()}getQueryCache(){return be(this,va)}getMutationCache(){return be(this,yd)}getDefaultOptions(){return be(this,xd)}setDefaultOptions(e){bt(this,xd,e)}setQueryDefaults(e,t){be(this,vg).set(np(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...be(this,vg).values()],n={};return t.forEach(r=>{lx(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){be(this,yg).set(np(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...be(this,yg).values()],n={};return t.forEach(r=>{lx(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...be(this,xd).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=IO(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===LO&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...be(this,xd).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){be(this,va).clear(),be(this,yd).clear()}},va=new WeakMap,yd=new WeakMap,xd=new WeakMap,vg=new WeakMap,yg=new WeakMap,bd=new WeakMap,xg=new WeakMap,bg=new WeakMap,G9),Ns,Hn,pb,os,Lh,wg,wd,_d,mb,_g,jg,Mh,$h,jd,Sg,pr,s0,dC,fC,hC,pC,mC,gC,vC,Lq,Y9,Lue=(Y9=class extends Mv{constructor(t,n){super();Kt(this,pr);Kt(this,Ns);Kt(this,Hn);Kt(this,pb);Kt(this,os);Kt(this,Lh);Kt(this,wg);Kt(this,wd);Kt(this,_d);Kt(this,mb);Kt(this,_g);Kt(this,jg);Kt(this,Mh);Kt(this,$h);Kt(this,jd);Kt(this,Sg,new Set);this.options=n,bt(this,Ns,t),bt(this,_d,null),bt(this,wd,uC()),this.options.experimental_prefetchInRender||be(this,wd).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(be(this,Hn).addObserver(this),nM(be(this,Hn),this.options)?Pn(this,pr,s0).call(this):this.updateResult(),Pn(this,pr,pC).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yC(be(this,Hn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yC(be(this,Hn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Pn(this,pr,mC).call(this),Pn(this,pr,gC).call(this),be(this,Hn).removeObserver(this)}setOptions(t){const n=this.options,r=be(this,Hn);if(this.options=be(this,Ns).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ro(this.options.enabled,be(this,Hn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Pn(this,pr,vC).call(this),be(this,Hn).setOptions(this.options),n._defaulted&&!K_(this.options,n)&&be(this,Ns).getQueryCache().notify({type:"observerOptionsUpdated",query:be(this,Hn),observer:this});const a=this.hasListeners();a&&rM(be(this,Hn),r,this.options,n)&&Pn(this,pr,s0).call(this),this.updateResult(),a&&(be(this,Hn)!==r||Ro(this.options.enabled,be(this,Hn))!==Ro(n.enabled,be(this,Hn))||qd(this.options.staleTime,be(this,Hn))!==qd(n.staleTime,be(this,Hn)))&&Pn(this,pr,dC).call(this);const i=Pn(this,pr,fC).call(this);a&&(be(this,Hn)!==r||Ro(this.options.enabled,be(this,Hn))!==Ro(n.enabled,be(this,Hn))||i!==be(this,jd))&&Pn(this,pr,hC).call(this,i)}getOptimisticResult(t){const n=be(this,Ns).getQueryCache().build(be(this,Ns),t),r=this.createResult(n,t);return $ue(this,r)&&(bt(this,os,r),bt(this,wg,this.options),bt(this,Lh,be(this,Hn).state)),r}getCurrentResult(){return be(this,os)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),Reflect.get(r,a))})}trackProp(t){be(this,Sg).add(t)}getCurrentQuery(){return be(this,Hn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=be(this,Ns).defaultQueryOptions(t),r=be(this,Ns).getQueryCache().build(be(this,Ns),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Pn(this,pr,s0).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),be(this,os)))}createResult(t,n){var P;const r=be(this,Hn),a=this.options,i=be(this,os),o=be(this,Lh),l=be(this,wg),u=t!==r?t.state:be(this,pb),{state:d}=t;let f={...d},p=!1,h;if(n._optimisticResults){const R=this.hasListeners(),C=!R&&nM(t,n),I=R&&rM(t,r,n,a);(C||I)&&(f={...f,...Rq(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:v}=f;h=f.data;let y=!1;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let R;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(R=i.data,y=!0):R=typeof n.placeholderData=="function"?n.placeholderData((P=be(this,jg))==null?void 0:P.state.data,be(this,jg)):n.placeholderData,R!==void 0&&(v="success",h=cC(i==null?void 0:i.data,R,n),p=!0)}if(n.select&&h!==void 0&&!y)if(i&&h===(o==null?void 0:o.data)&&n.select===be(this,mb))h=be(this,_g);else try{bt(this,mb,n.select),h=n.select(h),h=cC(i==null?void 0:i.data,h,n),bt(this,_g,h),bt(this,_d,null)}catch(R){bt(this,_d,R)}be(this,_d)&&(m=be(this,_d),h=be(this,_g),g=Date.now(),v="error");const b=f.fetchStatus==="fetching",w=v==="pending",j=v==="error",S=w&&b,A=h!==void 0,k={status:v,fetchStatus:f.fetchStatus,isPending:w,isSuccess:v==="success",isError:j,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:j&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:j&&A,isStale:$O(t,n),refetch:this.refetch,promise:be(this,wd),isEnabled:Ro(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=D=>{k.status==="error"?D.reject(k.error):k.data!==void 0&&D.resolve(k.data)},C=()=>{const D=bt(this,wd,k.promise=uC());R(D)},I=be(this,wd);switch(I.status){case"pending":t.queryHash===r.queryHash&&R(I);break;case"fulfilled":(k.status==="error"||k.data!==I.value)&&C();break;case"rejected":(k.status!=="error"||k.error!==I.reason)&&C();break}}return k}updateResult(){const t=be(this,os),n=this.createResult(be(this,Hn),this.options);if(bt(this,Lh,be(this,Hn).state),bt(this,wg,this.options),be(this,Lh).data!==void 0&&bt(this,jg,be(this,Hn)),K_(n,t))return;bt(this,os,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!be(this,Sg).size)return!0;const o=new Set(i??be(this,Sg));return this.options.throwOnError&&o.add("error"),Object.keys(be(this,os)).some(l=>{const c=l;return be(this,os)[c]!==t[c]&&o.has(c)})};Pn(this,pr,Lq).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Pn(this,pr,pC).call(this)}},Ns=new WeakMap,Hn=new WeakMap,pb=new WeakMap,os=new WeakMap,Lh=new WeakMap,wg=new WeakMap,wd=new WeakMap,_d=new WeakMap,mb=new WeakMap,_g=new WeakMap,jg=new WeakMap,Mh=new WeakMap,$h=new WeakMap,jd=new WeakMap,Sg=new WeakMap,pr=new WeakSet,s0=function(t){Pn(this,pr,vC).call(this);let n=be(this,Hn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(cs)),n},dC=function(){Pn(this,pr,mC).call(this);const t=qd(this.options.staleTime,be(this,Hn));if(tp||be(this,os).isStale||!oC(t))return;const r=Nq(be(this,os).dataUpdatedAt,t)+1;bt(this,Mh,setTimeout(()=>{be(this,os).isStale||this.updateResult()},r))},fC=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(be(this,Hn)):this.options.refetchInterval)??!1},hC=function(t){Pn(this,pr,gC).call(this),bt(this,jd,t),!(tp||Ro(this.options.enabled,be(this,Hn))===!1||!oC(be(this,jd))||be(this,jd)===0)&&bt(this,$h,setInterval(()=>{(this.options.refetchIntervalInBackground||MO.isFocused())&&Pn(this,pr,s0).call(this)},be(this,jd)))},pC=function(){Pn(this,pr,dC).call(this),Pn(this,pr,hC).call(this,Pn(this,pr,fC).call(this))},mC=function(){be(this,Mh)&&(clearTimeout(be(this,Mh)),bt(this,Mh,void 0))},gC=function(){be(this,$h)&&(clearInterval(be(this,$h)),bt(this,$h,void 0))},vC=function(){const t=be(this,Ns).getQueryCache().build(be(this,Ns),this.options);if(t===be(this,Hn))return;const n=be(this,Hn);bt(this,Hn,t),bt(this,pb,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Lq=function(t){ii.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(be(this,os))}),be(this,Ns).getQueryCache().notify({query:be(this,Hn),type:"observerResultsUpdated"})})},Y9);function Mue(e,t){return Ro(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nM(e,t){return Mue(e,t)||e.state.data!==void 0&&yC(e,t,t.refetchOnMount)}function yC(e,t,n){if(Ro(t.enabled,e)!==!1&&qd(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&$O(e,t)}return!1}function rM(e,t,n,r){return(e!==t||Ro(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&$O(e,n)}function $O(e,t){return Ro(t.enabled,e)!==!1&&e.isStaleByTime(qd(t.staleTime,e))}function $ue(e,t){return!K_(e.getCurrentResult(),t)}var Sd,Nd,As,tu,pu,Jw,xC,K9,Due=(K9=class extends Mv{constructor(n,r){super();Kt(this,pu);Kt(this,Sd);Kt(this,Nd);Kt(this,As);Kt(this,tu);bt(this,Sd,n),this.setOptions(r),this.bindMethods(),Pn(this,pu,Jw).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=be(this,Sd).defaultMutationOptions(n),K_(this.options,r)||be(this,Sd).getMutationCache().notify({type:"observerOptionsUpdated",mutation:be(this,As),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&np(r.mutationKey)!==np(this.options.mutationKey)?this.reset():((a=be(this,As))==null?void 0:a.state.status)==="pending"&&be(this,As).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=be(this,As))==null||n.removeObserver(this)}onMutationUpdate(n){Pn(this,pu,Jw).call(this),Pn(this,pu,xC).call(this,n)}getCurrentResult(){return be(this,Nd)}reset(){var n;(n=be(this,As))==null||n.removeObserver(this),bt(this,As,void 0),Pn(this,pu,Jw).call(this),Pn(this,pu,xC).call(this)}mutate(n,r){var a;return bt(this,tu,r),(a=be(this,As))==null||a.removeObserver(this),bt(this,As,be(this,Sd).getMutationCache().build(be(this,Sd),this.options)),be(this,As).addObserver(this),be(this,As).execute(n)}},Sd=new WeakMap,Nd=new WeakMap,As=new WeakMap,tu=new WeakMap,pu=new WeakSet,Jw=function(){var r;const n=((r=be(this,As))==null?void 0:r.state)??Iq();bt(this,Nd,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},xC=function(n){ii.batch(()=>{var r,a,i,o,l,c,u,d;if(be(this,tu)&&this.hasListeners()){const f=be(this,Nd).variables,p=be(this,Nd).context;(n==null?void 0:n.type)==="success"?((a=(r=be(this,tu)).onSuccess)==null||a.call(r,n.data,f,p),(o=(i=be(this,tu)).onSettled)==null||o.call(i,n.data,null,f,p)):(n==null?void 0:n.type)==="error"&&((c=(l=be(this,tu)).onError)==null||c.call(l,n.error,f,p),(d=(u=be(this,tu)).onSettled)==null||d.call(u,void 0,n.error,f,p))}this.listeners.forEach(f=>{f(be(this,Nd))})})},K9),Mq=x.createContext(void 0),Ab=e=>{const t=x.useContext(Mq);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Fue=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(Mq.Provider,{value:e,children:t})),$q=x.createContext(!1),Bue=()=>x.useContext($q);$q.Provider;function Uue(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var zue=x.createContext(Uue()),Wue=()=>x.useContext(zue),que=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Vue=e=>{x.useEffect(()=>{e.clearReset()},[e])},Hue=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Eq(n,[e.error,r])),Gue=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Yue=(e,t)=>e.isLoading&&e.isFetching&&!t,Kue=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,aM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zue(e,t,n){var f,p,h,m,g;const r=Bue(),a=Wue(),i=Ab(),o=i.defaultQueryOptions(e);(p=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,o),o._optimisticResults=r?"isRestoring":"optimistic",Gue(o),que(o,a),Vue(a);const l=!i.getQueryCache().get(o.queryHash),[c]=x.useState(()=>new t(i,o)),u=c.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(v=>{const y=d?c.subscribe(ii.batchCalls(v)):cs;return c.updateResult(),y},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setOptions(o)},[o,c]),Kue(o,u))throw aM(o,c,a);if(Hue({result:u,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((m=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,o,u),o.experimental_prefetchInRender&&!tp&&Yue(u,r)){const v=l?aM(o,c,a):(g=i.getQueryCache().get(o.queryHash))==null?void 0:g.promise;v==null||v.catch(cs).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function th(e,t){return Zue(e,Lue)}
vendor: 4,111 bytes, lines 506-515
506function Xue(e,t){const n=Ab(),[r]=x.useState(()=>new Due(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const a=x.useSyncExternalStore(x.useCallback(o=>r.subscribe(ii.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=x.useCallback((o,l)=>{r.mutate(o,l).catch(cs)},[r]);if(a.error&&Eq(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/**
507 * @remix-run/router v1.23.0
508 *
509 * Copyright (c) Remix Software Inc.
510 *
511 * This source code is licensed under the MIT license found in the
512 * LICENSE.md file in the root directory of this source tree.
513 *
514 * @license MIT
515 */function cx(){return cx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cx.apply(this,arguments)}var Td;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Td||(Td={}));const iM="popstate";function Jue(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:l}=r.location;return bC("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:X_(a)}return ede(t,n,null,e)}function Ma(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Dq(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Que(){return Math.random().toString(36).substr(2,8)}function sM(e,t){return{usr:e.state,key:e.key,idx:t}}function bC(e,t,n,r){return n===void 0&&(n=null),cx({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?$v(t):t,{state:n,key:t&&t.key||r||Que()})}function X_(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function $v(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ede(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,l=Td.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(cx({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Td.Pop;let v=d(),y=v==null?null:v-u;u=v,c&&c({action:l,location:g.location,delta:y})}function p(v,y){l=Td.Push;let b=bC(g.location,v,y);u=d()+1;let w=sM(b,u),j=g.createHref(b);try{o.pushState(w,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;a.location.assign(j)}i&&c&&c({action:l,location:g.location,delta:1})}function h(v,y){l=Td.Replace;let b=bC(g.location,v,y);u=d();let w=sM(b,u),j=g.createHref(b);o.replaceState(w,"",j),i&&c&&c({action:l,location:g.location,delta:0})}function m(v){let y=a.location.origin!=="null"?a.location.origin:a.location.href,b=typeof v=="string"?v:X_(v);return b=b.replace(/ $/,"%20"),Ma(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let g={get action(){return l},get location(){return e(a,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(iM,f),c=v,()=>{a.removeEventListener(iM,f),c=null}},createHref(v){return t(a,v)},createURL:m,encodeLocation(v){let y=m(v);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:p,replace:h,go(v){return o.go(v)}};return g}var oM;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(oM||(oM={}));function tde(e,t,n){return n===void 0&&(n="/"),nde(e,t,n,!1)}function nde(e,t,n,r){let a=typeof t=="string"?$v(t):t,i=DO(a.pathname||"/",n);if(i==null)return null;let o=Fq(e);rde(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=pde(i);l=fde(o[c],u,r)}return l}function Fq(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Ma(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
515id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Vd([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Ma(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Fq(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:ude(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of Bq(i.path))a(i,o,c)}),t}function Bq(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=Bq(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function rde(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dde(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ade=/^:[\w-]+$/,ide=3,sde=2,ode=1,lde=10,cde=-2,lM=e=>e==="*";function ude(e,t){let n=e.split("/"),r=n.length;return n.some(lM)&&(r+=cde),t&&(r+=sde),n.filter(a=>!lM(a)).reduce((a,i)=>a+(ade.test(i)?ide:i===""?ode:lde),r)}function dde(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function fde(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=cM({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),p=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=cM({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;
vendor: 9,534 bytes, lines 515-524
515Object.assign(a,f.params),o.push({params:a,pathname:Vd([i,f.pathname]),pathnameBase:yde(Vd([i,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(i=Vd([i,f.pathnameBase]))}return o}function cM(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=hde(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:p,isOptional:h}=d;if(p==="*"){let g=l[f]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=l[f];return h&&!m?u[p]=void 0:u[p]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function hde(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Dq(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function pde(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Dq(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function DO(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function mde(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?$v(e):e;return{pathname:n?n.startsWith("/")?n:gde(n,t):t,search:xde(r),hash:bde(a)}}function gde(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function mA(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` 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 vde(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function FO(e,t){let n=vde(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function BO(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=$v(e):(a=cx({},e),Ma(!a.pathname||!a.pathname.includes("?"),mA("?","pathname","search",a)),Ma(!a.pathname||!a.pathname.includes("#"),mA("#","pathname","hash",a)),Ma(!a.search||!a.search.includes("#"),mA("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;a.pathname=p.join("/")}l=f>=0?t[f]:"/"}let c=mde(a,l),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Vd=e=>e.join("/").replace(/\/\/+/g,"/"),yde=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xde=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,bde=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function wde(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Uq=["post","put","patch","delete"];new Set(Uq);const _de=["get",...Uq];new Set(_de);/**
516 * React Router v6.30.1
517 *
518 * Copyright (c) Remix Software Inc.
519 *
520 * This source code is licensed under the MIT license found in the
521 * LICENSE.md file in the root directory of this source tree.
522 *
523 * @license MIT
524 */function ux(){return ux=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ux.apply(this,arguments)}const UO=x.createContext(null),jde=x.createContext(null),xf=x.createContext(null),fS=x.createContext(null),Cu=x.createContext({outlet:null,matches:[],isDataRoute:!1}),zq=x.createContext(null);function Sde(e,t){let{relative:n}=t===void 0?{}:t;Dv()||Ma(!1);let{basename:r,navigator:a}=x.useContext(xf),{hash:i,pathname:o,search:l}=Vq(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Vd([r,o])),a.createHref({pathname:c,search:l,hash:i})}function Dv(){return x.useContext(fS)!=null}function Ko(){return Dv()||Ma(!1),x.useContext(fS).location}function Wq(e){x.useContext(xf).static||x.useLayoutEffect(e)}function di(){let{isDataRoute:e}=x.useContext(Cu);return e?$de():Nde()}function Nde(){Dv()||Ma(!1);let e=x.useContext(UO),{basename:t,future:n,navigator:r}=x.useContext(xf),{matches:a}=x.useContext(Cu),{pathname:i}=Ko(),o=JSON.stringify(FO(a,n.v7_relativeSplatPath)),l=x.useRef(!1);return Wq(()=>{l.current=!0}),x.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=BO(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Vd([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,i,e])}function qq(){let{matches:e}=x.useContext(Cu),t=e[e.length-1];return t?t.params:{}}function Vq(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(xf),{matches:a}=x.useContext(Cu),{pathname:i}=Ko(),o=JSON.stringify(FO(a,r.v7_relativeSplatPath));return x.useMemo(()=>BO(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function Ade(e,t){return kde(e,t)}function kde(e,t,n,r){Dv()||Ma(!1);let{navigator:a}=x.useContext(xf),{matches:i}=x.useContext(Cu),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Ko(),d;if(t){var f;let v=typeof t=="string"?$v(t):t;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||Ma(!1),d=v}else d=u;let p=d.pathname||"/",h=p;if(c!=="/"){let v=c.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=tde(e,{pathname:h}),g=Ode(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:Vd([c,a.encodeLocation?a.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:Vd([c,a.encodeLocation?a.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,n,r);return t&&g?x.createElement(fS.Provider,{value:{location:ux({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Td.Pop}},g):g}function Ede(){let e=Mde(),t=wde(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:a},n):null,null)}const Cde=x.createElement(Ede,null);class Pde extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(Cu.Provider,{value:this.props.routeContext},x.createElement(zq.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Tde(e){let{routeContext:t,match:n,children:r}=e,a=x.useContext(UO);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Cu.Provider,{value:t},r)}function Ode(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Ma(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:p,errors:h}=n,m=f.route.loader&&p[f.route.id]===void 0&&(!h||h[f.route.id]===void 0);if(f.route.lazy||m){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,p)=>{let h,m=!1,g=null,v=null;n&&(h=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||Cde,c&&(u<0&&p===0?(m=!0,v=null):u===p&&(m=!0,v=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,p+1)),b=()=>{let w;return h?w=g:m?w=v:f.route.Component?w=x.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,x.createElement(Tde,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?x.createElement(Pde,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeC
524ontext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var Hq=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Hq||{}),J_=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(J_||{});function Rde(e){let t=x.useContext(UO);return t||Ma(!1),t}function Ide(e){let t=x.useContext(jde);return t||Ma(!1),t}function Lde(e){let t=x.useContext(Cu);return t||Ma(!1),t}function Gq(e){let t=Lde(),n=t.matches[t.matches.length-1];return n.route.id||Ma(!1),n.route.id}function Mde(){var e;let t=x.useContext(zq),n=Ide(J_.UseRouteError),r=Gq(J_.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function $de(){let{router:e}=Rde(Hq.UseNavigateStable),t=Gq(J_.UseNavigateStable),n=x.useRef(!1);return Wq(()=>{n.current=!0}),x.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,ux({fromRouteId:t},i)))},[e,t])}function Dde(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Bo(e){let{to:t,replace:n,state:r,relative:a}=e;Dv()||Ma(!1);let{future:i,static:o}=x.useContext(xf),{matches:l}=x.useContext(Cu),{pathname:c}=Ko(),u=di(),d=BO(t,FO(l,i.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(d);return x.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:a}),[u,f,a,n,r]),null}function Rn(e){Ma(!1)}function Fde(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Td.Pop,navigator:i,static:o=!1,future:l}=e;Dv()&&Ma(!1);let c=t.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:c,navigator:i,static:o,future:ux({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=$v(r));let{pathname:d="/",search:f="",hash:p="",state:h=null,key:m="default"}=r,g=x.useMemo(()=>{let v=DO(d,c);return v==null?null:{location:{pathname:v,search:f,hash:p,state:h,key:m},navigationType:a}},[c,d,f,p,h,m,a]);return g==null?null:x.createElement(xf.Provider,{value:u},x.createElement(fS.Provider,{children:n,value:g}))}function Bde(e){let{children:t,location:n}=e;return Ade(wC(t),n)}new Promise(()=>{});function wC(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,a)=>{if(!x.isValidElement(r))return;let i=[...t,a];if(r.type===x.Fragment){n.push.apply(n,wC(r.props.children,i));return}r.type!==Rn&&Ma(!1),!r.props.index||!r.props.children||Ma(!1);let o={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&&(o.children=wC(r.props.children,i)),n.push(o)}),n}/**
525 * React Router DOM v6.30.1
526 *
527 * Copyright (c) Remix Software Inc.
528 *
529 * This source code is licensed under the MIT license found in the
530 * LICENSE.md file in the root directory of this source tree.
531 *
532 * @license MIT
533 */function _C(){return _C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_C.apply(this,arguments)}function Ude(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function zde(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wde(e,t){return e.button===0&&(!t||t==="_self")&&!zde(e)}function jC(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function qde(e,t){let n=jC(e);return t&&t.forEach((r,a)=>
533{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const Vde=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Hde="6";try{window.__reactRouterVersion=Hde}catch{}const Gde="startTransition",uM=xT[Gde];function Yde(e){let{basename:t,children:n,future:r,window:a}=e,i=x.useRef();i.current==null&&(i.current=Jue({window:a,v5Compat:!0}));let o=i.current,[l,c]=x.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=x.useCallback(f=>{u&&uM?uM(()=>c(f)):c(f)},[c,u]);return x.useLayoutEffect(()=>o.listen(d),[o,d]),x.useEffect(()=>Dde(r),[r]),x.createElement(Fde,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const Kde=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zde=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,an=x.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,p=Ude(t,Vde),{basename:h}=x.useContext(xf),m,g=!1;if(typeof u=="string"&&Zde.test(u)&&(m=u,Kde))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=DO(j.pathname,h);j.origin===w.origin&&S!=null?u=S+j.search+j.hash:g=!0}catch{}let v=Sde(u,{relative:a}),y=Xde(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||y(w)}return x.createElement("a",_C({},p,{href:m||v,onClick:g||i?r:b,ref:n,target:c}))});var dM;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(dM||(dM={}));var fM;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(fM||(fM={}));function Xde(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=di(),u=Ko(),d=Vq(e,{relative:o});return x.useCallback(f=>{if(Wde(f,n)){f.preventDefault();let p=r!==void 0?r:X_(u)===X_(d);c(e,{replace:p,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,d,r,a,n,e,i,o,l])}function zO(e){let t=x.useRef(jC(e)),n=x.useRef(!1),r=Ko(),a=x.useMemo(()=>qde(r.search,n.current?null:t.current),[r.search]),i=di(),o=x.useCallback((l,c)=>{const u=jC(typeof l=="function"?l(a):l);n.current=!0,i("?"+u,c)},[i,a]);return[a,o]}var WO={},Q_={},SC=function(e,t){return SC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},SC(e,t)};function Yq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");SC(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Mo=function(){return Mo=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Mo.apply(this,arguments)};function bf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function Kq(e,t,n,r){var a=arguments.length,i=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i}function Zq(e,t){return function(n,r){t(n,r,e)}}function Xq(e,t,n,r,a,i){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var l=r.kind,c=l==="getter"?"get":l==="setter"?"set":"value",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),f,p=!1,h=n.length-1;h>=0;h--){var m={};for(var g in r)m[g]=g==="access"?{}:r[g];for(var g in r.access)m.access[g]=r.access[g];m.addInitializer=function(y){if(p)throw new TypeError("Cannot add initializer
533s after decoration has completed");i.push(o(y||null))};var v=(0,n[h])(l==="accessor"?{get:d.get,set:d.set}:d[c],m);if(l==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(f=o(v.get))&&(d.get=f),(f=o(v.set))&&(d.set=f),(f=o(v.init))&&a.unshift(f)}else(f=o(v))&&(l==="field"?a.unshift(f):d[c]=f)}u&&Object.defineProperty(u,r.name,d),p=!0}function Jq(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0}function Qq(e){return typeof e=="symbol"?e:"".concat(e)}function eV(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function tV(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Et(e,t,n,r){function a(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function l(d){try{u(r.next(d))}catch(f){o(f)}}function c(d){try{u(r.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):a(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})}function nV(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,a,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,a&&(i=u[0]&2?a.return:u[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,u[1])).done)return i;switch(a=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,a=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],a=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var hS=Object.create?function(e,t,n,r){r===void 0&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};function rV(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&hS(t,e,n)}function e2(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function qO(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),a,i=[],o;try{for(;(t===void 0||t-- >0)&&!(a=r.next()).done;)i.push(a.value)}catch(l){o={error:l}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function aV(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(qO(arguments[t]));return e}function iV(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),a=0,t=0;t<n;t++)for(var i=arguments[t],o=0,l=i.length;o<l;o++,a++)r[a]=i[o];return r}function VO(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Bg(e){return this instanceof Bg?(this.v=e,this):new Bg(e)}function sV(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),a,i=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),a[Symbol.asyncIterator]=function(){return this},a;function o(h){return function(m){return Promise.resolve(m).then(
vendor: 4,331 bytes, line 533
533h,f)}}function l(h,m){r[h]&&(a[h]=function(g){return new Promise(function(v,y){i.push([h,g,v,y])>1||c(h,g)})},m&&(a[h]=m(a[h])))}function c(h,m){try{u(r[h](m))}catch(g){p(i[0][3],g)}}function u(h){h.value instanceof Bg?Promise.resolve(h.value.v).then(d,f):p(i[0][2],h)}function d(h){c("next",h)}function f(h){c("throw",h)}function p(h,m){h(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function oV(e){var t,n;return t={},r("next"),r("throw",function(a){throw a}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(a,i){t[a]=e[a]?function(o){return(n=!n)?{value:Bg(e[a](o)),done:!1}:i?i(o):o}:i}}function lV(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof e2=="function"?e2(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=e[i]&&function(o){return new Promise(function(l,c){o=e[i](o),a(l,c,o.done,o.value)})}}function a(i,o,l,c){Promise.resolve(c).then(function(u){i({value:u,done:l})},o)}}function cV(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Jde=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},NC=function(e){return NC=Object.getOwnPropertyNames||function(t){var n=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[n.length]=r);return n},NC(e)};function uV(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=NC(e),r=0;r<n.length;r++)n[r]!=="default"&&hS(t,e,n[r]);return Jde(t,e),t}function dV(e){return e&&e.__esModule?e:{default:e}}function fV(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function hV(e,t,n,r,a){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?a.call(e,n):a?a.value=n:t.set(e,n),n}function pV(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function mV(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,a;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(a=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");a&&(r=function(){try{a.call(this)}catch(i){return Promise.reject(i)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var Qde=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function gV(e){function t(i){e.error=e.hasError?new Qde(i,e.error,"An error was suppressed during disposal."):i,e.hasError=!0}var n,r=0;function a(){for(;n=e.stack.pop();)try{if(!n.async&&r===1)return r=0,e.stack.push(n),Promise.resolve().then(a);if(n.dispose){var i=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(i).then(a,function(o){return t(o),a()})}else r|=1}catch(o){t(o)}if(r===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return a()}function vV(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,a,i,o){return r?t?".jsx":".js":a&&(!i||!o)?n:a+i+"."+o.toLowerCase()+"js"}):e}const efe={__extends:Yq,__assign:Mo,__rest:bf,__decorate:Kq,__param:Zq,__esDecorate:Xq,__runInitializers:Jq,__propKey:Qq,__setFunctionName:eV,__metadata:tV,__awaiter:Et,__generator:nV,__createBinding:hS,__exportStar:rV,__values:e2,__read:qO,__spread:aV,__spreadArrays:iV,__spreadArray:VO,__await:Bg,__asyncGenerator:sV,__asyncDelegator:oV,__asyncValues:lV,__makeTemplateOb
533ject:cV,__importStar:uV,__importDefault:dV,__classPrivateFieldGet:fV,__classPrivateFieldSet:hV,__classPrivateFieldIn:pV,__addDisposableResource:mV,__disposeResources:gV,__rewriteRelativeImportExtension:vV},tfe=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:mV,get __assign(){return Mo},__asyncDelegator:oV,__asyncGenerator:sV,__asyncValues:lV,__await:Bg,__awaiter:Et,__classPrivateFieldGet:fV,__classPrivateFieldIn:pV,__classPrivateFieldSet:hV,__createBinding:hS,__decorate:Kq,__disposeResources:gV,__esDecorate:Xq,__exportStar:rV,__extends:Yq,__generator:nV,__importDefault:dV,__importStar:uV,__makeTemplateObject:cV,__metadata:tV,__param:Zq,__propKey:Qq,__read:qO,__rest:bf,__rewriteRelativeImportExtension:vV,__runInitializers:Jq,__setFunctionName:eV,__spread:aV,__spreadArray:VO,__spreadArrays:iV,__values:e2,default:efe},Symbol.toStringTag,{value:"Module"})),nfe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);let pS=class extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}},yV=class extends pS{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},AC=class extends pS{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},kC=class extends pS{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}};var t2;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(t2||(t2={}));class rfe{constructor(t,{headers:n={},customFetch:r,region:a=t2.Any}={}){this.url=t,this.headers=n,this.region=a,this.fetch=nfe(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return Et(this,arguments,void 0,function*(n,r={}){var a;let i,o;try{const{headers:l,method:c,body:u,signal:d,timeout:f}=r;let p={},{region:h}=r;h||(h=this.region);const m=new URL(`${this.url}/${n}`);h&&h!=="any"&&(p["x-region"]=h,m.searchParams.set("forceFunctionRegion",h));let g;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(p["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(p["Content-Type"]="application/json",g=JSON.stringify(u)):g=u;let v=d;f&&(o=new AbortController,i=setTimeout(()=>o.abort(),f),d?(v=o.signal,d.addEventListener("abort",()=>o.abort())):v=o.signal);const y=yield this.fetch(m.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),l),body:g,signal:v}).catch(S=>{throw new yV(S)}),b=y.headers.get("x-relay-error");if(b&&b==="true")throw new AC(y);if(!y.ok)throw new kC(y);let w=((a=y.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim(),j;return w==="application/json"?j=yield y.json():w==="application/octet-stream"||w==="application/pdf"?j=yield y.blob():w==="text/event-stream"?j=y:w==="multipart/form-data"?j=yield y.formData():j=yield y.text(),{data:j,error:null,response:y}}catch(l){return{data:null,error:l,response:l instanceof kC||l instanceof AC?l.context:void 0}}finally{i&&clearTimeout(i)}})}}const afe=Object.freeze(Object.defineProperty({__proto__:null,get FunctionRegion(){return t2},FunctionsClient:rfe,FunctionsError:pS,FunctionsFetchError:yV,FunctionsHttpError:kC,FunctionsRelayError:AC},Symbol.toStringTag,{value:"Module"})),xV=gb(afe);var Zi={};const Fv=gb(tfe);var G1={},Y1={},K1={},Z1={},X1={},J1={},hM;function bV(){if(hM)return J1;hM=1,Object.defineProperty(J1,"__esModule",{value:!0});class e extends Error{constructor(n){super(n.message),this.name="PostgrestError",this.details=n.details,this.hint=n.hint,this.co
533de=n.code}}return J1.default=e,J1}var pM;function wV(){if(pM)return X1;pM=1,Object.defineProperty(X1,"__esModule",{value:!0});const t=Fv.__importDefault(bV());let n=class{constructor(a){var i,o;this.shouldThrowOnError=!1,this.method=a.method,this.url=a.url,this.headers=new Headers(a.headers),this.schema=a.schema,this.body=a.body,this.shouldThrowOnError=(i=a.shouldThrowOnError)!==null&&i!==void 0?i:!1,this.signal=a.signal,this.isMaybeSingle=(o=a.isMaybeSingle)!==null&&o!==void 0?o:!1,a.fetch?this.fetch=a.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(a,i){return this.headers=new Headers(this.headers),this.headers.set(a,i),this}then(a,i){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 o=this.fetch;let l=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async c=>{var u,d,f,p;let h=null,m=null,g=null,v=c.status,y=c.statusText;if(c.ok){if(this.method!=="HEAD"){const S=await c.text();S===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((u=this.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?m=S:m=JSON.parse(S))}const w=(d=this.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),j=(f=c.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");w&&j&&j.length>1&&(g=parseInt(j[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(m)&&(m.length>1?(h={code:"PGRST116",details:`Results contain ${m.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},m=null,g=null,v=406,y="Not Acceptable"):m.length===1?m=m[0]:m=null)}else{const w=await c.text();try{h=JSON.parse(w),Array.isArray(h)&&c.status===404&&(m=[],h=null,v=200,y="OK")}catch{c.status===404&&w===""?(v=204,y="No Content"):h={message:w}}if(h&&this.isMaybeSingle&&(!((p=h==null?void 0:h.details)===null||p===void 0)&&p.includes("0 rows"))&&(h=null,v=200,y="OK"),h&&this.shouldThrowOnError)throw new t.default(h)}return{error:h,data:m,count:g,status:v,statusText:y}});return this.shouldThrowOnError||(l=l.catch(c=>{var u,d,f,p,h,m;let g="";const v=c==null?void 0:c.cause;if(v){const y=(u=v==null?void 0:v.message)!==null&&u!==void 0?u:"",b=(d=v==null?void 0:v.code)!==null&&d!==void 0?d:"";g=`${(f=c==null?void 0:c.name)!==null&&f!==void 0?f:"FetchError"}: ${c==null?void 0:c.message}`,g+=`
534
535Caused by: ${(p=v==null?void 0:v.name)!==null&&p!==void 0?p:"Error"}: ${y}`,b&&(g+=` (${b})`),v!=null&&v.stack&&(g+=`
536${v.stack}`)}else g=(h=c==null?void 0:c.stack)!==null&&h!==void 0?h:"";return{error:{message:`${(m=c==null?void 0:c.name)!==null&&m!==void 0?m:"FetchError"}: ${c==null?void 0:c.message}`,details:g,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),l.then(a,i)}returns(){return this}overrideTypes(){return this}};return X1.default=n,X1}var mM;function _V(){if(mM)return Z1;mM=1,Object.defineProperty(Z1,"__esModule",{value:!0});const t=Fv.__importDefault(wV());let n=class extends t.default{select(a){let i=!1;const o=(a??"*").split("").map(l=>/\s/.test(l)&&!i?"":(l==='"'&&(i=!i),l)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(a,{ascending:i=!0,nullsFirst:o,foreignTable:l,referencedTable:c=l}={}){const u=c?`${c}.order`:"order",d=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${d?`${d},`:""}${a}.${i?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(a,{foreignTable:i,referencedTable:o=i}={}){const l=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${a}`),this}range(a,i,{foreignTable:o,referencedTable:l=o}={}){const c=typeof l>"u"?"offset":`${l}.offset`,u=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(c,`${a}`),this.url.searchParams.set(u,`${i-a+1}`),this}abortSignal(a){return this.signal=a,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}
536explain({analyze:a=!1,verbose:i=!1,settings:o=!1,buffers:l=!1,wal:c=!1,format:u="text"}={}){var d;const f=[a?"analyze":null,i?"verbose":null,o?"settings":null,l?"buffers":null,c?"wal":null].filter(Boolean).join("|"),p=(d=this.headers.get("Accept"))!==null&&d!==void 0?d:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${p}"; options=${f};`),u==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(a){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${a}`),this}};return Z1.default=n,Z1}var gM;function HO(){if(gM)return K1;gM=1,Object.defineProperty(K1,"__esModule",{value:!0});const t=Fv.__importDefault(_V()),n=new RegExp("[,()]");let r=class extends t.default{eq(i,o){return this.url.searchParams.append(i,`eq.${o}`),this}neq(i,o){return this.url.searchParams.append(i,`neq.${o}`),this}gt(i,o){return this.url.searchParams.append(i,`gt.${o}`),this}gte(i,o){return this.url.searchParams.append(i,`gte.${o}`),this}lt(i,o){return this.url.searchParams.append(i,`lt.${o}`),this}lte(i,o){return this.url.searchParams.append(i,`lte.${o}`),this}like(i,o){return this.url.searchParams.append(i,`like.${o}`),this}likeAllOf(i,o){return this.url.searchParams.append(i,`like(all).{${o.join(",")}}`),this}likeAnyOf(i,o){return this.url.searchParams.append(i,`like(any).{${o.join(",")}}`),this}ilike(i,o){return this.url.searchParams.append(i,`ilike.${o}`),this}ilikeAllOf(i,o){return this.url.searchParams.append(i,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(i,o){return this.url.searchParams.append(i,`ilike(any).{${o.join(",")}}`),this}regexMatch(i,o){return this.url.searchParams.append(i,`match.${o}`),this}regexIMatch(i,o){return this.url.searchParams.append(i,`imatch.${o}`),this}is(i,o){return this.url.searchParams.append(i,`is.${o}`),this}isDistinct(i,o){return this.url.searchParams.append(i,`isdistinct.${o}`),this}in(i,o){const l=Array.from(new Set(o)).map(c=>typeof c=="string"&&n.test(c)?`"${c}"`:`${c}`).join(",");return this.url.searchParams.append(i,`in.(${l})`),this}contains(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cs.{${o.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(o)}`),this}containedBy(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cd.{${o.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(o)}`),this}rangeGt(i,o){return this.url.searchParams.append(i,`sr.${o}`),this}rangeGte(i,o){return this.url.searchParams.append(i,`nxl.${o}`),this}rangeLt(i,o){return this.url.searchParams.append(i,`sl.${o}`),this}rangeLte(i,o){return this.url.searchParams.append(i,`nxr.${o}`),this}rangeAdjacent(i,o){return this.url.searchParams.append(i,`adj.${o}`),this}overlaps(i,o){return typeof o=="string"?this.url.searchParams.append(i,`ov.${o}`):this.url.searchParams.append(i,`ov.{${o.join(",")}}`),this}textSearch(i,o,{config:l,type:c}={}){let u="";c==="plain"?u="pl":c==="phrase"?u="ph":c==="websearch"&&(u="w");const d=l===void 0?"":`(${l})`;return this.url.searchParams.append(i,`${u}fts${d}.${o}`),this}match(i){return Object.entries(i).forEach(([o,l])=>{this.url.searchParams.append(o,`eq.${l}`)}),this}not(i,o,l){return this.url.searchParams.append(i,`not.${o}.${l}`),this}or(i,{foreignTable:o,referencedTable:l=o}={}){const c=l?`${l}.or`:"or";return this.url.searchParams.append(c,`(${i})`),this}filter(i,o,l){return this.url.searchParams.append(i,`${o}.${l}`),this}};return K1.default=r,K1}var vM;function jV(){if(vM)return Y1;vM=1,Object.defineProperty(Y1,"__esModule",{value:!0});const t=Fv.__importDefault(HO());let n=class{constructor(a,{headers:i={},schema:o,fetch:l}){this.url=a,this.headers=new Headers(i),this.schema=o,this.fetch=l}select(a,i){const{head:o=!1,count:l}=i??{},c=o?"HEAD":"GET";let u=!1;const d=(a??"*").split("").map(f=>/\s/.test(f)&&!u?"":(f==='"'&&(u=!u),f)).join("");return this.url.searchParams.set("select",d),l&&this.headers.append("Prefer",`count=${l}`),new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(a,{count:i,defaultToNull:o=!0}={}){var l;const c="POST";if(i&&this.headers.append("Prefer",`count=${i}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(a)){const u=a.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);this.url.searchParams.set("columns",d.join(","))}}return new t.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}upsert(a,{onConflict:i,ignoreDuplicates:o=!1,count:l,defaultToNull:c=!0}={}){var u;const d="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),i!==void 0&&this.url.searchParams.set("on_conflict",i),l&&this.headers.append("Prefer",`count=${l}`),c||this.headers.append("Prefer","missing=default"),Array.isArray(a)){const f=a.reduce((p,h)=>p.concat(Object.keys(h)),[]);if(f.length>0){const p=[...new Set(f)].map(h=>`"${h}"`);this.url.searchParams.set("columns",p.join(","))}}return new t.default({method:d,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}update(a,{count:i}={}){var o;const l="PATCH";return i&&this.headers.append("Prefer",`count=${i}`),new t.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:a}={}){var i;const o="DELETE";return a&&this.headers.append("Prefer",`count=${a}`),new t.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}};return Y1.default=n,Y1}var yM;function ife(){if(yM)return G1;yM=1,Object.defineProperty(G1,"__esModule",{value:!0});const e=Fv,t=e.__importDefault(jV()),n=e.__importDefault(HO());let r=class SV{constructor(i,{headers:o={},schema:l,fetch:c}={}){this.url=i,this.headers=new Headers(o),this.schemaName=l,this.fetch=c}
536from(i){if(!i||typeof i!="string"||i.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");const o=new URL(`${this.url}/${i}`);return new t.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(i){return new SV(this.url,{headers:this.headers,schema:i,fetch:this.fetch})}rpc(i,o={},{head:l=!1,get:c=!1,count:u}={}){var d;let f;const p=new URL(`${this.url}/rpc/${i}`);let h;l||c?(f=l?"HEAD":"GET",Object.entries(o).filter(([g,v])=>v!==void 0).map(([g,v])=>[g,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([g,v])=>{p.searchParams.append(g,v)})):(f="POST",h=o);const m=new Headers(this.headers);return u&&m.set("Prefer",`count=${u}`),new n.default({method:f,url:p,headers:m,schema:this.schemaName,body:h,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch})}};return G1.default=r,G1}Object.defineProperty(Zi,"__esModule",{value:!0});Zi.PostgrestError=Zi.PostgrestBuilder=Zi.PostgrestTransformBuilder=Zi.PostgrestFilterBuilder=Zi.PostgrestQueryBuilder=Zi.PostgrestClient=void 0;const Bv=Fv,NV=Bv.__importDefault(ife());Zi.PostgrestClient=NV.default;const AV=Bv.__importDefault(jV());Zi.PostgrestQueryBuilder=AV.default;const kV=Bv.__importDefault(HO());Zi.PostgrestFilterBuilder=kV.default;const EV=Bv.__importDefault(_V());Zi.PostgrestTransformBuilder=EV.default;const CV=Bv.__importDefault(wV());Zi.PostgrestBuilder=CV.default;const PV=Bv.__importDefault(bV());Zi.PostgrestError=PV.default;Zi.default={PostgrestClient:NV.default,PostgrestQueryBuilder:AV.default,PostgrestFilterBuilder:kV.default,PostgrestTransformBuilder:EV.default,PostgrestBuilder:CV.default,PostgrestError:PV.default};class TV{constructor(){}static detectEnvironment(){var t;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"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.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,a=parseInt(r.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
537import ws from "ws"
538new 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 t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
539
540Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const r=this.getWebSocketConstructor();return new r(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const sfe="2.86.2",ofe=`realtime-js/${sfe}`,OV="1.0.0",lfe="2.0.0",xM=OV,EC=1e4,cfe=1e3,ufe=100;var uh;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(uh||(uh={}));var Wa;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Wa||(Wa={}));var bl;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(bl||(bl={}));var CC;(function(e){e.websocket="websocket"})(CC||(CC={}));var dh;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(dh||(dh={}));class dfe{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const a=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,a)}_encodeJsonUserBroadcastPush(t){var n,r;const a=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(a)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,r){var a,i;const o=t.topic,l=(a=t.ref)!==null&&a!==void 0?a:"",c=(i=t.join_ref)!==null&&i!==void 0?i:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const p=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+u.length+f.length,h=new ArrayBuffer(this.HEADER_LENGTH+p);
540let m=new DataView(h),g=0;m.setUint8(g++,this.KINDS.userBroadcastPush),m.setUint8(g++,c.length),m.setUint8(g++,l.length),m.setUint8(g++,o.length),m.setUint8(g++,u.length),m.setUint8(g++,f.length),m.setUint8(g++,n),Array.from(c,y=>m.setUint8(g++,y.charCodeAt(0))),Array.from(l,y=>m.setUint8(g++,y.charCodeAt(0))),Array.from(o,y=>m.setUint8(g++,y.charCodeAt(0))),Array.from(u,y=>m.setUint8(g++,y.charCodeAt(0))),Array.from(f,y=>m.setUint8(g++,y.charCodeAt(0)));var v=new Uint8Array(h.byteLength+r.byteLength);return v.set(new Uint8Array(h),0),v.set(new Uint8Array(r),h.byteLength),v.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[a,i,o,l,c]=r;return n({join_ref:a,ref:i,topic:o,event:l,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),a=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,a)}}_decodeUserBroadcast(t,n,r){const a=n.getUint8(1),i=n.getUint8(2),o=n.getUint8(3),l=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(t.slice(c,c+a));c=c+a;const d=r.decode(t.slice(c,c+i));c=c+i;const f=r.decode(t.slice(c,c+o));c=c+o;const p=t.slice(c,t.byteLength),h=l===this.JSON_ENCODING?JSON.parse(r.decode(p)):p,m={type:this.BROADCAST_EVENT,event:d,payload:h};return o>0&&(m.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:m}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}class RV{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,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 Mr;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Mr||(Mr={}));const bM=(e,t,n={})=>{var r;const a=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=ffe(o,e,t,a),i),{}):{}},ffe=(e,t,n,r)=>{const a=t.find(l=>
540l.name===e),i=a==null?void 0:a.type,o=n[e];return i&&!r.includes(i)?IV(i,o):PC(o)},IV=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return gfe(t,n)}switch(e){case Mr.bool:return hfe(t);case Mr.float4:case Mr.float8:case Mr.int2:case Mr.int4:case Mr.int8:case Mr.numeric:case Mr.oid:return pfe(t);case Mr.json:case Mr.jsonb:return mfe(t);case Mr.timestamp:return vfe(t);case Mr.abstime:case Mr.date:case Mr.daterange:case Mr.int4range:case Mr.int8range:case Mr.money:case Mr.reltime:case Mr.text:case Mr.time:case Mr.timestamptz:case Mr.timetz:case Mr.tsrange:case Mr.tstzrange:return PC(t);default:return PC(t)}},PC=e=>e,hfe=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},pfe=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},mfe=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},gfe=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let i;const o=e.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>IV(t,l))}return e},vfe=e=>typeof e=="string"?e.replace(" ","T"):e,LV=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class gA{constructor(t,n,r={},a=EC){this.channel=t,this.event=n,this.payload=r,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,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(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,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:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var TC;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(TC||(TC={}));let MV=class Qw{constructor(t,n){this.channel=t,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,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Qw.syncState(this.state,a,i,o),this.pendingDiffs.forEach(c=>{this.state=Qw.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel._on(r.diff,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=Qw.syncDiff(this.state,a,i,o),l())}),this.onJoin((a,i,o)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:i,newPresences:o})}),this.onLeave((a,i,o)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,a){const i=this.cloneDeep(t),o=this.transformState(n),l={},c={};return this.map(i,(u,d)=>{o[u]||(c[u]=d)}),this.map(o,(u,d)=>{const f=i[u];if(f){const p=d.map(v=>v.presence_ref),h=f.map(v=>v.presence_ref),m=d.filter(v=>h.indexOf(v.presence_ref)<0),g=f.filter(v=>p.indexOf(v.presence_ref)<0);m.length>0&&(l[u]=m),g.length>0&&(c[u]=g)}else l[u]=d}),this.syncDiff(i,{joins:l,leaves:c},r,a)}static syncDiff(t,n,r,a){const{joins:i,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),a||(a=()=>{}),this.map(i,(l,c)=>{var u;
540const d=(u=t[l])!==null&&u!==void 0?u:[];if(t[l]=this.cloneDeep(c),d.length>0){const f=t[l].map(h=>h.presence_ref),p=d.filter(h=>f.indexOf(h.presence_ref)<0);t[l].unshift(...p)}r(l,d,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;const d=c.map(f=>f.presence_ref);u=u.filter(f=>d.indexOf(f.presence_ref)<0),t[l]=u,a(l,u,c),u.length===0&&delete t[l]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const a=t[r];return"metas"in a?n[r]=a.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[r]=a,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var OC;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(OC||(OC={}));var eg;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(eg||(eg={}));var Zl;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Zl||(Zl={}));const yfe=Wa;let $V=class DV{constructor(t,n={config:{}},r){var a,i;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=Wa.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.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 gA(this,bl.join,this.params,this.timeout),this.rejoinTimer=new RV(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Wa.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Wa.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Wa.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Wa.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Wa.errored,this.rejoinTimer.scheduleTimeout())}),this._on(bl.reply,{},(o,l)=>{this._trigger(this._replyEventName(l),o)}),this.presence=new MV(this),this.broadcastEndpointURL=LV(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,a,i;if(this.socket.isConnected()||this.socket.connect(),this.state==Wa.closed){const{config:{broadcast:o,presence:l,private:c}}=this.params,u=(a=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(h=>h.filter))!==null&&a!==void 0?a:[],d=!!this.bindings[eg.PRESENCE]&&this.bindings[eg.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},p={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(h=>t==null?void 0:t(Zl.CHANNEL_ERROR,h)),this._onClose(()=>t==null?void 0:t(Zl.CLOSED)),this.updateJoinPayload(Object.assign({config:p},f)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:h})=>{var m;if(this.socket.setAuth(),h===void 0){t==null||t(Zl.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,v=(m=g==null?void 0:g.length)!==null&&m!==void 0?m:0,y=[];for(let b=0;b<v;b++){const w=g[b],{filter:{event:j,schema:S,table:A,filter:E}}=w,k=h&&h[b];if(k&&k.event===j&&k.schema===S&&k.table===A&&k.filter===E)y.push(Object.assign(Object.assign({},w),{id:k.id}));else{this.unsubscribe(),this.state=Wa.errored,t==null||t(Zl.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=y,t&&t(Zl.SUBSCRIBED);return}}).receive("error",h=>{this.state=Wa.errored,t==null||t(Zl.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Zl.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this.state===Wa.joined&&t===eg.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(t,n,r)}async httpSend(t,n,r={}){var a;const i=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(n==null)return Promise.reject("Payload is required for httpSend()");const o={method:"POST",headers:{Authorization:i,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(a=r.timeout)!==null&&a!==void 0?a:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;
540try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,n={}){var r,a;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=t,c={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:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((a=u.body)===null||a===void 0?void 0:a.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const u=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Wa.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(bl.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(a=>{r=new gA(this,bl.leave,{},t),r.receive("ok",()=>{n(),a("ok")}).receive("timeout",()=>{n(),a("timed out")}).receive("error",()=>{a("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Wa.closed,this.bindings={}}async _fetchWithTimeout(t,n,r){const a=new AbortController,i=setTimeout(()=>a.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:a.signal}));return clearTimeout(i),o}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new gA(this,t,n,r);return this._canPush()?a.send():this._addToPushBuffer(a),a}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>ufe){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var a,i;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:u,join:d}=bl;if(r&&[l,c,u,d].indexOf(o)>=0&&r!==this._joinRef())return;let p=this._onMessage(o,n,r);if(n&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(h=>{var m,g,v;return((m=h.filter)===null||m===void 0?void 0:m.event)==="*"||((v=(g=h.filter)===null||g===void 0?void 0:g.event)===null||v===void 0?void 0:v.toLocaleLowerCase())===o}).map(h=>h.callback(p,r)):(i=this.bindings[o])===null||i===void 0||i.filter(h=>{var m,g,v,y,b,w;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in h){const j=h.id,S=(m=h.filter)===null||m===void 0?void 0:m.event;return j&&((g=n.ids)===null||g===void 0?void 0:g.includes(j))&&(S==="*"||(S==null?void 0:S.toLocaleLowerCase())===((v=n.data)===null||v===void 0?void 0:v.type.toLocaleLowerCase()))}else{const j=(b=(y=h==null?void 0:h.filter)===null||y===void 0?void 0:y.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return j==="*"||j===((w=n==null?void 0:n.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===o}).map(h=>{if(typeof p=="object"&&"ids"in p){const m=p.data,{schema:g,table:v,commit_timestamp:y,type:b,errors:w}=m;p=Object.assign(Object.assign({},{schema:g,table:v,commit_timestamp:y,eventType:b,new:{},old:{},errors:w}),this._getPayloadRecords(m))}h.callback(p,r)})}_isClosed(){return this.state===Wa.closed}_isJoined(){return this.state===Wa.joined}_isJoining(){return this.state===Wa.joining}_isLeaving(){return this.state===Wa.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const a=t.toLocaleLowerCase(),i={type:a,filter:n,callback:r};return this.bindings[a]?this.bindings[a].push(i):this.bindings[a]=[i],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(a=>{var i;return!(((i=a.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&DV.isEqual(a.filter,n))})),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(bl.close,{},t)}_onError(t){this._on(bl.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Wa.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=bM(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=bM(t.columns,t.old_record)),n}};const vA=()=>{},Q1={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},xfe=[1e3,2e3,5e3,1e4],bfe=1e4,wfe=`
541  addEventListener("message", (e) => {
542    if (e.data.event === "start") {
543      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
544    }
545  });`;let _fe=class{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=EC,this.transport=null,this.heartbeatIntervalMs=Q1.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=vA,this.ref=0,this.reconnectTimer=null,this.vsn=xM,this.logger=vA,this.conn=null,this.sendBuffer=[],this.serializer
545=new dfe,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=a=>a?(...i)=>a(...i):(...i)=>fetch(...i),!(!((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=`${t}/${CC.websocket}`,this.httpEndpoint=LV(t),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.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=TV.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n}
546
547To use Realtime in Node.js, you need to provide a WebSocket implementation:
548
549Option 1: Use Node.js 22+ which has native WebSocket support
550Option 2: Install and provide the "ws" package:
551
552  npm install ws
553
554  import ws from "ws"
555  const client = new RealtimeClient(url, {
556    ...options,
557    transport: ws
558  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,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")},typeof this.conn.close=="function"&&(t?this.conn.close(t,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case uh.connecting:return dh.Connecting;case uh.open:return dh.Open;case uh.closing:return dh.Closing;default:return dh.Closed}}isConnected(){return this.connectionState()===dh.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,n={config:{}}){const r=`realtime:${t}`,a=this.getChannels().find(i=>i.topic===r);if(a)return a;{const i=new $V(`realtime:${t}`,n,this);return this.channels.push(i),i}}push(t){const{topic:n,event:r,payload:a,ref:i}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${n} ${r} (${i})`,a),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var t;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,(t=this.conn)===null||t===void 0||t.close(cfe,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},Q1.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(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,n=>
558{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:a,payload:i,ref:o}=n,l=o?`(${o})`:"",c=i.status||"";this.log("receive",`${c} ${r} ${a} ${l}`.trim(),i),this.channels.filter(u=>u._isMember(r)).forEach(u=>u._trigger(a,i,o)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="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=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_teardownConnection(){if(this.conn){if(this.conn.readyState===uh.open||this.conn.readyState===uh.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),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 t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),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(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(bl.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",a=new URLSearchParams(n);return`${t}${r}${a}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([wfe],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n;t?n=t:this.accessToken?n=await this.accessToken():n=this.accessTokenValue,this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const a={access_token:n,version:ofe};n&&r.updateJoinPayload(a),r.joinedOnce&&r._isJoined()&&r._push(bl.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this.setAuth().catch(n=>{this.log("error",`error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(r=>{try{r(n)}catch(a){this.log("error",`error in ${t} callback`,a)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new RV(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Q1.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,a,i,o,l,c,u,d,f,p,h;switch(this.transport=(n=t==null?void 0:t.transport)!==null&&n!==void 0?n:null,this.timeout=(r=t==null?void 0:t.t
558imeout)!==null&&r!==void 0?r:EC,this.heartbeatIntervalMs=(a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:Q1.HEARTBEAT_INTERVAL,this.worker=(i=t==null?void 0:t.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:vA,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:xM,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:m=>xfe[m-1]||bfe,this.vsn){case OV:this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(m,g)=>g(JSON.stringify(m)),this.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:(m,g)=>g(JSON.parse(m));break;case lfe:this.encode=(p=t==null?void 0:t.encode)!==null&&p!==void 0?p:this.serializer.encode.bind(this.serializer),this.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}};const jfe=Object.freeze(Object.defineProperty({__proto__:null,REALTIME_CHANNEL_STATES:yfe,get REALTIME_LISTEN_TYPES(){return eg},get REALTIME_POSTGRES_CHANGES_LISTEN_EVENT(){return OC},get REALTIME_PRESENCE_LISTEN_EVENTS(){return TC},get REALTIME_SUBSCRIBE_STATES(){return Zl},RealtimeChannel:$V,RealtimeClient:_fe,RealtimePresence:MV,WebSocketFactory:TV},Symbol.toStringTag,{value:"Module"})),FV=gb(jfe);class kb extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function ta(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class BV extends kb{constructor(t,n,r){super(t),this.name="StorageApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class n2 extends kb{constructor(t,n){super(t),this.name="StorageUnknownError",this.originalError=n}}const GO=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Sfe=()=>Response,RC=e=>{if(Array.isArray(e))return e.map(n=>RC(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const a=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=RC(r)}),t},Nfe=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Afe=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),yA=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},kfe=(e,t,n)=>Et(void 0,void 0,void 0,function*(){const r=yield Sfe();e instanceof r&&!(n!=null&&n.noResolveJson)?e.json().then(a=>{const i=e.status||500,o=(a==null?void 0:a.statusCode)||i+"";t(new BV(yA(a),i,o))}).catch(a=>{t(new n2(yA(a),a))}):t(new n2(yA(e),e))}),Efe=(e,t,n,r)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!r?a:(Nfe(r)?(a.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(r)):a.body=r,t!=null&&t.duplex&&(a.duplex=t.duplex),Object.assign(Object.assign({},a),n))};function Eb(e,t,n,r,a,i){return Et(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(n,Efe(t,r,a,i)).then(c=>{if(!c.ok)throw c;return r!=null&&r.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>kfe(c,l,r))})})}function dx(e,t,n,r){return Et(this,void 0,void 0,function*(){return Eb(e,"GET",t,n,r)})}function ml(e,t,n,r,a){return Et(this,void 0,void 0,function*(){return Eb(e,"POST",t,r,a,n)})}function IC(e,t,n,r,a){return Et(this,void 0,void 0,function*(){return Eb(e,"PUT",t,r,a,n)})}function Cfe(e,t,n,r){return Et(this,void 0,void 0,function*(){return Eb(e,"HEAD",t,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function YO(e,t,n,r,a){return Et(this,void 0,void 0,function*(){return Eb(e,"DELETE",t,r,a,n)})}class Pfe{constructor(t,n){this.downloadFn=t,this.shouldThrowOnError=n}then(t,n){return this.execute().then(t,n)}execute(){return Et(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(ta(t))return{data:null,error:t};throw t}})}}var UV;class Tfe{constructor(t,n){this.downloadFn=t,this.shouldThrowOnError=n,this[UV]="BlobDownloadBuilder",this.promise=null}asStream(){return new Pfe(this.downloadFn,this.shouldThrowOnError)}then(t,n){return this.getPromise().then(t,n)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return Et(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(ta(t))return{data:null,error:t};throw t}})}}UV=Symbol.toStringTag;const Ofe={limit:100,offset:0,sortBy:{column:"name",order:"asc"}}
558,wM={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Rfe{constructor(t,n={},r,a){this.shouldThrowOnError=!1,this.url=t,this.headers=n,this.bucketId=r,this.fetch=GO(a)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(t,n,r,a){return Et(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},wM),a);let l=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",this.encodeMetadata(c))):(i=r,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),a!=null&&a.headers&&(l=Object.assign(Object.assign({},l),a.headers));const u=this._removeEmptyFolders(n),d=this._getFinalPath(u),f=yield(t=="PUT"?IC:ml)(this.fetch,`${this.url}/object/${d}`,i,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:u,id:f.Id,fullPath:f.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(ta(i))return{data:null,error:i};throw i}})}upload(t,n,r){return Et(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,n,r)})}uploadToSignedUrl(t,n,r,a){return Et(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(t),o=this._getFinalPath(i),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",n);try{let c;const u=Object.assign({upsert:wM.upsert},a),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",u.cacheControl)):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);const f=yield IC(this.fetch,l.toString(),c,{headers:d});return{data:{path:i,fullPath:f.Key},error:null}}catch(c){if(this.shouldThrowOnError)throw c;if(ta(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,n){return Et(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t);const a=Object.assign({},this.headers);n!=null&&n.upsert&&(a["x-upsert"]="true");const i=yield ml(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:a}),o=new URL(this.url+i.url),l=o.searchParams.get("token");if(!l)throw new kb("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:l},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ta(r))return{data:null,error:r};throw r}})}update(t,n,r){return Et(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,n,r)})}move(t,n,r){return Et(this,void 0,void 0,function*(){try{return{data:yield ml(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ta(a))return{data:null,error:a};throw a}})}copy(t,n,r){return Et(this,void 0,void 0,function*(){try{return{data:{path:(yield ml(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ta(a))return{data:null,error:a};throw a}})}createSignedUrl(t,n,r){return Et(this,void 0,void 0,function*(){try{let a=this._getFinalPath(t),i=yield ml(this.fetch,`${this.url}/object/sign/${a}`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ta(a))return{data:null,error:a};throw a}})}createSignedUrls(t,n,r){return Et(this,void 0,void 0,function*(){try{const a=yield ml(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:t},{headers:this.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:a.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ta(a))return{data:null,error:a};throw a}})}download(t,n){const a=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),o=i?`?${i}`:"",l=this._getFinalPath(t),c=()=>dx(this.fetch,`${this.url}/${a}/${l}${o}
558`,{headers:this.headers,noResolveJson:!0});return new Tfe(c,this.shouldThrowOnError)}info(t){return Et(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{const r=yield dx(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:RC(r),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ta(r))return{data:null,error:r};throw r}})}exists(t){return Et(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{return yield Cfe(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ta(r)&&r instanceof n2){const a=r.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,n){const r=this._getFinalPath(t),a=[],i=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";i!==""&&a.push(i);const l=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});c!==""&&a.push(c);let u=a.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${r}${u}`)}}}remove(t){return Et(this,void 0,void 0,function*(){try{return{data:yield YO(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ta(n))return{data:null,error:n};throw n}})}list(t,n,r){return Et(this,void 0,void 0,function*(){try{const a=Object.assign(Object.assign(Object.assign({},Ofe),n),{prefix:t||""});return{data:yield ml(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},r),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ta(a))return{data:null,error:a};throw a}})}listV2(t,n){return Et(this,void 0,void 0,function*(){try{const r=Object.assign({},t);return{data:yield ml(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,r,{headers:this.headers},n),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ta(r))return{data:null,error:r};throw r}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const n=[];return t.width&&n.push(`width=${t.width}`),t.height&&n.push(`height=${t.height}`),t.resize&&n.push(`resize=${t.resize}`),t.format&&n.push(`format=${t.format}`),t.quality&&n.push(`quality=${t.quality}`),n.join("&")}}const zV="2.86.2",WV={"X-Client-Info":`storage-js/${zV}`};class Ife{constructor(t,n={},r,a){this.shouldThrowOnError=!1;const i=new URL(t);a!=null&&a.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({},WV),n),this.fetch=GO(r)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(t){return Et(this,void 0,void 0,function*(){try{const n=this.listBucketOptionsToQueryString(t);return{data:yield dx(this.fetch,`${this.url}/bucket${n}`,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ta(n))return{data:null,error:n};throw n}})}getBucket(t){return Et(this,void 0,void 0,function*(){try{return{data:yield dx(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ta(n))return{data:null,error:n};throw n}})}createBucket(t){return Et(this,arguments,void 0,function*(n,r={public:!1}){try{return{data:yield ml(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(a){if(this.shouldThrowOnError)throw a;if(ta(a))return{data:null,error:a};throw a}})}updateBucket(t,n){return Et(this,void 0,void 0,function*(){try{return{data:yield IC(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,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(ta(r))return{data:null,error:r};throw r}})}emptyBucket(t){return Et(this,void 0,void 0,function*(){try{return{data:yield ml(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ta(n))return{data:null,error:n};throw n}})}deleteBucket(t){return Et(this,void 0,void 0,function*(){try{return{data:yield YO(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ta(n))return{data:null,error:n};throw n}})}listBucketOptionsToQueryString(t){const n={};return t&&("limit"in t&&(n.limit=String(t.limit)),"offset"in t&&(n.offset=String(t.offset)),t.search&&(n.search=t.search),t.sortColumn&&(n.sortColumn=t.sortColumn),t.sortOrder&&(n.sortOrder=t.sortOrder)),Object.keys(n).length>0?"?"+new URLSearchParams(n).toString():""}}
558var fx=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Lfe(e,t,n){const r=new URL(t,e);if(n)for(const[a,i]of Object.entries(n))i!==void 0&&r.searchParams.set(a,i);return r.toString()}async function Mfe(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function $fe(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:a,body:i,headers:o}){const l=Lfe(e.baseUrl,r,a),c=await Mfe(e.auth),u=await t(l,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),p=f&&d?JSON.parse(d):d;if(!u.ok){const h=f?p:void 0,m=h==null?void 0:h.error;throw new fx((m==null?void 0:m.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:m==null?void 0:m.type,icebergCode:m==null?void 0:m.code,details:h})}return{status:u.status,headers:u.headers,data:p}}}}function ew(e){return e.join("�")}var Dfe=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:ew(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ew(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ew(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ew(e.namespace)}`}),!0}catch(t){if(t instanceof fx&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof fx&&n.status===409)return;throw n}}};function Jp(e){return e.join("�")}var Ffe=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Jp(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Jp(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Jp(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Jp(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Jp(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Jp(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof fx&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof fx&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},Bfe=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=$fe({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new Dfe(this.client,t),this.tableOps=new Ffe(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
558async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};class qV{constructor(t,n={},r){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},WV),n),this.fetch=GO(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(t){return Et(this,void 0,void 0,function*(){try{return{data:yield ml(this.fetch,`${this.url}/bucket`,{name:t},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ta(n))return{data:null,error:n};throw n}})}listBuckets(t){return Et(this,void 0,void 0,function*(){try{const n=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&n.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&n.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&n.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&n.set("sortOrder",t.sortOrder),t!=null&&t.search&&n.set("search",t.search);const r=n.toString(),a=r?`${this.url}/bucket?${r}`:`${this.url}/bucket`;return{data:yield dx(this.fetch,a,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ta(n))return{data:null,error:n};throw n}})}deleteBucket(t){return Et(this,void 0,void 0,function*(){try{return{data:yield YO(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ta(n))return{data:null,error:n};throw n}})}from(t){if(!Afe(t))throw new kb("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");return new Bfe({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:()=>Et(this,void 0,void 0,function*(){return this.headers})},fetch:this.fetch})}}const KO={"X-Client-Info":`storage-js/${zV}`,"Content-Type":"application/json"};class ZO extends Error{constructor(t){super(t),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function Cs(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}class e_ extends ZO{constructor(t,n,r){super(t),this.name="StorageVectorsApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class VV extends ZO{constructor(t,n){super(t),this.name="StorageVectorsUnknownError",this.originalError=n}}var LC;(function(e){e.InternalError="InternalError",e.S3VectorConflictException="S3VectorConflictException",e.S3VectorNotFoundException="S3VectorNotFoundException",e.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",e.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",e.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(LC||(LC={}));const mS=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Ufe=()=>Response,HV=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},zfe=e=>Array.from(new Float32Array(e)),Wfe=(e,t)=>{if(t!==void 0&&e.float32.length!==t)throw new Error(`Vector dimension mismatch: expected ${t}, got ${e.float32.length}`)},_M=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),qfe=(e,t,n)=>Et(void 0,void 0,void 0,function*(){if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(n!=null&&n.noResolveJson)){const a=e.status||500,i=e;if(typeof i.json=="function")i.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";t(new e_(_M(o),a,l))}).catch(()=>{const o=a+"",l=i.statusText||`HTTP ${a} error`;t(new e_(l,a,o))});else{const o=a+"",l=i.statusText||`HTTP ${a} error`;t(new e_(l,a,o))}}else t(new VV(_M(e),e))}),Vfe=(e,t,n,r)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return r?(HV(r)?(a.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(r)):a.body=r,Object.assign(Object.assign({},a),n)):a};function Hfe(e,t,n,r,a,i){return Et(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(n,Vfe(t,r,a,i)).then(c=>{if(!c.ok)throw c;if(r!=null&&r.noResolveJson)return c;const u=c.headers.get("content-type");return!u||!u.includes("application/json")?{}:c.json()}).then(c=>o(c)).catch(c=>
558qfe(c,l,r))})})}function ao(e,t,n,r,a){return Et(this,void 0,void 0,function*(){return Hfe(e,"POST",t,r,a,n)})}class GV{constructor(t,n={},r){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},KO),n),this.fetch=mS(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(t){return Et(this,void 0,void 0,function*(){try{return{data:(yield ao(this.fetch,`${this.url}/CreateIndex`,t,{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}getIndex(t,n){return Et(this,void 0,void 0,function*(){try{return{data:yield ao(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:t,indexName:n},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Cs(r))return{data:null,error:r};throw r}})}listIndexes(t){return Et(this,void 0,void 0,function*(){try{return{data:yield ao(this.fetch,`${this.url}/ListIndexes`,t,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}deleteIndex(t,n){return Et(this,void 0,void 0,function*(){try{return{data:(yield ao(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:t,indexName:n},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Cs(r))return{data:null,error:r};throw r}})}}class YV{constructor(t,n={},r){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},KO),n),this.fetch=mS(r)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(t){return Et(this,void 0,void 0,function*(){try{if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield ao(this.fetch,`${this.url}/PutVectors`,t,{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}getVectors(t){return Et(this,void 0,void 0,function*(){try{return{data:yield ao(this.fetch,`${this.url}/GetVectors`,t,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}listVectors(t){return Et(this,void 0,void 0,function*(){try{if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return{data:yield ao(this.fetch,`${this.url}/ListVectors`,t,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}queryVectors(t){return Et(this,void 0,void 0,function*(){try{return{data:yield ao(this.fetch,`${this.url}/QueryVectors`,t,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}deleteVectors(t){return Et(this,void 0,void 0,function*(){try{if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield ao(this.fetch,`${this.url}/DeleteVectors`,t,{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}}class KV{constructor(t,n={},r){this.shouldThrowOnError=!1,this.url=t.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},KO),n),this.fetch=mS(r)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(t){return Et(this,void 0,void 0,function*(){try{return{data:(yield ao(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}getBucket(t){return Et(this,void 0,void 0,function*(){try{return{data:yield ao(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:t},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}listBuckets(){return Et(this,arguments,void 0,function*(t={}){try{return{data:yield ao(this.fetch,`${this.url}/ListVectorBuckets`,t,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}deleteBucket(t){return Et(this,void 0,void 0,function*(){try{return{data:(yield ao(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Cs(n))return{data:null,error:n};throw n}})}}class ZV extends KV{constructor(t,n={}){super(t,n.headers||{},n.fetch)}from(t){return new XV(this.url,this.headers,t,this.fetch)}createBucket(t){const n=Object.create(null,{createBucket:{get:()=>super.createBucket}});return Et(this,void 0,void 0,function*(){return n.createBucket.call(this,t)})}getBucket(t){const n=Object.create(null,{getBucket:{get:()=>super.getBucket}});return Et(this,void 0,void 0,function*(){return n.getBucket.call(this,t)})}listBuckets(){const t=Object.create(null,{listBuckets:{get:()=>super.listBuckets}});return Et(this,arguments,void 0,function*(n={}
558){return t.listBuckets.call(this,n)})}deleteBucket(t){const n=Object.create(null,{deleteBucket:{get:()=>super.deleteBucket}});return Et(this,void 0,void 0,function*(){return n.deleteBucket.call(this,t)})}}class XV extends GV{constructor(t,n,r,a){super(t,n,a),this.vectorBucketName=r}createIndex(t){const n=Object.create(null,{createIndex:{get:()=>super.createIndex}});return Et(this,void 0,void 0,function*(){return n.createIndex.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const t=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return Et(this,arguments,void 0,function*(n={}){return t.listIndexes.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName}))})}getIndex(t){const n=Object.create(null,{getIndex:{get:()=>super.getIndex}});return Et(this,void 0,void 0,function*(){return n.getIndex.call(this,this.vectorBucketName,t)})}deleteIndex(t){const n=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return Et(this,void 0,void 0,function*(){return n.deleteIndex.call(this,this.vectorBucketName,t)})}index(t){return new JV(this.url,this.headers,this.vectorBucketName,t,this.fetch)}}class JV extends YV{constructor(t,n,r,a,i){super(t,n,i),this.vectorBucketName=r,this.indexName=a}putVectors(t){const n=Object.create(null,{putVectors:{get:()=>super.putVectors}});return Et(this,void 0,void 0,function*(){return n.putVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(t){const n=Object.create(null,{getVectors:{get:()=>super.getVectors}});return Et(this,void 0,void 0,function*(){return n.getVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const t=Object.create(null,{listVectors:{get:()=>super.listVectors}});return Et(this,arguments,void 0,function*(n={}){return t.listVectors.call(this,Object.assign(Object.assign({},n),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(t){const n=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return Et(this,void 0,void 0,function*(){return n.queryVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(t){const n=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return Et(this,void 0,void 0,function*(){return n.deleteVectors.call(this,Object.assign(Object.assign({},t),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class Gfe extends Ife{constructor(t,n={},r,a){super(t,n,r,a)}from(t){return new Rfe(this.url,this.headers,t,this.fetch)}get vectors(){return new ZV(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new qV(this.url+"/iceberg",this.headers,this.fetch)}}const Yfe=Object.freeze(Object.defineProperty({__proto__:null,StorageAnalyticsClient:qV,StorageApiError:BV,StorageClient:Gfe,StorageError:kb,StorageUnknownError:n2,StorageVectorsApiError:e_,StorageVectorsClient:ZV,StorageVectorsError:ZO,get StorageVectorsErrorCode(){return LC},StorageVectorsUnknownError:VV,VectorBucketApi:KV,VectorBucketScope:XV,VectorDataApi:YV,VectorIndexApi:GV,VectorIndexScope:JV,isPlainObject:HV,isStorageError:ta,isStorageVectorsError:Cs,normalizeToFloat32:zfe,resolveFetch:mS,resolveResponse:Ufe,validateVectorDimension:Wfe},Symbol.toStringTag,{value:"Module"})),Kfe=gb(Yfe);var QV={},gS={};Object.defineProperty(gS,"__esModule",{value:!0});gS.version=void 0;gS.version="2.86.2";(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_REALTIME_OPTIONS=e.DEFAULT_AUTH_OPTIONS=e.DEFAULT_DB_OPTIONS=e.DEFAULT_GLOBAL_OPTIONS=e.DEFAULT_HEADERS=void 0;const t=gS;let n="";typeof Deno<"u"?n="deno":typeof document<"u"?n="web":typeof navigator<"u"&&navigator.product==="ReactNative"?n="react-native":n="node",e.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${n}/${t.version}`},e.DEFAULT_GLOBAL_OPTIONS={headers:e.DEFAULT_HEADERS},e.DEFAULT_DB_OPTIONS={schema:"public"},e.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},e.DEFAULT_REALTIME_OPTIONS={}})(QV);var eH={};
558(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fetchWithAuth=e.resolveHeadersConstructor=e.resolveFetch=void 0;const t=a=>a?(...i)=>a(...i):(...i)=>fetch(...i);e.resolveFetch=t;const n=()=>Headers;e.resolveHeadersConstructor=n;const r=(a,i,o)=>{const l=(0,e.resolveFetch)(o),c=(0,e.resolveHeadersConstructor)();return async(u,d)=>{var f;const p=(f=await i())!==null&&f!==void 0?f:a;let h=new c(d==null?void 0:d.headers);return h.has("apikey")||h.set("apikey",a),h.has("Authorization")||h.set("Authorization",`Bearer ${p}`),l(u,Object.assign(Object.assign({},d),{headers:h}))}};e.fetchWithAuth=r})(eH);var wf={};Object.defineProperty(wf,"__esModule",{value:!0});wf.isBrowser=void 0;wf.uuid=Zfe;wf.ensureTrailingSlash=tH;wf.applySettingDefaults=Jfe;wf.validateSupabaseUrl=Qfe;function Zfe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,n=e=="x"?t:t&3|8;return n.toString(16)})}function tH(e){return e.endsWith("/")?e:e+"/"}const Xfe=()=>typeof window<"u";wf.isBrowser=Xfe;function Jfe(e,t){var n,r;const{db:a,auth:i,realtime:o,global:l}=e,{db:c,auth:u,realtime:d,global:f}=t,p={db:Object.assign(Object.assign({},c),a),auth:Object.assign(Object.assign({},u),i),realtime:Object.assign(Object.assign({},d),o),storage:{},global:Object.assign(Object.assign(Object.assign({},f),l),{headers:Object.assign(Object.assign({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=l==null?void 0:l.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?p.accessToken=e.accessToken:delete p.accessToken,p}function Qfe(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(tH(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var vS={};const nH="2.86.2",gm=30*1e3,MC=3,xA=MC*gm,ehe="http://localhost:9999",the="supabase.auth.token",nhe={"X-Client-Info":`gotrue-js/${nH}`},$C="X-Supabase-Api-Version",rH={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},rhe=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,ahe=10*60*1e3;let Ug=class extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}};function Ft(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}let aH=class extends Ug{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}};function iH(e){return Ft(e)&&e.name==="AuthApiError"}let hd=class extends Ug{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}},Pu=class extends Ug{constructor(t,n,r,a){super(t,r,a),this.name=n,this.status=r}},Ss=class extends Pu{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function sH(e){return Ft(e)&&e.name==="AuthSessionMissingError"}let nh=class extends Pu{constructor(){super("Auth session or user missing","AuthInvalidToken
558ResponseError",500,void 0)}},o0=class extends Pu{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},l0=class extends Pu{constructor(t,n=null){super(t,"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 oH(e){return Ft(e)&&e.name==="AuthImplicitGrantRedirectError"}let DC=class extends Pu{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},r2=class extends Pu{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}};function t_(e){return Ft(e)&&e.name==="AuthRetryableFetchError"}let FC=class extends Pu{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}};function ihe(e){return Ft(e)&&e.name==="AuthWeakPasswordError"}let a2=class extends Pu{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};const i2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),jM=` 	
559\r=`.split(""),she=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<jM.length;t+=1)e[jM[t].charCodeAt(0)]=-2;for(let t=0;t<i2.length;t+=1)e[i2[t].charCodeAt(0)]=t;return e})();function SM(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(i2[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(i2[r]),t.queuedBits-=6}}function lH(e,t,n){const r=she[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function NM(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=o=>{che(o,r,n)};for(let o=0;o<e.length;o+=1)lH(e.charCodeAt(o),a,i);return t.join("")}function ohe(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function lhe(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const a=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|a)+65536,n+=1}ohe(r,t)}}function che(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function tg(e){const t=[],n={queue:0,queuedBits:0},r=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)lH(e.charCodeAt(a),n,r);return new Uint8Array(t)}function uhe(e){const t=[];return lhe(e,n=>t.push(n)),new Uint8Array(t)}function wh(e){const t=[],n={queue:0,queuedBits:0},r=a=>{t.push(a)};return e.forEach(a=>SM(a,n,r)),SM(null,n,r),t.join("")}function dhe(e){return Math.round(Date.now()/1e3)+e}function fhe(){return Symbol("auth-callback")}const Pi=()=>typeof window<"u"&&typeof document<"u",Hf={tested:!1,writable:!1},cH=()=>{if(!Pi())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Hf.tested)return Hf.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Hf.tested=!0,Hf.writable=!0}catch{Hf.tested=!0,Hf.writable=!1}return Hf.writable};function hhe(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((a,i)=>{t[i]=a})}catch{}return n.searchParams.forEach((r,a)=>{t[a]=r}),t}const uH=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),phe=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",vm=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Gf=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Ci=async(e,t)=>{await e.removeItem(t)};class yS{constructor(){this.promise=new yS.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}yS.promiseConstructor=Promise;function bA(e){const t=e.split(".");if(t.length!==3)throw new a2("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!rhe.test(t[r]))throw new a2("JWT not in base64url format");return{header:JSON.parse(NM(t[0])),payload:JSON.parse(NM(t[1])),signature:tg(t[2]),raw:{header:t[0],payload:t[1]}}}async function mhe(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function ghe(e,t){return new Promise((r,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){r(o);return}}catch(o){if(!t(i,o)){a(o);return}}})()})}function vhe(e){return("0"+e.toString(16)).substr(-2)}function yhe(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let a="";for(let i=0;i<56;i++)a+=n.charAt(Math.floor(Math.random()*r));return a}return crypto.getRandomValues(t),Array.from(t,vhe).join("")}async function xhe(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",
559n),a=new Uint8Array(r);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function bhe(e){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."),e;const n=await xhe(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Qp(e,t,n=!1){const r=yhe();let a=r;n&&(a+="/PASSWORD_RECOVERY"),await vm(e,`${t}-code-verifier`,a);const i=await bhe(r);return[i,r===i?"plain":"s256"]}const whe=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function _he(e){const t=e.headers.get($C);if(!t||!t.match(whe))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function jhe(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function She(e){switch(e){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 Nhe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function em(e){if(!Nhe.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function wA(){const e={};return new Proxy(e,{get:(t,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:(t,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:(t,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 Ahe(e,t){return new Proxy(e,{get:(n,r,a)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const i=r.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,a)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,a)}})}function AM(e){return JSON.parse(JSON.stringify(e))}const rh=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),khe=[502,503,504];async function kM(e){var t;if(!phe(e))throw new r2(rh(e),0);if(khe.includes(e.status))throw new r2(rh(e),e.status);let n;try{n=await e.json()}catch(i){throw new hd(rh(i),i)}let r;const a=_he(e);if(a&&a.getTime()>=rH["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 FC(rh(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Ss}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,o)=>i&&typeof o=="string",!0))throw new FC(rh(n),e.status,n.weak_password.reasons);throw new aH(rh(n),e.status||500,r)}const Ehe=(e,t,n,r)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(r),Object.assign(Object.assign({},a),n))};async function en(e,t,n,r){var a;const i=Object.assign({},r==null?void 0:r.headers);i[$C]||(i[$C]=rH["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(a=r==null?void 0:r.query)!==null&&a!==void 0?a:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await Che(e,t,n+l,{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(c):{data:Object.assign({},c),error:null}}async function Che(e,t,n,r,a,i){const o=Ehe(t,r,a,i);let l;try{l=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new r2(rh(c),0)}if(l.ok||await kM(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await kM(c)}}function fl(e){var t;let n=null;Ohe(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=dhe(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function EM(e){const t=fl(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function pd(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function Phe(e){return{data:e,error:null}}function The(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:a,verification_type:i}=e,o=bf(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:a,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function CM(e){return e}function Ohe(e){return e.access_token&&e.refresh_token&&e.expires_in}const n_=["global","local","others"];let XO=class{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=uH(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,n=n_[0]){if(n_.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${n_.join(", ")}`);try{return await en(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Ft(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await en(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:pd})}catch(r){if(Ft(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=bf(t,["options"]),a=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(a.new_email=r==null?void 0:r.newEmail,delete a.newEmail),await en(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:The,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Ft(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await en(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:pd})}catch(n){if(Ft(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,a,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await en(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:CM});if(d.error)throw d.error;const f=await d.json(),p=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return h.length>
5590&&(h.forEach(m=>{const g=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(m.split(";")[1].split("=")[1]);u[`${v}Page`]=g}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Ft(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){em(t);try{return await en(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:pd})}catch(n){if(Ft(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){em(t);try{return await en(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:pd})}catch(r){if(Ft(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){em(t);try{return await en(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:pd})}catch(r){if(Ft(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){em(t.userId);try{const{data:n,error:r}=await en(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:n,error:r}}catch(n){if(Ft(n))return{data:null,error:n};throw n}}async _deleteFactor(t){em(t.userId),em(t.id);try{return{data:await en(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Ft(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,a,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await en(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:CM});if(d.error)throw d.error;const f=await d.json(),p=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return h.length>0&&(h.forEach(m=>{const g=parseInt(m.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(m.split(";")[1].split("=")[1]);u[`${v}Page`]=g}),u.total=parseInt(p)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Ft(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await en(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ft(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await en(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ft(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await en(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ft(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await en(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Ft(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await en(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ft(n))return{data:null,error:n};throw n}}};function PM(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const ah={debug:!!(globalThis&&cH()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class JO extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}let dH=class extends JO{};class Rhe extends JO{}async function fH(e,t,n){ah.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),ah.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>
559globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async a=>{if(a){ah.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await n()}finally{ah.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw ah.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new dH(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(ah.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()}}))}const TM={};async function Ihe(e,t,n){var r;const a=(r=TM[e])!==null&&r!==void 0?r:Promise.resolve(),i=Promise.race([a.catch(()=>null),t>=0?new Promise((o,l)=>{setTimeout(()=>{l(new Rhe(`Acquring process lock with name "${e}" timed out`))},t)}):null].filter(o=>o)).catch(o=>{if(o&&o.isAcquireTimeout)throw o;return null}).then(async()=>await n());return TM[e]=i.catch(async o=>{if(o&&o.isAcquireTimeout)return await a,null;throw o}),await i}function Lhe(){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 hH(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function Mhe(e){return parseInt(e,16)}function $he(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function Dhe(e){var t;const{chainId:n,domain:r,expirationTime:a,issuedAt:i=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:d,uri:f,version:p}=e;{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(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);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(!((t=e.statement)===null||t===void 0)&&t.includes(`
560`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const h=hH(e.address),m=d?`${d}://${r}
560`:r,g=e.statement?`${e.statement}
561`:"",v=`${m} wants you to sign in with your Ethereum account:
562${h}
563
564${g}`;let y=`URI: ${f}
565Version: ${p}
566Chain ID: ${n}${o?`
567Nonce: ${o}`:""}
568Issued At: ${i.toISOString()}`;if(a&&(y+=`
569Expiration Time: ${a.toISOString()}`),l&&(y+=`
570Not Before: ${l.toISOString()}`),c&&(y+=`
571Request ID: ${c}`),u){let b=`
572Resources:`;for(const w of u){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);b+=`
573- ${w}`}y+=b}return`${v}
574${y}`}class Va extends Error{constructor({message:t,code:n,cause:r,name:a}){var i;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=a??(r instanceof Error?r.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}}class s2 extends Va{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function Fhe({error:e,options:t}){var n,r,a;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Va({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Va({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Va({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((a=i.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new Va({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Va({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Va({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new Va({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Va({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(pH(o)){if(i.rp.id!==o)return new Va({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Va({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Va({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Va({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Va({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Bhe({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Va({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Va({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(pH(r)){if(n.rpId!==r)return new Va({message:`The RP ID "${n.rpId}
574" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Va({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Va({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Va({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class Uhe{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const zhe=new Uhe;function Whe(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,a=bf(e,["challenge","user","excludeCredentials"]),i=tg(t).buffer,o=Object.assign(Object.assign({},n),{id:tg(n.id).buffer}),l=Object.assign(Object.assign({},a),{challenge:i,user:o});if(r&&r.length>0){l.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:tg(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function qhe(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=bf(e,["challenge","allowCredentials"]),a=tg(t).buffer,i=Object.assign(Object.assign({},r),{challenge:a});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const l=n[o];i.allowCredentials[o]=Object.assign(Object.assign({},l),{id:tg(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return i}function Vhe(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:wh(new Uint8Array(e.response.attestationObject)),clientDataJSON:wh(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Hhe(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),a=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:wh(new Uint8Array(a.authenticatorData)),clientDataJSON:wh(new Uint8Array(a.clientDataJSON)),signature:wh(new Uint8Array(a.signature)),userHandle:a.userHandle?wh(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function pH(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function OM(){var e,t;return!!(Pi()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function Ghe(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new s2("Browser returned unexpected credential type",t)}:{data:null,error:new s2("Empty credential response",t)}}catch(t){return{data:null,error:Fhe({error:t,options:e})}}}async function Yhe(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new s2("Browser returned unexpected credential type",t)}:{data:null,error:new s2("Empty credential response",t)}}
574catch(t){return{data:null,error:Bhe({error:t,options:e})}}}const Khe={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Zhe={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function o2(...e){const t=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),n=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),r={};for(const a of e)if(a)for(const i in a){const o=a[i];if(o!==void 0)if(Array.isArray(o))r[i]=o;else if(n(o))r[i]=o;else if(t(o)){const l=r[i];t(l)?r[i]=o2(l,o):r[i]=o2(o)}else r[i]=o}return r}function Xhe(e,t){return o2(Khe,e,t||{})}function Jhe(e,t){return o2(Zhe,e,t||{})}class Qhe{constructor(t){this.client=t,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(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:a},i){try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!o)return{data:null,error:l};const c=a??zhe.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${r}`),u.displayName||(u.displayName=u.name)}switch(o.webauthn.type){case"create":{const u=Xhe(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:d,error:f}=await Ghe({publicKey:u,signal:c});return d?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}case"request":{const u=Jhe(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:d,error:f}=await Yhe(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}}}catch(o){return Ft(o)?{data:null,error:o}:{data:null,error:new hd("Unexpected error in challenge",o)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},i){if(!n)return{data:null,error:new Ug("rpId is required for WebAuthn authentication")};try{if(!OM())return{data:null,error:new hd("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:a},{request:i});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(o){return Ft(o)?{data:null,error:o}:{data:null,error:new hd("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},i){if(!n)return{data:null,error:new Ug("rpId is required for WebAuthn registration")};try{if(!OM())return{data:null,error:new hd("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)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===t&&p.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:a},{create:i});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return Ft(o)?{data:null,error:o}:{data:null,error:new hd("Unexpected error in register",o)}}}}Lhe();const epe={url:ehe,storageKey:the,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:nhe,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};
574async function RM(e,t,n){return await n()}const tm={};let QO=class BC{get jwks(){var t,n;return(n=(t=tm[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){tm[this.storageKey]=Object.assign(Object.assign({},tm[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=tm[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){tm[this.storageKey]=Object.assign(Object.assign({},tm[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,a;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;const i=Object.assign(Object.assign({},epe),t);if(this.storageKey=i.storageKey,this.instanceID=(n=BC.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,BC.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&Pi()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new XO({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=uH(i.fetch),this.lock=i.lock||RM,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,i.lock?this.lock=i.lock:Pi()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=fH:this.lock=RM,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 Qhe(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:cH()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=PM(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=PM(this.memoryStorage)),Pi()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${nH}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),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 t;try{let n={},r="none";if(Pi()&&(n=hhe(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),Pi()&&this.detectSessionInUrl&&r!=="none"){const{data:a,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),oH(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:l}=a;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Ft(n)?this._returnResult({error:n}):this._returnResult({error:new hd("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,a;try{const i=await en(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:fl}),{data:o,error:l}=i;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(Ft(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var n,r,a;try{let i;if("email"in t){const{email:d,password:f,options:p}=t;let h=null,m=null;this.flowType==="pkce"&&([h,m]=await Qp(this.storage,this.storageKey)),i=await en(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:h,code_challenge_method:m},xform:fl})}else if("phone"in t){const{phone:d,password:f,options:p}=t;i=await en(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:(a=p==null?void 0:p.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:fl})}else throw new o0("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return await Ci(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(await Ci(this.storage,`${this.storageKey}-code-verifier`),Ft(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let n;if("email"in t){const{email:i,password:o,options:l}=t;n=await en(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:EM})}else if("phone"in t){const{phone:i,password:o,options:l}=t;n=await en(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:EM})}else throw new o0("You must provide either an email or phone number and a password");const{data:r,error:a}=n;
574if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!r||!r.session||!r.user){const i=new nh;return this._returnResult({data:{user:null,session:null},error:i})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:a})}catch(n){if(Ft(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,a,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,a,i,o,l,c,u,d,f,p;let h,m;if("message"in t)h=t.message,m=t.signature;else{const{chain:g,wallet:v,statement:y,options:b}=t;let w;if(Pi())if(typeof v=="object")w=v;else{const P=window;if("ethereum"in P&&typeof P.ethereum=="object"&&"request"in P.ethereum&&typeof P.ethereum.request=="function")w=P.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 v!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=v}const j=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href),S=await w.request({method:"eth_requestAccounts"}).then(P=>P).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!S||S.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const A=hH(S[0]);let E=(r=b==null?void 0:b.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!E){const P=await w.request({method:"eth_chainId"});E=Mhe(P)}const k={domain:j.host,address:A,statement:y,uri:j.href,version:"1",chainId:E,nonce:(a=b==null?void 0:b.signInWithEthereum)===null||a===void 0?void 0:a.nonce,issuedAt:(o=(i=b==null?void 0:b.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=b==null?void 0:b.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=b==null?void 0:b.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=b==null?void 0:b.signInWithEthereum)===null||d===void 0?void 0:d.resources};h=Dhe(k),m=await w.request({method:"personal_sign",params:[$he(h),A]})}try{const{data:g,error:v}=await en(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:m},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:fl});if(v)throw v;if(!g||!g.session||!g.user){const y=new nh;return this._returnResult({data:{user:null,session:null},error:y})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:v})}catch(g){if(Ft(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var n,r,a,i,o,l,c,u,d,f,p,h;let m,g;if("message"in t)m=t.message,g=t.signature;else{const{chain:v,wallet:y,statement:b,options:w}=t;let j;if(Pi())if(typeof y=="object")j=y;else{const A=window;if("solana"in A&&typeof A.solana=="object"&&("signIn"in A.solana&&typeof A.solana.signIn=="function"||"signMessage"in A.solana&&typeof A.solana.signMessage=="function"))j=A.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=y}const S=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in j&&j.signIn){const A=await j.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),b?{statement:b}:null));let E;if(Array.isArray(A)&&A[0]&&typeof A[0]=="object")E=A[0];else if(A&&typeof A=="object"&&"signedMessage"in A&&"signature"in A)E=A;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)m=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),g=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in j)||typeof j.signMessage!="function"||!("publicKey"in j)||typeof j!="object"||!j.publicKey||!("toBase58"in j.publicKey)||typeof j.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");m=[`${S.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(a=(r=w==null?void 0:w.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((i=w==null?void 0:w.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((c=w==null?void 0:w.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((f=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...w.sign
574InWithSolana.resources.map(E=>`- ${E}`)]:[]].join(`
575`);const A=await j.signMessage(new TextEncoder().encode(m),"utf8");if(!A||!(A instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=A}}try{const{data:v,error:y}=await en(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:m,signature:wh(g)},!((p=t.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:fl});if(y)throw y;if(!v||!v.session||!v.user){const b=new nh;return this._returnResult({data:{user:null,session:null},error:b})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:y})}catch(v){if(Ft(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(t){const n=await Gf(this.storage,`${this.storageKey}-code-verifier`),[r,a]=(n??"").split("/");try{const{data:i,error:o}=await en(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:fl});if(await Ci(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const l=new nh;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:o})}catch(i){if(await Ci(this.storage,`${this.storageKey}-code-verifier`),Ft(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:n,provider:r,token:a,access_token:i,nonce:o}=t,l=await en(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:a,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:fl}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new nh;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(n){if(Ft(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,a,i,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Qp(this.storage,this.storageKey));const{error:f}=await en(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await en(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new o0("You must provide either an email or phone number.")}catch(l){if(await Ci(this.storage,`${this.storageKey}-code-verifier`),Ft(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,r;try{let a,i;"options"in t&&(a=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:l}=await en(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:fl});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(Ft(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithSSO(t){var n,r,a,i,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Qp(this.storage,this.storageKey));const u=await en(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:Phe});return!((i=u.data)===null||i===void 0)&&i.url&&Pi()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await Ci(this.storage,`${this.storageKey}-code-verifier`),Ft(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new Ss;const{error:a}=await en(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:a})})}catch(t){if(Ft(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:a,options:i}=t,{error:o}=await en(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:r,type:a,options:i}=t,{data:o,error:l}=await en(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new o0("You must provide either an email or phone number and a type")}catch(n){if(Ft(n))return this._returnResult({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(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,t,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 a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.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(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(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 t=null;const n=await Gf(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
575id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<xA:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await Gf(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=wA()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=Ahe(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:a},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(-1,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await en(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:pd}):await this._useSession(async n=>{var r,a,i;const{data:o,error:l}=n;if(l)throw l;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ss}:await en(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=o.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:pd})})}catch(n){if(Ft(n))return sH(n)&&(await this._removeSession(),await Ci(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:a,error:i}=r;if(i)throw i;if(!a.session)throw new Ss;const o=a.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Qp(this.storage,this.storageKey));const{data:u,error:d}=await en(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:pd});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await Ci(this.storage,`${this.storageKey}-code-verifier`),Ft(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Ss;const n=Date.now()/1e3;let r=n,a=!0,i=null;const{payload:o}=bA(t.access_token);if(o.exp&&(r=o.exp,a=r<=n),a){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)throw c;i={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(n){if(Ft(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:o,error:l}=n;if(l)throw l;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Ss;const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):a?this._returnResult({data:{user:a.user,session:a},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Ft(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!Pi())throw new l0("No browser detected.");
575if(t.error||t.error_description||t.error_code)throw new l0(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new DC("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new l0("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new DC("No code detected.");const{data:b,error:w}=await this._exchangeCodeForSession(t.code);if(w)throw w;const j=new URL(window.location.href);return j.searchParams.delete("code"),window.history.replaceState(window.history.state,"",j.toString()),{data:{session:b.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:a,access_token:i,refresh_token:o,expires_in:l,expires_at:c,token_type:u}=t;if(!i||!l||!o||!u)throw new l0("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(l);let p=d+f;c&&(p=parseInt(c));const h=p-d;h*1e3<=gm&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${f}s`);const m=p-f;d-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,p,d):d-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,p,d);const{data:g,error:v}=await this._getUser(i);if(v)throw v;const y={provider_token:r,provider_refresh_token:a,access_token:i,expires_in:f,expires_at:p,refresh_token:o,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(r){if(Ft(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await Gf(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return this._returnResult({error:i});const o=(r=a.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(iH(l)&&(l.status===404||l.status===401||l.status===403)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await Ci(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=fhe(),r={id:n,callback:t,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(t){return await this._useSession(async n=>{var r,a;try{const{data:{session:i},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,n={}){let r=null,a=null;this.flowType==="pkce"&&([r,a]=await Qp(this.storage,this.storageKey,!0));try{return await en(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:a,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(await Ci(this.storage,`${this.storageKey}-code-verifier`),Ft(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(Ft(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:a}=await this._useSession(async i=>{var o,l,c,u,d;const{data:f,error:p}=i;if(p)throw p;const h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await en(this.fetch,"GET",h,{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(a)throw a;return Pi()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(Ft(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:a,data:{session:i}}=n;
575if(a)throw a;const{options:o,provider:l,token:c,access_token:u,nonce:d}=t,f=await en(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:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:fl}),{data:p,error:h}=f;return h?this._returnResult({data:{user:null,session:null},error:h}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new nh}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:h}))}catch(a){if(await Ci(this.storage,`${this.storageKey}-code-verifier`),Ft(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,a;const{data:i,error:o}=n;if(o)throw o;return await en(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&a!==void 0?a:void 0})})}catch(n){if(Ft(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await ghe(async a=>(a>0&&await mhe(200*Math.pow(2,a-1)),this._debug(n,"refreshing attempt",a),await en(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:fl})),(a,i)=>{const o=200*Math.pow(2,a);return i&&t_(i)&&Date.now()+o-r<gm})}catch(r){if(this._debug(n,"error",r),Ft(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),Pi()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const a=await Gf(this.storage,this.storageKey);if(a&&this.userStorage){let o=await Gf(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:a.user},await vm(this.userStorage,this.storageKey+"-user",o)),a.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:wA()}else if(a&&!a.user&&!a.user){const o=await Gf(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(a.user=o.user,await Ci(this.storage,this.storageKey+"-user"),await vm(this.storage,this.storageKey,a)):a.user=wA()}if(this._debug(r,"session from storage",a),!this._isValidSession(a)){this._debug(r,"session is not valid"),a!==null&&await this._removeSession();return}const i=((n=a.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<xA;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${xA}s`),i){if(this.autoRefreshToken&&a.refresh_token){const{error:o}=await this._callRefreshToken(a.refresh_token);o&&(console.error(o),t_(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(a.access_token);!l&&(o!=null&&o.user)?(a.user=o.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(r,"error",a),console.error(a);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new Ss;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new yS;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new Ss;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const l={data:i.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(i){if(this._debug(a,"error",i),Ft(i)){const o={data:null,error:i};return t_(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,n,r=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Ci(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await vm(this.userStorage,this.storageKey+"-user",{user:n.user});const a=Object.assign({},n);delete a.user;const i=AM(a);await vm(this.storage,this.storageKey,i)}else{const a=AM(n);await vm(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Ci(this.storage,this.storageKey),await Ci(this.storage,this.storageKey+"-code-verifier"),await Ci(this.storage,this.storageKey+"-user"),this.userStorage&&await Ci(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Pi()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
575catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),gm);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=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 a=Math.floor((r.expires_at*1e3-t)/gm);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${gm}ms, refresh threshold is ${MC} ticks`),a<=MC&&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(t){if(t.isAcquireTimeout||t instanceof JO)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Pi()||!(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(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(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(t,n,r){const a=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&a.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&a.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await Qp(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});a.push(l.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);a.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&a.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;return i?this._returnResult({data:null,error:i}):await en(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Ft(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,a;const{data:i,error:o}=n;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await en(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(Ft(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Vhe(t.webauthn.credential_response):Hhe(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await en(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(n){if(Ft(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:a,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await en(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:Whe(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:qhe(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Ft(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const a={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])a.all.push(i),i.status==="verified"&&a[i.factor_type].push(i);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(){var t,n;const{data:{session:r},error:a}
575=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=bA(r.access_token);let o=null;i.aal&&(o=i.aal);let l=o;((n=(t=r.user.factors)===null||t===void 0?void 0:t.filter(d=>d.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(l="aal2");const u=i.amr||[];return{data:{currentLevel:o,nextLevel:l,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:a}=n;return a?this._returnResult({data:null,error:a}):r?await en(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Ss})})}catch(n){if(Ft(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:a},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new Ss});const o=await en(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Pi()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(Ft(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:a},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new Ss});const o=await en(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Pi()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(Ft(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await en(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new Ss})})}catch(t){if(Ft(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:a}=n;return a?this._returnResult({data:null,error:a}):r?(await en(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Ss})})}catch(n){if(Ft(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(l=>l.kid===t);if(r)return r;const a=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+ahe>a)return r;const{data:i,error:o}=await en(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=a,r=i.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:h,error:m}
575=await this.getSession();if(m||!h.session)return this._returnResult({data:null,error:m});r=h.session.access_token}const{header:a,payload:i,signature:o,raw:{header:l,payload:c}}=bA(r);n!=null&&n.allowExpired||jhe(i.exp);const u=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:h}=await this.getUser(r);if(h)throw h;return{data:{claims:i,header:a,signature:o},error:null}}const d=She(a.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,o,uhe(`${l}.${c}`)))throw new a2("Invalid JWT signature");return{data:{claims:i,header:a,signature:o},error:null}}catch(r){if(Ft(r))return this._returnResult({data:null,error:r});throw r}}};QO.nextInstanceID={};const tpe=XO,npe=QO,rpe=Object.freeze(Object.defineProperty({__proto__:null,AuthAdminApi:tpe,AuthApiError:aH,AuthClient:npe,AuthError:Ug,AuthImplicitGrantRedirectError:l0,AuthInvalidCredentialsError:o0,AuthInvalidJwtError:a2,AuthInvalidToken
575ResponseError:nh,AuthPKCEGrantCodeExchangeError:DC,AuthRetryableFetchError:r2,AuthSessionMissingError:Ss,AuthUnknownError:hd,AuthWeakPasswordError:FC,CustomAuthError:Pu,GoTrueAdminApi:XO,GoTrueClient:QO,NavigatorLockAcquireTimeoutError:dH,SIGN_OUT_SCOPES:n_,isAuthApiError:iH,isAuthError:Ft,isAuthImplicitGrantRedirectError:oH,isAuthRetryableFetchError:t_,isAuthSessionMissingError:sH,isAuthWeakPasswordError:ihe,lockInternals:ah,navigatorLock:fH,processLock:Ihe},Symbol.toStringTag,{value:"Module"})),mH=gb(rpe);Object.defineProperty(vS,"__esModule",{value:!0});vS.SupabaseAuthClient=void 0;const ape=mH;class ipe extends ape.AuthClient{constructor(t){super(t)}}vS.SupabaseAuthClient=ipe;Object.defineProperty(Q_,"__esModule",{value:!0});const spe=xV,ope=Zi,lpe=FV,cpe=Kfe,tw=QV,upe=eH,IM=wf,dpe=vS;let fpe=class{constructor(t,n,r){var a,i,o;this.supabaseUrl=t,this.supabaseKey=n;const l=(0,IM.validateSupabaseUrl)(t);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);const c=`sb-${l.hostname.split(".")[0]}-auth-token`,u={db:tw.DEFAULT_DB_OPTIONS,realtime:tw.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},tw.DEFAULT_AUTH_OPTIONS),{storageKey:c}),global:tw.DEFAULT_GLOBAL_OPTIONS},d=(0,IM.applySettingDefaults)(r??{},u);this.storageKey=(a=d.auth.storageKey)!==null&&a!==void 0?a:"",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((o=d.auth)!==null&&o!==void 0?o:{},this.headers,d.global.fetch),this.fetch=(0,upe.fetchWithAuth)(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.accessToken&&this.accessToken().then(f=>this.realtime.setAuth(f)).catch(f=>console.warn("Failed to set initial Realtime auth token:",f)),this.rest=new ope.PostgrestClient(new URL("rest/v1",l).href,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),this.storage=new cpe.StorageClient(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),d.accessToken||this._listenForAuthEvents()}get functions(){return new spe.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,n={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,n,r)}channel(t,n={config:{}}){return this.realtime.channel(t,n)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t,n;if(this.accessToken)return await this.accessToken();const{data:r}=await this.auth.getSession();return(n=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&n!==void 0?n:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:a,userStorage:i,storageKey:o,flowType:l,lock:c,debug:u,throwOnError:d},f,p){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new dpe.SupabaseAuthClient({url:this.authUrl.href,headers:Object.assign(Object.assign({},h),f),storageKey:o,autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:a,userStorage:i,flowType:l,lock:c,debug:u,throwOnError:d,fetch:p,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new lpe.RealtimeClient(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(t,n,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};Q_.default=fpe;(function(e){var t=ec&&ec.__createBinding||(Object.create?function(d,f,p,h){h===void 0&&(h=p);var m=Object.getOwnPropertyDescriptor(f,p);
575(!m||("get"in m?!f.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return f[p]}}),Object.defineProperty(d,h,m)}:function(d,f,p,h){h===void 0&&(h=p),d[h]=f[p]}),n=ec&&ec.__exportStar||function(d,f){for(var p in d)p!=="default"&&!Object.prototype.hasOwnProperty.call(f,p)&&t(f,d,p)},r=ec&&ec.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.createClient=e.SupabaseClient=e.FunctionRegion=e.FunctionsError=e.FunctionsRelayError=e.FunctionsFetchError=e.FunctionsHttpError=e.PostgrestError=void 0;const a=r(Q_);n(mH,e);var i=Zi;Object.defineProperty(e,"PostgrestError",{enumerable:!0,get:function(){return i.PostgrestError}});var o=xV;Object.defineProperty(e,"FunctionsHttpError",{enumerable:!0,get:function(){return o.FunctionsHttpError}}),Object.defineProperty(e,"FunctionsFetchError",{enumerable:!0,get:function(){return o.FunctionsFetchError}}),Object.defineProperty(e,"FunctionsRelayError",{enumerable:!0,get:function(){return o.FunctionsRelayError}}),Object.defineProperty(e,"FunctionsError",{enumerable:!0,get:function(){return o.FunctionsError}}),Object.defineProperty(e,"FunctionRegion",{enumerable:!0,get:function(){return o.FunctionRegion}}),n(FV,e);var l=Q_;Object.defineProperty(e,"SupabaseClient",{enumerable:!0,get:function(){return r(l).default}});const c=(d,f,p)=>new a.default(d,f,p);e.createClient=c;function u(){if(typeof window<"u"||typeof process>"u")return!1;const d=process.version;if(d==null)return!1;const f=d.match(/^v(\d+)\./);return f?parseInt(f[1],10)<=18:!1}u()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217")})(WO);const gH=mr(WO),hpe=Z9({__proto__:null,default:gH},[WO]),{PostgrestError:dJe,FunctionsHttpError:fJe,FunctionsFetchError:hJe,FunctionsRelayError:pJe,FunctionsError:mJe,FunctionRegion:gJe,SupabaseClient:vJe,createClient:ppe,GoTrueAdminApi:yJe,GoTrueClient:xJe,AuthAdminApi:bJe,AuthClient:wJe,navigatorLock:_Je,NavigatorLockAcquireTimeoutError:jJe,lockInternals:SJe,processLock:NJe,SIGN_OUT_SCOPES:AJe,AuthError:kJe,AuthApiError:EJe,AuthUnknownError:CJe,CustomAuthError:PJe,AuthSessionMissingError:TJe,AuthInvalidToken
575ResponseError:OJe,AuthInvalidCredentialsError:RJe,AuthImplicitGrantRedirectError:IJe,AuthPKCEGrantCodeExchangeError:LJe,AuthRetryableFetchError:MJe,AuthWeakPasswordError:$Je,AuthInvalidJwtError:DJe,isAuthError:FJe,isAuthApiError:BJe,isAuthSessionMissingError:UJe,isAuthImplicitGrantRedirectError:zJe,isAuthRetryableFetchError:WJe,isAuthWeakPasswordError:qJe,RealtimePresence:VJe,RealtimeChannel:HJe,RealtimeClient:GJe,REALTIME_LISTEN_TYPES:YJe,REALTIME_POSTGRES_CHANGES_LISTEN_EVENT:KJe,REALTIME_PRESENCE_LISTEN_EVENTS:ZJe,REALTIME_SUBSCRIBE_STATES:XJe,REALTIME_CHANNEL_STATES:JJe}=gH||hpe;function mpe(){var v,y;if(typeof window>"u")return;const e=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(b=>e===b||e.endsWith("."+b)),r="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",a=n?((v=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:v[1])??((y=e.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:y[1]):void 0,i=window.parent&&window.parent!==window;if(!a||!i)return localStorage;const o=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=c&&l.test(c)?[c]:o?["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),h=(b,w,j)=>new Promise(S=>{const A=p();let E=!1,k;const P=I=>{E||(E=!0,clearTimeout(k),window.removeEventListener("message",R),S(I))},R=I=>
575{if(u.indexOf(I.origin)<0)return;const D=I.data;D&&D.type===d&&D.requestId===A&&P(D)};window.addEventListener("message",R);const C={type:b,requestId:A,projectId:a,key:w};j!==void 0&&(C.value=j);for(const I of u)window.parent.postMessage(C,I);k=setTimeout(()=>P(null),f)});let m=!0;const g=250;return{getItem:async b=>{let w=await h("lovable-preview-auth:get",b);return!w&&m&&(await new Promise(j=>setTimeout(j,g)),w=await h("lovable-preview-auth:get",b)),m=!1,w&&w.ok&&typeof w.value=="string"?w.value===""?(localStorage.removeItem(b),null):w.value:localStorage.getItem(b)},setItem:(b,w)=>(localStorage.setItem(b,w),h("lovable-preview-auth:set",b,w).then(()=>{})),removeItem:b=>(localStorage.removeItem(b),h("lovable-preview-auth:remove",b).then(()=>{}))}}const gpe="https://lqvuodcxdknhkawvunaq.supabase.co",vpe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxxdnVvZGN4ZGtuaGthd3Z1bmFxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ5NTM5NjQsImV4cCI6MjA4MDUyOTk2NH0.vZw85S-GVfKk-hu5ZcEbtWfpo8KNK0YK2ONEpsZXj2k",Re=ppe(gpe,vpe,{auth:{storage:mpe(),persistSession:!0,autoRefreshToken:!0}}),vH=x.createContext(void 0),ype=({children:e})=>{const[t,n]=x.useState(null),[r,a]=x.useState(null),[i,o]=x.useState(null),[l,c]=x.useState(null),[u,d]=x.useState(!1),[f,p]=x.useState(!1),h=async(S,A=1e4)=>{let E;const k=new Promise(P=>{E=setTimeout(()=>P(null),A)});return Promise.race([S,k]).finally(()=>{E&&clearTimeout(E)})},m=async S=>{const{data:A,error:E}=await Re.from("user_roles").select("role").eq("user_id",S).maybeSingle();return E?(console.error("Error fetching user role:",E),null):A==null?void 0:A.role},g=async S=>{const{data:A,error:E}=await Re.from("profiles").select("*").eq("user_id",S).maybeSingle();return E?(console.error("Error fetching profile:",E),null):A},v=x.useCallback(async()=>{if(!t)return;const S=await g(t.id);S&&c(S)},[t]);x.useEffect(()=>{const{data:{subscription:S}}=Re.auth.onAuthStateChange((A,E)=>{a(E),n((E==null?void 0:E.user)??null),d(!0),E!=null&&E.user||(o(null),c(null),p(!1))});return h(Re.auth.getSession(),5e3).then(A=>{if(!A){console.error("Timed out restoring auth session"),a(null),n(null),o(null),c(null);return}const{data:{session:E}}=A;a(E),n((E==null?void 0:E.user)??null)}).catch(A=>{console.error("Error checking existing auth session:",A),a(null),n(null),o(null),c(null)}).finally(()=>{d(!0)}),()=>S.unsubscribe()},[]),x.useEffect(()=>{if(!u)return;let S=!1;if(!t){o(null),c(null),p(!1);return}return p(!0),h(Promise.all([m(t.id),g(t.id)])).then(A=>{if(S)return;if(!A){console.error("Timed out loading authenticated user profile data"),o(null),c(null);return}const[E,k]=A;o(E),c(k)}).catch(A=>{S||(console.error("Error loading authenticated user data:",A),o(null),c(null))}).finally(()=>{S||p(!1)}),()=>{S=!0}},[t==null?void 0:t.id,u]);const y=async(S,A,E,k)=>{const P=`${window.location.origin}/portal`,{error:R}=await Re.auth.signUp({email:S,password:A,options:{emailRedirectTo:P,data:{full_name:E,phone:k||null}}});return{error:R}},b=async(S,A)=>{const{error:E}=await Re.auth.signInWithPassword({email:S,password:A});return{error:E}},w=async()=>{await Re.auth.signOut(),n(null),a(null),o(null),c(null),p(!1)},j=!u||!!t&&f;return s.jsx(vH.Provider,{value:{user:t,session:r,userRole:i,profile:l,loading:j,signUp:y,signIn:b,signOut:w,refreshProfile:v},children:e})},bi=()=>{const e=x.useContext(vH);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e},yH=x.createContext(void 0),xpe=({children:e})=>{const[t,n]=x.useState(null),[r,a]=x.useState(!0),[i,o]=x.useState(null),[l,c]=x.useState(!1);x.useEffect(()=>{const{data:{subscription:h}}=Re.auth.onAuthStateChange(async(m,g)=>{var v,y,b,w;if(o(g),g){const j=(y=(v=g.user)==null?void 0:v.app_metadata)==null?void 0:y.admin_role,S=(w=(b=g.user)==null?void 0:b.app_metadata)==null?void 0:w.admin_id;j&&S?setTimeout(async()=>{try{const{data:A,error:E}=await Re.functions.invoke("admin-auth",{body:{action:"verify"}});!E&&(A!=null&&A.valid)?n(A.admin):n(null)}catch(A){console.error("Admin verification error:",A),n(null)}a(!1)},0):(n(null),a(!1))}else n(null),a(!1)});return Re.auth.getSession().then(async({data:{session:m}})=>{var g,v,y,b;if(o(m),m){const w=(v=(g=m.user)==null?void 0:g.app_metadata)==null?void 0:v.admin_role,j=(b=(y=m.user)==null?void 0:y.app_metadata)==null?void 0:b.admin_id;if(w&&j)try{const{data:S,error:A}=await Re.functions.invoke("admin-auth",{body:{action:"verify"}});!A&&(S!=null&&S.valid)&&n(S.admin)}catch(S){console.error("Admin session check error:",S)}}a(!1)}),()=>h.unsubscribe()},[]),x.useEffect(()=>{let h=!1;const m=async()=>{try{const{data:y}=await Re.auth.getSession(),b=y.session;if(!b||h)return;if((b.expires_at??0)*1e3-Date.now()<5*60*1e3){const{data:j}=await Re.auth.refreshSession();if(!h&&j.session){o(j.session);return}}h||o(j=>(j==null?void 0:j.access_token)===b.access_token?j:b)}catch(y){console.error("Admin session refresh error:",y)}},g=setInterval(m,60*1e3),v=()=>{document.visibilityState==="visible"&&m()};return document.addEventListener("visibilitychange",v),window.addEventListener("focus",m),m(),(
575)=>{h=!0,clearInterval(g),document.removeEventListener("visibilitychange",v),window.removeEventListener("focus",m)}},[]);const u=async(h,m)=>{var g;try{const{data:v,error:y}=await Re.functions.invoke("admin-auth",{body:{action:"login",username:h,password:m}});return y?{error:"Login failed. Please try again."}:v!=null&&v.error?{error:v.error}:(v!=null&&v.session&&(await Re.auth.setSession({access_token:v.session.access_token,refresh_token:v.session.refresh_token}),n(v.admin),o(v.session),(g=v.admin)!=null&&g.mustChangePassword&&c(!0)),{})}catch(v){return console.error("Login error:",v),{error:"An unexpected error occurred"}}},d=async()=>{try{await Re.functions.invoke("admin-auth",{body:{action:"logout"}})}catch(h){console.error("Logout error:",h)}await Re.auth.signOut(),n(null),o(null),c(!1)},f=async h=>{if(!i)return{error:"Not authenticated"};try{const{data:m,error:g}=await Re.functions.invoke("admin-auth",{body:{action:"change-password",password:h}});return g||m!=null&&m.error?{error:(m==null?void 0:m.error)||"Failed to change password"}:(c(!1),t&&n({...t,mustChangePassword:!1}),{})}catch(m){return console.error("Change password error:",m),{error:"An unexpected error occurred"}}},p=()=>{c(!1)};return s.jsx(yH.Provider,{value:{admin:t,loading:r,session:i,mustChangePassword:l,login:u,logout:d,changePassword:f,clearMustChangePassword:p},children:e})},bo=()=>{const e=x.useContext(yH);if(!e)throw new Error("useAdminAuth must be used within AdminAuthProvider");return e},hx=Tv("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),we=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?ese:"button";return s.jsx(o,{className:Ye(hx({variant:t,size:n,className:e})),ref:i,...a})});we.displayName="Button";var bpe=x.createContext(void 0);function jp(e){const t=x.useContext(bpe);return e||t||"ltr"}function xS(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Sp="NavigationMenu",[e3,xH,wpe]=Pv(Sp),[UC,_pe,jpe]=Pv(Sp),[t3,QJe]=ui(Sp,[wpe,jpe]),[Spe,Zo]=t3(Sp),[Npe,Ape]=t3(Sp),bH=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:a,defaultValue:i,delayDuration:o=200,skipDelayDuration:l=300,orientation:c="horizontal",dir:u,...d}=e,[f,p]=x.useState(null),h=sn(t,P=>p(P)),m=jp(u),g=x.useRef(0),v=x.useRef(0),y=x.useRef(0),[b,w]=x.useState(!0),[j,S]=vs({prop:r,onChange:P=>{const R=P!=="",C=l>0;R?(window.clearTimeout(y.current),C&&w(!1)):(window.clearTimeout(y.current),y.current=window.setTimeout(()=>w(!0),l)),a==null||a(P)},defaultProp:i??"",caller:Sp}),A=x.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>S(""),150)},[S]),E=x.useCallback(P=>{window.clearTimeout(v.current),S(P)},[S]),k=x.useCallback(P=>{j===P?window.clearTimeout(v.current):g.current=window.setTimeout(()=>{window.clearTimeout(v.current),S(P)},o)},[j,S,o]);return x.useEffect(()=>()=>{window.clearTimeout(g.current),window.clearTimeout(v.current),window.clearTimeout(y.current)},[]),s.jsx(wH,{scope:n,isRootMenu:!0,value:j,dir:m,orientation:c,rootNavigationMenu:f,onTriggerEnter:P=>{window.clearTimeout(g.current),b?k(P):E(P)},onTriggerLeave:()=>{window.clearTimeout(g.current),A()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:A,onItemSelect:P=>{S(R=>R===P?"":P)},onItemDismiss:()=>S(""),children:s.jsx(pt.nav,{"aria-label":"Main","data-orientation":c,dir:m,...d,ref:h})})});bH.displayName=Sp;var zC="NavigationMenuSub",kpe=x.forwardRef((e,t)=>
vendor: 4,369 bytes, line 575
575{const{__scopeNavigationMenu:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",...l}=e,c=Zo(zC,n),[u,d]=vs({prop:r,onChange:a,defaultProp:i??"",caller:zC});return s.jsx(wH,{scope:n,isRootMenu:!1,value:u,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:f=>d(f),onItemSelect:f=>d(f),onItemDismiss:()=>d(""),children:s.jsx(pt.div,{"data-orientation":o,...l,ref:t})})});kpe.displayName=zC;var wH=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:a,orientation:i,children:o,value:l,onItemSelect:c,onItemDismiss:u,onTriggerEnter:d,onTriggerLeave:f,onContentEnter:p,onContentLeave:h}=e,[m,g]=x.useState(null),[v,y]=x.useState(new Map),[b,w]=x.useState(null);return s.jsx(Spe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:l,previousValue:xS(l),baseId:Ga(),dir:a,orientation:i,viewport:m,onViewportChange:g,indicatorTrack:b,onIndicatorTrackChange:w,onTriggerEnter:Pr(d),onTriggerLeave:Pr(f),onContentEnter:Pr(p),onContentLeave:Pr(h),onItemSelect:Pr(c),onItemDismiss:Pr(u),onViewportContentChange:x.useCallback((j,S)=>{y(A=>(A.set(j,S),new Map(A)))},[]),onViewportContentRemove:x.useCallback(j=>{y(S=>S.has(j)?(S.delete(j),new Map(S)):S)},[]),children:s.jsx(e3.Provider,{scope:t,children:s.jsx(Npe,{scope:t,items:v,children:o})})})},_H="NavigationMenuList",jH=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,a=Zo(_H,n),i=s.jsx(pt.ul,{"data-orientation":a.orientation,...r,ref:t});return s.jsx(pt.div,{style:{position:"relative"},ref:a.onIndicatorTrackChange,children:s.jsx(e3.Slot,{scope:n,children:a.isRootMenu?s.jsx(RH,{asChild:!0,children:i}):i})})});jH.displayName=_H;var SH="NavigationMenuItem",[Epe,NH]=t3(SH),AH=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...a}=e,i=Ga(),o=r||i||"LEGACY_REACT_AUTO_VALUE",l=x.useRef(null),c=x.useRef(null),u=x.useRef(null),d=x.useRef(()=>{}),f=x.useRef(!1),p=x.useCallback((m="start")=>{if(l.current){d.current();const g=qC(l.current);g.length&&a3(m==="start"?g:g.reverse())}},[]),h=x.useCallback(()=>{if(l.current){const m=qC(l.current);m.length&&(d.current=Lpe(m))}},[]);return s.jsx(Epe,{scope:n,value:o,triggerRef:c,contentRef:l,focusProxyRef:u,wasEscapeCloseRef:f,onEntryKeyDown:p,onFocusProxyEnter:p,onRootContentClose:h,onContentFocusOutside:h,children:s.jsx(pt.li,{...a,ref:t})})});AH.displayName=SH;var WC="NavigationMenuTrigger",kH=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...a}=e,i=Zo(WC,e.__scopeNavigationMenu),o=NH(WC,e.__scopeNavigationMenu),l=x.useRef(null),c=sn(l,o.triggerRef,t),u=LH(i.baseId,o.value),d=MH(i.baseId,o.value),f=x.useRef(!1),p=x.useRef(!1),h=o.value===i.value;return s.jsxs(s.Fragment,{children:[s.jsx(e3.ItemSlot,{scope:n,value:o.value,children:s.jsx(IH,{asChild:!0,children:s.jsx(pt.button,{id:u,disabled:r,"data-disabled":r?"":void 0,"data-state":i3(h),"aria-expanded":h,"aria-controls":d,...a,ref:c,onPointerEnter:ht(e.onPointerEnter,()=>{p.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:ht(e.onPointerMove,l2(()=>{r||p.current||o.wasEscapeCloseRef.current||f.current||(i.onTriggerEnter(o.value),f.current=!0)})),onPointerLeave:ht(e.onPointerLeave,l2(()=>{r||(i.onTriggerLeave(),f.current=!1)})),onClick:ht(e.onClick,()=>{i.onItemSelect(o.value),p.current=h}),onKeyDown:ht(e.onKeyDown,m=>{const v={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];h&&m.key===v&&(o.onEntryKeyDown(),m.preventDefault())})})})}),h&&s.jsxs(s.Fragment,{children:[s.jsx(gW,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:m=>{const g=o.contentRef.current,v=m.relatedTarget,y=v===l.current,b=g==null?void 0:g.contains(v);(y||!b)&&o.onFocusProxyEnter(y?"start":"end")}}),i.viewport&&s.jsx("span",{"aria-owns":d})]})]})});kH.displayName=WC;var Cpe="NavigationMenuLink",LM="navigationMenu.linkSelect",EH=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:a,...i}=e;return s.jsx(IH,{asChild:!0,children:s.jsx(pt.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:t,onClick:ht(e.onClick,o=>{const l=o.target,c=new CustomEvent(LM,{bubbles:!0,cancelable:!0});if(l.addEventListener(LM,u=>a==null?void 0:a(u),{once:!0}),U_(l,c),!c.defaultPrevented&&!o.metaKey){const u=new CustomEvent(r_,{bubbles:!0,cancelable:!0});U_(l,u)}},{checkForDefaultPrevented:!1})})})});EH.displayName=Cpe;var n3="NavigationMenuIndicator",CH=x.forwardRef((e,t)=>
575{const{forceMount:n,...r}=e,a=Zo(n3,e.__scopeNavigationMenu),i=!!a.value;return a.indicatorTrack?uO.createPortal(s.jsx(Ka,{present:n||i,children:s.jsx(Ppe,{...r,ref:t})}),a.indicatorTrack):null});CH.displayName=n3;var Ppe=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,a=Zo(n3,n),i=xH(n),[o,l]=x.useState(null),[c,u]=x.useState(null),d=a.orientation==="horizontal",f=!!a.value;x.useEffect(()=>{var g;const m=(g=i().find(v=>v.value===a.value))==null?void 0:g.ref.current;m&&l(m)},[i,a.value]);const p=()=>{o&&u({size:d?o.offsetWidth:o.offsetHeight,offset:d?o.offsetLeft:o.offsetTop})};return VC(o,p),VC(a.indicatorTrack,p),c?s.jsx(pt.div,{"aria-hidden":!0,"data-state":f?"visible":"hidden","data-orientation":a.orientation,...r,ref:t,style:{position:"absolute",...d?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...r.style}}):null}),zg="NavigationMenuContent",PH=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Zo(zg,e.__scopeNavigationMenu),i=NH(zg,e.__scopeNavigationMenu),o=sn(i.contentRef,t),l=i.value===a.value,c={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return a.viewport?s.jsx(Tpe,{forceMount:n,...c,ref:o}):s.jsx(Ka,{present:n||l,children:s.jsx(TH,{"data-state":i3(l),...c,ref:o,onPointerEnter:ht(e.onPointerEnter,a.onContentEnter),onPointerLeave:ht(e.onPointerLeave,l2(a.onContentLeave)),style:{pointerEvents:!l&&a.isRootMenu?"none":void 0,...c.style}})})});PH.displayName=zg;var Tpe=x.forwardRef((e,t)=>{const n=Zo(zg,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:a}=n;return Xr(()=>{r(e.value,{ref:t,...e})},[e,t,r]),Xr(()=>()=>a(e.value),[e.value,a]),null}),r_="navigationMenu.rootContentDismiss",TH=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:a,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:l,onContentFocusOutside:c,...u}=e,d=Zo(zg,n),f=x.useRef(null),p=sn(f,t),h=LH(d.baseId,r),m=MH(d.baseId,r),g=xH(n),v=x.useRef(null),{onItemDismiss:y}=d;x.useEffect(()=>{const w=f.current;if(d.isRootMenu&&w){const j=()=>{var S;y(),l(),w.contains(document.activeElement)&&((S=a.current)==null||S.focus())};return w.addEventListener(r_,j),()=>w.removeEventListener(r_,j)}},[d.isRootMenu,e.value,a,y,l]);const b=x.useMemo(()=>{const j=g().map(R=>R.value);d.dir==="rtl"&&j.reverse();const S=j.indexOf(d.value),A=j.indexOf(d.previousValue),E=r===d.value,k=A===j.indexOf(r);if(!E&&!k)return v.current;const P=(()=>{if(S!==A){if(E&&A!==-1)return S>A?"from-end":"from-start";if(k&&S!==-1)return S>A?"to-start":"to-end"}return null})();return v.current=P,P},[d.previousValue,d.value,d.dir,g,r]);return s.jsx(RH,{asChild:!0,children:s.jsx(_p,{id:m,"aria-labelledby":h,"data-motion":b,"data-orientation":d.orientation,...u,ref:p,disableOutsidePointerEvents:!1,onDismiss:()=>{var j;const w=new Event(r_,{bubbles:!0,cancelable:!0});(j=f.current)==null||j.dispatchEvent(w)},onFocusOutside:ht(e.onFocusOutside,w=>{var S;c();const j=w.target;(S=d.rootNavigationMenu)!=null&&S.contains(j)&&w.preventDefault()}),onPointerDownOutside:ht(e.onPointerDownOutside,w=>{var E;const j=w.target,S=g().some(k=>{var P;return(P=k.ref.current)==null?void 0:P.contains(j)}),A=d.isRootMenu&&((E=d.viewport)==null?void 0:E.contains(j));(S||A||!d.isRootMenu)&&w.preventDefault()}),onKeyDown:ht(e.onKeyDown,w=>{var A;const j=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!j){const E=qC(w.currentTarget),k=document.activeElement,P=E.findIndex(I=>I===k),C=w.shiftKey?E.slice(0,P).reverse():E.slice(P+1,E.length);a3(C)?w.preventDefault():(A=i.current)==null||A.focus()}}),onEscapeKeyDown:ht(e.onEscapeKeyDown,w=>{o.current=!0})})})}),r3="NavigationMenuViewport",OH=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=!!Zo(r3,e.__scopeNavigationMenu).value;return s.jsx(Ka,{present:n||i,children:s.jsx(Ope,{...r,ref:t})})});OH.displayName=r3;var Ope=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...a}=e,i=Zo(r3,n),o=sn(t,i.onViewportChange),l=Ape(zg,e.__scopeNavigationMenu),[c,u]=x.useState(null),[d,f]=x.use
575State(null),p=c?(c==null?void 0:c.width)+"px":void 0,h=c?(c==null?void 0:c.height)+"px":void 0,m=!!i.value,g=m?i.value:i.previousValue;return VC(d,()=>{d&&u({width:d.offsetWidth,height:d.offsetHeight})}),s.jsx(pt.div,{"data-state":i3(m),"data-orientation":i.orientation,...a,ref:o,style:{pointerEvents:!m&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":p,"--radix-navigation-menu-viewport-height":h,...a.style},onPointerEnter:ht(e.onPointerEnter,i.onContentEnter),onPointerLeave:ht(e.onPointerLeave,l2(i.onContentLeave)),children:Array.from(l.items).map(([y,{ref:b,forceMount:w,...j}])=>{const S=g===y;return s.jsx(Ka,{present:w||S,children:s.jsx(TH,{...j,ref:rf(b,A=>{S&&A&&f(A)})})},y)})})}),Rpe="FocusGroup",RH=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,a=Zo(Rpe,n);return s.jsx(UC.Provider,{scope:n,children:s.jsx(UC.Slot,{scope:n,children:s.jsx(pt.div,{dir:a.dir,...r,ref:t})})})}),MM=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],Ipe="FocusGroupItem",IH=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,a=_pe(n),i=Zo(Ipe,n);return s.jsx(UC.ItemSlot,{scope:n,children:s.jsx(pt.button,{...r,ref:t,onKeyDown:ht(e.onKeyDown,o=>{if(["Home","End",...MM].includes(o.key)){let c=a().map(f=>f.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),MM.includes(o.key)){const f=c.indexOf(o.currentTarget);c=c.slice(f+1)}setTimeout(()=>a3(c)),o.preventDefault()}})})})});function qC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function a3(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function Lpe(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function VC(e,t){const n=Pr(t);Xr(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}function i3(e){return e?"open":"closed"}function LH(e,t){return`${e}-trigger-${t}`}function MH(e,t){return`${e}-content-${t}`}function l2(e){return t=>t.pointerType==="mouse"?e(t):void 0}var $H=bH,DH=jH,Mpe=AH,FH=kH,$pe=EH,BH=CH,UH=PH,zH=OH;const HC=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs($H,{ref:r,className:Ye("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,s.jsx(WH,{})]}));HC.displayName=$H.displayName;const GC=x.forwardRef(({className:e,...t},n)=>s.jsx(DH,{ref:n,className:Ye("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));GC.displayName=DH.displayName;const $M=Mpe,Dpe=Tv("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),YC=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(FH,{ref:r,className:Ye(Dpe(),"group",e),...n,children:[t," ",s.jsx(af,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));YC.displayName=FH.displayName;const KC=x.forwardRef(({className:e,...t},n)=>s.jsx(UH,{ref:n,className:Ye("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",e),...t}));KC.displayName=UH.displayName;const DM=$pe,WH=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:Ye("absolute left-1/2 -translate-x-1/2 top-full flex"),children:s.jsx(zH,{className:Ye("origin-top relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-[var(--radix-navigation-menu-viewport-width)] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90",e),ref:n,...t})}));WH.displayName=zH.displayName;const Fpe=x.forwardRef(({className:e,...t},n)=>s.jsx(BH,{ref:n,className:Ye("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:s.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));
575Fpe.displayName=BH.displayName;const Fs="/assets/star-logo-DHSQwuHw.png",FM=[{label:"HOME",path:"/"},{label:"FAQS",path:"/faqs"},{label:"WRITE A LETTER",path:"/write-a-letter"},{label:"CONTACT US",path:"/contact"},{label:"APPLY",path:"/apply"}],BM=[{label:"OUR MISSION",path:"/about#mission"},{label:"MEET THE BOARD",path:"/meet-the-board"},{label:"OUR IMPACT",path:"/our-impact"},{label:"EVENT GALLERY",path:"/event-gallery"}],UM=[{label:"SUCCESS STORIES",path:"/testimonials#success-stories"},{label:"STAR VOICES",path:"/star-voices"}],Bpe=()=>{const[e,t]=x.useState(!1),[n,r]=x.useState(!1),[a,i]=x.useState(!1),o=Ko(),l=o.pathname==="/about",c=o.pathname==="/testimonials";return s.jsx("header",{className:"bg-background shadow-sm sticky top-0 z-50",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsxs("div",{className:"flex items-center justify-between h-24",children:[s.jsx(an,{to:"/",className:"flex items-center",children:s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program, Inc.",className:"h-16 w-auto"})}),s.jsxs("nav",{className:"hidden lg:flex items-center gap-8",children:[s.jsx(an,{to:"/",className:`nav-link ${o.pathname==="/"?"nav-link-active":""}`,children:"HOME"}),s.jsx(HC,{children:s.jsx(GC,{children:s.jsxs($M,{children:[s.jsx(YC,{className:`!text-base !font-semibold !tracking-wider uppercase text-foreground hover:text-primary transition-colors bg-transparent hover:bg-transparent focus:bg-transparent data-[state=open]:bg-transparent p-0 h-auto [&>svg]:hidden ${l?"nav-link-active":""}`,onClick:u=>u.preventDefault(),children:"ABOUT US"}),s.jsx(KC,{className:"nav-dropdown",children:s.jsx("ul",{className:"flex flex-col py-1",children:BM.map(u=>s.jsx("li",{children:s.jsx(DM,{asChild:!0,children:s.jsx(an,{to:u.path,className:"nav-dropdown-item",children:u.label})})},u.path))})})]})})}),s.jsx(HC,{children:s.jsx(GC,{children:s.jsxs($M,{children:[s.jsx(YC,{className:`!text-base !font-semibold !tracking-wider uppercase text-foreground hover:text-primary transition-colors bg-transparent hover:bg-transparent focus:bg-transparent data-[state=open]:bg-transparent p-0 h-auto [&>svg]:hidden ${c?"nav-link-active":""}`,onClick:u=>u.preventDefault(),children:"TESTIMONIALS"}),s.jsx(KC,{className:"nav-dropdown",children:s.jsx("ul",{className:"flex flex-col py-1",children:UM.map(u=>s.jsx("li",{children:s.jsx(DM,{asChild:!0,children:s.jsx(an,{to:u.path,className:"nav-dropdown-item",children:u.label})})},u.path))})})]})})}),FM.slice(1).map(u=>u.disabled?s.jsx("span",{className:"nav-link opacity-50 cursor-not-allowed",children:u.label},u.path):s.jsx(an,{to:u.path,className:`nav-link ${o.pathname===u.path?"nav-link-active":""}`,children:u.label},u.path))]}),s.jsx("div",{className:"hidden lg:flex items-center",children:s.jsx("a",{href:"https://give.cornerstone.cc/starcsffw",target:"_blank",rel:"noopener noreferrer",children:s.jsx(we,{className:"donate-btn",children:"DONATE"})})}),s.jsx("button",{className:"lg:hidden p-2",onClick:()=>t(!e),children:e?s.jsx(yf,{className:"w-6 h-6"}):s.jsx(gO,{className:"w-6 h-6"})})]}),e&&s.jsxs("nav",{className:"lg:hidden py-4 border-t animate-fade-in",children:[s.jsx(an,{to:"/",className:`block py-3 px-4 nav-link ${o.pathname==="/"?"nav-link-active":""}`,onClick:()=>t(!1),children:"HOME"}),s.jsxs("div",{children:[s.jsxs("button",{onClick:()=>r(!n),className:`flex items-center justify-between w-full py-3 px-4 nav-link ${l?"nav-link-active":""}`,children:["ABOUT US",s.jsx(af,{className:`w-4 h-4 transition-transform ${n?"rotate-180":""}`})]}),n&&s.jsx("div",{className:"bg-muted/50",children:BM.map(u=>s.jsx(an,{to:u.path,className:"block py-2 px-8 text-sm font-medium text-muted-foreground hover:text-primary transition-colors",onClick:()=>{t(!1),r(!1)},children:u.label},u.path))})]}),s.jsxs("div",{children:[s.jsxs("button",{onClick:()=>i(!a),className:`flex items-center justify-between w-full py-3 px-4 nav-link ${c?"nav-link-active":""}`,children:["TESTIMONIALS",s.jsx(af,{className:`w-4 h-4 transition-transform ${a?"rotate-180":""}`})]}),a&&s.jsx("div",{className:"bg-muted/50",children:UM.map(u=>s.jsx(an,{to:u.path,className:"block py-2 px-8 text-sm font-medium text-muted-foreground hover:text-primary transition-colors",onClick:()=>{t(!1),i(!1)},children:u.label},u.path))})]}),FM.slice(1).map(u=>u.disabled?s.jsx("span",{className:"block py-3 px-4 nav-link opacity-50 cursor-not-allowed",children:u.label},u.path):s.jsx(an,{to:u.path,className:`block py-3 px-4 nav-link ${o.pathname===u.path?"nav-link-active":""}`,onClick:()=>t(!1),children:u.label},u.path)),s.jsx("div",{className:"pt-4 px-4",children:s.jsx("a",{href:"https://give.cornerstone.cc/starcsffw",target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),children:s.jsx(we,{className:"donate-btn w-full",children:"DONATE"})})})]})]})})},Upe=()=>s.jsx("footer",{className:"bg-primary text-primary-foreground py-12",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[s.jsxs("div",{children:[s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program, Inc.",className:"h-12 w-auto mb-4"}),s.jsx("p",{className:"text-sm opacity-90",children:"Success Through Academic Readiness"}),s.jsx("p",{className:"text-sm mt-4 opacity-80",children:"This is a private scholarship program for at-risk/lower income students whose parents want more for their child in education. Their local public school is not providing what their child needs to succeed. They commit to STAR program expectations of being on time, completing homework, respecting teachers and fellow students and working towards an honor roll report card."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-sans text-lg font-semibold mb-4",children:"Qu
575ick Links"}),s.jsxs("ul",{className:"space-y-2 text-sm",children:[s.jsx("li",{children:s.jsx(an,{to:"/about",className:"opacity-80 hover:opacity-100 transition-opacity",children:"About Us"})}),s.jsx("li",{children:s.jsx(an,{to:"/testimonials",className:"opacity-80 hover:opacity-100 transition-opacity",children:"Success Stories"})}),s.jsx("li",{children:s.jsx(an,{to:"/faqs",className:"opacity-80 hover:opacity-100 transition-opacity",children:"FAQs"})}),s.jsx("li",{children:s.jsx(an,{to:"/contact",className:"opacity-80 hover:opacity-100 transition-opacity",children:"Contact Us"})}),s.jsx("li",{children:s.jsx("a",{href:"https://give.cornerstone.cc/starcsffw",target:"_blank",rel:"noopener noreferrer",className:"opacity-80 hover:opacity-100 transition-opacity",children:"Donate"})}),s.jsx("li",{children:s.jsx(an,{to:"/admin-login",className:"opacity-80 hover:opacity-100 transition-opacity",children:"Admin Login"})})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-sans text-lg font-semibold mb-4",children:"Contact Us"}),s.jsxs("div",{className:"text-sm space-y-2 opacity-80",children:[s.jsx("p",{className:"font-bold",children:"Mailing Address:"}),s.jsx("p",{children:"P.O. Box 470949"}),s.jsx("p",{children:"Fort Worth, Texas 76147"}),s.jsx("p",{className:"mt-4",children:s.jsx("a",{href:"mailto:[email protected]",className:"hover:opacity-100",children:"[email protected]"})}),s.jsx("p",{children:s.jsx("a",{href:"tel:817-888-3255",className:"hover:opacity-100",children:"(817) 888-3255"})})]}),s.jsxs("div",{className:"flex gap-4 mt-6",children:[s.jsx("a",{href:"https://www.facebook.com/starsponsorshippgm/",target:"_blank",rel:"noopener noreferrer",className:"opacity-80 hover:opacity-100 transition-opacity",children:s.jsx(noe,{className:"w-5 h-5"})}),s.jsx("a",{href:"https://www.instagram.com/starsponsorship/?hl=en",target:"_blank",rel:"noopener noreferrer",className:"opacity-80 hover:opacity-100 transition-opacity",children:s.jsx(roe,{className:"w-5 h-5"})}),s.jsx("a",{href:"https://www.youtube.com/@starcsffw",target:"_blank",rel:"noopener noreferrer",className:"opacity-80 hover:opacity-100 transition-opacity",children:s.jsx(goe,{className:"w-5 h-5"})})]})]})]}),s.jsxs("div",{className:"border-t border-primary-foreground/20 mt-6 pt-4 text-center text-sm opacity-70",children:[s.jsxs("p",{children:["© ",new Date().getFullYear()," STAR Sponsorship Program, Inc. All rights reserved."]}),s.jsx("p",{className:"mt-2",children:"A 501(c)(3) nonprofit organization"})]})]})}),Xo=({children:e})=>s.jsxs("div",{className:"min-h-screen flex flex-col",children:[s.jsx(Bpe,{}),s.jsx("main",{className:"flex-1",children:e}),s.jsx(Upe,{})]}),zpe=8e3,qH=50,Wpe=qH/zpe*100,Ty=[{image:"/images/hero-students.jpg",title:`APPLICATIONS ARE CLOSED FOR 
5762026-2027`,tinted:!0,imageStyle:{objectPosition:"center 30%"}},{image:"/images/hero-event-gallery.jpg",title:"EVENT GALLERY — SHOWCASING OUR IMPACT",linkTo:"/event-gallery"},{image:"/images/why-donate.jpg",title:"MAKING A DIFFERENCE...ONE STUDENT AT A TIME",imageStyle:{objectPosition:"center 25%"}},{image:"/images/how-works.jpg",title:"SUCCESS THROUGH ACADEMIC READINESS"}],qpe=()=>{const[e,t]=x.useState(0),[n,r]=x.useState(0),[a,i]=x.useState(!1),[o,l]=x.useState(!1);x.useEffect(()=>{const f=window.matchMedia("(prefers-reduced-motion: reduce)");l(f.matches);const p=h=>l(h.matches);return f.addEventListener("change",p),()=>f.removeEventListener("change",p)},[]);const c=x.useCallback(()=>{t(f=>(f+1)%Ty.length),r(0)},[]),u=x.useCallback(()=>{t(f=>(f-1+Ty.length)%Ty.length),r(0)},[]),d=x.useCallback(f=>{t(f),r(0)},[]);return x.useEffect(()=>{if(a)return;const f=setInterval(()=>{r(p=>{const h=p+Wpe;return h>=100?(c(),0):h})},qH);return()=>clearInterval(f)},[e,a,c]),s.jsxs("div",{className:"relative h-[60vh] md:h-[80vh] overflow-hidden",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[Ty.map((f,p)=>s.jsxs("div",{className:`absolute inset-0 transition-opacity duration-1000 ${p===e?"opacity-100":"opacity-0"}`,children:[s.jsx("img",{src:f.image,alt:f.title,className:"w-full h-full object-cover",style:f.imageStyle}),f.tinted&&s.jsx("div",{className:"absolute inset-0 bg-red-900/15"}),s.jsx("div",{className:"hero-overlay pointer-events-none"}),"linkTo"in f&&f.linkTo?s.jsx(an,{to:f.linkTo,className:"hero-text-container group cursor-pointer",children:s.jsx("h2",{className:"hero-text group-hover:text-secondary transition-colors duration-300",children:f.title})}):s.jsx("div",{className:"hero-text-container",children:s.jsx("h2",{className:"hero-text",children:f.title})})]},p)),s.jsx("button",{onClick:u,className:"absolute left-4 top-1/2 -translate-y-1/2 z-50 bg-muted/80 hover:bg-muted p-3 rounded-full transition-colors",children:s.jsx(Sb,{className:"w-6 h-6 text-primary"})}),s.jsx("button",{onClick:c,className:"absolute right-4 top-1/2 -translate-y-1/2 z-50 bg-muted/80 hover:bg-muted p-3 rounded-full transition-colors",children:s.jsx(Ho,{className:"w-6 h-6 text-primary"})}),s.jsx("div",{className:"absolute bottom-6 left-1/2 -translate-x-1/2 flex gap-2 items-center z-20",children:Ty.map((f,p)=>{const h=p===e;return s.jsx("button",{onClick:()=>d(p),className:`h-3 rounded-full overflow-hidden cursor-pointer ${o?"":"transition-all duration-300 ease-in-out"}
576 ${h?"w-12 md:w-16 bg-primary-foreground/30":"w-3 bg-primary-foreground/50"}`,"aria-label":`Go to slide ${p+1}`,children:h&&s.jsx("div",{className:`h-full bg-secondary rounded-full ${o?"":"transition-[width] duration-[50ms] linear"}`,style:{width:`${n}%`}})},p)})})]})},Vpe=()=>s.jsx("section",{className:"section-padding bg-muted",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsx("div",{className:"max-w-5xl mx-auto",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-center",children:[s.jsx("div",{className:"aspect-video rounded-lg overflow-hidden shadow-lg",children:s.jsx("iframe",{src:"https://www.youtube.com/embed/ewV30zdsj_4",title:"STAR Sponsorship Program - Maria's Story",className:"w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),s.jsxs("div",{children:[s.jsx("h2",{className:"section-heading text-left mb-4",children:"Maria's Story"}),s.jsx("p",{className:"text-muted-foreground leading-relaxed",children:"Watch Maria's story to see how the STAR Sponsorship Program, Inc. impacted her future!"}),s.jsx("p",{className:"mt-4 text-muted-foreground leading-relaxed",children:"Through the support of generous donors, Maria was able to receive a quality education that set her on a path to success."})]})]})})})}),Hpe=[{image:"/images/why-star.jpg",title:"Why STAR?",description:"The Board of STAR Sponsorship Program, Inc. is committed to enhancing educational opportunities for children in Tarrant County whose parents lack the financial means to provide an education tailored to their children's unique needs.",link:"/about"},{image:"/images/why-donate.jpg",title:"Why Donate?",description:"Try as we might, we have been unable to meet the demand from parents eager to sacrifice to give their children a better education.",link:"https://give.cornerstone.cc/starcsffw",external:!0},{image:"/images/why-works.jpg",title:"Why Does The STAR Program Work?",description:"The STAR Sponsorship Program establishes a partnership between donors, schools, and parents. We act as the liaison among all parties to coordinate a pathway to success for children.",link:"/about"}],Gpe=()=>{const[e,t]=x.useState(new Set),n=x.useRef([]);return x.useEffect(()=>{const r=[];return n.current.forEach((a,i)=>{if(a){const o=new IntersectionObserver(l=>{l.forEach(c=>{c.isIntersecting&&(t(u=>new Set(u).add(i)),o.disconnect())})},{threshold:.3});o.observe(a),r.push(o)}}),()=>r.forEach(a=>a.disconnect())},[]),s.jsx("section",{className:"bg-background section-padding",children:s.jsx("div",{className:"container mx-auto px-4 max-w-5xl",children:s.jsx("div",{className:"flex flex-col gap-12",children:Hpe.map((r,a)=>s.jsx("div",{ref:i=>n.current[a]=i,className:"group overflow-hidden rounded-2xl shadow-sm",children:s.jsxs("div",{className:`flex flex-col md:grid md:grid-cols-2 ${a%2===1?"md:flex-row-reverse":""}`,children:[s.jsx("div",{className:`aspect-[4/3] overflow-hidden relative ${a%2===1?"md:order-2":""}`,children:s.jsx("img",{src:r.image,alt:r.title,className:"absolute inset-0 w-full h-full object-cover"})}),s.jsxs("div",{className:`aspect-[4/3] p-8 md:p-12 lg:p-16 flex flex-col items-center justify-center text-center bg-white ${a%2===1?"md:order-1":""}`,children:[s.jsx("h3",{className:"text-xl md:text-2xl lg:text-3xl font-display font-semibold text-primary",children:r.title}),s.jsxs("svg",{className:"w-56 h-4 mt-2 mb-5 overflow-visible",viewBox:"0 0 224 16",preserveAspectRatio:"none",children:[s.jsx("defs",{children:s.jsxs("filter",{id:`crayon-texture-${a}`,x:"-30%",y:"-30%",width:"160%",height:"160%",children:[s.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:"0.9",numOctaves:"5",result:"noise",seed:a*42}),s.jsx("feDisplacementMap",{in:"SourceGraphic",in2:"noise",scale:"5",xChannelSelector:"R",yChannelSelector:"G"})]})}),s.jsx("path",{d:"M2,12 Q56,11 112,9 Q168,7 222,5",fill:"none",stroke:a===0?"hsl(217, 91%, 55%)":a===1?"hsl(0, 75%, 55%)":"hsl(45, 93%, 50%)",strokeWidth:"6",strokeLinecap:"round",filter:`url(#crayon-texture-${a})`,strokeDasharray:"250",strokeDashoffset:e.has(a)?"0":"250",style:{transition:"stroke-dashoffset 0.8s ease-out",transitionDelay:"0.2s"}})]}),s.jsx("p",{className:"text-muted-foreground leading-relaxed mb-6 max-w-md",children:r.description}),r.external?s.jsx("a",{href:r.link,target:"_blank",rel:"noopener noreferrer",className:"font-bold uppercase tracking-wider text-sm px-5 py-3 rounded-full border border-secondary text-secondary bg-transparent hover:bg-secondary hover:text-white transition-all duration-300 ease-in-out text-center inline-flex items-center gap-2",children:"Learn More"}):s.jsx(an,{to:r.link,className:"font-bold uppercase tracking-wider text-sm px-5 py-3 rounded-full border border-secondary text-secondary bg-transparent hover:bg-secondary hover:text-white transition-all duration-300 ease-in-out text-center inline-flex items-center gap-2",children:"Learn More"})]})]})},a))})})})};function Ype(e){return Object.prototype.toString.call(e)==="[object Object]"}function zM(e){return Ype(e)||Array.isArray(e)}function Kpe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function s3(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const a=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return a!==i?!1:n.every(o=>{const l=e[o],c=t[o];return typeof l=="function"?`${l}`==`${c}`:!zM(l)||!zM(c)?l===c:s3(l,c)})}function WM(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function Zpe(e,t){if(e.length!==t.length)return!1;const n=WM(e),r=WM(t);return n.every((a,i)=>{const o=r[i];return s3(a,o)})}function o3(e){return typeof e=="number"}function ZC(e){return typeof e=="string"}function bS(e){return typeof e=="boolean"}function qM(e){return Object.prototype.toString.call(e)==="[object Object]"}function la(e){return Math.abs(e)}function l3(e){return Math.sign(e)}function N0(e,t){return la(e-t)}function Xpe(e,t){if(e===0||t===0||la(e)<=la(t))return 0;const n=N0(la(e),la(t));return la(n/e)}function Jpe(e){return Math.round(e*100)/100}function px(e){return mx(e).map(Number)}function kl(e){return e[Cb(e)]}function Cb(e){return Math.max(0,e.length-1)}function c3(e,t){return t===Cb(e)}
vendor: 14,437 bytes, line 576
576function VM(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function mx(e){return Object.keys(e)}function VH(e,t){return[e,t].reduce((n,r)=>(mx(r).forEach(a=>{const i=n[a],o=r[a],l=qM(i)&&qM(o);n[a]=l?VH(i,o):o}),n),{})}function XC(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function Qpe(e,t){const n={start:r,center:a,end:i};function r(){return 0}function a(c){return i(c)/2}function i(c){return t-c}function o(c,u){return ZC(e)?n[e](c):e(t,c,u)}return{measure:o}}function gx(){let e=[];function t(a,i,o,l={passive:!0}){let c;if("addEventListener"in a)a.addEventListener(i,o,l),c=()=>a.removeEventListener(i,o,l);else{const u=a;u.addListener(o),c=()=>u.removeListener(o)}return e.push(c),r}function n(){e=e.filter(a=>a())}const r={add:t,clear:n};return r}function eme(e,t,n,r){const a=gx(),i=1e3/60;let o=null,l=0,c=0;function u(){a.add(e,"visibilitychange",()=>{e.hidden&&m()})}function d(){h(),a.clear()}function f(v){if(!c)return;o||(o=v,n(),n());const y=v-o;for(o=v,l+=y;l>=i;)n(),l-=i;const b=l/i;r(b),c&&(c=t.requestAnimationFrame(f))}function p(){c||(c=t.requestAnimationFrame(f))}function h(){t.cancelAnimationFrame(c),o=null,l=0,c=0}function m(){o=null,l=0}return{init:u,destroy:d,start:p,stop:h,update:n,render:r}}function tme(e,t){const n=t==="rtl",r=e==="y",a=r?"y":"x",i=r?"x":"y",o=!r&&n?-1:1,l=d(),c=f();function u(m){const{height:g,width:v}=m;return r?g:v}function d(){return r?"top":n?"right":"left"}function f(){return r?"bottom":n?"left":"right"}function p(m){return m*o}return{scroll:a,cross:i,startEdge:l,endEdge:c,measureSize:u,direction:p}}function rp(e=0,t=0){const n=la(e-t);function r(u){return u<e}function a(u){return u>t}function i(u){return r(u)||a(u)}function o(u){return i(u)?r(u)?e:t:u}function l(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:o,reachedAny:i,reachedMax:a,reachedMin:r,removeOffset:l}}function HH(e,t,n){const{constrain:r}=rp(0,e),a=e+1;let i=o(t);function o(p){return n?la((a+p)%a):r(p)}function l(){return i}function c(p){return i=o(p),f}function u(p){return d().set(l()+p)}function d(){return HH(e,l(),n)}const f={get:l,set:c,add:u,clone:d};return f}function nme(e,t,n,r,a,i,o,l,c,u,d,f,p,h,m,g,v,y,b){const{cross:w,direction:j}=e,S=["INPUT","SELECT","TEXTAREA"],A={passive:!1},E=gx(),k=gx(),P=rp(50,225).constrain(h.measure(20)),R={mouse:300,touch:400},C={mouse:500,touch:600},I=m?43:25;let D=!1,U=0,q=0,Z=!1,H=!1,$=!1,W=!1;function ee(Q){if(!b)return;function ye(F){(bS(b)||b(Q,F))&&te(F)}const ie=t;E.add(ie,"dragstart",F=>F.preventDefault(),A).add(ie,"touchmove",()=>{},A).add(ie,"touchend",()=>{}).add(ie,"touchstart",ye).add(ie,"mousedown",ye).add(ie,"touchcancel",ce).add(ie,"contextmenu",ce).add(ie,"click",oe,!0)}function V(){E.clear(),k.clear()}function O(){const Q=W?n:t;k.add(Q,"touchmove",ne,A).add(Q,"touchend",ce).add(Q,"mousemove",ne,A).add(Q,"mouseup",ce)}function M(Q){const ye=Q.nodeName||"";return S.includes(ye)}function B(){return(m?C:R)[W?"mouse":"touch"]}function G(Q,ye){const ie=f.add(l3(Q)*-1),F=d.byDistance(Q,!m).distance;return m||la(Q)<P?F:v&&ye?F*.5:d.byIndex(ie.get(),0).distance}function te(Q){const ye=XC(Q,r);W=ye,$=m&&ye&&!Q.buttons&&D,D=N0(a.get(),o.get())>=2,!(ye&&Q.button!==0)&&(M(Q.target)||(Z=!0,i.pointerDown(Q),u.useFriction(0).useDuration(0),a.set(o),O(),U=i.readPoint(Q),q=i.readPoint(Q,w),p.emit("pointerDown")))}function ne(Q){if(!XC(Q,r)&&Q.touches.length>=2)return ce(Q);const ie=i.readPoint(Q),F=i.readPoint(Q,w),me=N0(ie,U),Ae=N0(F,q);if(!H&&!W&&(!Q.cancelable||(H=me>Ae,!H)))return ce(Q);const Ne=i.pointerMove(Q);me>g&&($=!0),u.useFriction(.3).useDuration(.75),l.start(),a.add(j(Ne)),Q.preventDefault()}function ce(Q){const ie=d.byDistance(0,!1).index!==f.get(),F=i.pointerUp(Q)*B(),me=G(j(F),ie),Ae=Xpe(F,me),Ne=I-10*Ae,ve=y+Ae/50;H=!1,Z=!1,k.clear(),u.useDuration(Ne).useFriction(ve),c.distance(me,!m),W=!1,p.emit("pointerUp")}function oe(Q){$&&(Q.stopPropagation(),Q.preventDefault(),$=!1)}function X(){return Z}return{init:ee,destroy:V,pointerDown:X}}function rme(e,t){let r,a;function i(f){return f.timeStamp}function o(f,p){const m=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(XC(f,t)?f:f.touches[0])[m]}function l(f){return r=f,a=f,o(f)}function c(f){const p=o(f)-o(a),h=i(f)-i(r)>170;return a=f,h&&(r=f),p}function u(f){if(!r||!a)return 0;const p=o(a)-o(r),h=i(f)-i(r),m=i(f)-i(a)>170,g=p/h;return h&&!m&&la(g)>.1?g:0}return{pointerDown:l,pointerMove:c,pointerUp:u,readPoint:o}}function ame(){function e(n){const{offsetTop:r,offsetLeft:a,offsetWidth:i,offsetHeight:o}=n;return{top:r,right:a+i,bottom:r+o,left:a,width:i,height:o}}return{measure:e}}function ime(e){function t(r){return e*(r/100)}return{measure:t}}function sme(e,t,n,r,a,i,o){const l=[e].concat(r);let c,u,d=[],f=!1;function p(v){return a.measureSize(o.measure(v))}function h(v){if(!i)return;u=p(e),d=r.map(p);function y(b){for(const w of b){if(f)return;const j=w.target===e,S=r.indexOf(w.target),A=j?u:d[S],E=p(j?e:r[S]);if(la(E-A)>=.5){v.reInit(),t.emit("resize");break}}}c=new ResizeObserver(b=>{(bS(i)||i(v,b))&&y(b)}),n.requestAnimationFrame(()=>{l.forEach(b=>c.observe(b))})}function m(){f=!0,c&&c.disconnect()}return{init:h,destroy:m}}function ome(e,t,n,r,a,i){let o=0,l=0,c=a,u=i,d=e.get(),f=0;function p(){const A=r.get()-e.get(),E=!c;let k=0;return E?(o=0,n.set(r),e.set(r),k=A):(n.set(e),o+=A/c,o*=u,d+=o,e.add(o),k=d-f),l=l3(k),f=d,S}function h(){const A=r.get()-t.get();return la(A)<.001}function m(){return c}function g(){return l}function v(){return o}function y(){return w(a)}function b(){return j(i)}function w(A){return c=A,S}function j(A){return u=A,S}const S={direction:g,duration:m,velocity:v,seek:p,settled:h,useBaseFriction:b,useBaseDuration:y,useFriction:j,useDuration:w};return S}function lme(e,t,n,r,a){const i=a.measure(10),o=a.measure(50),l=rp(.1,.99);let c=!1;function u(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function d(h){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",g=la(e[m]-t.get()),v=n.get()-t.get(),y=l.constrain(g/o);n.subtract(v*y),!h&&la(v)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function f(h){c=!h}return{shouldConstrain:u,constrain:d,toggleActive:f}}function cme(e,t,n,r,a){const i=rp(-t+e,0),o=f(),l=d(),c=p();function u(m,g){return N0(m,g)<=1}function d(){const m=o[0],g=kl(o),v=o.lastIndexOf(m),y=o.indexOf(g)+1;return rp(v,y)}function f(){return n.map((m,g)=>{const{min:v,max:y}=i,b=i.constrain(m),w=!g,j=c3(n,g);return w?y:j||u(v,b)?v:u(y,b)?y:b}).map(m=>parseFloat(m.toFixed(3)))}function p(){if(t<=e+a)return[i.max];if(r==="keepSnaps")return o;const{min:m,max:g}=l;return o.slice(m,g)}return{snapsContained:c,scrollContainLimit:l}}function ume(e,t,n){const r=t[0],a=n?r-e:kl(t);return{limit:rp(a,r)}}function dme(e,t,n,r){const i=t.min+.1,o=t.max+.1,{reachedMin:l,reachedMax:c}=rp(i,o);function u(p){return p===1?c(n.get()):p===-1?l(n.get()):!1}function d(p){if(!u(p))return;const h=e*(p*-1);r.forEach(m=>m.add(h))}return{loop:d}}function fme(e){const{max:t,length:n}=e;function r(i){const o=i-t;return n?o/-n:0}return{get:r}}function hme(e,t,n,r,a){const{startEdge:i,endEdge:o}=e,{groupSlides:l}=a,c=f().map(t.measure),u=p(),d=h();function f(){return l(r).map(g=>kl(g)[o]-g[0][i]).map(la)}function p(){return r.map(g=>n[i]-g[i]).map(g=>-la(g))}function h(){return l(u).map(g=>g[0]).map((g,v)=>g+c[v])}return{snaps:u,snapsAligned:d}}function pme(e,t,n,r,a,i){const{groupSlides:o}=a,{min:l,max:c}=r,u=d();function d(){const p=o(i),h=!e||t==="keepSnaps";return n.length===1?[i]:h?p:p.slice(l,c).map((m,g,v)=>{const y=!g,b=c3(v,g);if(y){const w=kl(v[0])+1;return VM(w)}if(b){const w=Cb(i)-kl(v)[0]+1;return VM(w,kl(v)[0])}return m})}return{slideRegistry:u}}function mme(e,t,n,r,a){const{reachedAny:i,removeOffset:o,constrain:l}=r;function c(m){return m.concat().sort((g,v)=>la(g)-la(v))[0]}function u(m){const g=e?o(m):l(m),v=t.map((b,w)=>({diff:d(b-g,0),index:w})).sort((b,w)=>la(b.diff)-la(w.diff)),{index:y}=v[0];return{index:y,distance:g}}function d(m,g){const v=[m,m+n,m-n];if(!e)return m;if(!g)return c(v);const y=v.filter(b=>l3(b)===g);return y.length?c(y):kl(v)-n}function f(m,g){const v=t[m]-a.get(),y=d(v,g);return{index:m,distance:y}}function p(m,g){const v=a.get()+m,{index:y,distance:b}=u(v),w=!e&&i(v);if(!g||w)return{index:y,distance:m};const j=t[y]-b,S=m+d(j,0);return{index:y,distance:S}}return{byDistance:p,byIndex:f,shortcut:d}}function gme(e,t,n,r,a,i,o){function l(f){const p=f.distance,h=f.index!==t.get();i.add(p),p&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),h&&(n.set(t.get()),t.set(f.index),o.emit("select"))}function c(f,p){const h=a.byDistance(f,p);l(h)}function u(f,p){const h=t.clone().set(f),m=a.byIndex(h.get(),p);l(m)}return{distance:c,index:u}}function vme(e,t,n,r,a,i,o,l){const c={passive:!0,capture:!0};let u=0;function d(h){if(!l)return;function m(g){if(new Date().getTime()-u>10)return;o.emit("slideFocusStart"),e.scrollLeft=0;const b=n.findIndex(w=>w.includes(g));o3(b)&&(a.useDuration(0),r.index(b,0),o.emit("slideFocus"))}i.add(document,"keydown",f,!1),t.forEach((g,v)=>{i.add(g,"focus",y=>{(bS(l)||l(h,y))&&m(v)},c)})}function f(h){h.code==="Tab"&&(u=new Date().getTime())}return{init:d}}function c0(e){let t=e;function n(){return t}function r(c){t=o(c)}function a(c){t+=o(c)}function i(c){t-=o(c)}function o(c){return o3(c)?c:c.get()}return{get:n,set:r,add:a,subtract:i}}function GH(e,t){const n=e.scroll==="x"?o:l,r=t.style;let a=null,i=!1;function o(p){return`translate3d(${p}px,0px,0px)`}function l(p){return`translate3d(0px,${p}px,0px)`}function c(p){if(i)return;const h=Jpe(e.direction(p));h!==a&&(r.transform=n(h),a=h)}function u(p){i=!p}function d(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:d,to:c,toggleActive:u}}function yme(e,t,n,r,a,i,o,l,c){const d=px(a),f=px(a).reverse(),p=y().concat(b());function h(E,k){return E.reduce((P,R)=>P-a[R],k)}function m(E,k){return E.reduce((P,R)=>h(P,k)>0?P.concat([R]):P,[])}function g(E){return i.map((k,P)=>({start:k-r[P]+.5+E,end:k+t-.5+E}))}function v(E,k,P){const R=g(k);return E.map(C=>{const I=P?0:-n,D=P?n:0,U=P?"end":"start",q=R[C][U];return{index:C,loopPoint:q,slideLocation:c0(-1),translate:GH(e,c[C]),target:()=>l.get()>q?I:D}})}function y(){const E=o[0],k=m(f,E);return v(k,n,!1)}function b(){const E=t-o[0]-1,k=m(d,E);return v(k,-n,!0)}function w(){return p.every(({index:E})=>{const k=d.filter(P=>P!==E);return h(k,t)<=.1})}function j(){p.forEach(E=>{const{target:k,translate:P,slideLocation:R}=E,C=k();C!==R.get()&&(P.to(C),R.set(C))})}function S(){p.forEach(E=>E.translate.clear())}return{canLoop:w,clear:S,loop:j,loopPoints:p}}function xme(e,t,n){let r,a=!1;function i(c){if(!n)return;function u(d){for(const f of d)if(f.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(d=>{a||(bS(n)||n(c,d))&&u(d)}),r.observe(e,{childList:!0})}function o(){r&&r.disconnect(),a=!0}return{init:i,destroy:o}}function bme(e,t,n,r){const a={};let i=null,o=null,l,c=!1;function u(){l=new IntersectionObserver(m=>{c||(m.forEach(g=>{const v=t.indexOf(g.target);a[v]=g}),i=null,o=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>l.observe(m))}function d(){l&&l.disconnect(),c=!0}function f(m){return mx(a).reduce((g,v)=>{const y=parseInt(v),{isIntersecting:b}=a[y];return(m&&b||!m&&!b)&&g.push(y),g},[])}function p(m=!0){if(m&&i)return i;if(!m&&o)return o;const g=f(m);return m&&(i=g),m||(o=g),g}return{init:u,destroy:d,get:p}}function wme(e,t,n,r,a,i){const{measureSize:o,startEdge:l,endEdge:c}=e,u=n[0]&&a,d=m(),f=g(),p=n.map(o),h=v();function m(){if(!u)return 0;const b=n[0];return la(t[l]-b[l])}function g(){if(!u)return 0;const b=i.getComputedStyle(kl(r));return parseFloat(b.getPropertyValue(`margin-${c}`))}function v(){return n.map((b,w,j)=>{const S=!w,A=c3(j,w);return S?p[w]+d:A?p[w]+f:j[w+1][l]-b[l]}).map(la)}return{slideSizes:p,slideSizesWithGaps:h,startGap:d,endGap:f}}function _me(e,t,n,r,a,i,o,l,c){const{startEdge:u,endEdge:d,direction:f}=e,p=o3(n);function h(y,b){return px(y).filter(w=>w%b===0).map(w=>y.slice(w,w+b))}function m(y){return y.length?px(y).reduce((b,w,j)=>{const S=kl(b)||0,A=S===0,E=w===Cb(y),k=a[u]-i[S][u],P=a[u]-i[w][d],R=!r&&A?f(o):0,C=!r&&E?f(l):0,I=la(P-C-(k+R));return j&&I>t+c&&b.push(w),E&&b.push(y.length),b},[]).map((b,w,j)=>{const S=Math.max(j[w-1]||0);return y.slice(S,b)}):[]}function g(y){return p?h(y,n):m(y)}return{groupSlides:g}}function jme(e,t,n,r,a,i,o){const{align:l,axis:c,direction:u,startIndex:d,loop:f,duration:p,dragFree:h,dragThreshold:m,inViewThreshold:g,slidesToScroll:v,skipSnaps:y,containScroll:b,watchResize:w,watchSlides:j,watchDrag:S,watchFocus:A}=i,E=2,k=ame(),P=k.measure(t),R=n.map(k.measure),C=tme(c,u),I=C.measureSize(P),D=ime(I),U=Qpe(l,I),q=!f&&!!b,Z=f||!!b,{slideSizes:H,slideSizesWithGaps:$,startGap:W,endGap:ee}=wme(C,P,R,n,Z,a),V=_me(C,I,v,f,P,R,W,ee,E),{snaps:O,snapsAligned:M}=hme(C,U,P,R,V),B=-kl(O)+kl($),{snapsContained:G,scrollContainLimit:te}=cme(I,B,M,b,E),ne=q?G:M,{limit:ce}=ume(B,ne,f),oe=HH(Cb(ne),d,f),X=oe.clone(),se=px(n),Q=({dragHandler:ut,scrollBody:Fe,scrollBounds:It,options:{loop:zt}})=>{zt||It.constrain(ut.pointerDown()),Fe.seek()},ye=({scrollBody:ut,translate:Fe,location:It,offsetLocation:zt,previousLocation:Wt,scrollLooper:Jt,slideLooper:Un,dragHandler:Pt,animation:Tn,eventHandler:Lt,scrollBounds:Vt,options:{loop:Mn}},nn)=>{const yt=ut.settled(),hn=!Vt.shouldConstrain(),Mt=Mn?yt:yt&&hn,Ht=Mt&&!Pt.pointerDown();Ht&&Tn.stop();const je=It.get()*nn+Wt.get()*(1-nn);zt.set(je),Mn&&(Jt.loop(ut.direction()),Un.loop()),Fe.to(zt.get()),Ht&&Lt.emit("settle"),Mt||Lt.emit("scroll")},ie=eme(r,a,()=>Q(ct),ut=>ye(ct,ut)),F=.68,me=ne[oe.get()],Ae=c0(me),Ne=c0(me),ve=c0(me),pe=c0(me),Pe=ome(Ae,ve,Ne,pe,p,F),Ee=mme(f,ne,B,ce,pe),Ie=gme(ie,oe,X,Pe,Ee,pe,o),Me=fme(ce),tt=gx(),De=bme(t,n,o,g),{slideRegistry:Qe}=pme(q,b,ne,te,V,se),vt=vme(e,n,Qe,Ie,Pe,tt,o,A),ct={ownerDocument:r,ownerWindow:a,eventHandler:o,containerRect:P,slideRects:R,animation:ie,axis:C,dragHandler:nme(C,e,r,a,pe,rme(C,a),Ae,ie,Ie,Pe,Ee,oe,o,D,h,m,y,F,S),eventStore:tt,percentOfView:D,index:oe,indexPrevious:X,limit:ce,location:Ae,offsetLocation:ve,previousLocation:Ne,options:i,resizeHandler:sme(t,o,a,n,C,w,k),scrollBody:Pe,scrollBounds:lme(ce,ve,pe,Pe,D),scrollLooper:dme(B,ce,ve,[Ae,ve,Ne,pe]),scrollProgress:Me,scrollSnapList:ne.map(Me.get),scrollSnaps:ne,scrollTarget:Ee,scrollTo:Ie,slideLooper:yme(C,I,B,H,$,O,ne,ve,
vendor: 4,490 bytes, line 576
576n),slideFocus:vt,slidesHandler:xme(t,o,j),slidesInView:De,slideIndexes:se,slideRegistry:Qe,slidesToScroll:V,target:pe,translate:GH(C,t)};return ct}function Sme(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function a(u){return r(u).forEach(d=>d(t,u)),c}function i(u,d){return e[u]=r(u).concat([d]),c}function o(u,d){return e[u]=r(u).filter(f=>f!==d),c}function l(){e={}}const c={init:n,emit:a,off:o,on:i,clear:l};return c}const Nme={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Ame(e){function t(i,o){return VH(i,o||{})}function n(i){const o=i.breakpoints||{},l=mx(o).filter(c=>e.matchMedia(c).matches).map(c=>o[c]).reduce((c,u)=>t(c,u),{});return t(i,l)}function r(i){return i.map(o=>mx(o.breakpoints||{})).reduce((o,l)=>o.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function kme(e){let t=[];function n(i,o){return t=o.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(i,e)),o.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function c2(e,t,n){const r=e.ownerDocument,a=r.defaultView,i=Ame(a),o=kme(i),l=gx(),c=Sme(),{mergeOptions:u,optionsAtMedia:d,optionsMediaQueries:f}=i,{on:p,off:h,emit:m}=c,g=C;let v=!1,y,b=u(Nme,c2.globalOptions),w=u(b),j=[],S,A,E;function k(){const{container:se,slides:Q}=w;A=(ZC(se)?e.querySelector(se):se)||e.children[0];const ie=ZC(Q)?A.querySelectorAll(Q):Q;E=[].slice.call(ie||A.children)}function P(se){const Q=jme(e,A,E,r,a,se,c);if(se.loop&&!Q.slideLooper.canLoop()){const ye=Object.assign({},se,{loop:!1});return P(ye)}return Q}function R(se,Q){v||(b=u(b,se),w=d(b),j=Q||j,k(),y=P(w),f([b,...j.map(({options:ye})=>ye)]).forEach(ye=>l.add(ye,"change",C)),w.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(X),y.eventHandler.init(X),y.resizeHandler.init(X),y.slidesHandler.init(X),y.options.loop&&y.slideLooper.loop(),A.offsetParent&&E.length&&y.dragHandler.init(X),S=o.init(X,j)))}function C(se,Q){const ye=V();I(),R(u({startIndex:ye},se),Q),c.emit("reInit")}function I(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),o.destroy(),l.clear()}function D(){v||(v=!0,l.clear(),I(),c.emit("destroy"),c.clear())}function U(se,Q,ye){!w.active||v||(y.scrollBody.useBaseFriction().useDuration(Q===!0?0:w.duration),y.scrollTo.index(se,ye||0))}function q(se){const Q=y.index.add(1).get();U(Q,se,-1)}function Z(se){const Q=y.index.add(-1).get();U(Q,se,1)}function H(){return y.index.add(1).get()!==V()}function $(){return y.index.add(-1).get()!==V()}function W(){return y.scrollSnapList}function ee(){return y.scrollProgress.get(y.offsetLocation.get())}function V(){return y.index.get()}function O(){return y.indexPrevious.get()}function M(){return y.slidesInView.get()}function B(){return y.slidesInView.get(!1)}function G(){return S}function te(){return y}function ne(){return e}function ce(){return A}function oe(){return E}const X={canScrollNext:H,canScrollPrev:$,containerNode:ce,internalEngine:te,destroy:D,off:h,on:p,emit:m,plugins:G,previousScrollSnap:O,reInit:g,rootNode:ne,scrollNext:q,scrollPrev:Z,scrollProgress:ee,scrollSnapList:W,scrollTo:U,selectedScrollSnap:V,slideNodes:oe,slidesInView:M,slidesNotInView:B};return R(t,n),setTimeout(()=>c.emit("init"),0),X}c2.globalOptions=void 0;function u3(e={},t=[]){const n=x.useRef(e),r=x.useRef(t),[a,i]=x.useState(),[o,l]=x.useState(),c=x.useCallback(()=>{a&&a.reInit(n.current,r.current)},[a]);return x.useEffect(()=>{s3(n.current,e)||(n.current=e,c())},[e,c]),x.useEffect(()=>{Zpe(r.current,t)||(r.current=t,c())},[t,c]),x.useEffect(()=>{if(Kpe()&&o){c2.globalOptions=u3.globalOptions;const u=c2(o,n.current,r.current);return i(u),()=>u.destroy()}else i(void 0)},[o,i]),[l,a]}u3.globalOptions=void 0;const YH=x.createContext(null);function wS(){const e=x.useContext(YH);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const KH=x.forwardRef(({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:a,children:i,...o},l)=>{const[c,u]=u3({...t,axis:e==="horizontal"?"x":"y"}
576,r),[d,f]=x.useState(!1),[p,h]=x.useState(!1),m=x.useCallback(b=>{b&&(f(b.canScrollPrev()),h(b.canScrollNext()))},[]),g=x.useCallback(()=>{u==null||u.scrollPrev()},[u]),v=x.useCallback(()=>{u==null||u.scrollNext()},[u]),y=x.useCallback(b=>{b.key==="ArrowLeft"?(b.preventDefault(),g()):b.key==="ArrowRight"&&(b.preventDefault(),v())},[g,v]);return x.useEffect(()=>{!u||!n||n(u)},[u,n]),x.useEffect(()=>{if(u)return m(u),u.on("reInit",m),u.on("select",m),()=>{u==null||u.off("select",m)}},[u,m]),s.jsx(YH.Provider,{value:{carouselRef:c,api:u,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:g,scrollNext:v,canScrollPrev:d,canScrollNext:p},children:s.jsx("div",{ref:l,onKeyDownCapture:y,className:Ye("relative",a),role:"region","aria-roledescription":"carousel",...o,children:i})})});KH.displayName="Carousel";const ZH=x.forwardRef(({className:e,...t},n)=>{const{carouselRef:r,orientation:a}=wS();return s.jsx("div",{ref:r,className:"overflow-x-hidden overflow-y-visible",children:s.jsx("div",{ref:n,className:Ye("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})});ZH.displayName="CarouselContent";const XH=x.forwardRef(({className:e,...t},n)=>{const{orientation:r}=wS();return s.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:Ye("min-w-0 shrink-0 grow-0 basis-full",r==="horizontal"?"pl-4":"pt-4",e),...t})});XH.displayName="CarouselItem";const JH=x.forwardRef(({className:e,variant:t="outline",size:n="icon",...r},a)=>{const{orientation:i,scrollPrev:o,canScrollPrev:l}=wS();return s.jsxs(we,{ref:a,variant:t,size:n,className:Ye("absolute h-8 w-8 rounded-full",i==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:o,...r,children:[s.jsx(Og,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Previous slide"})]})});JH.displayName="CarouselPrevious";const QH=x.forwardRef(({className:e,variant:t="outline",size:n="icon",...r},a)=>{const{orientation:i,scrollNext:o,canScrollNext:l}=wS();return s.jsxs(we,{ref:a,variant:t,size:n,className:Ye("absolute h-8 w-8 rounded-full",i==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:o,...r,children:[s.jsx(Rg,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Next slide"})]})});QH.displayName="CarouselNext";const Eme=[{name:"ALEX",school:"TEXAS WESLEYAN UNIVERSITY",image:"/images/alex.jpg",slug:"alex"},{name:"ISAIAS",school:"UNIVERSITY OF TEXAS AT ARLINGTON",image:"/images/isaias.jpg",slug:"isaias"},{name:"MAGAN",school:"TEXAS WOMAN'S UNIVERSITY-DENTON",image:"/images/magan.jpg",slug:"magan"},{name:"COLLINS",school:"UNIVERSITY OF ROCHESTER-MONROE, NY",image:"/images/collins.jpg",slug:"collins"},{name:"SERGIO",school:"LIBERTY UNIVERSITY",image:"/images/sergio.jpg",slug:"sergio"},{name:"CARLY",school:"UNIVERSITY OF TEXAS AT ARLINGTON",image:"/images/carly.jpg",slug:"carly"}],Cme=()=>s.jsx("section",{className:"section-padding bg-background",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsx("div",{className:"flex justify-center mb-12 overflow-hidden",children:s.jsxs("div",{className:"px-20 md:px-32 relative group",style:{WebkitMaskImage:"linear-gradient(to right, transparent, black 20%, black 80%, transparent)",maskImage:"linear-gradient(to right, transparent, black 20%, black 80%, transparent)"},children:[s.jsx(an,{to:"/testimonials",className:"section-heading !mb-0 hover:text-secondary transition-colors duration-300",children:"SUCCESS STORIES"}),s.jsx("span",{className:"absolute top-1/2 -translate-y-1/2 left-0 -translate-x-full opacity-0 group-hover:left-full group-hover:translate-x-0 group-hover:opacity-100 transition-all duration-1000 ease-in-out pointer-events-none z-20 text-2xl md:text-3xl",style:{filter:"drop-shadow(0 0 6px hsl(45, 93%, 50%)) drop-shadow(0 0 12px hsl(45, 93%, 60%))"},children:s.jsxs("span",{className:"relative",children:["★",s.jsx("span",{className:"absolute top-1/2 right-full -translate-y-1/2 w-6 md:w-10 h-[2px] bg-gradient-to-l from-secondary to-transparent"}),s.jsx("span",{className:"absolute top-[calc(50%-3px)] right-[calc(100%+2px)] w-4 md:w-6 h-[1px] bg-gradient-to-l from-secondary/60 to-transparent rotate-[8deg]"}),s.jsx("span",{className:"absolute top-[calc(50%+3px)] right-[calc(100%+2px)] w-4 md:w-6 h-[1px] bg-gradient-to-l from-secondary/60 to-transparent -rotate-[8deg]"})]})})]})}),s.jsx("div",{className:"relative px-12",children:s.jsxs(KH,{opts:{align:"start",loop:!0},className:"w-full",children:[s.jsx(ZH,{className:"-ml-4 py-2",children:Eme.map((e,t)=>s.jsx(XH,{className:"pl-4 basis-full sm:basis-1/2 lg:basis-1/4",children:s.jsx(an,{to:`/testimonials#${e.slug}`,className:"group block",children:s.jsxs("div",{className:"card-hover rounded-lg overflow-hidden shadow-md bg-card",children:[s.jsx("div",{className:"aspect-[3/4] overflow-hidden",children:s.jsx("img",{src:e.image,alt:e.name,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}),s.jsxs("div",{className:"p-3 text-center h-16 flex flex-col items-center justify-center",children:[s.jsx("h3",{className:"font-display font-semibold text-primary text-sm",children:e.name}),s.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-tight",children:e.school})]})]})})},t))}),s.jsx(JH,{className:"left-0"}),s.jsx(QH,{className:"right-0"})]})})]})}),Pme=()=>s.jsxs(Xo,{children:[s.jsx(qpe,{}),s.jsx(Vpe,{}),s.jsx(Gpe,{}),s.jsx(Cme,{})]}),Sc=({image:e,title:t,imageStyle:n})=>s.jsxs("div",{className:"relative h-[50vh] md:h-[60vh]",children:[s.jsx("img",{src:e,alt:t,className:"w-full h-full object-cover",style:n}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-primary/60 to-transparent"}),s.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-8",children:s.jsx("div",{className:"container mx-auto",children:s.jsx("h1",{className:"text-[34px] md:text-[52px] font-display font-semibold text-primary-foreground leading-[1.15] tracking-[-0.5px]",children:t})})})]}),Tme=()=>s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/about-hero.jpg?v=2",title:"ABOUT STAR",imageStyle:{objectPosition:"center 50%"}}),s.jsx("section",{className:"section-padding bg-background",children:s.jsxs("div",{className:"container mx-auto px-4 max-w-4xl",children:[s.jsx("h2",{className:"section-heading mb-8",children:"HISTORY & MISSION"}),s.jsxs("div",{className:"prose prose-lg max-w-none text-muted-foreground",children:[s.jsxs("p",{className:"leading-relaxed mb-6",children:["The ",s.jsx("em",{children:"STAR"})," (Success Through Academic Readiness) ",s.jsx("em",{children:"Sponsorship Program, Inc."})," was founded in 1993 by a group of compassionate business and community leaders with the desire to provide a choice in education for low-income children. In the fall of 1998, STAR expanded by partnering with a national effort called the ",s.jsx("em",{children:"Children's Scholarship Fund"}),"."]}),s.jsx("p",{className:"leading-relaxed mb-6",children:"The founders believe every child hungers for knowledge. Elementary schools can satisfy this hunger for learning. Children learn values at an early age; therefore, it is crucial that fundamentals are established in their primary years of life. Schools challenge children to reach their potential and help prepare them for the future."}),s.jsx("p",{className:"leading-relaxed mb-6",children:"The STAR Sponsorship Program, Inc. uniquely offers this opportunity. We provide the financial means in Tarrant County for low-income parents to choose a better fit for their child. We partner with the parents in the process, thereby establishing a link that ties children, parents, schools, and communities together."})]})]})}),s.jsx("section",{className:"section-padding bg-muted",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center max-w-5xl mx-auto",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold text-primary mb-6",children:"HOW THE PROGRAM WORKS"}),s.jsxs("div",{className:"text-muted-foreground space-y-4",children:[s.jsx("p",{children:"The STAR Sponsorship Program, Inc. teams a child with a sponsor to give the child an opportunity for a better education. Our sponsors believe in the importance of a good education and invest in the future by sponsoring a child."}),s.jsx("p",{children:"STAR students correspond with their sponsor by sending letters, artwork, schoolwork, and photographs, and they strive for A Honor Roll. STAR monitors each child's academic journey and updates the donors through quarterly report cards."})]})]}),s.jsx("div",{className:"rounded-lg overflow-hidden shadow-lg",children:s.jsx("img",{src:"/images/how-works.jpg",alt:"Children in classroom",className:"w-full h-full object-cover"})})]})})}),s.jsx("section",{className:"section-padding bg-background",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center max-w-5xl mx-auto",children:[s.jsx("div",{className:"order-2 md:order-1 rounded-lg overflow-hidden shadow-lg",children:s.jsx("img",{src:"/images/program-works.jpg",alt:"Children playing",className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"order-1 md:order-2",children:[s.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold text-primary mb-6",children:"WHERE DO WE GET THE STAR STUDENTS?"}),s.jsxs("div",{className:"text-muted-foreground space-y-4",children:[s.jsx("p",{children:"Oftentimes, parents will call due to word-of-mouth recommendations or their own research. Schools also recommend students."}),s.jsx("p",{children:"Each STAR student, with the help of the family, must be willing to put forth the extra effort needed to meet the program requirements. Parents apply annually. A teacher/principal recommendation, most recent report card, and financial documentation are also required."})]})]})]})})}),s.jsx("section",{className:"py-8 md:py-12 bg-muted text-foreground",children:s.jsxs("div",{className:"container mx-auto px-4 max-w-4xl",children:[s.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-6 text-center",children:"How STAR Is Funded"}),s.jsxs("div",{className:"opacity-90 leading-relaxed space-y-4",children:[s.jsx("p",{children:"STAR is funded through a diversified mix of individual donors, foundations, and corporate partners, with strong and growing support from North Texas philanthropic organizations."}),s.jsx("p",{children:"Foundation and trust funding represents a significant and stable source of support, aligned closely with STAR's mission and long-term sustainability."}),s.jsx("h3",{className:"text-xl font-display font-semibold mt-8 mb-3",children:"Foundation Partnerships"}),s.jsx("p",{children:"STAR has been especially effective in securing foundation support through board member-to-board member relationships, strengthening trust and long-term engagement."}),s.jsx("p",{children:"Key foundation partners include:"}),s.jsxs("ul",{className:"list-disc list-inside space-y-1 pl-2",children:[s.jsx("li",{children:"The Miles Foundation"}),s.jsx("li",{children:"Amon G. Carter Foundation"}),s.jsx("li",{children:"Sid W. Richardson Foundation"}),s.jsx("li",{children:"Capital for Kids"}),s.jsx("li",{children:"The Ryan Foundation"})]}),s.jsx("p",{className:"mt-4",children:"To strengthen and grow this support, STAR maintains ongoing communication, reporting, and strategic planning with key foundations. We regularly share measurable impact data demonstrating how STAR helps close the achievement gap in Tarrant County and invite foundation leaders to engage more deeply — including opportunities to serve on the STAR Board."})]})]})}),s.jsx("div",{className:"h-12 bg-background"})]}),eG=({end:e,duration:t=2e3,prefix:n="",suffix:r="",decimals:a=0})=>{const[i,o]=x.useState(0),[l,c]=x.useState(!1),[u,d]=x.useState(!1),f=x.useRef(null);x.useEffect(()=>{const h=new IntersectionObserver(m=>{m.forEach(g=>{g.isIntersecting&&!u&&(c(!0),d(!0),h.disconnect())})},{threshold:.3});return f.current&&h.observe(f.current),()=>h.disconnect()},[u]),x.useEffect(()=>{if(!l)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){o(e);return}let m,g;const v=b=>1-Math.pow(1-b,4),y=b=>{m||(m=b);const w=b-m,j=Math.min(w/t,1),S=v(j),A=Math.floor(S*e);o(A),j<1?g=requestAnimationFrame(y):o(e)};return g=requestAnimationFrame(y),()=>{g&&cancelAnimationFrame(g)}},[l,e,t]);const p=`${n}
576${i.toLocaleString(void 0,{minimumFractionDigits:a,maximumFractionDigits:a})}${r}`;return{ref:f,value:p,rawValue:i}};var Ome=Array.isArray,Us=Ome,Rme=typeof ec=="object"&&ec&&ec.Object===Object&&ec,tG=Rme,Ime=tG,Lme=typeof self=="object"&&self&&self.Object===Object&&self,Mme=Ime||Lme||Function("return this")(),Nc=Mme,$me=Nc,Dme=$me.Symbol,Pb=Dme,HM=Pb,nG=Object.prototype,Fme=nG.hasOwnProperty,Bme=nG.toString,Oy=HM?HM.toStringTag:void 0;function Ume(e){var t=Fme.call(e,Oy),n=e[Oy];try{e[Oy]=void 0;var r=!0}catch{}var a=Bme.call(e);return r&&(t?e[Oy]=n:delete e[Oy]),a}var zme=Ume,Wme=Object.prototype,qme=Wme.toString;function Vme(e){return qme.call(e)}var Hme=Vme,GM=Pb,Gme=zme,Yme=Hme,Kme="[object Null]",Zme="[object Undefined]",YM=GM?GM.toStringTag:void 0;function Xme(e){return e==null?e===void 0?Zme:Kme:YM&&YM in Object(e)?Gme(e):Yme(e)}var Tu=Xme;function Jme(e){return e!=null&&typeof e=="object"}var Ou=Jme,Qme=Tu,ege=Ou,tge="[object Symbol]";function nge(e){return typeof e=="symbol"||ege(e)&&Qme(e)==tge}var Uv=nge,rge=Us,age=Uv,ige=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sge=/^\w*$/;function oge(e,t){if(rge(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||age(e)?!0:sge.test(e)||!ige.test(e)||t!=null&&e in Object(t)}var d3=oge;function lge(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var _f=lge;const zv=mr(_f);var cge=Tu,uge=_f,dge="[object AsyncFunction]",fge="[object Function]",hge="[object GeneratorFunction]",pge="[object Proxy]";function mge(e){if(!uge(e))return!1;var t=cge(e);return t==fge||t==hge||t==dge||t==pge}var f3=mge;
vendor: 4,430 bytes, line 576
576const _n=mr(f3);var gge=Nc,vge=gge["__core-js_shared__"],yge=vge,_A=yge,KM=function(){var e=/[^.]+$/.exec(_A&&_A.keys&&_A.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function xge(e){return!!KM&&KM in e}var bge=xge,wge=Function.prototype,_ge=wge.toString;function jge(e){if(e!=null){try{return _ge.call(e)}catch{}try{return e+""}catch{}}return""}var rG=jge,Sge=f3,Nge=bge,Age=_f,kge=rG,Ege=/[\\^$.*+?()[\]{}|]/g,Cge=/^\[object .+?Constructor\]$/,Pge=Function.prototype,Tge=Object.prototype,Oge=Pge.toString,Rge=Tge.hasOwnProperty,Ige=RegExp("^"+Oge.call(Rge).replace(Ege,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Lge(e){if(!Age(e)||Nge(e))return!1;var t=Sge(e)?Ige:Cge;return t.test(kge(e))}var Mge=Lge;function $ge(e,t){return e==null?void 0:e[t]}var Dge=$ge,Fge=Mge,Bge=Dge;function Uge(e,t){var n=Bge(e,t);return Fge(n)?n:void 0}var Np=Uge,zge=Np,Wge=zge(Object,"create"),_S=Wge,ZM=_S;function qge(){this.__data__=ZM?ZM(null):{},this.size=0}var Vge=qge;function Hge(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Gge=Hge,Yge=_S,Kge="__lodash_hash_undefined__",Zge=Object.prototype,Xge=Zge.hasOwnProperty;function Jge(e){var t=this.__data__;if(Yge){var n=t[e];return n===Kge?void 0:n}return Xge.call(t,e)?t[e]:void 0}var Qge=Jge,eve=_S,tve=Object.prototype,nve=tve.hasOwnProperty;function rve(e){var t=this.__data__;return eve?t[e]!==void 0:nve.call(t,e)}var ave=rve,ive=_S,sve="__lodash_hash_undefined__";function ove(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ive&&t===void 0?sve:t,this}var lve=ove,cve=Vge,uve=Gge,dve=Qge,fve=ave,hve=lve;function Wv(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Wv.prototype.clear=cve;Wv.prototype.delete=uve;Wv.prototype.get=dve;Wv.prototype.has=fve;Wv.prototype.set=hve;var pve=Wv;function mve(){this.__data__=[],this.size=0}var gve=mve;function vve(e,t){return e===t||e!==e&&t!==t}var h3=vve,yve=h3;function xve(e,t){for(var n=e.length;n--;)if(yve(e[n][0],t))return n;return-1}var jS=xve,bve=jS,wve=Array.prototype,_ve=wve.splice;function jve(e){var t=this.__data__,n=bve(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():_ve.call(t,n,1),--this.size,!0}var Sve=jve,Nve=jS;function Ave(e){var t=this.__data__,n=Nve(t,e);return n<0?void 0:t[n][1]}var kve=Ave,Eve=jS;function Cve(e){return Eve(this.__data__,e)>-1}var Pve=Cve,Tve=jS;function Ove(e,t){var n=this.__data__,r=Tve(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Rve=Ove,Ive=gve,Lve=Sve,Mve=kve,$ve=Pve,Dve=Rve;function qv(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}qv.prototype.clear=Ive;qv.prototype.delete=Lve;qv.prototype.get=Mve;qv.prototype.has=$ve;qv.prototype.set=Dve;var SS=qv,Fve=Np,Bve=Nc,Uve=Fve(Bve,"Map"),p3=Uve,XM=pve,zve=SS,Wve=p3;function qve(){this.size=0,this.__data__={hash:new XM,map:new(Wve||zve),string:new XM}}var Vve=qve;function Hve(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Gve=Hve,Yve=Gve;function Kve(e,t){var n=e.__data__;return Yve(t)?n[typeof t=="string"?"string":"hash"]:n.map}var NS=Kve,Zve=NS;function Xve(e){var t=Zve(this,e).delete(e);return this.size-=t?1:0,t}var Jve=Xve,Qve=NS;function eye(e){return Qve(this,e).get(e)}var tye=eye,nye=NS;function rye(e){return nye(this,e).has(e)}var aye=rye,iye=NS;function sye(e,t){var n=iye(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var oye=sye,lye=Vve,cye=Jve,uye=tye,dye=aye,fye=oye;function Vv(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Vv.prototype.clear=lye;Vv.prototype.delete=cye;Vv.prototype.get=uye;Vv.prototype.has=dye;Vv.prototype.set=fye;var m3=Vv,aG=m3,hye="Expected a function";function g3(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(hye);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var o=e.apply(this,r);return n.cache=i.set(a,o)||i,o};return n.cache=new(g3.Cache||aG),n}g3.Cache=aG;var iG=g3;const pye=mr(iG);var mye=iG,gye=500;function vye(e){var t=mye(e,function(r){return n.size===gye&&n.clear(),r}),n=t.cache;return t}var yye=vye,xye=yye,bye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wye=/\\(\\)?/g,_ye=xye(function(e){var t=[];
576return e.charCodeAt(0)===46&&t.push(""),e.replace(bye,function(n,r,a,i){t.push(a?i.replace(wye,"$1"):r||n)}),t}),jye=_ye;function Sye(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var v3=Sye,JM=Pb,Nye=v3,Aye=Us,kye=Uv,Eye=1/0,QM=JM?JM.prototype:void 0,e$=QM?QM.toString:void 0;function sG(e){if(typeof e=="string")return e;if(Aye(e))return Nye(e,sG)+"";if(kye(e))return e$?e$.call(e):"";var t=e+"";return t=="0"&&1/e==-Eye?"-0":t}var Cye=sG,Pye=Cye;function Tye(e){return e==null?"":Pye(e)}var oG=Tye,Oye=Us,Rye=d3,Iye=jye,Lye=oG;function Mye(e,t){return Oye(e)?e:Rye(e,t)?[e]:Iye(Lye(e))}var lG=Mye,$ye=Uv,Dye=1/0;function Fye(e){if(typeof e=="string"||$ye(e))return e;var t=e+"";return t=="0"&&1/e==-Dye?"-0":t}var AS=Fye,Bye=lG,Uye=AS;function zye(e,t){t=Bye(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Uye(t[n++])];return n&&n==r?e:void 0}var y3=zye,Wye=y3;function qye(e,t,n){var r=e==null?void 0:Wye(e,t);return r===void 0?n:r}var cG=qye;const ho=mr(cG);function Vye(e){return e==null}var Hye=Vye;const In=mr(Hye);var Gye=Tu,Yye=Us,Kye=Ou,Zye="[object String]";function Xye(e){return typeof e=="string"||!Yye(e)&&Kye(e)&&Gye(e)==Zye}var Jye=Xye;const ap=mr(Jye);var uG={exports:{}},jr={};/**
577 * @license React
578 * react-is.production.min.js
579 *
580 * Copyright (c) Facebook, Inc. and its affiliates.
581 *
582 * This source code is licensed under the MIT license found in the
583 * LICENSE file in the root directory of this source tree.
584 */var x3=Symbol.for("react.element"),b3=Symbol.for("react.portal"),kS=Symbol.for("react.fragment"),ES=Symbol.for("react.strict_mode"),CS=Symbol.for("react.profiler"),PS=Symbol.for("react.provider"),TS=Symbol.for("react.context"),Qye=Symbol.for("react.server_context"),OS=Symbol.for("react.forward_ref"),RS=Symbol.for("react.suspense"),IS=Symbol.for("react.suspense_list"),LS=Symbol.for("react.memo"),MS=Symbol.for("react.lazy"),e0e=Symbol.for("react.offscreen"),dG;dG=Symbol.for("react.module.reference");function Jo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case x3:switch(e=e.type,e){case kS:case CS:case ES:case RS:case IS:return e;default:switch(e=e&&e.$$typeof,e){case Qye:case TS:case OS:case MS:case LS:case PS:return e;default:return t}}case b3:return t}}}jr.ContextConsumer=TS;jr.ContextProvider=PS;jr.Element=x3;jr.ForwardRef=OS;jr.Fragment=kS;jr.Lazy=MS;jr.Memo=LS;jr.Portal=b3;jr.Profiler=CS;jr.StrictMode=ES;jr.Suspense=RS;jr.SuspenseList=IS;jr.isAsyncMode=function(){return!1};jr.isConcurrentMode=function(){return!1};jr.isContextConsumer=function(e){return Jo(e)===TS};jr.isContextProvider=function(e){return Jo(e)===PS};jr.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===x3};jr.isForwardRef=function(e){return Jo(e)===OS};jr.isFragment=function(e){return Jo(e)===kS};jr.isLazy=function(e){return Jo(e)===MS};jr.isMemo=function(e){return Jo(e)===LS};jr.isPortal=function(e){return Jo(e)===b3};jr.isProfiler=function(e){return Jo(e)===CS};jr.isStrictMode=function(e){return Jo(e)===ES};jr.isSuspense=function(e){return Jo(e)===RS};jr.isSuspenseList=function(e){return Jo(e)===IS};jr.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kS||e===CS||e===ES||e===RS||e===IS||e===e0e||typeof e=="object"&&e!==null&&(e.$$typeof===MS||e.$$typeof===LS||e.$$typeof===PS||e.$$typeof===TS||e.$$typeof===OS||e.$$typeof===dG||e.getModuleId!==void 0)};jr.typeOf=Jo;uG.exports=jr;var t0e=uG.exports,n0e=Tu,r0e=Ou,a0e="[object Number]";function i0e(e){return typeof e=="number"||r0e(e)&&n0e(e)==a0e}var fG=i0e;const s0e=mr(fG);var o0e=fG;function l0e(e){return o0e(e)&&e!=+e}var c0e=l0e;const Tb=mr(c0e);var ds=function(t){return t===0?0:t>0?1:-1},_h=function(t){return ap(t)&&t.indexOf("%")===t.length-1},gt=function(t){return s0e(t)&&!Tb(t)},u0e=function(t){return In(t)},li=function(t){return gt(t)||ap(t)},d0e=0,Ob=function(t){var n=++d0e;return"".concat(t||"").concat(n)},fs=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!gt(t)&&!ap(t))return r;var i;if(_h(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return Tb(i)&&(i=r),a&&i>n&&(i=n),i},ym=function(t){if(!t)return null;var n=Object.keys(t);
vendor: 5,203 bytes, line 584
584return n&&n.length?t[n[0]]:null},f0e=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},ld=function(t,n){return gt(t)&&gt(n)?function(r){return t+r*(n-t)}:function(){return n}};function JC(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):ho(r,t))===n})}var h0e=function(t,n){return gt(t)&&gt(n)?t-n:ap(t)&&ap(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function ng(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function QC(e){"@babel/helpers - typeof";return QC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},QC(e)}var p0e=["viewBox","children"],m0e=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],t$=["points","pathLength"],jA={svg:p0e,polygon:t$,polyline:t$},w3=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
584ocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],u2=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(x.isValidElement(t)&&(r=t.props),!zv(r))return null;var a={};return Object.keys(r).forEach(function(i){w3.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},g0e=function(t,n,r){return function(a){return t(n,r,a),null}},ip=function(t,n,r){if(!zv(t)||QC(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];w3.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=g0e(o,n,r))}),a},v0e=["children"],y0e=["children"];function n$(e,t){if(e==null)return{};var n=x0e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function x0e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var r$={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},cu=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},a$=null,SA=null,_3=function e(t){if(t===a$&&Array.isArray(SA))return SA;var n=[];return x.Children.forEach(t,function(r){In(r)||(t0e.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),SA=n,a$=t,n};function Wo(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return cu(a)}
vendor: 5,006 bytes, line 584
584):r=[cu(t)],_3(e).forEach(function(a){var i=ho(a,"type.displayName")||ho(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function no(e,t){var n=Wo(e,t);return n&&n[0]}var i$=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!gt(r)||r<=0||!gt(a)||a<=0)},b0e=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],w0e=function(t){return t&&t.type&&ap(t.type)&&b0e.indexOf(t.type)>=0},_0e=function(t,n,r,a){var i,o=(i=jA==null?void 0:jA[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!_n(t)&&(a&&o.includes(n)||m0e.includes(n))||r&&w3.includes(n)},cn=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(x.isValidElement(t)&&(a=t.props),!zv(a))return null;var i={};return Object.keys(a).forEach(function(o){var l;_0e((l=a)===null||l===void 0?void 0:l[o],o,n,r)&&(i[o]=a[o])}),i},eP=function e(t,n){if(t===n)return!0;var r=x.Children.count(t);if(r!==x.Children.count(n))return!1;if(r===0)return!0;if(r===1)return s$(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var i=t[a],o=n[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!s$(i,o))return!1}return!0},s$=function(t,n){if(In(t)&&In(n))return!0;if(!In(t)&&!In(n)){var r=t.props||{},a=r.children,i=n$(r,v0e),o=n.props||{},l=o.children,c=n$(o,y0e);return a&&l?ng(i,c)&&eP(a,l):!a&&!l?ng(i,c):!1}return!1},o$=function(t,n){var r=[],a={};return _3(t).forEach(function(i,o){if(w0e(i))r.push(i);else if(i){var l=cu(i.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(i,l,o);r.push(f),a[l]=!0}}}),r},j0e=function(t){var n=t&&t.type;return n&&r$[n]?r$[n]:null},S0e=function(t,n){return _3(n).indexOf(t)},N0e=["children","width","height","viewBox","className","style","title","desc"];function tP(){return tP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tP.apply(this,arguments)}function A0e(e,t){if(e==null)return{};var n=k0e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function k0e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function nP(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,i=e.className,o=e.style,l=e.title,c=e.desc,u=A0e(e,N0e),d=a||{width:n,height:r,x:0,y:0},f=Cn("recharts-surface",i);return ue.createElement("svg",tP({},cn(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),ue.createElement("title",null,l),ue.createElement("desc",null,c),t)}var E0e=["children","className"];function rP(){return rP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rP.apply(this,arguments)}function C0e(e,t){if(e==null)return{};var n=P0e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function P0e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var wr=ue.forwardRef(function(e,t){var n=e.children,r=e.className,a=C0e(e,E0e),i=Cn("recharts-layer",r);return ue.createElement("g",rP({className:i},cn(a,!0),{ref:t}),n)}),uu=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),i=2;i<r;i++)a[i-2]=arguments[i]};function T0e(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(a);++r<a;)i[r]=e[r+t];return i}var O0e=T0e,R0e=O0e;function I0e(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:R0e(e,t,n)}var L0e=I0e,M0e="\\ud800-\\udfff",$0e="\\u0300-\\u036f",D0e="\\ufe20-\\ufe2f",F0e="\\u20d0-\\u20ff",B0e=$0e+D0e+F0e,U0e="\\ufe0e\\ufe0f",z0e="\\u200d",W0e=Reg
vendor: 6,520 bytes, line 584
584Exp("["+z0e+M0e+B0e+U0e+"]");function q0e(e){return W0e.test(e)}var hG=q0e;function V0e(e){return e.split("")}var H0e=V0e,pG="\\ud800-\\udfff",G0e="\\u0300-\\u036f",Y0e="\\ufe20-\\ufe2f",K0e="\\u20d0-\\u20ff",Z0e=G0e+Y0e+K0e,X0e="\\ufe0e\\ufe0f",J0e="["+pG+"]",aP="["+Z0e+"]",iP="\\ud83c[\\udffb-\\udfff]",Q0e="(?:"+aP+"|"+iP+")",mG="[^"+pG+"]",gG="(?:\\ud83c[\\udde6-\\uddff]){2}",vG="[\\ud800-\\udbff][\\udc00-\\udfff]",exe="\\u200d",yG=Q0e+"?",xG="["+X0e+"]?",txe="(?:"+exe+"(?:"+[mG,gG,vG].join("|")+")"+xG+yG+")*",nxe=xG+yG+txe,rxe="(?:"+[mG+aP+"?",aP,gG,vG,J0e].join("|")+")",axe=RegExp(iP+"(?="+iP+")|"+rxe+nxe,"g");function ixe(e){return e.match(axe)||[]}var sxe=ixe,oxe=H0e,lxe=hG,cxe=sxe;function uxe(e){return lxe(e)?cxe(e):oxe(e)}var dxe=uxe,fxe=L0e,hxe=hG,pxe=dxe,mxe=oG;function gxe(e){return function(t){t=mxe(t);var n=hxe(t)?pxe(t):void 0,r=n?n[0]:t.charAt(0),a=n?fxe(n,1).join(""):t.slice(1);return r[e]()+a}}var vxe=gxe,yxe=vxe,xxe=yxe("toUpperCase"),bxe=xxe;const $S=mr(bxe);function Dr(e){return function(){return e}}const bG=Math.cos,d2=Math.sin,Il=Math.sqrt,f2=Math.PI,DS=2*f2,sP=Math.PI,oP=2*sP,ih=1e-6,wxe=oP-ih;function wG(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function _xe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return wG;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class jxe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?wG:_xe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,i,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,r,a,i){if(t=+t,n=+n,r=+r,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=r-t,u=a-n,d=o-t,f=l-n,p=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(p>ih)if(!(Math.abs(f*c-u*d)>ih)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-o,m=a-l,g=c*c+u*u,v=h*h+m*m,y=Math.sqrt(g),b=Math.sqrt(p),w=i*Math.tan((sP-Math.acos((g+p-v)/(2*y*b)))/2),j=w/b,S=w/y;Math.abs(j-1)>ih&&this._append`L${t+j*d},${n+j*f}`,this._append`A${i},${i},0,0,${+(f*h>d*m)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,a,i,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(a),c=r*Math.sin(a),u=t+l,d=n+c,f=1^o,p=o?a-i:i-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>ih||Math.abs(this._y1-d)>ih)&&this._append`L${u},${d}`,r&&(p<0&&(p=p%oP+oP),p>wxe?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:p>ih&&this._append`A${r},${r},0,${+(p>=sP)},${f},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function j3(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new jxe(t)}function S3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _G(e){this._context=e}_G.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function FS(e){return new _G(e)}function jG(e){return e[0]}function SG(e){return e[1]}function NG(e,t){var n=Dr(!0),r=null,a=FS,i=null,o=j3(l);e=typeof e=="function"?e:e===void 0?jG:Dr(e),t=typeof t=="function"?t:t===void 0?SG:Dr(t);function l(c){var u,d=(c=S3(c)).length,f,p=!1,h;for(r==null&&(i=a(h=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===p&&((p=!p)?i.lineStart():i.lineEnd()),p&&i.point(+e(f,u,c),+t(f,u,c));if(h)return i=null,h+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Dr(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Dr(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Dr(!!c),l):n},l.curve=function(c){return arguments.length?(a=c,r!=null&&(i=a(r)),l):a},l.context=function(c){return arguments.length?(c==null?r=i=null:i=a(r=c),l):r},l}function nw(e,t,n){var r=null,a=Dr(!0),i=null,o=FS,l=null,c=j3(u);e=typeof e=="function"?e:e===void 0?jG:Dr(+e),t=typeof t=="function"?t:Dr(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?SG:Dr(+n);function u(f){var p,h,m,g=(f=S3(f)).length,v,y=!1,b,w=new Array(g),j=new Array(g);for(i==null&&(l=o(b=c())),p=0;p<=g;++p){if(!(p<g&&a(v=f[p],p,f))===y)if(y=!y)h=p,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),m=p-1;m>=h;--m)l.point(w[m],j[m]);l.lineEnd(),l.areaEnd()}y&&(w[p]=+e(v,p,f),j[p]=+t(v,p,f),l.point(r?+r(v,p,f):w[p],n?+n(v,p,f):j[p]))}if(b)return l=null,b+""||null}function d(){return NG().defined(a).curve(o).context(i)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Dr(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Dr(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Dr(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Dr(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Dr(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Dr(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:Dr(!!f),u):a},u.curve=function(f){return arguments.length?(o=f,i!=null&&(l=o(i)),u):o},u.context=function(f){return arguments.length?(f==null?i=l=null:l=o(i=f),u):i},u}class AG{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}
584point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Sxe(e){return new AG(e,!0)}function Nxe(e){return new AG(e,!1)}const N3={draw(e,t){const n=Il(t/f2);e.moveTo(n,0),e.arc(0,0,n,0,DS)}},Axe={draw(e,t){const n=Il(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},kG=Il(1/3),kxe=kG*2,Exe={draw(e,t){const n=Il(t/kxe),r=n*kG;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Cxe={draw(e,t){const n=Il(t),r=-n/2;e.rect(r,r,n,n)}},Pxe=.8908130915292852,EG=d2(f2/10)/d2(7*f2/10),Txe=d2(DS/10)*EG,Oxe=-bG(DS/10)*EG,Rxe={draw(e,t){const n=Il(t*Pxe),r=Txe*n,a=Oxe*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=DS*i/5,l=bG(o),c=d2(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*a,c*r+l*a)}e.closePath()}},NA=Il(3),Ixe={draw(e,t){const n=-Il(t/(NA*3));e.moveTo(0,n*2),e.lineTo(-NA*n,-n),e.lineTo(NA*n,-n),e.closePath()}},No=-.5,Ao=Il(3)/2,lP=1/Il(12),Lxe=(lP/2+1)*3,Mxe={draw(e,t){const n=Il(t/Lxe),r=n/2,a=n*lP,i=r,o=n*lP+n,l=-i,c=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(No*r-Ao*a,Ao*r+No*a),e.lineTo(No*i-Ao*o,Ao*i+No*o),e.lineTo(No*l-Ao*c,Ao*l+No*c),e.lineTo(No*r+Ao*a,No*a-Ao*r),e.lineTo(No*i+Ao*o,No*o-Ao*i),e.lineTo(No*l+Ao*c,No*c-Ao*l),e.closePath()}};function $xe(e,t){let n=null,r=j3(a);e=typeof e=="function"?e:Dr(e||N3),t=typeof t=="function"?t:Dr(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:Dr(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:Dr(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function h2(){}function p2(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function CG(e){this._context=e}CG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:p2(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:p2(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Dxe(e){return new CG(e)}function PG(e){this._context=e}PG.prototype={areaStart:h2,areaEnd:h2,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:p2(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fxe(e){return new PG(e)}function TG(e){this._context=e}TG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;
vendor: 4,581 bytes, line 584
584default:p2(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bxe(e){return new TG(e)}function OG(e){this._context=e}OG.prototype={areaStart:h2,areaEnd:h2,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Uxe(e){return new OG(e)}function l$(e){return e<0?-1:1}function c$(e,t,n){var r=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),l=(i*a+o*r)/(r+a);return(l$(i)+l$(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function u$(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function AA(e,t,n){var r=e._x0,a=e._y0,i=e._x1,o=e._y1,l=(i-r)/3;e._context.bezierCurveTo(r+l,a+l*t,i-l,o-l*n,i,o)}function m2(e){this._context=e}m2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:AA(this,this._t0,u$(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,AA(this,u$(this,n=c$(this,e,t)),n);break;default:AA(this,this._t0,n=c$(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function RG(e){this._context=new IG(e)}(RG.prototype=Object.create(m2.prototype)).point=function(e,t){m2.prototype.point.call(this,t,e)};function IG(e){this._context=e}IG.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function zxe(e){return new m2(e)}function Wxe(e){return new RG(e)}function LG(e){this._context=e}LG.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=d$(e),a=d$(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(r[0][i],a[0][i],r[1][i],a[1][i],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function d$(e){var t,n=e.length-1,r,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function qxe(e){return new LG(e)}function BS(e,t){this._context=e,this._t=t}BS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Vxe(e){return new BS(e,.5)}function Hxe(e){return new BS(e,0)}function Gxe(e){return new BS(e,1)}function Wg(e,t){if((o=e.length)>1)for(var n=1,r,a,i=e[t[0]],o,l=i.length;n<o;++n)for(a=i,i=e[t[n]],r=0;r<l;++r)i[r][1]+=i[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function cP(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Yxe(e,t){return e[t]}function Kxe(e){const t=[];return t.key=e,t}function Zxe(){var e=Dr([]),t=cP,n=Wg,r=Yxe;function a(i){var o=Array.from(e.apply(this,arguments),Kxe),l,c=o.length,u=-1,d;for(const f of i)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,i)]).data=f;
vendor: 8,371 bytes, lines 584-587
584for(l=0,d=S3(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:Dr(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:Dr(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?cP:typeof i=="function"?i:Dr(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??Wg,a):n},a}function Xxe(e,t){if((r=e.length)>0){for(var n,r,a=0,i=e[0].length,o;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}Wg(e,t)}}function Jxe(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,i=r.length;n<i;++n){for(var o=0,l=0;o<a;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}Wg(e,t)}}function Qxe(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,o;r<i;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[r][1]||0,p=d[r-1][1]||0,h=(f-p)/2,m=0;m<l;++m){var g=e[t[m]],v=g[r][1]||0,y=g[r-1][1]||0;h+=v-y}c+=f,u+=h*f}a[r-1][1]+=a[r-1][0]=n,c&&(n-=u/c)}a[r-1][1]+=a[r-1][0]=n,Wg(e,t)}}function vx(e){"@babel/helpers - typeof";return vx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vx(e)}var ebe=["type","size","sizeType"];function uP(){return uP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uP.apply(this,arguments)}function f$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function h$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f$(Object(n),!0).forEach(function(r){tbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tbe(e,t,n){return t=nbe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nbe(e){var t=rbe(e,"string");return vx(t)=="symbol"?t:t+""}function rbe(e,t){if(vx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(vx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function abe(e,t){if(e==null)return{};var n=ibe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ibe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var MG={symbolCircle:N3,symbolCross:Axe,symbolDiamond:Exe,symbolSquare:Cxe,symbolStar:Rxe,symbolTriangle:Ixe,symbolWye:Mxe},sbe=Math.PI/180,obe=function(t){var n="symbol".concat($S(t));return MG[n]||N3},lbe=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*sbe;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},cbe=function(t,n){MG["symbol".concat($S(t))]=n},A3=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=abe(t,ebe),u=h$(h$({},c),{},{type:r,size:i,sizeType:l}),d=function(){var v=obe(r),y=$xe().type(v).size(lbe(i,l,r));return y()},f=u.className,p=u.cx,h=u.cy,m=cn(u,!0);return p===+p&&h===+h&&i===+i?ue.createElement("path",uP({},m,{className:Cn("recharts-symbols",f),transform:"translate(".concat(p,", ").concat(h,")"),d:d()})):null};A3.registerSymbol=cbe;function qg(e){"@babel/helpers - typeof";return qg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qg(e)}function dP(){return dP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dP.apply(this,arguments)}function p$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ube(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p$(Object(n),!0).forEach(function(r){yx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fbe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,DG(r.key),r)}}function hbe(e,t,n){return t&&fbe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pbe(e,t,n){return t=g2(t),mbe(e,$G()?Reflect.construct(t,n||[],g2(e).constructor):t.apply(e,n))}function mbe(e,t){if(t&&(qg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gbe(e)}function gbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $G(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($G=function(){return!!e})()}function g2(e){return g2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},g2(e)}function vbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fP(e,t)}function fP(e,t){return fP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},fP(e,t)}function yx(e,t,n){return t=DG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DG(e){var t=ybe(e,"string");return qg(t)=="symbol"?t:t+""}function ybe(e,t){if(qg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(qg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ko=32,k3=function(e){function t(){return dbe(this,t),pbe(this,t,arguments)}return vbe(t,e),hbe(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=ko/2,o=ko/6,l=ko/3,c=r.inactive?a:r.color;if(r.type==="plainline")return ue.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:ko,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return ue.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
585            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,`
586            H`).concat(ko,"M").concat(2*l,",").concat(i,`
587            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(r.type==="rect")return ue.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(ko/8,"h").concat(ko,"v").concat(ko*3/4,"h").concat(-ko,"z"),className:"recharts-legend-icon"});if(ue.isValidElement(r.legendIcon)){var u=ube({},r);return delete u.legendIcon,ue.cloneElement(r.legendIcon,u)}return ue.createElement(A3,{fill:c,cx:i,cy:i,size:ko,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,i=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:ko,height:ko}
587,f={display:l==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(h,m){var g=h.formatter||c,v=Cn(yx(yx({"recharts-legend-item":!0},"legend-item-".concat(m),!0),"inactive",h.inactive));if(h.type==="none")return null;var y=_n(h.value)?null:h.value;uu(!_n(h.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var b=h.inactive?u:h.color;return ue.createElement("li",dP({className:v,style:f,key:"legend-item-".concat(m)},ip(r.props,h,m)),ue.createElement(nP,{width:o,height:o,viewBox:d,style:p},r.renderIcon(h)),ue.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},g?g(y,h,m):y))})}},{key:"render",value:function(){var r=this.props,a=r.payload,i=r.layout,o=r.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return ue.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(x.PureComponent);yx(k3,"displayName","Legend");yx(k3,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var xbe=SS;function bbe(){this.__data__=new xbe,this.size=0}var wbe=bbe;function _be(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var jbe=_be;function Sbe(e){return this.__data__.get(e)}var Nbe=Sbe;function Abe(e){return this.__data__.has(e)}var kbe=Abe,Ebe=SS,Cbe=p3,Pbe=m3,Tbe=200;function Obe(e,t){var n=this.__data__;if(n instanceof Ebe){var r=n.__data__;if(!Cbe||r.length<Tbe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pbe(r)}return n.set(e,t),this.size=n.size,this}var Rbe=Obe,Ibe=SS,Lbe=wbe,Mbe=jbe,$be=Nbe,Dbe=kbe,Fbe=Rbe;function Hv(e){var t=this.__data__=new Ibe(e);this.size=t.size}Hv.prototype.clear=Lbe;Hv.prototype.delete=Mbe;Hv.prototype.get=$be;Hv.prototype.has=Dbe;Hv.prototype.set=Fbe;var FG=Hv,Bbe="__lodash_hash_undefined__";function Ube(e){return this.__data__.set(e,Bbe),this}var zbe=Ube;function Wbe(e){return this.__data__.has(e)}var qbe=Wbe,Vbe=m3,Hbe=zbe,Gbe=qbe;function v2(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Vbe;++t<n;)this.add(e[t])}v2.prototype.add=v2.prototype.push=Hbe;v2.prototype.has=Gbe;var BG=v2;function Ybe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var UG=Ybe;function Kbe(e,t){return e.has(t)}var zG=Kbe,Zbe=BG,Xbe=UG,Jbe=zG,Qbe=1,e1e=2;function t1e(e,t,n,r,a,i){var o=n&Qbe,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,h=n&e1e?new Zbe:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var m=e[f],g=t[f];if(r)var v=o?r(g,m,f,t,e,i):r(m,g,f,e,t,i);if(v!==void 0){if(v)continue;p=!1;break}if(h){if(!Xbe(t,function(y,b){if(!Jbe(h,b)&&(m===y||a(m,y,n,r,i)))return h.push(b)})){p=!1;break}}else if(!(m===g||a(m,g,n,r,i))){p=!1;break}}return i.delete(e),i.delete(t),p}var WG=t1e,n1e=Nc,r1e=n1e.Uint8Array,a1e=r1e;function i1e(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}var s1e=i1e;function o1e(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var E3=o1e,m$=Pb,g$=a1e,l1e=h3,c1e=WG,u1e=s1e,d1e=E3,f1e=1,h1e=2,p1e="[object Boolean]",m1e="[object Date]",g1e="[object Error]",v1e="[object Map]",y1e="[object Number]",x1e="[object RegExp]",b1e="[object Set]",w1e="[object String]",_1e="[object Symbol]",j1e="[object ArrayBuffer]",S1e="[object DataView]",v$=m$?m$.prototype:void 0,kA=v$?v$.valueOf:void 0;function N1e(e,t,n,r,a,i,o){switch(n){case S1e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j1e:return!(e.byteLength!=t.byteLength||!i(new g$(e),new g$(t)));case p1e:case m1e:case y1e:return l1e(+e,+t);case g1e:return e.name==t.name&&e.message==t.message;case x1e:case w1e:return e==t+"";case v1e:var l=u1e;case b1e:var c=r&f1e;if(l||(l=d1e),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=h1e,o.set(e,t);var d=c1e(l(e),l(t),r,a,i,o);return o.delete(e),d;case _1e:if(kA)return kA.call(e)==kA.call(t)}return!1}var A1e=N1e;function k1e(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var qG=k1e,E1e=qG,C1e=Us;function P1e(e,t,n){var r=t(e);return C1e(e)?r:E1e(r,n(e))}var T1e=P1e;function O1e(e,t){for(var n=-1,r=e==null?0:e.length,a=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[a++]=o)}return i}var R1e=O1e;function I1e(){return[]}var L1e=I1e,M1e=R1e,$1e=L1e,D1e=Object.prototype,F1e=D1e.propertyIsEnumerable,y$=Object.getOwnPropertySymbols,B1e=y$?function(e){return e==null?[]:(e=Object(e),M1e(y$(e),function(t){return F1e.call(e,t)}))}:$1e,U1e=B1e;function z1e(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var W1e=z1e,q1e=Tu,V1e=Ou,H1e="[object Arguments]";function G1e(e){return V1e(e)&&q1e(e)==H1e}var Y1e=G1e,x$=Y1e,K1e=Ou,VG=Object.prototype,Z1e=VG.hasOwnProperty,X1e=VG.propertyIsEnumerable,J1e=x$(function(){return arguments}())?x$:function(e){return K1e(e)&&Z1e.call(e,"callee")&&!X1e.call(e,"callee")},C3=J1e,y2={exports:{}};function Q1e(){return!1}var ewe=Q1e;y2.exports;(function(e,t){var n=Nc,r=ewe,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(y2,y2.exports);var HG=y2.exports,twe=9007199254740991,nwe=/^(?:0|[1-9]\d*)$/;function rwe(e,t){var n=typeof e;return t=t??twe,!!t&&(n=="number"||n!="symbol"&&nwe.test(e))&&e>-1&&e%1==0&&e<t}var P3=rwe,awe=9007199254740991;function iwe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=awe}var T3=iwe,swe=Tu,owe=T3,lwe=Ou,cwe="[object Arguments]",uwe="[object Array]",dwe="[object Boolean]",fwe="[object Date]",hwe="[object Error]",pwe="[object Function]",mwe="[object Map]",gwe="[object Number]",vwe="[object Object]",ywe="[object RegExp]",xwe
vendor: 4,034 bytes, line 587
587="[object Set]",bwe="[object String]",wwe="[object WeakMap]",_we="[object ArrayBuffer]",jwe="[object DataView]",Swe="[object Float32Array]",Nwe="[object Float64Array]",Awe="[object Int8Array]",kwe="[object Int16Array]",Ewe="[object Int32Array]",Cwe="[object Uint8Array]",Pwe="[object Uint8ClampedArray]",Twe="[object Uint16Array]",Owe="[object Uint32Array]",Hr={};Hr[Swe]=Hr[Nwe]=Hr[Awe]=Hr[kwe]=Hr[Ewe]=Hr[Cwe]=Hr[Pwe]=Hr[Twe]=Hr[Owe]=!0;Hr[cwe]=Hr[uwe]=Hr[_we]=Hr[dwe]=Hr[jwe]=Hr[fwe]=Hr[hwe]=Hr[pwe]=Hr[mwe]=Hr[gwe]=Hr[vwe]=Hr[ywe]=Hr[xwe]=Hr[bwe]=Hr[wwe]=!1;function Rwe(e){return lwe(e)&&owe(e.length)&&!!Hr[swe(e)]}var Iwe=Rwe;function Lwe(e){return function(t){return e(t)}}var GG=Lwe,x2={exports:{}};x2.exports;(function(e,t){var n=tG,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(x2,x2.exports);var Mwe=x2.exports,$we=Iwe,Dwe=GG,b$=Mwe,w$=b$&&b$.isTypedArray,Fwe=w$?Dwe(w$):$we,YG=Fwe,Bwe=W1e,Uwe=C3,zwe=Us,Wwe=HG,qwe=P3,Vwe=YG,Hwe=Object.prototype,Gwe=Hwe.hasOwnProperty;function Ywe(e,t){var n=zwe(e),r=!n&&Uwe(e),a=!n&&!r&&Wwe(e),i=!n&&!r&&!a&&Vwe(e),o=n||r||a||i,l=o?Bwe(e.length,String):[],c=l.length;for(var u in e)(t||Gwe.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||qwe(u,c)))&&l.push(u);return l}var Kwe=Ywe,Zwe=Object.prototype;function Xwe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Zwe;return e===n}var Jwe=Xwe;function Qwe(e,t){return function(n){return e(t(n))}}var KG=Qwe,e_e=KG,t_e=e_e(Object.keys,Object),n_e=t_e,r_e=Jwe,a_e=n_e,i_e=Object.prototype,s_e=i_e.hasOwnProperty;function o_e(e){if(!r_e(e))return a_e(e);var t=[];for(var n in Object(e))s_e.call(e,n)&&n!="constructor"&&t.push(n);return t}var l_e=o_e,c_e=f3,u_e=T3;function d_e(e){return e!=null&&u_e(e.length)&&!c_e(e)}var US=d_e,f_e=Kwe,h_e=l_e,p_e=US;function m_e(e){return p_e(e)?f_e(e):h_e(e)}var O3=m_e,g_e=T1e,v_e=U1e,y_e=O3;function x_e(e){return g_e(e,y_e,v_e)}var b_e=x_e,_$=b_e,w_e=1,__e=Object.prototype,j_e=__e.hasOwnProperty;function S_e(e,t,n,r,a,i){var o=n&w_e,l=_$(e),c=l.length,u=_$(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var p=l[f];if(!(o?p in t:j_e.call(t,p)))return!1}var h=i.get(e),m=i.get(t);if(h&&m)return h==t&&m==e;var g=!0;i.set(e,t),i.set(t,e);for(var v=o;++f<c;){p=l[f];var y=e[p],b=t[p];if(r)var w=o?r(b,y,p,t,e,i):r(y,b,p,e,t,i);if(!(w===void 0?y===b||a(y,b,n,r,i):w)){g=!1;break}v||(v=p=="constructor")}if(g&&!v){var j=e.constructor,S=t.constructor;j!=S&&"constructor"in e&&"constructor"in t&&!(typeof j=="function"&&j instanceof j&&typeof S=="function"&&S instanceof S)&&(g=!1)}return i.delete(e),i.delete(t),g}var N_e=S_e,A_e=Np,k_e=Nc,E_e=A_e(k_e,"DataView"),C_e=E_e,P_e=Np,T_e=Nc,O_e=P_e(T_e,"Promise"),R_e=O_e,I_e=Np,L_e=Nc,M_e=I_e(L_e,"Set"),ZG=M_e,$_e=Np,D_e=Nc,F_e=$_e(D_e,"WeakMap"),B_e=F_e,hP=C_e,pP=p3,mP=R_e,gP=ZG,vP=B_e,XG=Tu,Gv=rG,j$="[object Map]",U_e="[object Object]",S$="[object Promise]",N$="[object Set]",A$="[object WeakMap]",k$="[object DataView]",z_e=Gv(hP),W_e=Gv(pP),q_e=Gv(mP),V_e=Gv(gP),H_e=Gv(vP),sh=XG;(hP&&sh(new hP(new ArrayBuffer(1)))!=k$||pP&&sh(new pP)!=j$||mP&&sh(mP.resolve())!=S$||gP&&sh(new gP)!=N$||vP&&sh(new vP)!=A$)&&(sh=function(e){var t=XG(e),n=t==U_e?e.constructor:void 0,r=n?Gv(n):"";if(r)switch(r){case z_e:return k$;case W_e:return j$;case q_e:return S$;case V_e:return N$;case H_e:return A$}return t});var G_e=sh,EA=FG,Y_e=WG,K_e=A1e,Z_e=N_e,E$=G_e,C$=Us,P$=HG,X_e=YG,J_e=1,T$="[object Arguments]",O$="[object Array]",rw="[object Object]",Q_e=Object.prototype,R$=Q_e.hasOwnProperty;function e2e(e,t,n,r,a,i){var o=C$(e),l=C$(t),c=o?O$:E$(e),u=l?O$:E$(t);c=c==T$?rw:c,u=u==T$?rw:u;var d=c==rw,f=u==rw,p=c==u;if(p&&P$(e)){if(!P$(t))return!1;o=!0,d=!1}if(p&&!d)return i||(i=new EA),o||X_e(e)?Y_e(e,t,n,r,a,i):K_e(e,t,c,n,r,a,i);if(!(n&J_e)){var h=d&&R$.call(e,"__wrapped__"),m=f&&R$.call(t,"__wrapped__");
vendor: 4,114 bytes, line 587
587if(h||m){var g=h?e.value():e,v=m?t.value():t;return i||(i=new EA),a(g,v,n,r,i)}}return p?(i||(i=new EA),Z_e(e,t,n,r,a,i)):!1}var t2e=e2e,n2e=t2e,I$=Ou;function JG(e,t,n,r,a){return e===t?!0:e==null||t==null||!I$(e)&&!I$(t)?e!==e&&t!==t:n2e(e,t,n,r,JG,a)}var R3=JG,r2e=FG,a2e=R3,i2e=1,s2e=2;function o2e(e,t,n,r){var a=n.length,i=a,o=!r;if(e==null)return!i;for(e=Object(e);a--;){var l=n[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=n[a];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new r2e;if(r)var p=r(u,d,c,e,t,f);if(!(p===void 0?a2e(d,u,i2e|s2e,r,f):p))return!1}}return!0}var l2e=o2e,c2e=_f;function u2e(e){return e===e&&!c2e(e)}var QG=u2e,d2e=QG,f2e=O3;function h2e(e){for(var t=f2e(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,d2e(a)]}return t}var p2e=h2e;function m2e(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var eY=m2e,g2e=l2e,v2e=p2e,y2e=eY;function x2e(e){var t=v2e(e);return t.length==1&&t[0][2]?y2e(t[0][0],t[0][1]):function(n){return n===e||g2e(n,e,t)}}var b2e=x2e;function w2e(e,t){return e!=null&&t in Object(e)}var _2e=w2e,j2e=lG,S2e=C3,N2e=Us,A2e=P3,k2e=T3,E2e=AS;function C2e(e,t,n){t=j2e(t,e);for(var r=-1,a=t.length,i=!1;++r<a;){var o=E2e(t[r]);if(!(i=e!=null&&n(e,o)))break;e=e[o]}return i||++r!=a?i:(a=e==null?0:e.length,!!a&&k2e(a)&&A2e(o,a)&&(N2e(e)||S2e(e)))}var P2e=C2e,T2e=_2e,O2e=P2e;function R2e(e,t){return e!=null&&O2e(e,t,T2e)}var I2e=R2e,L2e=R3,M2e=cG,$2e=I2e,D2e=d3,F2e=QG,B2e=eY,U2e=AS,z2e=1,W2e=2;function q2e(e,t){return D2e(e)&&F2e(t)?B2e(U2e(e),t):function(n){var r=M2e(n,e);return r===void 0&&r===t?$2e(n,e):L2e(t,r,z2e|W2e)}}var V2e=q2e;function H2e(e){return e}var Yv=H2e;function G2e(e){return function(t){return t==null?void 0:t[e]}}var Y2e=G2e,K2e=y3;function Z2e(e){return function(t){return K2e(t,e)}}var X2e=Z2e,J2e=Y2e,Q2e=X2e,eje=d3,tje=AS;function nje(e){return eje(e)?J2e(tje(e)):Q2e(e)}var rje=nje,aje=b2e,ije=V2e,sje=Yv,oje=Us,lje=rje;function cje(e){return typeof e=="function"?e:e==null?sje:typeof e=="object"?oje(e)?ije(e[0],e[1]):aje(e):lje(e)}var jf=cje;function uje(e,t,n,r){for(var a=e.length,i=n+(r?1:-1);r?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var dje=uje;function fje(e){return e!==e}var hje=fje;function pje(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var mje=pje,gje=dje,vje=hje,yje=mje;function xje(e,t,n){return t===t?yje(e,t,n):gje(e,vje,n)}var bje=xje,wje=bje;function _je(e,t){var n=e==null?0:e.length;return!!n&&wje(e,t,0)>-1}var jje=_je;function Sje(e,t,n){for(var r=-1,a=e==null?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1}var Nje=Sje;function Aje(){}var kje=Aje,CA=ZG,Eje=kje,Cje=E3,Pje=1/0,Tje=CA&&1/Cje(new CA([,-0]))[1]==Pje?function(e){return new CA(e)}:Eje,Oje=Tje,Rje=BG,Ije=jje,Lje=Nje,Mje=zG,$je=Oje,Dje=E3,Fje=200;function Bje(e,t,n){var r=-1,a=Ije,i=e.length,o=!0,l=[],c=l;if(n)o=!1,a=Lje;else if(i>=Fje){var u=t?null:$je(e);if(u)return Dje(u);o=!1,a=Mje,c=new Rje}else c=t?[]:l;e:for(;++r<i;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,o&&f===f){for(var p=c.length;p--;)if(c[p]===f)continue e;t&&c.push(f),l.push(d)}else a(c,f,n)||(c!==l&&c.push(f),l.push(d))}return l}var Uje=Bje,zje=jf,Wje=Uje;function qje(e,t){return e&&e.length?Wje(e,zje(t)):[]}var Vje=qje;const L$=mr(Vje);function tY(e,t,n){return t===!0?L$(e,n):_n(t)?L$(e,t):e}function Vg(e){"@babel/helpers - typeof";return Vg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vg(e)}var Hje=["ref"];function M$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M$(Object(n),!0).forEach(function(r){zS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M$(Object(n)).forEac
vendor: 4,286 bytes, line 587
587h(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $$(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rY(r.key),r)}}function Yje(e,t,n){return t&&$$(e.prototype,t),n&&$$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kje(e,t,n){return t=b2(t),Zje(e,nY()?Reflect.construct(t,n||[],b2(e).constructor):t.apply(e,n))}function Zje(e,t){if(t&&(Vg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xje(e)}function Xje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nY=function(){return!!e})()}function b2(e){return b2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},b2(e)}function Jje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yP(e,t)}function yP(e,t){return yP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},yP(e,t)}function zS(e,t,n){return t=rY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rY(e){var t=Qje(e,"string");return Vg(t)=="symbol"?t:t+""}function Qje(e,t){if(Vg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Vg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eSe(e,t){if(e==null)return{};var n=tSe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tSe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function nSe(e){return e.value}function rSe(e,t){if(ue.isValidElement(e))return ue.cloneElement(e,t);if(typeof e=="function")return ue.createElement(e,t);t.ref;var n=eSe(t,Hje);return ue.createElement(k3,n)}var D$=1,rg=function(e){function t(){var n;Gje(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Kje(this,t,[].concat(a)),zS(n,"lastBoundingBox",{width:-1,height:-1}),n}return Jje(t,e),Yje(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>D$||Math.abs(a.height-this.lastBoundingBox.height)>D$)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?zc({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,i=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,p;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var h=this.getBBoxSnapshot();f={left:((u||0)-h.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var m=this.getBBoxSnapsh
587ot();p={top:((d||0)-m.height)/2}}else p=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return zc(zc({},f),p)}},{key:"render",value:function(){var r=this,a=this.props,i=a.content,o=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=zc(zc({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return ue.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){r.wrapperNode=h}},rSe(i,zc(zc({},this.props),{},{payload:tY(d,u,nSe)})))}}],[{key:"getWithHeight",value:function(r,a){var i=zc(zc({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&gt(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])}(x.PureComponent);zS(rg,"displayName","Legend");zS(rg,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var F$=Pb,aSe=C3,iSe=Us,B$=F$?F$.isConcatSpreadable:void 0;function sSe(e){return iSe(e)||aSe(e)||!!(B$&&e&&e[B$])}var oSe=sSe,lSe=qG,cSe=oSe;function aY(e,t,n,r,a){var i=-1,o=e.length;for(n||(n=cSe),a||(a=[]);++i<o;){var l=e[i];t>0&&n(l)?t>1?aY(l,t-1,n,r,a):lSe(a,l):r||(a[a.length]=l)}return a}var iY=aY;function uSe(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++a];if(n(i[c],c,i)===!1)break}return t}}var dSe=uSe,fSe=dSe,hSe=fSe(),pSe=hSe,mSe=pSe,gSe=O3;function vSe(e,t){return e&&mSe(e,t,gSe)}var sY=vSe,ySe=US;function xSe(e,t){return function(n,r){if(n==null)return n;if(!ySe(n))return e(n,r);for(var a=n.length,i=t?a:-1,o=Object(n);(t?i--:++i<a)&&r(o[i],i,o)!==!1;);return n}}var bSe=xSe,wSe=sY,_Se=bSe,jSe=_Se(wSe),I3=jSe,SSe=I3,NSe=US;function ASe(e,t){var n=-1,r=NSe(e)?Array(e.length):[];return SSe(e,function(a,i,o){r[++n]=t(a,i,o)}),r}var oY=ASe;function kSe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var ESe=kSe,U$=Uv;function CSe(e,t){if(e!==t){var n=e!==void 0,r=e===null,a=e===e,i=U$(e),o=t!==void 0,l=t===null,c=t===t,u=U$(t);if(!l&&!u&&!i&&e>t||i&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!a)return 1;if(!r&&!i&&!u&&e<t||u&&n&&a&&!r&&!i||l&&n&&a||!o&&a||!c)return-1}return 0}var PSe=CSe,TSe=PSe;function OSe(e,t,n){for(var r=-1,a=e.criteria,i=t.criteria,o=a.length,l=n.length;++r<o;){var c=TSe(a[r],i[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var RSe=OSe,PA=v3,ISe=y3,LSe=jf,MSe=oY,$Se=ESe,DSe=GG,FSe=RSe,BSe=Yv,USe=Us;function zSe(e,t,n){t.length?t=PA(t,function(i){return USe(i)?function(o){return ISe(o,i.length===1?i[0]:i)}:i}):t=[BSe];var r=-1;t=PA(t,DSe(LSe));var a=MSe(e,function(i,o,l){var c=PA(t,function(u){return u(i)});return{criteria:c,index:++r,value:i}});return $Se(a,function(i,o){return FSe(i,o,n)})}var WSe=zSe;function qSe(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var VSe=qSe,HSe=VSe,z$=Math.max;function GSe(e,t,n){return t=z$(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,i=z$(r.length-t,0),o=Array(i);++a<i;)o[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(o),HSe(e,this,l)}}var YSe=GSe;function KSe(e){return function(){return e}}var ZSe=KSe,XSe=Np,JSe=function(){try{var e=XSe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),lY=JSe,QSe=ZSe,W$=lY,eNe=Yv,tNe=W$?function(e,t){return W$(e,"toString",{configurable:!0,enumerable:!1,value:QSe(t),writable:!0})}:eNe,nNe=tNe,rNe=800,aNe=16,iNe=Date.now;function sNe(e){var t=0,n=0;return function(){var r=iNe(),a=aNe-(r-n);if(n=r,a>0){if(++t>=rNe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var oNe=sNe,lNe=nNe,cNe=oNe,uNe=cNe(lNe),dNe=uNe,fNe=Yv,hNe=YSe,pNe=dNe;function mNe(e,t){return pNe(hNe(e,t,fNe),e+"")}var gNe=mNe,vNe=h3,yNe=US,xNe=P3,bNe=_f;function wNe(e,t,n){if(!bNe(n))return!1;var r=typeof t;return(r=="number"?yNe(n)&&xNe(t,n.length):r=="string"&&t in n)?vNe(n[t],e):!1}var WS=wNe,_Ne=iY,jNe=WSe,SNe=gNe,q$=WS,NNe=SNe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&q$(e,t[0],t[1])?t=[]:n>2&&q$(t[0],t[1],t[2])&&(t=[t[0]]),jNe(e,_Ne(t,1),[])}),ANe=NNe;const L3=mr(ANe);function xx(e){"@babel/helpers - typeof";return xx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xx(e)}function xP(){return xP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xP.apply(this,arguments)}function kNe(e,t){return TNe(e)||PNe(e,t)||CNe(e,t)||ENe()}
vendor: 29,175 bytes, lines 587-594
587function ENe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
588In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CNe(e,t){if(e){if(typeof e=="string")return V$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V$(e,t)}}function V$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PNe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function TNe(e){if(Array.isArray(e))return e}function H$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function TA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H$(Object(n),!0).forEach(function(r){ONe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ONe(e,t,n){return t=RNe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RNe(e){var t=INe(e,"string");return xx(t)=="symbol"?t:t+""}function INe(e,t){if(xx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(xx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LNe(e){return Array.isArray(e)&&li(e[0])&&li(e[1])?e.join(" ~ "):e}var MNe=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,p=t.itemSorter,h=t.wrapperClassName,m=t.labelClassName,g=t.label,v=t.labelFormatter,y=t.accessibilityLayer,b=y===void 0?!1:y,w=function(){if(d&&d.length){var I={padding:0,margin:0},D=(p?L3(d,p):d).map(function(U,q){if(U.type==="none")return null;var Z=TA({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},l),H=U.formatter||f||LNe,$=U.value,W=U.name,ee=$,V=W;if(H&&ee!=null&&V!=null){var O=H($,W,U,q,d);if(Array.isArray(O)){var M=kNe(O,2);ee=M[0],V=M[1]}else ee=O}return ue.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(q),style:Z},li(V)?ue.createElement("span",{className:"recharts-tooltip-item-name"},V):null,li(V)?ue.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,ue.createElement("span",{className:"recharts-tooltip-item-value"},ee),ue.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return ue.createElement("ul",{className:"recharts-tooltip-item-list",style:I},D)}return null},j=TA({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),S=TA({margin:0},u),A=!In(g),E=A?g:"",k=Cn("recharts-default-tooltip",h),P=Cn("recharts-tooltip-label",m);A&&v&&d!==void 0&&d!==null&&(E=v(g,d));var R=b?{role:"status","aria-live":"assertive"}:{};return ue.createElement("div",xP({className:k,style:j},R),ue.createElement("p",{className:P,style:S},ue.isValidElement(E)?E:"".concat(E)),w())};function bx(e){"@babel/helpers - typeof";return bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bx(e)}function aw(e,t,n){return t=$Ne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ne(e){var t=DNe(e,"string");return bx(t)=="symbol"?t:t+""}function DNe(e,t){if(bx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(bx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ry="recharts-tooltip-wrapper",FNe={visibility:"hidden"};function BNe(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Cn(Ry,aw(aw(aw(aw({},"".concat(Ry,"-right"),gt(n)&&t&&gt(t.x)&&n>=t.x),"".concat(Ry,"-left"),gt(n)&&t&&gt(t.x)&&n<t.x),"".concat(Ry,"-bottom"),gt(r)&&t&&gt(t.y)&&r>=t.y),"".concat(Ry,"-top"),gt(r)&&t&&gt(t.y)&&r<t.y))}function G$(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&gt(i[r]))return i[r];var d=n[r]-l-a,f=n[r]+a;if(t[r])return o[r]?d:f;if(o[r]){var p=d,h=c[r];return p<h?Math.max(f,c[r]):Math.max(d,c[r])}var m=f+l,g=c[r]+u;return m>g?Math.max(d,c[r]):Math.max(f,c[r])}function UNe(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function zNe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=G$({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=G$({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=UNe({translateX:d,translateY:f,useTranslate3d:l})):u=FNe,{cssProperties:u,cssClasses:BNe({translateX:d,translateY:f,coordinate:n})}}function Hg(e){"@babel/helpers - typeof";return Hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hg(e)}function Y$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function K$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y$(Object(n),!0).forEach(function(r){wP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qNe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,uY(r.key),r)}}function VNe(e,t,n){return t&&qNe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HNe(e,t,n){return t=w2(t),GNe(e,cY()?Reflect.construct(t,n||[],w2(e).constructor):t.apply(e,n))}function GNe(e,t){if(t&&(Hg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YNe(e)}function YNe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cY=function(){return!!e})()}function w2(e){return w2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},w2(e)}function KNe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bP(e,t)}function bP(e,t){return bP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},bP(e,t)}function wP(e,t,n){return t=uY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uY(e){var t=ZNe(e,"string");return Hg(t)=="symbol"?t:t+""}function ZNe(e,t){if(Hg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Z$=1,XNe=function(e){function t(){var n;WNe(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=HNe(this,t,[].concat(a)),wP(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),wP(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return KNe(t,e),VNe(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>Z$||Math.abs(r.height-this.state.lastBoundingBox.height)>Z$)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,p=a.isAnimationActive,h=a.offset,m=a.position,g=a.reverseDirection,v=a.useTranslate3d,y=a.viewBox,b=a.wrapperStyle,w=zNe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:h,position:m,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:y}),j=w.cssClasses,S=w.cssProperties,A=K$(K$({transition:p&&i?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},b);return ue.createElement("div",{tabIndex:-1,className:j,style:A,ref:function(k){r.wrapperNode=k}},u)}}])}(x.PureComponent),JNe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},du={isSsr:JNe(),get:function(t){return du[t]},set:function(t,n){if(typeof t=="string")du[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(a){du[a]=t[a]})}}};function Gg(e){"@babel/helpers - typeof";return Gg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gg(e)}function X$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function J$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X$(Object(n),!0).forEach(function(r){M3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e5e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fY(r.key),r)}}function t5e(e,t,n){return t&&e5e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function n5e(e,t,n){return t=_2(t),r5e(e,dY()?Reflect.construct(t,n||[],_2(e).constructor):t.apply(e,n))}function r5e(e,t){if(t&&(Gg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a5e(e)}function a5e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dY=function(){return!!e})()}function _2(e){return _2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_2(e)}function i5e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_P(e,t)}function _P(e,t){return _P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_P(e,t)}function M3(e,t,n){return t=fY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fY(e){var t=s5e(e,"string");return Gg(t)=="symbol"?t:t+""}function s5e(e,t){if(Gg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function o5e(e){return e.dataKey}function l5e(e,t){return ue.isValidElement(e)?ue.cloneElement(e,t):typeof e=="function"?ue.createElement(e,t):ue.createElement(MNe,t)}var Yc=function(e){function t(){return QNe(this,t),n5e(this,t,arguments)}return i5e(t,e),t5e(t,[{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,p=a.isAnimationActive,h=a.offset,m=a.payload,g=a.payloadUniqBy,v=a.position,y=a.reverseDirection,b=a.useTranslate3d,w=a.viewBox,j=a.wrapperStyle,S=m??[];f&&S.length&&(S=tY(m.filter(function(E){return E.value!=null&&(E.hide!==!0||r.props.includeHidden)}),g,o5e));var A=S.length>0;return ue.createElement(XNe,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:p,active:i,coordinate:d,hasPayload:A,offset:h,position:v,reverseDirection:y,useTranslate3d:b,viewBox:w,wrapperStyle:j},l5e(u,J$(J$({},this.props),{},{payload:S})))}}])}(x.PureComponent);M3(Yc,"displayName","Tooltip");M3(Yc,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!du.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var c5e=Nc,u5e=function(){return c5e.Date.now()},d5e=u5e,f5e=/\s/;function h5e(e){for(var t=e.length;t--&&f5e.test(e.charAt(t)););return t}var p5e=h5e,m5e=p5e,g5e=/^\s+/;function v5e(e){return e&&e.slice(0,m5e(e)+1).replace(g5e,"")}var y5e=v5e,x5e=y5e,Q$=_f,b5e=Uv,eD=NaN,w5e=/^[-+]0x[0-9a-f]+$/i,_5e=/^0b[01]+$/i,j5e=/^0o[0-7]+$/i,S5e=parseInt;function N5e(e){if(typeof e=="number")return e;if(b5e(e))return eD;if(Q$(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Q$(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=x5e(e);var n=_5e.test(e);return n||j5e.test(e)?S5e(e.slice(2),n?2:8):w5e.test(e)?eD:+e}var hY=N5e,A5e=_f,OA=d5e,tD=hY,k5e="Expected a function",E5e=Math.max,C5e=Math.min;function P5e(e,t,n){var r,a,i,o,l,c,u=0,d=!1,f=!1,p=!0;if(typeof e!="function")throw new TypeError(k5e);t=tD(t)||0,A5e(n)&&(d=!!n.leading,f="maxWait"in n,i=f?E5e(tD(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p);function h(A){var E=r,k=a;return r=a=void 0,u=A,o=e.apply(k,E),o}function m(A){return u=A,l=setTimeout(y,t),d?h(A):o}function g(A){var E=A-c,k=A-u,P=t-E;return f?C5e(P,i-k):P}function v(A){var E=A-c,k=A-u;return c===void 0||E>=t||E<0||f&&k>=i}function y(){var A=OA();if(v(A))return b(A);l=setTimeout(y,g(A))}function b(A){return l=void 0,p&&r?h(A):(r=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function j(){return l===void 0?o:b(OA())}function S(){var A=OA(),E=v(A);if(r=arguments,a=this,c=A,E){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(y,t),h(c)}return l===void 0&&(l=setTimeout(y,t)),o}return S.cancel=w,S.flush=j,S}var T5e=P5e,O5e=T5e,R5e=_f,I5e="Expected a function";function L5e(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(I5e);return R5e(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),O5e(e,t,{leading:r,maxWait:t,trailing:a})}var M5e=L5e;const pY=mr(M5e);function wx(e){"@babel/helpers - typeof";return wx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wx(e)}function nD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function iw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nD(Object(n),!0).forEach(function(r){$5e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $5e(e,t,n){return t=D5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D5e(e){var t=F5e(e,"string");return wx(t)=="symbol"?t:t+""}function F5e(e,t){if(wx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(wx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function B5e(e,t){return q5e(e)||W5e(e,t)||z5e(e,t)||U5e()}function U5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
589In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z5e(e,t){if(e){if(typeof e=="string")return rD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rD(e,t)}}function rD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function W5e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function q5e(e){if(Array.isArray(e))return e}var mY=x.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,p=e.maxHeight,h=e.children,m=e.debounce,g=m===void 0?0:m,v=e.id,y=e.className,b=e.onResize,w=e.style,j=w===void 0?{}:w,S=x.useRef(null),A=x.useRef();A.current=b,x.useImperativeHandle(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),S.current},configurable:!0})});var E=x.useState({containerWidth:a.width,containerHeight:a.height}),k=B5e(E,2),P=k[0],R=k[1],C=x.useCallback(function(D,U){R(function(q){var Z=Math.round(D),H=Math.round(U);return q.containerWidth===Z&&q.containerHeight===H?q:{containerWidth:Z,containerHeight:H}})},[]);x.useEffect(function(){var D=function(W){var ee,V=W[0].contentRect,O=V.width,M=V.height;C(O,M),(ee=A.current)===null||ee===void 0||ee.call(A,O,M)};g>0&&(D=pY(D,g,{trailing:!0,leading:!1}));var U=new ResizeObserver(D),q=S.current.getBoundingClientRect(),Z=q.width,H=q.height;return C(Z,H),U.observe(S.current),function(){U.disconnect()}},[C,g]);var I=x.useMemo(function(){var D=P.containerWidth,U=P.containerHeight;if(D<0||U<0)return null;uu(_h(o)||_h(c),`The width(%s) and height(%s) are both fixed numbers,
590       maybe you don't need to use a ResponsiveContainer.`,o,c),uu(!n||n>0,"The aspect(%s) must be greater than zero.",n);var q=_h(o)?D:o,Z=_h(c)?U:c;n&&n>0&&(q?Z=q/n:Z&&(q=Z*n),p&&Z>p&&(Z=p)),uu(q>0||Z>0,`The width(%s) and height(%s) of chart should be greater than 0,
591       please check the style of container, or the props width(%s) and height(%s),
592       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
593       height and width.`,q,Z,o,c,d,f,n);var H=!Array.isArray(h)&&cu(h.type).endsWith("Chart");return ue.Children.map(h,function($){return ue.isValidElement($)?x.cloneElement($,iw({width:q,height:Z},H?{style:iw({height:"100%",width:"100%",maxHeight:Z,maxWidth:q},$.props.style)}:{})):$})},[n,h,c,p,f,d,P,o]);return ue.createElement("div",{id:v?"".concat(v):void 0,className:Cn("recharts-responsive-container",y),style:iw(iw({},j),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:p}),ref:S},I)}),Rb=function(t){return null};Rb.displayName="Cell";function _x(e){"@babel/helpers - typeof";return _x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_x(e)}function aD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function jP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aD(Object(n),!0).forEach(function(r){V5e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V5e(e,t,n){return t=H5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H5e(e){var t=G5e(e,"string");return _x(t)=="symbol"?t:t+""}function G5e(e,t){if(_x(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_x(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nm={widthCache:{},cacheCount:0},Y5e=2e3,K5e={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},iD="recharts_measurement_span";function Z5e(e){var t=jP({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var A0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||du.isSsr)return{width:0,height:0};var r=Z5e(n),a=JSON.stringify({text:t,copyStyle:r});if(nm.widthCache[a])return nm.widthCache[a];try{var i=document.getElementById(iD);i||(i=document.createElement("span"),i.setAttribute("id",iD),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=jP(jP({},K5e),r);Object.assign(i.style,o),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return nm.widthCache[a]=c,++nm.cacheCount>Y5e&&(nm.cacheCount=0,nm.widthCache={}),c}catch{return{width:0,height:0}}},X5e=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function jx(e){"@babel/helpers - typeof";return jx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jx(e)}function j2(e,t){return tAe(e)||eAe(e,t)||Q5e(e,t)||J5e()}function J5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
594In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q5e(e,t){if(e){if(typeof e=="string")return sD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sD(e,t)}}function sD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eAe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function tAe(e){if(Array.isArray(e))return e}function nAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,aAe(r.key),r)}}function rAe(e,t,n){return t&&oD(e.prototype,t),n&&oD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function aAe(e){var t=iAe(e,"string");return jx(t)=="symbol"?t:t+""}function iAe(e,t){if(jx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var lD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,cD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,sAe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,oAe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,gY={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},lAe=Object.keys(gY),Fm="NaN";function cAe(e,t){return e*gY[t]}var sw=function(){function e(t,n){nAe(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!sAe.test(n)&&(this.num=NaN,this.unit=""),lAe.includes(n)&&(this.num=cAe(t,n),this.unit="px")}return rAe(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=oAe.exec(n))!==null&&r!==void 0?r:[],i=j2(a,3),o=i[1],l=i[2];return new e(parseFloat(o),l??"")}}])}();function vY(e){if(e.includes(Fm))return Fm;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=lD.exec(t))!==null&&n!==void 0?n:[],a=j2(r,4),i=a[1],o=a[2],l=a[3],c=sw.parse(i??""),u=sw.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return Fm;t=t.replace(lD,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,p=(f=cD.exec(t))!==null&&f!==void 0?f:[],h=j2(p,4),m=h[1],g=h[2],v=h[3],y=sw.parse(m??""),b=sw.parse(v??""),w=g==="+"?y.add(b):y.subtract(b);if(w.isNaN())return Fm;t=t.replace(cD,w.toString())}return t}var uD=/\(([^()]*)\)/;function uAe(e){for(var t=e;t.includes("(");){var n=uD.exec(t),r=j2(n,2),a=r[1];t=t.replace(uD,vY(a))}return t}function dAe(e){var t=e.replace(/\s+/g,"");return t=uAe(t),t=vY(t),t}function fAe(e){try{return dAe(e)}catch{return Fm}}function RA(e){var t=fAe(e.slice(5,-1));return t===Fm?"":t}var hAe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],pAe=["dx","dy","angle","className","breakAll"];function SP(){return SP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SP.apply(this,arguments)}function dD(e,t){if(e==null)return{};var n=mAe(e,t),r,a;
594if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function mAe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fD(e,t){return xAe(e)||yAe(e,t)||vAe(e,t)||gAe()}function gAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
595In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vAe(e,t){if(e){if(typeof e=="string")return hD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hD(e,t)}}function hD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yAe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function xAe(e){if(Array.isArray(e))return e}var yY=/[ \f\n\r\t\v\u2028\u2029]+/,xY=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];In(n)||(r?i=n.toString().split(""):i=n.toString().split(yY));var o=i.map(function(c){return{word:c,width:A0(c,a).width}}),l=r?0:A0(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},bAe=function(t,n,r,a,i){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=gt(o),f=l,p=function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return q.reduce(function(Z,H){var $=H.word,W=H.width,ee=Z[Z.length-1];if(ee&&(a==null||i||ee.width+W+r<Number(a)))ee.words.push($),ee.width+=W+r;else{var V={words:[$],width:W};Z.push(V)}return Z},[])},h=p(n),m=function(q){return q.reduce(function(Z,H){return Z.width>H.width?Z:H})};if(!d)return h;for(var g="…",v=function(q){var Z=f.slice(0,q),H=xY({breakAll:u,style:c,children:Z+g}).wordsWithComputedWidth,$=p(H),W=$.length>o||m($).width>Number(a);return[W,$]},y=0,b=f.length-1,w=0,j;y<=b&&w<=f.length-1;){var S=Math.floor((y+b)/2),A=S-1,E=v(A),k=fD(E,2),P=k[0],R=k[1],C=v(S),I=fD(C,1),D=I[0];if(!P&&!D&&(y=S+1),P&&D&&(b=S-1),!P&&D){j=R;break}w++}return j||h},pD=function(t){var n=In(t)?[]:t.toString().split(yY);return[{words:n}]},wAe=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!du.isSsr){var c,u,d=xY({breakAll:o,children:a,style:i});if(d){var f=d.wordsWithComputedWidth,p=d.spaceWidth;c=f,u=p}else return pD(a);return bAe({breakAll:o,children:a,maxLines:l,style:i},c,u,n,r)}return pD(a)},mD="#808080",sp=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,p=t.textAnchor,h=p===void 0?"start":p,m=t.verticalAnchor,g=m===void 0?"end":m,v=t.fill,y=v===void 0?mD:v,b=dD(t,hAe),w=x.useMemo(function(){return wAe({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:f,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,f,b.style,b.width]),j=b.dx,S=b.dy,A=b.angle,E=b.className,k=b.breakAll,P=dD(b,pAe);if(!li(r)||!li(i))return null;var R=r+(gt(j)?j:0),C=i+(gt(S)?S:0),I;switch(g){case"start":I=RA("calc(".concat(u,")"));break;case"middle":I=RA("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:I=RA("calc(".concat(w.length-1," * -").concat(l,")"));break}var D=[];if(f){var U=w[0].width,q=b.width;D.push("scale(".concat((gt(q)?q/U:1)/U,")"))}return A&&D.push("rotate(".concat(A,", ").concat(R,", ").concat(C,")")),D.length&&(P.transform=D.join(" ")),ue.createElement("text",SP({},cn(P,!0),{x:R,y:C,className:Cn("recharts-text",E),textAnchor:h,fill:y.includes("url")?mD:y}),w.map(function(Z,H){var $=Z.words.join(k?"":" ");return ue.createElement("tspan",{x:R,dy:H===0?I:l,key:"".concat($,"-").concat(H)},$)}))};function Hd(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _Ae(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function $3(e){let t,n,r;e.length!==2?(t=Hd,n=(l,c)=>Hd(e(l),c),r=(l,c)=>e(l)-c):(t=e===Hd||e===_Ae?e:jAe,n=e,r=e);function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:a,center:o,right:i}}function jAe(){return 0}function bY(e){return e===null?NaN:+e}function*SAe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}
595const NAe=$3(Hd),Ib=NAe.right;$3(bY).center;class gD extends Map{constructor(t,n=EAe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(vD(this,t))}has(t){return super.has(vD(this,t))}set(t,n){return super.set(AAe(this,t),n)}delete(t){return super.delete(kAe(this,t))}}function vD({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function AAe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function kAe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function EAe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function CAe(e=Hd){if(e===Hd)return wY;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function wY(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const PAe=Math.sqrt(50),TAe=Math.sqrt(10),OAe=Math.sqrt(2);function S2(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=PAe?10:i>=TAe?5:i>=OAe?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?S2(e,t,n*2):[l,c,u]}function NP(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,i,o]=r?S2(t,e,n):S2(e,t,n);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(i-u)/-o;else for(let u=0;u<l;++u)c[u]=(i-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(a+u)/-o;else for(let u=0;u<l;++u)c[u]=(a+u)*o;return c}function AP(e,t,n){return t=+t,e=+e,n=+n,S2(e,t,n)[2]}function kP(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?AP(t,e,n):AP(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function yD(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function xD(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function _Y(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?wY:CAe(a);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),p=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/c+p)),m=Math.min(r,Math.floor(t+(c-u)*f/c+p));_Y(e,t,h,m,a)}const i=e[t];let o=n,l=r;for(Iy(e,n,t),a(e[r],i)>0&&Iy(e,n,r);o<l;){for(Iy(e,o,l),++o,--l;a(e[o],i)<0;)++o;for(;a(e[l],i)>0;)--l}a(e[n],i)===0?Iy(e,n,l):(++l,Iy(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Iy(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function RAe(e,t,n){if(e=Float64Array.from(SAe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return xD(e);if(t>=1)return yD(e);var r,a=(r-1)*t,i=Math.floor(a),o=yD(_Y(e,i).subarray(0,i+1)),l=xD(e.subarray(i+1));return o+(l-o)*(a-i)}}function IAe(e,t,n=bY){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,i=Math.floor(a),o=+n(e[i],i,e),l=+n(e[i+1],i+1,e);return o+(l-o)*(a-i)}}function LAe(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function Qo(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ru(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const EP=Symbol("implicit");function D3(){var e=new gD,t=[],n=[],r=EP;function a(i){let o=e.get(i);if(o===void 0){if(r!==EP)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new gD;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return D3(t,n).unknown(r)},Qo.apply(a,arguments),a}function Sx(){var e=D3().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var p=t().length,h=a<r,m=h?a:r,g=h?r:a;i=(g-m)/Math.max(1,p-c+u*2),l&&(i=Math.floor(i)),m+=(g-m-i*(p-c))*d,o=i*(1-c),l&&(m=Math.round(m),o=Math.round(o));var v=LAe(p).map(function(y){return m+i*y});return n(h?v.reverse():v)}return e.domain=function(p){return arguments.length?(t(p),f()):t()},e.range=function(p){return arguments.length?([r,a]=p,r=+r,a=+a,f()):[r,a]},e.rangeRound=function(p){return[r,a]=p,r=+r,a=+a,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(p){return arguments.length?(l=!!p,f()):l},e.padding=function(p){return arguments.length?(c=Math.min(1,u=+p),f()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),f()):c},e.paddingOuter=function(p){return arguments.length?(u=+p,f()):u},e.align=function(p){return arguments.length?(d=Math.max(0,Math.min(1,p)),f()):d},e.copy=function(){return Sx(t(),[r,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},Qo.apply(f(),arguments)}function jY(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return jY(t())},e}function k0(){return jY(Sx.apply(null,arguments).paddingInner(1))}function F3(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function SY(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}
vendor: 8,066 bytes, line 595
595function Lb(){}var Nx=.7,N2=1/Nx,ag="\\s*([+-]?\\d+)\\s*",Ax="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",MAe=/^#([0-9a-f]{3,8})$/,$Ae=new RegExp(`^rgb\\(${ag},${ag},${ag}\\)$`),DAe=new RegExp(`^rgb\\(${pc},${pc},${pc}\\)$`),FAe=new RegExp(`^rgba\\(${ag},${ag},${ag},${Ax}\\)$`),BAe=new RegExp(`^rgba\\(${pc},${pc},${pc},${Ax}\\)$`),UAe=new RegExp(`^hsl\\(${Ax},${pc},${pc}\\)$`),zAe=new RegExp(`^hsla\\(${Ax},${pc},${pc},${Ax}\\)$`),bD={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};F3(Lb,kx,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wD,formatHex:wD,formatHex8:WAe,formatHsl:qAe,formatRgb:_D,toString:_D});function wD(){return this.rgb().formatHex()}function WAe(){return this.rgb().formatHex8()}function qAe(){return NY(this).formatHsl()}function _D(){return this.rgb().formatRgb()}function kx(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=MAe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?jD(t):n===3?new Ts(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ow(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ow(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=$Ae.exec(e))?new Ts(t[1],t[2],t[3],1):(t=DAe.exec(e))?new Ts(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=FAe.exec(e))?ow(t[1],t[2],t[3],t[4]):(t=BAe.exec(e))?ow(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=UAe.exec(e))?AD(t[1],t[2]/100,t[3]/100,1):(t=zAe.exec(e))?AD(t[1],t[2]/100,t[3]/100,t[4]):bD.hasOwnProperty(e)?jD(bD[e]):e==="transparent"?new Ts(NaN,NaN,NaN,0):null}function jD(e){return new Ts(e>>16&255,e>>8&255,e&255,1)}function ow(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ts(e,t,n,r)}function VAe(e){return e instanceof Lb||(e=kx(e)),e?(e=e.rgb(),new Ts(e.r,e.g,e.b,e.opacity)):new Ts}function CP(e,t,n,r){return arguments.length===1?VAe(e):new Ts(e,t,n,r??1)}function Ts(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}F3(Ts,CP,SY(Lb,{brighter(e){return e=e==null?N2:Math.pow(N2,e),new Ts(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nx:Math.pow(Nx,e),new Ts(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ts(Wh(this.r),Wh(this.g),Wh(this.b),A2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:SD,formatHex:SD,formatHex8:HAe,formatRgb:ND,toString:ND}));function SD(){return`#${jh(this.r)}${jh(this.g)}${jh(this.b)}`}function HAe(){return`#${jh(this.r)}${jh(this.g)}${jh(this.b)}${jh((isNaN(this.opacity)?1:this.opacity)*255)}`}function ND(){const e=A2(this.opacity);return`${e===1?"rgb(":"rgba("}${Wh(this.r)}, ${Wh(this.g)}, ${Wh(this.b)}${e===1?")":`, ${e})`}`}function A2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wh(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jh(e){return e=Wh(e),(e<16?"0":"")+e.toString(16)}function AD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new jl(e,t,n,r)}function NY(e){if(e instanceof jl)return new jl(e.h,e.s,e.l,e.opacity);if(e instanceof Lb||(e=kx(e)),!e)return new jl;if(e instanceof jl)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,l=i-a,c=(i+a)/2;return l?(t===i?o=(n-r)/l+(n<r)*6:n===i?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new jl(o,l,c,e.opacity)}function GAe(e,t,n,r){return arguments.length===1?NY(e):new jl(e,t,n,r??1)}function jl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}F3(jl,GAe,SY(Lb,{brighter(e){return e=e==null?N2:Math.pow(N2,e),new jl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nx:Math.pow(Nx,e),new jl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Ts(IA(e>=240?e-240:e+120,a,r),IA(e,a,r),IA(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new jl(kD(this.h),lw(this.s),lw(this.l),A2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=A2(this.opacity);return`${e===1?"hsl(":"hsla("}${kD(this.h)}, ${lw(this.s)*100}%, ${lw(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kD(e){return e=(e||0)%360,e<0?e+360:e}function lw(e){return Math.max(0,Math.min(1,e||0))}function IA(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const B3=e=>()=>e;function YAe(e,t){return function(n){return e+n*t}}function KAe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function ZAe(e){return(e=+e)==1?AY:function(t,n){return n-t?KAe(t,n,e):B3(isNaN(t)?n:t)}}function AY(e,t){var n=t-e;return n?YAe(e,n):B3(isNaN(e)?t:e)}const ED=function e(t){var n=ZAe(t);function r(a,i){var o=n((a=CP(a)).r,(i=CP(i)).r),l=n(a.g,i.g),c=n(a.b,i.b),u=AY(a.opacity,i.opacity);return function(d){return a.r=o(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return r.gamma=e,r}(1);function XAe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function JAe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function QAe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=Kv(e[o],t[o]);for(;o<n;
vendor: 5,514 bytes, line 595
595++o)i[o]=t[o];return function(l){for(o=0;o<r;++o)i[o]=a[o](l);return i}}function eke(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function k2(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function tke(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Kv(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var PP=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,LA=new RegExp(PP.source,"g");function nke(e){return function(){return e}}function rke(e){return function(t){return e(t)+""}}function ake(e,t){var n=PP.lastIndex=LA.lastIndex=0,r,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=PP.exec(e))&&(a=LA.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(r=r[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:k2(r,a)})),n=LA.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?rke(c[0].x):nke(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function Kv(e,t){var n=typeof t,r;return t==null||n==="boolean"?B3(t):(n==="number"?k2:n==="string"?(r=kx(t))?(t=r,ED):ake:t instanceof kx?ED:t instanceof Date?eke:JAe(t)?XAe:Array.isArray(t)?QAe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?tke:k2)(e,t)}function U3(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ike(e,t){t===void 0&&(t=e,e=Kv);for(var n=0,r=t.length-1,a=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(a,a=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return i[l](o-l)}}function ske(e){return function(){return e}}function E2(e){return+e}var CD=[0,1];function hs(e){return e}function TP(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ske(isNaN(t)?NaN:.5)}function oke(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function lke(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=TP(a,r),i=n(o,i)):(r=TP(r,a),i=n(i,o)),function(l){return i(r(l))}}function cke(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=TP(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(l){var c=Ib(e,l,1,r)-1;return i[c](a[c](l))}}function Mb(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function qS(){var e=CD,t=CD,n=Kv,r,a,i,o=hs,l,c,u;function d(){var p=Math.min(e.length,t.length);return o!==hs&&(o=oke(e[0],e[p-1])),l=p>2?cke:lke,c=u=null,f}function f(p){return p==null||isNaN(p=+p)?i:(c||(c=l(e.map(r),t,n)))(r(o(p)))}return f.invert=function(p){return o(a((u||(u=l(t,e.map(r),k2)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,E2),d()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),n=U3,d()},f.clamp=function(p){return arguments.length?(o=p?!0:hs,d()):o!==hs},f.interpolate=function(p){return arguments.length?(n=p,d()):n},f.unknown=function(p){return arguments.length?(i=p,f):i},function(p,h){return r=p,a=h,d()}}function z3(){return qS()(hs,hs)}function uke(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function C2(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Yg(e){return e=C2(Math.abs(e)),e?e[1]:NaN}function dke(e,t){return function(n,r){for(var a=n.length,i=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),i.push(n.substring(a-=l,a+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function fke(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var hke=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ex(e){if(!(t=hke.exec(e)))throw new Error("invalid format: "+e);var t;return new W3({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ex.prototype=W3.prototype;function W3(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}W3.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function pke(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var kY;function mke(e,t){var n=C2(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(kY=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+C2(e,Math.max(0,t+i-1))[0]}function PD(e,t){var n=C2(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const TD={"%":(e,t)=>
vendor: 5,608 bytes, line 595
595(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:uke,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>PD(e*100,t),r:PD,s:mke,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function OD(e){return e}var RD=Array.prototype.map,ID=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function gke(e){var t=e.grouping===void 0||e.thousands===void 0?OD:dke(RD.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?OD:fke(RD.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=Ex(f);var p=f.fill,h=f.align,m=f.sign,g=f.symbol,v=f.zero,y=f.width,b=f.comma,w=f.precision,j=f.trim,S=f.type;S==="n"?(b=!0,S="g"):TD[S]||(w===void 0&&(w=12),j=!0,S="g"),(v||p==="0"&&h==="=")&&(v=!0,p="0",h="=");var A=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=g==="$"?r:/[%p]/.test(S)?o:"",k=TD[S],P=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function R(C){var I=A,D=E,U,q,Z;if(S==="c")D=k(C)+D,C="";else{C=+C;var H=C<0||1/C<0;if(C=isNaN(C)?c:k(Math.abs(C),w),j&&(C=pke(C)),H&&+C==0&&m!=="+"&&(H=!1),I=(H?m==="("?m:l:m==="-"||m==="("?"":m)+I,D=(S==="s"?ID[8+kY/3]:"")+D+(H&&m==="("?")":""),P){for(U=-1,q=C.length;++U<q;)if(Z=C.charCodeAt(U),48>Z||Z>57){D=(Z===46?a+C.slice(U+1):C.slice(U))+D,C=C.slice(0,U);break}}}b&&!v&&(C=t(C,1/0));var $=I.length+C.length+D.length,W=$<y?new Array(y-$+1).join(p):"";switch(b&&v&&(C=t(W+C,W.length?y-D.length:1/0),W=""),h){case"<":C=I+C+D+W;break;case"=":C=I+W+C+D;break;case"^":C=W.slice(0,$=W.length>>1)+I+C+D+W.slice($);break;default:C=W+I+C+D;break}return i(C)}return R.toString=function(){return f+""},R}function d(f,p){var h=u((f=Ex(f),f.type="f",f)),m=Math.max(-8,Math.min(8,Math.floor(Yg(p)/3)))*3,g=Math.pow(10,-m),v=ID[8+m/3];return function(y){return h(g*y)+v}}return{format:u,formatPrefix:d}}var cw,q3,EY;vke({thousands:",",grouping:[3],currency:["$",""]});function vke(e){return cw=gke(e),q3=cw.format,EY=cw.formatPrefix,cw}function yke(e){return Math.max(0,-Yg(Math.abs(e)))}function xke(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Yg(t)/3)))*3-Yg(Math.abs(e)))}function bke(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Yg(t)-Yg(e))+1}function CY(e,t,n,r){var a=kP(e,t,n),i;switch(r=Ex(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=xke(a,o))&&(r.precision=i),EY(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=bke(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=yke(a))&&(r.precision=i-(r.type==="%")*2);break}}return q3(r)}function Sf(e){var t=e.domain;return e.ticks=function(n){var r=t();return NP(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return CY(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,o=r[a],l=r[i],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=a,a=i,i=u);d-- >0;){if(u=AP(o,l,n),u===c)return r[a]=o,r[i]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function P2(){var e=z3();return e.copy=function(){return Mb(e,P2())},Qo.apply(e,arguments),Sf(e)}function PY(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,E2),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return PY(e).unknown(t)},e=arguments.length?Array.from(e,E2):[0,1],Sf(n)}function TY(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],o;return i<a&&(o=n,n=r,r=o,o=a,a=i,i=o),e[n]=t.floor(a),e[r]=t.ceil(i),e}function LD(e){return Math.log(e)}function MD(e){return Math.exp(e)}function wke(e){return-Math.log(-e)}function _ke(e){return-Math.exp(-e)}function jke(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Ske(e){return e===10?jke:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Nke(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function $D(e){return(t,n)=>-e(-t,n)}function V3(e){const t=e(LD,MD),n=t.domain;let r=10,a,i;function o(){return a=Nke(r),i=Ske(r),n()[0]<0?(a=$D(a),i=$D(i),e(wke,_ke)):e(LD,MD),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let p=a(u),h=a(d),m,g;const v=l==null?10:+l;let y=[];if(!(r%1)&&h-p<v){if(p=Math.floor(p),h=Math.ceil(h),u>0){for(;p<=h;++p)for(m=1;m<r;++m)if(g=p<0?m/i(-p):m*i(p),!(g<u)){if(g>d)break;y.push(g)}}else for(;p<=h;++p)for(m=r-1;m>=1;--m)if(g=p>0?m/i(-p):m*i(p),!(g<u)){if(g>d)break;y.push(g)}y.length*2<v&&(y=NP(u,d,v))}else y=NP(p,h,Math.min(h-p,v)).map(i);return f?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Ex(c)).precision==null&&(c.trim=!0),c=q3(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/i(Math.round(a(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(TY(n(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function OY(){const e=V3(qS()).domain([1,10]);return e.copy=()=>Mb(e,OY()).base(e.base()),Qo.apply(e,arguments),e}
595function DD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function FD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function H3(e){var t=1,n=e(DD(t),FD(t));return n.constant=function(r){return arguments.length?e(DD(t=+r),FD(t)):t},Sf(n)}function RY(){var e=H3(qS());return e.copy=function(){return Mb(e,RY()).constant(e.constant())},Qo.apply(e,arguments)}function BD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ake(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function kke(e){return e<0?-e*e:e*e}function G3(e){var t=e(hs,hs),n=1;function r(){return n===1?e(hs,hs):n===.5?e(Ake,kke):e(BD(n),BD(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Sf(t)}function Y3(){var e=G3(qS());return e.copy=function(){return Mb(e,Y3()).exponent(e.exponent())},Qo.apply(e,arguments),e}function Eke(){return Y3.apply(null,arguments).exponent(.5)}function UD(e){return Math.sign(e)*e*e}function Cke(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function IY(){var e=z3(),t=[0,1],n=!1,r;function a(i){var o=Cke(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(UD(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,E2)).map(UD)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return IY(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Qo.apply(a,arguments),Sf(a)}function LY(){var e=[],t=[],n=[],r;function a(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=IAe(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?r:t[Ib(n,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Hd),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return LY().domain(e).range(t).unknown(r)},Qo.apply(i,arguments)}function MY(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(c){return c!=null&&c<=c?a[Ib(r,c,0,n)]:i}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return MY().domain([e,t]).range(a).unknown(i)},Qo.apply(Sf(o),arguments)}function $Y(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[Ib(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return $Y().domain(e).range(t).unknown(n)},Qo.apply(a,arguments)}const MA=new Date,$A=new Date;function fi(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),l=a.ceil(i);return i-o<l-i?o:l},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<o);return c},a.filter=i=>fi(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),n&&(a.count=(i,o)=>(MA.setTime(+i),$A.setTime(+o),e(MA),e($A),Math.floor(n(MA,$A))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?o=>r(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const T2=fi(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);T2.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?fi(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):T2);T2.range;const au=1e3,Uo=au*60,iu=Uo*60,wu=iu*24,K3=wu*7,zD=wu*30,DA=wu*365,Sh=fi(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*au)},(e,t)=>(t-e)/au,e=>e.getUTCSeconds());Sh.range;const Z3=fi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*au)},(e,t)=>{e.setTime(+e+t*Uo)},(e,t)=>(t-e)/Uo,e=>e.getMinutes());Z3.range;const X3=fi(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Uo)},(e,t)=>(t-e)/Uo,e=>e.getUTCMinutes());X3.range;const J3=fi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*au-e.getMinutes()*Uo)},(e,t)=>{e.setTime(+e+t*iu)},(e,t)=>(t-e)/iu,e=>e.getHours());J3.range;const Q3=fi(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*iu)},(e,t)=>(t-e)/iu,e=>e.getUTCHours());Q3.range;const $b=fi(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Uo)/wu,e=>e.getDate()-1);$b.range;const VS=fi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wu,e=>e.getUTCDate()-1);VS.range;const DY=fi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wu,e=>Math.floor(e/wu));DY.range;function Ap(e){return fi(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Uo)/K3)}const HS=Ap(0),O2=Ap(1),Pke=Ap(2),Tke=Ap(3),Kg=Ap(4),Oke=Ap(5),Rke=Ap(6);HS.range;O2.range;Pke.range;Tke.range;Kg.range;Oke.range;Rke.range;function kp(e){return fi(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/K3)}const GS=kp(0),R2=kp(1),Ike=kp(2),Lke=kp(3),Zg=kp(4),Mke=kp(5),$ke=kp(6);GS.range;R2.range;Ike.range;Lke.range;Zg.range;Mke.range;$ke.range;const eR=fi(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());eR.range;const tR=fi(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());tR.range;const _u=fi(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());_u.every=e=>
vendor: 6,053 bytes, line 595
595!isFinite(e=Math.floor(e))||!(e>0)?null:fi(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});_u.range;const ju=fi(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ju.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fi(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ju.range;function FY(e,t,n,r,a,i){const o=[[Sh,1,au],[Sh,5,5*au],[Sh,15,15*au],[Sh,30,30*au],[i,1,Uo],[i,5,5*Uo],[i,15,15*Uo],[i,30,30*Uo],[a,1,iu],[a,3,3*iu],[a,6,6*iu],[a,12,12*iu],[r,1,wu],[r,2,2*wu],[n,1,K3],[t,1,zD],[t,3,3*zD],[e,1,DA]];function l(u,d,f){const p=d<u;p&&([u,d]=[d,u]);const h=f&&typeof f.range=="function"?f:c(u,d,f),m=h?h.range(u,+d+1):[];return p?m.reverse():m}function c(u,d,f){const p=Math.abs(d-u)/f,h=$3(([,,v])=>v).right(o,p);if(h===o.length)return e.every(kP(u/DA,d/DA,f));if(h===0)return T2.every(Math.max(kP(u,d,f),1));const[m,g]=o[p/o[h-1][2]<o[h][2]/p?h-1:h];return m.every(g)}return[l,c]}const[Dke,Fke]=FY(ju,tR,GS,DY,Q3,X3),[Bke,Uke]=FY(_u,eR,HS,$b,J3,Z3);function FA(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function BA(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ly(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function zke(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=My(a),d=$y(a),f=My(i),p=$y(i),h=My(o),m=$y(o),g=My(l),v=$y(l),y=My(c),b=$y(c),w={a:H,A:$,b:W,B:ee,c:null,d:YD,e:YD,f:dEe,g:wEe,G:jEe,H:lEe,I:cEe,j:uEe,L:BY,m:fEe,M:hEe,p:V,q:O,Q:XD,s:JD,S:pEe,u:mEe,U:gEe,V:vEe,w:yEe,W:xEe,x:null,X:null,y:bEe,Y:_Ee,Z:SEe,"%":ZD},j={a:M,A:B,b:G,B:te,c:null,d:KD,e:KD,f:EEe,g:DEe,G:BEe,H:NEe,I:AEe,j:kEe,L:zY,m:CEe,M:PEe,p:ne,q:ce,Q:XD,s:JD,S:TEe,u:OEe,U:REe,V:IEe,w:LEe,W:MEe,x:null,X:null,y:$Ee,Y:FEe,Z:UEe,"%":ZD},S={a:R,A:C,b:I,B:D,c:U,d:HD,e:HD,f:aEe,g:VD,G:qD,H:GD,I:GD,j:eEe,L:rEe,m:Qke,M:tEe,p:P,q:Jke,Q:sEe,s:oEe,S:nEe,u:Gke,U:Yke,V:Kke,w:Hke,W:Zke,x:q,X:Z,y:VD,Y:qD,Z:Xke,"%":iEe};w.x=A(n,w),w.X=A(r,w),w.c=A(t,w),j.x=A(n,j),j.X=A(r,j),j.c=A(t,j);function A(oe,X){return function(se){var Q=[],ye=-1,ie=0,F=oe.length,me,Ae,Ne;for(se instanceof Date||(se=new Date(+se));++ye<F;)oe.charCodeAt(ye)===37&&(Q.push(oe.slice(ie,ye)),(Ae=WD[me=oe.charAt(++ye)])!=null?me=oe.charAt(++ye):Ae=me==="e"?" ":"0",(Ne=X[me])&&(me=Ne(se,Ae)),Q.push(me),ie=ye+1);return Q.push(oe.slice(ie,ye)),Q.join("")}}function E(oe,X){return function(se){var Q=Ly(1900,void 0,1),ye=k(Q,oe,se+="",0),ie,F;if(ye!=se.length)return null;if("Q"in Q)return new Date(Q.Q);if("s"in Q)return new Date(Q.s*1e3+("L"in Q?Q.L:0));if(X&&!("Z"in Q)&&(Q.Z=0),"p"in Q&&(Q.H=Q.H%12+Q.p*12),Q.m===void 0&&(Q.m="q"in Q?Q.q:0),"V"in Q){if(Q.V<1||Q.V>53)return null;"w"in Q||(Q.w=1),"Z"in Q?(ie=BA(Ly(Q.y,0,1)),F=ie.getUTCDay(),ie=F>4||F===0?R2.ceil(ie):R2(ie),ie=VS.offset(ie,(Q.V-1)*7),Q.y=ie.getUTCFullYear(),Q.m=ie.getUTCMonth(),Q.d=ie.getUTCDate()+(Q.w+6)%7):(ie=FA(Ly(Q.y,0,1)),F=ie.getDay(),ie=F>4||F===0?O2.ceil(ie):O2(ie),ie=$b.offset(ie,(Q.V-1)*7),Q.y=ie.getFullYear(),Q.m=ie.getMonth(),Q.d=ie.getDate()+(Q.w+6)%7)}else("W"in Q||"U"in Q)&&("w"in Q||(Q.w="u"in Q?Q.u%7:"W"in Q?1:0),F="Z"in Q?BA(Ly(Q.y,0,1)).getUTCDay():FA(Ly(Q.y,0,1)).getDay(),Q.m=0,Q.d="W"in Q?(Q.w+6)%7+Q.W*7-(F+5)%7:Q.w+Q.U*7-(F+6)%7);return"Z"in Q?(Q.H+=Q.Z/100|0,Q.M+=Q.Z%100,BA(Q)):FA(Q)}}function k(oe,X,se,Q){for(var ye=0,ie=X.length,F=se.length,me,Ae;ye<ie;){if(Q>=F)return-1;if(me=X.charCodeAt(ye++),me===37){if(me=X.charAt(ye++),Ae=S[me in WD?X.charAt(ye++):me],!Ae||(Q=Ae(oe,se,Q))<0)return-1}else if(me!=se.charCodeAt(Q++))return-1}return Q}function P(oe,X,se){var Q=u.exec(X.slice(se));return Q?(oe.p=d.get(Q[0].toLowerCase()),se+Q[0].length):-1}function R(oe,X,se){var Q=h.exec(X.slice(se));return Q?(oe.w=m.get(Q[0].toLowerCase()),se+Q[0].length):-1}function C(oe,X,se){var Q=f.exec(X.slice(se));return Q?(oe.w=p.get(Q[0].toLowerCase()),se+Q[0].length):-1}function I(oe,X,se){var Q=y.exec(X.slice(se));return Q?(oe.m=b.get(Q[0].toLowerCase()),se+Q[0].length):-1}function D(oe,X,se){var Q=g.exec(X.slice(se));return Q?(oe.m=v.get(Q[0].toLowerCase()),se+Q[0].length):-1}function U(oe,X,se){return k(oe,t,X,se)}function q(oe,X,se){return k(oe,n,X,se)}function Z(oe,X,se){return k(oe,r,X,se)}function H(oe){return o[oe.getDay()]}function $(oe){return i[oe.getDay()]}function W(oe){return c[oe.getMonth()]}function ee(oe){return l[oe.getMonth()]}function V(oe){return a[+(oe.getHours()>=12)]}function O(oe){return 1+~~(oe.getMonth()/3)}function M(oe){return o[oe.getUTCDay()]}function B(oe){return i[oe.getUTCDay()]}function G(oe){return c[oe.getUTCMonth()]}function te(oe){return l[oe.getUTCMonth()]}function ne(oe){return a[+(oe.getUTCHours()>=12)]}function ce(oe){return 1+~~(oe.getUTCMonth()/3)}return{format:function(oe){var X=A(oe+="",w);return X.toString=function(){return oe},X},parse:function(oe){var X=E(oe+="",!1);return X.toString=function(){return oe},X},utcFormat:function(oe){var X=A(oe+="",j);return X.toString=function(){return oe},X},utcParse:function(oe){var X=E(oe+="",!0);return X.toString=function(){return oe},X}}}var WD={"-":"",_:" ",0:"0"},wi=/^\s*\d+/,Wke=/^%/,qke=/[\\^$*+?|[\]().{}]/g;function ir(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function Vke(e){return e.replace(qke,"\\$&")}function My(e){return new RegExp("^(?:"+e.map(Vke).join("|")+")","i")}function $y(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Hke(e,t,n){var r=wi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Gke(e,t,n){var r=wi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Yke(e,t,n){var r=wi.exec(t.slice(n,n+2));
vendor: 4,106 bytes, line 595
595return r?(e.U=+r[0],n+r[0].length):-1}function Kke(e,t,n){var r=wi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Zke(e,t,n){var r=wi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function qD(e,t,n){var r=wi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function VD(e,t,n){var r=wi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Xke(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Jke(e,t,n){var r=wi.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Qke(e,t,n){var r=wi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function HD(e,t,n){var r=wi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function eEe(e,t,n){var r=wi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function GD(e,t,n){var r=wi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function tEe(e,t,n){var r=wi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function nEe(e,t,n){var r=wi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function rEe(e,t,n){var r=wi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function aEe(e,t,n){var r=wi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function iEe(e,t,n){var r=Wke.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function sEe(e,t,n){var r=wi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function oEe(e,t,n){var r=wi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function YD(e,t){return ir(e.getDate(),t,2)}function lEe(e,t){return ir(e.getHours(),t,2)}function cEe(e,t){return ir(e.getHours()%12||12,t,2)}function uEe(e,t){return ir(1+$b.count(_u(e),e),t,3)}function BY(e,t){return ir(e.getMilliseconds(),t,3)}function dEe(e,t){return BY(e,t)+"000"}function fEe(e,t){return ir(e.getMonth()+1,t,2)}function hEe(e,t){return ir(e.getMinutes(),t,2)}function pEe(e,t){return ir(e.getSeconds(),t,2)}function mEe(e){var t=e.getDay();return t===0?7:t}function gEe(e,t){return ir(HS.count(_u(e)-1,e),t,2)}function UY(e){var t=e.getDay();return t>=4||t===0?Kg(e):Kg.ceil(e)}function vEe(e,t){return e=UY(e),ir(Kg.count(_u(e),e)+(_u(e).getDay()===4),t,2)}function yEe(e){return e.getDay()}function xEe(e,t){return ir(O2.count(_u(e)-1,e),t,2)}function bEe(e,t){return ir(e.getFullYear()%100,t,2)}function wEe(e,t){return e=UY(e),ir(e.getFullYear()%100,t,2)}function _Ee(e,t){return ir(e.getFullYear()%1e4,t,4)}function jEe(e,t){var n=e.getDay();return e=n>=4||n===0?Kg(e):Kg.ceil(e),ir(e.getFullYear()%1e4,t,4)}function SEe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ir(t/60|0,"0",2)+ir(t%60,"0",2)}function KD(e,t){return ir(e.getUTCDate(),t,2)}function NEe(e,t){return ir(e.getUTCHours(),t,2)}function AEe(e,t){return ir(e.getUTCHours()%12||12,t,2)}function kEe(e,t){return ir(1+VS.count(ju(e),e),t,3)}function zY(e,t){return ir(e.getUTCMilliseconds(),t,3)}function EEe(e,t){return zY(e,t)+"000"}function CEe(e,t){return ir(e.getUTCMonth()+1,t,2)}function PEe(e,t){return ir(e.getUTCMinutes(),t,2)}function TEe(e,t){return ir(e.getUTCSeconds(),t,2)}function OEe(e){var t=e.getUTCDay();return t===0?7:t}function REe(e,t){return ir(GS.count(ju(e)-1,e),t,2)}function WY(e){var t=e.getUTCDay();return t>=4||t===0?Zg(e):Zg.ceil(e)}function IEe(e,t){return e=WY(e),ir(Zg.count(ju(e),e)+(ju(e).getUTCDay()===4),t,2)}function LEe(e){return e.getUTCDay()}function MEe(e,t){return ir(R2.count(ju(e)-1,e),t,2)}function $Ee(e,t){return ir(e.getUTCFullYear()%100,t,2)}function DEe(e,t){return e=WY(e),ir(e.getUTCFullYear()%100,t,2)}function FEe(e,t){return ir(e.getUTCFullYear()%1e4,t,4)}function BEe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Zg(e):Zg.ceil(e),ir(e.getUTCFullYear()%1e4,t,4)}function UEe(){return"+0000"}function ZD(){return"%"}function XD(e){return+e}function JD(e){return Math.floor(+e/1e3)}var rm,qY,VY;zEe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
595ay","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function zEe(e){return rm=zke(e),qY=rm.format,rm.parse,VY=rm.utcFormat,rm.utcParse,rm}function WEe(e){return new Date(e)}function qEe(e){return e instanceof Date?+e:+new Date(+e)}function nR(e,t,n,r,a,i,o,l,c,u){var d=z3(),f=d.invert,p=d.domain,h=u(".%L"),m=u(":%S"),g=u("%I:%M"),v=u("%I %p"),y=u("%a %d"),b=u("%b %d"),w=u("%B"),j=u("%Y");function S(A){return(c(A)<A?h:l(A)<A?m:o(A)<A?g:i(A)<A?v:r(A)<A?a(A)<A?y:b:n(A)<A?w:j)(A)}return d.invert=function(A){return new Date(f(A))},d.domain=function(A){return arguments.length?p(Array.from(A,qEe)):p().map(WEe)},d.ticks=function(A){var E=p();return e(E[0],E[E.length-1],A??10)},d.tickFormat=function(A,E){return E==null?S:u(E)},d.nice=function(A){var E=p();return(!A||typeof A.range!="function")&&(A=t(E[0],E[E.length-1],A??10)),A?p(TY(E,A)):d},d.copy=function(){return Mb(d,nR(e,t,n,r,a,i,o,l,c,u))},d}function VEe(){return Qo.apply(nR(Bke,Uke,_u,eR,HS,$b,J3,Z3,Sh,qY).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function HEe(){return Qo.apply(nR(Dke,Fke,ju,tR,GS,VS,Q3,X3,Sh,VY).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function YS(){var e=0,t=1,n,r,a,i,o=hs,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(a===0?.5:(f=(i(f)-n)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=i(e=+e),r=i(t=+t),a=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(p){var h,m;return arguments.length?([h,m]=p,o=f(h,m),u):[o(0),o(1)]}}return u.range=d(Kv),u.rangeRound=d(U3),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return i=f,n=f(e),r=f(t),a=n===r?0:1/(r-n),u}}function Nf(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function HY(){var e=Sf(YS()(hs));return e.copy=function(){return Nf(e,HY())},Ru.apply(e,arguments)}function GY(){var e=V3(YS()).domain([1,10]);return e.copy=function(){return Nf(e,GY()).base(e.base())},Ru.apply(e,arguments)}function YY(){var e=H3(YS());return e.copy=function(){return Nf(e,YY()).constant(e.constant())},Ru.apply(e,arguments)}function rR(){var e=G3(YS());return e.copy=function(){return Nf(e,rR()).exponent(e.exponent())},Ru.apply(e,arguments)}function GEe(){return rR.apply(null,arguments).exponent(.5)}function KY(){var e=[],t=hs;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ib(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Hd),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>RAe(e,i/r))},n.copy=function(){return KY(t).domain(e)},Ru.apply(n,arguments)}function KS(){var e=0,t=.5,n=1,r=1,a,i,o,l,c,u=hs,d,f=!1,p;function h(g){return isNaN(g=+g)?p:(g=.5+((g=+d(g))-i)*(r*g<r*i?l:c),u(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,a=d(e=+e),i=d(t=+t),o=d(n=+n),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),r=i<a?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(u=g,h):u};function m(g){return function(v){var y,b,w;return arguments.length?([y,b,w]=v,u=ike(g,[y,b,w]),h):[u(0),u(.5),u(1)]}}return h.range=m(Kv),h.rangeRound=m(U3),h.unknown=function(g){return arguments.length?(p=g,h):p},function(g){return d=g,a=g(e),i=g(t),o=g(n),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),r=i<a?-1:1,h}}function ZY(){var e=Sf(KS()(hs));return e.copy=function(){return Nf(e,ZY())},Ru.apply(e,arguments)}function XY(){var e=V3(KS()).domain([.1,1,10]);return e.copy=function(){return Nf(e,XY()).base(e.base())},Ru.apply(e,arguments)}function JY(){var e=H3(KS());return e.copy=function(){return Nf(e,JY()).constant(e.constant())},Ru.apply(e,arguments)}function aR(){var e=G3(KS());return e.copy=function(){return Nf(e,aR()).exponent(e.exponent())},Ru.apply(e,arguments)}function YEe(){return aR.apply(null,arguments).exponent(.5)}const QD=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Sx,scaleDiverging:ZY,scaleDivergingLog:XY,scaleDivergingPow:aR,scaleDivergingSqrt:YEe,scaleDivergingSymlog:JY,scaleIdentity:PY,scaleImplicit:EP,scaleLinear:P2,scaleLog:OY,scaleOrdinal:D3,scalePoint:k0,scalePow:Y3,scaleQuantile:LY,scaleQuantize:MY,scaleRadial:IY,scaleSequential:HY,scaleSequentialLog:GY,scaleSequentialPow:rR,scaleSequentialQuantile:KY,scaleSequentialSqrt:GEe,scaleSequentialSymlog:YY,scaleSqrt:Eke,scaleSymlog:RY,scaleThreshold:$Y,scaleTime:VEe,scaleUtc:HEe,tickFormat:CY},Symbol.toStringTag,{value:"Module"}));var KEe=Uv;function ZEe(e,t,n){for(var r=-1,a=e.length;++r<a;){var i=e[r],o=t(i);if(o!=null&&(l===void 0?o===o&&!KEe(o):n(o,l)))var l=o,c=i}return c}var ZS=ZEe;function XEe(e,t){return e>t}var QY=XEe,JEe=ZS,QEe=QY,eCe=Yv;function tCe(e){return e&&e.length?JEe(e,eCe,QEe):void 0}var nCe=tCe;const XS=mr(nCe);function rCe(e,t){return e<t}var eK=rCe,aCe=ZS,iCe=eK,sCe=Yv;function oCe(e){return e&&e.length?aCe(e,sCe,iCe):void 0}var lCe=oCe;const JS=mr(lCe);var cCe=v3,uCe=jf,dCe=oY,fCe=Us;
vendor: 65,044 bytes, lines 595-622
595function hCe(e,t){var n=fCe(e)?cCe:dCe;return n(e,uCe(t))}var pCe=hCe,mCe=iY,gCe=pCe;function vCe(e,t){return mCe(gCe(e,t),1)}var yCe=vCe;const xCe=mr(yCe);var bCe=R3;function wCe(e,t){return bCe(e,t)}var _Ce=wCe;const QS=mr(_Ce);var Zv=1e9,jCe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},sR,ra=!0,Go="[DecimalError] ",qh=Go+"Invalid argument: ",iR=Go+"Exponent out of range: ",Xv=Math.floor,oh=Math.pow,SCe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,io,pi=1e7,Gr=7,tK=9007199254740991,I2=Xv(tK/Gr),At={};At.absoluteValue=At.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};At.comparedTo=At.cmp=function(e){var t,n,r,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};At.decimalPlaces=At.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Gr;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};At.dividedBy=At.div=function(e){return fu(this,new this.constructor(e))};At.dividedToIntegerBy=At.idiv=function(e){var t=this,n=t.constructor;return Or(fu(t,new n(e),0,1),n.precision)};At.equals=At.eq=function(e){return!this.cmp(e)};At.exponent=function(){return Ya(this)};At.greaterThan=At.gt=function(e){return this.cmp(e)>0};At.greaterThanOrEqualTo=At.gte=function(e){return this.cmp(e)>=0};At.isInteger=At.isint=function(){return this.e>this.d.length-2};At.isNegative=At.isneg=function(){return this.s<0};At.isPositive=At.ispos=function(){return this.s>0};At.isZero=function(){return this.s===0};At.lessThan=At.lt=function(e){return this.cmp(e)<0};At.lessThanOrEqualTo=At.lte=function(e){return this.cmp(e)<1};At.logarithm=At.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(io))throw Error(Go+"NaN");if(n.s<1)throw Error(Go+(n.s?"NaN":"-Infinity"));return n.eq(io)?new r(0):(ra=!1,t=fu(Cx(n,i),Cx(e,i),i),ra=!0,Or(t,a))};At.minus=At.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?aK(t,e):nK(t,(e.s=-e.s,e))};At.modulo=At.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Go+"NaN");return n.s?(ra=!1,t=fu(n,e,0,1).times(e),ra=!0,n.minus(t)):Or(new r(n),a)};At.naturalExponential=At.exp=function(){return rK(this)};At.naturalLogarithm=At.ln=function(){return Cx(this)};At.negated=At.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};At.plus=At.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?nK(t,e):aK(t,(e.s=-e.s,e))};At.precision=At.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(qh+e);if(t=Ya(a)+1,r=a.d.length-1,n=r*Gr+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};At.squareRoot=At.sqrt=function(){var e,t,n,r,a,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Go+"NaN")}for(e=Ya(l),ra=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=oc(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Xv((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(a.toString()),n=c.precision,a=o=n+3;;)if(i=r,r=i.plus(fu(l,i,o+2)).times(.5),oc(i.d).slice(0,o)===(t=oc(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(Or(i,n+1,0),i.times(i).eq(l)){r=i;break}}else if(t!="9999")break;o+=4}return ra=!0,Or(r,n)};At.times=At.mul=function(e){var t,n,r,a,i,o,l,c,u,d=this,f=d.constructor,p=d.d,h=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=p.length,u=h.length,c<u&&(i=p,p=h,h=i,o=c,c=u,u=o),i=[],o=c+u,r=o;r--;)i.push(0);for(r=u;--r>=0;){for(t=0,a=c+r;a>r;)l=i[a]+h[r]*p[a-r-1]+t,i[a--]=l%pi|0,t=l/pi|0;i[a]=(i[a]+t)%pi|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,ra?Or(e,f.precision):e};At.toDecimalPlaces=At.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(bc(e,0,Zv),t===void 0?t=r.rounding:bc(t,0,8),Or(n,e+Ya(n)+1,t))};At.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=op(r,!0):(bc(e,0,Zv),t===void 0?t=a.rounding:bc(t,0,8),r=Or(new a(r),e+1,t),n=op(r,!0,e+1)),n};At.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?op(a):(bc(e,0,Zv),t===void 0?t=i.rounding:bc(t,0,8),r=Or(new i(a),e+Ya(a)+1,t),n=op(r.abs(),!1,e+Ya(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};At.toInteger=At.toint=function(){var e=this,t=e.constructor;return Or(new t(e),Ya(e)+1,t.rounding)};At.toNumber=function(){return+this};At.toPower=At.pow=function(e){var t,n,r,a,i,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(io);if(l=new c(l),!l.s){if(e.s<1)throw Error(Go+"Infinity");return l}if(l.eq(io))return l;if(r=c.precision,e.eq(io))return Or(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=l.s,o){if((n=d<0?-d:d)<=tK){for(a=new c(io),t=Math.ceil(r/Gr+4),ra=!1;n%2&&(a=a.times(l),t8(a.d,t)),n=Xv(n/2),n!==0;)l=l.times(l),t8(l.d,t);return ra=!0,e.s<0?new c(io).div(a):Or(a,r)}}else if(i<0)throw Error(Go+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,ra=!1,a=e.times(Cx(l,r+u)),ra=!0,a=rK(a),a.s=i,a};At.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=Ya(a),r=op(a,n<=i.toExpNeg||n>=i.toExpPos)):(bc(e,1,Zv),t===void 0?t=i.rounding:bc(t,0,8),a=Or(new i(a),e,t),n=Ya(a),r=op(a,e<=n||n<=i.toExpNeg,e)),r};At.toSignificantDigits=At.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(bc(e,1,Zv),t===void 0?t=r.rounding:bc(t,0,8)),Or(new r(n),e,t)};At.toString=At.valueOf=At.val=At.toJSON=At[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ya(e),n=e.constructor;return op(e,t<=n.toExpNeg||t>=n.toExpPos)};function nK(e,t){var n,r,a,i,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),ra?Or(t,f):t;if(c=e.d,u=t.d,o=e.e,a=t.e,c=c.slice(),i=o-a,i){for(i<0?(r=c,i=-i,l=u.length):(r=u,a=o,l=c.length),o=Math.ceil(f/Gr),l=o>l?o+1:l+1,i>l&&(i=l,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,r=u,u=c,c=r),n=0;i;)n=(c[--i]=c[i]+u[i]+n)/pi|0,c[i]%=pi;for(n&&(c.unshift(n),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,ra?Or(t,f):t}function bc(e,t,n){if(e!==~~e||e<t||e>n)throw Error(qh+e)}function oc(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)r=e[t]+"",n=Gr-r.length,n&&(i+=cd(n)),i+=r;o=e[t],r=o+"",n=Gr-r.length,n&&(i+=cd(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var fu=function(){function e(r,a){var i,o=0,l=r.length;for(r=r.slice();l--;)i=r[l]*a+o,r[l]=i%pi|0,o=i/pi|0;return o&&r.unshift(o),r}function t(r,a,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(r[l]!=a[l]){c=r[l]>a[l]?1:-1;break}return c}function n(r,a,i){for(var o=0;i--;)r[i]-=o,o=r[i]<a[i]?1:0,r[i]=o*pi+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var l,c,u,d,f,p,h,m,g,v,y,b,w,j,S,A,E,k,P=r.constructor,R=r.s==a.s?1:-1,C=r.d,I=a.d;if(!r.s)return new P(r);if(!a.s)throw Error(Go+"Division by zero");for(c=r.e-a.e,E=I.length,S=C.length,h=new P(R),m=h.d=[],u=0;I[u]==(C[u]||0);)++u;if(I[u]>(C[u]||0)&&--c,i==null?b=i=P.precision:o?b=i+(Ya(r)-Ya(a))+1:b=i,b<0)return new P(0);if(b=b/Gr+2|0,u=0,E==1)for(d=0,I=I[0],b++;(u<S||d)&&b--;u++)w=d*pi+(C[u]||0),m[u]=w/I|0,d=w%I|0;else{for(d=pi/(I[0]+1)|0,d>1&&(I=e(I,d),C=e(C,d),E=I.length,S=C.length),j=E,g=C.slice(0,E),v=g.length;v<E;)g[v++]=0;k=I.slice(),k.unshift(0),A=I[0],I[1]>=pi/2&&++A;do d=0,l=t(I,g,E,v),l<0?(y=g[0],E!=v&&(y=y*pi+(g[1]||0)),d=y/A|0,d>1?(d>=pi&&(d=pi-1),f=e(I,d),p=f.length,v=g.length,l=t(f,g,p,v),l==1&&(d--,n(f,E<p?k:I,p))):(d==0&&(l=d=1),f=I.slice()),p=f.length,p<v&&f.unshift(0),n(g,f,v),l==-1&&(v=g.length,l=t(I,g,E,v),l<1&&(d++,n(g,E<v?k:I,v))),v=g.length):l===0&&(d++,g=[0]),m[u++]=d,l&&g[0]?g[v++]=C[j]||0:(g=[C[j]],v=1);while((j++<S||g[0]!==void 0)&&b--)}return m[0]||m.shift(),h.e=c,Or(h,o?i+Ya(h)+1:i)}}();function rK(e,t){var n,r,a,i,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Ya(e)>16)throw Error(iR+Ya(e));if(!e.s)return new d(io);for(t==null?(ra=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(oh(2,u))/Math.LN10*2+5|0,l+=r,n=a=i=new d(io),d.precision=l;;){if(a=Or(a.times(e),l),n=n.times(++c),o=i.plus(fu(a,n,l)),oc(o.d).slice(0,l)===oc(i.d).slice(0,l)){for(;u--;)i=Or(i.times(i),l);return d.precision=f,t==null?(ra=!0,Or(i,f)):i}i=o}}function Ya(e){for(var t=e.e*Gr,n=e.d[0];n>=10;n/=10)t++;return t}function UA(e,t,n){if(t>e.LN10.sd())throw ra=!0,n&&(e.precision=n),Error(Go+"LN10 precision limit exceeded");return Or(new e(e.LN10),t)}function cd(e){for(var t="";e--;)t+="0";return t}function Cx(e,t){var n,r,a,i,o,l,c,u,d,f=1,p=10,h=e,m=h.d,g=h.constructor,v=g.precision;if(h.s<1)throw Error(Go+(h.s?"NaN":"-Infinity"));if(h.eq(io))return new g(0);if(t==null?(ra=!1,u=v):u=t,h.eq(10))return t==null&&(ra=!0),UA(g,u);if(u+=p,g.precision=u,n=oc(m),r=n.charAt(0),i=Ya(h),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=oc(h.d),r=n.charAt(0),f++;i=Ya(h),r>1?(h=new g("0."+n),i++):h=new g(r+"."+n.slice(1))}else return c=UA(g,u+2,v).times(i+""),h=Cx(new g(r+"."+n.slice(1)),u-p).plus(c),g.precision=v,t==null?(ra=!0,Or(h,v)):h;for(l=o=h=fu(h.minus(io),h.plus(io),u),d=Or(h.times(h),u),a=3;;){if(o=Or(o.times(d),u),c=l.plus(fu(o,new g(a),u)),oc(c.d).slice(0,u)===oc(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(UA(g,u+2,v).times(i+""))),l=fu(l,new g(f),u),g.precision=v,t==null?(ra=!0,Or(l,v)):l;l=c,a+=2}}function e8(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=Xv(n/Gr),e.d=[],r=(n+1)%Gr,n<0&&(r+=Gr),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=Gr;r<a;)e.d.push(+t.slice(r,r+=Gr));t=t.slice(r),r=Gr-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),ra&&(e.e>I2||e.e<-I2))throw Error(iR+n)}else e.s=0,e.e=0,e.d=[0];return e}function Or(e,t,n){var r,a,i,o,l,c,u,d,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=Gr,a=t,u=f[d=0];else{if(d=Math.ceil((r+1)/Gr),i=f.length,d>=i)return e;for(u=i=f[d],o=1;i>=10;i/=10)o++;r%=Gr,a=r-Gr+o}if(n!==void 0&&(i=oh(10,o-a-1),l=u/i%10|0,c=t<0||f[d+1]!==void 0||u%i,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?a>0?u/oh(10,o-a):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(i=Ya(e),f.length=1,t=t-i-1,f[0]=oh(10,(Gr-t%Gr)%Gr),e.e=Xv(-t/Gr)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,i=1,d--):(f.length=d+1,i=oh(10,Gr-r),f[d]=a>0?(u/oh(10,o-a)%oh(10,a)|0)*i:0),c)for(;;)if(d==0){(f[0]+=i)==pi&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=pi)break;f[d--]=0,i=1}for(r=f.length;f[--r]===0;)f.pop();if(ra&&(e.e>I2||e.e<-I2))throw Error(iR+Ya(e));return e}function aK(e,t){var n,r,a,i,o,l,c,u,d,f,p=e.constructor,h=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),ra?Or(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),a=Math.max(Math.ceil(h/Gr),l)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=c.length,l=f.length,d=a<l,d&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>o;){if(c[--a]<f[a]){for(i=a;i&&c[--i]===0;)c[i]=pi-1;--c[i],c[a]+=pi}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,ra?Or(t,h):t):new p(0)}function op(e,t,n){var r,a=Ya(e),i=oc(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+cd(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+cd(-a-1)+i,n&&(r=n-o)>0&&(i+=cd(r))):a>=o?(i+=cd(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+cd(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=cd(r))),e.s<0?"-"+i:i}function t8(e,t){if(e.length>t)return e.length=t,!0}function iK(e){var t,n,r;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(qh+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return e8(o,i.toString())}else if(typeof i!="string")throw Error(qh+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,SCe.test(i))e8(o,i);else throw Error(qh+i)}if(a.prototype=At,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=iK,a.config=a.set=NCe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return a.config(e),a}function NCe(e){if(!e||typeof e!="object")throw Error(Go+"Object expected");var t,n,r,a=["precision",1,Zv,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(Xv(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(qh+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(qh+n+": "+r);return this}var sR=iK(jCe);io=new sR(1);const Nr=sR;function ACe(e){return PCe(e)||CCe(e)||ECe(e)||kCe()}function kCe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
596In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ECe(e,t){if(e){if(typeof e=="string")return OP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OP(e,t)}}function CCe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function PCe(e){if(Array.isArray(e))return OP(e)}function OP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var TCe=function(t){return t},sK={"@@functional/placeholder":!0},oK=function(t){return t===sK},n8=function(t){return function n(){return arguments.length===0||arguments.length===1&&oK(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},OCe=function e(t,n){return t===1?n:n8(function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var o=a.filter(function(l){return l!==sK}).length;return o>=t?n.apply(void 0,a):e(t-o,n8(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=a.map(function(f){return oK(f)?c.shift():f});return n.apply(void 0,ACe(d).concat(c))}))})},eN=function(t){return OCe(t.length,t)},RP=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},RCe=eN(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),ICe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return TCe;var a=n.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},IP=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},lK=function(t){var n=null,r=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n&&i.every(function(l,c){return l===n[c]})||(n=i,r=t.apply(void 0,i)),r}};function LCe(e){var t;return e===0?t=1:t=Math.floor(new Nr(e).abs().log(10).toNumber())+1,t}function MCe(e,t,n){for(var r=new Nr(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var $Ce=eN(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),DCe=eN(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),FCe=eN(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const tN={rangeStep:MCe,getDigitCount:LCe,interpolateNumber:$Ce,uninterpolateNumber:DCe,uninterpolateTruncation:FCe};function LP(e){return zCe(e)||UCe(e)||cK(e)||BCe()}function BCe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
597In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UCe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function zCe(e){if(Array.isArray(e))return MP(e)}function Px(e,t){return VCe(e)||qCe(e,t)||cK(e,t)||WCe()}function WCe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
598In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cK(e,t){if(e){if(typeof e=="string")return MP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MP(e,t)}}function MP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qCe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){a=!0,i=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw i}}return n}}function VCe(e){if(Array.isArray(e))return e}function uK(e){var t=Px(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function dK(e,t,n){if(e.lte(0))return new Nr(0);var r=tN.getDigitCount(e.toNumber()),a=new Nr(10).pow(r),i=e.div(a),o=r!==1?.05:.1,l=new Nr(Math.ceil(i.div(o).toNumber())).add(n).mul(o),c=l.mul(a);return t?c:new Nr(Math.ceil(c))}function HCe(e,t,n){var r=1,a=new Nr(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Nr(10).pow(tN.getDigitCount(e)-1),a=new Nr(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Nr(Math.floor(e)))}else e===0?a=new Nr(Math.floor((t-1)/2)):n||(a=new Nr(Math.floor(e)));var o=Math.floor((t-1)/2),l=ICe(RCe(function(c){return a.add(new Nr(c-o).mul(r)).toNumber()}),RP);return l(0,t)}function fK(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Nr(0),tickMin:new Nr(0),tickMax:new Nr(0)};var i=dK(new Nr(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Nr(0):(o=new Nr(e).add(t).div(2),o=o.sub(new Nr(o).mod(i)));var l=Math.ceil(o.sub(e).div(i).toNumber()),c=Math.ceil(new Nr(t).sub(o).div(i).toNumber()),u=l+c+1;return u>n?fK(e,t,n,r,a+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:i,tickMin:o.sub(new Nr(l).mul(i)),tickMax:o.add(new Nr(c).mul(i))})}function GCe(e){var t=Px(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=uK([n,r]),c=Px(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(LP(RP(0,a-1).map(function(){return 1/0}))):[].concat(LP(RP(0,a-1).map(function(){return-1/0})),[d]);return n>r?IP(f):f}if(u===d)return HCe(u,a,i);var p=fK(u,d,o,i),h=p.step,m=p.tickMin,g=p.tickMax,v=tN.rangeStep(m,g.add(new Nr(.1).mul(h)),h);return n>r?IP(v):v}function YCe(e,t){var n=Px(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=uK([r,a]),l=Px(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,a];if(c===u)return[c];var d=Math.max(t,2),f=dK(new Nr(u).sub(c).div(d-1),i,0),p=[].concat(LP(tN.rangeStep(new Nr(c),new Nr(u).sub(new Nr(.99).mul(f)),f)),[u]);return r>a?IP(p):p}var KCe=lK(GCe),ZCe=lK(YCe),XCe="Invariant failed";function lp(e,t){throw new Error(XCe)}var JCe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Xg(e){"@babel/helpers - typeof";return Xg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xg(e)}function L2(){return L2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L2.apply(this,arguments)}function QCe(e,t){return rPe(e)||nPe(e,t)||tPe(e,t)||ePe()}function ePe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
599In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tPe(e,t){if(e){if(typeof e=="string")return r8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r8(e,t)}}function r8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function nPe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function rPe(e){if(Array.isArray(e))return e}function aPe(e,t){if(e==null)return{};var n=iPe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function iPe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sPe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oPe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mK(r.key),r)}}function lPe(e,t,n){return t&&oPe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cPe(e,t,n){return t=M2(t),uPe(e,hK()?Reflect.construct(t,n||[],M2(e).constructor):t.apply(e,n))}function uPe(e,t){if(t&&(Xg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dPe(e)}function dPe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hK=function(){return!!e})()}function M2(e){return M2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},M2(e)}function fPe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$P(e,t)}function $P(e,t){return $P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$P(e,t)}function pK(e,t,n){return t=mK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mK(e){var t=hPe(e,"string");return Xg(t)=="symbol"?t:t+""}function hPe(e,t){if(Xg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nN=function(e){function t(){return sPe(this,t),cPe(this,t,arguments)}return fPe(t,e),lPe(t,[{key:"render",value:function(){var r=this.props,a=r.offset,i=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,p=aPe(r,JCe),h=cn(p,!1);this.props.direction==="x"&&d.type!=="number"&&lp();var m=c.map(function(g){var v=u(g,l),y=v.x,b=v.y,w=v.value,j=v.errorVal;if(!j)return null;var S=[],A,E;if(Array.isArray(j)){var k=QCe(j,2);A=k[0],E=k[1]}else A=E=j;if(i==="vertical"){var P=d.scale,R=b+a,C=R+o,I=R-o,D=P(w-A),U=P(w+E);S.push({x1:U,y1:C,x2:U,y2:I}),S.push({x1:D,y1:R,x2:U,y2:R}),S.push({x1:D,y1:C,x2:D,y2:I})}else if(i==="horizontal"){var q=f.scale,Z=y+a,H=Z-o,$=Z+o,W=q(w-A),ee=q(w+E);S.push({x1:H,y1:ee,x2:$,y2:ee}),S.push({x1:Z,y1:W,x2:Z,y2:ee}),S.push({x1:H,y1:W,x2:$,y2:W})}return ue.createElement(wr,L2({className:"recharts-errorBar",key:"bar-".concat(S.map(function(V){return"".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))},h),S.map(function(V){return ue.createElement("line",L2({},V,{key:"line-".concat(V.x1,"-").concat(V.x2,"-").concat(V.y1,"-").concat(V.y2)}))}))});return ue.createElement(wr,{className:"recharts-errorBars"},m)}}])}(ue.Component);pK(nN,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});pK(nN,"displayName","ErrorBar");function Tx(e){"@babel/helpers - typeof";return Tx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tx(e)}function a8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a8(Object(n),!0).forEach(function(r){pPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pPe(e,t,n){return t=mPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mPe(e){var t=gPe(e,"string");return Tx(t)=="symbol"?t:t+""}function gPe(e,t){if(Tx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Tx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gK=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=no(n,rg);if(!o)return null;var l=rg.defaultProps,c=l!==void 0?Yf(Yf({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:i==="children"?u=(r||[]).reduce(function(d,f){var p=f.item,h=f.props,m=h.sectors||h.data||[];return d.concat(m.map(function(g){return{type:o.props.iconType||p.props.legendType,value:g.name,color:g.fill,payload:g}}))},[]):u=(r||[]).map(function(d){var f=d.item,p=f.type.defaultProps,h=p!==void 0?Yf(Yf({},p),f.props):{},m=h.dataKey,g=h.name,v=h.legendType,y=h.hide;return{inactive:y,dataKey:m,type:c.iconType||v||"square",color:oR(f),value:g||m,payload:h}}),Yf(Yf(Yf({},c),rg.getWithHeight(o,a)),{},{payload:u,item:o})};function Ox(e){"@babel/helpers - typeof";return Ox=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ox(e)}function i8(e){return bPe(e)||xPe(e)||yPe(e)||vPe()}function vPe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
600In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yPe(e,t){if(e){if(typeof e=="string")return DP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DP(e,t)}}function xPe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bPe(e){if(Array.isArray(e))return DP(e)}function DP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function wa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s8(Object(n),!0).forEach(function(r){ig(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ig(e,t,n){return t=wPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wPe(e){var t=_Pe(e,"string");return Ox(t)=="symbol"?t:t+""}function _Pe(e,t){if(Ox(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ox(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xi(e,t,n){return In(e)||In(t)?n:li(t)?ho(e,t,n):_n(t)?t(e):n}function E0(e,t,n,r){var a=xCe(e,function(l){return Xi(l,t)});if(n==="number"){var i=a.filter(function(l){return gt(l)||parseFloat(l)});return i.length?[JS(i),XS(i)]:[1/0,-1/0]}var o=r?a.filter(function(l){return!In(l)}):a;return o.map(function(l){return li(l)||l instanceof Date?l:""})}var jPe=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var d=u>0?a[u-1].coordinate:a[l-1].coordinate,f=a[u].coordinate,p=u>=l-1?a[0].coordinate:a[u+1].coordinate,h=void 0;if(ds(f-d)!==ds(p-f)){var m=[];if(ds(p-f)===ds(c[1]-c[0])){h=p;var g=f+c[1]-c[0];m[0]=Math.min(g,(g+d)/2),m[1]=Math.max(g,(g+d)/2)}else{h=d;var v=p+c[1]-c[0];m[0]=Math.min(f,(v+f)/2),m[1]=Math.max(f,(v+f)/2)}var y=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(t>y[0]&&t<=y[1]||t>=m[0]&&t<=m[1]){o=a[u].index;break}}else{var b=Math.min(d,p),w=Math.max(d,p);if(t>(b+f)/2&&t<=(w+f)/2){o=a[u].index;break}}}else for(var j=0;j<l;j++)if(j===0&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j>0&&j<l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j===l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2){o=r[j].index;break}return o},oR=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?wa(wa({},t.type.defaultProps),t.props):t.props,o=i.stroke,l=i.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},SPe=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var d=i[l[c]].stackGroups,f=Object.keys(d),p=0,h=f.length;p<h;p++){var m=d[f[p]],g=m.items,v=m.cateAxisId,y=g.filter(function(E){return cu(E.type).indexOf("Bar")>=0});if(y&&y.length){var b=y[0].type.defaultProps,w=b!==void 0?wa(wa({},b),y[0].props):y[0].props,j=w.barSize,S=w[v];o[S]||(o[S]=[]);var A=In(j)?n:j;o[S].push({item:y[0],stackList:y.slice(1),barSize:In(A)?void 0:fs(A,r,0)})}}return o},NPe=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=fs(n,a,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var p=!1,h=a/c,m=o.reduce(function(j,S){return j+S.barSize||0},0);m+=(c-1)*u,m>=a&&(m-=(c-1)*u,u=0),m>=a&&h>0&&(p=!0,h*=.9,m=c*h);var g=(a-m)/2>>0,v={offset:g-u,size:0};d=o.reduce(function(j,S){var A={item:S.item,position:{offset:v.offset+v.size+u,size:p?h:S.barSize}},E=[].concat(i8(j),[A]);return v=E[E.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(k){E.push({item:k,position:v})}),E},f)}else{var y=fs(r,a,0,!0);a-2*y-(c-1)*u<=0&&(u=0);var b=(a-2*y-(c-1)*u)/c;b>1&&(b>>=0);var w=l===+l?Math.min(b,l):b;d=o.reduce(function(j,S,A){var E=[].concat(i8(j),[{item:S.item,position:{offset:y+(b+u)*A+(b-w)/2,size:w}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(k){E.push({item:k,position:E[E.length-1].position})}),E},f)}return d},APe=function(t,n,r,a){var i=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=gK({children:i,legendWidth:c});if(u){var d=a||{},f=d.width,p=d.height,h=u.align,m=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&m==="middle")&&h!=="center"&&gt(t[h]))return wa(wa({},t),{},ig({},h,t[h]+(f||0)));if((g==="horizontal"||g==="vertical"&&h==="center")&&m!=="middle"&&gt(t[m]))return wa(wa({},t),{},ig({},m,t[m]+(p||0)))}return t},kPe=function(t,n,r){return In(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},vK=function(t,n,r,a,i){var o=n.props.children,l=Wo(o,nN).filter(function(u){return kPe(a,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=Xi(d,r);if(In(f))return u;var p=Array.isArray(f)?[JS(f),XS(f)]:[f,f],h=c.reduce(function(m,g){var v=Xi(d,g,0),y=p[0]-Math.abs(Array.isArray(v)?v[0]:v),b=p[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(y,m[0]),Math.max(b,m[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},EPe=function(t,n,r,a,i){var o=n.map(function(l){return vK(t,l,r,i,a)}).filter(function(l){return!In(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},yK=function(t,n,r,a,i){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&vK(t,c,u,a)||E0(t,u,r,i)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},xK=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Nh=function(t,n,r){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(n||r)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?ds(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var p=i?i.indexOf(f):f;return{coordinate:a(p)+u,value:f,offset:u}});return d.filter(function(f){return!Tb(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,p){return{coordinate:a(f)+u,value:f,index:p,offset:u}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,p){return{coordinate:a(f)+u,value:i?i[f]:f,index:p,offset:u}})},zA=new WeakMap,uw=function(t,n){if(typeof n!="function")return t;zA.has(t)||zA.set(t,new WeakMap);var r=zA.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},bK=function(t,n,r){var a=t.scale,i=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:Sx(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:P2(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:k0(),realScaleType:"point"}:i==="category"?{scale:Sx(),realScaleType:"band"}:{scale:P2(),realScaleType:"linear"};if(ap(a)){var c="scale".concat($S(a));return{scale:(QD[c]||k0)(),realScaleType:QD[c]?c:"point"}}return _n(a)?{scale:a}:{scale:k0(),realScaleType:"point"}},o8=1e-4,wK=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),i=Math.min(a[0],a[1])-o8,o=Math.max(a[0],a[1])+o8,l=t(n[0]),c=t(n[r-1]);(l<i||l>o||c<i||c>o)&&t.domain([n[0],n[r-1]])}},CPe=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},PPe=function(t,n){if(!n||n.length!==2||!gt(n[0])||!gt(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),i=[t[0],t[1]];return(!gt(t[0])||t[0]<r)&&(i[0]=r),(!gt(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},TPe=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0,l=0;l<n;++l){var c=Tb(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=i,t[l][r][1]=i+c,i=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},OPe=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0;o<n;++o){var l=Tb(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=i,t[o][r][1]=i+l,i=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},RPe={sign:TPe,expand:Xxe,none:Wg,silhouette:Jxe,wiggle:Qxe,positive:OPe},IPe=function(t,n,r){var a=n.map(function(l){return l.props.dataKey}),i=RPe[r],o=Zxe().keys(a).value(function(l,c){return+Xi(l,c,0)}).order(cP).offset(i);return o(t)},LPe=function(t,n,r,a,i,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,p){var h,m=(h=p.type)!==null&&h!==void 0&&h.defaultProps?wa(wa({},p.type.defaultProps),p.props):p.props,g=m.stackId,v=m.hide;if(v)return f;var y=m[r],b=f[y]||{hasStack:!1,stackGroups:{}};if(li(g)){var w=b.stackGroups[g]||{numericAxisId:r,cateAxisId:a,items:[]};w.items.push(p),b.hasStack=!0,b.stackGroups[g]=w}else b.stackGroups[Ob("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[p]};return wa(wa({},f),{},ig({},y,b))},c),d={};return Object.keys(u).reduce(function(f,p){var h=u[p];if(h.hasStack){var m={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(g,v){var y=h.stackGroups[v];return wa(wa({},g),{},ig({},v,{numericAxisId:r,cateAxisId:a,items:y.items,stackedData:IPe(t,y.items,i)}))},m)}return wa(wa({},f),{},ig({},p,h))},d)},_K=function(t,n){var r=n.realScaleType,a=n.type,i=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=KCe(u,i,l);return t.domain([JS(d),XS(d)]),{niceTicks:d}}if(i&&a==="number"){var f=t.domain(),p=ZCe(f,i,l);return{niceTicks:p}}return null},l8=function(t){var n=t.axis,r=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+a:null;var c=Xi(o,n.dataKey,n.domain[l]);return In(c)?null:n.scale(c)-i/2+a},MPe=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return a<=0&&i>=0?0:i<0?i:a}return r[0]},$Pe=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?wa(wa({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(li(i)){var o=n[i];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},DPe=function(t){return t.reduce(function(n,r){return[JS(r.concat([n[0]]).filter(gt)),XS(r.concat([n[1]]).filter(gt))]},[1/0,-1/0])},jK=function(t,n,r){return Object.keys(t).reduce(function(a,i){var o=t[i],l=o.stackedData,c=l.reduce(function(u,d){var f=DPe(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},c8=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,u8=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,FP=function(t,n,r){if(_n(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(gt(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(c8.test(t[0])){var i=+c8.exec(t[0])[1];a[0]=n[0]-i}else _n(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(gt(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(u8.test(t[1])){var o=+u8.exec(t[1])[1];a[1]=n[1]+o}else _n(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},$2=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var i=L3(n,function(f){return f.coordinate}),o=1/0,l=1,c=i.length;l<c;l++){var u=i[l],d=i[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},d8=function(t,n,r){return!t||!t.length||QS(t,ho(r,"type.defaultProps.domain"))?n:t},SK=function(t,n){var r=t.type.defaultProps?wa(wa({},t.type.defaultProps),t.props):t.props,a=r.dataKey,i=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return wa(wa({},cn(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:i||a,color:oR(t),value:Xi(n,a),type:c,payload:n,chartType:u,hide:d})};function Rx(e){"@babel/helpers - typeof";return Rx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rx(e)}function f8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Kc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f8(Object(n),!0).forEach(function(r){NK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NK(e,t,n){return t=FPe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FPe(e){var t=BPe(e,"string");return Rx(t)=="symbol"?t:t+""}function BPe(e,t){if(Rx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Rx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UPe(e,t){return VPe(e)||qPe(e,t)||WPe(e,t)||zPe()}function zPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
601In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WPe(e,t){if(e){if(typeof e=="string")return h8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h8(e,t)}}function h8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qPe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function VPe(e){if(Array.isArray(e))return e}var D2=Math.PI/180,HPe=function(t){return t*180/Math.PI},Br=function(t,n,r,a){return{x:t+Math.cos(-D2*a)*r,y:n+Math.sin(-D2*a)*r}},AK=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},GPe=function(t,n,r,a,i){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=fs(t.cx,o,o/2),f=fs(t.cy,l,l/2),p=AK(o,l,r),h=fs(t.innerRadius,p,0),m=fs(t.outerRadius,p,p*.8),g=Object.keys(n);return g.reduce(function(v,y){var b=n[y],w=b.domain,j=b.reversed,S;if(In(b.range))a==="angleAxis"?S=[c,u]:a==="radiusAxis"&&(S=[h,m]),j&&(S=[S[1],S[0]]);else{S=b.range;var A=S,E=UPe(A,2);c=E[0],u=E[1]}var k=bK(b,i),P=k.realScaleType,R=k.scale;R.domain(w).range(S),wK(R);var C=_K(R,Kc(Kc({},b),{},{realScaleType:P})),I=Kc(Kc(Kc({},b),C),{},{range:S,radius:m,realScaleType:P,scale:R,cx:d,cy:f,innerRadius:h,outerRadius:m,startAngle:c,endAngle:u});return Kc(Kc({},v),{},NK({},y,I))},{})},YPe=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(a-o,2))},KPe=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,l=YPe({x:r,y:a},{x:i,y:o});if(l<=0)return{radius:l};var c=(r-i)/l,u=Math.acos(c);return a>o&&(u=2*Math.PI-u),{radius:l,angle:HPe(u),angleInRadian:u}},ZPe=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(a,i);return{startAngle:n-o*360,endAngle:r-o*360}},XPe=function(t,n){var r=n.startAngle,a=n.endAngle,i=Math.floor(r/360),o=Math.floor(a/360),l=Math.min(i,o);return t+l*360},p8=function(t,n){var r=t.x,a=t.y,i=KPe({x:r,y:a},n),o=i.radius,l=i.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=ZPe(n),f=d.startAngle,p=d.endAngle,h=l,m;if(f<=p){for(;h>p;)h-=360;for(;h<f;)h+=360;m=h>=f&&h<=p}else{for(;h>f;)h-=360;for(;h<p;)h+=360;m=h>=p&&h<=f}return m?Kc(Kc({},n),{},{radius:o,angle:XPe(h,n)}):null},kK=function(t){return!x.isValidElement(t)&&!_n(t)&&typeof t!="boolean"?t.className:""};function Ix(e){"@babel/helpers - typeof";return Ix=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ix(e)}var JPe=["offset"];function QPe(e){return r4e(e)||n4e(e)||t4e(e)||e4e()}function e4e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
602In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t4e(e,t){if(e){if(typeof e=="string")return BP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BP(e,t)}}function n4e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function r4e(e){if(Array.isArray(e))return BP(e)}function BP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a4e(e,t){if(e==null)return{};var n=i4e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function i4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function m8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m8(Object(n),!0).forEach(function(r){s4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s4e(e,t,n){return t=o4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o4e(e){var t=l4e(e,"string");return Ix(t)=="symbol"?t:t+""}function l4e(e,t){if(Ix(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ix(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lx(){return Lx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lx.apply(this,arguments)}var c4e=function(t){var n=t.value,r=t.formatter,a=In(t.children)?n:t.children;return _n(r)?r(a):a},u4e=function(t,n){var r=ds(n-t),a=Math.min(Math.abs(n-t),360);return r*a},d4e=function(t,n,r){var a=t.position,i=t.viewBox,o=t.offset,l=t.className,c=i,u=c.cx,d=c.cy,f=c.innerRadius,p=c.outerRadius,h=c.startAngle,m=c.endAngle,g=c.clockWise,v=(f+p)/2,y=u4e(h,m),b=y>=0?1:-1,w,j;a==="insideStart"?(w=h+b*o,j=g):a==="insideEnd"?(w=m-b*o,j=!g):a==="end"&&(w=m+b*o,j=g),j=y<=0?j:!j;var S=Br(u,d,v,w),A=Br(u,d,v,w+(j?1:-1)*359),E="M".concat(S.x,",").concat(S.y,`
603    A`).concat(v,",").concat(v,",0,1,").concat(j?0:1,`,
604    `).concat(A.x,",").concat(A.y),k=In(t.id)?Ob("recharts-radial-line-"):t.id;return ue.createElement("text",Lx({},r,{dominantBaseline:"central",className:Cn("recharts-radial-bar-label",l)}),ue.createElement("defs",null,ue.createElement("path",{id:k,d:E})),ue.createElement("textPath",{xlinkHref:"#".concat(k)},n))},f4e=function(t){var n=t.viewBox,r=t.offset,a=t.position,i=n,o=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,p=(d+f)/2;if(a==="outside"){var h=Br(o,l,u+r,p),m=h.x,g=h.y;return{x:m,y:g,textAnchor:m>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var v=(c+u)/2,y=Br(o,l,v,p),b=y.x,w=y.y;return{x:b,y:w,textAnchor:"middle",verticalAnchor:"middle"}},h4e=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,i=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,p=f*a,h=f>0?"end":"start",m=f>0?"start":"end",g=u>=0?1:-1,v=g*a,y=g>0?"end":"start",b=g>0?"start":"end";if(i==="top"){var w={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:h};return ri(ri({},w),r?{height:Math.max(c-r.y,0),width:u}:{})}if(i==="bottom"){var j={x:l+u/2,y:c+d+p,textAnchor:"middle",verticalAnchor:m};return ri(ri({},j),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(i==="left"){var S={x:l-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return ri(ri({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(i==="right"){var A={x:l+u+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return ri(ri({},A),r?{width:Math.max(r.x+r.width-A.x,0),height:d}:{})}var E=r?{width:u,height:d}:{};return i==="insideLeft"?ri({x:l+v,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},E):i==="insideRight"?ri({x:l+u-v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},E):i==="insideTop"?ri({x:l+u/2,y:c+p,textAnchor:"middle",verticalAnchor:m},E):i==="insideBottom"?ri({x:l+u/2,y:c+d-p,textAnchor:"middle",verticalAnchor:h},E):i==="insideTopLeft"?ri({x:l+v,y:c+p,textAnchor:b,verticalAnchor:m},E):i==="insideTopRight"?ri({x:l+u-v,y:c+p,textAnchor:y,verticalAnchor:m},E):i==="insideBottomLeft"?ri({x:l+v,y:c+d-p,textAnchor:b,verticalAnchor:h},E):i==="insideBottomRight"?ri({x:l+u-v,y:c+d-p,textAnchor:y,verticalAnchor:h},E):zv(i)&&(gt(i.x)||_h(i.x))&&(gt(i.y)||_h(i.y))?ri({x:l+fs(i.x,u),y:c+fs(i.y,d),textAnchor:"end",verticalAnchor:"end"},E):ri({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},E)},p4e=function(t){return"cx"in t&&gt(t.cx)};function vi(e){var t=e.offset,n=t===void 0?5:t,r=a4e(e,JPe),a=ri({offset:n},r),i=a.viewBox,o=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,p=a.textBreakAll;if(!i||In(l)&&In(c)&&!x.isValidElement(u)&&!_n(u))return null;if(x.isValidElement(u))return x.cloneElement(u,a);var h;if(_n(u)){if(h=x.createElement(u,a),x.isValidElement(h))return h}else h=c4e(a);var m=p4e(i),g=cn(a,!0);if(m&&(o==="insideStart"||o==="insideEnd"||o==="end"))return d4e(a,h,g);var v=m?f4e(a):h4e(a);return ue.createElement(sp,Lx({className:Cn("recharts-label",f)},g,v,{breakAll:p}),h)}vi.displayName="Label";var EK=function(t){var n=t.cx,r=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,p=t.y,h=t.top,m=t.left,g=t.width,v=t.height,y=t.clockWise,b=t.labelViewBox;if(b)return b;if(gt(g)&&gt(v)){if(gt(f)&&gt(p))return{x:f,y:p,width:g,height:v};if(gt(h)&&gt(m))return{x:h,y:m,width:g,height:v}}return gt(f)&&gt(p)?{x:f,y:p,width:0,height:0}:gt(n)&&gt(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:y}:t.viewBox?t.viewBox:{}},m4e=function(t,n){return t?t===!0?ue.createElement(vi,{key:"label-implicit",viewBox:n}):li(t)?ue.createElement(vi,{key:"label-implicit",viewBox:n,value:t}):x.isValidElement(t)?t.type===vi?x.cloneElement(t,{key:"label-implicit",viewBox:n}):ue.createElement(vi,{key:"label-implicit",content:t,viewBox:n}):_n(t)?ue.createElement(vi,{key:"label-implicit",content:t,viewBox:n}):zv(t)?ue.createElement(vi,Lx({viewBox:n},t,{key:"label-implicit"})):null:null},g4e=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,i=EK(t),o=Wo(a,vi).map(function(c,u){return x.cloneElement(c,{viewBox:n||i,key:"label-".concat(u)})});if(!r)return o;var l=m4e(t.label,n||i);return[l].concat(QPe(o))};vi.parseViewBox=EK;vi.renderCallByParent=g4e;function v4e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var y4e=v4e;const x4e=mr(y4e);function Mx(e){"@babel/helpers - typeof";return Mx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mx(e)}var b4e=["valueAccessor"],w4e=["data","dataKey","clockWise","id","textBreakAll"];function _4e(e){return A4e(e)||N4e(e)||S4e(e)||j4e()}function j4e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
605In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S4e(e,t){if(e){if(typeof e=="string")return UP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return UP(e,t)}}function N4e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function A4e(e){if(Array.isArray(e))return UP(e)}function UP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function F2(){return F2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F2.apply(this,arguments)}function g8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function v8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g8(Object(n),!0).forEach(function(r){k4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function k4e(e,t,n){return t=E4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E4e(e){var t=C4e(e,"string");return Mx(t)=="symbol"?t:t+""}function C4e(e,t){if(Mx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Mx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function y8(e,t){if(e==null)return{};var n=P4e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function P4e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var T4e=function(t){return Array.isArray(t.value)?x4e(t.value):t.value};function Gd(e){var t=e.valueAccessor,n=t===void 0?T4e:t,r=y8(e,b4e),a=r.data,i=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=y8(r,w4e);return!a||!a.length?null:ue.createElement(wr,{className:"recharts-label-list"},a.map(function(d,f){var p=In(i)?n(d,f):Xi(d&&d.payload,i),h=In(l)?{}:{id:"".concat(l,"-").concat(f)};return ue.createElement(vi,F2({},cn(d,!0),u,h,{parentViewBox:d.parentViewBox,value:p,textBreakAll:c,viewBox:vi.parseViewBox(In(o)?d:v8(v8({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Gd.displayName="LabelList";function O4e(e,t){return e?e===!0?ue.createElement(Gd,{key:"labelList-implicit",data:t}):ue.isValidElement(e)||_n(e)?ue.createElement(Gd,{key:"labelList-implicit",data:t,content:e}):zv(e)?ue.createElement(Gd,F2({data:t},e,{key:"labelList-implicit"})):null:null}function R4e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=Wo(r,Gd).map(function(o,l){return x.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return a;var i=O4e(e.label,t);return[i].concat(_4e(a))}Gd.renderCallByParent=R4e;function $x(e){"@babel/helpers - typeof";return $x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$x(e)}function zP(){return zP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zP.apply(this,arguments)}function x8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function b8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x8(Object(n),!0).forEach(function(r){I4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function I4e(e,t,n){return t=L4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L4e(e){var t=M4e(e,"string");return $x(t)=="symbol"?t:t+""}function M4e(e,t){if($x(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($x(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $4e=function(t,n){var r=ds(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},dw=function(t){var n=t.cx,r=t.cy,a=t.radius,i=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/D2,p=u?i:i+o*f,h=Br(n,r,d,p),m=Br(n,r,a,p),g=u?i-o*f:i,v=Br(n,r,d*Math.cos(f*D2),g);return{center:h,circleTangency:m,lineTangency:v,theta:f}},CK=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,l=t.endAngle,c=$4e(o,l),u=o+c,d=Br(n,r,i,o),f=Br(n,r,i,u),p="M ".concat(d.x,",").concat(d.y,`
606    A `).concat(i,",").concat(i,`,0,
607    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
608    `).concat(f.x,",").concat(f.y,`
609  `);if(a>0){var h=Br(n,r,a,o),m=Br(n,r,a,u);p+="L ".concat(m.x,",").concat(m.y,`
610            A `).concat(a,",").concat(a,`,0,
611            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
612            `).concat(h.x,",").concat(h.y," Z")}else p+="L ".concat(n,",").concat(r," Z");return p},D4e=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=ds(d-u),p=dw({cx:n,cy:r,radius:i,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),h=p.circleTangency,m=p.lineTangency,g=p.theta,v=dw({cx:n,cy:r,radius:i,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),y=v.circleTangency,b=v.lineTangency,w=v.theta,j=c?Math.abs(u-d):Math.abs(u-d)-g-w;if(j<0)return l?"M ".concat(m.x,",").concat(m.y,`
613        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
614        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
615      `):CK({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:u,endAngle:d});var S="M ".concat(m.x,",").concat(m.y,`
616    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(h.x,",").concat(h.y,`
617    A`).concat(i,",").concat(i,",0,").concat(+(j>180),",").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
618    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(b.x,",").concat(b.y,`
619  `);if(a>0){var A=dw({cx:n,cy:r,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=A.circleTangency,k=A.lineTangency,P=A.theta,R=dw({cx:n,cy:r,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),C=R.circleTangency,I=R.lineTangency,D=R.theta,U=c?Math.abs(u-d):Math.abs(u-d)-P-D;if(U<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(I.x,",").concat(I.y,`
620      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,`
621      A`).concat(a,",").concat(a,",0,").concat(+(U>180),",").concat(+(f>0),",").concat(E.x,",").concat(E.y,`
622      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(k.x,",").concat(k.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},F4e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},PK=function(t){var n=b8(b8({},F4e),t),r=n.cx,a=n.cy,i=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,p=n.className;if(o<i||d===f)return null;var h=Cn("recharts-sector",p),m=o-i,g=fs(l,m,0,!0),v;return g>0&&Math.abs(d-f)<360?v=D4e({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(g,m/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):v=CK({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:d,endAngle:f}),ue.createElement("path",zP({},cn(n,!0),{className:h,d:v,role:"img"}))};function Dx(e){"@babel/helpers - typeof";return Dx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dx(e)}function WP(){return WP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WP.apply(this,arguments)}function w8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w8(Object(n),!0).forEach(function(r){B4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B4e(e,t,n){return t=U4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U4e(e){var t=z4e(e,"string");return Dx(t)=="symbol"?t:t+""}function z4e(e,t){if(Dx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var j8={curveBasisClosed:Fxe,curveBasisOpen:Bxe,curveBasis:Dxe,curveBumpX:Sxe,curveBumpY:Nxe,curveLinearClosed:Uxe,curveLinear:FS,curveMonotoneX:zxe,curveMonotoneY:Wxe,curveNatural:qxe,curveStep:Vxe,curveStepAfter:Gxe,curveStepBefore:Hxe},fw=function(t){return t.x===+t.x&&t.y===+t.y},Dy=function(t){return t.x},Fy=function(t){return t.y},W4e=function(t,n){if(_n(t))return t;var r="curve".concat($S(t));return(r==="curveMonotone"||r==="curveBump")&&n?j8["".concat(r).concat(n==="vertical"?"Y":"X")]:j8[r]||FS},q4e=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,i=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=W4e(r,l),f=u?i.filter(function(g){return fw(g)}):i,p;if(Array.isArray(o)){var h=u?o.filter(function(g){return fw(g)}):o,m=f.map(function(g,v){return _8(_8({},g),{},{base:h[v]})});return l==="vertical"?p=nw().y(Fy).x1(Dy).x0(function(g){return g.base.x}):p=nw().x(Dy).y1(Fy).y0(function(g){return g.base.y}),p.defined(fw).curve(d),p(m)}return l==="vertical"&&gt(o)?p=nw().y(Fy).x1(Dy).x0(o):gt(o)?p=nw().x(Dy).y1(Fy).y0(o):p=NG().x(Dy).y(Fy),p.defined(fw).curve(d),p(f)},qP=function(t){var n=t.className,r=t.points,a=t.path,i=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?q4e(t):a;return x.createElement("path",WP({},cn(t,!1),u2(t),{className:Cn("recharts-curve",n),d:o,ref:i}))},TK={exports:{}},V4e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",H4e=V4e,G4e=H4e;function OK(){}function RK(){}RK.resetWarningCache=OK;var Y4e=function(){function e(r,a,i,o,l,c){if(c!==G4e){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}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol
622:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:RK,resetWarningCache:OK};return n.PropTypes=n,n};TK.exports=Y4e();var K4e=TK.exports;const fr=mr(K4e);var Z4e=Object.getOwnPropertyNames,X4e=Object.getOwnPropertySymbols,J4e=Object.prototype.hasOwnProperty;function S8(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function hw(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);var i=a.cache,o=i.get(n),l=i.get(r);if(o&&l)return o===r&&l===n;i.set(n,r),i.set(r,n);var c=e(n,r,a);return i.delete(n),i.delete(r),c}}function N8(e){return Z4e(e).concat(X4e(e))}var Q4e=Object.hasOwn||function(e,t){return J4e.call(e,t)};function Ep(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var eTe="__v",tTe="__o",nTe="_owner",A8=Object.getOwnPropertyDescriptor,k8=Object.keys;function rTe(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function aTe(e,t){return Ep(e.getTime(),t.getTime())}function iTe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function sTe(e,t){return e===t}function E8(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),i=e.entries(),o,l,c=0;(o=i.next())&&!o.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(a[f]){f++;continue}var p=o.value,h=l.value;if(n.equals(p[0],h[0],c,f,e,t,n)&&n.equals(p[1],h[1],p[0],h[0],e,t,n)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}var oTe=Ep;function lTe(e,t,n){var r=k8(e),a=r.length;if(k8(t).length!==a)return!1;for(;a-- >0;)if(!IK(e,t,n,r[a]))return!1;return!0}function By(e,t,n){var r=N8(e),a=r.length;if(N8(t).length!==a)return!1;for(var i,o,l;a-- >0;)if(i=r[a],!IK(e,t,n,i)||(o=A8(e,i),l=A8(t,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function cTe(e,t){return Ep(e.valueOf(),t.valueOf())}function uTe(e,t){return e.source===t.source&&e.flags===t.flags}function C8(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),i=e.values(),o,l;(o=i.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!a[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function dTe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function fTe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function IK(e,t,n,r){return(r===nTe||r===tTe||r===eTe)&&(e.$$typeof||t.$$typeof)?!0:Q4e(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var hTe="[object Arguments]",pTe="[object Boolean]",mTe="[object Date]",gTe="[object Error]",vTe="[object Map]",yTe="[object Number]",xTe="[object Object]",bTe="[object RegExp]",wTe="[object Set]",_Te="[object String]",jTe="[object URL]",STe=Array.isArray,P8=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,T8=Object.assign,NTe=Object.prototype.toString.call.bind(Object.prototype.toString);function ATe(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,p=e.areUrlsEqual;return function(m,g,v){if(m===g)return!0;if(m==null||g==null)return!1;var y=typeof m;if(y!==typeof g)return!1;if(y!=="object")return y==="number"?o(m,g,v):y==="function"?a(m,g,v):!1;var b=m.constructor;if(b!==g.constructor)return!1;if(b===Object)return l(m,g,v);if(STe(m))return t(m,g,v);if(P8!=null&&P8(m))return f(m,g,v);if(b===Date)return n(m,g,v);if(b===RegExp)return u(m,g,v);if(b===Map)return i(m,g,v);if(b===Set)return d(m,g,v);var w=NTe(m);return w===mTe?n(m,g,v):w===bTe?u(m,g,v):w===vTe?i(m,g,v):w===wTe?d(m,g,v):w===xTe?typeof m.then!="function"&&typeof g.then!="function"&&l(m,g,v):w===jTe?p(m,g,v):w===gTe?r(m,g,v):w===hTe?l(m,g,v):w===pTe||w===yTe||w===_Te?c(m,g,v):!1}}
vendor: 30,231 bytes, lines 622-640
622function kTe(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,a={areArraysEqual:r?By:rTe,areDatesEqual:aTe,areErrorsEqual:iTe,areFunctionsEqual:sTe,areMapsEqual:r?S8(E8,By):E8,areNumbersEqual:oTe,areObjectsEqual:r?By:lTe,arePrimitiveWrappersEqual:cTe,areRegExpsEqual:uTe,areSetsEqual:r?S8(C8,By):C8,areTypedArraysEqual:r?By:dTe,areUrlsEqual:fTe};if(n&&(a=T8({},a,n(a))),t){var i=hw(a.areArraysEqual),o=hw(a.areMapsEqual),l=hw(a.areObjectsEqual),c=hw(a.areSetsEqual);a=T8({},a,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return a}function ETe(e){return function(t,n,r,a,i,o,l){return e(t,n,l)}}function CTe(e){var t=e.circular,n=e.comparator,r=e.createState,a=e.equals,i=e.strict;if(r)return function(c,u){var d=r(),f=d.cache,p=f===void 0?t?new WeakMap:void 0:f,h=d.meta;return n(c,u,{cache:p,equals:a,meta:h,strict:i})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var o={cache:void 0,equals:a,meta:void 0,strict:i};return function(c,u){return n(c,u,o)}}var PTe=Af();Af({strict:!0});Af({circular:!0});Af({circular:!0,strict:!0});Af({createInternalComparator:function(){return Ep}});Af({strict:!0,createInternalComparator:function(){return Ep}});Af({circular:!0,createInternalComparator:function(){return Ep}});Af({circular:!0,createInternalComparator:function(){return Ep},strict:!0});function Af(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,a=e.createState,i=e.strict,o=i===void 0?!1:i,l=kTe(e),c=ATe(l),u=r?r(c):ETe(c);return CTe({circular:n,comparator:c,createState:a,equals:u,strict:o})}function TTe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function O8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):TTe(a)};requestAnimationFrame(r)}function VP(e){"@babel/helpers - typeof";return VP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},VP(e)}function OTe(e){return MTe(e)||LTe(e)||ITe(e)||RTe()}function RTe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
623In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ITe(e,t){if(e){if(typeof e=="string")return R8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R8(e,t)}}function R8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LTe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MTe(e){if(Array.isArray(e))return e}function $Te(){var e={},t=function(){return null},n=!1,r=function a(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,l=OTe(o),c=l[0],u=l.slice(1);if(typeof c=="number"){O8(a.bind(null,u),c);return}a(c),O8(a.bind(null,u));return}VP(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){n=!0},start:function(i){n=!1,r(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function Fx(e){"@babel/helpers - typeof";return Fx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fx(e)}function I8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function L8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I8(Object(n),!0).forEach(function(r){LK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LK(e,t,n){return t=DTe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DTe(e){var t=FTe(e,"string");return Fx(t)==="symbol"?t:String(t)}function FTe(e,t){if(Fx(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Fx(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BTe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},UTe=function(t){return t},zTe=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},C0=function(t,n){return Object.keys(n).reduce(function(r,a){return L8(L8({},r),{},LK({},a,t(a,n[a])))},{})},M8=function(t,n,r){return t.map(function(a){return"".concat(zTe(a)," ").concat(n,"ms ").concat(r)}).join(",")};function WTe(e,t){return HTe(e)||VTe(e,t)||MK(e,t)||qTe()}function qTe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
624In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VTe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function HTe(e){if(Array.isArray(e))return e}function GTe(e){return ZTe(e)||KTe(e)||MK(e)||YTe()}function YTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
625In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MK(e,t){if(e){if(typeof e=="string")return HP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HP(e,t)}}function KTe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZTe(e){if(Array.isArray(e))return HP(e)}function HP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var B2=1e-4,$K=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},DK=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},$8=function(t,n){return function(r){var a=$K(t,n);return DK(a,r)}},XTe=function(t,n){return function(r){var a=$K(t,n),i=[].concat(GTe(a.map(function(o,l){return o*l}).slice(1)),[0]);return DK(i,r)}},D8=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],i=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,l=1;break;case"ease":a=.25,i=.1,o=.25,l=1;break;case"ease-in":a=.42,i=0,o=1,l=1;break;case"ease-out":a=.42,i=0,o=.58,l=1;break;case"ease-in-out":a=0,i=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(v){return parseFloat(v)}),d=WTe(u,4);a=d[0],i=d[1],o=d[2],l=d[3]}}}var f=$8(a,o),p=$8(i,l),h=XTe(a,o),m=function(y){return y>1?1:y<0?0:y},g=function(y){for(var b=y>1?1:y,w=b,j=0;j<8;++j){var S=f(w)-b,A=h(w);if(Math.abs(S-b)<B2||A<B2)return p(w);w=m(w-S/A)}return p(w)};return g.isStepper=!1,g},JTe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(d,f,p){var h=-(d-f)*r,m=p*i,g=p+(h-m)*l/1e3,v=p*l/1e3+d;return Math.abs(v-f)<B2&&Math.abs(g)<B2?[f,0]:[v,g]};return c.isStepper=!0,c.dt=l,c},QTe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return D8(a);case"spring":return JTe();default:if(a.split("(")[0]==="cubic-bezier")return D8(a)}return typeof a=="function"?a:null};function Bx(e){"@babel/helpers - typeof";return Bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bx(e)}function F8(e){return nOe(e)||tOe(e)||FK(e)||eOe()}function eOe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
626In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tOe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nOe(e){if(Array.isArray(e))return YP(e)}function B8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ti(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B8(Object(n),!0).forEach(function(r){GP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GP(e,t,n){return t=rOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rOe(e){var t=aOe(e,"string");return Bx(t)==="symbol"?t:String(t)}function aOe(e,t){if(Bx(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Bx(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iOe(e,t){return lOe(e)||oOe(e,t)||FK(e,t)||sOe()}function sOe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
627In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FK(e,t){if(e){if(typeof e=="string")return YP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YP(e,t)}}function YP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oOe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function lOe(e){if(Array.isArray(e))return e}var U2=function(t,n,r){return t+(n-t)*r},KP=function(t){var n=t.from,r=t.to;return n!==r},cOe=function e(t,n,r){var a=C0(function(i,o){if(KP(o)){var l=t(o.from,o.to,o.velocity),c=iOe(l,2),u=c[0],d=c[1];return Ti(Ti({},o),{},{from:u,velocity:d})}return o},n);return r<1?C0(function(i,o){return KP(o)?Ti(Ti({},o),{},{velocity:U2(o.velocity,a[i].velocity,r),from:U2(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const uOe=function(e,t,n,r,a){var i=BTe(e,t),o=i.reduce(function(v,y){return Ti(Ti({},v),{},GP({},y,[e[y],t[y]]))},{}),l=i.reduce(function(v,y){return Ti(Ti({},v),{},GP({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,f=function(){return null},p=function(){return C0(function(y,b){return b.from},l)},h=function(){return!Object.values(l).filter(KP).length},m=function(y){u||(u=y);var b=y-u,w=b/n.dt;l=cOe(n,l,w),a(Ti(Ti(Ti({},e),t),p())),u=y,h()||(c=requestAnimationFrame(f))},g=function(y){d||(d=y);var b=(y-d)/r,w=C0(function(S,A){return U2.apply(void 0,F8(A).concat([n(b)]))},o);if(a(Ti(Ti(Ti({},e),t),w)),b<1)c=requestAnimationFrame(f);else{var j=C0(function(S,A){return U2.apply(void 0,F8(A).concat([n(1)]))},o);a(Ti(Ti(Ti({},e),t),j))}};return f=n.isStepper?m:g,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function Jg(e){"@babel/helpers - typeof";return Jg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jg(e)}var dOe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function fOe(e,t){if(e==null)return{};var n=hOe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hOe(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function WA(e){return vOe(e)||gOe(e)||mOe(e)||pOe()}function pOe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
628In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mOe(e,t){if(e){if(typeof e=="string")return ZP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ZP(e,t)}}function gOe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vOe(e){if(Array.isArray(e))return ZP(e)}function ZP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function U8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function cl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U8(Object(n),!0).forEach(function(r){u0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u0(e,t,n){return t=BK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yOe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xOe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,BK(r.key),r)}}function bOe(e,t,n){return t&&xOe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function BK(e){var t=wOe(e,"string");return Jg(t)==="symbol"?t:String(t)}function wOe(e,t){if(Jg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Jg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _Oe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XP(e,t)}function XP(e,t){return XP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},XP(e,t)}function jOe(e){var t=SOe();return function(){var r=z2(e),a;if(t){var i=z2(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return JP(this,a)}}function JP(e,t){if(t&&(Jg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QP(e)}function QP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SOe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function z2(e){return z2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},z2(e)}var Su=function(e){_Oe(n,e);var t=jOe(n);function n(r,a){var i;yOe(this,n),i=t.call(this,r,a);var o=i.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,p=o.children,h=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(QP(i)),i.changeStyle=i.changeStyle.bind(QP(i)),!l||h<=0)return i.state={style:{}},typeof p=="function"&&(i.state={style:d}),JP(i);if(f&&f.length)i.state={style:f[0].style};else if(u){if(typeof p=="function")return i.state={style:u},JP(i);i.state={style:c?u0({},c,u):u}}else i.state={style:{}};return i}return bOe(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,d=i.to,f=i.from,p=this.state.style;if(l){if(!o){var h={style:c?u0({},c,d):d};this.state&&p&&(c&&p[c]!==d||!c&&p!==d)&&this.setState(h);return}if(!(PTe(a.to,d)&&a.canBegin&&a.isActive)){var m=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=m||u?f:a.to;if(this.state&&p){var v={style:c?u0({},c,g):g};(c&&p[c]!==g||!c&&p!==g)&&this.setState(v)}this.runAnimation(cl(cl({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,p=a.onAnimationStart,h=uOe(o,l,QTe(u),c,this.changeStyle),m=function(){i.stopJSAnimation=h()};this.manager.start([p,d,m,c,f])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,l=a.begin,c=a.onAnimationStart,u=o[0],d=u.style,f=u.duration,p=f===void 0?0:f,h=function(g,v,y){if(y===0)return g;var b=v.duration,w=v.easing,j=w===void 0?"ease":w,S=v.style,A=v.properties,E=v.onAnimationEnd,k=y>0?o[y-1]:v,P=A||Object.keys(S);if(typeof j=="function"||j==="spring")return[].concat(WA(g),[i.runJSAnimation.bind(i,{from:k.style,to:S,duration:b,easing:j}),b]);var R=M8(P,b,j),C=cl(cl(cl({},k.style),S),{},{transition:R});return[].concat(WA(g),[C,b,E]).filter(UTe)};return this.manager.start([c].concat(WA(o.reduce(h,[d,Math.max(p,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=$Te());var i=a.begin,o=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,p=a.steps,h=a.children,m=this.manager;if(this.unSubscribe=m.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(a);return}if(p.length>1){this.runStepAnimation(a);return}var g=l?u0({},l,c):c,v=M8(Object.keys(g),o,u);m.start([d,i,cl(cl({},g),{},{transition:v}),o,f])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=fOe(a,dOe),u=x.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!l||u===0||o<=0)return i;var f=function(h){var m=h.props,g=m.style,v=g===void 0?{}:g,y=m.className,b=x.cloneElement(h,cl(cl({},c),{},{style:cl(cl({},v),d),className:y}));return b};return u===1?f(x.Children.only(i)):ue.createElement("div",null,x.Children.map(i,function(p){return f(p)}))}}]),n}(x.PureComponent);Su.displayName="Animate";Su.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Su.propTypes={from:fr.oneOfType([fr.object,fr.string]),to:fr.oneOfType([fr.object,fr.string]),attributeName:fr.string,duration:fr.number,begin:fr.number,easing:fr.oneOfType([fr.string,fr.func]),steps:fr.arrayOf(fr.shape({duration:fr.number.isRequired,style:fr.object.isRequired,easing:fr.oneOfType([fr.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),fr.func]),properties:fr.arrayOf("string"),onAnimationEnd:fr.func})),children:fr.oneOfType([fr.node,fr.func]),isActive:fr.bool,canBegin:fr.bool,onAnimationEnd:fr.func,shouldReAnimate:fr.bool,onAnimationStart:fr.func,onAnimationReStart:fr.func};function Ux(e){"@babel/helpers - typeof";return Ux=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ux(e)}function W2(){return W2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},W2.apply(this,arguments)}function NOe(e,t){return COe(e)||EOe(e,t)||kOe(e,t)||AOe()}function AOe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
629In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kOe(e,t){if(e){if(typeof e=="string")return z8(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z8(e,t)}}function z8(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EOe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function COe(e){if(Array.isArray(e))return e}function W8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function q8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W8(Object(n),!0).forEach(function(r){POe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function POe(e,t,n){return t=TOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TOe(e){var t=OOe(e,"string");return Ux(t)=="symbol"?t:t+""}function OOe(e,t){if(Ux(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ux(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var V8=function(t,n,r,a,i){var o=Math.min(Math.abs(r)/2,Math.abs(a)/2),l=a>=0?1:-1,c=r>=0?1:-1,u=a>=0&&r>=0||a<0&&r<0?1:0,d;if(o>0&&i instanceof Array){for(var f=[0,0,0,0],p=0,h=4;p<h;p++)f[p]=i[p]>o?o:i[p];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
630        `).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
631        `).concat(t+r-c*f[2],",").concat(n+a)),d+="L ".concat(t+c*f[3],",").concat(n+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
632        `).concat(t,",").concat(n+a-l*f[3])),d+="Z"}else if(o>0&&i===+i&&i>0){var m=Math.min(o,i);d="M ".concat(t,",").concat(n+l*m,`
633            A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+c*m,",").concat(n,`
634            L `).concat(t+r-c*m,",").concat(n,`
635            A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*m,`
636            L `).concat(t+r,",").concat(n+a-l*m,`
637            A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+r-c*m,",").concat(n+a,`
638            L `).concat(t+c*m,",").concat(n+a,`
639            A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t,",").concat(n+a-l*m," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return d},ROe=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),d=Math.max(i,i+l),f=Math.min(o,o+c),p=Math.max(o,o+c);return r>=u&&r<=d&&a>=f&&a<=p}return!1},IOe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},lR=function(t){var n=q8(q8({},IOe),t),r=x.useRef(),a=x.useState(-1),i=NOe(a,2),o=i[0],l=i[1];x.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var j=r.current.getTotalLength();j&&l(j)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,p=n.radius,h=n.className,m=n.animationEasing,g=n.animationDuration,v=n.animationBegin,y=n.isAnimationActive,b=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=Cn("recharts-rectangle",h);return b?ue.createElement(Su,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:g,animationEasing:m,isActive:b},function(j){var S=j.width,A=j.height,E=j.x,k=j.y;return ue.createElement(Su,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,isActive:y,easing:m},ue.createElement("path",W2({},cn(n,!0),{className:w,d:V8(E,k,S,A,p),ref:r})))}):ue.createElement("path",W2({},cn(n,!0),{className:w,d:V8(c,u,d,f,p)}))},LOe=["points","className","baseLinePoints","connectNulls"];function Bm(){return Bm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bm.apply(this,arguments)}function MOe(e,t){if(e==null)return{};var n=$Oe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $Oe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function H8(e){return UOe(e)||BOe(e)||FOe(e)||DOe()}function DOe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
640In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FOe(e,t){if(e){if(typeof e=="string")return e4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e4(e,t)}}function BOe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UOe(e){if(Array.isArray(e))return e4(e)}function e4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var G8=function(t){return t&&t.x===+t.x&&t.y===+t.y},zOe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){G8(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),G8(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},P0=function(t,n){var r=zOe(t);n&&(r=[r.reduce(function(i,o){return[].concat(H8(i),H8(o))},[])]);var a=r.map(function(i){return i.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},WOe=function(t,n,r){var a=P0(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(P0(n.reverse(),r).slice(1))},qOe=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=MOe(t,LOe);if(!n||!n.length)return null;var l=Cn("recharts-polygon",r);if(a&&a.length){var c=o.stroke&&o.stroke!=="none",u=WOe(n,a,i);return ue.createElement("g",{className:l},ue.createElement("path",Bm({},cn(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?ue.createElement("path",Bm({},cn(o,!0),{fill:"none",d:P0(n,i)})):null,c?ue.createElement("path",Bm({},cn(o,!0),{fill:"none",d:P0(a,i)})):null)}var d=P0(n,i);return ue.createElement("path",Bm({},cn(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function t4(){return t4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t4.apply(this,arguments)}var cR=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=Cn("recharts-dot",i);return n===+n&&r===+r&&a===+a?x.createElement("circle",t4({},cn(t,!1),u2(t),{className:o,cx:n,cy:r,r:a})):null};function zx(e){"@babel/helpers - typeof";return zx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zx(e)}var VOe=["x","y","top","left","width","height","className"];function n4(){return n4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}
640,n4.apply(this,arguments)}function Y8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function HOe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y8(Object(n),!0).forEach(function(r){GOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GOe(e,t,n){return t=YOe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YOe(e){var t=KOe(e,"string");return zx(t)=="symbol"?t:t+""}function KOe(e,t){if(zx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ZOe(e,t){if(e==null)return{};var n=XOe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XOe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var JOe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},QOe=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,p=t.height,h=p===void 0?0:p,m=t.className,g=ZOe(t,VOe),v=HOe({x:r,y:i,top:l,left:u,width:f,height:h},g);return!gt(r)||!gt(i)||!gt(f)||!gt(h)||!gt(l)||!gt(u)?null:ue.createElement("path",n4({},cn(v,!0),{className:Cn("recharts-cross",m),d:JOe(r,i,f,h,l,u)}))},e3e=ZS,t3e=QY,n3e=jf;function r3e(e,t){return e&&e.length?e3e(e,n3e(t),t3e):void 0}var a3e=r3e;const i3e=mr(a3e);var s3e=ZS,o3e=jf,l3e=eK;function c3e(e,t){return e&&e.length?s3e(e,o3e(t),l3e):void 0}var u3e=c3e;const d3e=mr(u3e);var f3e=["cx","cy","angle","ticks","axisLine"],h3e=["ticks","tick","angle","tickFormatter","stroke"];function Qg(e){"@babel/helpers - typeof";return Qg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qg(e)}function T0(){return T0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},T0.apply(this,arguments)}function K8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Kf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K8(Object(n),!0).forEach(function(r){rN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z8(e,t){if(e==null)return{};var n=p3e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function p3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function m3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zK(r.key),r)}}function g3e(e,t,n){return t&&X8(e.prototype,t),n&&X8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function v3e(e,t,n){return t=q2(t),y3e(e,UK()?Reflect.construct(t,n||[],q2(e).
vendor: 28,171 bytes, lines 640-641
640constructor):t.apply(e,n))}function y3e(e,t){if(t&&(Qg(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x3e(e)}function x3e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UK=function(){return!!e})()}function q2(e){return q2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},q2(e)}function b3e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r4(e,t)}function r4(e,t){return r4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},r4(e,t)}function rN(e,t,n){return t=zK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zK(e){var t=w3e(e,"string");return Qg(t)=="symbol"?t:t+""}function w3e(e,t){if(Qg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aN=function(e){function t(){return m3e(this,t),v3e(this,t,arguments)}return b3e(t,e),g3e(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,l=i.cx,c=i.cy;return Br(l,c,a,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,a;switch(r){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,l=r.ticks,c=i3e(l,function(d){return d.coordinate||0}),u=d3e(l,function(d){return d.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,l=r.ticks,c=r.axisLine,u=Z8(r,f3e),d=l.reduce(function(m,g){return[Math.min(m[0],g.coordinate),Math.max(m[1],g.coordinate)]},[1/0,-1/0]),f=Br(a,i,d[0],o),p=Br(a,i,d[1],o),h=Kf(Kf(Kf({},cn(u,!1)),{},{fill:"none"},cn(c,!1)),{},{x1:f.x,y1:f.y,x2:p.x,y2:p.y});return ue.createElement("line",T0({className:"recharts-polar-radius-axis-line"},h))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,l=a.angle,c=a.tickFormatter,u=a.stroke,d=Z8(a,h3e),f=this.getTickTextAnchor(),p=cn(d,!1),h=cn(o,!1),m=i.map(function(g,v){var y=r.getTickValueCoord(g),b=Kf(Kf(Kf(Kf({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(y.x,", ").concat(y.y,")")},p),{},{stroke:"none",fill:u},h),{},{index:v},y),{},{payload:g});return ue.createElement(wr,T0({className:Cn("recharts-polar-radius-axis-tick",kK(o)),key:"tick-".concat(g.coordinate)},ip(r.props,g,v)),t.renderTickItem(o,b,c?c(g.value,v):g.value))});return ue.createElement(wr,{className:"recharts-polar-radius-axis-ticks"},m)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.axisLine,o=r.tick;return!a||!a.length?null:ue.createElement(wr,{className:Cn("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),vi.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return ue.isValidElement(r)?o=ue.cloneElement(r,a):_n(r)?o=r(a):o=ue.createElement(sp,T0({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])}(x.PureComponent);rN(aN,"displayName","PolarRadiusAxis");rN(aN,"axisType","radiusAxis");rN(aN,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function ev(e){"@babel/helpers - typeof";return ev=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ev(e)}function fh(){return fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fh.apply(this,arguments)}function J8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J8(Object(n),!0).forEach(function(r){iN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q8(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qK(r.key),r)}}function j3e(e,t,n){return t&&Q8(e.prototype,t),n&&Q8(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S3e(e,t,n){return t=V2(t),N3e(e,WK()?Reflect.construct(t,n||[],V2(e).constructor):t.apply(e,n))}function N3e(e,t){if(t&&(ev(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A3e(e)}function A3e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WK=function(){return!!e})()}function V2(e){return V2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},V2(e)}function k3e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a4(e,t)}function a4(e,t){return a4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},a4(e,t)}function iN(e,t,n){return t=qK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qK(e){var t=E3e(e,"string");return ev(t)=="symbol"?t:t+""}function E3e(e,t){if(ev(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ev(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var C3e=Math.PI/180,eF=1e-5,sN=function(e){function t(){return _3e(this,t),S3e(this,t,arguments)}return k3e(t,e),j3e(t,[{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.cx,o=a.cy,l=a.radius,c=a.orientation,u=a.tickSize,d=u||8,f=Br(i,o,l,r.coordinate),p=Br(i,o,l+(c==="inner"?-1:1)*d,r.coordinate);return{x1:f.x,y1:f.y,x2:p.x,y2:p.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*C3e),o;return i>eF?o=a==="outer"?"start":"end":i<-eF?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.radius,l=r.axisLine,c=r.axisLineType,u=Zf(Zf({},cn(this.props,!1)),{},{fill:"none"},cn(l,!1));if(c==="circle")return ue.createElement(cR,fh({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var d=this.props.ticks,f=d.map(function(p){return Br(a,i,o,p.coordinate)});return ue.createElement(qOe,fh({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,l=a.tickLine,c=a.tickFormatter,u=a.stroke,d=cn(this.props,!1),f=cn(o,!1),p=Zf(Zf({},d),{},{fill:"none"},cn(l,!1)),h=i.map(function(m,g){var v=r.getTickLineCoord(m),y=r.getTickTextAnchor(m),b=Zf(Zf(Zf({textAnchor:y},d),{},{stroke:"none",fill:u},f),{},{index:g,payload:m,x:v.x2,y:v.y2});return ue.createElement(wr,fh({className:Cn("recharts-polar-angle-axis-tick",kK(o)),key:"tick-".concat(m.coordinate)},ip(r.props,m,g)),l&&ue.createElement("line",fh({className:"recharts-polar-angle-axis-tick-line"},p,v)),o&&t.renderTickItem(o,b,c?c(m.value,g):m.value))});return ue.createElement(wr,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:ue.createElement(wr,{className:Cn("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return ue.isValidElement(r)?o=ue.cloneElement(r,a):_n(r)?o=r(a):o=ue.createElement(sp,fh({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(x.PureComponent);iN(sN,"displayName","PolarAngleAxis");iN(sN,"axisType","angleAxis");iN(sN,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var P3e=KG,T3e=P3e(Object.getPrototypeOf,Object),O3e=T3e,R3e=Tu,I3e=O3e,L3e=Ou,M3e="[object Object]",$3e=Function.prototype,D3e=Object.prototype,VK=$3e.toString,F3e=D3e.hasOwnProperty,B3e=VK.call(Object);function U3e(e){if(!L3e(e)||R3e(e)!=M3e)return!1;var t=I3e(e);if(t===null)return!0;var n=F3e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&VK.call(n)==B3e}var z3e=U3e;const W3e=mr(z3e);var q3e=Tu,V3e=Ou,H3e="[object Boolean]";function G3e(e){return e===!0||e===!1||V3e(e)&&q3e(e)==H3e}var Y3e=G3e;const K3e=mr(Y3e);function Wx(e){"@babel/helpers - typeof";return Wx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wx(e)}function H2(){return H2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H2.apply(this,arguments)}function Z3e(e,t){return eRe(e)||Q3e(e,t)||J3e(e,t)||X3e()}function X3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
641In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J3e(e,t){if(e){if(typeof e=="string")return tF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tF(e,t)}}function tF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Q3e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function eRe(e){if(Array.isArray(e))return e}function nF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nF(Object(n),!0).forEach(function(r){tRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tRe(e,t,n){return t=nRe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nRe(e){var t=rRe(e,"string");return Wx(t)=="symbol"?t:t+""}function rRe(e,t){if(Wx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Wx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aF=function(t,n,r,a,i){var o=r-a,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+i),l+="L ".concat(t+r-o/2-a,",").concat(n+i),l+="L ".concat(t,",").concat(n," Z"),l},aRe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},iRe=function(t){var n=rF(rF({},aRe),t),r=x.useRef(),a=x.useState(-1),i=Z3e(a,2),o=i[0],l=i[1];x.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&l(w)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,p=n.height,h=n.className,m=n.animationEasing,g=n.animationDuration,v=n.animationBegin,y=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||p!==+p||d===0&&f===0||p===0)return null;var b=Cn("recharts-trapezoid",h);return y?ue.createElement(Su,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:p,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:p,x:c,y:u},duration:g,animationEasing:m,isActive:y},function(w){var j=w.upperWidth,S=w.lowerWidth,A=w.height,E=w.x,k=w.y;return ue.createElement(Su,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,easing:m},ue.createElement("path",H2({},cn(n,!0),{className:b,d:aF(E,k,j,S,A),ref:r})))}):ue.createElement("g",null,ue.createElement("path",H2({},cn(n,!0),{className:b,d:aF(c,u,d,f,p)})))},sRe=["option","shapeType","propTransformer","activeClassName","isActive"];function qx(e){"@babel/helpers - typeof";return qx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qx(e)}function oRe(e,t){if(e==null)return{};var n=lRe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lRe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function iF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function G2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iF(Object(n),!0).forEach(function(r){cRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cRe(e,t,n){return t=uRe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uRe(e){var t=dRe(e,"string");return qx(t)=="symbol"?t:t+""}function dRe(e,t){if(qx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(qx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fRe(e,t){return G2(G2({},t),e)}function hRe(e,t){return e==="symbols"}function sF(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return ue.createElement(lR,n);case"trapezoid":return ue.createElement(iRe,n);case"sector":return ue.createElement(PK,n);case"symbols":if(hRe(t))return ue.createElement(A3,n);break;default:return null}}function pRe(e){return x.isValidElement(e)?e.props:e}function HK(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?fRe:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,l=e.isActive,c=oRe(e,sRe),u;if(x.isValidElement(t))u=x.cloneElement(t,G2(G2({},c),pRe(t)));else if(_n(t))u=t(c);else if(W3e(t)&&!K3e(t)){var d=a(t,c);u=ue.createElement(sF,{shapeType:n,elementProps:d})}else{var f=c;u=ue.createElement(sF,{shapeType:n,elementProps:f})}return l?ue.createElement(wr,{className:o},u):u}function oN(e,t){return t!=null&&"trapezoids"in e.props}function lN(e,t){return t!=null&&"sectors"in e.props}function Vx(e,t){return t!=null&&"points"in e.props}function mRe(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,i=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&i}function gRe(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function vRe(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function yRe(e,t){var n;return oN(e,t)?n=mRe:lN(e,t)?n=gRe:Vx(e,t)&&(n=vRe),n}function xRe(e,t){var n;return oN(e,t)?n="trapezoids":lN(e,t)?n="sectors":Vx(e,t)&&(n="points"),n}function bRe(e,t){if(oN(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(lN(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return Vx(e,t)?t.payload:{}}function wRe(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=xRe(n,t),i=bRe(n,t),o=r.filter(function(c,u){var d=QS(i,c),f=n.props[a].filter(function(m){var g=yRe(n,t);return g(m,t)}),p=n.props[a].indexOf(f[f.length-1]),h=u===p;return d&&h}),l=r.indexOf(o[o.length-1]);return l}var a_;function tv(e){"@babel/helpers - typeof";return tv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tv(e)}function Um(){return Um=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Um.apply(this,arguments)}function oF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oF(Object(n),!0).forEach(function(r){$o(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YK(r.key),r)}}function jRe(e,t,n){return t&&lF(e.prototype,t),n&&lF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function SRe(e,t,n){return t=Y2(t),NRe(e,GK()?Reflect.construct(t,n||[],Y2(e).constructor):t.apply(e,n))}function NRe(e,t){if(t&&(tv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ARe(e)}function ARe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GK=function(){return!!e})()}function Y2(e){return Y2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Y2(e)}function kRe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i4(e,t)}function i4(e,t){return i4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},i4(e,t)}function $o(e,t,n){return t=YK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YK(e){var t=ERe(e,"string");return tv(t)=="symbol"?t:t+""}function ERe(e,t){if(tv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Iu=function(e){function t(n){var r;return _Re(this,t),r=SRe(this,t,[n]),$o(r,"pieRef",null),$o(r,"sectorRefs",[]),$o(r,"id",Ob("recharts-pie-")),$o(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),_n(a)&&a()}),$o(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),_n(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return kRe(t,e),jRe(t,[{key:"isActiveIndex",value:function(r){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(r)!==-1:r===a}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,l=i.labelLine,c=i.dataKey,u=i.valueKey,d=cn(this.props,!1),f=cn(o,!1),p=cn(l,!1),h=o&&o.offsetRadius||20,m=r.map(function(g,v){var y=(g.startAngle+g.endAngle)/2,b=Br(g.cx,g.cy,g.outerRadius+h,y),w=$r($r($r($r({},d),g),{},{stroke:"none"},f),{},{index:v,textAnchor:t.getTextAnchor(b.x,g.cx)},b),j=$r($r($r($r({},d),g),{},{fill:"none",stroke:g.fill},p),{},{index:v,points:[Br(g.cx,g.cy,g.outerRadius,y),b]}),S=c;return In(c)&&In(u)?S="value":In(c)&&(S=u),ue.createElement(wr,{key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(v)},l&&t.renderLabelLineItem(l,j,"line"),t.renderLabelItem(o,w,Xi(g,S)))});return ue.createElement(wr,{className:"recharts-pie-labels"},m)}},{key:"renderSectorsStatically",value:function(r){var a=this,i=this.props,o=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return r.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&r.length!==1)return null;var f=a.isActiveIndex(d),p=c&&a.hasActiveIndex()?c:null,h=f?o:p,m=$r($r({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return ue.createElement(wr,Um({ref:function(v){v&&!a.sectorRefs.includes(v)&&a.sectorRefs.push(v)},tabIndex:-1,className:"recharts-pie-sector"},ip(a.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),ue.createElement(HK,Um({option:h,isActive:f,shapeType:"sector"},m)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,a=this.props,i=a.sectors,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,d=a.animationId,f=this.state,p=f.prevSectors,h=f.prevIsAnimationActive;return ue.createElement(Su,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(h),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(m){var g=m.t,v=[],y=i&&i[0],b=y.startAngle;return i.forEach(function(w,j){var S=p&&p[j],A=j>0?ho(w,"paddingAngle",0):0;if(S){var E=ld(S.endAngle-S.startAngle,w.endAngle-w.startAngle),k=$r($r({},w),{},{startAngle:b+A,endAngle:b+E(g)+A});v.push(k),b=k.endAngle}else{var P=w.endAngle,R=w.startAngle,C=ld(0,P-R),I=C(g),D=$r($r({},w),{},{startAngle:b+A,endAngle:b+I+A});v.push(D),b=D.endAngle}}),ue.createElement(wr,null,r.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!QS(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,o=a.sectors,l=a.className,c=a.label,u=a.cx,d=a.cy,f=a.innerRadius,p=a.outerRadius,h=a.isAnimationActive,m=this.state.isAnimationFinished;if(i||!o||!o.length||!gt(u)||!gt(d)||!gt(f)||!gt(p))return null;var g=Cn("recharts-pie",l);return ue.createElement(wr,{tabIndex:this.props.rootTabIndex,className:g,ref:function(y){r.pieRef=y}},this.renderSectors(),c&&this.renderLabels(o),vi.renderCallByParent(this.props,null,!1),(!h||m)&&Gd.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,a,i){if(ue.isValidElement(r))return ue.cloneElement(r,a);if(_n(r))return r(a);var o=Cn("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return ue.createElement(qP,Um({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(ue.isValidElement(r))return ue.cloneElement(r,a);var o=i;if(_n(r)&&(o=r(a),ue.isValidElement(o)))return o;var l=Cn("recharts-pie-label-text",typeof r!="boolean"&&!_n(r)?r.className:"");return ue.createElement(sp,Um({},a,{alignmentBaseline:"middle",className:l}),o)}}])}(x.PureComponent);a_=Iu;$o(Iu,"displayName","Pie");$o(Iu,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!du.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});$o(Iu,"parseDeltaAngle",function(e,t){var n=ds(t-e),r=Math.min(Math.abs(t-e),360);return n*r});$o(Iu,"getRealPieData",function(e){var t=e.data,n=e.children,r=cn(e,!1),a=Wo(n,Rb);return t&&t.length?t.map(function(i,o){return $r($r($r({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return $r($r({},r),i.props)}):[]});$o(Iu,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=AK(a,i),l=r+fs(e.cx,a,a/2),c=n+fs(e.cy,i,i/2),u=fs(e.innerRadius,o,0),d=fs(e.outerRadius,o,o*.8),f=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:f}});$o(Iu,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?$r($r({},t.type.defaultProps),t.props):t.props,a=a_.getRealPieData(r);if(!a||!a.length)return null;var i=r.cornerRadius,o=r.startAngle,l=r.endAngle,c=r.paddingAngle,u=r.dataKey,d=r.nameKey,f=r.valueKey,p=r.tooltipType,h=Math.abs(r.minAngle),m=a_.parseCoordinateOfPie(r,n),g=a_.parseDeltaAngle(o,l),v=Math.abs(g),y=u;In(u)&&In(f)?(uu(!1,`Use "dataKey" to specify the value of pie,
642      the props "valueKey" will be deprecated in 1.1.0`),y="value"):In(u)&&(uu(!1,`Use "dataKey" to specify the value of pie,
643      the props "valueKey" will be deprecated in 1.1.0`),y=f);var b=a.filter(function(k){return Xi(k,y,0)!==0}).length,w=(v>=360?b:b-1)*c,j=v-b*h-w,S=a.reduce(function(k,P){var R=Xi(P,y,0);return k+(gt(R)?R:0)},0),A;if(S>0){var E;A=a.map(function(k,P){var R=Xi(k,y,0),C=Xi(k,d,P),I=(gt(R)?R:0)/S,D;P?D=E.endAngle+ds(g)*c*(R!==0?1:0):D=o;var U=D+ds(g)*((R!==0?h:0)+I*j),q=(D+U)/2,Z=(m.innerRadius+m.outerRadius)/2,H=[{name:C,value:R,payload:k,dataKey:y,type:p}],$=Br(m.cx,m.cy,Z,q);return E=$r($r($r({percent:I,cornerRadius:i,name:C,tooltipPayload:H,midAngle:q,middleRadius:Z,tooltipPosition:$},k),m),{},{value:Xi(k,y),startAngle:D,endAngle:U,payload:k,paddingAngle:ds(g)*c}),E})}return $r($r({},m),{},{sectors:A,data:a})});var CRe=Math.ceil,PRe=Math.max;function TRe(e,t,n,r){for(var a=-1,i=PRe(CRe((t-e)/(n||1)),0),o=Array(i);i--;)o[r?i:++a]=e,e+=n;return o}var ORe=TRe,RRe=hY,cF=1/0,IRe=17976931348623157e292;function LRe(e){if(!e)return e===0?e:0;if(e=RRe(e),e===cF||e===-cF){var t=e<0?-1:1;return t*IRe}return e===e?e:0}var MRe=LRe,$Re=ORe,DRe=WS,qA=MRe;function FRe(e){return function(t,n,r){return r&&typeof r!="number"&&DRe(t,n,r)&&(n=r=void 0),t=qA(t),n===void 0?(n=t,t=0):n=qA(n),r=r===void 0?t<n?1:-1:qA(r),$Re(t,n,r,e)}}var BRe=FRe,URe=BRe,zRe=URe(),WRe=zRe;const K2=mr(WRe);function Hx(e){"@babel/helpers - typeof";return Hx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hx(e)}function uF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function dF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uF(Object(n),!0).forEach(function(r){KK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KK(e,t,n){return t=qRe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qRe(e){var t=VRe(e,"string");return Hx(t)=="symbol"?t:t+""}function VRe(e,t){if(Hx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var HRe=["Webkit","Moz","O","ms"],GRe=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=HRe.reduce(function(i,o){return dF(dF({},i),{},KK({},o+r,n))},{});return a[t]=n,a};function nv(e){"@babel/helpers - typeof";return nv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nv(e)}function Z2(){return Z2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z2.apply(this,arguments)}function fF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function VA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fF(Object(n),!0).forEach(function(r){Qs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,XK(r.key),r)}}function KRe(e,t,n){return t&&hF(e.prototype,t),n&&hF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZRe(e,t,n){return t=X2(t),XRe(e,ZK()?Reflect.construct(t,n||[],X2(e).constructor):t.apply(e,n))}function XRe(e,t){if(t&&(nv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JRe(e)}function JRe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZK=function(){return!!e})()}function X2(e){return X2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},X2(e)}function QRe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s4(e,t)}function s4(e,t){return s4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},s4(e,t)}function Qs(e,t,n){return t=XK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XK(e){var t=eIe(e,"string");return nv(t)=="symbol"?t:t+""}function eIe(e,t){if(nv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(nv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tIe=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,i=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=k0().domain(K2(0,c)).range([i,i+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(a),scale:u,scaleValues:d}},pF=function(t){return t.changedTouches&&!!t.changedTouches.length},rv=function(e){function t(n){var r;return YRe(this,t),r=ZRe(this,t,[n]),Qs(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Qs(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Qs(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:i,startIndex:l})}),r.detachDragEndListener()}),Qs(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Qs(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Qs(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Qs(r,"handleSlideDragStart",function(a){var i=pF(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}
vendor: 102,057 bytes, lines 643-647
643return QRe(t,e),KRe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,i),p=Math.max(a,i),h=t.getIndexInRange(o,f),m=t.getIndexInRange(o,p);return{startIndex:h-h%c,endIndex:m===d?d:m-m%c}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,o=a.tickFormatter,l=a.dataKey,c=Xi(i[r],l,r);return _n(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,p=c.startIndex,h=c.endIndex,m=c.onChange,g=r.pageX-i;g>0?g=Math.min(g,u+d-f-l,u+d-f-o):g<0&&(g=Math.max(g,u-o,u-l));var v=this.getIndex({startX:o+g,endX:l+g});(v.startIndex!==p||v.endIndex!==h)&&m&&m(v),this.setState({startX:o+g,endX:l+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=pF(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[o],d=this.props,f=d.x,p=d.width,h=d.travellerWidth,m=d.onChange,g=d.gap,v=d.data,y={startX:this.state.startX,endX:this.state.endX},b=r.pageX-i;b>0?b=Math.min(b,f+p-h-u):b<0&&(b=Math.max(b,f-u)),y[o]=u+b;var w=this.getIndex(y),j=w.startIndex,S=w.endIndex,A=function(){var k=v.length-1;return o==="startX"&&(l>c?j%g===0:S%g===0)||l<c&&S===k||o==="endX"&&(l>c?S%g===0:j%g===0)||l>c&&S===k};this.setState(Qs(Qs({},o,u+b),"brushMoveStartX",r.pageX),function(){m&&A()&&m(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var p=f+r;if(!(p===-1||p>=l.length)){var h=l[p];a==="startX"&&h>=u||a==="endX"&&h<=c||this.setState(Qs({},a,h),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return ue.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=x.Children.only(u);return f?ue.cloneElement(f,{x:a,y:i,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,p=c.traveller,h=c.ariaLabel,m=c.data,g=c.startIndex,v=c.endIndex,y=Math.max(r,this.props.x),b=VA(VA({},cn(this.props,!1)),{},{x:y,y:u,width:d,height:f}),w=h||"Min value: ".concat((i=m[g])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=m[v])===null||o===void 0?void 0:o.name);return ue.createElement(wr,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(p,b))}},{key:"renderSlide",value:function(r,a){var i=this.props,o=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,d=Math.min(r,a)+u,f=Math.max(Math.abs(a-r)-u,0);return ue.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,p=d.endX,h=5,m={pointerEvents:"none",fill:u};return ue.createElement(wr,{className:"recharts-brush-texts"},ue.createElement(sp,Z2({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,p)-h,y:o+l/2},m),this.getTextOfTick(a)),ue.createElement(sp,Z2({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,p)+c+h,y:o+l/2},m),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,p=this.state,h=p.startX,m=p.endX,g=p.isTextActive,v=p.isSlideMoving,y=p.isTravellerMoving,b=p.isTravellerFocused;if(!a||!a.length||!gt(l)||!gt(c)||!gt(u)||!gt(d)||u<=0||d<=0)return null;var w=Cn("recharts-brush",i),j=ue.Children.count(o)===1,S=GRe("userSelect","none");return ue.createElement(wr,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(h,m),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(m,"endX"),(g||v||y||b||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(i+l/2)-1;return ue.createElement(ue.Fragment,null,ue.createElement("rect",{x:a,y:i,width:o,height:l,fill:c,stroke:"none"}),ue.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),ue.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return ue.isValidElement(r)?i=ue.cloneElement(r,a):_n(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return VA({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},i&&i.length?tIe({data:i,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var p=a.scale.domain().map(function(h){return a.scale(h)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>a?l=c:o=c}return a>=r[l]?l:o}}])}(x.PureComponent);Qs(rv,"displayName","Brush");Qs(rv,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var nIe=I3;function rIe(e,t){var n;return nIe(e,function(r,a,i){return n=t(r,a,i),!n}),!!n}var aIe=rIe,iIe=UG,sIe=jf,oIe=aIe,lIe=Us,cIe=WS;function uIe(e,t,n){var r=lIe(e)?iIe:oIe;return n&&cIe(e,t,n)&&(t=void 0),r(e,sIe(t))}var dIe=uIe;const fIe=mr(dIe);var mc=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},mF=lY;function hIe(e,t,n){t=="__proto__"&&mF?mF(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var pIe=hIe,mIe=pIe,gIe=sY,vIe=jf;function yIe(e,t){var n={};return t=vIe(t),gIe(e,function(r,a,i){mIe(n,a,t(r,a,i))}),n}var xIe=yIe;const bIe=mr(xIe);function wIe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var _Ie=wIe,jIe=I3;function SIe(e,t){var n=!0;return jIe(e,function(r,a,i){return n=!!t(r,a,i),n}),n}var NIe=SIe,AIe=_Ie,kIe=NIe,EIe=jf,CIe=Us,PIe=WS;function TIe(e,t,n){var r=CIe(e)?AIe:kIe;return n&&PIe(e,t,n)&&(t=void 0),r(e,EIe(t))}var OIe=TIe;const RIe=mr(OIe);var IIe=["x","y"];function Gx(e){"@babel/helpers - typeof";return Gx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gx(e)}function o4(){return o4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o4.apply(this,arguments)}function gF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Uy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gF(Object(n),!0).forEach(function(r){LIe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LIe(e,t,n){return t=MIe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MIe(e){var t=$Ie(e,"string");return Gx(t)=="symbol"?t:t+""}function $Ie(e,t){if(Gx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DIe(e,t){if(e==null)return{};var n=FIe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FIe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function BIe(e,t){var n=e.x,r=e.y,a=DIe(e,IIe),i="".concat(n),o=parseInt(i,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),p=parseInt(f,10);return Uy(Uy(Uy(Uy(Uy({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:p,name:t.name,radius:t.radius})}function vF(e){return ue.createElement(HK,o4({shapeType:"rectangle",propTransformer:BIe,activeClassName:"recharts-active-bar"},e))}var UIe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=gt(r)||u0e(r);return i?t(r,a):(i||lp(),n)}},zIe=["value","background"],JK;function av(e){"@babel/helpers - typeof";return av=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},av(e)}function WIe(e,t){if(e==null)return{};var n=qIe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qIe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function J2(){return J2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J2.apply(this,arguments)}function yF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yF(Object(n),!0).forEach(function(r){Od(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VIe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eZ(r.key),r)}}function HIe(e,t,n){return t&&xF(e.prototype,t),n&&xF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function GIe(e,t,n){return t=Q2(t),YIe(e,QK()?Reflect.construct(t,n||[],Q2(e).constructor):t.apply(e,n))}function YIe(e,t){if(t&&(av(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KIe(e)}function KIe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QK=function(){return!!e})()}function Q2(e){return Q2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q2(e)}function ZIe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l4(e,t)}function l4(e,t){return l4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},l4(e,t)}function Od(e,t,n){return t=eZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eZ(e){var t=XIe(e,"string");return av(t)=="symbol"?t:t+""}function XIe(e,t){if(av(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(av(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Cp=function(e){function t(){var n;VIe(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=GIe(this,t,[].concat(a)),Od(n,"state",{isAnimationFinished:!1}),Od(n,"id",Ob("recharts-bar-")),Od(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Od(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return ZIe(t,e),HIe(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,i=this.props,o=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,d=cn(this.props,!1);return r&&r.map(function(f,p){var h=p===c,m=h?u:o,g=qa(qa(qa({},d),f),{},{isActive:h,option:m,index:p,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return ue.createElement(wr,J2({className:"recharts-bar-rectangle"},ip(a.props,f,p),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(p)}),ue.createElement(vF,g))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,i=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,p=this.state.prevData;return ue.createElement(Su,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var m=h.t,g=i.map(function(v,y){var b=p&&p[y];if(b){var w=ld(b.x,v.x),j=ld(b.y,v.y),S=ld(b.width,v.width),A=ld(b.height,v.height);return qa(qa({},v),{},{x:w(m),y:j(m),width:S(m),height:A(m)})}if(o==="horizontal"){var E=ld(0,v.height),k=E(m);return qa(qa({},v),{},{y:v.y+v.height-k,height:k})}var P=ld(0,v.width),R=P(m);return qa(qa({},v),{},{width:R})});return ue.createElement(wr,null,r.renderRectanglesStatically(g))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!QS(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,i=a.data,o=a.dataKey,l=a.activeIndex,c=cn(this.props.background,!1);return i.map(function(u,d){u.value;var f=u.background,p=WIe(u,zIe);if(!f)return null;var h=qa(qa(qa(qa(qa({},p),{},{fill:"#eee"},f),c),ip(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return ue.createElement(vF,J2({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},h))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,f=Wo(d,nN);if(!f)return null;var p=u==="vertical"?o[0].height/2:o[0].width/2,h=function(v,y){var b=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:b,errorVal:Xi(v,y)}},m={clipPath:r?"url(#clipPath-".concat(a,")"):null};return ue.createElement(wr,m,f.map(function(g){return ue.cloneElement(g,{key:"error-bar-".concat(a,"-").concat(g.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:p,dataPointFormatter:h})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,p=r.height,h=r.isAnimationActive,m=r.background,g=r.id;if(a||!i||!i.length)return null;var v=this.state.isAnimationFinished,y=Cn("recharts-bar",o),b=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,j=b||w,S=In(g)?this.id:g;return ue.createElement(wr,{className:y},b||w?ue.createElement("defs",null,ue.createElement("clipPath",{id:"clipPath-".concat(S)},ue.createElement("rect",{x:b?u:u-f/2,y:w?d:d-p/2,width:b?f:f*2,height:w?p:p*2}))):null,ue.createElement(wr,{className:"recharts-bar-rectangles",clipPath:j?"url(#clipPath-".concat(S,")"):null},m?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(j,S),(!h||v)&&Gd.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])}(x.PureComponent);JK=Cp;Od(Cp,"displayName","Bar");Od(Cp,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!du.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Od(Cp,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,p=e.offset,h=CPe(r,n);if(!h)return null;var m=t.layout,g=n.type.defaultProps,v=g!==void 0?qa(qa({},g),n.props):n.props,y=v.dataKey,b=v.children,w=v.minPointSize,j=m==="horizontal"?o:i,S=u?j.scale.domain():null,A=MPe({numericAxis:j}),E=Wo(b,Rb),k=f.map(function(P,R){var C,I,D,U,q,Z;u?C=PPe(u[d+R],S):(C=Xi(P,y),Array.isArray(C)||(C=[A,C]));var H=UIe(w,JK.defaultProps.minPointSize)(C[1],R);if(m==="horizontal"){var $,W=[o.scale(C[0]),o.scale(C[1])],ee=W[0],V=W[1];I=l8({axis:i,ticks:l,bandSize:a,offset:h.offset,entry:P,index:R}),D=($=V??ee)!==null&&$!==void 0?$:void 0,U=h.size;var O=ee-V;if(q=Number.isNaN(O)?0:O,Z={x:I,y:o.y,width:U,height:o.height},Math.abs(H)>0&&Math.abs(q)<Math.abs(H)){var M=ds(q||H)*(Math.abs(H)-Math.abs(q));D-=M,q+=M}}else{var B=[i.scale(C[0]),i.scale(C[1])],G=B[0],te=B[1];if(I=G,D=l8({axis:o,ticks:c,bandSize:a,offset:h.offset,entry:P,index:R}),U=te-G,q=h.size,Z={x:i.x,y:D,width:i.width,height:q},Math.abs(H)>0&&Math.abs(U)<Math.abs(H)){var ne=ds(U||H)*(Math.abs(H)-Math.abs(U));U+=ne}}return qa(qa(qa({},P),{},{x:I,y:D,width:U,height:q,value:u?C:C[1],payload:P,background:Z},E&&E[R]&&E[R].props),{},{tooltipPayload:[SK(n,P)],tooltipPosition:{x:I+U/2,y:D+q/2}})});return qa({data:k,layout:m},p)});function Yx(e){"@babel/helpers - typeof";return Yx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yx(e)}function JIe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tZ(r.key),r)}}function QIe(e,t,n){return t&&bF(e.prototype,t),n&&bF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function wl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wF(Object(n),!0).forEach(function(r){cN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cN(e,t,n){return t=tZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tZ(e){var t=e6e(e,"string");return Yx(t)=="symbol"?t:t+""}function e6e(e,t){if(Yx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Yx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var t6e=function(t,n,r,a,i){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},p=!!no(u,Cp);return d.reduce(function(h,m){var g=n[m],v=g.orientation,y=g.domain,b=g.padding,w=b===void 0?{}:b,j=g.mirror,S=g.reversed,A="".concat(v).concat(j?"Mirror":""),E,k,P,R,C;if(g.type==="number"&&(g.padding==="gap"||g.padding==="no-gap")){var I=y[1]-y[0],D=1/0,U=g.categoricalDomain.sort(h0e);if(U.forEach(function(B,G){G>0&&(D=Math.min((B||0)-(U[G-1]||0),D))}),Number.isFinite(D)){var q=D/I,Z=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(E=q*Z/2),g.padding==="no-gap"){var H=fs(t.barCategoryGap,q*Z),$=q*Z/2;E=$-H-($-H)/Z*H}}}a==="xAxis"?k=[r.left+(w.left||0)+(E||0),r.left+r.width-(w.right||0)-(E||0)]:a==="yAxis"?k=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(E||0),r.top+r.height-(w.bottom||0)-(E||0)]:k=g.range,S&&(k=[k[1],k[0]]);var W=bK(g,i,p),ee=W.scale,V=W.realScaleType;ee.domain(y).range(k),wK(ee);var O=_K(ee,wl(wl({},g),{},{realScaleType:V}));a==="xAxis"?(C=v==="top"&&!j||v==="bottom"&&j,P=r.left,R=f[A]-C*g.height):a==="yAxis"&&(C=v==="left"&&!j||v==="right"&&j,P=f[A]-C*g.width,R=r.top);var M=wl(wl(wl({},g),O),{},{realScaleType:V,x:P,y:R,scale:ee,width:a==="xAxis"?r.width:g.width,height:a==="yAxis"?r.height:g.height});return M.bandSize=$2(M,O),!g.hide&&a==="xAxis"?f[A]+=(C?-1:1)*M.height:g.hide||(f[A]+=(C?-1:1)*M.width),wl(wl({},h),{},cN({},m,M))},{})},nZ=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(a,o),width:Math.abs(i-r),height:Math.abs(o-a)}},n6e=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return nZ({x:n,y:r},{x:a,y:i})},rZ=function(){function e(t){JIe(this,e),this.scale=t}return QIe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])}();cN(rZ,"EPS",1e-4);var uR=function(t){var n=Object.keys(t).reduce(function(r,a){return wl(wl({},r),{},cN({},a,rZ.create(t[a])))},{});return wl(wl({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return bIe(a,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return RIe(a,function(i,o){return n[o].isInRange(i)})}})};function r6e(e){return(e%180+180)%180}var a6e=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=r6e(a),o=i*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},i6e=pye(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),aZ=x.createContext(void 0),iZ=x.createContext(void 0),sZ=x.createContext(void 0),s6e=x.createContext({}),oZ=x.createContext(void 0),lZ=x.createContext(0),cZ=x.createContext(0),_F=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,i=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=i6e(i);return ue.createElement(aZ.Provider,{value:r},ue.createElement(iZ.Provider,{value:a},ue.createElement(s6e.Provider,{value:i},ue.createElement(sZ.Provider,{value:d},ue.createElement(oZ.Provider,{value:o},ue.createElement(lZ.Provider,{value:u},ue.createElement(cZ.Provider,{value:c},l)))))))},o6e=function(){return x.useContext(oZ)},uZ=function(t){var n=x.useContext(aZ);n==null&&lp();var r=n[t];return r==null&&lp(),r},dZ=function(t){var n=x.useContext(iZ);n==null&&lp();var r=n[t];return r==null&&lp(),r},l6e=function(){var t=x.useContext(sZ);return t},fZ=function(){return x.useContext(cZ)},hZ=function(){return x.useContext(lZ)};function iv(e){"@babel/helpers - typeof";return iv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},iv(e)}function c6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mZ(r.key),r)}}function d6e(e,t,n){return t&&u6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f6e(e,t,n){return t=ej(t),h6e(e,pZ()?Reflect.construct(t,n||[],ej(e).constructor):t.apply(e,n))}function h6e(e,t){if(t&&(iv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p6e(e)}function p6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pZ=function(){return!!e})()}function ej(e){return ej=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ej(e)}function m6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c4(e,t)}function c4(e,t){return c4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},c4(e,t)}function jF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function SF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jF(Object(n),!0).forEach(function(r){dR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dR(e,t,n){return t=mZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mZ(e){var t=g6e(e,"string");return iv(t)=="symbol"?t:t+""}function g6e(e,t){if(iv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(iv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function v6e(e,t){return w6e(e)||b6e(e,t)||x6e(e,t)||y6e()}function y6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
644In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x6e(e,t){if(e){if(typeof e=="string")return NF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NF(e,t)}}function NF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b6e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function w6e(e){if(Array.isArray(e))return e}function u4(){return u4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u4.apply(this,arguments)}var _6e=function(t,n){var r;return ue.isValidElement(t)?r=ue.cloneElement(t,n):_n(t)?r=t(n):r=ue.createElement("line",u4({},n,{className:"recharts-reference-line-line"})),r},j6e=function(t,n,r,a,i,o,l,c,u){var d=i.x,f=i.y,p=i.width,h=i.height;if(r){var m=u.y,g=t.y.apply(m,{position:o});if(mc(u,"discard")&&!t.y.isInRange(g))return null;var v=[{x:d+p,y:g},{x:d,y:g}];return c==="left"?v.reverse():v}if(n){var y=u.x,b=t.x.apply(y,{position:o});if(mc(u,"discard")&&!t.x.isInRange(b))return null;var w=[{x:b,y:f+h},{x:b,y:f}];return l==="top"?w.reverse():w}if(a){var j=u.segment,S=j.map(function(A){return t.apply(A,{position:o})});return mc(u,"discard")&&fIe(S,function(A){return!t.isInRange(A)})?null:S}return null};function S6e(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=o6e(),d=uZ(a),f=dZ(i),p=l6e();if(!u||!p)return null;uu(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=uR({x:d.scale,y:f.scale}),m=li(t),g=li(n),v=r&&r.length===2,y=j6e(h,m,g,v,p,e.position,d.orientation,f.orientation,e);if(!y)return null;var b=v6e(y,2),w=b[0],j=w.x,S=w.y,A=b[1],E=A.x,k=A.y,P=mc(e,"hidden")?"url(#".concat(u,")"):void 0,R=SF(SF({clipPath:P},cn(e,!0)),{},{x1:j,y1:S,x2:E,y2:k});return ue.createElement(wr,{className:Cn("recharts-reference-line",l)},_6e(o,R),vi.renderCallByParent(e,n6e({x1:j,y1:S,x2:E,y2:k})))}var fR=function(e){function t(){return c6e(this,t),f6e(this,t,arguments)}return m6e(t,e),d6e(t,[{key:"render",value:function(){return ue.createElement(S6e,this.props)}}])}(ue.Component);dR(fR,"displayName","ReferenceLine");dR(fR,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function d4(){return d4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d4.apply(this,arguments)}function sv(e){"@babel/helpers - typeof";return sv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sv(e)}function AF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function kF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AF(Object(n),!0).forEach(function(r){uN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vZ(r.key),r)}}function k6e(e,t,n){return t&&A6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function E6e(e,t,n){return t=tj(t),C6e(e,gZ()?Reflect.construct(t,n||[],tj(e).constructor):t.apply(e,n))}function C6e(e,t){if(t&&(sv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P6e(e)}function P6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gZ=function(){return!!e})()}function tj(e){return tj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tj(e)}function T6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f4(e,t)}function f4(e,t){return f4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},f4(e,t)}function uN(e,t,n){return t=vZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vZ(e){var t=O6e(e,"string");return sv(t)=="symbol"?t:t+""}function O6e(e,t){if(sv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var R6e=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=uR({x:a.scale,y:i.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return mc(t,"discard")&&!o.isInRange(l)?null:l},dN=function(e){function t(){return N6e(this,t),E6e(this,t,arguments)}return T6e(t,e),k6e(t,[{key:"render",value:function(){var r=this.props,a=r.x,i=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=li(a),d=li(i);if(uu(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=R6e(this.props);if(!f)return null;var p=f.x,h=f.y,m=this.props,g=m.shape,v=m.className,y=mc(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=kF(kF({clipPath:y},cn(this.props,!0)),{},{cx:p,cy:h});return ue.createElement(wr,{className:Cn("recharts-reference-dot",v)},t.renderDot(g,b),vi.renderCallByParent(this.props,{x:p-o,y:h-o,width:2*o,height:2*o}))}}])}(ue.Component);uN(dN,"displayName","ReferenceDot");uN(dN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});uN(dN,"renderDot",function(e,t){var n;return ue.isValidElement(e)?n=ue.cloneElement(e,t):_n(e)?n=e(t):n=ue.createElement(cR,d4({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function h4(){return h4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h4.apply(this,arguments)}function ov(e){"@babel/helpers - typeof";return ov=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ov(e)}function EF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function CF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EF(Object(n),!0).forEach(function(r){fN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function I6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L6e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xZ(r.key),r)}}function M6e(e,t,n){return t&&L6e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $6e(e,t,n){return t=nj(t),D6e(e,yZ()?Reflect.construct(t,n||[],nj(e).constructor):t.apply(e,n))}function D6e(e,t){if(t&&(ov(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F6e(e)}function F6e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yZ=function(){return!!e})()}function nj(e){return nj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},nj(e)}function B6e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p4(e,t)}function p4(e,t){return p4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},p4(e,t)}function fN(e,t,n){return t=xZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xZ(e){var t=U6e(e,"string");return ov(t)=="symbol"?t:t+""}function U6e(e,t){if(ov(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ov(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var z6e=function(t,n,r,a,i){var o=i.x1,l=i.x2,c=i.y1,u=i.y2,d=i.xAxis,f=i.yAxis;if(!d||!f)return null;var p=uR({x:d.scale,y:f.scale}),h={x:t?p.x.apply(o,{position:"start"}):p.x.rangeMin,y:r?p.y.apply(c,{position:"start"}):p.y.rangeMin},m={x:n?p.x.apply(l,{position:"end"}):p.x.rangeMax,y:a?p.y.apply(u,{position:"end"}):p.y.rangeMax};return mc(i,"discard")&&(!p.isInRange(h)||!p.isInRange(m))?null:nZ(h,m)},hN=function(e){function t(){return I6e(this,t),$6e(this,t,arguments)}return B6e(t,e),M6e(t,[{key:"render",value:function(){var r=this.props,a=r.x1,i=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;uu(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=li(a),p=li(i),h=li(o),m=li(l),g=this.props.shape;if(!f&&!p&&!h&&!m&&!g)return null;var v=z6e(f,p,h,m,this.props);if(!v&&!g)return null;var y=mc(this.props,"hidden")?"url(#".concat(d,")"):void 0;return ue.createElement(wr,{className:Cn("recharts-reference-area",c)},t.renderRect(g,CF(CF({clipPath:y},cn(this.props,!0)),v)),vi.renderCallByParent(this.props,v))}}])}(ue.Component);fN(hN,"displayName","ReferenceArea");fN(hN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});fN(hN,"renderRect",function(e,t){var n;return ue.isValidElement(e)?n=ue.cloneElement(e,t):_n(e)?n=e(t):n=ue.createElement(lR,h4({},t,{className:"recharts-reference-area-rect"})),n});function bZ(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function W6e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return a6e(r,n)}function q6e(e,t,n){var r=n==="width",a=e.x,i=e.y,o=e.width,l=e.height;return t===1?{start:r?a:i,end:r?a+o:i+l}:{start:r?a+o:i+l,end:r?a:i}}function rj(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function V6e(e,t){return bZ(e,t+1)}function H6e(e,t,n,r,a){for(var i=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var m=r==null?void 0:r[c];if(m===void 0)return{v:bZ(r,u)};var g=c,v,y=function(){return v===void 0&&(v=n(m,g)),v},b=m.coordinate,w=c===0||rj(e,b,y,d,l);w||(c=0,d=o,u+=1),w&&(d=b+e*(y()/2+a),c+=u)},p;u<=i.length;)if(p=f(),p)return p.v;return[]}function Kx(e){"@babel/helpers - typeof";return Kx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kx(e)}function PF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PF(Object(n),!0).forEach(function(r){G6e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function G6e(e,t,n){return t=Y6e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y6e(e){var t=K6e(e,"string");return Kx(t)=="symbol"?t:t+""}function K6e(e,t){if(Kx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Kx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z6e(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,l=t.start,c=t.end,u=function(p){var h=i[p],m,g=function(){return m===void 0&&(m=n(h,p)),m};if(p===o-1){var v=e*(h.coordinate+e*g()/2-c);i[p]=h=Yi(Yi({},h),{},{tickCoord:v>0?h.coordinate-v*e:h.coordinate})}else i[p]=h=Yi(Yi({},h),{},{tickCoord:h.coordinate});var y=rj(e,h.tickCoord,g,l,c);y&&(c=h.tickCoord-e*(g()/2+a),i[p]=Yi(Yi({},h),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return i}function X6e(e,t,n,r,a,i){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(i){var d=r[l-1],f=n(d,l-1),p=e*(d.coordinate+e*f/2-u);o[l-1]=d=Yi(Yi({},d),{},{tickCoord:p>0?d.coordinate-p*e:d.coordinate});var h=rj(e,d.tickCoord,function(){return f},c,u);h&&(u=d.tickCoord-e*(f/2+a),o[l-1]=Yi(Yi({},d),{},{isShow:!0}))}for(var m=i?l-1:l,g=function(b){var w=o[b],j,S=function(){return j===void 0&&(j=n(w,b)),j};if(b===0){var A=e*(w.coordinate-e*S()/2-c);o[b]=w=Yi(Yi({},w),{},{tickCoord:A<0?w.coordinate-A*e:w.coordinate})}else o[b]=w=Yi(Yi({},w),{},{tickCoord:w.coordinate});var E=rj(e,w.tickCoord,S,c,u);E&&(c=w.tickCoord+e*(S()/2+a),o[b]=Yi(Yi({},w),{},{isShow:!0}))},v=0;v<m;v++)g(v);return o}function J6e(e,t,n){var r=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!r)return[];if(gt(c)||du.isSsr)return V6e(a,typeof c=="number"&&gt(c)?c:0);var p=[],h=l==="top"||l==="bottom"?"width":"height",m=d&&h==="width"?A0(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},g=function(w,j){var S=_n(u)?u(w.value,j):w.value;return h==="width"?W6e(A0(S,{fontSize:t,letterSpacing:n}),m,f):A0(S,{fontSize:t,letterSpacing:n})[h]},v=a.length>=2?ds(a[1].coordinate-a[0].coordinate):1,y=q6e(i,v,h);return c==="equidistantPreserveStart"?H6e(v,y,g,a,o):(c==="preserveStart"||c==="preserveStartEnd"?p=X6e(v,y,g,a,o,c==="preserveStartEnd"):p=Z6e(v,y,g,a,o),p.filter(function(b){return b.isShow}))}var Q6e=["viewBox"],eLe=["viewBox"],tLe=["ticks"];function lv(e){"@babel/helpers - typeof";return lv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lv(e)}function zm(){return zm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zm.apply(this,arguments)}function TF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ni(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TF(Object(n),!0).forEach(function(r){hR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HA(e,t){if(e==null)return{};var n=nLe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nLe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function rLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_Z(r.key),r)}}function aLe(e,t,n){return t&&OF(e.prototype,t),n&&OF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iLe(e,t,n){return t=aj(t),sLe(e,wZ()?Reflect.construct(t,n||[],aj(e).constructor):t.apply(e,n))}function sLe(e,t){if(t&&(lv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oLe(e)}function oLe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wZ=function(){return!!e})()}function aj(e){return aj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},aj(e)}function lLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m4(e,t)}function m4(e,t){return m4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},m4(e,t)}function hR(e,t,n){return t=_Z(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Z(e){var t=cLe(e,"string");return lv(t)=="symbol"?t:t+""}function cLe(e,t){if(lv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(lv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pN=function(e){function t(n){var r;return rLe(this,t),r=iLe(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return lLe(t,e),aLe(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=HA(r,Q6e),l=this.props,c=l.viewBox,u=HA(l,eLe);return!ng(i,c)||!ng(o,u)||!ng(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.x,o=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,p=a.tickMargin,h,m,g,v,y,b,w=f?-1:1,j=r.tickSize||d,S=gt(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":h=m=r.coordinate,v=o+ +!f*c,g=v-w*j,b=g-w*p,y=S;break;case"left":g=v=r.coordinate,m=i+ +!f*l,h=m-w*j,y=h-w*p,b=S;break;case"right":g=v=r.coordinate,m=i+ +f*l,h=m+w*j,y=h+w*p,b=S;break;default:h=m=r.coordinate,v=o+ +f*c,g=v+w*j,b=g+w*p,y=S;break}return{line:{x1:h,y1:g,x2:m,y2:v},tick:{x:y,y:b}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=ni(ni(ni({},cn(this.props,!1)),cn(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var p=+(c==="top"&&!u||c==="bottom"&&u);f=ni(ni({},f),{},{x1:a,y1:i+p*l,x2:a+o,y2:i+p*l})}else{var h=+(c==="left"&&!u||c==="right"&&u);f=ni(ni({},f),{},{x1:a+h*o,y1:i,x2:a+h*o,y2:i+l})}return ue.createElement("line",zm({},f,{className:Cn("recharts-cartesian-axis-line",ho(d,"className"))}))}},{key:"renderTicks",value:function(r,a,i){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,p=l.unit,h=J6e(ni(ni({},this.props),{},{ticks:r}),a,i),m=this.getTickTextAnchor(),g=this.getTickVerticalAnchor(),v=cn(this.props,!1),y=cn(d,!1),b=ni(ni({},v),{},{fill:"none"},cn(c,!1)),w=h.map(function(j,S){var A=o.getTickLineCoord(j),E=A.line,k=A.tick,P=ni(ni(ni(ni({textAnchor:m,verticalAnchor:g},v),{},{stroke:"none",fill:u},y),k),{},{index:S,payload:j,visibleTicksCount:h.length,tickFormatter:f});return ue.createElement(wr,zm({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},ip(o.props,j,S)),c&&ue.createElement("line",zm({},b,E,{className:Cn("recharts-cartesian-axis-tick-line",ho(c,"className"))})),d&&t.renderTickItem(d,P,"".concat(_n(f)?f(j.value,S):j.value).concat(p||"")))});return ue.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var r=this,a=this.props,i=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,u=a.className,d=a.hide;if(d)return null;var f=this.props,p=f.ticks,h=HA(f,tLe),m=p;return _n(c)&&(m=p&&p.length>0?c(this.props):c(h)),o<=0||l<=0||!m||!m.length?null:ue.createElement(wr,{className:Cn("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},i&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),vi.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,l=Cn(a.className,"recharts-cartesian-axis-tick-value");return ue.isValidElement(r)?o=ue.cloneElement(r,ni(ni({},a),{},{className:l})):_n(r)?o=r(ni(ni({},a),{},{className:l})):o=ue.createElement(sp,zm({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(x.Component);hR(pN,"displayName","CartesianAxis");hR(pN,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});function cv(e){"@babel/helpers - typeof";return cv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cv(e)}function uLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dLe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,NZ(r.key),r)}}function fLe(e,t,n){return t&&dLe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hLe(e,t,n){return t=ij(t),pLe(e,jZ()?Reflect.construct(t,n||[],ij(e).constructor):t.apply(e,n))}function pLe(e,t){if(t&&(cv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mLe(e)}function mLe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jZ=function(){return!!e})()}function ij(e){return ij=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ij(e)}function gLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g4(e,t)}function g4(e,t){return g4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},g4(e,t)}function SZ(e,t,n){return t=NZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NZ(e){var t=vLe(e,"string");return cv(t)=="symbol"?t:t+""}function vLe(e,t){if(cv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(cv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function v4(){return v4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v4.apply(this,arguments)}function yLe(e){var t=e.xAxisId,n=fZ(),r=hZ(),a=uZ(t);return a==null?null:x.createElement(pN,v4({},a,{className:Cn("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Nh(o,!0)}}))}var mN=function(e){function t(){return uLe(this,t),hLe(this,t,arguments)}return gLe(t,e),fLe(t,[{key:"render",value:function(){return x.createElement(yLe,this.props)}}])}(x.Component);SZ(mN,"displayName","XAxis");SZ(mN,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function uv(e){"@babel/helpers - typeof";return uv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uv(e)}function xLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bLe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,EZ(r.key),r)}}function wLe(e,t,n){return t&&bLe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _Le(e,t,n){return t=sj(t),jLe(e,AZ()?Reflect.construct(t,n||[],sj(e).constructor):t.apply(e,n))}function jLe(e,t){if(t&&(uv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SLe(e)}function SLe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AZ=function(){return!!e})()}function sj(e){return sj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sj(e)}function NLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y4(e,t)}function y4(e,t){return y4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},y4(e,t)}function kZ(e,t,n){return t=EZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EZ(e){var t=ALe(e,"string");return uv(t)=="symbol"?t:t+""}function ALe(e,t){if(uv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(uv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function x4(){return x4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x4.apply(this,arguments)}var kLe=function(t){var n=t.yAxisId,r=fZ(),a=hZ(),i=dZ(n);return i==null?null:x.createElement(pN,x4({},i,{className:Cn("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(l){return Nh(l,!0)}}))},gN=function(e){function t(){return xLe(this,t),_Le(this,t,arguments)}return NLe(t,e),wLe(t,[{key:"render",value:function(){return x.createElement(kLe,this.props)}}])}(x.Component);kZ(gN,"displayName","YAxis");kZ(gN,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function RF(e){return TLe(e)||PLe(e)||CLe(e)||ELe()}function ELe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
645In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CLe(e,t){if(e){if(typeof e=="string")return b4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b4(e,t)}}function PLe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TLe(e){if(Array.isArray(e))return b4(e)}function b4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w4=function(t,n,r,a,i){var o=Wo(t,fR),l=Wo(t,dN),c=[].concat(RF(o),RF(l)),u=Wo(t,hN),d="".concat(a,"Id"),f=a[0],p=n;if(c.length&&(p=c.reduce(function(g,v){if(v.props[d]===r&&mc(v.props,"extendDomain")&&gt(v.props[f])){var y=v.props[f];return[Math.min(g[0],y),Math.max(g[1],y)]}return g},p)),u.length){var h="".concat(f,"1"),m="".concat(f,"2");p=u.reduce(function(g,v){if(v.props[d]===r&&mc(v.props,"extendDomain")&&gt(v.props[h])&&gt(v.props[m])){var y=v.props[h],b=v.props[m];return[Math.min(g[0],y,b),Math.max(g[1],y,b)]}return g},p)}return i&&i.length&&(p=i.reduce(function(g,v){return gt(v)?[Math.min(g[0],v),Math.max(g[1],v)]:g},p)),p},CZ={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(c,u,d,f,p){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new a(d,f||c,p),m=n?n+u:u;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],h]:c._events[m].push(h):(c._events[m]=h,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var p=0,h=f.length,m=new Array(h);p<h;p++)m[p]=f[p].fn;return m},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,p,h,m){var g=n?n+u:u;if(!this._events[g])return!1;var v=this._events[g],y=arguments.length,b,w;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),y){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,p),!0;case 5:return v.fn.call(v.context,d,f,p,h),!0;case 6:return v.fn.call(v.context,d,f,p,h,m),!0}for(w=1,b=new Array(y-1);w<y;w++)b[w-1]=arguments[w];v.fn.apply(v.context,b)}else{var j=v.length,S;for(w=0;w<j;w++)switch(v[w].once&&this.removeListener(u,v[w].fn,void 0,!0),y){case 1:v[w].fn.call(v[w].context);break;case 2:v[w].fn.call(v[w].context,d);break;case 3:v[w].fn.call(v[w].context,d,f);break;case 4:v[w].fn.call(v[w].context,d,f,p);break;default:if(!b)for(S=1,b=new Array(y-1);S<y;S++)b[S-1]=arguments[S];v[w].fn.apply(v[w].context,b)}}return!0},l.prototype.on=function(u,d,f){return i(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return i(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,p){var h=n?n+u:u;if(!this._events[h])return this;if(!d)return o(this,h),this;var m=this._events[h];if(m.fn)m.fn===d&&(!p||m.once)&&(!f||m.context===f)&&o(this,h);else{for(var g=0,v=[],y=m.length;g<y;g++)(m[g].fn!==d||p&&!m[g].once||f&&m[g].context!==f)&&v.push(m[g]);v.length?this._events[h]=v.length===1?v[0]:v:o(this,h)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(CZ);var OLe=CZ.exports;const RLe=mr(OLe);var GA=new RLe,YA="recharts.syncMouseEvents";function Zx(e){"@babel/helpers - typeof";return Zx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zx(e)}function ILe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LLe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,PZ(r.key),r)}}function MLe(e,t,n){return t&&LLe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function KA(e,t,n){return t=PZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PZ(e){var t=$Le(e,"string");return Zx(t)=="symbol"?t:t+""}function $Le(e,t){if(Zx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var DLe=function(){function e(){ILe(this,e),KA(this,"activeIndex",0),KA(this,"coordinateList",[]),KA(this,"layout","horizontal")}return MLe(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,i=a===void 0?null:a,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,p=n.mouseHandlerCallback,h=p===void 0?null:p;this.coordinateList=(r=i??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=h??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=i+c+u,p=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:p})}}}])}();function FLe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],a=e==null?void 0:e[1];if(r&&a&&gt(r)&&gt(a))return!0}return!1}function BLe(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function TZ(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=Br(t,n,r,a),l=Br(t,n,r,i);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function ULe(e,t,n){var r,a,i,o;if(e==="horizontal")r=t.x,i=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,p=Br(l,c,u,f),h=Br(l,c,d,f);r=p.x,a=p.y,i=h.x,o=h.y}else return TZ(t);return[{x:r,y:a},{x:i,y:o}]}function Xx(e){"@babel/helpers - typeof";return Xx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xx(e)}function IF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IF(Object(n),!0).forEach(function(r){zLe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zLe(e,t,n){return t=WLe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WLe(e){var t=qLe(e,"string");return Xx(t)=="symbol"?t:t+""}function qLe(e,t){if(Xx(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xx(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VLe(e){var t,n,r=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,p=e.chartName,h=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!h||!i||!o||p!=="ScatterChart"&&a!=="axis")return null;var m,g=qP;if(p==="ScatterChart")m=o,g=QOe;else if(p==="BarChart")m=BLe(f,o,c,d),g=lR;else if(f==="radial"){var v=TZ(o),y=v.cx,b=v.cy,w=v.radius,j=v.startAngle,S=v.endAngle;m={cx:y,cy:b,startAngle:j,endAngle:S,innerRadius:w,outerRadius:w},g=PK}else m={points:ULe(f,o,c)},g=qP;var A=pw(pw(pw(pw({stroke:"#ccc",pointerEvents:"none"},c),m),cn(h,!1)),{},{payload:l,payloadIndex:u,className:Cn("recharts-tooltip-cursor",h.className)});return x.isValidElement(h)?x.cloneElement(h,A):x.createElement(g,A)}var HLe=["item"],GLe=["children","className","width","height","style","compact","title","desc"];function dv(e){"@babel/helpers - typeof";return dv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dv(e)}function Wm(){return Wm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wm.apply(this,arguments)}function LF(e,t){return ZLe(e)||KLe(e,t)||RZ(e,t)||YLe()}function YLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
646In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KLe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function ZLe(e){if(Array.isArray(e))return e}function MF(e,t){if(e==null)return{};var n=XLe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XLe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function JLe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QLe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,IZ(r.key),r)}}function eMe(e,t,n){return t&&QLe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tMe(e,t,n){return t=oj(t),nMe(e,OZ()?Reflect.construct(t,n||[],oj(e).constructor):t.apply(e,n))}function nMe(e,t){if(t&&(dv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rMe(e)}function rMe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OZ=function(){return!!e})()}function oj(e){return oj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},oj(e)}function aMe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_4(e,t)}function _4(e,t){return _4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_4(e,t)}function fv(e){return oMe(e)||sMe(e)||RZ(e)||iMe()}function iMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
647In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RZ(e,t){if(e){if(typeof e=="string")return j4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j4(e,t)}}function sMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oMe(e){if(Array.isArray(e))return j4(e)}function j4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$F(Object(n),!0).forEach(function(r){Qt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$F(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qt(e,t,n){return t=IZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IZ(e){var t=lMe(e,"string");return dv(t)=="symbol"?t:t+""}function lMe(e,t){if(dv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(dv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cMe={xAxis:["bottom","top"],yAxis:["left","right"]},uMe={width:"100%",height:"100%"},LZ={x:0,y:0};function mw(e){return e}var dMe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},fMe=function(t,n,r,a){var i=n.find(function(d){return d&&d.index===r});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,l=a.radius;return ze(ze(ze({},a),Br(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=i.coordinate,u=a.angle;return ze(ze(ze({},a),Br(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return LZ},vN=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,i=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(fv(l),fv(u)):l},[]);return o.length>0?o:t&&t.length&&gt(a)&&gt(i)?t.slice(a,i+1):[]};function MZ(e){return e==="number"?[0,"auto"]:void 0}var S4=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,l=vN(n,t);return r<0||!i||!i.length||r>=l.length?null:i.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var h=f===void 0?l:f;p=JC(h,o.dataKey,a)}else p=f&&f[r]||l[r];return p?[].concat(fv(c),[SK(u,p)]):c},[])},DF=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=dMe(i,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=jPe(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,p=S4(t,n,d,f),h=fMe(r,l,d,i);return{activeTooltipIndex:d,activeLabel:f,activePayload:p,activeCoordinate:h}}return null},hMe=function(t,n){var r=n.axes,a=n.graphicalItems,i=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,p=t.stackOffset,h=xK(d,i);return r.reduce(function(m,g){var v,y=g.type.defaultProps!==void 0?ze(ze({},g.type.defaultProps),g.props):g.props,b=y.type,w=y.dataKey,j=y.allowDataOverflow,S=y.allowDuplicatedCategory,A=y.scale,E=y.ticks,k=y.includeHidden,P=y[o];if(m[P])return m;var R=vN(t.data,{graphicalItems:a.filter(function(O){var M,B=o in O.props?O.props[o]:(M=O.type.defaultProps)===null||M===void 0?void 0:M[o];return B===P}),dataStartIndex:c,dataEndIndex:u}),C=R.length,I,D,U;FLe(y.domain,j,b)&&(I=FP(y.domain,null,j),h&&(b==="number"||A!=="auto")&&(U=E0(R,w,"category")));var q=MZ(b);if(!I||I.length===0){var Z,H=(Z=y.domain)!==null&&Z!==void 0?Z:q;if(w){if(I=E0(R,w,b),b==="category"&&h){var $=f0e(I);S&&$?(D=I,I=K2(0,C)):S||(I=d8(H,I,g).reduce(function(O,M){return O.indexOf(M)>=0?O:[].concat(fv(O),[M])},[]))}else if(b==="category")S?I=I.filter(function(O){return O!==""&&!In(O)}):I=d8(H,I,g).reduce(function(O,M){return O.indexOf(M)>=0||M===""||In(M)?O:[].concat(fv(O),[M])},[]);else if(b==="number"){var W=EPe(R,a.filter(function(O){var M,B,G=o in O.props?O.props[o]:(M=O.type.defaultProps)===null||M===void 0?void 0:M[o],te="hide"in O.props?O.props.hide:(B=O.type.defaultProps)===null||B===void 0?void 0:B.hide;return G===P&&(k||!te)}),w,i,d);W&&(I=W)}h&&(b==="number"||A!=="auto")&&(U=E0(R,w,"category"))}else h?I=K2(0,C):l&&l[P]&&l[P].hasStack&&b==="number"?I=p==="expand"?[0,1]:jK(l[P].stackGroups,c,u):I=yK(R,a.filter(function(O){var M=o in O.props?O.props[o]:O.type.defaultProps[o],B="hide"in O.props?O.props.hide:O.type.defaultProps.hide;return M===P&&(k||!B)}),b,d,!0);if(b==="number")I=w4(f,I,P,i,E),H&&(I=FP(H,I,j));else if(b==="category"&&H){var ee=H,V=I.every(function(O){return ee.indexOf(O)>=0});V&&(I=ee)}}return ze(ze({},m),{},Qt({},P,ze(ze({},y),{},{axisType:i,domain:I,categoricalDomain:U,duplicateDomain:D,originalDomain:(v=y.domain)!==null&&v!==void 0?v:q,isCategorical:h,layout:d})))},{})},pMe=function(t,n){var r=n.graphicalItems,a=n.Axis,i=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,p=vN(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),h=p.length,m=xK(d,i),g=-1;return r.reduce(function(v,y){var b=y.type.defaultProps!==void 0?ze(ze({},y.type.defaultProps),y.props):y.props,w=b[o],j=MZ("number");if(!v[w]){g++;var S;return m?S=K2(0,h):l&&l[w]&&l[w].hasStack?(S=jK(l[w].stackGroups,c,u),S=w4(f,S,w,i)):(S=FP(j,yK(p,r.filter(function(A){var E,k,P=o in A.props?A.props[o]:(E=A.type.defaultProps)===null||E===void 0?void 0:E[o],R="hide"in A.props?A.props.hide:(k=A.type.defaultProps)===null||k===void 0?void 0:k.hide;return P===w&&!R}),"number",d),a.defaultProps.allowDataOverflow),S=w4(f,S,w,i)),ze(ze({},v),{},Qt({},w,ze(ze({axisType:i},a.defaultProps),{},{hide:!0,orientation:ho(cMe,"".concat(i,".").concat(g%2),null),domain:S,originalDomain:j,isCategorical:m,layout:d})))}return v},{})},mMe=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,i=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(a,"Id"),p=Wo(d,i),h={};return p&&p.length?h=hMe(t,{axes:p,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(h=pMe(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),h},gMe=function(t){var n=ym(t),r=Nh(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:L3(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:$2(n,r)}},FF=function(t){var n=t.children,r=t.defaultShowTooltip,a=no(n,rv),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},vMe=function(t){return!t||!t.length?!1:t.some(function(n){var r=cu(n&&n.type);return r&&r.indexOf("Bar")>=0})},BF=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},yMe=function(t,n){var r=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,p=r.margin||{},h=no(f,rv),m=no(f,rg),g=Object.keys(c).reduce(function(S,A){var E=c[A],k=E.orientation;return!E.mirror&&!E.hide?ze(ze({},S),{},Qt({},k,S[k]+E.width)):S},{left:p.left||0,right:p.right||0}),v=Object.keys(o).reduce(function(S,A){var E=o[A],k=E.orientation;return!E.mirror&&!E.hide?ze(ze({},S),{},Qt({},k,ho(S,"".concat(k))+E.height)):S},{top:p.top||0,bottom:p.bottom||0}),y=ze(ze({},v),g),b=y.bottom;h&&(y.bottom+=h.props.height||rv.defaultProps.height),m&&n&&(y=APe(y,a,r,n));var w=u-y.left-y.right,j=d-y.top-y.bottom;return ze(ze({brushBottom:b},y),{},{width:Math.max(w,0),height:Math.max(j,0)})},xMe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},$Z=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,p=function(y,b){var w=b.graphicalItems,j=b.stackGroups,S=b.offset,A=b.updateId,E=b.dataStartIndex,k=b.dataEndIndex,P=y.barSize,R=y.layout,C=y.barGap,I=y.barCategoryGap,D=y.maxBarSize,U=BF(R),q=U.numericAxisName,Z=U.cateAxisName,H=vMe(w),$=[];return w.forEach(function(W,ee){var V=vN(y.data,{graphicalItems:[W],dataStartIndex:E,dataEndIndex:k}),O=W.type.defaultProps!==void 0?ze(ze({},W.type.defaultProps),W.props):W.props,M=O.dataKey,B=O.maxBarSize,G=O["".concat(q,"Id")],te=O["".concat(Z,"Id")],ne={},ce=c.reduce(function(Pe,Ee){var Ie=b["".concat(Ee.axisType,"Map")],Me=O["".concat(Ee.axisType,"Id")];Ie&&Ie[Me]||Ee.axisType==="zAxis"||lp();var tt=Ie[Me];return ze(ze({},Pe),{},Qt(Qt({},Ee.axisType,tt),"".concat(Ee.axisType,"Ticks"),Nh(tt)))},ne),oe=ce[Z],X=ce["".concat(Z,"Ticks")],se=j&&j[G]&&j[G].hasStack&&$Pe(W,j[G].stackGroups),Q=cu(W.type).indexOf("Bar")>=0,ye=$2(oe,X),ie=[],F=H&&SPe({barSize:P,stackGroups:j,totalSize:xMe(ce,Z)});if(Q){var me,Ae,Ne=In(B)?D:B,ve=(me=(Ae=$2(oe,X,!0))!==null&&Ae!==void 0?Ae:Ne)!==null&&me!==void 0?me:0;ie=NPe({barGap:C,barCategoryGap:I,bandSize:ve!==ye?ve:ye,sizeList:F[te],maxBarSize:Ne}),ve!==ye&&(ie=ie.map(function(Pe){return ze(ze({},Pe),{},{position:ze(ze({},Pe.position),{},{offset:Pe.position.offset-ve/2})})}))}var pe=W&&W.type&&W.type.getComposedData;pe&&$.push({props:ze(ze({},pe(ze(ze({},ce),{},{displayedData:V,props:y,dataKey:M,item:W,bandSize:ye,barPosition:ie,offset:S,stackedData:se,layout:R,dataStartIndex:E,dataEndIndex:k}))),{},Qt(Qt(Qt({key:W.key||"item-".concat(ee)},q,ce[q]),Z,ce[Z]),"animationId",A)),childIndex:S0e(W,y.children),item:W})}),$},h=function(y,b){var w=y.props,j=y.dataStartIndex,S=y.dataEndIndex,A=y.updateId;if(!i$({props:w}))return null;var E=w.children,k=w.layout,P=w.stackOffset,R=w.data,C=w.reverseStackOrder,I=BF(k),D=I.numericAxisName,U=I.cateAxisName,q=Wo(E,r),Z=LPe(R,q,"".concat(D,"Id"),"".concat(U,"Id"),P,C),H=c.reduce(function(O,M){var B="".concat(M.axisType,"Map");return ze(ze({},O),{},Qt({},B,mMe(w,ze(ze({},M),{},{graphicalItems:q,stackGroups:M.axisType===D&&Z,dataStartIndex:j,dataEndIndex:S}))))},{}),$=yMe(ze(ze({},H),{},{props:w,graphicalItems:q}),b==null?void 0:b.legendBBox);Object.keys(H).forEach(function(O){H[O]=d(w,H[O],$,O.replace("Map",""),n)});var W=H["".concat(U,"Map")],ee=gMe(W),V=p(w,ze(ze({},H),{},{dataStartIndex:j,dataEndIndex:S,updateId:A,graphicalItems:q,stackGroups:Z,offset:$}));return ze(ze({formattedGraphicalItems:V,graphicalItems:q,offset:$,stackGroups:Z},ee),H)},m=function(v){function y(b){var w,j,S;return JLe(this,y),S=tMe(this,y,[b]),Qt(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Qt(S,"accessibilityManager",new DLe),Qt(S,"handleLegendBBoxUpdate",function(A){if(A){var E=S.state,k=E.dataStartIndex,P=E.dataEndIndex,R=E.updateId;S.setState(ze({legendBBox:A},h({props:S.props,dataStartIndex:k,dataEndIndex:P,updateId:R},ze(ze({},S.state),{},{legendBBox:A}))))}}),Qt(S,"handleReceiveSyncEvent",function(A,E,k){if(S.props.syncId===A){if(k===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(E)}}),Qt(S,"handleBrushChange",function(A){var E=A.startIndex,k=A.endIndex;if(E!==S.state.dataStartIndex||k!==S.state.dataEndIndex){var P=S.state.updateId;S.setState(function(){return ze({dataStartIndex:E,dataEndIndex:k},h({props:S.props,dataStartIndex:E,dataEndIndex:k,updateId:P},S.state))}),S.triggerSyncEvent({dataStartIndex:E,dataEndIndex:k})}}),Qt(S,"handleMouseEnter",function(A){var E=S.getMouseInfo(A);if(E){var k=ze(ze({},E),{},{isTooltipActive:!0});S.setState(k),S.triggerSyncEvent(k);var P=S.props.onMouseEnter;_n(P)&&P(k,A)}}),Qt(S,"triggeredAfterMouseMove",function(A){var E=S.getMouseInfo(A),k=E?ze(ze({},E),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(k),S.triggerSyncEvent(k);var P=S.props.onMouseMove;_n(P)&&P(k,A)}),Qt(S,"handleItemMouseEnter",function(A){S.setState(function(){return{isTooltipActive:!0,activeItem:A,activePayload:A.tooltipPayload,activeCoordinate:A.tooltipPosition||{x:A.cx,y:A.cy}}})}),Qt(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Qt(S,"handleMouseMove",function(A){A.persist(),S.throttleTriggeredAfterMouseMove(A)}),Qt(S,"handleMouseLeave",function(A){S.throttleTriggeredAfterMouseMove.cancel();var E={isTooltipActive:!1};S.setState(E),S.triggerSyncEvent(E);var k=S.props.onMouseLeave;_n(k)&&k(E,A)}),Qt(S,"handleOuterEvent",function(A){var E=j0e(A),k=ho(S.props,"".concat(E));if(E&&_n(k)){var P,R;/.*touch.*/i.test(E)?R=S.getMouseInfo(A.changedTouches[0]):R=S.getMouseInfo(A),k((P=R)!==null&&P!==void 0?P:{},A)}}),Qt(S,"handleClick",function(A){var E=S.getMouseInfo(A);if(E){var k=ze(ze({},E),{},{isTooltipActive:!0});S.setState(k),S.triggerSyncEvent(k);var P=S.props.onClick;_n(P)&&P(k,A)}}),Qt(S,"handleMouseDown",function(A){var E=S.props.onMouseDown;if(_n(E)){var k=S.getMouseInfo(A);E(k,A)}}),Qt(S,"handleMouseUp",function(A){var E=S.props.onMouseUp;if(_n(E)){var k=S.getMouseInfo(A);E(k,A)}}),Qt(S,"handleTouchMove",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(A.changedTouches[0])}),Qt(S,"handleTouchStart",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&S.handleMouseDown(A.changedTouches[0])}),Qt(S,"handleTouchEnd",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&S.handleMouseUp(A.changedTouches[0])}),Qt(S,"handleDoubleClick",function(A){var E=S.props.onDoubleClick;if(_n(E)){var k=S.getMouseInfo(A);E(k,A)}}),Qt(S,"handleContextMenu",function(A){var E=S.props.onContextMenu;if(_n(E)){var k=S.getMouseInfo(A);E(k,A)}}),Qt(S,"triggerSyncEvent",function(A){S.props.syncId!==void 0&&GA.emit(YA,S.props.syncId,A,S.eventEmitterSymbol)}),Qt(S,"applySyncEvent",function(A){var E=S.props,k=E.layout,P=E.syncMethod,R=S.state.updateId,C=A.dataStartIndex,I=A.dataEndIndex;if(A.dataStartIndex!==void 0||A.dataEndIndex!==void 0)S.setState(ze({dataStartIndex:C,dataEndIndex:I},h({props:S.props,dataStartIndex:C,dataEndIndex:I,updateId:R},S.state)));else if(A.activeTooltipIndex!==void 0){var D=A.chartX,U=A.chartY,q=A.activeTooltipIndex,Z=S.state,H=Z.offset,$=Z.tooltipTicks;if(!H)return;if(typeof P=="function")q=P($,A);else if(P==="value"){q=-1;for(var W=0;W<$.length;W++)if($[W].value===A.activeLabel){q=W;break}}var ee=ze(ze({},H),{},{x:H.left,y:H.top}),V=Math.min(D,ee.x+ee.width),O=Math.min(U,ee.y+ee.height),M=$[q]&&$[q].value,B=S4(S.state,S.props.data,q),G=$[q]?{x:k==="horizontal"?$[q].coordinate:V,y:k==="horizontal"?O:$[q].coordinate}:LZ;S.setState(ze(ze({},A),{},{activeLabel:M,activeCoordinate:G,activePayload:B,activeTooltipIndex:q}))}else S.setState(A)}),Qt(S,"renderCursor",function(A){var E,k=S.state,P=k.isTooltipActive,R=k.activeCoordinate,C=k.activePayload,I=k.offset,D=k.activeTooltipIndex,U=k.tooltipAxisBandSize,q=S.getTooltipEventType(),Z=(E=A.props.active)!==null&&E!==void 0?E:P,H=S.props.layout,$=A.key||"_recharts-cursor";return ue.createElement(VLe,{key:$,activeCoordinate:R,activePayload:C,activeTooltipIndex:D,chartName:n,element:A,isActive:Z,layout:H,offset:I,tooltipAxisBandSize:U,tooltipEventType:q})}),Qt(S,"renderPolarAxis",function(A,E,k){var P=ho(A,"type.axisType"),R=ho(S.state,"".concat(P,"Map")),C=A.type.defaultProps,I=C!==void 0?ze(ze({},C),A.props):A.props,D=R&&R[I["".concat(P,"Id")]];return x.cloneElement(A,ze(ze({},D),{},{className:Cn(P,D.className),key:A.key||"".concat(E,"-").concat(k),ticks:Nh(D,!0)}))}),Qt(S,"renderPolarGrid",function(A){var E=A.props,k=E.radialLines,P=E.polarAngles,R=E.polarRadius,C=S.state,I=C.radiusAxisMap,D=C.angleAxisMap,U=ym(I),q=ym(D),Z=q.cx,H=q.cy,$=q.innerRadius,W=q.outerRadius;return x.cloneElement(A,{polarAngles:Array.isArray(P)?P:Nh(q,!0).map(function(ee){return ee.coordinate}),polarRadius:Array.isArray(R)?R:Nh(U,!0).map(function(ee){return ee.coordinate}),cx:Z,cy:H,innerRadius:$,outerRadius:W,key:A.key||"polar-grid",radialLines:k})}),Qt(S,"renderLegend",function(){var A=S.state.formattedGraphicalItems,E=S.props,k=E.children,P=E.width,R=E.height,C=S.props.margin||{},I=P-(C.left||0)-(C.right||0),D=gK({children:k,formattedGraphicalItems:A,legendWidth:I,legendContent:u});if(!D)return null;var U=D.item,q=MF(D,HLe);return x.cloneElement(U,ze(ze({},q),{},{chartWidth:P,chartHeight:R,margin:C,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),Qt(S,"renderTooltip",function(){var A,E=S.props,k=E.children,P=E.accessibilityLayer,R=no(k,Yc);if(!R)return null;var C=S.state,I=C.isTooltipActive,D=C.activeCoordinate,U=C.activePayload,q=C.activeLabel,Z=C.offset,H=(A=R.props.active)!==null&&A!==void 0?A:I;return x.cloneElement(R,{viewBox:ze(ze({},Z),{},{x:Z.left,y:Z.top}),active:H,label:q,payload:H?U:[],coordinate:D,accessibilityLayer:P})}),Qt(S,"renderBrush",function(A){var E=S.props,k=E.margin,P=E.data,R=S.state,C=R.offset,I=R.dataStartIndex,D=R.dataEndIndex,U=R.updateId;return x.cloneElement(A,{key:A.key||"_recharts-brush",onChange:uw(S.handleBrushChange,A.props.onChange),data:P,x:gt(A.props.x)?A.props.x:C.left,y:gt(A.props.y)?A.props.y:C.top+C.height+C.brushBottom-(k.bottom||0),width:gt(A.props.width)?A.props.width:C.width,startIndex:I,endIndex:D,updateId:"brush-".concat(U)})}),Qt(S,"renderReferenceElement",function(A,E,k){if(!A)return null;var P=S,R=P.clipPathId,C=S.state,I=C.xAxisMap,D=C.yAxisMap,U=C.offset,q=A.type.defaultProps||{},Z=A.props,H=Z.xAxisId,$=H===void 0?q.xAxisId:H,W=Z.yAxisId,ee=W===void 0?q.yAxisId:W;return x.cloneElement(A,{key:A.key||"".concat(E,"-").concat(k),xAxis:I[$],yAxis:D[ee],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:R})}),Qt(S,"renderActivePoints",function(A){var E=A.item,k=A.activePoint,P=A.basePoint,R=A.childIndex,C=A.isRange,I=[],D=E.props.key,U=E.item.type.defaultProps!==void 0?ze(ze({},E.item.type.defaultProps),E.item.props):E.item.props,q=U.activeDot,Z=U.dataKey,H=ze(ze({index:R,dataKey:Z,cx:k.x,cy:k.y,r:4,fill:oR(E.item),strokeWidth:2,stroke:"#fff",payload:k.payload,value:k.value},cn(q,!1)),u2(q));return I.push(y.renderActiveDot(q,H,"".concat(D,"-activePoint-").concat(R))),P?I.push(y.renderActiveDot(q,ze(ze({},H),{},{cx:P.x,cy:P.y}),"".concat(D,"-basePoint-").concat(R))):C&&I.push(null),I}),Qt(S,"renderGraphicChild",function(A,E,k){var P=S.filterFormatItem(A,E,k);if(!P)return null;var R=S.getTooltipEventType(),C=S.state,I=C.isTooltipActive,D=C.tooltipAxis,U=C.activeTooltipIndex,q=C.activeLabel,Z=S.props.children,H=no(Z,Yc),$=P.props,W=$.points,ee=$.isRange,V=$.baseLine,O=P.item.type.defaultProps!==void 0?ze(ze({},P.item.type.defaultProps),P.item.props):P.item.props,M=O.activeDot,B=O.hide,G=O.activeBar,te=O.activeShape,ne=!!(!B&&I&&H&&(M||G||te)),ce={};R!=="axis"&&H&&H.props.trigger==="click"?ce={onClick:uw(S.handleItemMouseEnter,A.props.onClick)}:R!=="axis"&&(ce={onMouseLeave:uw(S.handleItemMouseLeave,A.props.onMouseLeave),onMouseEnter:uw(S.handleItemMouseEnter,A.props.onMouseEnter)});var oe=x.cloneElement(A,ze(ze({},P.props),ce));function X(Ee){return typeof D.dataKey=="function"?D.dataKey(Ee.payload):null}if(ne)if(U>=0){var se,Q;if(D.dataKey&&!D.allowDuplicatedCategory){var ye=typeof D.dataKey=="function"?X:"payload.".concat(D.dataKey.toString());se=JC(W,ye,q),Q=ee&&V&&JC(V,ye,q)}else se=W==null?void 0:W[U],Q=ee&&V&&V[U];if(te||G){var ie=A.props.activeIndex!==void 0?A.props.activeIndex:U;return[x.cloneElement(A,ze(ze(ze({},P.props),ce),{},{activeIndex:ie})),null,null]}if(!In(se))return[oe].concat(fv(S.renderActivePoints({item:P,activePoint:se,basePoint:Q,childIndex:U,isRange:ee})))}else{var F,me=(F=S.getItemByXY(S.state.activeCoordinate))!==null&&F!==void 0?F:{graphicalItem:oe},Ae=me.graphicalItem,Ne=Ae.item,ve=Ne===void 0?A:Ne,pe=Ae.childIndex,Pe=ze(ze(ze({},P.props),ce),{},{activeIndex:pe});return[x.cloneElement(ve,Pe),null,null]}return ee?[oe,null,null]:[oe,null]}),Qt(S,"renderCustomized",function(A,E,k){return x.cloneElement(A,ze(ze({key:"recharts-customized-".concat(k)},S.props),S.state))}),Qt(S,"renderMap",{CartesianGrid:{handler:mw,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:mw},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:mw},YAxis:{handler:mw},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((w=b.id)!==null&&w!==void 0?w:Ob("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=pY(S.triggeredAfterMouseMove,(j=b.throttleDelay)!==null&&j!==void 0?j:1e3/60),S.state={},S}return aMe(y,v),eMe(y,[{key:"componentDidMount",value:function(){var w,j;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,j=w.children,S=w.data,A=w.height,E=w.layout,k=no(j,Yc);if(k){var P=k.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var R=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,C=S4(this.state,S,P,R),I=this.state.tooltipTicks[P].coordinate,D=(this.state.offset.top+A)/2,U=E==="horizontal",q=U?{x:I,y:D}:{y:I,x:D},Z=this.state.formattedGraphicalItems.find(function($){var W=$.item;return W.type.name==="Scatter"});Z&&(q=ze(ze({},q),Z.props.points[P].tooltipPosition),C=Z.props.points[P].tooltipPayload);var H={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:R,activePayload:C,activeCoordinate:q};this.setState(H),this.renderCursor(k),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,j){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==j.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var S,A;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0}})}return null}},{key:"componentDidUpdate",value:function(w){eP([no(w.children,Yc)],[no(this.props.children,Yc)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=no(this.props.children,Yc);if(w&&typeof w.props.shared=="boolean"){var j=w.props.shared?"axis":"item";return l.indexOf(j)>=0?j:i}return i}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var j=this.container,S=j.getBoundingClientRect(),A=X5e(S),E={chartX:Math.round(w.pageX-A.left),chartY:Math.round(w.pageY-A.top)},k=S.width/j.offsetWidth||1,P=this.inRange(E.chartX,E.chartY,k);if(!P)return null;var R=this.state,C=R.xAxisMap,I=R.yAxisMap,D=this.getTooltipEventType(),U=DF(this.state,this.props.data,this.props.layout,P);if(D!=="axis"&&C&&I){var q=ym(C).scale,Z=ym(I).scale,H=q&&q.invert?q.invert(E.chartX):null,$=Z&&Z.invert?Z.invert(E.chartY):null;return ze(ze({},E),{},{xValue:H,yValue:$},U)}return U?ze(ze({},E),U):null}},{key:"inRange",value:function(w,j){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,A=this.props.layout,E=w/S,k=j/S;if(A==="horizontal"||A==="vertical"){var P=this.state.offset,R=E>=P.left&&E<=P.left+P.width&&k>=P.top&&k<=P.top+P.height;return R?{x:E,y:k}:null}var C=this.state,I=C.angleAxisMap,D=C.radiusAxisMap;if(I&&D){var U=ym(I);return p8({x:E,y:k},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,j=this.getTooltipEventType(),S=no(w,Yc),A={};S&&j==="axis"&&(S.props.trigger==="click"?A={onClick:this.handleClick}:A={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var E=u2(this.props,this.handleOuterEvent);return ze(ze({},E),A)}},{key:"addListener",value:function(){GA.on(YA,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){GA.removeListener(YA,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,j,S){for(var A=this.state.formattedGraphicalItems,E=0,k=A.length;E<k;E++){var P=A[E];if(P.item===w||P.props.key===w.key||j===cu(P.item.type)&&S===P.childIndex)return P}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,j=this.state.offset,S=j.left,A=j.top,E=j.height,k=j.width;return ue.createElement("defs",null,ue.createElement("clipPath",{id:w},ue.createElement("rect",{x:S,y:A,height:E,width:k})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(j,S){var A=LF(S,2),E=A[0],k=A[1];return ze(ze({},j),{},Qt({},E,k.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(j,S){var A=LF(S,2),E=A[0],k=A[1];return ze(ze({},j),{},Qt({},E,k.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var j;return(j=this.state.xAxisMap)===null||j===void 0||(j=j[w])===null||j===void 0?void 0:j.scale}},{key:"getYScaleByAxisId",value:function(w){var j;return(j=this.state.yAxisMap)===null||j===void 0||(j=j[w])===null||j===void 0?void 0:j.scale}},{key:"getItemByXY",value:function(w){var j=this.state,S=j.formattedGraphicalItems,A=j.activeItem;if(S&&S.length)for(var E=0,k=S.length;E<k;E++){var P=S[E],R=P.props,C=P.item,I=C.type.defaultProps!==void 0?ze(ze({},C.type.defaultProps),C.props):C.props,D=cu(C.type);if(D==="Bar"){var U=(R.data||[]).find(function($){return ROe(w,$)});if(U)return{graphicalItem:P,payload:U}}else if(D==="RadialBar"){var q=(R.data||[]).find(function($){return p8(w,$)});if(q)return{graphicalItem:P,payload:q}}else if(oN(P,A)||lN(P,A)||Vx(P,A)){var Z=wRe({graphicalItem:P,activeTooltipItem:A,itemData:I.data}),H=I.activeIndex===void 0?Z:I.activeIndex;return{graphicalItem:ze(ze({},P),{},{childIndex:H}),payload:Vx(P,A)?I.data[Z]:P.props.data[Z]}}}return null}},{key:"render",value:function(){var w=this;if(!i$(this))return null;var j=this.props,S=j.children,A=j.className,E=j.width,k=j.height,P=j.style,R=j.compact,C=j.title,I=j.desc,D=MF(j,GLe),U=cn(D,!1);if(R)return ue.createElement(_F,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},ue.createElement(nP,Wm({},U,{width:E,height:k,title:C,desc:I}),this.renderClipPath(),o$(S,this.renderMap)));if(this.props.accessibilityLayer){var q,Z;U.tabIndex=(q=this.props.tabIndex)!==null&&q!==void 0?q:0,U.role=(Z=this.props.role)!==null&&Z!==void 0?Z:"application",U.onKeyDown=function($){w.accessibilityManager.keyboardEvent($)},U.onFocus=function(){w.accessibilityManager.focus()}}var H=this.parseEventsOfWrapper();return ue.createElement(_F,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},ue.createElement("div",Wm({className:Cn("recharts-wrapper",A),style:ze({position:"relative",cursor:"default",width:E,height:k},P)},H,{ref:function(W){w.container=W}}),ue.createElement(nP,Wm({},U,{width:E,height:k,title:C,desc:I,style:uMe}),this.renderClipPath(),o$(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(x.Component);Qt(m,"displayName",n),Qt(m,"defaultProps",ze({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Qt(m,"getDerivedStateFromProps",function(v,y){var b=v.dataKey,w=v.data,j=v.children,S=v.width,A=v.height,E=v.layout,k=v.stackOffset,P=v.margin,R=y.dataStartIndex,C=y.dataEndIndex;if(y.updateId===void 0){var I=FF(v);return ze(ze(ze({},I),{},{updateId:0},h(ze(ze({props:v},I),{},{updateId:0}),y)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:A,prevLayout:E,prevStackOffset:k,prevMargin:P,prevChildren:j})}if(b!==y.prevDataKey||w!==y.prevData||S!==y.prevWidth||A!==y.prevHeight||E!==y.prevLayout||k!==y.prevStackOffset||!ng(P,y.prevMargin)){var D=FF(v),U={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},q=ze(ze({},DF(y,w,E)),{},{updateId:y.updateId+1}),Z=ze(ze(ze({},D),U),q);return ze(ze(ze({},Z),h(ze({props:v},Z),y)),{},{prevDataKey:b,prevData:w,prevWidth:S,prevHeight:A,prevLayout:E,prevStackOffset:k,prevMargin:P,prevChildren:j})}if(!eP(j,y.prevChildren)){var H,$,W,ee,V=no(j,rv),O=V&&(H=($=V.props)===null||$===void 0?void 0:$.startIndex)!==null&&H!==void 0?H:R,M=V&&(W=(ee=V.props)===null||ee===void 0?void 0:ee.endIndex)!==null&&W!==void 0?W:C,B=O!==R||M!==C,G=!In(w),te=G&&!B?y.updateId:y.updateId+1;return ze(ze({updateId:te},h(ze(ze({props:v},y),{},{updateId:te,dataStartIndex:O,dataEndIndex:M}),y)),{},{prevChildren:j,dataStartIndex:O,dataEndIndex:M})}return null}),Qt(m,"renderActiveDot",function(v,y,b){var w;return x.isValidElement(v)?w=x.cloneElement(v,y):_n(v)?w=v(y):w=ue.createElement(cR,y),ue.createElement(wr,{className:"recharts-active-dot",ke
647y:b},w)});var g=x.forwardRef(function(y,b){return ue.createElement(m,Wm({},y,{ref:b}))});return g.displayName=m.displayName,g},bMe=$Z({chartName:"BarChart",GraphicalChild:Cp,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:mN},{axisType:"yAxis",AxisComp:gN}],formatAxisMap:t6e}),wMe=$Z({chartName:"PieChart",GraphicalChild:Iu,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:sN},{axisType:"radiusAxis",AxisComp:aN}],formatAxisMap:GPe,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const _Me=({data:e})=>{const[t,n]=x.useState(!1),r=x.useRef(null);x.useEffect(()=>{const i=new IntersectionObserver(o=>{o.forEach(l=>{l.isIntersecting&&(n(!0),i.disconnect())})},{threshold:.3});return r.current&&i.observe(r.current),()=>i.disconnect()},[]);const a=e.map(i=>({name:i.label,value:i.percentage,color:i.color}));return s.jsxs("div",{ref:r,className:`transition-all duration-700 ${t?"opacity-100 scale-100":"opacity-0 scale-95"}`,children:[s.jsx("div",{className:"h-[180px] mb-4",children:s.jsx(mY,{width:"100%",height:"100%",children:s.jsx(wMe,{children:s.jsx(Iu,{data:a,cx:"50%",cy:"50%",innerRadius:0,outerRadius:70,paddingAngle:0,dataKey:"value",startAngle:180,endAngle:-180,animationBegin:t?0:9999,animationDuration:1e3,stroke:"none",children:a.map((i,o)=>s.jsx(Rb,{fill:i.color},`cell-${o}`))})})})}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map(i=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-4 h-4 rounded-full flex-shrink-0",style:{backgroundColor:i.color},"aria-hidden":"true"}),s.jsxs("span",{className:"text-sm text-foreground",children:[i.label," ",s.jsxs("span",{className:"font-semibold text-primary",children:[i.percentage,"%"]})]})]},i.label))})]})},ZA=[{year:"2023-24",students:135},{year:"2024-25",students:155},{year:"2025-26",students:165}],jMe=()=>{const[e,t]=x.useState(!1),n=x.useRef(null);return x.useEffect(()=>{const r=new IntersectionObserver(a=>{a.forEach(i=>{i.isIntersecting&&(t(!0),r.disconnect())})},{threshold:.3});return n.current&&r.observe(n.current),()=>r.disconnect()},[]),s.jsxs("div",{ref:n,className:`bg-card rounded-2xl p-6 shadow-lg border border-border transition-all duration-500 flex flex-col h-full ${e?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,children:[s.jsx("h4",{className:"text-lg font-display font-semibold text-foreground mb-4 text-center",children:"Program Growth"}),s.jsxs("div",{className:"flex-1 flex flex-col justify-center",children:[s.jsx("div",{className:"h-[160px] mb-3",children:s.jsx(mY,{width:"100%",height:"100%",children:s.jsxs(bMe,{data:ZA,margin:{top:20,right:20,left:0,bottom:5},children:[s.jsx(mN,{dataKey:"year",axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12}}),s.jsx(gN,{domain:[0,200],axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},width:40}),s.jsx(Cp,{dataKey:"students",radius:[6,6,0,0],animationBegin:e?0:9999,animationDuration:1e3,label:{position:"top",fill:"hsl(var(--primary))",fontSize:14,fontWeight:600},children:ZA.map((r,a)=>s.jsx(Rb,{fill:a===ZA.length-1?"hsl(var(--secondary))":"hsl(var(--primary))"},`cell-${a}`))})]})})}),s.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Steady growth in students served year over year"})]})]})},SMe=[{label:"Hispanic",percentage:43,color:"#3ca081"},{label:"Asian",percentage:17,color:"#1a365d"},{label:"Caucasian",percentage:29,color:"#D00000"},{label:"African-American",percentage:11,color:"#FFEF00"}],NMe=()=>s.jsxs("section",{className:"py-20 bg-gradient-to-b from-muted/30 to-background relative overflow-hidden",children:[s.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-secondary via-secondary to-secondary/60"}),s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsxs("h2",{className:"text-3xl md:text-4xl font-display font-semibold text-foreground mb-2",children:["STAR is",s.jsx("span",{className:"text-secondary",children:"..."})," ",s.jsx("span",{className:"text-primary",children:"Diverse"})]}),s.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Our students represent a rich tapestry of backgrounds, reflecting the diversity of Tarrant County."})]}),s.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 max-w-5xl mx-auto items-stretch",children:[s.jsxs("div",{className:"bg-card rounded-2xl p-6 shadow-lg border border-border flex flex-col",children:[s.jsx("h4",{className:"text-lg font-display font-semibold text-foreground mb-4 text-center",children:"Student Demographics"}),s.jsx("div",{className:"flex-1 flex flex-col justify-center",children:s.jsx(_Me,{data:SMe})})]}),s.jsx(jMe,{})]})]})]}),XA=({icon:e,value:t,prefix:n="",suffix:r="",label:a,description:i,delay:o=0})=>{const{ref:l,value:c}=eG({end:t,prefix:n,suffix:r,duration:2e3}),[u,d]=x.useState(!1),f=x.useRef(null);return x.useEffect(()=>{const p=new IntersectionObserver(h=>{h.forEach(m=>{m.isIntersecting&&(setTimeout(()=>d(!0),o),p.disconnect())})},{threshold:.3});return f.current&&p.observe(f.current),()=>p.disconnect()}
647,[o]),s.jsxs("div",{ref:f,className:`bg-card rounded-2xl p-8 shadow-lg card-hover border border-border text-center transition-all duration-500 ${u?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,children:[s.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-6",children:e}),s.jsx("div",{ref:l,className:"text-5xl md:text-6xl lg:text-7xl font-display font-bold text-primary mb-2",children:c}),s.jsx("h3",{className:"text-xl font-display font-semibold text-foreground mb-2",children:a}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:i})]})},JA=({percentage:e,label:t,description:n,delay:r=0})=>{const{ref:a,rawValue:i}=eG({end:e,duration:1500}),[o,l]=x.useState(!1),c=x.useRef(null),u=160,d=10,f=(u-d)/2,p=2*Math.PI*f,h=p-i/100*p;return x.useEffect(()=>{const m=new IntersectionObserver(g=>{g.forEach(v=>{v.isIntersecting&&(setTimeout(()=>l(!0),r),m.disconnect())})},{threshold:.3});return c.current&&m.observe(c.current),()=>m.disconnect()},[r]),s.jsxs("div",{ref:c,className:`flex flex-col items-center text-center transition-all duration-500 ${o?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,children:[s.jsxs("div",{className:"relative mb-4",children:[s.jsxs("svg",{width:u,height:u,className:"transform -rotate-90",children:[s.jsx("circle",{cx:u/2,cy:u/2,r:f,fill:"none",stroke:"hsl(var(--muted))",strokeWidth:d}),s.jsx("circle",{cx:u/2,cy:u/2,r:f,fill:"none",stroke:"hsl(var(--secondary))",strokeWidth:d,strokeLinecap:"round",strokeDasharray:p,strokeDashoffset:o?h:p,className:"transition-all duration-1000 ease-out"})]}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsxs("span",{ref:a,className:"text-3xl md:text-4xl font-display font-bold text-primary",children:[i,"%"]})})]}),s.jsx("h4",{className:"text-lg font-display font-semibold text-foreground mb-1",children:t}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-[200px]",children:n})]})},AMe=()=>s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/our-impact-hero.jpg",title:"OUR IMPACT",imageStyle:{objectPosition:"center 35%"}}),s.jsx("section",{className:"py-20 bg-gradient-to-b from-background to-muted/30",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsx("h2",{className:"section-heading mb-4",children:"IMPACT BY THE NUMBERS"}),s.jsx("p",{className:"text-center text-muted-foreground max-w-2xl mx-auto mb-12",children:"Since 1993, STAR has been transforming lives through educational opportunities in Tarrant County."}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-8 max-w-5xl mx-auto",children:[s.jsx(XA,{icon:s.jsx(yi,{className:"w-8 h-8"}),value:33,label:"Years of Impact",description:"Since the STAR Sponsorship Program was founded in Fort Worth, Texas.",delay:0}),s.jsx(XA,{icon:s.jsx(sf,{className:"w-8 h-8"}),value:6,prefix:"$",suffix:"M+",label:"Scholarships Awarded",description:"More than $6 million in scholarships awarded in Tarrant County since 1993.",delay:150}),s.jsx(XA,{icon:s.jsx(Zr,{className:"w-8 h-8"}),value:5e3,suffix:"+",label:"Students Supported",description:"Children who have received a STAR scholarship — lives and futures changed for the better.",delay:300})]})]})}),s.jsxs("section",{className:"py-20 bg-muted relative overflow-hidden",children:[s.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-secondary via-secondary to-secondary/60"}),s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsxs("h2",{className:"text-3xl md:text-4xl font-display font-semibold text-foreground mb-2",children:["STAR is",s.jsx("span",{className:"text-secondary",children:"..."})," ",s.jsx("span",{className:"text-primary",children:"making a difference"})]}),s.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Our students consistently achieve exceptional outcomes that demonstrate the power of educational investment."})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-12 max-w-4xl mx-auto",children:[s.jsx(JA,{percentage:100,label:"High School Graduation",description:"of STAR students graduate high school",delay:0}),s.jsx(JA,{percentage:92,label:"Elite Private High School",description:"of 2024–2025 STAR graduates attended an elite private high school in Tarrant County",delay:150}),s.jsx(JA,{percentage:92,label:"College Matriculation",description:"of STAR graduates matriculate into college",delay:300})]})]})]}),s.jsx(NMe,{}),s.jsx("section",{className:"section-padding bg-primary text-primary-foreground",children:s.jsxs("div",{className:"container mx-auto px-4 text-center max-w-3xl",children:[s.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold mb-6",children:"COMMUNITY PARTNERSHIP"}),s.jsx("p",{className:"opacity-90 leading-relaxed",children:"STAR creates a unique partnership that ties children, parents, schools, sponsors, and communities together. This collaborative approach ensures that every child receives not just financial support, but a network of people invested in their success."})]})})]});var QA="focusScope.autoFocusOnMount",ek="focusScope.autoFocusOnUnmount",UF={bubbles:!1,cancelable:!0},kMe="FocusScope",yN=x.forwardRef((e,t)=>
vendor: 4,320 bytes, line 647
647{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=x.useState(null),u=Pr(a),d=Pr(i),f=x.useRef(null),p=sn(t,g=>c(g)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let g=function(w){if(h.paused||!l)return;const j=w.target;l.contains(j)?f.current=j:id(f.current,{select:!0})},v=function(w){if(h.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||id(f.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&id(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const b=new MutationObserver(y);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),b.disconnect()}}},[r,l,h.paused]),x.useEffect(()=>{if(l){WF.add(h);const g=document.activeElement;if(!l.contains(g)){const y=new CustomEvent(QA,UF);l.addEventListener(QA,u),l.dispatchEvent(y),y.defaultPrevented||(EMe(RMe(DZ(l)),{select:!0}),document.activeElement===g&&id(l))}return()=>{l.removeEventListener(QA,u),setTimeout(()=>{const y=new CustomEvent(ek,UF);l.addEventListener(ek,d),l.dispatchEvent(y),y.defaultPrevented||id(g??document.body,{select:!0}),l.removeEventListener(ek,d),WF.remove(h)},0)}}},[l,u,d,h]);const m=x.useCallback(g=>{if(!n&&!r||h.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(v&&y){const b=g.currentTarget,[w,j]=CMe(b);w&&j?!g.shiftKey&&y===j?(g.preventDefault(),n&&id(w,{select:!0})):g.shiftKey&&y===w&&(g.preventDefault(),n&&id(j,{select:!0})):y===b&&g.preventDefault()}},[n,r,h.paused]);return s.jsx(pt.div,{tabIndex:-1,...o,ref:p,onKeyDown:m})});yN.displayName=kMe;function EMe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(id(r,{select:t}),document.activeElement!==n)return}function CMe(e){const t=DZ(e),n=zF(t,e),r=zF(t.reverse(),e);return[n,r]}function DZ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zF(e,t){for(const n of e)if(!PMe(n,{upTo:t}))return n}function PMe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TMe(e){return e instanceof HTMLInputElement&&"select"in e}function id(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TMe(e)&&t&&e.select()}}var WF=OMe();function OMe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=qF(e,t),e.unshift(t)},remove(t){var n;e=qF(e,t),(n=e[0])==null||n.resume()}}}function qF(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function RMe(e){return e.filter(t=>t.tagName!=="A")}var tk=0;function pR(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??VF()),document.body.insertAdjacentElement("beforeend",e[1]??VF()),tk++,()=>{tk===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),tk--}},[])}function VF(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var i_="right-scroll-bar-position",s_="width-before-scroll-bar",IMe="with-scroll-bars-hidden",LMe="--removed-body-scroll-bar-size";function nk(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function MMe(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var $Me=typeof window<"u"?x.useLayoutEffect:x.useEffect,HF=new WeakMap;function DMe(e,t){var n=MMe(null,function(r){return e.forEach(function(a){return nk(a,r)})});return $Me(function(){var r=HF.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||nk(l,null)}
vendor: 4,181 bytes, lines 647-662
647),i.forEach(function(l){a.has(l)||nk(l,o)})}HF.set(n,e)},[e]),n}function FMe(e){return e}function BMe(e,t){t===void 0&&(t=FMe);var n=[],r=!1,a={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]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return a}function UMe(e){e===void 0&&(e={});var t=BMe(null);return t.options=Mo({async:!0,ssr:!1},e),t}var FZ=function(e){var t=e.sideCar,n=bf(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Mo({},n))};FZ.isSideCarExport=!0;function zMe(e,t){return e.useMedium(t),FZ}var BZ=UMe(),rk=function(){},xN=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:rk,onWheelCapture:rk,onTouchMoveCapture:rk}),a=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,w=e.gapMode,j=bf(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,A=DMe([n,t]),E=Mo(Mo({},j),a);return x.createElement(x.Fragment,null,d&&x.createElement(S,{sideCar:BZ,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),o?x.cloneElement(x.Children.only(l),Mo(Mo({},E),{ref:A})):x.createElement(b,Mo({},E,{className:c,ref:A}),l))});xN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xN.classNames={fullWidth:s_,zeroRight:i_};var WMe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qMe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=WMe();return t&&e.setAttribute("nonce",t),e}function VMe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HMe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var GMe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qMe())&&(VMe(t,n),HMe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},YMe=function(){var e=GMe();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},UZ=function(){var e=YMe(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},KMe={left:0,top:0,right:0,gap:0},ak=function(e){return parseInt(e||"",10)||0},ZMe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[ak(n),ak(r),ak(a)]},XMe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return KMe;var t=ZMe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},JMe=UZ(),sg="data-scroll-locked",QMe=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
648  .`.concat(IMe,` {
649   overflow: hidden `).concat(r,`;
650   padding-right: `).concat(l,"px ").concat(r,`;
651  }
652  body[`).concat(sg,`] {
653    overflow: hidden `).concat(r,`;
654    overscroll-behavior: contain;
655    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
656    padding-left: `.concat(a,`px;
657    padding-top: `).concat(i,`px;
658    padding-right: `).concat(o,`px;
659    margin-left:0;
660    margin-top:0;
661    margin-right: `).concat(l,"px ").concat(r,`;
662    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";
662")].filter(Boolean).join(""),`
663  }
664  
665  .`).concat(i_,` {
666    right: `).concat(l,"px ").concat(r,`;
667  }
668  
669  .`).concat(s_,` {
670    margin-right: `).concat(l,"px ").concat(r,`;
671  }
672  
673  .`).concat(i_," .").concat(i_,` {
674    right: 0 `).concat(r,`;
675  }
676  
677  .`).concat(s_," .").concat(s_,` {
678    margin-right: 0 `).concat(r,`;
679  }
680  
681  body[`).concat(sg,`] {
682    `).concat(LMe,": ").concat(l,`px;
683  }
684`)},GF=function(){var e=parseInt(document.body.getAttribute(sg)||"0",10);return isFinite(e)?e:0},e$e=function(){x.useEffect(function(){return document.body.setAttribute(sg,(GF()+1).toString()),function(){var e=GF()-1;e<=0?document.body.removeAttribute(sg):document.body.setAttribute(sg,e.toString())}},[])},t$e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;e$e();var i=x.useMemo(function(){return XMe(a)},[a]);return x.createElement(JMe,{styles:QMe(i,!t,a,n?"":"!important")})},N4=!1;if(typeof window<"u")try{var gw=Object.defineProperty({},"passive",{get:function(){return N4=!0,!0}});window.addEventListener("test",gw,gw),window.removeEventListener("test",gw,gw)}catch{N4=!1}var am=N4?{passive:!1}:!1,n$e=function(e){return e.tagName==="TEXTAREA"},zZ=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!n$e(e)&&n[t]==="visible")},r$e=function(e){return zZ(e,"overflowY")},a$e=function(e){return zZ(e,"overflowX")},YF=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=WZ(e,r);if(a){var i=qZ(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},i$e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},s$e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},WZ=function(e,t){return e==="v"?r$e(t):a$e(t)},qZ=function(e,t){return e==="v"?i$e(t):s$e(t)},o$e=function(e,t){return e==="h"&&t==="rtl"?-1:1},l$e=function(e,t,n,r,a){var i=o$e(e,window.getComputedStyle(t).direction),o=i*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,p=0;do{if(!l)break;var h=qZ(e,l),m=h[0],g=h[1],v=h[2],y=g-v-i*m;(m||y)&&WZ(e,l)&&(f+=y,p+=m);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!a)||!d&&(Math.abs(p)<1||!a))&&(u=!0),u},vw=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},KF=function(e){return[e.deltaX,e.deltaY]},ZF=function(e){return e&&"current"in e?e.current:e},c$e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},u$e=function(e){return`
685  .block-interactivity-`.concat(e,` {pointer-events: none;}
686  .allow-interactivity-`).concat(e,` {pointer-events: all;}
687`)},d$e=0,im=[];function f$e(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),a=x.useState(d$e++)[0],i=x.useState(UZ)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var g=VO([e.lockRef.current],(e.shards||[]).map(ZF),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(g,v){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var y=vw(g),b=n.current,w="deltaX"in g?g.deltaX:b[0]-y[0],j="deltaY"in g?g.deltaY:b[1]-y[1],S,A=g.target,E=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in g&&E==="h"&&A.type==="range")return!1;var k=YF(E,A);if(!k)return!0;if(k?S=E:(S=E==="v"?"h":"v",k=YF(E,A)),!k)return!1;if(!r.current&&"changedTouches"in g&&(w||j)&&(r.current=S),!S)return!0;var P=r.current||S;return l$e(P,v,g,P==="h"?w:j,!0)},[]),c=x.useCallback(function(g){var v=g;if(!(!im.length||im[im.length-1]!==i)){var y="deltaY"in v?KF(v):vw(v),b=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&c$e(S.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}
vendor: 4,354 bytes, line 687
687if(!b){var w=(o.current.shards||[]).map(ZF).filter(Boolean).filter(function(S){return S.contains(v.target)}),j=w.length>0?l(v,w[0]):!o.current.noIsolation;j&&v.cancelable&&v.preventDefault()}}},[]),u=x.useCallback(function(g,v,y,b){var w={name:g,delta:v,target:y,should:b,shadowParent:h$e(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=x.useCallback(function(g){n.current=vw(g),r.current=void 0},[]),f=x.useCallback(function(g){u(g.type,KF(g),g.target,l(g,e.lockRef.current))},[]),p=x.useCallback(function(g){u(g.type,vw(g),g.target,l(g,e.lockRef.current))},[]);x.useEffect(function(){return im.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,am),document.addEventListener("touchmove",c,am),document.addEventListener("touchstart",d,am),function(){im=im.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,am),document.removeEventListener("touchmove",c,am),document.removeEventListener("touchstart",d,am)}},[]);var h=e.removeScrollBar,m=e.inert;return x.createElement(x.Fragment,null,m?x.createElement(i,{styles:u$e(a)}):null,h?x.createElement(t$e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function h$e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const p$e=zMe(BZ,f$e);var bN=x.forwardRef(function(e,t){return x.createElement(xN,Mo({},e,{ref:t,sideCar:p$e}))});bN.classNames=xN.classNames;var m$e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sm=new WeakMap,yw=new WeakMap,xw={},ik=0,VZ=function(e){return e&&(e.host||VZ(e.parentNode))},g$e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=VZ(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},v$e=function(e,t,n,r){var a=g$e(t,Array.isArray(e)?e:[e]);xw[n]||(xw[n]=new WeakMap);var i=xw[n],o=[],l=new Set,c=new Set(a),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};a.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(p){if(l.has(p))d(p);else try{var h=p.getAttribute(r),m=h!==null&&h!=="false",g=(sm.get(p)||0)+1,v=(i.get(p)||0)+1;sm.set(p,g),i.set(p,v),o.push(p),g===1&&m&&yw.set(p,!0),v===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return d(t),l.clear(),ik++,function(){o.forEach(function(f){var p=sm.get(f)-1,h=i.get(f)-1;sm.set(f,p),i.set(f,h),p||(yw.has(f)||f.removeAttribute(r),yw.delete(f)),h||f.removeAttribute(n)}),ik--,ik||(sm=new WeakMap,sm=new WeakMap,yw=new WeakMap,xw={})}},mR=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=m$e(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),v$e(r,a,n,"aria-hidden")):function(){return null}},wN="Dialog",[HZ,GZ]=ui(wN),[y$e,Ll]=HZ(wN),YZ=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=x.useRef(null),c=x.useRef(null),[u,d]=vs({prop:r,defaultProp:a??!1,onChange:i,caller:wN});return s.jsx(y$e,{scope:t,triggerRef:l,contentRef:c,contentId:Ga(),titleId:Ga(),descriptionId:Ga(),open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};YZ.displayName=wN;var KZ="DialogTrigger",ZZ=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ll(KZ,n),i=sn(t,a.triggerRef);return s.jsx(pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":yR(a.open),...r,ref:i,onClick:ht(e.onClick,a.onOpenToggle)})});ZZ.displayName=KZ;var gR="DialogPortal",[x$e,XZ]=HZ(gR,{forceMount:void 0}),JZ=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Ll(gR,t);return s.jsx(x$e,{scope:t,forceMount:n,children:x.Children.map(r,o=>s.jsx(Ka,{present:n||i.open,children:s.jsx(_b,{asChild:!0,container:a,children:o})}))})};JZ.displayName=gR;var lj="DialogOverlay",QZ=x.forwardRef((e,t)=>{const n=XZ(lj,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ll(lj,e.__scopeDialog);return i.modal?s.jsx(Ka,{present:r||i.open,children:s.jsx(w$e,{...a,ref:t})}):null});QZ.displayName=lj;var b$e=Jh("DialogOverlay.RemoveScroll"),w$e=x.forwardRef((e,t)=>
vendor: 4,650 bytes, lines 687-691
687{const{__scopeDialog:n,...r}=e,a=Ll(lj,n);return s.jsx(bN,{as:b$e,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(pt.div,{"data-state":yR(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),cp="DialogContent",eX=x.forwardRef((e,t)=>{const n=XZ(cp,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ll(cp,e.__scopeDialog);return s.jsx(Ka,{present:r||i.open,children:i.modal?s.jsx(_$e,{...a,ref:t}):s.jsx(j$e,{...a,ref:t})})});eX.displayName=cp;var _$e=x.forwardRef((e,t)=>{const n=Ll(cp,e.__scopeDialog),r=x.useRef(null),a=sn(t,n.contentRef,r);return x.useEffect(()=>{const i=r.current;if(i)return mR(i)},[]),s.jsx(tX,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ht(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ht(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:ht(e.onFocusOutside,i=>i.preventDefault())})}),j$e=x.forwardRef((e,t)=>{const n=Ll(cp,e.__scopeDialog),r=x.useRef(!1),a=x.useRef(!1);return s.jsx(tX,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),tX=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=Ll(cp,n),c=x.useRef(null),u=sn(t,c);return pR(),s.jsxs(s.Fragment,{children:[s.jsx(yN,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(_p,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":yR(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(N$e,{titleId:l.titleId}),s.jsx(k$e,{contentRef:c,descriptionId:l.descriptionId})]})]})}),vR="DialogTitle",nX=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ll(vR,n);return s.jsx(pt.h2,{id:a.titleId,...r,ref:t})});nX.displayName=vR;var rX="DialogDescription",aX=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ll(rX,n);return s.jsx(pt.p,{id:a.descriptionId,...r,ref:t})});aX.displayName=rX;var iX="DialogClose",sX=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ll(iX,n);return s.jsx(pt.button,{type:"button",...r,ref:t,onClick:ht(e.onClick,()=>a.onOpenChange(!1))})});sX.displayName=iX;function yR(e){return e?"open":"closed"}var oX="DialogTitleWarning",[S$e,lX]=Jie(oX,{contentName:cp,titleName:vR,docsSlug:"dialog"}),N$e=({titleId:e})=>{const t=lX(oX),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
688
689If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
690
691For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},A$e="DialogDescriptionWarning",k$e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${lX(A$e).contentName}}.`;return x.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},xR=YZ,E$e=ZZ,bR=JZ,_N=QZ,jN=eX,wR=nX,_R=aX,jR=sX;const _a=xR,C$e=bR,cX=x.forwardRef(({className:e,...t},n)=>s.jsx(_N,{ref:n,className:Ye("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",e),...t}));cX.displayName=_N.displayName;const ha=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(C$e,{children:[s.jsx(cX,{}),s.jsxs(jN,{ref:r,className:Ye("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:rou
691nded-lg",e),...n,children:[t,s.jsxs(jR,{className:"absolute right-4 top-4 rounded-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:[s.jsx(yf,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ha.displayName=jN.displayName;const $a=({className:e,...t})=>s.jsx("div",{className:Ye("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$a.displayName="DialogHeader";const Qi=({className:e,...t})=>s.jsx("div",{className:Ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Qi.displayName="DialogFooter";const Da=x.forwardRef(({className:e,...t},n)=>s.jsx(wR,{ref:n,className:Ye("text-lg font-semibold leading-none tracking-tight",e),...t}));Da.displayName=wR.displayName;const Bs=x.forwardRef(({className:e,...t},n)=>s.jsx(_R,{ref:n,className:Ye("text-sm text-muted-foreground",e),...t}));Bs.displayName=_R.displayName;const P$e="/assets/annual-meeting-1-D0F_zZRY.jpg",T$e="/assets/annual-meeting-2-BSbPxGch.jpg",O$e="/assets/annual-meeting-3-XzUPD-Wd.png",R$e="/assets/annual-meeting-4-B4iw9fEM.png",I$e="/assets/annual-meeting-5-Yn9Djn-Q.png",L$e="/assets/annual-meeting-6-Czf2iAYo.png",M$e="/assets/grad-dinner-2026-1-CLYzxXmy.jpg",$$e="/assets/grad-dinner-2026-2-B-v1BinA.jpg",D$e="/assets/grad-dinner-2026-3-C4VtrM8i.jpg",F$e="/assets/grad-dinner-2026-4-CWniwcUZ.jpg",B$e="/assets/grad-dinner-2026-5-Cn5aulM8.jpg",U$e="/assets/grad-dinner-2026-6-nM2Ppi6b.jpg",A4=[{title:"Annual Inform & Inspire Meeting 2025",photos:[{src:P$e,alt:"Families and students gathered in the gymnasium bleachers"},{src:T$e,alt:"STAR scholarship students with medals at group photo"},{src:O$e,alt:"Board member greeting families at the event"},{src:R$e,alt:"Volunteer with two students holding books"},{src:I$e,alt:"Family at the Pick A Book table"},{src:L$e,alt:"Young student proudly holding her new book"}]},{title:"Class of 2026 STAR Graduation Dinner",photos:[{src:M$e,alt:"Class of 2026 STAR graduates and students group photo"},{src:$$e,alt:"2026 STAR graduates posing together at the dinner"},{src:D$e,alt:"Student and family enjoying conversation at the dinner"},{src:F$e,alt:"Family and board member chatting at the dinner table"},{src:B$e,alt:"Student speaking with board members at the dinner"},{src:U$e,alt:"STAR graduate Chloe with family and board members"}]}],zy=A4.flatMap(e=>e.photos),z$e=()=>{const[e,t]=x.useState(null),n=(o,l)=>{let c=0;for(let u=0;u<o;u++)c+=A4[u].photos.length;t(c+l)},r=()=>{t(null)},a=()=>{e!==null&&t(e===0?zy.length-1:e-1)},i=()=>{e!==null&&t(e===zy.length-1?0:e+1)};return s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/event-gallery-hero.jpg",title:"EVENT GALLERY"}),s.jsx("section",{className:"section-padding bg-background",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsx("h2",{className:"section-heading mb-4 text-center",children:"STAR Events"}),s.jsx("p",{className:"text-center text-muted-foreground max-w-2xl mx-auto mb-12",children:"Take a look at the memorable moments from our STAR events, fundraisers, and celebrations with our students and families."}),A4.map((o,l)=>s.jsxs("div",{className:"mb-16 last:mb-0",children:[s.jsx("h3",{className:"text-2xl md:text-3xl font-display font-semibold text-primary mb-8 text-center",children:o.title}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:o.photos.map((c,u)=>s.jsx("div",{className:"aspect-[4/3] rounded-lg overflow-hidden shadow-lg cursor-pointer group",onClick:()=>n(l,u),children:s.jsx("img",{src:c.src,alt:c.alt,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"})},u))})]},l))]})}),s.jsx(_a,{open:e!==null,onOpenChange:r,children:s.jsx(ha,{className:"max-w-5xl w-full p-0 bg-black/95 border-none",children:s.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",children:[s.jsx("button",{onClick:r,className:"absolute top-4 right-4 z-10 p-2 text-white/80 hover:text-white transition-colors","aria-label":"Close",children:s.jsx(yf,{className:"w-6 h-6"})}),s.jsx("button",{onClick:a,className:"absolute left-4 z-10 p-2 text-white/80 hover:text-white transition-colors","aria-label":"Previous image",children:s.jsx(Sb,{className:"w-8 h-8"})}),e!==null&&s.jsx("img",{src:zy[e].src,alt:zy[e].alt,className:"max-h-[80vh] max-w-full object-contain p-4"}),s.jsx("button",{onClick:i,className:"absolute right-4 z-10 p-2 text-white/80 hover:text-white transition-colors","aria-label":"Next image",children:s.jsx(Ho,{className:"w-8 h-8"})}),e!==null&&s.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-white/80 text-sm",children:[e
vendor: 4,306 bytes, lines 691-699
691+1," / ",zy.length]})]})})})]})},Ve=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ye("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Ve.displayName="Card";const _t=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ye("flex flex-col space-y-1.5 p-6",e),...t}));_t.displayName="CardHeader";const jt=x.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Ye("text-2xl font-semibold leading-none tracking-tight",e),...t}));jt.displayName="CardTitle";const qn=x.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Ye("text-sm text-muted-foreground",e),...t}));qn.displayName="CardDescription";const He=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ye("p-6 pt-0",e),...t}));He.displayName="CardContent";const W$e=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ye("flex items-center p-6 pt-0",e),...t}));W$e.displayName="CardFooter";var uX={exports:{}},dX={};/**
692 * @license React
693 * use-sync-external-store-shim.production.js
694 *
695 * Copyright (c) Meta Platforms, Inc. and affiliates.
696 *
697 * This source code is licensed under the MIT license found in the
698 * LICENSE file in the root directory of this source tree.
699 */var hv=x;function q$e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var V$e=typeof Object.is=="function"?Object.is:q$e,H$e=hv.useState,G$e=hv.useEffect,Y$e=hv.useLayoutEffect,K$e=hv.useDebugValue;function Z$e(e,t){var n=t(),r=H$e({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return Y$e(function(){a.value=n,a.getSnapshot=t,sk(a)&&i({inst:a})},[e,n,t]),G$e(function(){return sk(a)&&i({inst:a}),e(function(){sk(a)&&i({inst:a})})},[e]),K$e(n),n}function sk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!V$e(e,n)}catch{return!0}}function X$e(e,t){return t()}var J$e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?X$e:Z$e;dX.useSyncExternalStore=hv.useSyncExternalStore!==void 0?hv.useSyncExternalStore:J$e;uX.exports=dX;var Q$e=uX.exports;function eDe(){return Q$e.useSyncExternalStore(tDe,()=>!0,()=>!1)}function tDe(){return()=>{}}var SR="Avatar",[nDe,eQe]=ui(SR),[rDe,fX]=nDe(SR),hX=x.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[a,i]=x.useState("idle");return s.jsx(rDe,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:s.jsx(pt.span,{...r,ref:t})})});hX.displayName=SR;var pX="AvatarImage",mX=x.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:a=()=>{},...i}=e,o=fX(pX,n),l=aDe(r,i),c=Pr(u=>{a(u),o.onImageLoadingStatusChange(u)});return Xr(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?s.jsx(pt.img,{...i,ref:t,src:r}):null});mX.displayName=pX;var gX="AvatarFallback",vX=x.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...a}=e,i=fX(gX,n),[o,l]=x.useState(r===void 0);return x.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&i.imageLoadingStatus!=="loaded"?s.jsx(pt.span,{...a,ref:t}):null});vX.displayName=gX;function XF(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function aDe(e,{referrerPolicy:t,crossOrigin:n}){const r=eDe(),a=x.useRef(null),i=r?(a.current||(a.current=new window.Image),a.current):null,[o,l]=x.useState(()=>XF(i,e));return Xr(()=>{l(XF(i,e))},[i,e]),Xr(()=>{const c=f=>()=>{l(f)};if(!i)return;const u=c("loaded"),d=c("error");return i.addEventListener("load",u),i.addEventListener("error",d),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",d)}},[i,n,t]),o}var yX=hX,xX=mX,bX=vX;const wX=x.forwardRef(({className:e,...t},n)=>s.jsx(yX,{ref:n,className:Ye("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));wX.displayName=yX.displayName;const _X=x.forwardRef(({className:e,...t},n)=>s.jsx(xX,{ref:n,className:Ye("aspect-square h-full w-full",e),...t}));_X.displayName=xX.displayName;const jX=x.forwardRef(({className:e,...t},n)=>s.jsx(bX,{ref:n,className:Ye("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));jX.displayName=bX.displayName;const iDe="/assets/scott-alvis-A_mlT7PP.jpg",sDe="/assets/maria-barragan-CLjZL67M.png",oDe="/assets/kathy-burt-DFT-s9VK.jpg",lDe="/assets/kim-carter-CxTYga33.
699jpg",cDe="/assets/brian-crumley-C3KKU_3b.jpg",uDe="/assets/paul-greenwell-CdR3KQf0.jpg",dDe="/assets/bryan-king-C1PMH6Ib.jpg",fDe="/assets/john-pergande-hWvTyrV-.jpg",hDe="/assets/peter-philpott-BaYPoYTX.jpg",pDe="/assets/david-porter-OL94Vgsk.png",mDe="/assets/rick-porter-C16B--v4.png",gDe="/assets/frost-prioleau-DoI-qGV4.jpg",vDe="/assets/aaron-scow-B9WZEYmr.jpg",yDe="/assets/diego-semper-D9Tdz3vH.jpg",xDe=[{name:"Scott Alvis",occupation:"Founder & Executive Editor - NEXT Travel Stream",image:iDe},{name:"Maria Barragan",occupation:"Mayor's Aide – Mayor Mattie Parker, Fort Worth, Texas",image:sDe},{name:"Kim Carter",occupation:"Partner and CFO - Luther King Capital Management",image:lDe},{name:"Brian Crumley",occupation:"Managing Partner / Co-Founder - Vortus Investments",image:cDe,imageStyle:{objectPosition:"center 20%"}},{name:"Paul Greenwell",occupation:"Partner - Luther King Capital Management",image:uDe},{name:"Bryan King",occupation:"Principal - Luther King Capital Management",image:dDe},{name:"John Pergande",occupation:"CEO – InsureZone",image:fDe},{name:"Peter Philpott",occupation:"Vice President - RW Baird",image:hDe},{name:"David Porter",occupation:"President - The PNL Companies",image:pDe},{name:"Rick Porter",occupation:"Vice President of Business Operations - New Relic, Inc.",image:mDe},{name:"Frost Prioleau",occupation:"Co-Founder/CEO - Simpli.fi Holdings Inc.",image:gDe},{name:"Aaron Scow",occupation:"Partner - Baker McKenzie LLP",image:vDe},{name:"Diego Semper",occupation:"Founder - Lighthouse Homes LLC",image:yDe},{name:"Kathy Burt",occupation:"Executive Director - STAR Sponsorship Program, Inc.",image:oDe,imageStyle:{objectPosition:"5% top"}}],bDe=()=>{const e=t=>t.split(" ").map(n=>n[0]).join("").toUpperCase();return s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/board-hero.jpg",title:"MEET THE BOARD"}),s.jsx("section",{className:"section-padding bg-background",children:s.jsxs("div",{className:"container mx-auto px-4",children:[s.jsx("h2",{className:"section-heading mb-4 text-center",children:"Board of Directors"}),s.jsx("p",{className:"text-center text-muted-foreground max-w-2xl mx-auto mb-12",children:"Our dedicated board members volunteer their time and expertise to guide the mission of the STAR Sponsorship Program."}),s.jsx("div",{className:"flex flex-wrap justify-center gap-6 max-w-7xl mx-auto",children:xDe.map((t,n)=>s.jsx("div",{className:"w-full md:w-[calc(50%-12px)] lg:w-[calc(33.333%-16px)] xl:w-[calc(25%-18px)]",children:s.jsxs(Ve,{className:"h-full hover:shadow-md transition-shadow",children:[s.jsxs(_t,{className:"flex flex-col items-center pb-2",children:[s.jsxs(wX,{className:"w-32 h-32 mb-4",children:[t.image?s.jsx(_X,{src:t.image,alt:t.name,className:"object-cover",style:t.imageStyle}):null,s.jsx(jX,{className:"text-xl bg-primary/10 text-primary",children:e(t.name)})]}),s.jsx(jt,{className:"text-xl font-display text-primary text-center",children:t.name})]}),s.jsx(He,{children:s.jsx("p",{className:"text-center text-muted-foreground text-sm",children:t.occupation})})]})},n))})]})})]})},JF=!1,wDe=["2024 Tax Return","2025 Tax Return","W-2, 1099, or Schedule C for each employed or self-employed guardian","Statement of self-employment (if applicable)","STAR Parent/Guardian Commitment Form","Teacher Recommendation Form"],_De=[{step:1,title:"Get a Principal Referral",description:"Families must obtain a referral from the principal at the partner school they wish their child to attend. The principal will review financial eligibility, which follows the federal hot lunch program qualifications."},{step:2,title:"Create an Application Portal Account",description:"After the principal signs the referral form, families must sign up and create their account in the application portal."},{step:3,title:"Upload the Referral Form",description:"After creating an account, the family must upload a PDF of the principal referral form. STAR will review it. Once approved, they can continue with the application."},{step:4,title:"Complete the Application",description:"Families must complete all fields and upload all required documents."},{step:5,title:"Schedule an Interview",description:"After completing the application, families must schedule an interview through the application portal."}],jDe=[{name:"All Saints Catholic School",url:"https://www.ascsfw.org/"}
699,{name:"Bethesda Christian School",url:"https://bethesdachristianschool.org/"},{name:"Braveheart Christian Academy",url:"https://braveheartacademy.org/"},{name:"Christian Life Preparatory School",url:"https://www.clpsfamily.com/",logo:"/images/schools/clps.png"},{name:"Fellowship Academy",url:"https://fellowshipacademy.com/"},{name:"Holy Family Catholic School",url:"https://www.hfcsfw.org/"},{name:"Hope Works Christian Academy",url:"https://visithwca.com/"},{name:"Mercy Culture Preparatory",url:"https://www.mcprep.org/"},{name:"Mid-Cities Christian Academy",url:"https://midcitieschristian.org/"},{name:"Mosaic Academy",url:"https://www.mosaicacademyfw.org/"},{name:"St. Andrew Catholic School",url:"https://standrewsch.org/"},{name:"St. Elizabeth Ann Seton Catholic School",url:"https://seascs.net/"},{name:"St. George Catholic School",url:"https://stgeorgecatholicschool.org/",logo:"/images/schools/st-george.webp"},{name:"St. John the Apostle Catholic School",url:"https://stjs.org/"},{name:"St. Peter Catholic School",url:"https://spsfw.org/"},{name:"St. Rita Catholic School",url:"https://www.saintritaschool.net/"},{name:"Southwest Christian School",url:"https://www.southwestchristian.org/"},{name:"Temple Christian School",url:"https://www.tcseagles.org/"},{name:"Wedgwood Academy",url:"https://www.wedgwoodacademy.org/",logo:"/images/schools/wedgwood.png"}],SDe=()=>{const{user:e,profile:t,signOut:n}=bi();return s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/apply-hero.jpg",title:"APPLY FOR A SCHOLARSHIP",imageStyle:{objectPosition:"center 35%"}}),s.jsx("div",{className:"bg-destructive text-white",children:s.jsxs("div",{className:"container mx-auto px-4 py-6 max-w-6xl text-center",children:[s.jsx("p",{className:"font-display text-xl md:text-2xl font-bold mb-1",children:"Applications for the 2026–2027 school year are now closed"}),s.jsx("p",{className:"text-sm md:text-base opacity-90",children:"Thank you for your interest in the STAR Sponsorship Program. Please check back for information about the next application cycle."})]})}),s.jsx("div",{className:"container mx-auto px-4 py-8 max-w-6xl",children:s.jsxs("section",{className:"mb-16 text-center",children:[s.jsx("h2",{className:"text-3xl md:text-4xl font-display font-bold text-primary mb-6",children:"Welcome to the STAR Sponsorship Program"}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-3xl mx-auto leading-relaxed mb-8",children:"We are a Fort Worth, Texas–based nonprofit working with schools in Tarrant County. Our STAR student scholarships are for students in Kindergarten through 8th grade. We partner with 19 schools to help families access quality private education for their children."}),e?s.jsx(an,{to:"/portal",children:s.jsx(we,{size:"lg",className:"text-lg px-8 py-6 rounded-full bg-[#d00000] hover:bg-[#b00000] text-white",children:"CONTINUE YOUR APPLICATION"})}):s.jsx(we,{size:"lg",className:"text-lg px-8 py-6 rounded-full bg-[#d00000] text-white opacity-50 cursor-not-allowed",disabled:!0,children:"APPLY NOW"})]})}),s.jsx("section",{className:"mb-12 py-8",children:s.jsx("div",{className:"container mx-auto px-4 max-w-4xl",children:s.jsx(Ve,{className:"border-secondary/30 bg-secondary/5",children:s.jsxs(He,{className:"pt-4 pb-4",children:[s.jsx("h3",{className:"text-xl md:text-2xl font-display font-bold text-primary text-center mb-2",children:"Texas Education Freedom Accounts (TEFA) Policy"}),s.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed text-center mb-3",children:"After careful consideration, the STAR Program Board of Directors officially approved a new scholarship eligibility policy."}),s.jsx("div",{className:"bg-white/60 dark:bg-white/5 rounded-lg p-3 border border-secondary/20",children:s.jsx("p",{className:"text-sm text-foreground leading-relaxed text-center font-medium",children:"Students who receive a Texas Education Freedom Account (TEFA) voucher are not eligible to receive a STAR scholarship award."})}),s.jsx("p",{className:"text-xs text-muted-foreground mt-3 italic text-center",children:"This policy is now part of our official scholarship eligibility requirements."})]})})})}),s.jsx("section",{className:"mb-16 bg-muted/40 py-10",children:s.jsxs("div",{className:"container mx-auto px-4 max-w-2xl",children:[s.jsx("h3",{className:"text-2xl md:text-3xl font-display font-bold text-primary text-center mb-3",children:"STAR Sc
699holarships Financial Guidelines"}),s.jsx("p",{className:"text-base text-muted-foreground leading-relaxed mb-4 text-center",children:"Financial eligibility is based on the income guidelines from the Federal School Lunch Program. The income guidelines for the 2026–2027 school year are as follows:"}),s.jsxs("table",{className:"w-full max-w-sm mx-auto text-base",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b-2 border-primary/20",children:[s.jsx("th",{className:"py-2 px-3 font-semibold text-primary",children:"Family Size"}),s.jsx("th",{className:"py-2 px-3 font-semibold text-primary text-right",children:"Annual Income"})]})}),s.jsx("tbody",{children:[{size:2,income:"$54,100"},{size:3,income:"$68,300"},{size:4,income:"$82,500"},{size:5,income:"$96,700"},{size:6,income:"$110,900"}].map(r=>s.jsxs("tr",{className:"border-b border-muted",children:[s.jsx("td",{className:"py-2 px-3 text-foreground",children:r.size}),s.jsx("td",{className:"py-2 px-3 text-foreground text-right",children:r.income})]},r.size))})]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-4 italic text-center",children:"For each additional family member, add $14,200 to the annual income limit."}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2 italic text-center",children:"Based on 250% of the Federal Poverty Level (FPL)."})]})}),s.jsxs("div",{className:"container mx-auto px-4 max-w-6xl",children:[s.jsx("section",{className:"mb-16",children:s.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[s.jsxs(Ve,{className:"border-primary/20 hover:shadow-lg transition-shadow",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(Bh,{className:"w-8 h-8 text-primary"})}),s.jsx(jt,{className:"text-xl",children:"What We Offer"})]}),s.jsx(He,{className:"text-center text-muted-foreground",children:s.jsx("p",{children:"Financial sponsorship to help cover tuition costs at participating K–8 private schools in Tarrant County."})})]}),s.jsxs(Ve,{className:"border-secondary/20 hover:shadow-lg transition-shadow",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"w-16 h-16 bg-secondary/10 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(Zr,{className:"w-8 h-8 text-secondary"})}),s.jsx(jt,{className:"text-xl",children:"Who Can Apply"})]}),s.jsx(He,{className:"text-center text-muted-foreground",children:s.jsx("p",{children:"Families with students in Kindergarten through 8th grade who meet the financial qualifications and show excellent academic potential."})})]}),s.jsxs(Ve,{className:"border-accent/20 hover:shadow-lg transition-shadow",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"w-16 h-16 bg-accent/10 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(IL,{className:"w-8 h-8 text-accent"})}),s.jsx(jt,{className:"text-xl",children:"Our Expectations"})]}),s.jsx(He,{className:"text-center text-muted-foreground",children:s.jsx("p",{children:"We expect students to be leaders, demonstrate good citizenship, prioritize attendance, and take their schoolwork seriously."})})]})]})}),s.jsxs("section",{className:"mb-16",children:[s.jsxs("h3",{className:"text-2xl font-display font-bold text-primary mb-6 flex items-center gap-3",children:[s.jsx(eoe,{className:"w-7 h-7"}),"Application Process for New Families"]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4",children:_De.map(r=>s.jsx(Ve,{className:"bg-muted/30 h-56",children:s.jsxs(He,{className:"p-4 flex flex-col h-full",children:[s.jsx("div",{className:"w-8 h-8 bg-primary text-primary-foreground rounded-full flex items-center justify-center font-bold text-sm flex-shrink-0 mb-3",children:r.step}),s.jsx("h4",{className:"font-semibold text-sm text-foreground mb-2 leading-tight",children:r.title}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r.description})]})},r.step))})]}),s.jsxs("section",{className:"mb-16",children:[s.jsxs("h3",{className:"text-2xl font-display font-bold text-primary mb-6 flex items-center gap-3",children:[s.jsx(IL,{className:"w-7 h-7"}),"Academic Expectations"]}),s.jsx(Ve,{children:s.jsxs(He,{className:"pt-6",children:[s.jsxs("p",{className:"text-muted-foreground mb-4 leading-relaxed",children:["Academically, we expect all students to apply themselves and strive to make the honor roll,",s.jsx("strong",{children:" but being on the honor roll is not a requirement"}),". We expect all students to:"]}),s.jsxs("ul",{className:"space-y-3",children:[s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx(Nt,{className:"w-5 h-5 text-green-600 mt-0.5 flex-shrink-0"}),s.jsx("span",{children:"Be leaders in their school and community"})]}),s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx(Nt,{className:"w-5 h-5 text-green-600 mt-0.5 flex-shrink-0"}),s.jsx("span",{children:"Demonstrate good citizenship"})]}),s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx(Nt,{className:"w-5 h-5 text-green-600 mt-0.5 flex-shrink-0"}),s.jsx("span",{children:"Prioritize attendance"})]}),s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx(Nt,{className:"w-5 h-5 text-green-600 mt-0.5 flex-shrink-0"}),s.jsx("span",{children:"Take their schoolwork seriously"})]})]})]})})]}),s.jsxs("section",{className:"mb-16",children:[s.jsxs("h3",{className:"text-2xl font-display font-bold text-primary mb-6 flex items-center gap-3",children:[s.jsx(En,{className:"w-7 h-7"}),"Required Documents (New Families)"]}
699),s.jsx(Ve,{className:"bg-muted/30",children:s.jsxs(He,{className:"pt-6",children:[s.jsx("ul",{className:"space-y-3",children:wDe.map((r,a)=>s.jsxs("li",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"w-6 h-6 bg-primary text-primary-foreground rounded-full flex items-center justify-center text-sm font-medium flex-shrink-0",children:a+1}),s.jsx("span",{children:r})]},a))}),s.jsx("p",{className:"text-sm text-muted-foreground mt-6 italic",children:"These requirements apply only to new families. Returning families will be guided through a separate process."})]})})]}),s.jsxs("section",{className:"mb-16",children:[s.jsxs("h3",{className:"text-2xl font-display font-bold text-primary mb-6 flex items-center gap-3",children:[s.jsx(FW,{className:"w-7 h-7"}),"Eligible K–8 Partner Schools"]}),s.jsx(Ve,{children:s.jsxs(He,{className:"pt-6",children:[s.jsx("p",{className:"text-muted-foreground mb-6",children:"The STAR Sponsorship Program partners with the following schools in Tarrant County:"}),s.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-3",children:jDe.map((r,a)=>s.jsxs("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-2 rounded-lg hover:bg-muted/50 transition-colors group",children:[s.jsx("img",{src:r.logo||`https://www.google.com/s2/favicons?domain=${new URL(r.url).hostname}&sz=32`,alt:"",className:"w-5 h-5 object-contain flex-shrink-0 rounded-sm"}),s.jsx("span",{className:"text-sm text-primary underline-offset-2 group-hover:underline",children:r.name})]},a))}),s.jsx("p",{className:"text-sm text-muted-foreground mt-6 italic",children:"Don't see your school? Contact us to inquire about adding new partner schools."})]})})]}),s.jsxs("section",{className:"text-center py-12 mb-12 bg-primary/5 rounded-2xl",children:[s.jsx("h3",{className:"text-2xl md:text-3xl font-display font-bold text-primary mb-4",children:"Ready to Apply?"}),s.jsx("p",{className:"text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Start your application today and take the first step toward giving your child the gift of a quality private education. Our team is here to help you every step of the way."}),e?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{className:"text-muted-foreground",children:["Welcome back, ",s.jsx("span",{className:"font-semibold text-foreground",children:(t==null?void 0:t.full_name)||e.email}),"!"]}),s.jsx(an,{to:"/portal",children:s.jsx(we,{size:"lg",className:"text-lg px-8 py-6 rounded-full bg-[#d00000] hover:bg-[#b00000] text-white",children:"CONTINUE YOUR APPLICATION"})}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-4",children:["Not you?"," ",s.jsxs("button",{onClick:()=>n(),className:"text-primary hover:underline inline-flex items-center gap-1",children:[s.jsx(Uh,{className:"w-3 h-3"}),"Sign out"]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(we,{size:"lg",className:"text-lg px-8 py-6 rounded-full bg-[#d00000] text-white opacity-50 cursor-not-allowed",disabled:!0,children:"APPLY NOW"}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-4",children:["Already have an account?"," ",s.jsx("span",{className:"text-muted-foreground/50 cursor-not-allowed",children:"Sign in here"})]})]})]})]})]})},NDe=[{id:"alex",name:"ALEX",school:"TEXAS WESLEYAN UNIVERSITY",image:"/images/alex.jpg",story:"Alex joined the STAR Sponsorship Program in 2014, attending Fort Worth Academy beginning in 6th grade. After graduating in 2017, he continued his education at Trinity Valley School before earning his Bachelor of Business Administration in Marketing from Texas Wesleyan University in May 2025. As a first-generation college graduate, Alex views this milestone as a reflection of not only his own hard work, but also his family's sacrifices and unwavering support."},{id:"isaias",name:"ISAIAS",school:"UNIVERSITY OF TEXAS AT ARLINGTON",image:"/images/isaias.jpg",story:"Isaias joined the STAR Sponsorship Program in 2008, attending Our Lady of Victory Catholic School through 8th grade. He later graduated from Nolan Catholic High School and earned his Bachelor of Business Administration in Information Systems from the University of Texas at Arlington in May 2025. As a first-generation college graduate, Isaias reflects on the challenges that shaped his growth and encourages students to dream big, stay consistent, and ask for help when needed. He is grateful to STAR for providing the foundation that helped make his success possible."},{id:"magan",name:"MAGAN",school:"TEXAS WOMAN'S UNIVERSITY-DENTO
699N",image:"/images/magan.jpg",story:"Magan attended St. Andrew Catholic School where she received the Math Award for the top student. She graduated from Paschal High School in May 2020, and received the Terry Foundation scholarship to attend Texas Woman's University as a nursing major."},{id:"collins",name:"COLLINS",school:"UNIVERSITY OF ROCHESTER-MONROE, NY",image:"/images/collins.jpg",story:"Collins attended St. Rita Catholic School, graduated from Trinity Valley School in 2017, and in the spring of 2021 from the University of Rochester in NY with a degree in Chemical Engineering. He plans on taking the LSAT and studying to become a patent lawyer."},{id:"sergio",name:"SERGIO",school:"LIBERTY UNIVERSITY",image:"/images/sergio.jpg",story:"Sergio graduated from Nolan Catholic High School and enrolled at Tarleton State University. He faced a challenge in continuing his education when he joined the U.S. Army. However, that did not deter him from achieving his academic goal!"},{id:"carly",name:"CARLY",school:"UNIVERSITY OF TEXAS AT ARLINGTON",image:"/images/carly.jpg",story:"Carly Aguirre graduated from Our Lady of Victory Catholic School. She then graduated from North Crowley High School Cum Laude and was named a Texas Scholar in May 2015. She is currently attending UTA, majoring in Business Marketing with a Minor in Psychology."}],ADe=()=>s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/testimonials-hero.jpg",title:"SUCCESS STORIES",imageStyle:{objectPosition:"center 40%"}}),s.jsx("section",{className:"section-padding bg-background",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto",children:NDe.map((e,t)=>s.jsxs("div",{id:e.id,className:"bg-card rounded-lg overflow-hidden shadow-lg card-hover",children:[s.jsx("div",{className:"aspect-square overflow-hidden",children:s.jsx("img",{src:e.image,alt:e.name,className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"p-6",children:[s.jsx("h3",{className:"text-xl font-display font-semibold text-primary",children:e.name}),s.jsx("p",{className:"text-sm text-secondary font-medium mb-4",children:e.school}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:e.story})]})]},e.id))})})})]});var SN="Collapsible",[kDe,SX]=ui(SN),[EDe,NR]=kDe(SN),NX=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...l}=e,[c,u]=vs({prop:r,defaultProp:a??!1,onChange:o,caller:SN});return s.jsx(EDe,{scope:n,disabled:i,contentId:Ga(),open:c,onOpenToggle:x.useCallback(()=>u(d=>!d),[u]),children:s.jsx(pt.div,{"data-state":CR(c),"data-disabled":i?"":void 0,...l,ref:t})})});NX.displayName=SN;var AX="CollapsibleTrigger",AR=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=NR(AX,n);return s.jsx(pt.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":CR(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:ht(e.onClick,a.onOpenToggle)})});AR.displayName=AX;var kR="CollapsibleContent",ER=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=NR(kR,e.__scopeCollapsible);return s.jsx(Ka,{present:n||a.open,children:({present:i})=>s.jsx(CDe,{...r,ref:t,present:i})})});ER.displayName=kR;var CDe=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=NR(kR,n),[l,c]=x.useState(r),u=x.useRef(null),d=sn(t,u),f=x.useRef(0),p=f.current,h=x.useRef(0),m=h.current,g=o.open||l,v=x.useRef(g),y=x.useRef(void 0);return x.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),Xr(()=>{const b=u.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const w=b.getBoundingClientRect();f.current=w.height,h.current=w.width,v.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),c(r)}},[o.open,r]),s.jsx(pt.div,{"data-state":CR(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!g,...i,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:g&&a})});function CR(e){return e?"open":"closed"}var kX=NX,PDe=AR,TDe=ER,Ml="Accordion",ODe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[PR,RDe,IDe]=Pv(Ml),[NN,tQe]=u
699i(Ml,[IDe,SX]),TR=SX(),EX=ue.forwardRef((e,t)=>{const{type:n,...r}=e,a=r,i=r;return s.jsx(PR.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?s.jsx(DDe,{...i,ref:t}):s.jsx($De,{...a,ref:t})})});EX.displayName=Ml;var[CX,LDe]=NN(Ml),[PX,MDe]=NN(Ml,{collapsible:!1}),$De=ue.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},collapsible:i=!1,...o}=e,[l,c]=vs({prop:n,defaultProp:r??"",onChange:a,caller:Ml});return s.jsx(CX,{scope:e.__scopeAccordion,value:ue.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:ue.useCallback(()=>i&&c(""),[i,c]),children:s.jsx(PX,{scope:e.__scopeAccordion,collapsible:i,children:s.jsx(TX,{...o,ref:t})})})}),DDe=ue.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...i}=e,[o,l]=vs({prop:n,defaultProp:r??[],onChange:a,caller:Ml}),c=ue.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=ue.useCallback(d=>l((f=[])=>f.filter(p=>p!==d)),[l]);return s.jsx(CX,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:u,children:s.jsx(PX,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(TX,{...i,ref:t})})})}),[FDe,AN]=NN(Ml),TX=ue.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:a,orientation:i="vertical",...o}=e,l=ue.useRef(null),c=sn(l,t),u=RDe(n),f=jp(a)==="ltr",p=ht(e.onKeyDown,h=>{var k;if(!ODe.includes(h.key))return;const m=h.target,g=u().filter(P=>{var R;return!((R=P.ref.current)!=null&&R.disabled)}),v=g.findIndex(P=>P.ref.current===m),y=g.length;if(v===-1)return;h.preventDefault();let b=v;const w=0,j=y-1,S=()=>{b=v+1,b>j&&(b=w)},A=()=>{b=v-1,b<w&&(b=j)};switch(h.key){case"Home":b=w;break;case"End":b=j;break;case"ArrowRight":i==="horizontal"&&(f?S():A());break;case"ArrowDown":i==="vertical"&&S();break;case"ArrowLeft":i==="horizontal"&&(f?A():S());break;case"ArrowUp":i==="vertical"&&A();break}const E=b%y;(k=g[E].ref.current)==null||k.focus()});return s.jsx(FDe,{scope:n,disabled:r,direction:a,orientation:i,children:s.jsx(PR.Slot,{scope:n,children:s.jsx(pt.div,{...o,"data-orientation":i,ref:c,onKeyDown:r?void 0:p})})})}),cj="AccordionItem",[BDe,OR]=NN(cj),OX=ue.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...a}=e,i=AN(cj,n),o=LDe(cj,n),l=TR(n),c=Ga(),u=r&&o.value.includes(r)||!1,d=i.disabled||e.disabled;return s.jsx(BDe,{scope:n,open:u,disabled:d,triggerId:c,children:s.jsx(kX,{"data-orientation":i.orientation,"data-state":DX(u),...l,...a,ref:t,disabled:d,open:u,onOpenChange:f=>{f?o.onItemOpen(r):o.onItemClose(r)}})})});OX.displayName=cj;var RX="AccordionHeader",IX=ue.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=AN(Ml,n),i=OR(RX,n);return s.jsx(pt.h3,{"data-orientation":a.orientation,"data-state":DX(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});IX.displayName=RX;var k4="AccordionTrigger",LX=ue.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=AN(Ml,n),i=OR(k4,n),o=MDe(k4,n),l=TR(n);return s.jsx(PR.ItemSlot,{scope:n,children:s.jsx(PDe,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...r,ref:t})})});LX.displayName=k4;var MX="AccordionContent",$X=ue.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=AN(Ml,n),i=OR(MX,n),o=TR(n);return s.jsx(TDe,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});$X.displayName=MX;function DX(e){return e?"open":"closed"}var UDe=EX,zDe=OX,WDe=IX,FX=LX,BX=$X;const uj=UDe,Co=x.forwardRef(({className:e,...t},n)=>s.jsx(zDe,{ref:n,className:Ye("border-b",e),...t}));Co.displayName="AccordionItem";const Po=x.forwardRef(({className:e,children:t,...n},r)=>s.jsx(WDe,{className:"flex",children:s.jsxs(FX,{ref:r,className:Ye("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,s.jsx(af,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Po.displayName=FX.displayName;const To=x.forwardRef(({className:e,children:t,...n},r)=>s.jsx(BX,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:s.jsx("div",{className:Ye("pb-4 pt-0",e),children:t})}));To.displayName=BX.displayName;const qDe=[{question:"What is the STAR Sponsorship Program?",answer:"The STAR (Success Through Academic Readiness) Sponsorship Program, Inc. is a 501(c)(3) nonprofit organization founded in 1993 that provides tuition assistance to low-income families in Tarrant County, enabling their children to attend private schools that better meet their educational needs."},{question:"Will STAR still be needed with the new Texas Education Freedom Accounts (TEFA) program?",answer:"Yes. While TEFA is an important step toward expanding school 
699choice in Texas, initial funding is limited and will not meet the full demand. With only a portion of students expected to receive funding in the early years, many families will still face financial gaps. STAR will continue to play a critical role in helping low-income families access the educational environment that best fits their child's needs. State programs and private scholarships work together to expand opportunity, not replace one another."},{question:"How does the sponsorship work?",answer:"Sponsors are matched with individual students and provide financial support for their tuition. Throughout the school year, sponsors receive updates including report cards, letters, artwork, and photographs from their sponsored student."},{question:"Who qualifies for the program?",answer:"Students from low-income families in Tarrant County who demonstrate the willingness to put forth extra effort to meet program requirements. Parents must apply annually with teacher/principal recommendations, recent report cards, and financial documentation."},{question:"How much does it cost to sponsor a child?",answer:"Sponsorship amounts vary based on the school and the family's financial situation. Contact us directly for specific information about current sponsorship opportunities."},{question:"Is my donation tax-deductible?",answer:"Yes! STAR Sponsorship Program, Inc. is a 501(c)(3) nonprofit organization. All donations are tax-deductible to the extent allowed by law."},{question:"How can I become a sponsor?",answer:"You can become a sponsor by visiting our Donate page or contacting us directly. We'll match you with a student and provide all the information you need to begin your sponsorship journey."},{question:"What schools participate in the program?",answer:"STAR partners with various private schools throughout Tarrant County. The specific school depends on the student's needs, location, and available openings."},{question:"Can I specify how my donation is used?",answer:"Yes, you can designate your donation for a specific student or allow us to direct it where it's needed most. Contact us to discuss your preferences."}],VDe=()=>s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/faqs-hero.jpg",title:"FREQUENTLY ASKED QUESTIONS"}),s.jsx("section",{className:"section-padding bg-background",children:s.jsx("div",{className:"container mx-auto px-4 max-w-3xl",children:s.jsx(uj,{type:"single",collapsible:!0,className:"space-y-4",children:qDe.map((e,t)=>s.jsxs(Co,{value:`item-${t}`,className:"bg-card rounded-lg shadow-md px-6 border-none",children:[s.jsx(Po,{className:"text-left font-display text-primary hover:text-secondary hover:no-underline py-6",children:e.question}),s.jsx(To,{className:"text-muted-foreground pb-6",children:e.answer})]},t))})})})]}),HDe="/assets/esmeralda-DmdZo_CH.png",GDe="/assets/shannon-elders-DlOxxBLG.jpg",YDe="/assets/david-porter-OL94Vgsk.png",KDe="/assets/maria-DU0AdXTZ.jpg",ZDe=()=>s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/star-voices-hero.jpg",title:"STAR VOICES"}),s.jsx("section",{className:"section-padding bg-background",children:s.jsxs("div",{className:"container mx-auto px-4 max-w-4xl",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("h2",{className:"text-2xl md:text-3xl font-display font-bold text-primary mb-4",children:"Voices from the STAR Community"}),s.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto",children:"Hear directly from the students, families, sponsors, and supporters who are part of STAR. Their stories reflect the hope, opportunity, and lasting impact this program creates."})]}),s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"bg-card rounded-lg shadow-md p-8 flex flex-col md:flex-row items-center gap-6",children:[s.jsx("img",{src:HDe,alt:"Esmeralda",className:"w-24 h-24 rounded-full object-cover shrink-0"}),s.jsxs("div",{children:[s.jsx("blockquote",{className:"text-muted-foreground italic leading-relaxed mb-4 font-display",children:'"I would like to thank you for your generosity and gift of love. Thank you for giving me the strength, courage, and mindset to reach for the sky. My sponsors have taught me values and morals for a bright future. For those reasons, I thank you for my future."'}),s.jsx("p",{className:"text-primary font-semibold",children:"— STAR Alumna, Esmeralda, St. Andrew Catholic School"})]})]}),s.jsxs("div",{className:"bg-card rounded-lg shadow-md p-8 flex flex-col md:flex-row items-center gap-6",children:[s.jsx("img",{src:GDe,alt:"Shannon Elders",className:"w-24 h-24 rounded-full object-cover shrink-0"}),s.jsxs("div",{children:[s.jsx("blockquote",{className:"text-muted-foreground italic leading-relaxed mb-4 font-display",children:'"I just wanted to thank STAR for your partnership with FWA. We love our STAR students and we are very fortunate to have such a wonderful organization to help families in Fort Worth."'}),s.jsx("p",{className:"text-primary font-semibold",children:"— Fort Worth Academy Head of School, Shannon Elders"})]})]}),s.jsxs("div",{className:"bg-card rounded-lg shadow-md p-8 flex flex-col md:flex-row items-center gap-6",children:[s.jsx("img",{src:YDe,alt:"David Porter",className:"w-24 h-24 rounded-full object-cover shrink-0"}),s.jsxs("div",{children:[s.jsx("blockquote",{className:"text-muted-foreground italic leading-relaxed mb-4 font-display",children:`"STAR has been around long enough that its graduates are not only graduating from the eighth grade and high school, but now graduating from college. You can begin to see that trajectory or path and it's amazing how well these kids have done."`}),s.jsx("p",{className:"text-primary font-semibold",children:"— STAR Sponsorship, Inc. Board Member & Sponsor, David Porter"})]})]}),s.jsxs("div",{className:"bg-card rounded-lg shadow-md p-8 flex flex-col md:flex-row items-center gap-6",children:[s.jsx("img",{src:KDe,alt:"Maria",className:"w-24 h-24 rounded-full shrink-0",style:{objectFit:"cover",objectPosition:"20% center"}}),s.jsxs("div",{children:[s.jsx("blockquote",{className:"text-muted-foreground italic leading-relaxed mb-4 font-display",children:`"This program helps mothers like me who want the best for our children. I want to thank STAR for finding such wonderful people who care about our children's education. Thank y
699ou for allowing him to have such an amazing opportunity."`}),s.jsx("p",{className:"text-primary font-semibold",children:"— STAR Parent, Maria"})]})]})]})]})})]}),xt=x.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:Ye("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",e),ref:r,...n}));xt.displayName="Input";const wc=x.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:Ye("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-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",e),ref:n,...t}));wc.displayName="Textarea";var XDe="Label",UX=x.forwardRef((e,t)=>s.jsx(pt.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));UX.displayName=XDe;var zX=UX;const JDe=Tv("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),$e=x.forwardRef(({className:e,...t},n)=>s.jsx(zX,{ref:n,className:Ye(JDe(),e),...t}));$e.displayName=zX.displayName;const QDe=["application/pdf","image/jpeg","image/jpg","image/png"],e8e=10*1024*1024,Wy=5;function t8e(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}async function n8e(e){if(!e||typeof e!="object")return"Something went wrong. Please try again.";const t=e;if(t.context)try{const n=await t.context.clone().json();if(n&&typeof n.error=="string")return n.error}catch{try{const n=await t.context.text();if(n)return n}catch{}}return t.message||"Something went wrong. Please try again."}const QF=({title:e,description:t,firstNameLabel:n,lastNameLabel:r,messageLabel:a,letterType:i})=>{const[o,l]=x.useState(""),[c,u]=x.useState(""),[d,f]=x.useState(""),[p,h]=x.useState([]),[m,g]=x.useState({}),[v,y]=x.useState(!1),b=x.useRef(null),w=x.useRef(Date.now());x.useEffect(()=>{w.current=Date.now()},[]);const j=()=>{const k={};return o.trim()||(k.firstName="First name is required."),c.trim()||(k.lastName="Last name is required."),d.trim()||(k.message="Message is required."),o.trim().length>100&&(k.firstName="First name must be 100 characters or less."),c.trim().length>100&&(k.lastName="Last name must be 100 characters or less."),d.trim().length>5e3&&(k.message="Message must be 5,000 characters or less."),g(k),Object.keys(k).length===0},S=k=>{const P=Array.from(k.target.files||[]),R=[],C=P.filter(D=>QDe.includes(D.type)?D.size>e8e?(R.push(`${D.name}: Exceeds 10MB limit.`),!1):!0:(R.push(`${D.name}: Invalid file type.`),!1)),I=[...p,...C].slice(0,Wy);h(I),R.length>0?g(D=>({...D,files:R.join(" ")})):p.length+C.length>Wy?g(D=>({...D,files:`Maximum ${Wy} files allowed.`})):g(D=>{const{files:U,...q}=D;return q}),b.current&&(b.current.value="")},A=k=>{h(P=>P.filter((R,C)=>C!==k)),g(P=>{const{files:R,...C}=P;return C})},E=async k=>{var P;if(k.preventDefault(),!!j()){if(Date.now()-w.current<3e3){et({title:"Please wait a moment",description:"Give the page a few seconds, then submit again.",variant:"destructive"});return}y(!0);try{const R=new FormData;R.append("student_first_name",o.trim()),R.append("student_last_name",c.trim()),R.append("message",d.trim()),R.append("form_loaded_at",String(w.current)),R.append("form_elapsed_ms",String(Math.max(0,Date.now()-w.current))),R.append("letter_type",i);for(const D of p)R.append("files",D,D.name);let C=null,I=null;for(let D=1;D<=2;D++){const U=await Re.functions.invoke("send-sponsor-letter",{body:R});if(C=U.data,I=U.error,!I)break;const q=(P=I==null?void 0:I.context)==null?void 0:P.status;if(!(typeof q=="number"&&[500,502,503,504].includes(q))||D===2)break;await new Promise(H=>setTimeout(H,800))}if(I){const D=await n8e(I);throw new Error(D)}if(C!=null&&C.error)throw new Error(C.error);et({title:"Message Sent!",description:"Your message has been successfully sent."}),l(""),u(""),f(""),h([]),g({})}catch(R){console.error("Submission error:",R),et({title:"Error",description:R.message||"Something went wrong. Please try again.",variant:"destructive"})}finally{y(!1)}}};return s.jsxs(Ve,{className:"shadow-lg h-full",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx(jt,{className:"text-2xl md:text-3xl font-display font-semibold text-primary",children:e}),s.jsx("p",{className:"text-muted-foreground mt-2",children:t})]}),s.jsx(He,{children:s.jsxs("form",{onSubmit:E,className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`${i}-firstName`,children:[n," ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:`${i}-firstName`,value:o,onChange:k=>l(k.target.value),placeholder:"First name",maxLength:100,disabled:v}),m.firstName&&s.jsx("p",{className:"text-sm text-destructive",children:m.firstName})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`${i}-lastName`,children:[r," ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:`${i}-lastName`,value:c,onChange:k=>u(k.target.value),placeholder:"Last name",maxLength:100,disabled:v}),m.lastName&&s.jsx("p",{className:"text-sm text-destructive",children:m.lastName})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`${i}-message`,children:[a," ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(wc,{id:`${i}-message`,value:d,onChange:k=>f(k.target.value),placeholder:"Write your message here...",rows:6,maxLength:5e3,disabled:v}),s.jsxs("div",{className:"flex justify-between",children:[m.message?s.jsx("p",{className:"text-sm text-destructive",children:m.message}):s.jsx("span",{}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[d.length,"/5,000"]})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx($e,{children:"Attachments (optional)"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Upload letters, drawings, or artwork. PDF, JPG, or PNG — max 10MB each, up to 5 files."}),s.jsx("input",{ref:b,type:"file",accept:".pdf,.jpg,.jpeg,.png",multiple:!0,className:"hidden",onChange:S,disabled:v||p.length>=Wy}),s.jsxs(we,{type:"button",variant:"outline",onClick:()=>{var k;return(k=b.current)==null?void 0:k.click()},disabled:v||p.length>=Wy,className:"gap-2",children:[s.jsx(fa,{className:"h-4 w-4"})," Choose Files"]}),m.files&&s.jsx("p",{className:"text-sm text-destructive",children:m.files}),p.length>0&&s.jsx("ul",{className:"space-y-2 mt-2",children:p.map((k,P)=>s.jsxs("li",{className:"flex items-center justify-between rounded-md border border-border bg-muted/50 px-3 py-2 text-sm",children:[s.jsxs("span",{className:"truncate mr-2",children:[k.name," ",s.jsxs("span",{className:"text-muted-foreground",children:["(",t8e(k.size),")"]})]}),s.jsx("button",{type:"button",onClick:()=>A(P),className:"text-muted-foreground hover:text-destructive shrink-0","aria-label":`Remove ${k.name}`,disabled:v,children:s.jsx(yf,{className:"h-4 w-4"})})]},`${k.name}-${P}`))})]}),s.jsx(we,{type:"submit",size:"lg",disabled:v,className:"w-full sm:w-auto",children:v?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"h-4 w-4 animate-spin"})," Sending…"]}):"Send Message"})]})})]})},r8e=()=>s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/write-letter-hero.jpg",title:"WRITE A LETTER",imageStyle:{objectPosition:"center 60%"}}),s.jsx("section",{className:"section-padding pb-4 bg-background",children:s.jsxs("div",{className:"container mx-auto px-4 max-w-4xl",children:[s.jsx("h2",{className:"section-heading mb-8",children:"WAYS TO CONNECT"}),s.jsx("div",{className:"prose prose-lg max-w-none text-muted-foreground",children:s.jsx("p",{className:"leading-relaxed mb-6",children:"Our parent-sponsor-school partnership is the heart of the STAR Program, and it creates a unique environment for connectivity and curiosity. There are many ways to connect with each other, and it all starts with our letters."})})]})}),s.jsx("section",{className:"section-padding pt-4 bg-background",children:s.jsx("div",{className:"container mx-auto px-4 max-w-6xl",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[s.jsx(QF,{title:"WRITE YOUR STUDENT",description:"Send a message to your student. You may also attach letters, drawings, or artwork.",firstNameLabel:"First Name",lastNameLabel:"Last Name",messageLabel:"Message to Student",letterType:"student"}),s.jsx(QF,{title:"WRITE YOUR SPONSOR",description:"Send a message to your sponsor. You may also attach letters, drawings, or artwork.",firstNameLabel:"Student First Name",lastNameLabel:"Student Last Name",messageLabel:"Message to Sponsor",letterType:"sponsor"})]})})})]}),a8e=()=>
699{const[e,t]=x.useState({name:"",email:"",subject:"",message:""}),n=r=>{r.preventDefault(),tn.success("Thank you for your message! We'll be in touch soon."),t({name:"",email:"",subject:"",message:""})};return s.jsxs(Xo,{children:[s.jsx(Sc,{image:"/images/about-hero.jpg",title:"CONTACT US"}),s.jsx("section",{className:"section-padding bg-background",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-12 max-w-5xl mx-auto",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl md:text-3xl font-display font-semibold text-primary mb-6",children:"Get In Touch"}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"We'd love to hear from you! Whether you're interested in becoming a sponsor, have questions about our program, or want to learn more about how you can help, please reach out."}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"bg-primary/10 p-3 rounded-lg",children:s.jsx(loe,{className:"w-6 h-6 text-primary"})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-foreground",children:"Address"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Fort Worth, Texas"})]})]}),s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"bg-primary/10 p-3 rounded-lg",children:s.jsx(lu,{className:"w-6 h-6 text-primary"})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-foreground",children:"Email"}),s.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:text-secondary text-sm",children:"[email protected]"})]})]}),s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"bg-primary/10 p-3 rounded-lg",children:s.jsx(rx,{className:"w-6 h-6 text-primary"})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-foreground",children:"Phone"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Contact us via email for phone inquiries"})]})]})]})]}),s.jsx("div",{children:s.jsxs("form",{onSubmit:n,className:"bg-card rounded-lg shadow-lg p-8 space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"name",children:"Name"}),s.jsx(xt,{id:"name",value:e.name,onChange:r=>t({...e,name:r.target.value}),placeholder:"Your name",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"email",children:"Email"}),s.jsx(xt,{id:"email",type:"email",value:e.email,onChange:r=>t({...e,email:r.target.value}),placeholder:"[email protected]",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"subject",children:"Subject"}),s.jsx(xt,{id:"subject",value:e.subject,onChange:r=>t({...e,subject:r.target.value}),placeholder:"How can we help?",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"message",children:"Message"}),s.jsx(wc,{id:"message",value:e.message,onChange:r=>t({...e,message:r.target.value}),placeholder:"Your message...",rows:5,required:!0})]}),s.jsx(we,{type:"submit",className:"donate-btn w-full",children:"Send Message"})]})})]})})})]})},i8e=()=>s.jsx(Xo,{children:s.jsx("div",{className:"min-h-[60vh] flex items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center px-4",children:[s.jsx("h1",{className:"text-6xl font-display font-bold text-primary mb-4",children:"404"}),s.jsx("p",{className:"text-xl text-muted-foreground mb-8",children:"Oops! The page you're looking for doesn't exist."}),s.jsx(an,{to:"/",children:s.jsx(we,{className:"donate-btn",children:"Return to Home"})})]})})});var WX="5.0.1";function dj(e,t){return new Promise(n=>setTimeout(n,e,t))}function s8e(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function o8e(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(r=>n.call(window,()=>r(),{timeout:t})):dj(Math.min(e,t))}function qX(e){return!!e&&typeof e.then=="function"}function e7(e,t){try{const n=e();qX(n)?n.then(r=>t(!0,r),r=>t(!1,r)):t(!0,n)}catch(n){t(!1,n)}}async function t7(e,t,n=16){const r=Array(e.length);let a=Date.now();for(let i=0;i<e.length;++i){r[i]=t(e[i],i);const o=Date.now();o>=a+n&&(a=o,await s8e())}return r}function Jx(e){return e.then(void 0,()=>{}),e}function l8e(e,t){for(let n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function c8e(e,t){return!l8e(e,t)}function RR(e){return parseInt(e)}function gl(e){return parseFloat(e)}function Xc(e,t){return typeof e=="number"&&isNaN(e)?t:e}function ys(e){return e.reduce((t,n)=>t+(n?1:0),0)}function VX(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function u8e(e){var t,n;const r=`Unexpected syntax '${e}'`,a=/^\s*([a-z-]*)(.*)$/i.exec(e),i=a[1]||void 0,o={},l=/([.:#][\w-]+|\[.+?\])/gi,c=(u,d)=>{o[u]=o[u]||[],o[u].push(d)};for(;;){const u=l.exec(a[2]);if(!u)break;const d=u[0];switch(d[0]){case".":c("class",d.slice(1));break;case"#":c("id",d.slice(1));break;
699case"[":{const f=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(d);if(f)c(f[1],(n=(t=f[4])!==null&&t!==void 0?t:f[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[i,o]}function d8e(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(r>127)return new TextEncoder().encode(e);t[n]=r}return t}function ed(e,t){const n=e[0]>>>16,r=e[0]&65535,a=e[1]>>>16,i=e[1]&65535,o=t[0]>>>16,l=t[0]&65535,c=t[1]>>>16,u=t[1]&65535;let d=0,f=0,p=0,h=0;h+=i+u,p+=h>>>16,h&=65535,p+=a+c,f+=p>>>16,p&=65535,f+=r+l,d+=f>>>16,f&=65535,d+=n+o,d&=65535,e[0]=d<<16|f,e[1]=p<<16|h}function Eo(e,t){const n=e[0]>>>16,r=e[0]&65535,a=e[1]>>>16,i=e[1]&65535,o=t[0]>>>16,l=t[0]&65535,c=t[1]>>>16,u=t[1]&65535;let d=0,f=0,p=0,h=0;h+=i*u,p+=h>>>16,h&=65535,p+=a*u,f+=p>>>16,p&=65535,p+=i*c,f+=p>>>16,p&=65535,f+=r*u,d+=f>>>16,f&=65535,f+=a*c,d+=f>>>16,f&=65535,f+=i*l,d+=f>>>16,f&=65535,d+=n*u+r*c+a*l+i*o,d&=65535,e[0]=d<<16|f,e[1]=p<<16|h}function om(e,t){const n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Xs(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function ea(e,t){e[0]^=t[0],e[1]^=t[1]}const f8e=[4283543511,3981806797],h8e=[3301882366,444984403];function n7(e){const t=[0,e[0]>>>1];ea(e,t),Eo(e,f8e),t[1]=e[0]>>>1,ea(e,t),Eo(e,h8e),t[1]=e[0]>>>1,ea(e,t)}const bw=[2277735313,289559509],ww=[1291169091,658871167],r7=[0,5],p8e=[0,1390208809],m8e=[0,944331445];function g8e(e,t){const n=d8e(e);t=t||0;const r=[0,n.length],a=r[1]%16,i=r[1]-a,o=[0,t],l=[0,t],c=[0,0],u=[0,0];let d;for(d=0;d<i;d=d+16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,u[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,u[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,Eo(c,bw),om(c,31),Eo(c,ww),ea(o,c),om(o,27),ed(o,l),Eo(o,r7),ed(o,p8e),Eo(u,ww),om(u,33),Eo(u,bw),ea(l,u),om(l,31),ed(l,o),Eo(l,r7),ed(l,m8e);c[0]=0,c[1]=0,u[0]=0,u[1]=0;const f=[0,0];switch(a){case 15:f[1]=n[d+14],Xs(f,48),ea(u,f);case 14:f[1]=n[d+13],Xs(f,40),ea(u,f);case 13:f[1]=n[d+12],Xs(f,32),ea(u,f);case 12:f[1]=n[d+11],Xs(f,24),ea(u,f);case 11:f[1]=n[d+10],Xs(f,16),ea(u,f);case 10:f[1]=n[d+9],Xs(f,8),ea(u,f);case 9:f[1]=n[d+8],ea(u,f),Eo(u,ww),om(u,33),Eo(u,bw),ea(l,u);case 8:f[1]=n[d+7],Xs(f,56),ea(c,f);case 7:f[1]=n[d+6],Xs(f,48),ea(c,f);case 6:f[1]=n[d+5],Xs(f,40),ea(c,f);case 5:f[1]=n[d+4],Xs(f,32),ea(c,f);case 4:f[1]=n[d+3],Xs(f,24),ea(c,f);case 3:f[1]=n[d+2],Xs(f,16),ea(c,f);case 2:f[1]=n[d+1],Xs(f,8),ea(c,f);case 1:f[1]=n[d],ea(c,f),Eo(c,bw),om(c,31),Eo(c,ww),ea(o,c)}return ea(o,r),ea(l,r),ed(o,l),ed(l,o),n7(o),n7(l),ed(o,l),ed(l,o),("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(l[0]>>>0).toString(16)).slice(-8)+("00000000"+(l[1]>>>0).toString(16)).slice(-8)}function v8e(e){var t;return{name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
700`),...e}}function y8e(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function x8e(e){return typeof e!="function"}function b8e(e,t){const n=Jx(new Promise(r=>{const a=Date.now();e7(e.bind(null,t),(...i)=>{const o=Date.now()-a;if(!i[0])return r(()=>({error:i[1],duration:o}));const l=i[1];if(x8e(l))return r(()=>({value:l,duration:o}));r(()=>new Promise(c=>{const u=Date.now();e7(l,(...d)=>{const f=o+Date.now()-u;if(!d[0])return c({error:d[1],duration:f});c({value:d[1],duration:f})})}))})}));return function(){return n.then(a=>a())}}function w8e(e,t,n,r){const a=Object.keys(e).filter(o=>c8e(n,o)),i=Jx(t7(a,o=>b8e(e[o],t),r));return async function(){const l=await i,c=await t7(l,f=>Jx(f()),r),u=await Promise.all(c),d={};for(let f=0;f<a.length;++f)d[a[f]]=u[f];return d}}function HX(){const e=window,t=navigator;return ys(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function _8e(){const e=window,t=navigator;return ys(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!HX()}function Db(){const e=window,t=navigator;return ys(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>
700=5}function $l(){const e=window,t=navigator;return ys(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function IR(){const e=window,{HTMLElement:t,Document:n}=e;return ys(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function Fb(){const e=window;return y8e(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function GX(){var e,t;const n=window;return ys(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function j8e(){const e=window;return ys([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function S8e(){const e=window,{URLPattern:t}=e;return ys(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function N8e(){const e=window;return ys(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Bb(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:r}=e;return ys([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function A8e(){if(navigator.platform==="iPad")return!0;const e=screen,t=e.width/e.height;return ys(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function k8e(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function E8e(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function LR(){const e=Db(),t=GX(),n=window,r=navigator,a="connection";return e?ys([!("SharedWorker"in n),r[a]&&"ontypechange"in r[a],!("sinkId"in new Audio)])>=2:t?ys(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function C8e(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:r}=t;return ys(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function P8e(){return R8e()?-4:T8e()}function T8e(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(O8e())return-1;const n=4500,r=5e3,a=new t(1,r,44100),i=a.createOscillator();i.type="triangle",i.frequency.value=1e4;const o=a.createDynamicsCompressor();o.threshold.value=-50,o.knee.value=40,o.ratio.value=12,o.attack.value=0,o.release.value=.25,i.connect(o),o.connect(a.destination),i.start(0);const[l,c]=I8e(a),u=Jx(l.then(d=>L8e(d.getChannelData(0).subarray(n)),d=>{if(d.name==="timeout"||d.name==="suspended")return-3;throw d}));return()=>(c(),u)}function O8e(){return $l()&&!IR()&&!N8e()}function R8e(){return $l()&&Bb()&&Fb()||Db()&&C8e()&&S8e()}function I8e(e){let i=()=>{};return[new Promise((l,c)=>{let u=!1,d=0,f=0;e.oncomplete=m=>l(m.renderedBuffer);const p=()=>{setTimeout(()=>c(a7("timeout")),Math.min(500,f+5e3-Date.now()))},h=()=>{try{const m=e.startRendering();switch(qX(m)&&Jx(m),e.state){case"running":f=Date.now(),u&&p();break;case"suspended":document.hidden||d++,u&&d>=3?c(a7("suspended")):setTimeout(h,500);break}}catch(m){c(m)}};h(),i=()=>{u||(u=!0,f>0&&p())}}),i]}function L8e(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function a7(e){const t=new Error(e);return t.name=e,t}async function YX(e,t,n=50){var r,a,i;const o=document;for(;!o.body;)await dj(n);const l=o.createElement("iframe");try{for(await new Promise((c,u)=>{let d=!1;const f=()=>{d=!0,c()},p=g=>{d=!0,u(g)};l.onload=f,l.onerror=p;const{style:h}=l;h.setProperty("display","block","important"),h.position="absolute",h.top="0",h.left="0",h.visibility="hidden",t&&"srcdoc"in l?l.srcdoc=t:l.src="about:blank",o.body.appendChild(l);const m=()=>{var g,v;d||(((v=(g=l.contentWindow)===null||g===void 0?void 0:g.document)===null||v===void 0?void 0:v.readyState)==="complete"?f():setTimeout(m,10))};m()});!(!((a=(r=l.contentWindow)===null||r===void 0?void 0:r.document)===null||a===void 0)&&a.body);)await dj(n);return await e(l,l.contentWindow)}finally{(i=l.parentNode)===null||i===void 0||i.removeChild(l)}}function M8e(e){const[t,n]=u8e(e),r=document.createElement(t??"div");for(const a of Object.keys(n)){const i=n[a].join(" ");a==="style"?$8e(r.style,i):r.setAttribute(a,i)}return r}function $8e(e,t){for(const n of t.split(";")){const r=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(r){const[,a,i,,o]=r;e.setProperty(a,i,o||"")}}}function D8e(){let e=window;for(;;){const t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}const F8e="mmMwWLliI0O&1",B8e="48px",lm=["monospace","sans-serif","serif"],i7=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera S
700ans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function U8e(){return YX(async(e,{document:t})=>{const n=t.body;n.style.fontSize=B8e;const r=t.createElement("div");r.style.setProperty("visibility","hidden","important");const a={},i={},o=h=>{const m=t.createElement("span"),{style:g}=m;return g.position="absolute",g.top="0",g.left="0",g.fontFamily=h,m.textContent=F8e,r.appendChild(m),m},l=(h,m)=>o(`'${h}',${m}`),c=()=>lm.map(o),u=()=>{const h={};for(const m of i7)h[m]=lm.map(g=>l(m,g));return h},d=h=>lm.some((m,g)=>h[g].offsetWidth!==a[m]||h[g].offsetHeight!==i[m]),f=c(),p=u();n.appendChild(r);for(let h=0;h<lm.length;h++)a[lm[h]]=f[h].offsetWidth,i[lm[h]]=f[h].offsetHeight;return i7.filter(h=>d(p[h]))})}function z8e(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const r=e[n];if(!r)continue;const a=[];for(let i=0;i<r.length;++i){const o=r[i];a.push({type:o.type,suffixes:o.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:a})}return t}function W8e(){return q8e(X8e())}function q8e(e){let t=!1,n,r;const[a,i]=V8e();return H8e(a,i)?(t=G8e(i),e?n=r="skipped":[n,r]=Y8e(a,i)):n=r="unsupported",{winding:t,geometry:n,text:r}}function V8e(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function H8e(e,t){return!!(t&&e.toDataURL)}function G8e(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function Y8e(e,t){K8e(e,t);const n=ok(e),r=ok(e);return n!==r?["unstable","unstable"]:(Z8e(e,t),[ok(e),n])}function K8e(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n="Cwm fjordbank gly 😃";t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function Z8e(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,r,a]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(r,a,40,0,Math.PI*2,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function ok(e){return e.toDataURL()}function X8e(){return $l()&&Bb()&&Fb()}function J8e(){const e=navigator;let t=0,n;e.maxTouchPoints!==void 0?t=RR(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}const r="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:r}}function Q8e(){return navigator.oscpu}function eFe(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))Db()&&j8e()||t.push(e.languages);else if(typeof e.languages=="string"){const r=e.languages;r&&t.push(r.split(","))}return t}function tFe(){return window.screen.colorDepth}function nFe(){return Xc(gl(navigator.deviceMemory),void 0)}function rFe(){if(!($l()&&Bb()&&Fb()))return aFe()}function aFe(){const e=screen,t=r=>Xc(RR(r),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}const iFe=2500,sFe=10;let o_,lk;function oFe(){if(lk!==void 0)return;const e=()=>{const t=E4();C4(t)?lk=setTimeout(e,iFe):(o_=t,lk=void 0)};e()}function lFe(){return oFe(),async()=>{let e=E4();if(C4(e)){if(o_)return[...o_];k8e()&&(await E8e(),e=E4())}return C4(e)||(o_=e),e}}function cFe(){if($l()&&Bb()&&Fb())return()=>Promise.resolve(void 0);const e=lFe();return async()=>{const t=await e(),n=r=>r===null?null:VX(r,sFe);return[n(t[0]),n(t[1]),n(t[2]),n(t[3])]}}function E4(){const e=screen;
700return[Xc(gl(e.availTop),null),Xc(gl(e.width)-gl(e.availWidth)-Xc(gl(e.availLeft),0),null),Xc(gl(e.height)-gl(e.availHeight)-Xc(gl(e.availTop),0),null),Xc(gl(e.availLeft),null)]}function C4(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function uFe(){return Xc(RR(navigator.hardwareConcurrency),void 0)}function dFe(){var e;const t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){const r=new t().resolvedOptions().timeZone;if(r)return r}const n=-fFe();return`UTC${n>=0?"+":""}${n}`}function fFe(){const e=new Date().getFullYear();return Math.max(gl(new Date(e,0,1).getTimezoneOffset()),gl(new Date(e,6,1).getTimezoneOffset()))}function hFe(){try{return!!window.sessionStorage}catch{return!0}}function pFe(){try{return!!window.localStorage}catch{return!0}}function mFe(){if(!(HX()||_8e()))try{return!!window.indexedDB}catch{return!0}}function gFe(){return!!window.openDatabase}function vFe(){return navigator.cpuClass}function yFe(){const{platform:e}=navigator;return e==="MacIntel"&&$l()&&!IR()?A8e()?"iPad":"iPhone":e}function xFe(){return navigator.vendor||""}function bFe(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&typeof n=="object"&&e.push(t)}return e.sort()}function wFe(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function _Fe(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie
vendor: 3,598 bytes, line 700
700:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiX
700Q=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}async function jFe({debug:e}={}){if(!SFe())return;const t=_Fe(),n=Object.keys(t),r=[].concat(...n.map(o=>t[o])),a=await NFe(r);e&&AFe(t,a);const i=n.filter(o=>{const l=t[o];return ys(l.map(u=>a[u]))>l.length*.6});return i.sort(),i}function SFe(){return $l()||LR()}async function NFe(e){var t;const n=document,r=n.createElement("div"),a=new Array(e.length),i={};s7(r);for(let o=0;o<e.length;++o){const l=M8e(e[o]);l.tagName==="DIALOG"&&l.show();const c=n.createElement("div");s7(c),c.appendChild(l),r.appendChild(c),a[o]=l}for(;!n.body;)await dj(50);n.body.appendChild(r);try{for(let o=0;o<e.length;++o)a[o].offsetParent||(i[e[o]]=!0)}finally{(t=r.parentNode)===null||t===void 0||t.removeChild(r)}return i}function s7(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function AFe(e,t){let n="DOM blockers debug:\n```";for(const r of Object.keys(e)){n+=`
701${r}:`;for(const a of e[r])n+=`
702  ${t[a]?"🚫":"➡️"} ${a}`}console.log(`${n}
703\`\`\``)}function kFe(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e}function EFe(){if(o7("inverted"))return!0;if(o7("none"))return!1}function o7(e){return matchMedia(`(inverted-colors: ${e})`).matches}function CFe(){if(l7("active"))return!0;if(l7("none"))return!1}function l7(e){return matchMedia(`(forced-colors: ${e})`).matches}const PFe=100;function TFe(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=PFe;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}}function OFe(){if(cm("no-preference"))return 0;if(cm("high")||cm("more"))return 1;if(cm("low")||cm("less"))return-1;if(cm("forced"))return 10}function cm(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function RFe(){if(c7("reduce"))return!0;if(c7("no-preference"))return!1}function c7(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function IFe(){if(u7("reduce"))return!0;if(u7("no-preference"))return!1}function u7(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}
703function LFe(){if(d7("high"))return!0;if(d7("standard"))return!1}function d7(e){return matchMedia(`(dynamic-range: ${e})`).matches}const hr=Math,is=()=>0;function MFe(){const e=hr.acos||is,t=hr.acosh||is,n=hr.asin||is,r=hr.asinh||is,a=hr.atanh||is,i=hr.atan||is,o=hr.sin||is,l=hr.sinh||is,c=hr.cos||is,u=hr.cosh||is,d=hr.tan||is,f=hr.tanh||is,p=hr.exp||is,h=hr.expm1||is,m=hr.log1p||is,g=k=>hr.pow(hr.PI,k),v=k=>hr.log(k+hr.sqrt(k*k-1)),y=k=>hr.log(k+hr.sqrt(k*k+1)),b=k=>hr.log((1+k)/(1-k))/2,w=k=>hr.exp(k)-1/hr.exp(k)/2,j=k=>(hr.exp(k)+1/hr.exp(k))/2,S=k=>hr.exp(k)-1,A=k=>(hr.exp(2*k)-1)/(hr.exp(2*k)+1),E=k=>hr.log(1+k);return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:v(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:y(1),atanh:a(.5),atanhPf:b(.5),atan:i(.5),sin:o(-1e300),sinh:l(1),sinhPf:w(1),cos:c(10.000000000123),cosh:u(1),coshPf:j(1),tan:d(-1e300),tanh:f(1),tanhPf:A(1),exp:p(1),expm1:h(1),expm1Pf:S(1),log1p:m(10),log1pPf:E(10),powPI:g(-100)}}const $Fe="mmMwWLliI0fiflO&1",ck={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function DFe(){return FFe((e,t)=>{const n={},r={};for(const a of Object.keys(ck)){const[i={},o=$Fe]=ck[a],l=e.createElement("span");l.textContent=o,l.style.whiteSpace="nowrap";for(const c of Object.keys(i)){const u=i[c];u!==void 0&&(l.style[c]=u)}n[a]=l,t.append(e.createElement("br"),l)}for(const a of Object.keys(ck))r[a]=n[a].getBoundingClientRect().width;return r})}function FFe(e,t=4e3){return YX((n,r)=>{const a=r.document,i=a.body,o=i.style;o.width=`${t}px`,o.webkitTextSizeAdjust=o.textSizeAdjust="none",Db()?i.style.zoom=`${1/r.devicePixelRatio}`:$l()&&(i.style.zoom="reset");const l=a.createElement("div");return l.textContent=[...Array(t/20<<0)].map(()=>"word").join(" "),i.appendChild(l),e(a,i)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function BFe(){return navigator.pdfViewerEnabled}function UFe(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function zFe(){const{ApplePaySession:e}=window;if(typeof(e==null?void 0:e.canMakePayments)!="function")return-1;if(WFe())return-3;try{return e.canMakePayments()?1:0}catch(t){return qFe(t)}}const WFe=D8e;function qFe(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function VFe(){var e;const t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}const KX=-1,ZX=-2,HFe=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),GFe=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),YFe=["FRAGMENT_SHADER","VERTEX_SHADER"],KFe=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],XX="WEBGL_debug_renderer_info",ZFe="WEBGL_polygon_mode";function XFe({cache:e}){var t,n,r,a,i,o;const l=JX(e);if(!l)return KX;if(!eJ(l))return ZX;const c=QX()?null:l.getExtension(XX);return{version:((t=l.getParameter(l.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=l.getParameter(l.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:c?(r=l.getParameter(c.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((a=l.getParameter(l.RENDERER))===null||a===void 0?void 0:a.toString())||"",rendererUnmasked:c?(i=l.getParameter(c.UNMASKED_RENDERER_WEBGL))===null||i===void 0?void 0:i.toString():"",shadingLanguageVersion:((o=l.getParameter(l.SHADING_LANGUAGE_VERSION))===null||o===void 0?void 0:o.toString())||""}}function JFe({cache:e}){const t=JX(e);if(!t)return KX;if(!eJ(t))return ZX;
703const n=t.getSupportedExtensions(),r=t.getContextAttributes(),a=[],i=[],o=[],l=[],c=[];if(r)for(const d of Object.keys(r))i.push(`${d}=${r[d]}`);const u=f7(t);for(const d of u){const f=t[d];o.push(`${d}=${f}${HFe.has(f)?`=${t.getParameter(f)}`:""}`)}if(n)for(const d of n){if(d===XX&&QX()||d===ZFe&&t7e())continue;const f=t.getExtension(d);if(!f){a.push(d);continue}for(const p of f7(f)){const h=f[p];l.push(`${p}=${h}${GFe.has(h)?`=${t.getParameter(h)}`:""}`)}}for(const d of YFe)for(const f of KFe){const p=QFe(t,d,f);c.push(`${d}.${f}=${p.join(",")}`)}return l.sort(),o.sort(),{contextAttributes:i,parameters:o,shaderPrecisions:c,extensions:n,extensionParameters:l,unsupportedExtensions:a}}function JX(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const r of["webgl","experimental-webgl"]){try{n=t.getContext(r)}catch{}if(n)break}return e.webgl={context:n},n}function QFe(e,t,n){const r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function f7(e){return Object.keys(e.__proto__).filter(e7e)}function e7e(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function QX(){return GX()}function t7e(){return Db()||$l()}function eJ(e){return typeof e.getParameter=="function"}function n7e(){if(!(LR()||$l()))return-2;if(!window.AudioContext)return-1;const t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function r7e(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}const a7e={fonts:U8e,domBlockers:jFe,fontPreferences:DFe,audio:P8e,screenFrame:cFe,canvas:W8e,osCpu:Q8e,languages:eFe,colorDepth:tFe,deviceMemory:nFe,screenResolution:rFe,hardwareConcurrency:uFe,timezone:dFe,sessionStorage:hFe,localStorage:pFe,indexedDB:mFe,openDatabase:gFe,cpuClass:vFe,platform:yFe,plugins:z8e,touchSupport:J8e,vendor:xFe,vendorFlavors:bFe,cookiesEnabled:wFe,colorGamut:kFe,invertedColors:EFe,forcedColors:CFe,monochrome:TFe,contrast:OFe,reducedMotion:RFe,reducedTransparency:IFe,hdr:LFe,math:MFe,pdfViewerEnabled:BFe,architecture:UFe,applePay:zFe,privateClickMeasurement:VFe,audioBaseLatency:n7e,dateTimeLocale:r7e,webGlBasics:XFe,webGlExtensions:JFe};function i7e(e){return w8e(a7e,e,[])}const s7e="$ if upgrade to Pro: https://fpjs.dev/pro";function o7e(e){const t=l7e(e),n=c7e(t);return{score:t,comment:s7e.replace(/\$/g,`${n}`)}}function l7e(e){if(LR())return .4;if($l())return IR()&&!(Bb()&&Fb())?.5:.3;const t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function c7e(e){return VX(.99+.01*e,1e-4)}function u7e(e){let t="";for(const n of Object.keys(e).sort()){const r=e[n],a="error"in r?"error":JSON.stringify(r.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${a}`}return t}function tJ(e){return JSON.stringify(e,(t,n)=>n instanceof Error?v8e(n):n,2)}function nJ(e){return g8e(u7e(e))}function d7e(e){let t;const n=o7e(e);return{get visitorId(){return t===void 0&&(t=nJ(this.components)),t},set visitorId(r){t=r},confidence:n,components:e,version:WX}}function f7e(e=50){return o8e(e,e*2)}function h7e(e,t){const n=Date.now();return{async get(r){const a=Date.now(),i=await e(),o=d7e(i);return(t||r!=null&&r.debug)&&console.log(`Copy the text below to get the debug data:
704
705\`\`\`
706version: ${o.version}
707userAgent: ${navigator.userAgent}
708timeBetweenLoadAndGet: ${a-n}
709visitorId: ${o.visitorId}
710components: ${tJ(i)}
711\`\`\``),o}}}function p7e(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${WX}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}async function m7e(e={}){var t;(!((t=e.monitoring)!==null&&t!==void 0)||t)&&p7e();const{delayFallback:n,debug:r}=e;await f7e(n);const a=i7e({cache:{},debug:r});return h7e(a,r)}var g7e={load:m7e,hashComponents:nJ,componentsToDebugString:tJ};const rJ=()=>{const[e,t]=x.useState(null),[n,r]=x.useState("Unknown Device"),[a,i]=x.useState(!0);return x.useEffect(()=>{(async()=>{try{const c=await(await g7e.load()).get();t(c.visitorId);const u=navigator.userAgent;let d="Browser",f="Device";u.includes("Chrome")&&!u.includes("Edg")?d="Chrome":u.includes("Safari")&&!u.includes("Chrome")?d="Safari":u.includes("Firefox")?d="Firefox":u.includes("Edg")?d="Edge":(u.includes("Opera")||u.includes("OPR"))&&(d="Opera"),u.includes("Windows")?f="Windows":u.includes("Mac")&&!u.includes("iPhone")&&!u.includes("iPad")?f="macOS":u.includes("iPhone")?f="iPhone":u.includes("iPad")?f="iPad":u.includes("Android")?f="Android":u.includes("Linux")?f="Linux":u.includes("CrOS")&&(f="ChromeOS"),r(`${d} on ${f}`)}catch(l){console.error("Failed to generate fingerprint:",l),t(`fallback-${Date.now()}-${Math.random().toString(36).substring(2)}`)}finally{i(!1)}})()},[]),{fingerprint:e,deviceName:n,loading:a}};var v7e=Object.defineProperty,y7e=Object.defineProperties,x7e=Object.getOwnPropertyDescriptors,fj=Object.getOwnPropertySymbols,aJ=Object.prototype.hasOwnProperty,iJ=Object.prototype.propertyIsEnumerable,h7=(e,t,n)=>t in e?v7e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b7e=(e,t)=>{for(var n in t||(t={}
711))aJ.call(t,n)&&h7(e,n,t[n]);if(fj)for(var n of fj(t))iJ.call(t,n)&&h7(e,n,t[n]);return e},w7e=(e,t)=>y7e(e,x7e(t)),_7e=(e,t)=>{var n={};for(var r in e)aJ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fj)for(var r of fj(e))t.indexOf(r)<0&&iJ.call(e,r)&&(n[r]=e[r]);return n};function j7e(e){let t=setTimeout(e,0),n=setTimeout(e,10),r=setTimeout(e,50);return[t,n,r]}function S7e(e){let t=x.useRef();return x.useEffect(()=>{t.current=e}),t.current}var N7e=18,sJ=40,A7e=`${sJ}px`,k7e=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function E7e({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[a,i]=x.useState(!1),[o,l]=x.useState(!1),[c,u]=x.useState(!1),d=x.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&a&&o,[a,o,n]),f=x.useCallback(()=>{let p=e.current,h=t.current;if(!p||!h||c||n==="none")return;let m=p,g=m.getBoundingClientRect().left+m.offsetWidth,v=m.getBoundingClientRect().top+m.offsetHeight/2,y=g-N7e,b=v;document.querySelectorAll(k7e).length===0&&document.elementFromPoint(y,b)===p||(i(!0),u(!0))},[e,t,c,n]);return x.useEffect(()=>{let p=e.current;if(!p||n==="none")return;function h(){let g=window.innerWidth-p.getBoundingClientRect().right;l(g>=sJ)}h();let m=setInterval(h,1e3);return()=>{clearInterval(m)}},[e,n]),x.useEffect(()=>{let p=r||document.activeElement===t.current;if(n==="none"||!p)return;let h=setTimeout(f,0),m=setTimeout(f,2e3),g=setTimeout(f,5e3),v=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(h),clearTimeout(m),clearTimeout(g),clearTimeout(v)}},[t,r,n,f]),{hasPWMBadge:a,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:A7e}}var oJ=x.createContext({}),lJ=x.forwardRef((e,t)=>{var n=e,{value:r,onChange:a,maxLength:i,textAlign:o="left",pattern:l,placeholder:c,inputMode:u="numeric",onComplete:d,pushPasswordManagerStrategy:f="increase-width",pasteTransformer:p,containerClassName:h,noScriptCSSFallback:m=C7e,render:g,children:v}=n,y=_7e(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),b,w,j,S,A;let[E,k]=x.useState(typeof y.defaultValue=="string"?y.defaultValue:""),P=r??E,R=S7e(P),C=x.useCallback(ie=>{a==null||a(ie),k(ie)},[a]),I=x.useMemo(()=>l?typeof l=="string"?new RegExp(l):l:null,[l]),D=x.useRef(null),U=x.useRef(null),q=x.useRef({value:P,onChange:C,isIOS:typeof window<"u"&&((w=(b=window==null?void 0:window.CSS)==null?void 0:b.supports)==null?void 0:w.call(b,"-webkit-touch-callout","none"))}),Z=x.useRef({prev:[(j=D.current)==null?void 0:j.selectionStart,(S=D.current)==null?void 0:S.selectionEnd,(A=D.current)==null?void 0:A.selectionDirection]});x.useImperativeHandle(t,()=>D.current,[]),x.useEffect(()=>{let ie=D.current,F=U.current;if(!ie||!F)return;q.current.value!==ie.value&&q.current.onChange(ie.value),Z.current.prev=[ie.selectionStart,ie.selectionEnd,ie.selectionDirection];function me(){if(document.activeElement!==ie){O(null),B(null);return}let ve=ie.selectionStart,pe=ie.selectionEnd,Pe=ie.selectionDirection,Ee=ie.maxLength,Ie=ie.value,Me=Z.current.prev,tt=-1,De=-1,Qe;if(Ie.length!==0&&ve!==null&&pe!==null){let Fe=ve===pe,It=ve===Ie.length&&Ie.length<Ee;if(Fe&&!It){let zt=ve;if(zt===0)tt=0,De=1,Qe="forward";else if(zt===Ee)tt=zt-1,De=zt,Qe="backward";else if(Ee>1&&Ie.length>1){let Wt=0;if(Me[0]!==null&&Me[1]!==null){Qe=zt<Me[1]?"backward":"forward";let Jt=Me[0]===Me[1]&&Me[0]<Ee;Qe==="backward"&&!Jt&&(Wt=-1)}tt=Wt+zt,De=Wt+zt+1}}tt!==-1&&De!==-1&&tt!==De&&D.current.setSelectionRange(tt,De,Qe)}let vt=tt!==-1?tt:ve,ct=De!==-1?De:pe,ut=Qe??Pe;O(vt),B(ct),Z.current.prev=[vt,ct,ut]}if(document.addEventListener("selectionchange",me,{capture:!0}),me(),document.activeElement===ie&&ee(!0),!document.getElementById("input-otp-style")){let ve=document.createElement("style");if(ve.id="input-otp-style",document.head.appendChild(ve),ve.sheet){let pe="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";qy(ve.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),qy(ve.sheet,`[data-input-otp]:autofill { ${pe} }`),qy(ve.sheet,`[data-input-otp]:-webkit-autofill { ${pe} }
711`),qy(ve.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),qy(ve.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let Ae=()=>{F&&F.style.setProperty("--root-height",`${ie.clientHeight}px`)};Ae();let Ne=new ResizeObserver(Ae);return Ne.observe(ie),()=>{document.removeEventListener("selectionchange",me,{capture:!0}),Ne.disconnect()}},[]);let[H,$]=x.useState(!1),[W,ee]=x.useState(!1),[V,O]=x.useState(null),[M,B]=x.useState(null);x.useEffect(()=>{j7e(()=>{var ie,F,me,Ae;(ie=D.current)==null||ie.dispatchEvent(new Event("input"));let Ne=(F=D.current)==null?void 0:F.selectionStart,ve=(me=D.current)==null?void 0:me.selectionEnd,pe=(Ae=D.current)==null?void 0:Ae.selectionDirection;Ne!==null&&ve!==null&&(O(Ne),B(ve),Z.current.prev=[Ne,ve,pe])})},[P,W]),x.useEffect(()=>{R!==void 0&&P!==R&&R.length<i&&P.length===i&&(d==null||d(P))},[i,d,R,P]);let G=E7e({containerRef:U,inputRef:D,pushPasswordManagerStrategy:f,isFocused:W}),te=x.useCallback(ie=>{let F=ie.currentTarget.value.slice(0,i);if(F.length>0&&I&&!I.test(F)){ie.preventDefault();return}typeof R=="string"&&F.length<R.length&&document.dispatchEvent(new Event("selectionchange")),C(F)},[i,C,R,I]),ne=x.useCallback(()=>{var ie;if(D.current){let F=Math.min(D.current.value.length,i-1),me=D.current.value.length;(ie=D.current)==null||ie.setSelectionRange(F,me),O(F),B(me)}ee(!0)},[i]),ce=x.useCallback(ie=>{var F,me;let Ae=D.current;if(!p&&(!q.current.isIOS||!ie.clipboardData||!Ae))return;let Ne=ie.clipboardData.getData("text/plain"),ve=p?p(Ne):Ne;ie.preventDefault();let pe=(F=D.current)==null?void 0:F.selectionStart,Pe=(me=D.current)==null?void 0:me.selectionEnd,Ee=(pe!==Pe?P.slice(0,pe)+ve+P.slice(Pe):P.slice(0,pe)+ve+P.slice(pe)).slice(0,i);if(Ee.length>0&&I&&!I.test(Ee))return;Ae.value=Ee,C(Ee);let Ie=Math.min(Ee.length,i-1),Me=Ee.length;Ae.setSelectionRange(Ie,Me),O(Ie),B(Me)},[i,C,I,P]),oe=x.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),X=x.useMemo(()=>({position:"absolute",inset:0,width:G.willPushPWMBadge?`calc(100% + ${G.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:G.willPushPWMBadge?`inset(0 ${G.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:o,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[G.PWM_BADGE_SPACE_WIDTH,G.willPushPWMBadge,o]),se=x.useMemo(()=>x.createElement("input",w7e(b7e({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":P.length===0||void 0,"data-input-otp-mss":V,"data-input-otp-mse":M,inputMode:u,pattern:I==null?void 0:I.source,"aria-placeholder":c,style:X,maxLength:i,value:P,ref:D,onPaste:ie=>{var F;ce(ie),(F=y.onPaste)==null||F.call(y,ie)},onChange:te,onMouseOver:ie=>{var F;$(!0),(F=y.onMouseOver)==null||F.call(y,ie)},onMouseLeave:ie=>{var F;$(!1),(F=y.onMouseLeave)==null||F.call(y,ie)},onFocus:ie=>{var F;ne(),(F=y.onFocus)==null||F.call(y,ie)},onBlur:ie=>{var F;ee(!1),(F=y.onBlur)==null||F.call(y,ie)}})),[te,ne,ce,u,X,i,M,V,y,I==null?void 0:I.source,P]),Q=x.useMemo(()=>({slots:Array.from({length:i}).map((ie,F)=>{var me;let Ae=W&&V!==null&&M!==null&&(V===M&&F===V||F>=V&&F<M),Ne=P[F]!==void 0?P[F]:null,ve=P[0]!==void 0?null:(me=c==null?void 0:c[F])!=null?me:null;return{char:Ne,placeholderChar:ve,isActive:Ae,hasFakeCaret:Ae&&Ne===null}}),isFocused:W,isHovering:!y.disabled&&H}),[W,H,i,M,V,y.disabled,P]),ye=x.useMemo(()=>g?g(Q):x.createElement(oJ.Provider,{value:Q},v),[v,Q,g]);return x.createElement(x.Fragment,null,m!==null&&x.createElement("noscript",null,x.createElement("style",null,m)),x.createElement("div",{ref:U,"data-input-otp-container":!0,style:oe,className:h},ye,x.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},se)))});lJ.displayName="Input";function qy(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var C7e=`
712[data-input-otp] {
713  --nojs-bg: white !important;
714  --nojs-fg: black !important;
715
716  background-color: var(--nojs-bg) !important;
717  color: var(--nojs-fg) !important;
718  caret-color: var(--nojs-fg) !important;
719  letter-spacing: .25em !important;
720  text-align: center !important;
721  border: 1px solid var(--nojs-fg) !important;
722  border-radius: 4px !important;
723  width: 100% !important;
724}
725@media (prefers-color-scheme: dark) {
726  [data-input-otp] {
727    --nojs-bg: black !important;
728    --nojs-fg: white !important;
729  }
730}`;const kN=x.forwardRef(({className:e,containerClassName:t,...n},r)=>s.jsx(lJ,{ref:r,containerClassName:Ye("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:Ye("disabled:cursor-not-allowed",e),...n}));kN.displayName="InputOTP";const EN=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ye("flex items-center",e),...t}));EN.displayName="InputOTPGroup";const si=x.forwardRef(({index:e,className:t,...n},r)=>{const a=x.useContext(oJ),{char:i,hasFakeCaret:o,isActive:l}=a.slots[e];return s.jsxs("div",{ref:r,className:Ye("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",l&&"z-10 ring-2 ring-ring ring-offset-background",t),...n,children:[i,o&&s.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:s.jsx("div",{className:"animate-caret-blink h-4 w-px bg-foreground duration-1000"})})]})});si.displayName="InputOTPSlot";const P7e=x.forwardRef(({...e},t)=>s.jsx("div",{ref:t,role:"separator",...e,children:s.jsx(toe,{})}));P7e.displayName="InputOTPSeparator";const T7e=Tv("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Nu=x.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:Ye(T7e({variant:t}),e),...n}));Nu.displayName="Alert";const cJ=x.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Ye("mb-1 font-medium leading-none tracking-tight",e),...t}));cJ.displayName="AlertTitle";const Au=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Ye("text-sm [&_p]:leading-relaxed",e),...t}));Au.displayName="AlertDescription";const O7e=({email:e,fingerprint:t,deviceName:n,onVerified:r,onCancel:a,onResendCode:i,onVerifyCode:o,isNew
730Registration:l=!1,smsEligible:c=!1,maskedPhone:u,initialDeliveryMethod:d="email"})=>{const[f,p]=x.useState(""),[h,m]=x.useState(!1),[g,v]=x.useState(!1),[y,b]=x.useState(null),[w,j]=x.useState(0),[S,A]=x.useState(d);x.useEffect(()=>{if(w>0){const C=setTimeout(()=>j(w-1),1e3);return()=>clearTimeout(C)}},[w]);const E=async()=>{if(f.length!==6){b("Please enter the complete 6-digit code");return}m(!0),b(null);const C=await o(f);m(!1),C.success?r():(b(C.error||"Invalid verification code. Please try again."),p(""))},k=async(C=!1)=>{v(!0),b(null);const I=await i(C);v(!1),I.success?(j(60),p(""),I.deliveryMethod&&A(I.deliveryMethod)):b(I.error||"Failed to resend code. Please try again.")},P=async()=>{await k(S==="email")},R=e.replace(/(.{2})(.*)(@.*)/,"$1***$3");return s.jsx("div",{className:"min-h-screen flex flex-col bg-muted p-4",children:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs(Ve,{className:"w-full max-w-md",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program, Inc.",className:"h-16 w-auto"})}),s.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mb-4",children:s.jsx(Cd,{className:"w-6 h-6 text-primary"})}),s.jsx(jt,{className:"text-2xl font-display",children:l?"Verify Your Device":"New Device Detected"}),s.jsxs(qn,{className:"space-y-2",children:[s.jsx("p",{children:l?"To complete your registration, please verify this device.":"We noticed you're signing in from a new device."}),s.jsx("p",{className:"flex items-center justify-center gap-2 text-sm",children:S==="sms"?s.jsxs(s.Fragment,{children:[s.jsx(W_,{className:"w-4 h-4"}),"Code sent to ",s.jsx("span",{className:"font-medium",children:u||"your phone"})]}):s.jsxs(s.Fragment,{children:[s.jsx(lu,{className:"w-4 h-4"}),"Code sent to ",s.jsx("span",{className:"font-medium",children:R})]})})]})]}),s.jsxs(He,{className:"space-y-6",children:[s.jsxs("div",{className:`rounded-lg p-3 text-center ${S==="sms"?"bg-green-50 border border-green-200":"bg-blue-50 border border-blue-200"}`,children:[s.jsxs("div",{className:"flex items-center justify-center gap-2 mb-1",children:[S==="sms"?s.jsx(vO,{className:"w-4 h-4 text-green-600"}):s.jsx(lu,{className:"w-4 h-4 text-blue-600"}),s.jsx("span",{className:`text-sm font-medium ${S==="sms"?"text-green-700":"text-blue-700"}`,children:S==="sms"?"SMS Verification":"Email Verification"})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Verifying device: ",n]})]}),s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsx(kN,{maxLength:6,value:f,onChange:p,disabled:h,children:s.jsxs(EN,{children:[s.jsx(si,{index:0}),s.jsx(si,{index:1}),s.jsx(si,{index:2}),s.jsx(si,{index:3}),s.jsx(si,{index:4}),s.jsx(si,{index:5})]})}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Enter the 6-digit code from your ",S==="sms"?"text message":"email"]})]}),y&&s.jsx(Nu,{variant:"destructive",children:s.jsx(Au,{children:y})}),s.jsx(we,{onClick:E,className:"w-full",disabled:f.length!==6||h,children:h?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Verifying..."]}):"Verify Device"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(we,{variant:"ghost",onClick:()=>k(S==="sms"),disabled:g||w>0,className:"w-full",children:g?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending..."]}):w>0?s.jsxs(s.Fragment,{children:[s.jsx(of,{className:"w-4 h-4 mr-2"}),"Resend code in ",w,"s"]}):s.jsxs(s.Fragment,{children:[s.jsx(of,{className:"w-4 h-4 mr-2"}),"Resend Code"]})}),c&&s.jsx(we,{variant:"outline",onClick:P,disabled:g||w>0,className:"w-full",children:S==="sms"?s.jsxs(s.Fragment,{children:[s.jsx(lu,{className:"w-4 h-4 mr-2"}),"Send code via Email instead"]}):s.jsxs(s.Fragment,{children:[s.jsx(W_,{className:"w-4 h-4 mr-2"}),"Send code via SMS instead"]})}),s.jsxs(we,{variant:"outline",onClick:a,className:"w-full",children:[s.jsx(Og,{className:"w-4 h-4 mr-2"}),l?"Cancel Registration":"Cancel Sign In"]})]}),s.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"This code expires in 10 minutes. If you didn't request this code, please ignore it and your account will remain secure."})]})]})})})};var uk="rovingFocusGroup.onEntryFocus",R7e={bubbles:!1,cancelable:!0},Ub="RovingFocusGroup",[P4,uJ,I7e]=Pv(Ub),[L7e,CN]=ui(Ub,[I7e]),[M7e,$7e]=L7e(Ub),dJ=x.forwardRef((e,t)=>
vendor: 1,753 bytes, line 730
730s.jsx(P4.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(P4.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(D7e,{...e,ref:t})})}));dJ.displayName=Ub;var D7e=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=x.useRef(null),h=sn(t,p),m=jp(i),[g,v]=vs({prop:o,defaultProp:l??null,onChange:c,caller:Ub}),[y,b]=x.useState(!1),w=Pr(u),j=uJ(n),S=x.useRef(!1),[A,E]=x.useState(0);return x.useEffect(()=>{const k=p.current;if(k)return k.addEventListener(uk,w),()=>k.removeEventListener(uk,w)},[w]),s.jsx(M7e,{scope:n,orientation:r,dir:m,loop:a,currentTabStopId:g,onItemFocus:x.useCallback(k=>v(k),[v]),onItemShiftTab:x.useCallback(()=>b(!0),[]),onFocusableItemAdd:x.useCallback(()=>E(k=>k+1),[]),onFocusableItemRemove:x.useCallback(()=>E(k=>k-1),[]),children:s.jsx(pt.div,{tabIndex:y||A===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:ht(e.onMouseDown,()=>{S.current=!0}),onFocus:ht(e.onFocus,k=>{const P=!S.current;if(k.target===k.currentTarget&&P&&!y){const R=new CustomEvent(uk,R7e);if(k.currentTarget.dispatchEvent(R),!R.defaultPrevented){const C=j().filter(Z=>Z.focusable),I=C.find(Z=>Z.active),D=C.find(Z=>Z.id===g),q=[I,D,...C].filter(Boolean).map(Z=>Z.ref.current);pJ(q,d)}}S.current=!1}),onBlur:ht(e.onBlur,()=>b(!1))})})}),fJ="RovingFocusGroupItem",hJ=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...l}=e,c=Ga(),u=i||c,d=$7e(fJ,n),f=d.currentTabStopId===u,p=uJ(n),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:g}=d;return x.useEffect(()=>{if(r)return h(),()=>m()}
vendor: 4,564 bytes, line 730
730,[r,h,m]),s.jsx(P4.ItemSlot,{scope:n,id:u,focusable:r,active:a,children:s.jsx(pt.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:ht(e.onMouseDown,v=>{r?d.onItemFocus(u):v.preventDefault()}),onFocus:ht(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ht(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=U7e(v,d.orientation,d.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=p().filter(j=>j.focusable).map(j=>j.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const j=w.indexOf(v.currentTarget);w=d.loop?z7e(w,j+1):w.slice(j+1)}setTimeout(()=>pJ(w))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:g!=null}):o})})});hJ.displayName=fJ;var F7e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function B7e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function U7e(e,t,n){const r=B7e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return F7e[r]}function pJ(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function z7e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var mJ=dJ,gJ=hJ,PN="Tabs",[W7e,nQe]=ui(PN,[CN]),vJ=CN(),[q7e,MR]=W7e(PN),yJ=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=jp(l),[f,p]=vs({prop:r,onChange:a,defaultProp:i??"",caller:PN});return s.jsx(q7e,{scope:n,baseId:Ga(),value:f,onValueChange:p,orientation:o,dir:d,activationMode:c,children:s.jsx(pt.div,{dir:d,"data-orientation":o,...u,ref:t})})});yJ.displayName=PN;var xJ="TabsList",bJ=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=MR(xJ,n),o=vJ(n);return s.jsx(mJ,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(pt.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});bJ.displayName=xJ;var wJ="TabsTrigger",_J=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=MR(wJ,n),l=vJ(n),c=NJ(o.baseId,r),u=AJ(o.baseId,r),d=r===o.value;return s.jsx(gJ,{asChild:!0,...l,focusable:!a,active:d,children:s.jsx(pt.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:ht(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:ht(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:ht(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!a&&f&&o.onValueChange(r)})})})});_J.displayName=wJ;var jJ="TabsContent",SJ=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,l=MR(jJ,n),c=NJ(l.baseId,r),u=AJ(l.baseId,r),d=r===l.value,f=x.useRef(d);return x.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),s.jsx(Ka,{present:a||d,children:({present:p})=>s.jsx(pt.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&i})})});SJ.displayName=jJ;function NJ(e,t){return`${e}-trigger-${t}`}function AJ(e,t){return`${e}-content-${t}`}var V7e=yJ,kJ=bJ,EJ=_J,CJ=SJ;const $R=V7e,DR=x.forwardRef(({className:e,...t},n)=>s.jsx(kJ,{ref:n,className:Ye("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));DR.displayName=kJ.displayName;const Qx=x.forwardRef(({className:e,...t},n)=>s.jsx(EJ,{ref:n,className:Ye("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",e),...t}));Qx.displayName=EJ.displayName;const pv=x.forwardRef(({className:e,...t},n)=>s.jsx(CJ,{ref:n,className:Ye("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));pv.displayName=CJ.displayName;
730var TN="Checkbox",[H7e,rQe]=ui(TN),[G7e,FR]=H7e(TN);function Y7e(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[p,h]=vs({prop:n,defaultProp:a??!1,onChange:c,caller:TN}),[m,g]=x.useState(null),[v,y]=x.useState(null),b=x.useRef(!1),w=m?!!o||!!m.closest("form"):!0,j={checked:p,disabled:i,setChecked:h,control:m,setControl:g,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:Yd(a)?!1:a,isFormControl:w,bubbleInput:v,setBubbleInput:y};return s.jsx(G7e,{scope:t,...j,children:K7e(f)?f(j):r})}var PJ="CheckboxTrigger",TJ=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:m}=FR(PJ,e),g=sn(a,d),v=x.useRef(c);return x.useEffect(()=>{const y=i==null?void 0:i.form;if(y){const b=()=>f(v.current);return y.addEventListener("reset",b),()=>y.removeEventListener("reset",b)}},[i,f]),s.jsx(pt.button,{type:"button",role:"checkbox","aria-checked":Yd(c)?"mixed":c,"aria-required":u,"data-state":MJ(c),"data-disabled":l?"":void 0,disabled:l,value:o,...r,ref:g,onKeyDown:ht(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:ht(n,y=>{f(b=>Yd(b)?!0:!b),m&&h&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})});TJ.displayName=PJ;var BR=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return s.jsx(Y7e,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:p})=>s.jsxs(s.Fragment,{children:[s.jsx(TJ,{...f,ref:t,__scopeCheckbox:n}),p&&s.jsx(LJ,{__scopeCheckbox:n})]})})});BR.displayName=TN;var OJ="CheckboxIndicator",RJ=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=FR(OJ,n);return s.jsx(Ka,{present:r||Yd(i.checked)||i.checked===!0,children:s.jsx(pt.span,{"data-state":MJ(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});RJ.displayName=OJ;var IJ="CheckboxBubbleInput",LJ=x.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:h}=FR(IJ,e),m=sn(n,h),g=xS(i),v=kO(r);x.useEffect(()=>{const b=p;if(!b)return;const w=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(w,"checked").set,A=!a.current;if(g!==i&&S){const E=new Event("click",{bubbles:A});b.indeterminate=Yd(i),S.call(b,Yd(i)?!1:i),b.dispatchEvent(E)}},[p,g,i,a]);const y=x.useRef(Yd(i)?!1:i);return s.jsx(pt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??y.current,required:l,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:m,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});LJ.displayName=IJ;function K7e(e){return typeof e=="function"}function Yd(e){return e==="indeterminate"}function MJ(e){return Yd(e)?"indeterminate":e?"checked":"unchecked"}const T4=x.forwardRef(({className:e,...t},n)=>s.jsx(BR,{ref:n,className:Ye("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",e),...t,children:s.jsx(RJ,{className:Ye("flex items-center justify-center text-current"),children:s.jsx(tx,{className:"h-4 w-4"})})}));T4.displayName=BR.displayName;var ar;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of i)o[l]=a[l];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o}
vendor: 5,854 bytes, line 730
730,e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(ar||(ar={}));var p7;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(p7||(p7={}));const Rt=ar.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ud=e=>{switch(typeof e){case"undefined":return Rt.undefined;case"string":return Rt.string;case"number":return Number.isNaN(e)?Rt.nan:Rt.number;case"boolean":return Rt.boolean;case"function":return Rt.function;case"bigint":return Rt.bigint;case"symbol":return Rt.symbol;case"object":return Array.isArray(e)?Rt.array:e===null?Rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Rt.promise:typeof Map<"u"&&e instanceof Map?Rt.map:typeof Set<"u"&&e instanceof Set?Rt.set:typeof Date<"u"&&e instanceof Date?Rt.date:Rt.object;default:return Rt.unknown}},ft=ar.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 mo extends Error{get errors(){return this.issues}constructor(t){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=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let l=r,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return a(this),r}static assert(t){if(!(t instanceof mo))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ar.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}mo.create=e=>new mo(e);const O4=(e,t)=>{let n;switch(e.code){case ft.invalid_type:e.received===Rt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ft.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ar.jsonStringifyReplacer)}`;break;case ft.unrecognized_keys:n=`Unrecognized key(s) in object: ${ar.joinValues(e.keys,", ")}`;break;case ft.invalid_union:n="Invalid input";break;case ft.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ar.joinValues(e.options)}`;break;case ft.invalid_enum_value:n=`Invalid enum value. Expected ${ar.joinValues(e.options)}, received '${e.received}'`;break;case ft.invalid_arguments:n="Invalid function arguments";break;case ft.invalid_return_type:n="Invalid function return type";break;case ft.invalid_date:n="Invalid date";break;case ft.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ar.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ft.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ft.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ft.custom:n="Invalid input";break;case ft.invalid_intersection_types:n="Intersection results could not be merged";break;case ft.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ft.not_finite:n="Number must be finite";break;default:n=t.defaultError,ar.assertNever(e)}return{message:n}};let Z7e=O4;function X7e(){return Z7e}const J7e=e=>
vendor: 17,901 bytes, line 730
730{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...a,path:i,message:l}};function wt(e,t){const n=X7e(),r=J7e({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===O4?void 0:O4].filter(a=>!!a)});e.common.issues.push(r)}class go{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return mn;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,o=await a.value;r.push({key:i,value:o})}return go.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return mn;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const mn=Object.freeze({status:"aborted"}),d0=e=>({status:"dirty",value:e}),el=e=>({status:"valid",value:e}),m7=e=>e.status==="aborted",g7=e=>e.status==="dirty",mv=e=>e.status==="valid",hj=e=>typeof Promise<"u"&&e instanceof Promise;var Bt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Bt||(Bt={}));class df{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}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 v7=(e,t)=>{if(mv(t))return{success:!0,data:t.value};if(!e.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 mo(e.common.issues);return this._error=n,this._error}}};function Ln(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(o,l)=>{const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??r??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??n??l.defaultError}},description:a}}class tr{get description(){return this._def.description}_getType(t){return ud(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ud(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new go,ctx:{common:t.parent.common,data:t.data,parsedType:ud(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(hj(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,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:t,parsedType:ud(t)},a=this._parseSync({data:t,path:r.path,parent:r});return v7(r,a)}"~validate"(t){var r,a;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ud(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return mv(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(a=(r=i==null?void 0:i.message)==null?void 0:r.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>mv(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,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:t,parsedType:ud(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(hj(a)?a:Promise.resolve(a));return v7(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const o=t(a),l=()=>i.addIssue({code:ft.custom,...r(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new yv({schema:this,typeName:yn.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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 Kd.create(this,this._def)}nullable(){return xv.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return gc.create(this)}promise(){return vj.create(this,this._def)}or(t){return mj.create([this,t],this._def)}and(t){return gj.create(this,t,this._def)}transform(t){return new yv({...Ln(this._def),schema:this,typeName:yn.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new I4({...Ln(this._def),innerType:this,defaultValue:n,typeName:yn.ZodDefault})}brand(){return new wBe({typeName:yn.ZodBranded,type:this,...Ln(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new L4({...Ln(this._def),innerType:this,catchValue:n,typeName:yn.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return UR.create(this,t)}readonly(){return M4.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Q7e=/^c[^\s-]{8,}$/i,eBe=/^[0-9a-z]+$/,tBe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,nBe=/^[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,rBe=/^[a-z0-9_-]{21}$/i,aBe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,iBe=/^[-+]?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)?)??$/,sBe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oBe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let dk;const lBe=/^(?:(?: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])$/,cBe=/^(?:(?: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])$/,uBe=/^(([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]))$/,dBe=/^(([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])$/,fBe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hBe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$J="((\\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])))",pBe=new RegExp(`^${$J}$`);function DJ(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function mBe(e){return new RegExp(`^${DJ(e)}$`)}function gBe(e){let t=`${$J}T${DJ(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function vBe(e,t){return!!((t==="v4"||!t)&&lBe.test(e)||(t==="v6"||!t)&&uBe.test(e))}function yBe(e,t){if(!aBe.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function xBe(e,t){return!!((t==="v4"||!t)&&cBe.test(e)||(t==="v6"||!t)&&dBe.test(e))}class Rd extends tr{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Rt.string){const i=this._getOrReturnCtx(t);return wt(i,{code:ft.invalid_type,expected:Rt.string,received:i.parsedType}),mn}const r=new go;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,l=t.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(t,a),o?wt(a,{code:ft.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&wt(a,{code:ft.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")sBe.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"email",code:ft.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")dk||(dk=new RegExp(oBe,"u")),dk.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"emoji",code:ft.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")nBe.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"uuid",code:ft.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")rBe.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"nanoid",code:ft.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Q7e.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"cuid",code:ft.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")eBe.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"cuid2",code:ft.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")tBe.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"ulid",code:ft.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),wt(a,{validation:"url",code:ft.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"regex",code:ft.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?gBe(i).test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?pBe.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?mBe(i).test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?iBe.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"duration",code:ft.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?vBe(t.data,i.version)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"ip",code:ft.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?yBe(t.data,i.alg)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"jwt",code:ft.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?xBe(t.data,i.version)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"cidr",code:ft.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?fBe.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"base64",code:ft.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?hBe.test(t.data)||(a=this._getOrReturnCtx(t,a),wt(a,{validation:"base64url",code:ft.invalid_string,message:i.message}),r.dirty()):ar.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:ft.invalid_string,...Bt.errToObj(r)})}_addCheck(t){return new Rd({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Bt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Bt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Bt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Bt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Bt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Bt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Bt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Bt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Bt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Bt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Bt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Bt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Bt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Bt.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Bt.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Bt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Bt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Bt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Bt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Bt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Bt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Bt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Bt.errToObj(n)})}nonempty(t){return this.min(1,Bt.errToObj(t))}trim(){return new Rd({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rd({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rd({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}
vendor: 4,672 bytes, line 730
730get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Rd.create=e=>new Rd({checks:[],typeName:yn.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ln(e)});function bBe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(e.toFixed(a).replace(".","")),o=Number.parseInt(t.toFixed(a).replace(".",""));return i%o/10**a}class gv extends tr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Rt.number){const i=this._getOrReturnCtx(t);return wt(i,{code:ft.invalid_type,expected:Rt.number,received:i.parsedType}),mn}let r;const a=new go;for(const i of this._def.checks)i.kind==="int"?ar.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),wt(r,{code:ft.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ft.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ft.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?bBe(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ft.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),wt(r,{code:ft.not_finite,message:i.message}),a.dirty()):ar.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Bt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Bt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Bt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Bt.toString(n))}setLimit(t,n,r,a){return new gv({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Bt.toString(a)}]})}_addCheck(t){return new gv({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Bt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Bt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Bt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Bt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Bt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Bt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Bt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Bt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Bt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ar.isInteger(t.value))}get isFinite(){let t=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"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}
vendor: 5,043 bytes, line 730
730}gv.create=e=>new gv({checks:[],typeName:yn.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ln(e)});class eb extends tr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Rt.bigint)return this._getInvalidInput(t);let r;const a=new go;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ft.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ft.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),wt(r,{code:ft.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):ar.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return wt(n,{code:ft.invalid_type,expected:Rt.bigint,received:n.parsedType}),mn}gte(t,n){return this.setLimit("min",t,!0,Bt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Bt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Bt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Bt.toString(n))}setLimit(t,n,r,a){return new eb({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Bt.toString(a)}]})}_addCheck(t){return new eb({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Bt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Bt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Bt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Bt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Bt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}eb.create=e=>new eb({checks:[],typeName:yn.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ln(e)});class y7 extends tr{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Rt.boolean){const r=this._getOrReturnCtx(t);return wt(r,{code:ft.invalid_type,expected:Rt.boolean,received:r.parsedType}),mn}return el(t.data)}}y7.create=e=>new y7({typeName:yn.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ln(e)});class pj extends tr{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Rt.date){const i=this._getOrReturnCtx(t);return wt(i,{code:ft.invalid_type,expected:Rt.date,received:i.parsedType}),mn}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return wt(i,{code:ft.invalid_date}),mn}const r=new go;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),wt(a,{code:ft.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):ar.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new pj({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Bt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Bt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}pj.create=e=>new pj({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:yn.ZodDate,...Ln(e)});class x7 extends tr{_parse(t){if(this._getType(t)!==Rt.symbol){const r=this._getOrReturnCtx(t);return wt(r,{code:ft.invalid_type,expected:Rt.symbol,received:r.parsedType}),mn}return el(t.data)}}x7.create=e=>new x7({typeName:yn.ZodSymbol,...Ln(e)});class b7 extends tr{_parse(t){if(this._getType(t)!==Rt.undefined){const r=this._getOrReturnCtx(t);return wt(r,{code:ft.invalid_type,expected:Rt.undefined,received:r.parsedType}),mn}return el(t.data)}}b7.create=e=>new b7({typeName:yn.ZodUndefined,...Ln(e)});class w7 extends tr{_parse(t){if(this._getType(t)!==Rt.null){const r=this._getOrReturnCtx(t);return wt(r,{code:ft.invalid_type,expected:Rt.null,received:r.parsedType}),mn}return el(t.data)}}w7.create=e=>new w7({typeName:yn.ZodNull,...Ln(e)});class _7 extends tr{constructor(){super(...arguments),this._any=!0}_parse(t){return el(t.data)}}_7.create=e=>new _7({typeName:yn.ZodAny,...Ln(e)});
vendor: 13,418 bytes, line 730
730class j7 extends tr{constructor(){super(...arguments),this._unknown=!0}_parse(t){return el(t.data)}}j7.create=e=>new j7({typeName:yn.ZodUnknown,...Ln(e)});class ff extends tr{_parse(t){const n=this._getOrReturnCtx(t);return wt(n,{code:ft.invalid_type,expected:Rt.never,received:n.parsedType}),mn}}ff.create=e=>new ff({typeName:yn.ZodNever,...Ln(e)});class S7 extends tr{_parse(t){if(this._getType(t)!==Rt.undefined){const r=this._getOrReturnCtx(t);return wt(r,{code:ft.invalid_type,expected:Rt.void,received:r.parsedType}),mn}return el(t.data)}}S7.create=e=>new S7({typeName:yn.ZodVoid,...Ln(e)});class gc extends tr{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Rt.array)return wt(n,{code:ft.invalid_type,expected:Rt.array,received:n.parsedType}),mn;if(a.exactLength!==null){const o=n.data.length>a.exactLength.value,l=n.data.length<a.exactLength.value;(o||l)&&(wt(n,{code:o?ft.too_big:ft.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(wt(n,{code:ft.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(wt(n,{code:ft.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,l)=>a.type._parseAsync(new df(n,o,n.path,l)))).then(o=>go.mergeArray(r,o));const i=[...n.data].map((o,l)=>a.type._parseSync(new df(n,o,n.path,l)));return go.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new gc({...this._def,minLength:{value:t,message:Bt.toString(n)}})}max(t,n){return new gc({...this._def,maxLength:{value:t,message:Bt.toString(n)}})}length(t,n){return new gc({...this._def,exactLength:{value:t,message:Bt.toString(n)}})}nonempty(t){return this.min(1,t)}}gc.create=(e,t)=>new gc({type:e,minLength:null,maxLength:null,exactLength:null,typeName:yn.ZodArray,...Ln(t)});function xm(e){if(e instanceof xa){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Kd.create(xm(r))}return new xa({...e._def,shape:()=>t})}else return e instanceof gc?new gc({...e._def,type:xm(e.element)}):e instanceof Kd?Kd.create(xm(e.unwrap())):e instanceof xv?xv.create(xm(e.unwrap())):e instanceof up?up.create(e.items.map(t=>xm(t))):e}class xa extends tr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ar.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Rt.object){const u=this._getOrReturnCtx(t);return wt(u,{code:ft.invalid_type,expected:Rt.object,received:u.parsedType}),mn}const{status:r,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof ff&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=i[u],f=a.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new df(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof ff){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:a.data[d]}});else if(u==="strict")l.length>0&&(wt(a,{code:ft.unrecognized_keys,keys:l}),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 l){const f=a.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new df(a,f,a.path,d)),alwaysSet:d in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const f=await d.key,p=await d.value;u.push({key:f,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>go.mergeObjectSync(r,u)):go.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Bt.errToObj,new xa({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Bt.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new xa({...this._def,unknownKeys:"strip"})}passthrough(){return new xa({...this._def,unknownKeys:"passthrough"})}extend(t){return new xa({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new xa({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:yn.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new xa({...this._def,catchall:t})}pick(t){const n={};for(const r of ar.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new xa({...this._def,shape:()=>n})}omit(t){const n={};for(const r of ar.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new xa({...this._def,shape:()=>n})}deepPartial(){return xm(this)}partial(t){const n={};for(const r of ar.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new xa({...this._def,shape:()=>n})}required(t){const n={};for(const r of ar.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Kd;)i=i._def.innerType;n[r]=i}return new xa({...this._def,shape:()=>n})}keyof(){return FJ(ar.objectKeys(this.shape))}}xa.create=(e,t)=>new xa({shape:()=>e,unknownKeys:"strip",catchall:ff.create(),typeName:yn.ZodObject,...Ln(t)});xa.strictCreate=(e,t)=>new xa({shape:()=>e,unknownKeys:"strict",catchall:ff.create(),typeName:yn.ZodObject,...Ln(t)});xa.lazycreate=(e,t)=>new xa({shape:e,unknownKeys:"strip",catchall:ff.create(),typeName:yn.ZodObject,...Ln(t)});class mj extends tr{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new mo(l.ctx.common.issues));return wt(n,{code:ft.invalid_union,unionErrors:o}),mn}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._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&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new mo(c));return wt(n,{code:ft.invalid_union,unionErrors:l}),mn}}get options(){return this._def.options}}mj.create=(e,t)=>new mj({options:e,typeName:yn.ZodUnion,...Ln(t)});function R4(e,t){const n=ud(e),r=ud(t);if(e===t)return{valid:!0,data:e};if(n===Rt.object&&r===Rt.object){const a=ar.objectKeys(t),i=ar.objectKeys(e).filter(l=>a.indexOf(l)!==-1),o={...e,...t};for(const l of i){const c=R4(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(n===Rt.array&&r===Rt.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],l=t[i],c=R4(o,l);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return n===Rt.date&&r===Rt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class gj extends tr{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,o)=>{if(m7(i)||m7(o))return mn;const l=R4(i.value,o.value);return l.valid?((g7(i)||g7(o))&&n.dirty(),{status:n.value,value:l.data}):(wt(r,{code:ft.invalid_intersection_types}),mn)};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,o])=>a(i,o)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}gj.create=(e,t,n)=>new gj({left:e,right:t,typeName:yn.ZodIntersection,...Ln(n)});class up extends tr{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Rt.array)return wt(r,{code:ft.invalid_type,expected:Rt.array,received:r.parsedType}),mn;if(r.data.length<this._def.items.length)return wt(r,{code:ft.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),mn;!this._def.rest&&r.data.length>this._def.items.length&&(wt(r,{code:ft.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new df(r,o,r.path,l)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>go.mergeArray(n,o)):go.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new up({...this._def,rest:t})}}up.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new up({items:e,typeName:yn.ZodTuple,rest:null,...Ln(t)})};class N7 extends tr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Rt.map)return wt(r,{code:ft.invalid_type,expected:Rt.map,received:r.parsedType}),mn;const a=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([l,c],u)=>({key:a._parse(new df(r,l,r.path,[u,"key"])),value:i._parse(new df(r,c,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return mn;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return mn;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),l.set(u.value,d.value)}return{status:n.value,value:l}}}}N7.create=(e,t,n)=>new N7({valueType:t,keyType:e,typeName:yn.ZodMap,...Ln(n)});class tb extends tr{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Rt.set)return wt(r,{code:ft.invalid_type,expected:Rt.set,received:r.parsedType}),mn;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(wt(r,{code:ft.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(wt(r,{code:ft.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return mn;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((c,u)=>i._parse(new df(r,c,r.path,u)));return r.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,n){return new tb({...this._def,minSize:{value:t,message:Bt.toString(n)}})}max(t,n){return new tb({...this._def,maxSize:{value:t,message:Bt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}tb.create=(e,t)=>new tb({valueType:e,minSize:null,maxSize:null,typeName:yn.ZodSet,...Ln(t)});class A7 extends tr{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}A7.create=(e,t)=>new A7({getter:e,typeName:yn.ZodLazy,...Ln(t)});class k7 extends tr{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return wt(n,{received:n.data,code:ft.invalid_literal,expected:this._def.value}),mn}return{status:"valid",value:t.data}}get value(){return this._def.value}}k7.create=(e,t)=>new k7({value:e,typeName:yn.ZodLiteral,...Ln(t)});function FJ(e,t){return new vv({values:e,typeName:yn.ZodEnum,...Ln(t)})}class vv extends tr{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return wt(n,{expected:ar.joinValues(r),received:n.parsedType,code:ft.invalid_type}),mn}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return wt(n,{received:n.data,code:ft.invalid_enum_value,options:r}),mn}return el(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return vv.create(t,{...this._def,...n})}exclude(t,n=this._def){return vv.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}vv.create=FJ;class E7 extends tr{_parse(t){const n=ar.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Rt.string&&r.parsedType!==Rt.number){const a=ar.objectValues(n);return wt(r,{expected:ar.joinValues(a),received:r.parsedType,code:ft.invalid_type}),mn}if(this._cache||(this._cache=new Set(ar.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=ar.objectValues(n);return wt(r,{received:r.data,code:ft.invalid_enum_value,options:a}),mn}return el(t.data)}get enum(){return this._def.values}}E7.create=(e,t)=>
vendor: 4,106 bytes, line 730
730new E7({values:e,typeName:yn.ZodNativeEnum,...Ln(t)});class vj extends tr{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Rt.promise&&n.common.async===!1)return wt(n,{code:ft.invalid_type,expected:Rt.promise,received:n.parsedType}),mn;const r=n.parsedType===Rt.promise?n.data:Promise.resolve(n.data);return el(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}vj.create=(e,t)=>new vj({type:e,typeName:yn.ZodPromise,...Ln(t)});class yv extends tr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===yn.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{wt(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async l=>{if(n.value==="aborted")return mn;const c=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return c.status==="aborted"?mn:c.status==="dirty"||n.value==="dirty"?d0(c.value):c});{if(n.value==="aborted")return mn;const l=this._def.schema._parseSync({data:o,path:r.path,parent:r});return l.status==="aborted"?mn:l.status==="dirty"||n.value==="dirty"?d0(l.value):l}}if(a.type==="refinement"){const o=l=>{const c=a.refinement(l,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?mn:(l.status==="dirty"&&n.dirty(),o(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?mn:(l.status==="dirty"&&n.dirty(),o(l.value).then(()=>({status:n.value,value:l.value}))))}if(a.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!mv(o))return mn;const l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>mv(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:n.value,value:l})):mn);ar.assertNever(a)}}yv.create=(e,t,n)=>new yv({schema:e,typeName:yn.ZodEffects,effect:t,...Ln(n)});yv.createWithPreprocess=(e,t,n)=>new yv({schema:t,effect:{type:"preprocess",transform:e},typeName:yn.ZodEffects,...Ln(n)});class Kd extends tr{_parse(t){return this._getType(t)===Rt.undefined?el(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Kd.create=(e,t)=>new Kd({innerType:e,typeName:yn.ZodOptional,...Ln(t)});class xv extends tr{_parse(t){return this._getType(t)===Rt.null?el(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}xv.create=(e,t)=>new xv({innerType:e,typeName:yn.ZodNullable,...Ln(t)});class I4 extends tr{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}I4.create=(e,t)=>new I4({innerType:e,typeName:yn.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ln(t)});class L4 extends tr{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return hj(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new mo(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new mo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}L4.create=(e,t)=>
730new L4({innerType:e,typeName:yn.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ln(t)});class C7 extends tr{_parse(t){if(this._getType(t)!==Rt.nan){const r=this._getOrReturnCtx(t);return wt(r,{code:ft.invalid_type,expected:Rt.nan,received:r.parsedType}),mn}return{status:"valid",value:t.data}}}C7.create=e=>new C7({typeName:yn.ZodNaN,...Ln(e)});class wBe extends tr{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class UR extends tr{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);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"?mn:i.status==="dirty"?(n.dirty(),d0(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?mn:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new UR({in:t,out:n,typeName:yn.ZodPipeline})}}class M4 extends tr{_parse(t){const n=this._def.innerType._parse(t),r=a=>(mv(a)&&(a.value=Object.freeze(a.value)),a);return hj(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}M4.create=(e,t)=>new M4({innerType:e,typeName:yn.ZodReadonly,...Ln(t)});xa.lazycreate;var yn;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(yn||(yn={}));const Pp=Rd.create,_Be=gv.create;ff.create;gc.create;const jBe=xa.create;xa.strictCreate;mj.create;gj.create;up.create;vv.create;vj.create;Kd.create;xv.create;const SBe=Pp().email("Please enter a valid email address"),NBe=Pp().min(12,"Password must be at least 12 characters").regex(/[A-Z]/,"Must contain at least one uppercase letter").regex(/[a-z]/,"Must contain at least one lowercase letter").regex(/[0-9]/,"Must contain at least one number").regex(/[!@#$%^&*(),.?":{}|<>]/,"Must contain at least one special character");Pp().min(2,"First name must be at least 2 characters").max(50,"First name must be less than 50 characters");Pp().min(2,"Last name must be at least 2 characters").max(50,"Last name must be less than 50 characters");const ABe=()=>{const[e,t]=x.useState(""),[n,r]=x.useState(""),[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(""),[d,f]=x.useState(""),[p,h]=x.useState(!1),[m,g]=x.useState(!1),[v,y]=x.useState(!1);x.useState(!1);const[b,w]=x.useState({}),[j,S]=x.useState("credentials"),[A,E]=x.useState(null),[k,P]=x.useState(!1),[R,C]=x.useState(!1),[I,D]=x.useState(null),[U,q]=x.useState("email"),[Z,H]=x.useState(null),[$,W]=x.useState(!1),ee=Ne=>!!Ne&&Ne.toLowerCase().includes("email not confirmed"),V=async()=>{if(!Z)return;W(!0);const{error:Ne}=await Re.auth.resend({type:"signup",email:Z,options:{emailRedirectTo:`${window.location.origin}/portal`}});if(W(!1),Ne){X({title:"Could not resend email",description:Ne.message.toLowerCase().includes("rate")?"Please wait a few minutes before requesting another confirmation email.":Ne.message,variant:"destructive"});return}X({title:"Confirmation email sent",description:`We sent a new confirmation link to ${Z}.`})},{signIn:O,signUp:M,user:B,loading:G}=bi(),{fingerprint:te,deviceName:ne,loading:ce}=rJ(),oe=di(),{toast:X}=_c();x.useEffect(()=>{!G&&B&&j==="credentials"&&oe("/portal")},[B,G,oe,j]);const se=Ne=>{const ve={};try{SBe.parse(e)}catch(pe){pe instanceof mo&&(ve.email=pe.errors[0].message)}try{NBe.parse(n)}catch(pe){pe instanceof mo&&(ve.password=pe.errors[0].message)}return w(ve),Object.keys(ve).length===0},Q=async Ne=>{if(Ne.preventDefault(),!se())return;g(!0);try{if((await(await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/auth-safeguards",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"check-login-lockout",email:e.toLowerCase()})})).json()).locked){g(!1),X({title:"Account temporarily locked",description:"Too many failed login attempts. Please reset your password or try again later.",variant:"destructive"});return}}catch{}const{error:ve}=await O(e,n);if(ve){try{if((await(await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/auth-safeguards",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"log-login-failure",email:e.toLowerCase()})})).json()).locked){g(!1),X({title:"Account temporarily locked",description:"Too many failed login attempts. Please reset your password or try again later.",variant:"destructive"});return}}catch{}if(g(!1),ee(ve.message)){H(e.trim().toLowerCase()),X({title:"Please confirm your email",description:"Check your inbox for the confirmation link 
730we sent you. You can resend it below.",variant:"destructive"});return}const pe=ve.message==="Invalid login credentials"?"Invalid email or password. Please try again.":ve.message;X({title:"Sign in failed",description:pe,variant:"destructive"});return}try{await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/auth-safeguards",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear-login-failures",email:e.toLowerCase()})})}catch{}g(!1),X({title:"Welcome back!",description:"You have successfully signed in."}),oe("/portal")},ye=async Ne=>{if(!te)return{success:!1,error:"Device fingerprint not available"};const{data:ve,error:pe}=await Re.functions.invoke("device-auth",{body:{action:"verify-code",userId:A,email:e,code:Ne,fingerprint:te,deviceName:ne}});return pe?{success:!1,error:"Verification failed. Please try again."}:ve},ie=async Ne=>{if(!te)return{success:!1,error:"Device fingerprint not available"};const{data:ve,error:pe}=await Re.functions.invoke("device-auth",{body:{action:"send-code",userId:A,email:e,phone:I,fingerprint:te,deviceName:ne,preferSms:Ne}});return pe?{success:!1,error:"Failed to resend code. Please try again."}:ve},F=async()=>{if(A&&p&&I){const{data:Ne}=await Re.from("profiles").select("phone_verified").eq("user_id",A).single();if(!(Ne!=null&&Ne.phone_verified)){X({title:k?"Device Verified!":"Welcome back!",description:"Please verify your phone number to continue."}),oe("/portal/verify-phone");return}}X({title:k?"Device Verified!":"Welcome back!",description:k?"Your device is now trusted. Welcome to STAR Application Portal.":"Your device is now trusted. You have successfully signed in."}),oe("/portal")},me=async()=>{await Re.auth.signOut(),S("credentials"),E(null),t(""),r(""),i(""),l(""),u(""),f(""),h(!1)};if(G)return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted",children:s.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})});const Ae=()=>I?`***-***-${I.slice(-4)}`:void 0;return j==="device-verification"?s.jsx(O7e,{email:e,fingerprint:te||"",deviceName:ne,onVerified:F,onCancel:me,onResendCode:ie,onVerifyCode:ye,isNewRegistration:k,smsEligible:R,maskedPhone:Ae(),initialDeliveryMethod:U}):s.jsxs("div",{className:"min-h-screen flex flex-col bg-muted p-4",children:[s.jsx("div",{className:"w-full max-w-md mx-auto mb-4",children:s.jsx(an,{to:"/",children:s.jsxs(we,{variant:"ghost",size:"sm",className:"gap-2",children:[s.jsx(fc,{className:"w-4 h-4"}),"Back to Home"]})})}),s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs(Ve,{className:"w-full max-w-md",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program, Inc.",className:"h-16 w-auto"})}),s.jsx(jt,{className:"text-2xl font-display",children:"Application Portal"}),s.jsx(qn,{children:"Sign in to manage your sponsorship application"})]}),s.jsxs(He,{children:[Z&&s.jsxs("div",{className:"mb-6 rounded-lg border border-primary/30 bg-primary/5 p-4 space-y-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Confirm your email address"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["We sent a confirmation link to ",s.jsx("span",{className:"font-medium",children:Z}),". Click the link in that email, then sign in below. Be sure to check your spam or junk folder."]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(we,{type:"button",variant:"outline",size:"sm",onClick:V,disabled:$,children:$?"Sending...":"Resend confirmation email"}),s.jsx(we,{type:"button",variant:"ghost",size:"sm",onClick:()=>H(null),children:"Dismiss"})]})]}),s.jsxs($R,{defaultValue:"signin",className:"w-full",children:[s.jsx("div",{className:"mb-6 rounded-lg border border-primary/30 bg-primary/5 p-4 text-sm text-muted-foreground text-center",children:"Applications for the 2026-2027 school year are closed. Existing families may still sign in below."}),JF,s.jsx(pv,{value:"signin",children:s.jsxs("form",{onSubmit:Q,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"signin-email",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(lu,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),s.jsx(xt,{id:"signin-email",type:"email",placeholder:"[email protected]",value:e,onCh
730ange:Ne=>t(Ne.target.value),className:"pl-10"})]}),b.email&&s.jsx("p",{className:"text-sm text-destructive",children:b.email})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"signin-password",children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(Mg,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),s.jsx(xt,{id:"signin-password",type:v?"text":"password",placeholder:"••••••••",value:n,onChange:Ne=>r(Ne.target.value),className:"pl-10 pr-10"}),s.jsx("button",{type:"button",onClick:()=>y(!v),className:"absolute right-3 top-3 text-muted-foreground hover:text-foreground",children:v?s.jsx(nx,{className:"h-4 w-4"}):s.jsx($s,{className:"h-4 w-4"})})]}),b.password&&s.jsx("p",{className:"text-sm text-destructive",children:b.password})]}),s.jsx("div",{className:"flex items-center justify-between text-sm",children:s.jsx(an,{to:"/portal/forgot-password",className:"text-primary hover:underline",children:"Forgot Password?"})}),s.jsx(we,{type:"submit",className:"w-full",disabled:m||ce,children:m?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Signing in..."]}):ce?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Preparing..."]}):"Sign In"})]})}),JF]}),s.jsx("div",{className:"mt-6 pt-4 border-t border-border",children:s.jsx(an,{to:"/admin-login",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Admin Login →"})})]})]})})]})},kBe=()=>{const{userRole:e,profile:t,loading:n}=bi();return n?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted",children:s.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})}):e==="admin"?s.jsx(Bo,{to:"/portal/admin",replace:!0}):(t==null?void 0:t.applicant_type)===null||(t==null?void 0:t.applicant_type)===void 0?s.jsx(Bo,{to:"/portal/onboarding",replace:!0}):t.applicant_type==="new"&&t.referral_status!=="approved"?s.jsx(Bo,{to:"/portal/referral",replace:!0}):s.jsx(Bo,{to:"/portal/family",replace:!0})},EBe=()=>{const{user:e,profile:t,refreshProfile:n,loading:r}=bi(),a=di(),{toast:i}=_c(),[o,l]=x.useState(!1),c=d=>(d==null?void 0:d.applicant_type)==="returning"?(a("/portal/family",{replace:!0}),!0):(d==null?void 0:d.applicant_type)==="new"?(a(d.referral_status==="approved"?"/portal/family":"/portal/referral",{replace:!0}),!0):!1;if(x.useEffect(()=>{r||c(t)},[t,r,a]),x.useEffect(()=>{if(r||!e||t!=null&&t.applicant_type)return;let d=!0;return l(!0),Re.functions.invoke("family-profile",{body:{action:"get-profile"}}).then(({data:f,error:p})=>{if(d){if(p){console.error("Error loading profile from backend:",p);return}c((f==null?void 0:f.profile)??null)}}).finally(()=>{d&&l(!1)}),()=>{d=!1}},[e,t==null?void 0:t.applicant_type,r,a]),r||o||t!=null&&t.applicant_type)return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted",children:s.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})});const u=async d=>{if(!e)return;l(!0);const{error:f}=await Re.functions.invoke("family-profile",{body:{applicantType:d}});if(f){console.error("Error updating profile:",f),i({title:"Error",description:"Failed to save your selection. Please try again.",variant:"destructive"}),l(!1);return}await n(),l(!1),d==="returning"?(i({title:"Welcome back!",description:"You can now access the full application."}),a("/portal/family")):(i({title:"Welcome!",description:"Please upload your referral form to continue."}),a("/portal/referral"))};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted p-4",children:s.jsxs("div",{className:"w-full max-w-2xl",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program, Inc.",className:"h-16 w-auto"})}),s.jsx("h1",{className:"text-2xl font-display font-semibold text-foreground",children:"Welcome to the Application Portal"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Please tell us about your family to get started."})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[s.jsxs(Ve,{className:"cursor-pointer transition-all hover:shadow-lg hover:border-primary",onClick:()=>!o&&u("returning"),children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"mx-auto p-4 rounded-full bg-primary/10 w-fit mb-2",children:s.jsx(Zr,{className:"w-8 h-8 text-primary"})}),s.jsx(jt,{children:"Returning Family"}
730),s.jsx(qn,{children:"We've participated in STAR Sponsorship before"})]}),s.jsxs(He,{className:"text-center",children:[s.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2 mb-6",children:[s.jsx("li",{children:"✓ Immediate access to application"}),s.jsx("li",{children:"✓ No referral required"}),s.jsx("li",{children:"✓ Streamlined process"})]}),s.jsx(we,{className:"w-full",disabled:o,onClick:d=>{d.stopPropagation(),u("returning")},children:o?"Please wait...":"I'm a Returning Family"})]})]}),s.jsxs(Ve,{className:"cursor-pointer transition-all hover:shadow-lg hover:border-secondary",onClick:()=>!o&&u("new"),children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"mx-auto p-4 rounded-full bg-secondary/10 w-fit mb-2",children:s.jsx(Qh,{className:"w-8 h-8 text-secondary"})}),s.jsx(jt,{children:"New Family"}),s.jsx(qn,{children:"This is our first time applying for sponsorship"})]}),s.jsxs(He,{className:"text-center",children:[s.jsxs("ul",{className:"text-sm text-muted-foreground space-y-2 mb-6",children:[s.jsx("li",{children:"✓ Welcome to STAR!"}),s.jsx("li",{children:"✓ Upload referral form first"}),s.jsx("li",{children:"✓ Full application after approval"})]}),s.jsx(we,{variant:"secondary",className:"w-full",disabled:o,onClick:d=>{d.stopPropagation(),u("new")},children:o?"Please wait...":"I'm a New Family"})]})]})]})]})})},so=({children:e})=>{var v;const{user:t,userRole:n,signOut:r}=bi(),a=Ko(),i=di(),[o,l]=x.useState(!1),[c,u]=x.useState(null);x.useEffect(()=>{(async()=>{if(!t||n==="admin")return;const{data:b}=await Re.from("applications").select("id").eq("user_id",t.id).order("created_at",{ascending:!1}).limit(1).maybeSingle();b&&u(b.id)})()},[t,n]);const d=async()=>{await r(),i("/portal/auth")},f=c?`/portal/application/${c}`:"/portal/family",m=n==="admin"?[{label:"Overview",path:"/portal/admin",icon:fc},{label:"Referrals",path:"/portal/admin/referrals",icon:mO},{label:"Applications",path:"/portal/admin/applications",icon:En},{label:"Documents",path:"/portal/admin/documents",icon:pO},{label:"Interviews",path:"/portal/admin/interviews",icon:yi},{label:"Messages",path:"/portal/admin/notifications",icon:ex}]:[{label:"Dashboard",path:"/portal/family",icon:fc},{label:"Application",path:f,icon:En}],g=y=>y==="/portal/admin"||y==="/portal/family"?a.pathname===y:y.startsWith("/portal/application")?a.pathname.startsWith("/portal/application"):a.pathname.startsWith(y);return s.jsxs("div",{className:"min-h-screen bg-muted/50",children:[s.jsxs("header",{className:"bg-background border-b border-border/60 sticky top-0 z-50 shadow-sm",children:[s.jsx("div",{className:"container mx-auto px-4 lg:px-6",children:s.jsxs("div",{className:"flex items-center justify-between h-16",children:[s.jsxs(an,{to:n==="admin"?"/portal/admin":"/portal/family",className:"flex items-center gap-2 group",children:[s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program, Inc.",className:"h-10 w-auto transition-transform group-hover:scale-105"}),s.jsx("div",{className:"hidden sm:flex flex-col",children:s.jsx("span",{className:"text-[10px] text-muted-foreground leading-none",children:"Application Portal"})})]}),s.jsx("nav",{className:"hidden lg:flex items-center gap-1 bg-muted/50 rounded-lg p-1",children:m.map(y=>{const b=y.icon,w=g(y.path);return s.jsxs(an,{to:y.path,className:Ye("portal-nav-tab",w?"portal-nav-tab-active":"portal-nav-tab-inactive"),children:[s.jsx(b,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden xl:inline",children:y.label})]},y.path)})}),s.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-sm font-medium text-foreground leading-none",children:n==="admin"?"Administrator":"Family Portal"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate max-w-[180px]",children:t==null?void 0:t.email})]}),s.jsxs(we,{variant:"outline",size:"sm",onClick:d,className:"gap-2",children:[s.jsx(Uh,{className:"w-4 h-4"}),s.jsx("span",{className:"hidden lg:inline",children:"Sign Out"})]})]}),s.jsx("button",{className:"lg:hidden p-2 rounded-lg hover:bg-muted transition-colors",onClick:()=>l(!o),"aria-label":"Toggle menu",children:o?s.jsx(yf,{className:"w-6 h-6"}):s.jsx(gO,{className:"w-6 h-6"})})]})}),o&&s.jsx("div",{className:"lg:hidden border-t bg-background animate-fade-in",children:s.jsxs("nav",{className:"container mx-auto px-4 py-3",children:[s.jsx("div",{className:"space-y-1",children:m.map(y=>{const b=y.icon,w=g(y.path);return s.jsxs(an,{to:y.path,className:Ye("flex items-center justify-between py-3 px-4 roun
730ded-lg transition-colors",w?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"),onClick:()=>l(!1),children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(b,{className:"w-5 h-5"}),s.jsx("span",{className:"font-medium",children:y.label})]}),s.jsx(Ho,{className:Ye("w-4 h-4",w?"opacity-100":"opacity-40")})]},y.path)})}),s.jsxs("div",{className:"mt-4 pt-4 border-t",children:[s.jsxs("div",{className:"px-4 mb-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:n==="admin"?"Administrator":"Family Portal"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t==null?void 0:t.email})]}),s.jsxs(we,{variant:"outline",size:"sm",onClick:d,className:"w-full justify-center gap-2",children:[s.jsx(Uh,{className:"w-4 h-4"}),"Sign Out"]})]})]})})]}),s.jsx("div",{className:"lg:hidden bg-background border-b px-4 py-2",children:s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:n==="admin"?"Admin":"Family"}),s.jsx(Ho,{className:"w-3 h-3 text-muted-foreground"}),s.jsx("span",{className:"font-medium text-foreground",children:((v=m.find(y=>g(y.path)))==null?void 0:v.label)||"Dashboard"})]})}),s.jsx("main",{className:"container mx-auto px-4 lg:px-6 py-6 lg:py-8",children:s.jsx("div",{className:"animate-fade-in",children:e})}),s.jsx("footer",{className:"bg-background border-t mt-auto py-4",children:s.jsx("div",{className:"container mx-auto px-4 lg:px-6",children:s.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["© ",new Date().getFullYear()," STAR Sponsorship Program. All rights reserved."]})})})]})};function $4(e,[t,n]){return Math.min(n,Math.max(t,e))}var CBe=[" ","Enter","ArrowUp","ArrowDown"],PBe=[" ","Enter"],dp="Select",[ON,RN,TBe]=Pv(dp),[Jv,aQe]=ui(dp,[TBe,Lv]),IN=Lv(),[OBe,kf]=Jv(dp),[RBe,IBe]=Jv(dp),BJ=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:m}=e,g=IN(t),[v,y]=x.useState(null),[b,w]=x.useState(null),[j,S]=x.useState(!1),A=jp(u),[E,k]=vs({prop:r,defaultProp:a??!1,onChange:i,caller:dp}),[P,R]=vs({prop:o,defaultProp:l,onChange:c,caller:dp}),C=x.useRef(null),I=v?m||!!v.closest("form"):!0,[D,U]=x.useState(new Set),q=Array.from(D).map(Z=>Z.props.value).join(";");return s.jsx(PO,{...g,children:s.jsxs(OBe,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:j,onValueNodeHasChildrenChange:S,contentId:Ga(),value:P,onValueChange:R,open:E,onOpenChange:k,dir:A,triggerPointerDownPosRef:C,disabled:p,children:[s.jsx(ON.Provider,{scope:t,children:s.jsx(RBe,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(Z=>{U(H=>new Set(H).add(Z))},[]),onNativeOptionRemove:x.useCallback(Z=>{U(H=>{const $=new Set(H);return $.delete(Z),$})},[]),children:n})}),I?s.jsxs(uQ,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:P,onChange:Z=>R(Z.target.value),disabled:p,form:m,children:[P===void 0?s.jsx("option",{value:""}):null,Array.from(D)]},q):null]})})};BJ.displayName=dp;var UJ="SelectTrigger",zJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=IN(n),o=kf(UJ,n),l=o.disabled||r,c=sn(t,o.onTriggerChange),u=RN(n),d=x.useRef("touch"),[f,p,h]=fQ(g=>{const v=u().filter(w=>!w.disabled),y=v.find(w=>w.value===o.value),b=hQ(v,g,y);b!==void 0&&o.onValueChange(b.value)}),m=g=>{l||(o.onOpenChange(!0),h()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return s.jsx(lS,{asChild:!0,...i,children:s.jsx(pt.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":dQ(o.value)?"":void 0,...a,ref:c,onClick:ht(a.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&m(g)}),onPointerDown:ht(a.onPointerDown,g=>{d.current=g.pointerType;const v=g.target;v.hasPointerCapture(g.pointerId)&&v.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(m(g),g.preventDefault())}),onKeyDown:ht(a.onKeyDown,g=>{const v=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(v&&g.key===" ")&&CBe.includes(g.key)&&(m(),g.preventDefault())})})})});zJ.displayName=UJ;var WJ="SelectValue",qJ=x.forwardRef((e,t)=>
vendor: 15,569 bytes, line 730
730{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...l}=e,c=kf(WJ,n),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,f=sn(t,c.onValueNodeChange);return Xr(()=>{u(d)},[u,d]),s.jsx(pt.span,{...l,ref:f,style:{pointerEvents:"none"},children:dQ(c.value)?s.jsx(s.Fragment,{children:o}):i})});qJ.displayName=WJ;var LBe="SelectIcon",VJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(pt.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});VJ.displayName=LBe;var MBe="SelectPortal",HJ=e=>s.jsx(_b,{asChild:!0,...e});HJ.displayName=MBe;var fp="SelectContent",GJ=x.forwardRef((e,t)=>{const n=kf(fp,e.__scopeSelect),[r,a]=x.useState();if(Xr(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?wp.createPortal(s.jsx(YJ,{scope:e.__scopeSelect,children:s.jsx(ON.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(KJ,{...e,ref:t})});GJ.displayName=fp;var hl=10,[YJ,Ef]=Jv(fp),$Be="SelectContentImpl",DBe=Jh("SelectContent.RemoveScroll"),KJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:v,...y}=e,b=kf(fp,n),[w,j]=x.useState(null),[S,A]=x.useState(null),E=sn(t,ne=>j(ne)),[k,P]=x.useState(null),[R,C]=x.useState(null),I=RN(n),[D,U]=x.useState(!1),q=x.useRef(!1);x.useEffect(()=>{if(w)return mR(w)},[w]),pR();const Z=x.useCallback(ne=>{const[ce,...oe]=I().map(Q=>Q.ref.current),[X]=oe.slice(-1),se=document.activeElement;for(const Q of ne)if(Q===se||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===ce&&S&&(S.scrollTop=0),Q===X&&S&&(S.scrollTop=S.scrollHeight),Q==null||Q.focus(),document.activeElement!==se))return},[I,S]),H=x.useCallback(()=>Z([k,w]),[Z,k,w]);x.useEffect(()=>{D&&H()},[D,H]);const{onOpenChange:$,triggerPointerDownPosRef:W}=b;x.useEffect(()=>{if(w){let ne={x:0,y:0};const ce=X=>{var se,Q;ne={x:Math.abs(Math.round(X.pageX)-(((se=W.current)==null?void 0:se.x)??0)),y:Math.abs(Math.round(X.pageY)-(((Q=W.current)==null?void 0:Q.y)??0))}},oe=X=>{ne.x<=10&&ne.y<=10?X.preventDefault():w.contains(X.target)||$(!1),document.removeEventListener("pointermove",ce),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",oe,{capture:!0})}}},[w,$,W]),x.useEffect(()=>{const ne=()=>$(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[$]);const[ee,V]=fQ(ne=>{const ce=I().filter(se=>!se.disabled),oe=ce.find(se=>se.ref.current===document.activeElement),X=hQ(ce,ne,oe);X&&setTimeout(()=>X.ref.current.focus())}),O=x.useCallback((ne,ce,oe)=>{const X=!q.current&&!oe;(b.value!==void 0&&b.value===ce||X)&&(P(ne),X&&(q.current=!0))},[b.value]),M=x.useCallback(()=>w==null?void 0:w.focus(),[w]),B=x.useCallback((ne,ce,oe)=>{const X=!q.current&&!oe;(b.value!==void 0&&b.value===ce||X)&&C(ne)},[b.value]),G=r==="popper"?D4:ZJ,te=G===D4?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:g,avoidCollisions:v}:{};return s.jsx(YJ,{scope:n,content:w,viewport:S,onViewportChange:A,itemRefCallback:O,selectedItem:k,onItemLeave:M,itemTextRefCallback:B,focusSelectedItem:H,selectedItemText:R,position:r,isPositioned:D,searchRef:ee,children:s.jsx(bN,{as:DBe,allowPinchZoom:!0,children:s.jsx(yN,{asChild:!0,trapped:b.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:ht(a,ne=>{var ce;(ce=b.trigger)==null||ce.focus({preventScroll:!0}),ne.preventDefault()}),children:s.jsx(_p,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:s.jsx(G,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:ne=>ne.preventDefault(),...y,...te,onPlaced:()=>U(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ht(y.onKeyDown,ne=>{const ce=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!ce&&ne.key.length===1&&V(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let X=I().filter(se=>!se.disabled).map(se=>se.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const se=ne.target,Q=X.indexOf(se);X=X.slice(Q+1)}setTimeout(()=>Z(X)),ne.preventDefault()}})})})})})})});KJ.displayName=$Be;var FBe="SelectItemAlignedPosition",ZJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=kf(fp,n),o=Ef(fp,n),[l,c]=x.useState(null),[u,d]=x.useState(null),f=sn(t,E=>d(E)),p=RN(n),h=x.useRef(!1),m=x.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,w=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&g&&v&&y){const E=i.trigger.getBoundingClientRect(),k=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),R=y.getBoundingClientRect();if(i.dir!=="rtl"){const se=R.left-k.left,Q=P.left-se,ye=E.left-Q,ie=E.width+ye,F=Math.max(ie,k.width),me=window.innerWidth-hl,Ae=$4(Q,[hl,Math.max(hl,me-F)]);l.style.minWidth=ie+"px",l.style.left=Ae+"px"}else{const se=k.right-R.right,Q=window.innerWidth-P.right-se,ye=window.innerWidth-E.right-Q,ie=E.width+ye,F=Math.max(ie,k.width),me=window.innerWidth-hl,Ae=$4(Q,[hl,Math.max(hl,me-F)]);l.style.minWidth=ie+"px",l.style.right=Ae+"px"}const C=p(),I=window.innerHeight-hl*2,D=g.scrollHeight,U=window.getComputedStyle(u),q=parseInt(U.borderTopWidth,10),Z=parseInt(U.paddingTop,10),H=parseInt(U.borderBottomWidth,10),$=parseInt(U.paddingBottom,10),W=q+Z+D+$+H,ee=Math.min(v.offsetHeight*5,W),V=window.getComputedStyle(g),O=parseInt(V.paddingTop,10),M=parseInt(V.paddingBottom,10),B=E.top+E.height/2-hl,G=I-B,te=v.offsetHeight/2,ne=v.offsetTop+te,ce=q+Z+ne,oe=W-ce;if(ce<=B){const se=C.length>0&&v===C[C.length-1].ref.current;l.style.bottom="0px";const Q=u.clientHeight-g.offsetTop-g.offsetHeight,ye=Math.max(G,te+(se?M:0)+Q+H),ie=ce+ye;l.style.height=ie+"px"}else{const se=C.length>0&&v===C[0].ref.current;l.style.top="0px";const ye=Math.max(B,q+g.offsetTop+(se?O:0)+te)+oe;l.style.height=ye+"px",g.scrollTop=ce-B+g.offsetTop}l.style.margin=`${hl}px 0`,l.style.minHeight=ee+"px",l.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,l,u,g,v,y,i.dir,r]);Xr(()=>w(),[w]);const[j,S]=x.useState();Xr(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const A=x.useCallback(E=>{E&&m.current===!0&&(w(),b==null||b(),m.current=!1)},[w,b]);return s.jsx(UBe,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:A,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:s.jsx(pt.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});ZJ.displayName=FBe;var BBe="SelectPopperPosition",D4=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=hl,...i}=e,o=IN(n);return s.jsx(TO,{...o,...i,ref:t,align:r,collisionPadding:a,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)"}})});D4.displayName=BBe;var[UBe,zR]=Jv(fp,{}),F4="SelectViewport",XJ=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Ef(F4,n),o=zR(F4,n),l=sn(t,i.onViewportChange),c=x.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(ON.Slot,{scope:n,children:s.jsx(pt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ht(a.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&f){const h=Math.abs(c.current-d.scrollTop);if(h>0){const m=window.innerHeight-hl*2,g=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),y=Math.max(g,v);if(y<m){const b=y+h,w=Math.min(m,b),j=b-w;f.style.height=w+"px",f.style.bottom==="0px"&&(d.scrollTop=j>0?j:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});XJ.displayName=F4;var JJ="SelectGroup",[zBe,WBe]=Jv(JJ),qBe=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Ga();return s.jsx(zBe,{scope:n,id:a,children:s.jsx(pt.div,{role:"group","aria-labelledby":a,...r,ref:t})})});qBe.displayName=JJ;var QJ="SelectLabel",eQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=WBe(QJ,n);return s.jsx(pt.div,{id:a.id,...r,ref:t})});eQ.displayName=QJ;var yj="SelectItem",[VBe,tQ]=Jv(yj),nQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,l=kf(yj,n),c=Ef(yj,n),u=l.value===r,[d,f]=x.useState(i??""),[p,h]=x.useState(!1),m=sn(t,b=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,b,r,a)}),g=Ga(),v=x.useRef("touch"),y=()=>{a||(l.onValueChange(r),l.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 s.jsx(VBe,{scope:n,value:r,disabled:a,textId:g,isSelected:u,onItemTextChange:x.useCallback(b=>{f(w=>w||((b==null?void 0:b.textContent)??"").trim())},[]),children:s.jsx(ON.ItemSlot,{scope:n,value:r,disabled:a,textValue:d,children:s.jsx(pt.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:m,onFocus:ht(o.onFocus,()=>h(!0)),onBlur:ht(o.onBlur,()=>h(!1)),onClick:ht(o.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:ht(o.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:ht(o.onPointerDown,b=>{v.current=b.pointerType}),onPointerMove:ht(o.onPointerMove,b=>{var w;v.current=b.pointerType,a?(w=c.onItemLeave)==null||w.call(c):v.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ht(o.onPointerLeave,b=>{var w;b.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ht(o.onKeyDown,b=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&b.key===" "||(PBe.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});nQ.displayName=yj;var f0="SelectItemText",rQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=kf(f0,n),l=Ef(f0,n),c=tQ(f0,n),u=IBe(f0,n),[d,f]=x.useState(null),p=sn(t,y=>f(y),c.onItemTextChange,y=>{var b;return(b=l.itemTextRefCallback)==null?void 0:b.call(l,y,c.value,c.disabled)}),h=d==null?void 0:d.textContent,m=x.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=u;return Xr(()=>(g(m),()=>v(m)),[g,v,m]),s.jsxs(s.Fragment,{children:[s.jsx(pt.span,{id:c.textId,...i,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?wp.createPortal(i.children,o.valueNode):null]})});rQ.displayName=f0;var aQ="SelectItemIndicator",iQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return tQ(aQ,n).isSelected?s.jsx(pt.span,{"aria-hidden":!0,...r,ref:t}):null});iQ.displayName=aQ;var B4="SelectScrollUpButton",sQ=x.forwardRef((e,t)=>{const n=Ef(B4,e.__scopeSelect),r=zR(B4,e.__scopeSelect),[a,i]=x.useState(!1),o=sn(t,r.onScrollButtonChange);return Xr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?s.jsx(lQ,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});sQ.displayName=B4;var U4="SelectScrollDownButton",oQ=x.forwardRef((e,t)=>{const n=Ef(U4,e.__scopeSelect),r=zR(U4,e.__scopeSelect),[a,i]=x.useState(!1),o=sn(t,r.onScrollButtonChange);return Xr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;i(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?s.jsx(lQ,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});oQ.displayName=U4;var lQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Ef("SelectScrollButton",n),o=x.useRef(null),l=RN(n),c=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),Xr(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),s.jsx(pt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:ht(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ht(a.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ht(a.onPointerLeave,()=>{c()})})}),HBe="SelectSeparator",cQ=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(pt.div,{"aria-hidden":!0,...r,ref:t})});cQ.displayName=HBe;var z4="SelectArrow",GBe=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=IN(n),i=kf(z4,n),o=Ef(z4,n);return i.open&&o.position==="popper"?s.jsx(OO,{...a,...r,ref:t}):null});GBe.displayName=z4;var YBe="SelectBubbleInput",uQ=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=x.useRef(null),i=sn(r,a),o=xS(t);return x.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[o,t]),s.jsx(pt.select,{...n,style:{...mW,...n.style},ref:i,defaultValue:t})});uQ.displayName=YBe;function dQ(e){return e===""||e===void 0}function fQ(e){const t=Pr(e),n=x.useRef(""),r=x.useRef(0),a=x.useCallback(o=>{const l=n.current+o;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function hQ(e,t,n){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=KBe(e,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function KBe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ZBe=BJ,pQ=zJ,XBe=qJ,JBe=VJ,QBe=HJ,mQ=GJ,e9e=XJ,gQ=eQ,vQ=nQ,t9e=rQ,n9e=iQ,yQ=sQ,xQ=oQ,bQ=cQ;const gn=ZBe,vn=XBe,dn=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(pQ,{ref:r,className:Ye("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
730ing-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",e),...n,children:[t,s.jsx(JBe,{asChild:!0,children:s.jsx(af,{className:"h-4 w-4 opacity-50"})})]}));dn.displayName=pQ.displayName;const wQ=x.forwardRef(({className:e,...t},n)=>s.jsx(yQ,{ref:n,className:Ye("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(DW,{className:"h-4 w-4"})}));wQ.displayName=yQ.displayName;const _Q=x.forwardRef(({className:e,...t},n)=>s.jsx(xQ,{ref:n,className:Ye("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(af,{className:"h-4 w-4"})}));_Q.displayName=xQ.displayName;const fn=x.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(QBe,{children:s.jsxs(mQ,{ref:a,className:Ye("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",e),position:n,...r,children:[s.jsx(wQ,{}),s.jsx(e9e,{className:Ye("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(_Q,{})]})}));fn.displayName=mQ.displayName;const r9e=x.forwardRef(({className:e,...t},n)=>s.jsx(gQ,{ref:n,className:Ye("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));r9e.displayName=gQ.displayName;const ot=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(vQ,{ref:r,className:Ye("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",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(n9e,{children:s.jsx(tx,{className:"h-4 w-4"})})}),s.jsx(t9e,{children:t})]}));ot.displayName=vQ.displayName;const a9e=x.forwardRef(({className:e,...t},n)=>s.jsx(bQ,{ref:n,className:Ye("-mx-1 my-1 h-px bg-muted",e),...t}));a9e.displayName=bQ.displayName;const i9e=Tv("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 Je({className:e,variant:t,...n}){return s.jsx("div",{className:Ye(i9e({variant:t}),e),...n})}const s9e=50*1024*1024,o9e=["application/pdf","image/jpeg","image/png","image/webp","image/heic","image/heif","image/tiff","image/bmp"],l9e=jBe({size:_Be().max(s9e,"File must be less than 50MB"),type:Pp().refine(e=>o9e.includes(e)||!0,"File must be a PDF or image")}),c9e=()=>{const{user:e,profile:t,refreshProfile:n}=bi(),r=di(),{toast:a}=_c(),i=x.useRef({}),o=x.useRef({}),[l,c]=x.useState(!0),[u,d]=x.useState(null),[f,p]=x.useState([]),[h,m]=x.useState((t==null?void 0:t.expected_student_count)||1),[g,v]=x.useState(null),[y,b]=x.useState((t==null?void 0:t.full_name)||""),[w,j]=x.useState([]),S=x.useCallback(async()=>{if(!e)return;c(!0);const{data:ee,error:V}=await Re.from("referral_documents").select("*").eq("user_id",e.id).order("student_label",{ascending:!0});V?console.error("Error fetching referral documents:",V):p(ee||[]),c(!1)},[e]);x.useEffect(()=>{S()},[S]),x.useEffect(()=>{t!=null&&t.expected_student_count&&m(t.expected_student_count),t!=null&&t.full_name&&b(t.full_name)},[t==null?void 0:t.expected_student_count,t==null?void 0:t.full_name]),x.useEffect(()=>{if(f.length>0){const ee=[];for(let V=0;V<h;V++){const O=f.find(M=>M.student_label===`Student ${V+1}`||M.student_first_name&&M.student_last_name&&f.indexOf(M)===V);O!=null&&O.student_first_name&&(O!=null&&O.student_last_name)?ee[V]={firstName:O.student_first_name,lastName:O.student_last_name}:w[V]?ee[V]=w[V]:ee[V]={firstName:"",lastName:""}}ee.length>0&&j(ee)}},[f,h]);const A=async ee=>{const V=parseInt(ee,10);m(V),j(O=>{const M=[...O];for(;M.length<V;
730)M.push({firstName:"",lastName:""});return M}),e&&await Re.from("profiles").update({expected_student_count:V}).eq("user_id",e.id)},E=async ee=>{b(ee),e&&await Re.from("profiles").update({full_name:ee}).eq("user_id",e.id)},k=(ee,V,O)=>{j(M=>{const B=[...M];return B[ee]||(B[ee]={firstName:"",lastName:""}),B[ee][V]=O,B})},P=ee=>{var O,M;const V=w[ee];return!!((O=V==null?void 0:V.firstName)!=null&&O.trim()&&((M=V==null?void 0:V.lastName)!=null&&M.trim())&&(y!=null&&y.trim()))},R=async(ee,V)=>{var ye,ie,F;const O=(ye=ee.target.files)==null?void 0:ye[0];if(!O||!e)return;const M=l9e.safeParse({size:O.size,type:O.type});if(!M.success){a({title:"Invalid file",description:M.error.errors[0].message,variant:"destructive"});return}d(V);const B=w[V],G=((ie=B==null?void 0:B.firstName)==null?void 0:ie.trim())||"",te=((F=B==null?void 0:B.lastName)==null?void 0:F.trim())||"",ne=G&&te?`${G} ${te}`:`Student ${V+1}`,ce=O.name.split(".").pop(),oe=`student-${V+1}-referral-${Date.now()}.${ce}`,X=`${e.id}/referrals/${oe}`,{error:se}=await Re.storage.from("application-documents").upload(X,O);if(se){console.error("Upload error:",se),a({title:"Upload failed",description:"Failed to upload your referral form. Please try again.",variant:"destructive"}),d(null);return}const{error:Q}=await Re.from("referral_documents").insert({user_id:e.id,student_label:ne,student_first_name:G||null,student_last_name:te||null,parent_name:(y==null?void 0:y.trim())||null,file_path:X,file_name:O.name,file_size:O.size,status:"pending"});if(Q){console.error("Insert error:",Q),a({title:"Error",description:"Failed to save referral information. Please try again.",variant:"destructive"}),d(null);return}await Re.from("profiles").update({referral_status:"pending",referral_submitted_at:new Date().toISOString()}).eq("user_id",e.id),await n(),await S(),d(null);try{const{data:{session:me}}=await Re.auth.getSession();me!=null&&me.access_token&&Re.functions.invoke("referral-upload-notify",{body:{userId:e.id}})}catch(me){console.error("Referral notification failed (non-blocking):",me)}a({title:"Referral uploaded!",description:`Referral form for ${ne} has been submitted.`}),i.current[V]&&(i.current[V].value=""),o.current[V]&&(o.current[V].value="")},C=async ee=>{if(ee.status!=="pending"){a({title:"Cannot delete",description:"Only pending referrals can be deleted.",variant:"destructive"});return}v(ee.id);const{error:V}=await Re.storage.from("application-documents").remove([ee.file_path]);V&&console.error("Storage delete error:",V);const{error:O}=await Re.from("referral_documents").delete().eq("id",ee.id);if(O){console.error("Delete error:",O),a({title:"Error",description:"Failed to delete referral. Please try again.",variant:"destructive"}),v(null);return}await S(),v(null),a({title:"Referral deleted",description:`${ee.student_label} referral has been removed.`})},I=ee=>{const V=w[ee];if(V!=null&&V.firstName&&(V!=null&&V.lastName)){const M=`${V.firstName} ${V.lastName}`,B=f.find(G=>G.student_label===M);if(B)return B}const O=`Student ${ee+1}`;return f.find(M=>M.student_label===O)},D=ee=>{switch(ee){case"approved":return s.jsx(Je,{className:"bg-green-500 text-white",children:"Approved"});case"rejected":return s.jsx(Je,{variant:"destructive",children:"Rejected"});default:return s.jsx(Je,{variant:"secondary",children:"Pending"})}},U=f.length,q=U>=h,Z=f.length>=h&&f.slice(0,h).every(ee=>ee.status==="approved"),H=f.some(ee=>ee.status==="rejected"),$=(t==null?void 0:t.referral_status)==="approved";x.useEffect(()=>{(Z||$)&&!l&&r("/portal/family")},[Z,$,l,r]);const W=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);return l?s.jsx(so,{children:s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsx(Xt,{className:"w-8 h-8 animate-spin text-primary"})})}):s.jsx(so,{children:s.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-display font-semibold text-foreground",children:"Referral Forms"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"As a new family, please upload a referral form for each student you plan to enroll."})]}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsx(jt,{children:"Parent/Guardian Information"}
730),s.jsx(qn,{children:"Please enter your full name as it will appear on all referral documents."})]}),s.jsx(He,{children:s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"parentName",children:"Full Name *"}),s.jsx(xt,{id:"parentName",value:y,onChange:ee=>E(ee.target.value),placeholder:"Enter your full name"})]})})]}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsx(jt,{children:"How many students will you be enrolling?"}),s.jsx(qn,{children:"You'll need to upload a separate referral form for each student."})]}),s.jsx(He,{children:s.jsxs(gn,{value:h.toString(),onValueChange:A,children:[s.jsx(dn,{className:"w-full max-w-[200px]",children:s.jsx(vn,{placeholder:"Select number of students"})}),s.jsx(fn,{children:[1,2,3,4,5].map(ee=>s.jsxs(ot,{value:ee.toString(),children:[ee," ",ee===1?"Student":"Students"]},ee))})]})})]}),h>0&&s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsx(jt,{children:"Student Information"}),s.jsx(qn,{children:"Enter the first and last name for each student you are enrolling."})]}),s.jsx(He,{className:"space-y-4",children:Array.from({length:h}).map((ee,V)=>{var O,M;return s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4 border rounded-lg bg-muted/30",children:[s.jsx("div",{className:"col-span-1 md:col-span-2",children:s.jsxs("p",{className:"font-medium text-sm text-muted-foreground",children:["Student ",V+1]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"First Name *"}),s.jsx(xt,{value:((O=w[V])==null?void 0:O.firstName)||"",onChange:B=>k(V,"firstName",B.target.value),placeholder:"First name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Last Name *"}),s.jsx(xt,{value:((M=w[V])==null?void 0:M.lastName)||"",onChange:B=>k(V,"lastName",B.target.value),placeholder:"Last name"})]})]},V)})})]}),s.jsx(Ve,{className:H?"border-destructive":q?"border-primary":"",children:s.jsx(He,{className:"flex items-center gap-4 p-6",children:H?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"p-3 rounded-full bg-destructive/20",children:s.jsx(er,{className:"w-6 h-6 text-destructive"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-destructive",children:"Action Required"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"One or more referrals were not approved. Please upload new forms for the rejected referrals."})]})]}):q?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"p-3 rounded-full bg-secondary/20",children:s.jsx(Fn,{className:"w-6 h-6 text-secondary"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold",children:"All Referrals Submitted"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your referral forms are being reviewed. You'll be notified once they're all approved."})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"p-3 rounded-full bg-muted",children:s.jsx(fa,{className:"w-6 h-6 text-muted-foreground"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold",children:"Upload Progress"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[U," of ",h," referral",h>1?"s":""," uploaded"]})]})]})})}),s.jsx("div",{className:"space-y-4",children:Array.from({length:h}).map((ee,V)=>{const O=I(V),M=u===V,B=w[V],G=B!=null&&B.firstName&&(B!=null&&B.lastName)?`${B.firstName} ${B.lastName}`:`Student ${V+1}`,te=P(V);return s.jsx(Ve,{className:(O==null?void 0:O.status)==="rejected"?"border-destructive":"",children:s.jsx(He,{className:"p-6",children:O?s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:`p-3 rounded-full ${O.status==="approved"?"bg-green-100":O.status==="rejected"?"bg-destructive/10":"bg-secondary/20"}`,children:O.status==="approved"?s.jsx(Nt,{className:"w-6 h-6 text-green-600"}):O.status==="rejected"?s.jsx(er,{className:"w-6 h-6 text-destructive"}):s.jsx(En,{className:"w-6 h-6 text-secondary"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("p",{className:"font-medium",children:[G,"'s Referral"]}),D(O.status)]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:O.file_name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Uploaded ",new Date(O.uploaded_at).toLocaleDateString()]}),O.admin_feedback&&s.jsxs("p",{className:"text-sm text-destructive mt-1",children:["Feedback: ",O.admin_feedback]})]})]}),O.status==="pending"&&s.jsx(we,{variant:"ghost",size:"icon",onClick:()=>C(O),disabled:g===O.id,children:g===O.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsx(Al,{className:"w-4 h-4 text-muted-foreground hover:text-destructive"})}),O.status==="rejected"&&s.jsx("div",{className:"flex gap-2",children:s.jsx(we,{variant:"ghost",size:"icon",onClick:()=>C(O),disabled:g===O.id,children:g===O.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsx(Al,{className:"w-4 h-4 text-muted-foreground hover:text-destructive"})})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("h3",{className:"font-medium",children:[G,"'s Referral"]}),!te&&s.jsx("p",{className:"text-sm text-amber-600 bg-amber-50 p-3 rounded-lg",children:"Please enter your name and the student's first and last name above before uploading."}),s.jsxs("div",{className:`border-2 border-dashed rounded-lg p-6 text-center transition-colors ${te?"cursor-pointer hover:border-primary hover:bg-muted/50":"opacity-50 cursor-not-allowed"}`,onClick:()=>{var ne;return te&&((ne=i.current[V])==null?void 0:ne.click())},children:[s.jsx("input",{ref:ne=>i.current[V]=ne,type:"file",accept:".pdf,.jpg,.jpeg,.png,.webp,.heic,.heif,.tiff,.tif,.bmp",onChange:ne=>R(ne,V),className:"hidden",disabled:!te}),M?s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx(Xt,{className:"w-6 h-6 animate-spin text-primary"}),s.jsx("span",{children:"Uploading..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(fa,{className:"w-10 h-10 mx-auto text-muted-foreground mb-2"}),s.jsx("p",{className:"font-medium",children:"Click to upload or drag and drop"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"PDF, JPEG, PNG, WebP (max 10MB)"})]})]}),W&&s.jsxs("div",{className:"flex justify-center",children:[s.jsx("input",{ref:ne=>o.current[V]=ne,type:"file",accept:"image/*",capture:"environment",onChange:ne=>R(ne,V),className:"hidden",disabled:!te}),s.jsxs(we,{variant:"outline",onClick:()=>{var ne;return(ne=o.current[V])==null?void 0:ne.click()},disabled:M||!te,children:[s.jsx(Zse,{className:"w-4 h-4 mr-2"}),"Take Photo"]})]})]})})},V)})}),s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsx(jt,{children:"What happens next?"})}),s.jsx(He,{children:s.jsxs("ol",{className:"space-y-4",children:[s.jsxs("li",{className:"flex gap-4",children:[s.jsx("div",{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium ${q?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:q?s.jsx(Nt,{className:"w-4 h-4"}):"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Submit referral forms"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Upload a referral form for each student you plan to enroll"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium bg-muted text-muted-foreground",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Admin review"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Our team will review each referral form"})]})]}),s.jsxs("li",{className:"flex gap-4",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-muted flex items-center justify-center text-sm font-medium text-muted-foreground",children:"3"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Complete application"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Once all referrals are approved, you can complete the full application"})]})]})]})})]})]})})};function jn(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Tr(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Ea(e,t){const n=jn(e);return isNaN(t)?Tr(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Tl(e,t){const n=jn(e);if(isNaN(t))return Tr(e,NaN);if(!t)return n;const r=n.getDate(),a=Tr(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const i=a.getDate();return r>=i?a:(n.setFullYear(a.getFullYear(),a.getMonth(),r),n)}function u9e(e,t){const n=+jn(e);return Tr(e,n+t)}const WR=6048e5,d9e=864e5,LN=6e4,qR=36e5,f9e=1e3;let h9e={};function Tp(){return h9e}function vo(e,t){var l,c,u,d;const n=Tp(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=jn(e),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function ku(e){return vo(e,{weekStartsOn:1}
730)}function jQ(e){const t=jn(e),n=t.getFullYear(),r=Tr(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=ku(r),i=Tr(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=ku(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Os(e){const t=jn(e);return t.setHours(0,0,0,0),t}function bv(e){const t=jn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function lc(e,t){const n=Os(e),r=Os(t),a=+n-bv(n),i=+r-bv(r);return Math.round((a-i)/d9e)}function p9e(e){const t=jQ(e),n=Tr(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ku(n)}function _w(e,t){return u9e(e,t*LN)}function W4(e,t){const n=t*7;return Ea(e,n)}function m9e(e,t){return Tl(e,t*12)}function g9e(e){let t;return e.forEach(function(n){const r=jn(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function v9e(e){let t;return e.forEach(n=>{const r=jn(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function ca(e,t){const n=Os(e),r=Os(t);return+n==+r}function VR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function y9e(e){if(!VR(e)&&typeof e!="number")return!1;const t=jn(e);return!isNaN(Number(t))}function nb(e,t){const n=jn(e),r=jn(t),a=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return a*12+i}function x9e(e,t,n){const r=vo(e,n),a=vo(t,n),i=+r-bv(r),o=+a-bv(a);return Math.round((i-o)/WR)}function HR(e){const t=jn(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Ds(e){const t=jn(e);return t.setDate(1),t.setHours(0,0,0,0),t}function SQ(e){const t=jn(e),n=Tr(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function GR(e,t){var l,c,u,d;const n=Tp(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=jn(e),i=a.getDay(),o=(i<r?-7:0)+6-(i-r);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function NQ(e){return GR(e,{weekStartsOn:1})}const b9e={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"}},w9e=(e,t,n)=>{let r;const a=b9e[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function fk(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const _9e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},j9e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},S9e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},N9e={date:fk({formats:_9e,defaultWidth:"full"}),time:fk({formats:j9e,defaultWidth:"full"}),dateTime:fk({formats:S9e,defaultWidth:"full"})},A9e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},k9e=(e,t,n,r)=>A9e[e];function Vy(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const E9e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},C9e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},P9e={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"]},T9e={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
730ay","Saturday"]},O9e={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"}},R9e={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"}},I9e=(e,t)=>{const n=Number(e),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"},L9e={ordinalNumber:I9e,era:Vy({values:E9e,defaultWidth:"wide"}),quarter:Vy({values:C9e,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Vy({values:P9e,defaultWidth:"wide"}),day:Vy({values:T9e,defaultWidth:"wide"}),dayPeriod:Vy({values:O9e,defaultWidth:"wide",formattingValues:R9e,defaultFormattingWidth:"wide"})};function Hy(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?$9e(l,f=>f.test(o)):M9e(l,f=>f.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function M9e(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function $9e(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function D9e(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const F9e=/^(\d+)(th|st|nd|rd)?/i,B9e=/\d+/i,U9e={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},z9e={any:[/^b/i,/^(a|c)/i]},W9e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},q9e={any:[/1/i,/2/i,/3/i,/4/i]},V9e={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},H9e={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]},G9e={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},Y9e={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]},K9e={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},Z9e={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}},X9e={ordinalNumber:D9e({matchPattern:F9e,parsePattern:B9e,valueCallback:e=>parseInt(e,10)}),era:Hy({matchPatterns:U9e,defaultMatchWidth:"wide",parsePatterns:z9e,defaultParseWidth:"any"}),quarter:Hy({matchPatterns:W9e,defaultMatchWidth:"wide",parsePatterns:q9e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Hy({matchPatterns:V9e,defaultMatchWidth:"wide",parsePatterns:H9e,defaultParseWidth:"any"}),day:Hy({matchPatterns:G9e,defaultMatchWidth:"wide",parsePatterns:Y9e,defaultParseWidth:"any"}),dayPeriod:Hy({matchPatterns:K9e,defaultMatchWidth:"any",parsePatterns:Z9e,defaultParseWidth:"any"})},YR={code:"en-US",formatDistance:w9e,formatLong:N9e,formatRelative:k9e,localize:L9e,match:X9e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function J9e(e){const t=jn(e);return lc(t,SQ(t))+1}function KR(e){const t=jn(e),n=+ku(t)-+p9e(t);return Math.round(n/WR)+1}function ZR(e,t){var d,f,p,h;const n=jn(e),r=n.getFullYear(),a=Tp(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((h=(p=a.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,o=Tr(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=vo(o,t),c=Tr(e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=vo(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Q9e(e,t){var l,c,u,d;const n=Tp(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=ZR(e,t),i=Tr(e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),vo(i,t)}function XR(e,t){const n=jn(e),r=+vo(n,t)-+Q9e(n,t);return Math.round(r/WR)+1}function yr(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const td={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return yr(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):yr(n+1,2)},d(e,t){return yr(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){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(e,t){return yr(e.getHours()%12||12,t.length)},H(e,t){return yr(e.getHours(),t.length)},m(e,t){return yr(e.getMinutes(),t.length)},s(e,t){return yr(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return yr(a,t.length)}},um={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},P7={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){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(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return td.y(e,t)},Y:function(e,t,n,r){const a=ZR(e,r),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return yr(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):yr(i,t.length)},R:function(e,t){const n=jQ(e);return yr(n,t.length)},u:function(e,t){const n=e.getFullYear();return yr(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return yr(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(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return yr(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(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return td.M(e,t);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(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return yr(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(e,t,n,r){const a=XR(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):yr(a,t.length)},I:function(e,t,n){const r=KR(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):yr(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):td.d(e,t)},D:function(e,t,n){const r=J9e(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):yr(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){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(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return yr(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return yr(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return yr(a,t.length);case"io":return n.ordinalNumber(a,{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(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=um.noon:r===0?a=um.midnight:a=r/12>
vendor: 4,712 bytes, line 730
730=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=um.evening:r>=12?a=um.afternoon:r>=4?a=um.morning:a=um.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return td.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):td.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):yr(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):yr(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):td.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):td.s(e,t)},S:function(e,t){return td.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return O7(r);case"XXXX":case"XX":return lh(r);case"XXXXX":case"XXX":default:return lh(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return O7(r);case"xxxx":case"xx":return lh(r);case"xxxxx":case"xxx":default:return lh(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+T7(r,":");case"OOOO":default:return"GMT"+lh(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+T7(r,":");case"zzzz":default:return"GMT"+lh(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return yr(r,t.length)},T:function(e,t,n){const r=e.getTime();return yr(r,t.length)}};function T7(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+yr(i,2)}function O7(e,t){return e%60===0?(e>0?"-":"+")+yr(Math.abs(e)/60,2):lh(e,t)}function lh(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=yr(Math.trunc(r/60),2),i=yr(r%60,2);return n+a+t+i}const R7=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},AQ=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},eUe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return R7(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",R7(r,t)).replace("{{time}}",AQ(a,t))},q4={p:AQ,P:eUe},tUe=/^D+$/,nUe=/^Y+$/,rUe=["D","DD","YY","YYYY"];function kQ(e){return tUe.test(e)}function EQ(e){return nUe.test(e)}function V4(e,t,n){const r=aUe(e,t,n);if(console.warn(r),rUe.includes(e))throw new RangeError(r)}function aUe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const iUe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sUe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,oUe=/^'([^]*?)'?$/,lUe=/''/g,cUe=/[a-zA-Z]/;function Dn(e,t,n){var d,f,p,h,m,g,v,y;const r=Tp(),a=(n==null?void 0:n.locale)??r.locale??YR,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((g=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((y=(v=r.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,l=jn(e);if(!y9e(l))throw new RangeError("Invalid time value");let c=t.match(sUe).map(b=>{const w=b[0];if(w==="p"||w==="P"){const j=q4[w];return j(b,a.formatLong)}return b}).join("").match(iUe).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const w=b[0];if(w==="'")return{isToken:!1,value:uUe(b)};if(P7[w])return{isToken:!0,value:b};
vendor: 25,564 bytes, line 730
730if(w.match(cUe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:b}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(b=>{if(!b.isToken)return b.value;const w=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&EQ(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&kQ(w))&&V4(w,t,String(e));const j=P7[w[0]];return j(l,w,a.localize,u)}).join("")}function uUe(e){const t=e.match(oUe);return t?t[1].replace(lUe,"'"):e}function dUe(e){const t=jn(e),n=t.getFullYear(),r=t.getMonth(),a=Tr(e,0);return a.setFullYear(n,r+1,0),a.setHours(0,0,0,0),a.getDate()}function fUe(){return Object.assign({},Tp())}function hUe(e){let n=jn(e).getDay();return n===0&&(n=7),n}function pUe(e){return Math.trunc(+jn(e)/1e3)}function mUe(e){const t=jn(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function gUe(e,t){return x9e(mUe(e),Ds(e),t)+1}function hu(e,t){const n=jn(e),r=jn(t);return n.getTime()>r.getTime()}function Vh(e,t){const n=jn(e),r=jn(t);return+n<+r}function xj(e,t){const n=jn(e),r=jn(t);return+n==+r}function vUe(e,t){const n=t instanceof Date?Tr(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const yUe=10;class CQ{constructor(){qe(this,"subPriority",0)}validate(t,n){return!0}}class xUe extends CQ{constructor(t,n,r,a,i){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=a,i&&(this.subPriority=i)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class bUe extends CQ{constructor(){super(...arguments);qe(this,"priority",yUe);qe(this,"subPriority",-1)}set(n,r){return r.timestampIsSet?n:Tr(n,vUe(n,Date))}}class ur{run(t,n,r,a){const i=this.parse(t,n,r,a);return i?{setter:new xUe(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,n,r){return!0}}class wUe extends ur{constructor(){super(...arguments);qe(this,"priority",140);qe(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,a){switch(r){case"G":case"GG":case"GGG":return a.era(n,{width:"abbreviated"})||a.era(n,{width:"narrow"});case"GGGGG":return a.era(n,{width:"narrow"});case"GGGG":default:return a.era(n,{width:"wide"})||a.era(n,{width:"abbreviated"})||a.era(n,{width:"narrow"})}}set(n,r,a){return r.era=a,n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}const Ia={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},nc={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function La(e,t){return e&&{value:t(e.value),rest:e.rest}}function ua(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function rc(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,a=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(a*qR+i*LN+o*f9e),rest:t.slice(n[0].length)}}function PQ(e){return ua(Ia.anyDigitsSigned,e)}function ja(e,t){switch(e){case 1:return ua(Ia.singleDigit,t);case 2:return ua(Ia.twoDigits,t);case 3:return ua(Ia.threeDigits,t);case 4:return ua(Ia.fourDigits,t);default:return ua(new RegExp("^\\d{1,"+e+"}"),t)}}function bj(e,t){switch(e){case 1:return ua(Ia.singleDigitSigned,t);case 2:return ua(Ia.twoDigitsSigned,t);case 3:return ua(Ia.threeDigitsSigned,t);case 4:return ua(Ia.fourDigitsSigned,t);default:return ua(new RegExp("^-?\\d{1,"+e+"}"),t)}}function JR(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function TQ(e,t){const n=t>0,r=n?t:1-t;let a;if(r<=50)a=e||100;else{const i=r+50,o=Math.trunc(i/100)*100,l=e>=i%100;a=e+o-(l?100:0)}return n?a:1-a}function OQ(e){return e%400===0||e%4===0&&e%100!==0}class _Ue extends ur{constructor(){super(...arguments);qe(this,"priority",130);qe(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,a){const i=o=>({year:o,isTwoDigitYear:r==="yy"});switch(r){case"y":return La(ja(4,n),i);case"yo":return La(a.ordinalNumber(n,{unit:"year"}),i);default:return La(ja(r.length,n),i)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,a){const i=n.getFullYear();if(a.isTwoDigitYear){const l=TQ(a.year,i);return n.setFullYear(l,0,1),n.setHours(0,0,0,0),n}const o=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}class jUe extends ur{constructor(){super(...arguments);qe(this,"priority",130);qe(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,a){const i=o=>({year:o,isTwoDigitYear:r==="YY"});switch(r){case"Y":return La(ja(4,n),i);case"Yo":return La(a.ordinalNumber(n,{unit:"year"}),i);default:return La(ja(r.length,n),i)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,a,i){const o=ZR(n,i);if(a.isTwoDigitYear){const c=TQ(a.year,o);return n.setFullYear(c,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),vo(n,i)}const l=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(l,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),vo(n,i)}}class SUe extends ur{constructor(){super(...arguments);qe(this,"priority",130);qe(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return bj(r==="R"?4:r.length,n)}set(n,r,a){const i=Tr(n,0);return i.setFullYear(a,0,4),i.setHours(0,0,0,0),ku(i)}}class NUe extends ur{constructor(){super(...arguments);qe(this,"priority",130);qe(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return bj(r==="u"?4:r.length,n)}set(n,r,a){return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}class AUe extends ur{constructor(){super(...arguments);qe(this,"priority",120);qe(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"Q":case"QQ":return ja(r.length,n);case"Qo":return a.ordinalNumber(n,{unit:"quarter"});case"QQQ":return a.quarter(n,{width:"abbreviated",context:"formatting"})||a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(n,{width:"wide",context:"formatting"})||a.quarter(n,{width:"abbreviated",context:"formatting"})||a.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,a){return n.setMonth((a-1)*3,1),n.setHours(0,0,0,0),n}}class kUe extends ur{constructor(){super(...arguments);qe(this,"priority",120);qe(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"q":case"qq":return ja(r.length,n);case"qo":return a.ordinalNumber(n,{unit:"quarter"});case"qqq":return a.quarter(n,{width:"abbreviated",context:"standalone"})||a.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(n,{width:"wide",context:"standalone"})||a.quarter(n,{width:"abbreviated",context:"standalone"})||a.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,a){return n.setMonth((a-1)*3,1),n.setHours(0,0,0,0),n}}class EUe extends ur{constructor(){super(...arguments);qe(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);qe(this,"priority",110)}parse(n,r,a){const i=o=>o-1;switch(r){case"M":return La(ua(Ia.month,n),i);case"MM":return La(ja(2,n),i);case"Mo":return La(a.ordinalNumber(n,{unit:"month"}),i);case"MMM":return a.month(n,{width:"abbreviated",context:"formatting"})||a.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(n,{width:"wide",context:"formatting"})||a.month(n,{width:"abbreviated",context:"formatting"})||a.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.setMonth(a,1),n.setHours(0,0,0,0),n}}class CUe extends ur{constructor(){super(...arguments);qe(this,"priority",110);qe(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,a){const i=o=>o-1;switch(r){case"L":return La(ua(Ia.month,n),i);case"LL":return La(ja(2,n),i);case"Lo":return La(a.ordinalNumber(n,{unit:"month"}),i);case"LLL":return a.month(n,{width:"abbreviated",context:"standalone"})||a.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(n,{width:"wide",context:"standalone"})||a.month(n,{width:"abbreviated",context:"standalone"})||a.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.setMonth(a,1),n.setHours(0,0,0,0),n}}function PUe(e,t,n){const r=jn(e),a=XR(r,n)-t;return r.setDate(r.getDate()-a*7),r}class TUe extends ur{constructor(){super(...arguments);qe(this,"priority",100);qe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,a){switch(r){case"w":return ua(Ia.week,n);case"wo":return a.ordinalNumber(n,{unit:"week"});default:return ja(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a,i){return vo(PUe(n,a,i),i)}}function OUe(e,t){const n=jn(e),r=KR(n)-t;return n.setDate(n.getDate()-r*7),n}class RUe extends ur{constructor(){super(...arguments);qe(this,"priority",100);qe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,a){switch(r){case"I":return ua(Ia.week,n);case"Io":return a.ordinalNumber(n,{unit:"week"});default:return ja(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a){return ku(OUe(n,a))}}const IUe=[31,28,31,30,31,30,31,31,30,31,30,31],LUe=[31,29,31,30,31,30,31,31,30,31,30,31];class MUe extends ur{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"subPriority",1);qe(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"d":return ua(Ia.date,n);case"do":return a.ordinalNumber(n,{unit:"date"});default:return ja(r.length,n)}}validate(n,r){const a=n.getFullYear(),i=OQ(a),o=n.getMonth();return i?r>=1&&r<=LUe[o]:r>=1&&r<=IUe[o]}set(n,r,a){return n.setDate(a),n.setHours(0,0,0,0),n}}class $Ue extends ur{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"subpriority",1);qe(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,a){switch(r){case"D":case"DD":return ua(Ia.dayOfYear,n);case"Do":return a.ordinalNumber(n,{unit:"date"});default:return ja(r.length,n)}}validate(n,r){const a=n.getFullYear();return OQ(a)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,a){return n.setMonth(0,a),n.setHours(0,0,0,0),n}}function QR(e,t,n){var f,p,h,m;const r=Tp(),a=(n==null?void 0:n.weekStartsOn)??((p=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,i=jn(e),o=i.getDay(),c=(t%7+7)%7,u=7-a,d=t<0||t>6?t-(o+u)%7:(c+u)%7-(o+u)%7;return Ea(i,d)}class DUe extends ur{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"E":case"EE":case"EEE":return a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,i){return n=QR(n,a,i),n.setHours(0,0,0,0),n}}class FUe extends ur{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,a,i){const o=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(r){case"e":case"ee":return La(ja(r.length,n),o);case"eo":return La(a.ordinalNumber(n,{unit:"day"}),o);case"eee":return a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"eeeee":return a.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,i){return n=QR(n,a,i),n.setHours(0,0,0,0),n}}class BUe extends ur{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,a,i){const o=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(r){case"c":case"cc":return La(ja(r.length,n),o);case"co":return La(a.ordinalNumber(n,{unit:"day"}),o);case"ccc":return a.day(n,{width:"abbreviated",context:"standalone"})||a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"});case"ccccc":return a.day(n,{width:"narrow",context:"standalone"});case"cccccc":return a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(n,{width:"wide",context:"standalone"})||a.day(n,{width:"abbreviated",context:"standalone"})||a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,i){return n=QR(n,a,i),n.setHours(0,0,0,0),n}}function UUe(e,t){const n=jn(e),r=hUe(n),a=t-r;return Ea(n,a)}class zUe extends ur{constructor(){super(...arguments);qe(this,"priority",90);qe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,a){const i=o=>o===0?7:o;switch(r){case"i":case"ii":return ja(r.length,n);case"io":return a.ordinalNumber(n,{unit:"day"});case"iii":return La(a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),i);case"iiiii":return La(a.day(n,{width:"narrow",context:"formatting"}),i);case"iiiiii":return La(a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),i);case"iiii":default:return La(a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),i)}}validate(n,r){return r>=1&&r<=7}set(n,r,a){return n=UUe(n,a),n.setHours(0,0,0,0),n}}class WUe extends ur{constructor(){super(...arguments);qe(this,"priority",80);qe(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,a){switch(r){case"a":case"aa":case"aaa":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(JR(a),0,0,0),n}}class qUe extends ur{constructor(){super(...arguments);qe(this,"priority",80);qe(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,a){switch(r){case"b":case"bb":case"bbb":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(JR(a),0,0,0),n}}class VUe extends ur{constructor(){super(...arguments);qe(this,"priority",80);qe(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,a){switch(r){case"B":case"BB":case"BBB":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(JR(a),0,0,0),n}}class HUe extends ur{constructor(){super(...arguments);qe(this,"priority",70);qe(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,a){switch(r){case"h":return ua(Ia.hour12h,n);case"ho":return a.ordinalNumber(n,{unit:"hour"});default:return ja(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,a){const i=n.getHours()>=12;return i&&a<12?n.setHours(a+12,0,0,0):!i&&a===12?n.setHours(0,0,0,0):n.setHours(a,0,0,0),n}}class GUe extends ur{constructor(){super(...arguments);qe(this,"priority",70);qe(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,a){switch(r){case"H":return ua(Ia.hour23h,n);case"Ho":return a.ordinalNumber(n,{unit:"hour"});default:return ja(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,a){return n.setHours(a,0,0,0),n}}class YUe extends ur{constructor(){super(...arguments);qe(this,"priority",70);qe(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,a){switch(r){case"K":return ua(Ia.hour11h,n);case"Ko":return a.ordinalNumber(n,{unit:"hour"});default:return ja(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.getHours()>=12&&a<12?n.setHours(a+12,0,0,0):n.setHours(a,0,0,0),n}}class KUe extends ur{constructor(){super(...arguments);qe(this,"priority",70);qe(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,a){switch(r){case"k":return ua(Ia.hour24h,n);case"ko":return a.ordinalNumber(n,{unit:"hour"});default:return ja(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,a){const i=a<=24?a%24:a;return n.setHours(i,0,0,0),n}}class ZUe extends ur{constructor(){super(...arguments);qe(this,"priority",60);qe(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"m":return ua(Ia.minute,n);case"mo":return a.ordinalNumber(n,{unit:"minute"});default:return ja(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setMinutes(a,0,0),n}}class XUe extends ur{constructor(){super(...arguments);qe(this,"priority",50);qe(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"s":return ua(Ia.second,n);case"so":return a.ordinalNumber(n,{unit:"second"});default:return ja(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setSeconds(a,0),n}}class JUe extends ur{constructor(){super(...arguments);qe(this,"priority",30);qe(this,"incompatibleTokens",["t","T"])}parse(n,r){const a=i=>Math.trunc(i*Math.pow(10,-r.length+3));return La(ja(r.length,n),a)}set(n,r,a){return n.setMilliseconds(a),n}}class QUe extends ur{constructor(){super(...arguments);qe(this,"priority",10);qe(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return rc(nc.basicOptionalMinutes,n);case"XX":return rc(nc.basic,n);case"XXXX":return rc(nc.basicOptionalSeconds,n);case"XXXXX":return rc(nc.extendedOptionalSeconds,n);case"XXX":default:return rc(nc.extended,n)}}set(n,r,a){return r.timestampIsSet?n:Tr(n,n.getTime()-bv(n)-a)}}class eze extends ur{constructor(){super(...arguments);qe(this,"priority",10);qe(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return rc(nc.basicOptionalMinutes,n);case"xx":return rc(nc.basic,n);case"xxxx":return rc(nc.basicOptionalSeconds,n);case"xxxxx":return rc(nc.extendedOptionalSeconds,n);case"xxx":default:return rc(nc.extended,n)}}set(n,r,a){return r.timestampIsSet?n:Tr(n,n.getTime()-bv(n)-a)}}class tze extends ur{constructor(){super(...arguments);qe(this,"priority",40);qe(this,"incompatibleTokens","*")}parse(n){return PQ(n)}set(n,r,a){return[Tr(n,a*1e3),{timestampIsSet:!0}]}}class nze extends ur{constructor(){super(...arguments);qe(this,"priority",20);qe(this,"incompatibleTokens","*")}parse(n){return PQ(n)}set(n,r,a){return[Tr(n,a),{timestampIsSet:!0}]}}const rze={G:new wUe,y:new _Ue,Y:new jUe,R:new SUe,u:new NUe,Q:new AUe,q:new kUe,M:new EUe,L:new CUe,w:new TUe,I:new RUe,d:new MUe,D:new $Ue,E:new DUe,e:new FUe,c:new BUe,i:new zUe,a:new WUe,b:new qUe,B:new VUe,h:new HUe,H:new GUe,K:new YUe,k:new KUe,m:new ZUe,s:new XUe,S:new JUe,X:new QUe,x:new eze,t:new tze,T:new nze},aze=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ize=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sze=/^'([^]*?)'?$/,oze=/''/g,lze=/\S/,cze=/[a-zA-Z]/;function jw(e,t,n,r){var g,v,y,b;const a=fUe(),i=a.locale??YR,o=a.firstWeekContainsDate??((v=(g=a.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??1,l=a.weekStartsOn??((b=(y=a.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??0,c={firstWeekContainsDate:o,weekStartsOn:l,locale:i},u=[new bUe],d=t.match(ize).map(w=>{const j=w[0];if(j in q4){const S=q4[j];return S(w,i.formatLong)}return w}).join("").match(aze),f=[];for(let w of d){EQ(w)&&V4(w,t,e),kQ(w)&&V4(w,t,e);const j=w[0],S=rze[j];if(S){const{incompatibleTokens:A}=S;if(Array.isArray(A)){const k=f.find(P=>A.includes(P.token)||P.token===j);if(k)throw new RangeError(`The format string mustn't contain \`${k.fullToken}\` and \`${w}\` at the same time`)}else if(S.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${w}\` and any other token at the same time`);f.push({token:j,fullToken:w});const E=S.run(e,w,i.match,c);if(!E)return Tr(n,NaN);u.push(E.setter),e=E.rest}else{if(j.match(cze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+j+"`");if(w==="''"?w="'":j==="'"&&(w=uze(w)),e.indexOf(w)===0)e=e.slice(w.length);else return Tr(n,NaN)}}if(e.length>0&&lze.test(e))return Tr(n,NaN);const p=u.map(w=>w.priority).sort((w,j)=>j-w).filter((w,j,S)=>S.indexOf(w)===j).map(w=>u.filter(j=>j.priority===w).sort((j,S)=>S.subPriority-j.subPriority)).map(w=>w[0]);let h=jn(n);if(isNaN(h.getTime()))return Tr(n,NaN);const m={};for(const w of p){if(!w.validate(h,c))return Tr(n,NaN);const j=w.set(h,m,c);Array.isArray(j)?(h=j[0],Object.assign(m,j[1])):h=j}return Tr(n,h)}function uze(e){return e.match(sze)[1].replace(oze,"'")}function eI(e,t){const n=jn(e),r=jn(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function dze(e,t){const n=jn(e),r=jn(t);return n.getFullYear()===r.getFullYear()}function hk(e,t){return Ea(e,-t)}function xr(e,t){const r=mze(e);let a;if(r.date){const c=gze(r.date,2);a=vze(c.restDateString,c.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let o=0,l;if(r.time&&(o=yze(r.time),isNaN(o)))return new Date(NaN);if(r.timezone){if(l=xze(r.timezone),isNaN(l))return new Date(NaN)}else{const c=new Date(i+o),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(i+o+l)}const Sw={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},fze=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,hze=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,pze=/^([+-])(\d{2})(?::?(\d{2}))?$/;function mze(e){const t={},n=e.split(Sw.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Sw.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Sw.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const a=Sw.timezone.exec(r);a?(t.time=r.replace(a[1],""),t.timezone=a[1]):t.time=r}return t}function gze(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function vze(e,t){if(t===null)return new Date(NaN);const n=e.match(fze);if(!n)return new Date(NaN);const r=!!n[4],a=Gy(n[1]),i=Gy(n[2])-1,o=Gy(n[3]),l=Gy(n[4]),c=Gy(n[5])-1;if(r)return Sze(t,l,c)?bze(t,l,c):new Date(NaN);{const u=new Date(0);return!_ze(t,i,o)||!jze(t,a)?new Date(NaN):(u.setUTCFullYear(t,i,Math.max(a,o)),u)}}function Gy(e){return e?parseInt(e):1}function yze(e){const t=e.match(hze);if(!t)return NaN;const n=pk(t[1]),r=pk(t[2]),a=pk(t[3]);return Nze(n,r,a)?n*qR+r*LN+a*1e3:NaN}function pk(e){return e&&parseFloat(e.replace(",","."))||0}function xze(e){if(e==="Z")return 0;const t=e.match(pze);if(!t)return 0;
730const n=t[1]==="+"?-1:1,r=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return Aze(r,a)?n*(r*qR+a*LN):NaN}function bze(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,i=(t-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const wze=[31,null,31,30,31,30,31,31,30,31,30,31];function RQ(e){return e%400===0||e%4===0&&e%100!==0}function _ze(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(wze[t]||(RQ(e)?29:28))}function jze(e,t){return t>=1&&t<=(RQ(e)?366:365)}function Sze(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Nze(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Aze(e,t){return t>=0&&t<=59}function mk(e,t){const n=jn(e),r=n.getFullYear(),a=n.getDate(),i=Tr(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const o=dUe(i);return n.setMonth(t,Math.min(a,o)),n}function I7(e,t){const n=jn(e);return isNaN(+n)?Tr(e,NaN):(n.setFullYear(t),n)}var rn=function(){return rn=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},rn.apply(this,arguments)};function kze(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function IQ(e,t,n){for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function zb(e){return e.mode==="multiple"}function Wb(e){return e.mode==="range"}function MN(e){return e.mode==="single"}var Eze={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function Cze(e,t){return Dn(e,"LLLL y",t)}function Pze(e,t){return Dn(e,"d",t)}function Tze(e,t){return Dn(e,"LLLL",t)}function Oze(e){return"".concat(e)}function Rze(e,t){return Dn(e,"cccccc",t)}function Ize(e,t){return Dn(e,"yyyy",t)}var Lze=Object.freeze({__proto__:null,formatCaption:Cze,formatDay:Pze,formatMonthCaption:Tze,formatWeekNumber:Oze,formatWeekdayName:Rze,formatYearCaption:Ize}),Mze=function(e,t,n){return Dn(e,"do MMMM (EEEE)",n)},$ze=function(){return"Month: "},Dze=function(){return"Go to next month"},Fze=function(){return"Go to previous month"},Bze=function(e,t){return Dn(e,"cccc",t)},Uze=function(e){return"Week n. ".concat(e)},zze=function(){return"Year: "},Wze=Object.freeze({__proto__:null,labelDay:Mze,labelMonthDropdown:$ze,labelNext:Dze,labelPrevious:Fze,labelWeekNumber:Uze,labelWeekday:Bze,labelYearDropdown:zze});function qze(){var e="buttons",t=Eze,n=YR,r={},a={},i=1,o={},l=new Date;return{captionLayout:e,classNames:t,formatters:Lze,labels:Wze,locale:n,modifiersClassNames:r,modifiers:a,numberOfMonths:i,styles:o,today:l,mode:"default"}}function Vze(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,a=e.toMonth,i=e.fromDate,o=e.toDate;return r?i=Ds(r):t&&(i=new Date(t,0,1)),a?o=HR(a):n&&(o=new Date(n,11,31)),{fromDate:i?Os(i):void 0,toDate:o?Os(o):void 0}}var LQ=x.createContext(void 0);function Hze(e){var t,n=e.initialProps,r=qze(),a=Vze(n),i=a.fromDate,o=a.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;l!=="buttons"&&(!i||!o)&&(l="buttons");var c;(MN(n)||zb(n)||Wb(n))&&(c=n.onSelect);var u=rn(rn(rn({},r),n),{captionLayout:l,classNames:rn(rn({},r.classNames),n.classNames),components:rn({},n.components),formatters:rn(rn({},r.formatters),n.formatters),fromDate:i,labels:rn(rn({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:rn(rn({},r.modifiers),n.modifiers),modifiersClassNames:rn(rn({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:rn(rn({},r.styles),n.styles),toDate:o});return s.jsx(LQ.Provider,{value:u,children:e.children})}function Ur(){var e=x.useContext(LQ);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function MQ(e){var t=Ur(),n=t.locale,r=t.classNames,a=t.styles,i=t.formatters.formatCaption;return s.jsx("div",{className:r.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function Gze(e){return s.jsx("svg",rn({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:s.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.7
73078175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function $Q(e){var t,n,r=e.onChange,a=e.value,i=e.children,o=e.caption,l=e.className,c=e.style,u=Ur(),d=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Gze;return s.jsxs("div",{className:l,style:c,children:[s.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),s.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:a,onChange:r,children:i}),s.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[o,s.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function Yze(e){var t,n=Ur(),r=n.fromDate,a=n.toDate,i=n.styles,o=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return s.jsx(s.Fragment,{});if(!a)return s.jsx(s.Fragment,{});var f=[];if(dze(r,a))for(var p=Ds(r),h=r.getMonth();h<=a.getMonth();h++)f.push(mk(p,h));else for(var p=Ds(new Date),h=0;h<=11;h++)f.push(mk(p,h));var m=function(v){var y=Number(v.target.value),b=mk(Ds(e.displayMonth),y);e.onChange(b)},g=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:$Q;return s.jsx(g,{name:"months","aria-label":d(),className:c.dropdown_month,style:i.dropdown_month,onChange:m,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:o}),children:f.map(function(v){return s.jsx("option",{value:v.getMonth(),children:l(v,{locale:o})},v.getMonth())})})}function Kze(e){var t,n=e.displayMonth,r=Ur(),a=r.fromDate,i=r.toDate,o=r.locale,l=r.styles,c=r.classNames,u=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,p=[];if(!a)return s.jsx(s.Fragment,{});if(!i)return s.jsx(s.Fragment,{});for(var h=a.getFullYear(),m=i.getFullYear(),g=h;g<=m;g++)p.push(I7(SQ(new Date),g));var v=function(b){var w=I7(Ds(n),Number(b.target.value));e.onChange(w)},y=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:$Q;return s.jsx(y,{name:"years","aria-label":f(),className:c.dropdown_year,style:l.dropdown_year,onChange:v,value:n.getFullYear(),caption:d(n,{locale:o}),children:p.map(function(b){return s.jsx("option",{value:b.getFullYear(),children:d(b,{locale:o})},b.getFullYear())})})}function Zze(e,t){var n=x.useState(e),r=n[0],a=n[1],i=t===void 0?r:t;return[i,a]}function Xze(e){var t=e.month,n=e.defaultMonth,r=e.today,a=t||n||r||new Date,i=e.toDate,o=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(i&&nb(i,a)<0){var u=-1*(c-1);a=Tl(i,u)}return o&&nb(a,o)<0&&(a=o),Ds(a)}function Jze(){var e=Ur(),t=Xze(e),n=Zze(t,e.month),r=n[0],a=n[1],i=function(o){var l;if(!e.disableNavigation){var c=Ds(o);a(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[r,i]}function Qze(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,a=Ds(e),i=Ds(Tl(a,r)),o=nb(i,a),l=[],c=0;c<o;c++){var u=Tl(a,c);l.push(u)}return n&&(l=l.reverse()),l}function eWe(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=r?i:1,l=Ds(e);if(!n)return Tl(l,o);var c=nb(n,e);if(!(c<i))return Tl(l,o)}}function tWe(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=r?i:1,l=Ds(e);if(!n)return Tl(l,-o);var c=nb(l,n);if(!(c<=0))return Tl(l,-o)}}var DQ=x.createContext(void 0);function nWe(e){var t=Ur(),n=Jze(),r=n[0],a=n[1],i=Qze(r,t),o=eWe(r,t),l=tWe(r,t),c=function(f){return i.some(function(p){return eI(f,p)})},u=function(f,p){c(f)||(p&&Vh(f,p)?a(Tl(f,1+t.numberOfMonths*-1)):a(f))},d={currentMonth:r,displayMonths:i,goToMonth:a,goToDate:u,previousMonth:l,nextMonth:o,isDateDisplayed:c};return s.jsx(DQ.Provider,{value:d,children:e.children})}function qb(){var e=x.useContext(DQ);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function L7(e){var t,n=Ur(),r=n.classNames,a=n.styles,i=n.components,o=qb().goToMonth,l=function(d){o(Tl(d,e.displayIndex?-e.dis
730playIndex:0))},c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:MQ,u=s.jsx(c,{id:e.id,displayMonth:e.displayMonth});return s.jsxs("div",{className:r.caption_dropdowns,style:a.caption_dropdowns,children:[s.jsx("div",{className:r.vhidden,children:u}),s.jsx(Yze,{onChange:l,displayMonth:e.displayMonth}),s.jsx(Kze,{onChange:l,displayMonth:e.displayMonth})]})}function rWe(e){return s.jsx("svg",rn({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function aWe(e){return s.jsx("svg",rn({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var wj=x.forwardRef(function(e,t){var n=Ur(),r=n.classNames,a=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var o=i.join(" "),l=rn(rn({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),s.jsx("button",rn({},e,{ref:t,type:"button",className:o,style:l}))});function iWe(e){var t,n,r=Ur(),a=r.dir,i=r.locale,o=r.classNames,l=r.styles,c=r.labels,u=c.labelPrevious,d=c.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return s.jsx(s.Fragment,{});var p=u(e.previousMonth,{locale:i}),h=[o.nav_button,o.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:i}),g=[o.nav_button,o.nav_button_next].join(" "),v=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:aWe,y=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:rWe;return s.jsxs("div",{className:o.nav,style:l.nav,children:[!e.hidePrevious&&s.jsx(wj,{name:"previous-month","aria-label":p,className:h,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:a==="rtl"?s.jsx(v,{className:o.nav_icon,style:l.nav_icon}):s.jsx(y,{className:o.nav_icon,style:l.nav_icon})}),!e.hideNext&&s.jsx(wj,{name:"next-month","aria-label":m,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:a==="rtl"?s.jsx(y,{className:o.nav_icon,style:l.nav_icon}):s.jsx(v,{className:o.nav_icon,style:l.nav_icon})})]})}function M7(e){var t=Ur().numberOfMonths,n=qb(),r=n.previousMonth,a=n.nextMonth,i=n.goToMonth,o=n.displayMonths,l=o.findIndex(function(m){return eI(e.displayMonth,m)}),c=l===0,u=l===o.length-1,d=t>1&&(c||!u),f=t>1&&(u||!c),p=function(){r&&i(r)},h=function(){a&&i(a)};return s.jsx(iWe,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:a,previousMonth:r,onPreviousClick:p,onNextClick:h})}function sWe(e){var t,n=Ur(),r=n.classNames,a=n.disableNavigation,i=n.styles,o=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:MQ,u;return a?u=s.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?u=s.jsx(L7,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?u=s.jsxs(s.Fragment,{children:[s.jsx(L7,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),s.jsx(M7,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=s.jsxs(s.Fragment,{children:[s.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(M7,{displayMonth:e.displayMonth,id:e.id})]}),s.jsx("div",{className:r.caption,style:i.caption,children:u})}function oWe(e){var t=Ur(),n=t.footer,r=t.styles,a=t.classNames.tfoot;return n?s.jsx("tfoot",{className:a,style:r.tfoot,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,children:n})})}):s.jsx(s.Fragment,{})}function lWe(e,t,n){for(var r=n?ku(new Date):vo(new Date,{locale:e,weekStartsOn:t}),a=[],i=0;i<7;i++){var o=Ea(r,i);a.push(o)}return a}
730function cWe(){var e=Ur(),t=e.classNames,n=e.styles,r=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=lWe(a,i,o);return s.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&s.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(d,f){return s.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(d,{locale:a}),children:l(d,{locale:a})},f)})]})}function uWe(){var e,t=Ur(),n=t.classNames,r=t.styles,a=t.components,i=(e=a==null?void 0:a.HeadRow)!==null&&e!==void 0?e:cWe;return s.jsx("thead",{style:r.head,className:n.head,children:s.jsx(i,{})})}function dWe(e){var t=Ur(),n=t.locale,r=t.formatters.formatDay;return s.jsx(s.Fragment,{children:r(e.date,{locale:n})})}var tI=x.createContext(void 0);function fWe(e){if(!zb(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return s.jsx(tI.Provider,{value:t,children:e.children})}return s.jsx(hWe,{initialProps:e.initialProps,children:e.children})}function hWe(e){var t=e.initialProps,n=e.children,r=t.selected,a=t.min,i=t.max,o=function(u,d,f){var p,h;(p=t.onDayClick)===null||p===void 0||p.call(t,u,d,f);var m=!!(d.selected&&a&&(r==null?void 0:r.length)===a);if(!m){var g=!!(!d.selected&&i&&(r==null?void 0:r.length)===i);if(!g){var v=r?IQ([],r):[];if(d.selected){var y=v.findIndex(function(b){return ca(u,b)});v.splice(y,1)}else v.push(u);(h=t.onSelect)===null||h===void 0||h.call(t,v,u,d,f)}}},l={disabled:[]};r&&l.disabled.push(function(u){var d=i&&r.length>i-1,f=r.some(function(p){return ca(p,u)});return!!(d&&!f)});var c={selected:r,onDayClick:o,modifiers:l};return s.jsx(tI.Provider,{value:c,children:n})}function nI(){var e=x.useContext(tI);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function pWe(e,t){var n=t||{},r=n.from,a=n.to;return r&&a?ca(a,e)&&ca(r,e)?void 0:ca(a,e)?{from:a,to:void 0}:ca(r,e)?void 0:hu(r,e)?{from:e,to:a}:{from:r,to:e}:a?hu(e,a)?{from:a,to:e}:{from:e,to:a}:r?Vh(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var rI=x.createContext(void 0);function mWe(e){if(!Wb(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return s.jsx(rI.Provider,{value:t,children:e.children})}return s.jsx(gWe,{initialProps:e.initialProps,children:e.children})}function gWe(e){var t=e.initialProps,n=e.children,r=t.selected,a=r||{},i=a.from,o=a.to,l=t.min,c=t.max,u=function(h,m,g){var v,y;(v=t.onDayClick)===null||v===void 0||v.call(t,h,m,g);var b=pWe(h,r);(y=t.onSelect)===null||y===void 0||y.call(t,b,h,m,g)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],o?(d.range_end=[o],ca(i,o)||(d.range_middle=[{after:i,before:o}])):d.range_end=[i]):o&&(d.range_start=[o],d.range_end=[o]),l&&(i&&!o&&d.disabled.push({after:hk(i,l-1),before:Ea(i,l-1)}),i&&o&&d.disabled.push({after:i,before:Ea(i,l-1)}),!i&&o&&d.disabled.push({after:hk(o,l-1),before:Ea(o,l-1)})),c){if(i&&!o&&(d.disabled.push({before:Ea(i,-c+1)}),d.disabled.push({after:Ea(i,c-1)})),i&&o){var f=lc(o,i)+1,p=c-f;d.disabled.push({before:hk(i,p)}),d.disabled.push({after:Ea(o,p)})}!i&&o&&(d.disabled.push({before:Ea(o,-c+1)}),d.disabled.push({after:Ea(o,c-1)}))}return s.jsx(rI.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function aI(){var e=x.useContext(rI);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function l_(e){return Array.isArray(e)?IQ([],e):e!==void 0?[e]:[]}function vWe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],a=n[1];t[r]=l_(a)}),t}var Ol;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ol||(Ol={}));var yWe=Ol.Selected,Wc=Ol.Disabled,xWe=Ol.Hidden,bWe=Ol.Today,gk=Ol.RangeEnd,vk=Ol.RangeMiddle,yk=Ol.RangeStart,wWe=Ol.Outside;function _We(e,t,n){var r,a=(r={},r[yWe]=l_(e.selected),r[Wc]=l_(e.disabled),r[xWe]=l_(e.hidden),r[bWe]=[e.today],r[gk]=[],r[vk]=[],r[yk]=[],r[wWe]=[],r);return e.fromDate&&a[Wc].push({before:e.fromDate}),e.toDate&&a[Wc].push({after:e.toDate}),zb(e)?a[Wc]=a[Wc].concat(t.modifiers[Wc]):Wb(e)&&(a[Wc]=a[Wc].concat(n.modifiers[Wc]),a[yk]=n.modifiers[yk],a[vk]=n.modifiers[vk],a[gk]=n.modifiers[gk]),a}var FQ=x.createContext(void 0);function jWe(e){var t=Ur(),n=nI(),r=aI(),a=_We(t,n,r),i=vWe(t.modifiers),o=rn(rn({},a),i);return s.jsx(FQ.Provider,{value:o,children:e.children})}function BQ(){var e=x.useContext(FQ);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function SWe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function NWe(e){return!!(e&&typeof e=="object"&&"from"in e)}function AWe(e){return!!(e&&typeof e=="object"&&"after"in e)}function kWe(e){return!!(e&&typeof e=="object"&&"before"in e)}function EWe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function CWe(e,t){var n,r=t.from,a=t.to;if(r&&a){var i=lc(a,r)<0;i&&(n=[a,r],r=n[0],a=n[1]);var o=lc(e,r)>=0&&lc(a,e)>=0;return o}return a?ca(a,e):r?ca(r,e):!1}function PWe(e){return VR(e)}function TWe(e){return Array.isArray(e)&&e.every(VR)}function OWe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(PWe(n))return ca(e,n);if(TWe(n))return n.includes(e);if(NWe(n))return CWe(e,n);if(EWe(n))return n.dayOfWeek.includes(e.getDay());if(SWe(n)){var r=lc(n.before,e),a=lc(n.after,e),i=r>0,o=a<0,l=hu(n.before,n.after);return l?o&&i:i||o}return AWe(n)?lc(e,n.after)>0:kWe(n)?lc(n.before,e)>0:typeof n=="function"?n(e):!1})}function iI(e,t,n){var r=Object.keys(t).reduce(function(i,o){var l=t[o];return OWe(e,l)&&i.push(o),i},[]),a={};return r.forEach(function(i){return a[i]=!0}),n&&!eI(e,n)&&(a.outside=!0),a}function RWe(e,t){for(var n=Ds(e[0]),r=HR(e[e.length-1]),a,i,o=n;o<=r;){var l=iI(o,t),c=!l.disabled&&!l.hidden;if(!c){o=Ea(o,1);continue}if(l.selected)return o;l.today&&!i&&(i=o),a||(a=o),o=Ea(o,1)}return i||a}var IWe=365;function UQ(e,t){var n=t.moveBy,r=t.direction,a=t.context,i=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=a.weekStartsOn,u=a.fromDate,d=a.toDate,f=a.locale,p={day:Ea,week:W4,month:Tl,year:m9e,startOfWeek:function(v){return a.ISOWeek?ku(v):vo(v,{locale:f,weekStartsOn:c})},endOfWeek:function(v){return a.ISOWeek?NQ(v):GR(v,{locale:f,weekStartsOn:c})}},h=p[n](e,r==="after"?1:-1);r==="before"&&u?h=g9e([u,h]):r==="after"&&d&&(h=v9e([d,h]));var m=!0;if(i){var g=iI(h,i);m=!g.disabled&&!g.hidden}return m?h:l.count>IWe?l.lastFocused:UQ(h,{moveBy:n,direction:r,context:a,modifiers:i,retry:rn(rn({},l),{count:l.count+1})})}var zQ=x.createContext(void 0);function LWe(e){var t=qb(),n=BQ(),r=x.useState(),a=r[0],i=r[1],o=x.use
730State(),l=o[0],c=o[1],u=RWe(t.displayMonths,n),d=a??(l&&t.isDateDisplayed(l))?l:u,f=function(){c(a),i(void 0)},p=function(v){i(v)},h=Ur(),m=function(v,y){if(a){var b=UQ(a,{moveBy:v,direction:y,context:h,modifiers:n});ca(a,b)||(t.goToDate(b,a),p(b))}},g={focusedDay:a,focusTarget:d,blur:f,focus:p,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return s.jsx(zQ.Provider,{value:g,children:e.children})}function sI(){var e=x.useContext(zQ);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function MWe(e,t){var n=BQ(),r=iI(e,n,t);return r}var oI=x.createContext(void 0);function $We(e){if(!MN(e.initialProps)){var t={selected:void 0};return s.jsx(oI.Provider,{value:t,children:e.children})}return s.jsx(DWe,{initialProps:e.initialProps,children:e.children})}function DWe(e){var t=e.initialProps,n=e.children,r=function(i,o,l){var c,u,d;if((c=t.onDayClick)===null||c===void 0||c.call(t,i,o,l),o.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,i,o,l);return}(d=t.onSelect)===null||d===void 0||d.call(t,i,i,o,l)},a={selected:t.selected,onDayClick:r};return s.jsx(oI.Provider,{value:a,children:n})}function WQ(){var e=x.useContext(oI);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function FWe(e,t){var n=Ur(),r=WQ(),a=nI(),i=aI(),o=sI(),l=o.focusDayAfter,c=o.focusDayBefore,u=o.focusWeekAfter,d=o.focusWeekBefore,f=o.blur,p=o.focus,h=o.focusMonthBefore,m=o.focusMonthAfter,g=o.focusYearBefore,v=o.focusYearAfter,y=o.focusStartOfWeek,b=o.focusEndOfWeek,w=function(H){var $,W,ee,V;MN(n)?($=r.onDayClick)===null||$===void 0||$.call(r,e,t,H):zb(n)?(W=a.onDayClick)===null||W===void 0||W.call(a,e,t,H):Wb(n)?(ee=i.onDayClick)===null||ee===void 0||ee.call(i,e,t,H):(V=n.onDayClick)===null||V===void 0||V.call(n,e,t,H)},j=function(H){var $;p(e),($=n.onDayFocus)===null||$===void 0||$.call(n,e,t,H)},S=function(H){var $;f(),($=n.onDayBlur)===null||$===void 0||$.call(n,e,t,H)},A=function(H){var $;($=n.onDayMouseEnter)===null||$===void 0||$.call(n,e,t,H)},E=function(H){var $;($=n.onDayMouseLeave)===null||$===void 0||$.call(n,e,t,H)},k=function(H){var $;($=n.onDayPointerEnter)===null||$===void 0||$.call(n,e,t,H)},P=function(H){var $;($=n.onDayPointerLeave)===null||$===void 0||$.call(n,e,t,H)},R=function(H){var $;($=n.onDayTouchCancel)===null||$===void 0||$.call(n,e,t,H)},C=function(H){var $;($=n.onDayTouchEnd)===null||$===void 0||$.call(n,e,t,H)},I=function(H){var $;($=n.onDayTouchMove)===null||$===void 0||$.call(n,e,t,H)},D=function(H){var $;($=n.onDayTouchStart)===null||$===void 0||$.call(n,e,t,H)},U=function(H){var $;($=n.onDayKeyUp)===null||$===void 0||$.call(n,e,t,H)},q=function(H){var $;switch(H.key){case"ArrowLeft":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":H.preventDefault(),H.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":H.preventDefault(),H.stopPropagation(),u();break;case"ArrowUp":H.preventDefault(),H.stopPropagation(),d();break;case"PageUp":H.preventDefault(),H.stopPropagation(),H.shiftKey?g():h();break;case"PageDown":H.preventDefault(),H.stopPropagation(),H.shiftKey?v():m();break;case"Home":H.preventDefault(),H.stopPropagation(),y();break;case"End":H.preventDefault(),H.stopPropagation(),b();break}($=n.onDayKeyDown)===null||$===void 0||$.call(n,e,t,H)},Z={onClick:w,onFocus:j,onBlur:S,onKeyDown:q,onKeyUp:U,onMouseEnter:A,onMouseLeave:E,onPointerEnter:k,onPointerLeave:P,onTouchCancel:R,onTouchEnd:C,onTouchMove:I,onTouchStart:D};return Z}function BWe(){var e=Ur(),t=WQ(),n=nI(),r=aI(),a=MN(e)?t.selected:zb(e)?n.selected:Wb(e)?r.selected:void 0;return a}function UWe(e){return Object.values(Ol).includes(e)}function zWe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var a=e.modifiersClassNames[r];if(a)n.push(a);else if(UWe(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function WWe(e,t){var n=rn({},e.styles.day);return Object.keys(t).forEach(function(r){var a;n=rn(rn({},n),(a=e.modifiersStyles)===null||a===void 0?void 0:a[r])}),n}function qWe(e,t,n){var r,a,i,o=Ur(),l=sI(),c=MWe(e,t),u=FWe(e,c),d=BWe(),f=!!(o.onDayCl
730ick||o.mode!=="default");x.useEffect(function(){var A;c.outside||l.focusedDay&&f&&ca(l.focusedDay,e)&&((A=n.current)===null||A===void 0||A.focus())},[l.focusedDay,e,n,f,c.outside]);var p=zWe(o,c).join(" "),h=WWe(o,c),m=!!(c.outside&&!o.showOutsideDays||c.hidden),g=(i=(a=o.components)===null||a===void 0?void 0:a.DayContent)!==null&&i!==void 0?i:dWe,v=s.jsx(g,{date:e,displayMonth:t,activeModifiers:c}),y={style:h,className:p,children:v,role:"gridcell"},b=l.focusTarget&&ca(l.focusTarget,e)&&!c.outside,w=l.focusedDay&&ca(l.focusedDay,e),j=rn(rn(rn({},y),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||b?0:-1,r)),u),S={isButton:f,isHidden:m,activeModifiers:c,selectedDays:d,buttonProps:j,divProps:y};return S}function VWe(e){var t=x.useRef(null),n=qWe(e.date,e.displayMonth,t);return n.isHidden?s.jsx("div",{role:"gridcell"}):n.isButton?s.jsx(wj,rn({name:"day",ref:t},n.buttonProps)):s.jsx("div",rn({},n.divProps))}function HWe(e){var t=e.number,n=e.dates,r=Ur(),a=r.onWeekNumberClick,i=r.styles,o=r.classNames,l=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(t),{locale:l});if(!a)return s.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:d});var f=c(Number(t),{locale:l}),p=function(h){a(t,n,h)};return s.jsx(wj,{name:"week-number","aria-label":f,className:o.weeknumber,style:i.weeknumber,onClick:p,children:d})}function GWe(e){var t,n,r=Ur(),a=r.styles,i=r.classNames,o=r.showWeekNumber,l=r.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:VWe,u=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:HWe,d;return o&&(d=s.jsx("td",{className:i.cell,style:a.cell,children:s.jsx(u,{number:e.weekNumber,dates:e.dates})})),s.jsxs("tr",{className:i.row,style:a.row,children:[d,e.dates.map(function(f){return s.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:s.jsx(c,{displayMonth:e.displayMonth,date:f})},pUe(f))})]})}function $7(e,t,n){for(var r=n!=null&&n.ISOWeek?NQ(t):GR(t,n),a=n!=null&&n.ISOWeek?ku(e):vo(e,n),i=lc(r,a),o=[],l=0;l<=i;l++)o.push(Ea(a,l));var c=o.reduce(function(u,d){var f=n!=null&&n.ISOWeek?KR(d):XR(d,n),p=u.find(function(h){return h.weekNumber===f});return p?(p.dates.push(d),u):(u.push({weekNumber:f,dates:[d]}),u)},[]);return c}function YWe(e,t){var n=$7(Ds(e),HR(e),t);if(t!=null&&t.useFixedWeeks){var r=gUe(e,t);if(r<6){var a=n[n.length-1],i=a.dates[a.dates.length-1],o=W4(i,6-r),l=$7(W4(i,1),o,t);n.push.apply(n,l)}}return n}function KWe(e){var t,n,r,a=Ur(),i=a.locale,o=a.classNames,l=a.styles,c=a.hideHead,u=a.fixedWeeks,d=a.components,f=a.weekStartsOn,p=a.firstWeekContainsDate,h=a.ISOWeek,m=YWe(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:h,locale:i,weekStartsOn:f,firstWeekContainsDate:p}),g=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:uWe,v=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:GWe,y=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:oWe;return s.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&s.jsx(g,{}),s.jsx("tbody",{className:o.tbody,style:l.tbody,children:m.map(function(b){return s.jsx(v,{displayMonth:e.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),s.jsx(y,{displayMonth:e.displayMonth})]})}function ZWe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var XWe=ZWe()?x.useLayoutEffect:x.useEffect,xk=!1,JWe=0;function D7(){return"react-day-picker-".concat(++JWe)}function QWe(e){var t,n=e??(xk?D7():null),r=x.useState(n),a=r[0],i=r[1];return XWe(function(){a===null&&i(D7())},[]),x.useEffect(function(){xk===!1&&(xk=!0)},[]),(t=e??a)!==null&&t!==void 0?t:void 0}function eqe(e){var t,n,r=Ur(),a=r.dir,i=r.classNames,o=r.styles,l=r.components,c=qb().displayMonths,u=QWe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],p=o.month,h=e.displayIndex===0,m=e.displayIndex===c.length-1,g=!h&&!m;a==="rtl"&&(t=[h,m],m=t[0],h=t[1]),h&&(f.push(i.caption_start),p=rn(rn({},p),o.caption_start)),m&&(f.push(i.caption_end),p=rn(rn({},p),o.caption_end)),g&&(f.push(i.caption_between),p=rn(rn({},p),o.caption_between));var v=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:sWe;return s.jsxs("div",{className:f.join(" "),style:p,children:[s.jsx(v,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(KWe,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function tqe(e){var t=Ur(),n=t.classNames,r=t.styles;return s.jsx("div",{className:n.months,style:r.months,children:e.children})}
730function nqe(e){var t,n,r=e.initialProps,a=Ur(),i=sI(),o=qb(),l=x.useState(!1),c=l[0],u=l[1];x.useEffect(function(){a.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),u(!0)))},[a.initialFocus,c,i.focus,i.focusTarget,i]);var d=[a.classNames.root,a.className];a.numberOfMonths>1&&d.push(a.classNames.multiple_months),a.showWeekNumber&&d.push(a.classNames.with_weeknumber);var f=rn(rn({},a.styles.root),a.style),p=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,g){var v;return rn(rn({},m),(v={},v[g]=r[g],v))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:tqe;return s.jsx("div",rn({className:d.join(" "),style:f,dir:a.dir,id:a.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:s.jsx(h,{children:o.displayMonths.map(function(m,g){return s.jsx(eqe,{displayIndex:g,displayMonth:m},g)})})}))}function rqe(e){var t=e.children,n=kze(e,["children"]);return s.jsx(Hze,{initialProps:n,children:s.jsx(nWe,{children:s.jsx($We,{initialProps:n,children:s.jsx(fWe,{initialProps:n,children:s.jsx(mWe,{initialProps:n,children:s.jsx(jWe,{children:s.jsx(LWe,{children:t})})})})})})})}function aqe(e){return s.jsx(rqe,rn({},e,{children:s.jsx(nqe,{initialProps:e})}))}function $N({className:e,classNames:t,showOutsideDays:n=!0,...r}){return s.jsx(aqe,{showOutsideDays:n,className:Ye("p-3 pointer-events-auto",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Ye(hx({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Ye(hx({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...a})=>s.jsx(Sb,{className:"h-4 w-4"}),IconRight:({...a})=>s.jsx(Ho,{className:"h-4 w-4"})},...r})}$N.displayName="Calendar";const qQ="America/Chicago",iqe=60*60*1e3,VQ=(e,t)=>{const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(e);return Object.fromEntries(n.map(({type:r,value:a})=>[r,a]))},bm=()=>{const e=VQ(new Date,qQ);return`${e.year}-${e.month}-${e.day}`},hh=e=>HQ(e.slot_date,e.start_time)>new Date,HQ=(e,t)=>{const[n,r,a]=e.split("-").map(Number),[i,o]=t.split(":").map(Number),l=new Date(Date.UTC(n,r-1,a,i,o,0)),c=VQ(l,qQ),u=Date.UTC(Number(c.year),Number(c.month)-1,Number(c.day),Number(c.hour),Number(c.minute),Number(c.second));return new Date(l.getTime()-(u-l.getTime()))},_j=({open:e,onOpenChange:t,availableSlots:n,onBookSlot:r,isBooking:a,isRescheduling:i=!1,existingBooking:o,onReschedule:l})=>{const[c,u]=x.useState(void 0),[d,f]=x.useState(null),[p,h]=x.useState(new Date);x.useEffect(()=>{d&&!n.some(R=>R.id===d)&&f(null)},[n,d]);const m=x.useMemo(()=>{const R={};return n.filter(hh).forEach(C=>{R[C.slot_date]||(R[C.slot_date]=[]),R[C.slot_date].push(C)}),R},[n]),g=x.useMemo(()=>Object.keys(m).map(R=>xr(R)),[m]),v=x.useMemo(()=>
730{if(!c)return[];const R=Dn(c,"yyyy-MM-dd");return m[R]||[]},[c,m]),y=R=>{const[C,I]=R.split(":"),D=parseInt(C);return`${D%12||12}:${I} ${D>=12?"PM":"AM"}`},b=(R,C)=>{const[I,D]=R.split(":").map(Number),[U,q]=C.split(":").map(Number),Z=I*60+D;return U*60+q-Z},w=R=>{if(R<60)return`${R} minutes`;if(R===60)return"1 hour";if(R%60===0)return`${R/60} hours`;{const C=Math.floor(R/60),I=R%60;return`${C} hr ${I} min`}},j=async()=>{d&&(i&&o&&l?await l(d,o.slot_id,o.id):await r(d),f(null),u(void 0))},S=R=>g.some(C=>ca(R,C)),A=R=>{u(R),f(null)},E=i?"Reschedule Your Interview":"Schedule Your Family Interview",k=i?"Select a new date and time for your interview. Your previous slot will be freed for other families.":"Select an available date, then choose a time slot. All family members applying should attend.",P=i?"Confirm Reschedule":"Confirm Interview";return s.jsx(_a,{open:e,onOpenChange:t,children:s.jsxs(ha,{className:"max-w-3xl max-h-[90vh] overflow-auto",children:[s.jsxs($a,{children:[s.jsxs(Da,{className:"flex items-center gap-2",children:[i?s.jsx(of,{className:"w-5 h-5 text-primary"}):s.jsx(yi,{className:"w-5 h-5 text-primary"}),E]}),s.jsx(Bs,{children:k})]}),i&&o&&s.jsxs("div",{className:"bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-amber-800 dark:text-amber-200 font-medium text-sm",children:[s.jsx(Fn,{className:"w-4 h-4"}),"Current Interview"]}),s.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300 mt-1",children:o.interview_slots?`${Dn(xr(o.interview_slots.slot_date),"EEEE, MMMM d, yyyy")} at ${y(o.interview_slots.start_time)}`:"Scheduled interview (details unavailable)"})]}),n.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx(er,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground"}),s.jsx("h3",{className:"font-medium text-lg",children:"No Available Slots"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"There are no interview slots available at this time. Please check back later."})]}):s.jsxs("div",{className:"grid md:grid-cols-2 gap-6 py-4",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Step 1: Select a Date"}),s.jsx(Ve,{children:s.jsx(He,{className:"p-3",children:s.jsx($N,{mode:"single",selected:c,onSelect:A,month:p,onMonthChange:h,className:"pointer-events-auto",modifiers:{available:g},modifiersStyles:{available:{fontWeight:"bold"}},disabled:R=>{const C=new Date;return C.setHours(0,0,0,0),Vh(R,C)||!S(R)},components:{DayContent:({date:R})=>{const C=S(R);return s.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",children:[s.jsx("span",{children:R.getDate()}),C&&s.jsx("span",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full bg-primary"})]})}}})})}),s.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),s.jsx("span",{children:"Available dates"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"w-2 h-2 rounded-full bg-muted"}),s.jsx("span",{children:"No availability"})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:"Step 2: Choose a Time"}),c?s.jsxs(Ve,{children:[s.jsxs(_t,{className:"pb-3",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[s.jsx(yi,{className:"w-4 h-4"}),Dn(c,"EEEE, MMMM d, yyyy")]}),s.jsxs(qn,{children:[v.length," time slot",v.length!==1?"s":""," available"]})]}),s.jsx(He,{className:"space-y-2",children:v.length===0?s.jsx("p",{className:"text-center py-4 text-muted-foreground",children:"No slots available for this date"}):v.map(R=>s.jsxs(we,{variant:d===R.id?"default":"outline",className:Ye("w-full justify-start h-auto py-3",d===R.id&&"ring-2 ring-primary ring-offset-2"),onClick:()=>f(R.id),children:[s.jsx(Fn,{className:"w-4 h-4 mr-3"}),s.jsxs("div",{className:"text-left",children:[s.jsxs("div",{className:"font-medium",children:[y(R.start_time)," - ",y(R.end_time)]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Duration: ",w(b(R.start_time,R.end_time))]})]}),d===R.id&&s.jsx(Nt,{className:"w-4 h-4 ml-auto text-primary-foreground"})]},R.id))})]}):s.jsx(Ve,{className:"border-dashed",children:s.jsxs(He,{className:"py-12 text-center text-muted-foreground",children:[s.jsx(yi,{className:"w-10 h-10 mx-auto mb-3 opacity-50"}),s.jsx("p",{children:"Select a date with available slots to view times"})]})})]})]}),s.jsxs(Qi,{className:"flex-col sm:flex-row gap-2",children:[s.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(we,{onClick:j,disabled:!d||a,className:"gap-2",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 animate-spin"}),i?"Rescheduling...":"Booking..."]}):s.jsxs(s.Fragment,{children:[i?s.jsx(of,{className:"w-4 h-4"}):s.jsx(Nt,{className:"w-4 h-4"}),P]})})]})]})})},GQ=e=>{if(!e)return{allowed:!1,message:"No booking found"};if(e.status==="cancelled")return{allowed:!1,message:"This interview has already been cancelled."};if(!e.interview_slots)return{allowed:!0};const t=new Date,n=HQ(e.interview_slots.slot_date,e.interview_slots.start_time),r=new Date(n.getTime()-iqe);return t>=r?{allowed:!1,message:"Rescheduling or cancellation is not available within 1 hour of the scheduled interview time."}:{allowed:!0}},sqe=()=>{var j,S,A,E,k;const{user:e,profile:t,loading:n}=bi(),r=Ab(),a=th({queryKey:["family-applications",e==null?void 0:e.id],queryFn:async()=>
730{if(!e)return[];const{data:P,error:R}=await Re.from("applications").select("*").eq("user_id",e.id).order("created_at",{ascending:!1});if(R)throw R;return P||[]},enabled:!!e&&!n,staleTime:3e4,gcTime:5*60*1e3}),i=th({queryKey:["family-students",e==null?void 0:e.id],queryFn:async()=>{if(!e)return[];const{data:P,error:R}=await Re.from("students").select("*").eq("user_id",e.id);if(R)throw R;return P||[]},enabled:!!e&&!n,staleTime:3e4,gcTime:5*60*1e3}),o=th({queryKey:["family-guardians",e==null?void 0:e.id],queryFn:async()=>{if(!e)return[];const{data:P,error:R}=await Re.from("guardians").select("*").eq("user_id",e.id);if(R)throw R;return P||[]},enabled:!!e&&!n,staleTime:3e4,gcTime:5*60*1e3}),l=(S=(j=a.data)==null?void 0:j[0])==null?void 0:S.id,c=th({queryKey:["family-documents",e==null?void 0:e.id,l],queryFn:async()=>{if(!e||!l)return[];const{data:P,error:R}=await Re.from("documents").select("*").eq("application_id",l);if(R)throw R;return(P||[]).map(C=>({...C,document_type:C.document_type||"",status:C.status}))},enabled:!!e&&!n&&!!l,staleTime:3e4,gcTime:5*60*1e3}),u=(t==null?void 0:t.applicant_type)==="new",d=th({queryKey:["family-interview-booking",e==null?void 0:e.id,l],queryFn:async()=>{if(!e||!l||!u)return null;const{data:P,error:R}=await Re.from("interview_bookings").select("id, slot_id, status, application_id, interview_slots(*)").eq("user_id",e.id).eq("application_id",l).neq("status","cancelled").order("created_at",{ascending:!1}).limit(1).maybeSingle();if(R)throw R;return P},enabled:!!e&&!n&&!!l&&u,staleTime:3e4,gcTime:5*60*1e3}),f=th({queryKey:["family-available-slots"],queryFn:async()=>{if(!e||!u)return[];const{data:P,error:R}=await Re.from("interview_slots").select("*").eq("is_booked",!1).gte("slot_date",bm()).order("slot_date",{ascending:!0}).order("start_time",{ascending:!0});if(R)throw R;return(P||[]).filter(hh)},enabled:!!e&&!n&&u,staleTime:3e4,gcTime:5*60*1e3});x.useEffect(()=>{if(!e)return;const P=Re.channel("family-data-sync").on("postgres_changes",{event:"*",schema:"public",table:"applications",filter:`user_id=eq.${e.id}`},()=>{r.invalidateQueries({queryKey:["family-applications"]})}).on("postgres_changes",{event:"*",schema:"public",table:"students",filter:`user_id=eq.${e.id}`},()=>{r.invalidateQueries({queryKey:["family-students"]})}).on("postgres_changes",{event:"*",schema:"public",table:"documents",filter:`user_id=eq.${e.id}`},()=>{r.invalidateQueries({queryKey:["family-documents"]})}).on("postgres_changes",{event:"*",schema:"public",table:"interview_slots"},()=>{r.invalidateQueries({queryKey:["family-available-slots"]}),r.invalidateQueries({queryKey:["family-interview-booking"]})}).on("postgres_changes",{event:"*",schema:"public",table:"interview_bookings",filter:`user_id=eq.${e.id}`},()=>{r.invalidateQueries({queryKey:["family-interview-booking"]}),r.invalidateQueries({queryKey:["family-available-slots"]})}).subscribe();return()=>{Re.removeChannel(P)}},[e==null?void 0:e.id,r]);const p=((A=a.data)==null?void 0:A[0])||null,h=((E=o.data)==null?void 0:E.filter(P=>P.application_id===l))||[],m=((k=i.data)==null?void 0:k.filter(P=>P.application_id===l))||[],g=n||a.isLoading||i.isLoading||o.isLoading||(l?c.isLoading:!1),v=async()=>{await Promise.all([a.refetch(),i.refetch(),o.refetch(),c.refetch(),d.refetch(),f.refetch()])},y=P=>{var R;return((R=i.data)==null?void 0:R.filter(C=>C.application_id===P))||[]},b=P=>{var R;return((R=o.data)==null?void 0:R.filter(C=>C.application_id===P))||[]},w=async P=>{if(P===l)return c.data||[];const{data:R}=await Re.from("documents").select("*").eq("application_id",P);return(R||[]).map(C=>({...C,document_type:C.document_type||"",status:C.status}))};return{applications:a.data||[],allStudents:i.data||[],allGuardians:o.data||[],primaryApplication:p,primaryAppId:l,documents:c.data||[],guardians:h,students:m,existingBooking:d.data,availableSlots:f.data||[],isLoading:g,isRefetching:a.isRefetching,refetchAll:v,invalidateApplications:()=>r.invalidateQueries({queryKey:["family-applications"]}),invalidateDocuments:()=>r.invalidateQueries({queryKey:["family-documents"]}),getStudentsByAppId:y,getGuardiansByAppId:b,getDocumentsByAppId:w}},oqe={pending:{label:"Pending",icon:Fn,className:"status-pending border"},approved:{label:"Approved",icon:Nt,className:"status-approved border"},rejected:{label:"Rejected",icon:Pa,className:"status-rejected border"},missing:{label:"Missing",icon:er,className:"status-missing border"},draft:{label:"Draft",icon:En,className:"status-draft border"},submitted:{label:"Submitted",icon:fa,className:"status-pending border"},under_review:{label:"Under Review",icon:$s,className:"status-review border"},uploaded:{label:"Uploaded",icon:fa,className:"status-pending border"},needs_resubmission:{label:"Resubmit",icon:er,className:"status-rejected border"},scheduled:{label:"Scheduled",icon:Fn,className:"status-review border"},completed:{label:"Completed",icon:Nt,className:"status-approved border"},cancelled:{label:"Cancelled",icon:Pa,className:"status-draft border"},waitlisted:{label:"Waitlisted",icon:Fn,className:"bg-orange-100 text-orange-800 border-orange-200"}},lqe={sm:"text-xs px-2 py-0.5 gap-1",md:"text-xs px-2.5 py-1 gap-1.5",lg:"text-sm px-3 py-1.5 gap-2"},cqe={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},jj=({status:e,size:t="md",showIcon:n=!0,className:r})=>{const a=oqe[e]||{label:e,icon:Jse,className:"status-draft border"},i=a.icon;return s.jsxs("span",{className:Ye("inline-flex items-center font-medium rounded-full whitespace-nowrap",lqe[t],a.className,r),children:[n&&s.jsx(i,{className:cqe[t]}),a.label]})};function uqe(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var lI="ScrollArea",[YQ,iQe]=ui(lI),[dqe,tl]=YQ(lI),KQ=x.forwardRef((e,t)=>
vendor: 8,870 bytes, line 730
730{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...o}=e,[l,c]=x.useState(null),[u,d]=x.useState(null),[f,p]=x.useState(null),[h,m]=x.useState(null),[g,v]=x.useState(null),[y,b]=x.useState(0),[w,j]=x.useState(0),[S,A]=x.useState(!1),[E,k]=x.useState(!1),P=sn(t,C=>c(C)),R=jp(a);return s.jsx(dqe,{scope:n,type:r,dir:R,scrollHideDelay:i,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:A,scrollbarY:g,onScrollbarYChange:v,scrollbarYEnabled:E,onScrollbarYEnabledChange:k,onCornerWidthChange:b,onCornerHeightChange:j,children:s.jsx(pt.div,{dir:R,...o,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});KQ.displayName=lI;var ZQ="ScrollAreaViewport",XQ=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=tl(ZQ,n),l=x.useRef(null),c=sn(t,l,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(pt.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});XQ.displayName=ZQ;var Ac="ScrollAreaScrollbar",cI=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=tl(Ac,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,l=e.orientation==="horizontal";return x.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),a.type==="hover"?s.jsx(fqe,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(hqe,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(JQ,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(uI,{...r,ref:t}):null});cI.displayName=Ac;var fqe=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=tl(Ac,e.__scopeScrollArea),[i,o]=x.useState(!1);return x.useEffect(()=>{const l=a.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(Ka,{present:n||i,children:s.jsx(JQ,{"data-state":i?"visible":"hidden",...r,ref:t})})}),hqe=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=tl(Ac,e.__scopeScrollArea),i=e.orientation==="horizontal",o=FN(()=>c("SCROLL_END"),100),[l,c]=uqe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,a.scrollHideDelay,c]),x.useEffect(()=>{const u=a.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const h=u[d];f!==h&&(c("SCROLL"),o()),f=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[a.viewport,i,c,o]),s.jsx(Ka,{present:n||l!=="hidden",children:s.jsx(uI,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ht(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ht(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),JQ=x.forwardRef((e,t)=>{const n=tl(Ac,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=x.useState(!1),l=e.orientation==="horizontal",c=FN(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?u:d)}},10);return wv(n.viewport,c),wv(n.content,c),s.jsx(Ka,{present:r||i,children:s.jsx(uI,{"data-state":i?"visible":"hidden",...a,ref:t})})}),uI=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=tl(Ac,e.__scopeScrollArea),i=x.useRef(null),o=x.useRef(0),[l,c]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ree(l.viewport,l.content),d={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function f(p,h){return xqe(p,o.current,l,h)}return n==="horizontal"?s.jsx(pqe,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const p=a.viewport.scrollLeft,h=F7(p,l,a.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{a.viewport&&(a.viewport.scrollLeft=p)},onDragScroll:p=>{a.viewport&&(a.viewport.scrollLeft=f(p,a.dir))}}):n==="vertical"?s.jsx(mqe,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const p=a.viewport.scrollTop,h=F7(p,l);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{a.viewport&&(a.viewport.scrollTop=p)},onDragScroll:p=>{a.viewport&&(a.viewport.scrollTop=f(p))}}):null}),pqe=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=tl(Ac,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),u=sn(t,c,i.onScrollbarXChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(eee,{"data-orientation":"horizontal",...a,ref:u,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":DN(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),iee(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Nj(o.paddingLeft),paddingEnd:Nj(o.paddingRight)}})}})}),mqe=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=tl(Ac,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),u=sn(t,c,i.onScrollbarYChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(eee,{"data-orientation":"vertical",...a,ref:u,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":DN(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),iee(p,f)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Nj(o.paddingTop),paddingEnd:Nj(o.paddingBottom)}})}})}),[gqe,QQ]=YQ(Ac),eee=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,h=tl(Ac,n),[m,g]=x.useState(null),v=sn(t,P=>g(P)),y=x.useRef(null),b=x.useRef(""),w=h.viewport,j=r.content-r.viewport,S=Pr(d),A=Pr(c),E=FN(f,10);function k(P){if(y.current){const R=P.clientX-y.current.left,C=P.clientY-y.current.top;u({x:R,y:C})}}return x.useEffect(()=>{const P=R=>{const C=R.target;(m==null?void 0:m.contains(C))&&S(R,j)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[w,m,j,S]),x.useEffect(A,[r,A]),wv(m,E),wv(h.content,E),s.jsx(gqe,{scope:n,scrollbar:m,hasThumb:a,onThumbChange:Pr(i),onThumbPointerUp:Pr(o),onThumbPositionChange:A,onThumbPointerDown:Pr(l),children:s.jsx(pt.div,{...p,ref:v,style:{position:"absolute",...p.style},onPointerDown:ht(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),y.current=m.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),k(P))}),onPointerMove:ht(e.onPointerMove,k),onPointerUp:ht(e.onPointerUp,P=>{const R=P.target;R.hasPointerCapture(P.pointerId)&&R.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})})}),Sj="ScrollAreaThumb",tee=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=QQ(Sj,e.__scopeScrollArea);return s.jsx(Ka,{present:n||a.hasThumb,children:s.jsx(vqe,{ref:t,...r})})}),vqe=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=tl(Sj,n),o=QQ(Sj,n),{onThumbPositionChange:l}=o,c=sn(t,f=>o.onThumbChange(f)),u=x.useRef(void 0),d=FN(()=>{u.current&&(u.current(),u.current=void 0)},100);return x.useEffect(()=>{const f=i.viewport;if(f){const p=()=>
730{if(d(),!u.current){const h=bqe(f,l);u.current=h,l()}};return l(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,d,l]),s.jsx(pt.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ht(e.onPointerDownCapture,f=>{const h=f.target.getBoundingClientRect(),m=f.clientX-h.left,g=f.clientY-h.top;o.onThumbPointerDown({x:m,y:g})}),onPointerUp:ht(e.onPointerUp,o.onThumbPointerUp)})});tee.displayName=Sj;var dI="ScrollAreaCorner",nee=x.forwardRef((e,t)=>{const n=tl(dI,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(yqe,{...e,ref:t}):null});nee.displayName=dI;var yqe=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=tl(dI,n),[i,o]=x.useState(0),[l,c]=x.useState(0),u=!!(i&&l);return wv(a.scrollbarX,()=>{var f;const d=((f=a.scrollbarX)==null?void 0:f.offsetHeight)||0;a.onCornerHeightChange(d),c(d)}),wv(a.scrollbarY,()=>{var f;const d=((f=a.scrollbarY)==null?void 0:f.offsetWidth)||0;a.onCornerWidthChange(d),o(d)}),u?s.jsx(pt.div,{...r,ref:t,style:{width:i,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Nj(e){return e?parseInt(e,10):0}function ree(e,t){const n=e/t;return isNaN(n)?0:n}function DN(e){const t=ree(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function xqe(e,t,n,r="ltr"){const a=DN(n),i=a/2,o=t||i,l=a-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return aee([c,u],f)(e)}function F7(e,t,n="ltr"){const r=DN(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,o]:[o*-1,0],u=$4(e,c);return aee([0,o],[0,l])(u)}function aee(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function iee(e,t){return e>0&&e<t}var bqe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,l=n.top!==i.top;(o||l)&&t(),n=i,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function FN(e,t){const n=Pr(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function wv(e,t){const n=Pr(t);Xr(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var see=KQ,wqe=XQ,_qe=nee;const fI=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(see,{ref:r,className:Ye("relative overflow-hidden",e),...n,children:[s.jsx(wqe,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(oee,{}),s.jsx(_qe,{})]}));fI.displayName=see.displayName;const oee=x.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(cI,{ref:r,orientation:t,className:Ye("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(tee,{className:"relative flex-1 rounded-full bg-border"})}));oee.displayName=cI.displayName;const BN=kX,UN=AR,zN=ER,B7={draft:{bg:"bg-muted",text:"text-muted-foreground"},submitted:{bg:"bg-blue-100",text:"text-blue-700"},under_review:{bg:"bg-amber-100",text:"text-amber-700"},approved:{bg:"bg-green-100",text:"text-green-700"},rejected:{bg:"bg-red-100",text:"text-red-700"}},U7={returning:{bg:"bg-blue-50",text:"text-blue-600",icon:q_},new:{bg:"bg-purple-50",text:"text-purple-600",icon:Qh}},jqe=({applications:e,allStudents:t,isLoading:n=!1})=>{const{profile:r}=bi(),[a,i]=x.useState([]),[o,l]=x.useState(null),c=(r==null?void 0:r.applicant_type)==="returning",u=x.useMemo(()=>{const v={};return t.forEach(y=>{const b=y.application_id;v[b]||(v[b]=[]),v[b].push({id:y.id,first_name:y.first_name,last_name:y.last_name,grade:y.grade,school:y.school,status:y.status||"new"})}),v},[t]),d=x.useMemo(()=>{const v={};return e==null||e.forEach(y=>{const b=y.application_year||"Unknown";v[b]||(v[b]=[]);let w=u[y.id]||[];w.length===0&&y.student_first_name&&(w=[{id:`legacy-${y.id}`,first_name:y.student_first_name||"",last_name:y.student_last_name||"",grade:y.student_grade,school:y.student_school,status:y.student_status||"new"}]),v[b].push({id:y.id,year:new Date(y.created_at).getFullYear(),status:y.status,admin_notes:y.admin_notes,household_income:y.household_income,scholarship_amount:y.scholarship_amount,application_year:y.application_year,created_at:y.created_at,
730submitted_at:y.submitted_at,students:w})}),v},[e,u]),f=Object.keys(d).sort((v,y)=>y.localeCompare(v));x.useMemo(()=>{f.length>0&&a.length===0&&i([f[0]])},[f.length]);const p=v=>{i(y=>y.includes(v)?y.filter(b=>b!==v):[...y,v])},h=v=>{if(v.includes("-")){const[y,b]=v.split("-");return`${y}-${b.slice(-2)}`}return v},m=v=>v.split("_").map(y=>y.charAt(0).toUpperCase()+y.slice(1)).join(" "),g=v=>d[v].reduce((y,b)=>y+b.students.length,0);return n?s.jsxs("div",{className:"w-64 border-r border-border bg-muted/30 p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(JE,{className:"w-5 h-5 text-primary"}),s.jsx("h2",{className:"font-semibold text-foreground",children:"Application History"})]}),s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Xt,{className:"w-5 h-5 animate-spin text-muted-foreground"})})]}):s.jsxs("div",{className:"w-64 border-r border-border bg-muted/30 flex flex-col h-full",children:[s.jsxs("div",{className:"p-4 border-b border-border",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(JE,{className:"w-5 h-5 text-primary"}),s.jsx("h2",{className:"font-semibold text-foreground",children:"Application History"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"View your past applications"})]}),s.jsx(fI,{className:"flex-1",children:s.jsx("div",{className:"p-2",children:f.length===0?s.jsxs("div",{className:"text-center py-8 px-4",children:[s.jsx(En,{className:"w-8 h-8 mx-auto text-muted-foreground mb-2"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"No application history"})]}):f.map(v=>s.jsxs(BN,{open:a.includes(v),onOpenChange:()=>p(v),children:[s.jsx(UN,{className:"w-full",children:s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg hover:bg-muted transition-colors cursor-pointer",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ho,{className:Ye("w-4 h-4 transition-transform",a.includes(v)&&"rotate-90")}),s.jsx("span",{className:"font-medium",children:h(v)})]}),s.jsxs(Je,{variant:"secondary",className:"text-xs",children:[g(v)," student",g(v)!==1?"s":""]})]})}),s.jsx(zN,{children:s.jsx("div",{className:"ml-4 space-y-2 pb-2",children:d[v].map(y=>{var b,w;return s.jsxs("div",{className:Ye("p-3 rounded-lg border cursor-pointer transition-all",o===y.id?"border-primary bg-primary/5":"border-transparent hover:bg-muted"),onClick:()=>l(o===y.id?null:y.id),children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("div",{className:Ye("inline-flex items-center px-2 py-0.5 rounded text-xs",((b=B7[y.status])==null?void 0:b.bg)||"bg-muted",((w=B7[y.status])==null?void 0:w.text)||"text-muted-foreground"),children:m(y.status)}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[y.students.length," student",y.students.length!==1?"s":""]})]}),s.jsx("div",{className:"space-y-2",children:y.students.map(j=>{const S=U7[j.status]||U7.new,A=S.icon;return s.jsxs("div",{className:"flex items-start gap-2 p-2 bg-muted/50 rounded",children:[s.jsx(ci,{className:"w-3 h-3 text-muted-foreground mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("span",{className:"text-sm font-medium block truncate",children:[j.first_name," ",j.last_name]}),c&&s.jsxs("div",{className:Ye("inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs mt-1",S.bg,S.text),children:[s.jsx(A,{className:"w-3 h-3"}),j.status==="returning"?"Returning":"New"]})]})]},j.id)})}),o===y.id&&s.jsxs("div",{className:"mt-3 pt-3 border-t border-border space-y-3 text-xs",children:[y.students.map((j,S)=>s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:"font-medium text-foreground",children:[j.first_name," ",j.last_name]}),s.jsxs("div",{className:"pl-2 space-y-1 text-muted-foreground",children:[j.grade&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"Grade:"}),s.jsx("span",{className:"text-foreground",children:j.grade})]}),j.school&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{children:"School:"}),s.jsx("span",{className:"text-foreground text-right truncate max-w-[100px]",children:j.school})]})]}),S<y.students.length-1&&s.jsx("div",{className:"border-b border-border/50 my-2"})]},j.id)),s.jsxs("div",{className:"pt-2 border-t border-border space-y-1",children:[y.scholarship_amount!==null&&y.scholarship_amount>0&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("span",{className:"text-muted-foreground flex items-center gap-1",children:[s.jsx(sf,{className:"w-3 h-3"}),"Scholarship:"]}),s.jsxs("span",{className:"font-medium text-green-600",children:["$",y.scholarship_amount.toLocaleStr
730ing()]})]}),y.household_income&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-muted-foreground",children:"Income:"}),s.jsx("span",{children:y.household_income})]}),y.submitted_at&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Submitted:"}),s.jsx("span",{children:new Date(y.submitted_at).toLocaleDateString()})]})]}),y.admin_notes&&s.jsxs("div",{className:"pt-2 border-t border-border",children:[s.jsx("span",{className:"text-muted-foreground block mb-1",children:"Notes:"}),s.jsx("p",{className:"text-foreground bg-muted/50 p-2 rounded text-xs",children:y.admin_notes})]})]})]},y.id)})})})]},v))})})]})},lee=e=>{const t=[];e.marital_status||t.push("Marital Status");const n=e.guardians[0];if(n!=null&&n.first_name||t.push("Primary Guardian First Name"),n!=null&&n.last_name||t.push("Primary Guardian Last Name"),n!=null&&n.phone||t.push("Primary Guardian Phone"),n!=null&&n.email||t.push("Primary Guardian Email"),n!=null&&n.relationship||t.push("Primary Guardian Relationship"),n!=null&&n.employment_status||t.push("Primary Guardian Employment Status"),((n==null?void 0:n.employment_status)==="employed"||(n==null?void 0:n.employment_status)==="self_employed")&&!(n!=null&&n.annual_salary)&&t.push("Primary Guardian Annual Salary"),e.marital_status==="married"||e.marital_status==="divorced"){const r=e.guardians[1];r!=null&&r.first_name||t.push("Second Guardian First Name"),r!=null&&r.last_name||t.push("Second Guardian Last Name"),r!=null&&r.phone||t.push("Second Guardian Phone"),r!=null&&r.email||t.push("Second Guardian Email"),r!=null&&r.relationship||t.push("Second Guardian Relationship"),r!=null&&r.employment_status||t.push("Second Guardian Employment Status"),((r==null?void 0:r.employment_status)==="employed"||(r==null?void 0:r.employment_status)==="self_employed")&&!(r!=null&&r.annual_salary)&&t.push("Second Guardian Annual Salary")}return e.address||t.push("Street Address"),e.city||t.push("City"),e.state||t.push("State"),e.zip_code||t.push("ZIP Code"),{isComplete:t.length===0,missing:t}},cee=(e,t)=>{const n=[];return e.students.length===0?(n.push("At least one student is required"),{isComplete:!1,missing:n}):(e.students.forEach((r,a)=>{const i=e.students.length>1?`Student ${a+1}: `:"";r.first_name||n.push(`${i}First Name`),r.last_name||n.push(`${i}Last Name`),r.date_of_birth||n.push(`${i}Date of Birth`),r.race||n.push(`${i}Race/Ethnicity`),r.gender||n.push(`${i}Gender`),r.grade||n.push(`${i}Grade`),r.school||n.push(`${i}School`),r.tefa_status||n.push(`${i}TEFA Status`),r.tefa_status==="waitlist"&&!r.tefa_waitlist_position&&n.push(`${i}TEFA Waitlist Position`),t&&!r.status&&n.push(`${i}Student Status (New or Returning)`)}),{isComplete:n.length===0,missing:n})},uee=e=>{const t=[];return e.household_size||t.push("Household Size"),e.household_income||t.push("Household Income Range"),e.how_heard_about_us||t.push("How Heard About Us"),(!e.essay||e.essay.trim().length===0)&&t.push("Essay"),e.has_other_income&&!e.other_income_description&&t.push("Other Income Description"),e.has_star_family_member&&!e.star_family_member_names&&t.push("STAR Family Member Names"),{isComplete:t.length===0,missing:t}},hI=(e,t,n,r,a=[])=>{const i=[],o=e.map(u=>u.document_type),l=u=>a.includes(u),c=u=>o.some(d=>d===u||d.startsWith(`${u}_page_`));if(r)!l("principal_referral")&&!o.includes("principal_referral")&&i.push("Principal Referral Form"),!l("student_form")&&!o.includes("student_form")&&i.push("Student Form");else{[{id:"current_tax_return",label:"2025 Tax Documents (Upload all pages)"},{id:"w2_forms",label:"2025 – W-2, 1099, or Schedule C"}].forEach(h=>{!l(h.id)&&!c(h.id)&&i.push(h.label)}),t.students.forEach(h=>{const m=h.first_name||"Student";if(!l(`star_form_${h.id}`)&&!c(`star_form_${h.id}`)&&i.push(`${m}'s Parent/Guardian Commitment Form`),h.status==="new"){const v=`principal_referral_${h.id}`;!l(v)&&!o.includes(v)&&i.push(`${m}'s Principal Referral Form`)}const g=`student_form_${h.id}`;!l(g)&&!o.includes(g)&&i.push(`${m}'s Student Form`)});const d=t.guardians.some(h=>h.employment_status==="self_employed"),f=t.guardians.some(h=>{var m;return h.employment_status==="self_employed"&&((m=h.selfEmploymentData)==null?void 0:m.isSubmitted)}),p=e.find(h=>h.document_type==="Self-Employment Statement"||h.document_type==="self_employment");d&&!f&&!p&&i.push("Self-Employment Income Statement")}return{isComplete:i.length===0,missing:i}},Sqe=(e,t,n,r,a,i=[])=>{const o=lee(e),l=cee(e,r),c=uee(e),u=hI(t,e,n,a,i),d={isComplete:o.isComplete&&l.isComplete&&c.isComplete&&u.isComplete,missing:[]};return[o,l,c,u,d]},WN=e=>{let t=e.replace(/[^0-9.]/g,"");if(!t)return"";const n=t.split(".");let r=n[0]||"",a=n.length>1?n[1].slice(0,2):"";r=r.replace(/^0+/,"")||"0";const i=r.replace(/\B(?=(\d{3})+(?!\d))/g,",");return n.length>1?`$${i}.${a}`:`$${i}`},wm=e=>{if(e==null||e==="")return"$0.00";const t=typeof e=="number"?e:parseFloat(String(e).replace(/[^0-9.
730-]/g,""));return isNaN(t)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(t)},ph=e=>e?e.replace(/[^0-9.]/g,""):"",_m=e=>{if(e==null||e==="")return"";const t=typeof e=="number"?e:parseFloat(String(e).replace(/[^0-9.-]/g,""));if(isNaN(t))return"";const n=Math.floor(t).toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),r=t%1!==0?(t%1).toFixed(2).substring(1):"";return`$${n}${r}`},Nqe=["Pre-K","Kindergarten","1st Grade","2nd Grade","3rd Grade","4th Grade","5th Grade","6th Grade","7th Grade","8th Grade","9th Grade","10th Grade","11th Grade","12th Grade"],Aqe=({open:e,onOpenChange:t,onSuccess:n,existingParentInfo:r})=>{const{user:a}=bi(),[i,o]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(null),h=x.useRef(null),m=x.useRef(null),[g,v]=x.useState(""),[y,b]=x.useState(""),[w,j]=x.useState(""),[S,A]=x.useState(""),[E,k]=x.useState(""),[P,R]=x.useState(""),C=()=>{v(""),b(""),j(""),A(""),k(""),R(""),d(null),p(null)},I=async q=>{const Z=q.target.files;if(!Z||Z.length===0||!a)return;const H=Z[0];if(!["application/pdf","image/jpeg","image/png","image/webp","image/heic","image/heif","image/tiff","image/bmp"].includes(H.type)&&!H.name.toLowerCase().match(/\.(heic|heif|tiff|tif|bmp)$/)){et({title:"Invalid file type",description:"Please upload a PDF, JPEG, PNG, WebP, HEIC, TIFF, or BMP file.",variant:"destructive"});return}if(H.size>50*1024*1024){et({title:"File too large",description:"Maximum file size is 50MB.",variant:"destructive"});return}c(!0);const W=H.name.split(".").pop(),ee=`teacher_referral_${Date.now()}.${W}`,V=`${a.id}/new_student_${Date.now()}/${ee}`,{error:O}=await Re.storage.from("application-documents").upload(V,H);O?et({title:"Upload failed",description:O.message,variant:"destructive"}):(d({name:H.name,path:V}),et({title:"File uploaded",description:"Teacher referral form uploaded successfully."})),c(!1),m.current&&(m.current.value="")},D=async q=>{const Z=q.target.files;if(!Z||Z.length===0||!a)return;const H=Z[0];if(!["application/pdf","image/jpeg","image/png","image/webp","image/heic","image/heif","image/tiff","image/bmp"].includes(H.type)&&!H.name.toLowerCase().match(/\.(heic|heif|tiff|tif|bmp)$/)){et({title:"Invalid file type",description:"Please upload a PDF, JPEG, PNG, WebP, HEIC, TIFF, or BMP file.",variant:"destructive"});return}if(H.size>50*1024*1024){et({title:"File too large",description:"Maximum file size is 50MB.",variant:"destructive"});return}c(!0);const W=H.name.split(".").pop(),ee=`principal_referral_${Date.now()}.${W}`,V=`${a.id}/new_student_${Date.now()}/${ee}`,{error:O}=await Re.storage.from("application-documents").upload(V,H);O?et({title:"Upload failed",description:O.message,variant:"destructive"}):(p({name:H.name,path:V}),et({title:"File uploaded",description:"Principal referral form uploaded successfully."})),c(!1),h.current&&(h.current.value="")},U=async()=>{if(!a)return;if(!g.trim()||!y.trim()||!w||!S||!E||!P.trim()){et({title:"Missing information",description:"Please fill in all required fields.",variant:"destructive"});return}if(!u){et({title:"Missing document",description:"Please upload the Teacher Referral Form.",variant:"destructive"});return}if(!f){et({title:"Missing document",description:"Please upload the Principal Referral Form.",variant:"destructive"});return}o(!0);const{data:q,error:Z}=await Re.from("applications").insert({user_id:a.id,student_first_name:g.trim(),student_last_name:y.trim(),student_date_of_birth:w,student_grade:E,student_school:P.trim(),student_status:"new",parent_first_name:r==null?void 0:r.parent_first_name,parent_last_name:r==null?void 0:r.parent_last_name,email:r==null?void 0:r.email,phone:r==null?void 0:r.phone,address:r==null?void 0:r.address,city:r==null?void 0:r.city,state:r==null?void 0:r.state,zip_code:r==null?void 0:r.zip_code,application_type:"new_student_existing_family",is_returning_family:!0,interview_required:!0,current_step:2,status:"draft"}).select().single();if(Z||!q){et({title:"Error",description:"Failed to create application for new student.",variant:"destructive"}),o(!1);return}const{error:H}=await Re.from("documents").insert({application_id:q.id,user_id:a.id,file_path:u.path,file_name:u.name,document_type:"teacher_recommendation",document_category:"verification_documents",status:"uploaded"});H&&console.error("Error saving document:",H);const{error:$}=await Re.from("documents").insert({application_id:q.id,user_id:a.id,file_path:f.path,file_name:f.name,document_type:"principal_referral",document_category:"verification_documents",status:"uploaded"});$&&console.error("Error saving principal referral document:",$),o(!1),et({title:"New student added!",description:`Application created for ${g} ${y}.`}),C(),t(!1),n()};
730return s.jsx(_a,{open:e,onOpenChange:t,children:s.jsxs(ha,{className:"sm:max-w-lg",children:[s.jsxs($a,{children:[s.jsxs(Da,{className:"flex items-center gap-2",children:[s.jsx(Qh,{className:"w-5 h-5"}),"Add New Student"]}),s.jsx(Bs,{children:"As a returning family, you can add additional children to the program. The Teacher Referral Form and Principal Referral Form are required for new students."})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"firstName",children:"First Name *"}),s.jsx(xt,{id:"firstName",value:g,onChange:q=>v(q.target.value),placeholder:"Student's first name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"lastName",children:"Last Name *"}),s.jsx(xt,{id:"lastName",value:y,onChange:q=>b(q.target.value),placeholder:"Student's last name"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"dob",children:"Date of Birth *"}),s.jsx(xt,{id:"dob",type:"date",value:w,onChange:q=>j(q.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"gender",children:"Gender *"}),s.jsxs(gn,{value:S,onValueChange:A,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select gender"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"male",children:"Male"}),s.jsx(ot,{value:"female",children:"Female"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"grade",children:"Grade Applying For *"}),s.jsxs(gn,{value:E,onValueChange:k,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select grade"})}),s.jsx(fn,{children:Nqe.map(q=>s.jsx(ot,{value:q,children:q},q))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"school",children:"School Name *"}),s.jsx(xt,{id:"school",value:P,onChange:q=>R(q.target.value),placeholder:"Current or intended school"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Teacher Referral Form * (Required)"}),s.jsxs("div",{className:"border rounded-lg p-4 space-y-3",children:[u?s.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 rounded-lg border border-green-200",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nt,{className:"w-5 h-5 text-green-600"}),s.jsx("span",{className:"text-sm font-medium text-green-800 truncate max-w-[200px]",children:u.name})]}),s.jsx(we,{variant:"outline",size:"sm",onClick:()=>{var q;return(q=m.current)==null?void 0:q.click()},disabled:l,children:"Replace"})]}):s.jsx(we,{variant:"outline",onClick:()=>{var q;return(q=m.current)==null?void 0:q.click()},disabled:l,className:"w-full",children:l?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):s.jsxs(s.Fragment,{children:[s.jsx(fa,{className:"w-4 h-4 mr-2"}),"Upload Teacher Referral Form"]})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"PDF, JPEG, PNG, WebP, HEIC, TIFF, or BMP. Max 50MB."})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Principal Referral Form * (Required)"}),s.jsxs("div",{className:"border rounded-lg p-4 space-y-3",children:[s.jsxs("a",{href:"/forms/2026-27_Principal_Referral_Form.pdf",download:!0,className:"flex items-center justify-center gap-2 p-3 bg-primary/10 rounded-lg border border-primary/20 hover:bg-primary/20 transition-colors",children:[s.jsx(En,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"text-sm font-medium text-primary",children:"Download Principal Referral Form 2026-27"})]}),f?s.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 rounded-lg border border-green-200",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Nt,{className:"w-5 h-5 text-green-600"}),s.jsx("span",{className:"text-sm font-medium text-green-800 truncate max-w-[200px]",children:f.name})]}),s.jsx(we,{variant:"outline",size:"sm",onClick:()=>{var q;return(q=h.current)==null?void 0:q.click()},disabled:l,children:"Replace"})]}):s.jsx(we,{variant:"outline",onClick:()=>{var q;return(q=h.current)==null?void 0:q.click()},disabled:l,className:"w-full",children:l?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):s.jsxs(s.Fragment,{children:[s.jsx(fa,{className:"w-4 h-4 mr-2"}),"Upload Principal Referral Form"]})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"PDF, JPEG, PNG, WebP, HEIC, TIFF, or BMP. Max 50MB."})]}),s.jsx("input",{ref:h,type:"file",accept:".pdf,.jpg,.jpeg,.png,.webp,.heic,.heif,.tiff,.tif,.bmp",onChange:D,className:"hidden"}),s.jsx("input",{ref:m,type:"file",accept:".pdf,.jpg,.jpeg,.png,.webp,.heic,.heif,.tiff,.tif,.bmp",onChange:I,className:"hidden"})]}),s.jsx("div",{className:"bg-blue-50 rounded-lg p-3 border border-blue-200",children:s.jsxs("p",{className:"text-sm text-blue-800",children:[s.jsx("strong",{children:"Note:"})," As a returning family, you do not need to upload tax documents again. Your existing financial documents on file will be used."]})})]}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(we,{onClick:U,disabled:i,children:i?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Qh,{className:"w-4 h-4 mr-2"}),"Add Student"]})})]})]})})};var pI="Progress",mI=100,[kqe,sQe]=ui(pI),[Eqe,Cqe]=kqe(pI),dee=x.forwardRef((e,t)=>
730{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=Pqe,...o}=e;(a||a===0)&&!z7(a)&&console.error(Tqe(`${a}`,"Progress"));const l=z7(a)?a:mI;r!==null&&!W7(r,l)&&console.error(Oqe(`${r}`,"Progress"));const c=W7(r,l)?r:null,u=Aj(c)?i(c,l):void 0;return s.jsx(Eqe,{scope:n,value:c,max:l,children:s.jsx(pt.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Aj(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":pee(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});dee.displayName=pI;var fee="ProgressIndicator",hee=x.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Cqe(fee,n);return s.jsx(pt.div,{"data-state":pee(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});hee.displayName=fee;function Pqe(e,t){return`${Math.round(e/t*100)}%`}function pee(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Aj(e){return typeof e=="number"}function z7(e){return Aj(e)&&!isNaN(e)&&e>0}function W7(e,t){return Aj(e)&&!isNaN(e)&&e<=t&&e>=0}function Tqe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${mI}\`.`}function Oqe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
731  - a positive number
732  - less than the value passed to \`max\` (or ${mI} if no \`max\` prop is set)
733  - \`null\` or \`undefined\` if the progress is indeterminate.
734
735Defaulting to \`null\`.`}var mee=dee,Rqe=hee;const qN=x.forwardRef(({className:e,value:t,...n},r)=>s.jsx(mee,{ref:r,className:Ye("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(Rqe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));qN.displayName=mee.displayName;const Iqe={pending:{label:"Pending",variant:"outline",icon:Fn},uploaded:{label:"Uploaded",variant:"secondary",icon:fa},approved:{label:"Approved",variant:"default",icon:Nt},needs_resubmission:{label:"Resubmit",variant:"destructive",icon:er}},bk=async(e,t=1e4)=>{let n;const r=new Promise(a=>{n=setTimeout(()=>a(null),t)});return Promise.race([e,r]).finally(()=>{n&&clearTimeout(n)})},Lqe=()=>{const{user:e,profile:t,session:n}=bi(),r=di(),a=Ko(),{applications:i,primaryApplication:o,documents:l,guardians:c,students:u,existingBooking:d,availableSlots:f,allStudents:p,isLoading:h,refetchAll:m}=sqe(),[g,v]=x.useState(!1),[y,b]=x.useState(!1),[w,j]=x.useState(!1),[S,A]=x.useState(!1),[E,k]=x.useState(!1);x.useEffect(()=>{var F;h||o||!e||!(n!=null&&n.access_token)||E||(F=a.state)!=null&&F.skipAutoResume||(k(!0),bk(Re.functions.invoke("family-profile",{body:{action:"get-saved-draft"}}),8e3).then(me=>{var ve;if(!me){console.error("Timed out checking saved draft");return}const{data:Ae,error:Ne}=me;if(Ne){console.error("Could not check saved draft:",Ne);return}(ve=Ae==null?void 0:Ae.application)!=null&&ve.id&&r(`/portal/application/${Ae.application.id}`)}))},[h,o,e,n==null?void 0:n.access_token,E,r,a.state]);const P=(t==null?void 0:t.applicant_type)==="new",R=(t==null?void 0:t.applicant_type)==="returning"||i.some(F=>F.is_returning_family===!0),C=(t==null?void 0:t.referral_status)||"pending",I=C==="approved",D=i.some(F=>F.status==="submitted"||F.status==="under_review"||F.status==="approved"),U=R||D,q=i.find(F=>F.student_edit_unlocked===!0&&F.status!=="draft"),Z=x.useMemo(()=>{const F=[{id:"current_tax_return",label:"2025 Tax Documents (Upload all pages)",required:!0},{id:"w2_forms",label:"2025 – W-2, 1099, or Schedule C",required:!0}];return P&&F.push({id:"last_year_tax_return",label:"2024 Tax Return (Recommended)",required:!1}),u.forEach(me=>{const Ae=me.first_name||"Student";F.push({id:`star_form_${me.id}`,label:`${Ae}'s Parent/Guardian Commitment Form`,required:!0}),me.status==="new"&&(F.push({id:`teacher_recommendation_${me.id}`,label:`${Ae}'s Teacher Recommendation`,required:!1}),F.push({id:`principal_referral_${me.id}`,label:`${Ae}'s Principal Referral Form`,required:!0}),F.push({id:`report_card_${me.id}`,label:`${Ae}'s Most Recent Report Card`,required:!1})),F.push({id:`student_form_${me.id}`,label:`${Ae}'s Student Form`,required:!0})}),F},[P,u]),H=async F=>{if(!(!e||!o)){A(!0);try{const{data:me,error:Ae}=await Re.rpc("book_interview_slot",{p_slot_id:F,p_application_id:o.id,p_user_id:e.id});if(Ae){et({title:"Error",description:Ae.message||"Failed to book interview.",variant:"destructive"});return}const Ne=me;if(!Ne.success){et({title:"Error",description:Ne.error||"Failed to book interview.",variant:"destructive"});return}et({title:"Interview Scheduled!",description:"Your interview has been booked successfully."}),v(!1),await m()}finally{A(!1)}}},$=async(F,me,Ae)=>{if(!(!e||!o)){A(!0);try{const{data:Ne,error:ve}=await Re.rpc("reschedule_interview_slot",{p_booking_id:Ae,p_old_slot_id:me,p_new_slot_id:F});if(ve){et({title:"Error",description:ve.message||"Failed to reschedule interview.",variant:"destructive"});return}const pe=Ne;if(!pe.success){et({title:"Error",description:pe.error||"Failed to reschedule interview.",variant:"destructive"});return}et({title:"Interview Rescheduled!",description:"Your interview has been successfully rescheduled to the new time."}),b(!1),await m()}finally{A(!1)}}},W=async()=>
735{if(d){A(!0);try{const{data:F,error:me}=await Re.rpc("cancel_interview_booking",{p_booking_id:d.id});if(me){et({title:"Error",description:me.message||"Failed to cancel interview.",variant:"destructive"});return}const Ae=F;if(!Ae.success){et({title:"Error",description:Ae.error||"Failed to cancel interview.",variant:"destructive"});return}et({title:"Interview Cancelled",description:"You can now schedule a new interview time."}),await m()}finally{A(!1)}}},ee=F=>{const[me,Ae]=F.split(":"),Ne=parseInt(me);return`${Ne%12||12}:${Ae} ${Ne>=12?"PM":"AM"}`},[V,O]=x.useState(!1),M=async()=>{var F;if(!(!e||V)){O(!0);try{const me=await bk(Re.functions.invoke("family-profile",{body:{action:"get-saved-draft"}}),8e3),Ae=me==null?void 0:me.data;if(!(me==null?void 0:me.error)&&((F=Ae==null?void 0:Ae.application)!=null&&F.id)){r(`/portal/application/${Ae.application.id}`);return}const ve=await bk(Re.from("applications").select("id").eq("user_id",e.id).eq("status","draft").limit(1).maybeSingle(),8e3),pe=ve==null?void 0:ve.data;if(pe){await m(),r(`/portal/application/${pe.id}`);return}const{data:Pe,error:Ee}=await Re.from("applications").insert({user_id:e.id,interview_required:!R,is_returning_family:R}).select().single();Ee?(console.error("Error creating application:",Ee),et({title:"Error",description:"Could not open your application. Please refresh and try again.",variant:"destructive"})):Pe&&(await m(),r(`/portal/application/${Pe.id}`))}finally{O(!1)}}},B=x.useMemo(()=>{const F=c.map(Ae=>({id:Ae.id,is_primary:Ae.is_primary,first_name:Ae.first_name||"",last_name:Ae.last_name||"",email:Ae.email||"",phone:Ae.phone||"",relationship:Ae.relationship||"",employment_status:Ae.employment_status||"",employer_name:Ae.employer_name||"",job_title:Ae.job_title||"",annual_salary:_m(Ae.annual_salary)}));F.length===0&&F.push({is_primary:!0,first_name:"",last_name:"",email:"",phone:"",relationship:"",employment_status:"",employer_name:"",job_title:"",annual_salary:""});const me=u.map(Ae=>({id:Ae.id,first_name:Ae.first_name||"",last_name:Ae.last_name||"",date_of_birth:Ae.date_of_birth||"",grade:Ae.grade||"",school:Ae.school||"",status:Ae.status||"",race:Ae.race||"",gender:Ae.gender||"",tefa_status:Ae.tefa_status||"",tefa_waitlist_position:Ae.tefa_waitlist_position!=null?String(Ae.tefa_waitlist_position):""}));return{address:(o==null?void 0:o.address)||"",address_line_2:"",city:(o==null?void 0:o.city)||"",state:(o==null?void 0:o.state)||"",zip_code:(o==null?void 0:o.zip_code)||"",marital_status:(o==null?void 0:o.marital_status)||"",guardians:F,students:me,dependents:[],household_size:(o==null?void 0:o.household_size)??void 0,household_income:(o==null?void 0:o.household_income)||"",receives_assistance:(o==null?void 0:o.receives_assistance)??!1,monthly_rent_payment:(o==null?void 0:o.monthly_rent_payment)||"",monthly_car_payment:(o==null?void 0:o.monthly_car_payment)||"",receives_social_security:(o==null?void 0:o.receives_social_security)??!1,social_security_amount:(o==null?void 0:o.social_security_amount)||"",ex_spouse_support_amount:(o==null?void 0:o.ex_spouse_support_amount)||"",has_other_income:(o==null?void 0:o.has_other_income)??!1,other_income_description:(o==null?void 0:o.other_income_description)||"",has_star_family_member:(o==null?void 0:o.has_star_family_member)??!1,star_family_member_names:(o==null?void 0:o.star_family_member_names)||"",how_heard_about_us:(o==null?void 0:o.how_heard_about_us)||"",essay:(o==null?void 0:o.essay)||""}},[o,c,u]),G=x.useMemo(()=>lee(B),[B]),te=x.useMemo(()=>cee(B,R),[B,R]),ne=x.useMemo(()=>uee(B),[B]),ce=x.useMemo(()=>hI(l,B,P,!1),[l,B,P]),oe=[{id:"parent_info",label:"Parent/Guardian Information",icon:ci,completed:G.isComplete},{id:"student_info",label:"Student Information",icon:Zr,completed:te.isComplete},{id:"financial_info",label:"Financial Information",icon:sf,completed:ne.isComplete},{id:"documents",label:"Document Uploads",icon:En,completed:ce.isComplete},{id:"review",label:"Review & Confirmation",icon:TL,completed:(o==null?void 0:o.status)!=="draft"}],X=oe.filter(F=>F.completed).length,se=oe.length,Q=Math.round(X/se*100),ye=Q===100&&(!P||I),ie=F=>{if(["current_tax_return","w2_forms","last_year_tax_return"].includes(F)){const Ne=l.find(ve=>ve.document_type===F||ve.document_type.startsWith(`${F}_page_`));return Ne?{status:Ne.status,doc:Ne}:{status:"not_uploaded"}}const Ae=l.find(Ne=>Ne.document_type===F);return Ae?{status:Ae.status,doc:Ae}:{status:"not_uploaded"}};return P&&!I?s.jsx(Bo,{to:"/portal/referral",replace:!0}):h?s.jsx(so,{children:s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Xt,{className:"w-6 h-6 animate-spin text-muted-foreground"})})}):s.jsxs(so,{children:[s.jsxs("div",{className:"flex min-h-[calc(100vh-4rem)]",children:[s.jsx(jqe,{applications:i,allStudents:p}),s.jsxs("div",{className:"flex-1 p-6 space-y-6",children:[(t==null?void 0:t.applicant_type_changed_at)&&!localStorage.getItem(`type_change_dism
735issed_${e==null?void 0:e.id}`)&&s.jsxs("div",{className:"bg-amber-50 border border-amber-300 rounded-lg p-4 flex items-start gap-3",children:[s.jsx(er,{className:"w-5 h-5 text-amber-600 mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"font-medium text-amber-800",children:"Application Type Updated"}),s.jsx("p",{className:"text-sm text-amber-700 mt-1",children:"Your application type has been updated by the STAR Sponsorship Program. You are required to restart the application using the correct application type."})]}),s.jsx(we,{variant:"ghost",size:"sm",className:"text-amber-600 hover:text-amber-800",onClick:()=>{localStorage.setItem(`type_change_dismissed_${e==null?void 0:e.id}`,"true"),window.location.reload()},children:s.jsx(Pa,{className:"w-4 h-4"})})]}),(o==null?void 0:o.interview_required)&&!d&&s.jsx("div",{className:"rounded-lg border-2 border-red-500 bg-red-50 p-5 shadow-sm",children:s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(er,{className:"mt-0.5 h-6 w-6 flex-shrink-0 text-red-600"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-lg font-semibold text-red-800",children:"Action Required: Schedule Your Family Interview"}),s.jsx("p",{className:"mt-1 text-sm text-red-700",children:ye?"An interview is mandatory to complete your application. Your application will not be reviewed until an interview is scheduled.":"An interview is mandatory. Finish the remaining application requirements below to unlock interview scheduling."})]})]}),ye&&s.jsxs(we,{size:"lg",className:"w-full bg-red-600 text-white hover:bg-red-700 md:w-auto",onClick:()=>v(!0),children:[s.jsx(yi,{className:"mr-2 h-4 w-4"}),"Schedule Interview Now"]})]})}),s.jsx("div",{className:"flex items-start justify-between",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-display font-semibold text-foreground",children:"Welcome to Your Dashboard"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Track your application progress and manage your documents."})]})}),R&&s.jsx(Ve,{className:"bg-blue-50 border-blue-200",children:s.jsxs(He,{className:"py-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(of,{className:"w-5 h-5 text-blue-600"}),s.jsx("span",{className:"font-medium text-blue-800",children:"Returning Family"}),s.jsxs(Je,{variant:"outline",className:"ml-2 border-blue-300 text-blue-700",children:[i.length," Student",i.length!==1?"s":""," on File"]})]}),s.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"You can add additional students without re-uploading tax documents."})]})}),i.length>1&&s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(Zr,{className:"w-5 h-5"}),"Your Students (",i.length,")"]}),s.jsx(qn,{children:"View and manage applications for each student"})]}),s.jsx(He,{children:s.jsx("div",{className:"space-y-3",children:i.map(F=>s.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg border ${F.id===(o==null?void 0:o.id)?"border-primary bg-primary/5":"bg-muted/50"}`,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 rounded-full bg-background",children:s.jsx(ci,{className:"w-4 h-4"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:F.student_first_name&&F.student_last_name?`${F.student_first_name} ${F.student_last_name}`:"Unnamed Student"}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[F.student_grade&&s.jsx("span",{children:F.student_grade}),F.application_type==="new_student_existing_family"&&s.jsx(Je,{variant:"outline",className:"text-xs",children:"New Student"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(jj,{status:F.status,size:"sm"}),s.jsx(an,{to:`/portal/application/${F.id}`,children:s.jsx(we,{variant:"ghost",size:"sm",children:s.jsx(Rg,{className:"w-4 h-4"})})})]})]},F.id))})})]}),o?s.jsxs(s.Fragment,{children:[s.jsxs(Ve,{className:"border-primary/30",children:[s.jsx(_t,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(jt,{children:"Application Progress"}
735),s.jsx(qn,{children:R?"Complete all sections to submit your application":"Complete all sections to schedule your interview"})]}),s.jsxs("div",{className:"text-3xl font-bold text-primary",children:[Q,"%"]})]})}),s.jsxs(He,{className:"space-y-4",children:[s.jsx(qN,{value:Q,className:"h-3"}),s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("span",{className:"text-muted-foreground",children:[X," of ",se," sections complete"]}),s.jsx(an,{to:`/portal/application/${o.id}`,children:s.jsx(we,{variant:"outline",size:"sm",children:"Continue Application"})})]})]})]}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(TL,{className:"w-5 h-5"}),"Application Sections"]}),s.jsx(qn,{children:"Review which sections are complete or need attention"})]}),s.jsx(He,{children:s.jsx("div",{className:"space-y-3",children:oe.map(F=>{const me=F.icon;return s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/50",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`p-2 rounded-full ${F.completed?"bg-green-100":"bg-muted"}`,children:s.jsx(me,{className:`w-4 h-4 ${F.completed?"text-green-600":"text-muted-foreground"}`})}),s.jsx("span",{className:"font-medium",children:F.label})]}),F.completed?s.jsxs(Je,{variant:"default",className:"bg-green-600",children:[s.jsx(Nt,{className:"w-3 h-3 mr-1"}),"Complete"]}):s.jsxs(Je,{variant:"outline",children:[s.jsx(Pa,{className:"w-3 h-3 mr-1"}),"Incomplete"]})]},F.id)})})})]}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(En,{className:"w-5 h-5"}),"Document Upload Status"]}),s.jsx(qn,{children:"Track the status of your required documents"})]}),s.jsxs(He,{children:[s.jsx("div",{className:"space-y-3",children:Z.map(F=>{const{status:me,doc:Ae}=ie(F.id),Ne=me==="not_uploaded",ve=Ne?null:Iqe[me],pe=(ve==null?void 0:ve.icon)||fa;return s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(En,{className:"w-4 h-4 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-sm",children:F.label}),F.required&&s.jsx("span",{className:"text-destructive text-xs ml-1",children:"*"})]})]}),Ne?s.jsxs(Je,{variant:"outline",className:"text-muted-foreground",children:[s.jsx(fa,{className:"w-3 h-3 mr-1"}),"Not Uploaded"]}):s.jsxs(Je,{variant:ve==null?void 0:ve.variant,children:[s.jsx(pe,{className:"w-3 h-3 mr-1"}),ve==null?void 0:ve.label]})]},F.id)})}),s.jsxs("div",{className:"mt-4 flex gap-2",children:[s.jsx("a",{href:"/forms/STAR_Verification_Form_2026-2027.pdf",download:!0,className:"flex-1",children:s.jsxs(we,{variant:"outline",className:"w-full",children:[s.jsx(Lg,{className:"w-4 h-4 mr-2"}),"Download STAR Parent/Guardian Commitment Form"]})}),s.jsx(an,{to:`/portal/application/${o.id}`,className:"flex-1",children:s.jsxs(we,{variant:"outline",className:"w-full",children:[s.jsx(fa,{className:"w-4 h-4 mr-2"}),"Upload Documents"]})})]})]})]}),P&&s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(En,{className:"w-5 h-5"}),"Referral Status"]}),s.jsx(qn,{children:"New families must have an approved referral before scheduling"})]}),s.jsxs(He,{children:[s.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[s.jsx("span",{className:"font-medium",children:"Referral Form"}),s.jsxs(Je,{variant:C==="approved"?"default":C==="rejected"?"destructive":"secondary",className:C==="approved"?"bg-green-600":"",children:[C==="approved"&&s.jsx(Nt,{className:"w-3 h-3 mr-1"}),C==="rejected"&&s.jsx(Pa,{className:"w-3 h-3 mr-1"}),C==="pending"&&s.jsx(Fn,{className:"w-3 h-3 mr-1"}),C.charAt(0).toUpperCase()+C.slice(1)]})]}),C!=="approved"&&s.jsx(an,{to:"/portal/referral-upload",className:"block mt-4",children:s.jsx(we,{variant:"outline",className:"w-full",children:t!=null&&t.referral_file_path?"View/Replace Referral":"Upload Referral Form"})})]})]}),(o==null?void 0:o.interview_required)&&s.jsxs(Ve,{className:ye?"border-green-500/50":"",children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(yi,{className:"w-5 h-5"}),"Schedule Interview"]}
735),s.jsx(qn,{children:ye?"Your application is complete! Schedule your interview now.":"Complete all requirements to unlock interview scheduling."})]}),s.jsx(He,{children:d?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 text-green-800 font-medium mb-2",children:[s.jsx(Nt,{className:"w-5 h-5"}),"Interview Scheduled"]}),s.jsx("p",{className:"text-sm text-green-700",children:d.interview_slots?`${Dn(xr(d.interview_slots.slot_date),"EEEE, MMMM d, yyyy")} at ${ee(d.interview_slots.start_time)}`:"Your interview is scheduled."}),s.jsx(Je,{className:"mt-2",children:d.status})]}),s.jsxs("div",{className:"p-5 bg-muted/50 border rounded-lg space-y-4 text-sm text-foreground",children:[s.jsx("p",{children:"Thank you for scheduling your interview with Mrs. Kathy Burt at the STAR Sponsorship Program. We look forward to meeting you and your student."}),s.jsx("p",{className:"font-medium",children:"Here are a few quick reminders for your visit:"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Address:"}),s.jsx("p",{children:"550 Bailey Ave, Suite 150"}),s.jsx("p",{children:"Fort Worth, Texas 76107"})]}),s.jsx("p",{children:"Parking is available in the front of the building in the designated visitor parking spaces. Our office is located on the first floor. When you enter through the front doors, you will immediately see our STAR Sponsorship Program banner to the left. Please ring the doorbell, and a member of our team will c
735ome greet you."}),s.jsxs("p",{children:["If you have any questions prior to your appointment, feel free to reach out via email at"," ",s.jsx("a",{href:"mailto:[email protected]",className:"text-primary underline",children:"[email protected]"})," ","or phone at"," ",s.jsx("a",{href:"tel:8178883255",className:"text-primary underline",children:"(817)-888-3255"}),"."]})]}),(()=>{const F=GQ(d);return F.allowed?s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsxs(we,{variant:"outline",className:"w-full",onClick:()=>b(!0),disabled:S,children:[s.jsx(yO,{className:"w-4 h-4 mr-2"}),"Reschedule Interview"]}),s.jsxs(we,{variant:"outline",className:"w-full",onClick:W,disabled:S,children:[s.jsx(Pa,{className:"w-4 h-4 mr-2"}),"Cancel Interview"]})]}):s.jsx("div",{className:"p-3 bg-muted rounded-lg",children:s.jsxs("p",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[s.jsx(Fn,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),s.jsx("span",{children:F.message})]})})})()]}):ye?s.jsxs(we,{className:"w-full",size:"lg",onClick:()=>v(!0),children:[s.jsx(yi,{className:"w-4 h-4 mr-2"}),"Schedule Your Interview"]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-amber-600 font-medium",children:[s.jsx(er,{className:"w-5 h-5"}),"Requirements Pending"]}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[Q<100&&s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Pa,{className:"w-4 h-4 text-red-500"}),"Complete all application sections (",Q,"% done)"]}),P&&!I&&s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Pa,{className:"w-4 h-4 text-red-500"}),"Referral form must be approved"]})]})]})})]}),U&&s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(Zr,{className:"w-5 h-5"}),"Add Another Student"]}),s.jsx(qn,{children:q?"STAR has opened your existing application so you can add a child without starting over.":"Apply for additional students in your family"})]}),s.jsx(He,{children:s.jsxs(we,{variant:"outline",className:"w-full",onClick:()=>q?r(`/portal/application/${q.id}`):j(!0),children:[s.jsx(zh,{className:"w-4 h-4 mr-2"}),q?"Add a Child to My Application":"Add New Student Application"]})})]})]}):s.jsx(Ve,{children:s.jsxs(He,{className:"py-12 text-center",children:[s.jsx(En,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),s.jsx("h3",{className:"font-semibold mb-2",children:"No application yet"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Start your sponsorship application today."}),s.jsxs(we,{onClick:M,disabled:V,children:[V?s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(zh,{className:"w-4 h-4 mr-2"}),V?"Creating...":"Start Application"]})]})})]})]}),s.jsx(_j,{open:g,onOpenChange:v,availableSlots:f,onBookSlot:H,isBooking:S}),d&&s.jsx(_j,{open:y,onOpenChange:b,availableSlots:f,onBookSlot:H,isBooking:S,isRescheduling:!0,existingBooking:d,onReschedule:$}),s.jsx(Aqe,{open:w,onOpenChange:j,onSuccess:m})]})};var Mqe="Separator",q7="horizontal",$qe=["horizontal","vertical"],gee=x.forwardRef((e,t)=>{const{decorative:n,orientation:r=q7,...a}=e,i=Dqe(r)?r:q7,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(pt.div,{"data-orientation":i,...l,...a,ref:t})});gee.displayName=Mqe;function Dqe(e){return $qe.includes(e)}var vee=gee;const _v=x.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(vee,{ref:a,decorative:n,orientation:t,className:Ye("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));_v.displayName=vee.displayName;const yee=[{value:"received_funds",label:"Received TEFA Funds"},{value:"waitlist",label:"On TEFA Waitlist"},{value:"applied_pending",label:"Applied – Decision Pending"},{value:"did_not_apply",label:"Did Not Apply"}],Fqe=Object.fromEntries(yee.map(e=>[e.value,e.label])),xee=e=>e?Fqe[e]??e:"—",V7={received_funds:{label:"TEFA Recipient",className:"border-amber-500/40 bg-amber-500/15 text-amber-700 dark:text-amber-400"},waitlist:{label:"TEFA Waitlist",className:"border-blue-500/40 bg-blue-500/15 text-blue-700 dark:text-blue-400"}
vendor: 3,762 bytes, line 735
735,applied_pending:{label:"Decision Pending",className:"border-border bg-transparent text-foreground"},did_not_apply:{label:"Did Not Apply",className:"border-transparent bg-muted text-muted-foreground"},"":{label:"Not Reported",className:"border-transparent bg-muted/60 text-muted-foreground"}},H7=()=>({ownerName:"",businessName:"",paymentPeriod:"",paymentAmount:"",taxFormType:"",signatureData:"",signatureDate:"",isSubmitted:!1}),Bqe=["Kindergarten (K)","Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6","Grade 7","Grade 8","Grade 9","Grade 10","Grade 11","Grade 12","College"],Uqe=()=>({id:`dep-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,full_name:"",age:"",date_of_birth:"",grade:"",annual_tuition:""}),O0=e=>({is_primary:e,first_name:"",last_name:"",email:"",phone:"",relationship:"",employment_status:"",employer_name:"",job_title:"",annual_salary:""});var gI="Radio",[zqe,bee]=ui(gI),[Wqe,qqe]=zqe(gI),wee=x.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:a=!1,required:i,disabled:o,value:l="on",onCheck:c,form:u,...d}=e,[f,p]=x.useState(null),h=sn(t,v=>p(v)),m=x.useRef(!1),g=f?u||!!f.closest("form"):!0;return s.jsxs(Wqe,{scope:n,checked:a,disabled:o,children:[s.jsx(pt.button,{type:"button",role:"radio","aria-checked":a,"data-state":Nee(a),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:h,onClick:ht(e.onClick,v=>{a||c==null||c(),g&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})}),g&&s.jsx(See,{control:f,bubbles:!m.current,name:r,value:l,checked:a,required:i,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});wee.displayName=gI;var _ee="RadioIndicator",jee=x.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...a}=e,i=qqe(_ee,n);return s.jsx(Ka,{present:r||i.checked,children:s.jsx(pt.span,{"data-state":Nee(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t})})});jee.displayName=_ee;var Vqe="RadioBubbleInput",See=x.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=x.useRef(null),l=sn(o,i),c=xS(n),u=kO(t);return x.useEffect(()=>{const d=o.current;if(!d)return;const f=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&h){const m=new Event("click",{bubbles:r});h.call(d,n),d.dispatchEvent(m)}},[c,n,r]),s.jsx(pt.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});See.displayName=Vqe;function Nee(e){return e?"checked":"unchecked"}var Hqe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],VN="RadioGroup",[Gqe,oQe]=ui(VN,[CN,bee]),Aee=CN(),kee=bee(),[Yqe,Kqe]=Gqe(VN),Eee=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:a,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...p}=e,h=Aee(n),m=jp(u),[g,v]=vs({prop:i,defaultProp:a??null,onChange:f,caller:VN});return s.jsx(Yqe,{scope:n,name:r,required:o,disabled:l,value:g,onValueChange:v,children:s.jsx(mJ,{asChild:!0,...h,orientation:c,dir:m,loop:d,children:s.jsx(pt.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:m,...p,ref:t})})})});Eee.displayName=VN;var Cee="RadioGroupItem",Pee=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...a}=e,i=Kqe(Cee,n),o=i.disabled||r,l=Aee(n),c=kee(n),u=x.useRef(null),d=sn(t,u),f=i.value===a.value,p=x.useRef(!1);return x.useEffect(()=>{const h=g=>{Hqe.includes(g.key)&&(p.current=!0)},m=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),s.jsx(gJ,{asChild:!0,...l,focusable:!o,active:f,children:s.jsx(wee,{disabled:o,required:i.required,
735checked:f,...c,...a,name:i.name,ref:d,onCheck:()=>i.onValueChange(a.value),onKeyDown:ht(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:ht(a.onFocus,()=>{var h;p.current&&((h=u.current)==null||h.click())})})})});Pee.displayName=Cee;var Zqe="RadioGroupIndicator",Tee=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,a=kee(n);return s.jsx(jee,{...a,...r,ref:t})});Tee.displayName=Zqe;var Oee=Eee,Ree=Pee,Xqe=Tee;const rb=x.forwardRef(({className:e,...t},n)=>s.jsx(Oee,{className:Ye("grid gap-2",e),...t,ref:n}));rb.displayName=Oee.displayName;const ac=x.forwardRef(({className:e,...t},n)=>s.jsx(Ree,{ref:n,className:Ye("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(Xqe,{className:"flex items-center justify-center",children:s.jsx(Qse,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ac.displayName=Ree.displayName;/*!
736 * Signature Pad v5.1.3 | https://github.com/szimek/signature_pad
737 * (c) 2025 Szymon Nowak | Released under the MIT license
738 */var kj=class{constructor(e,t,n,r){qe(this,"x");qe(this,"y");qe(this,"pressure");qe(this,"time");if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}},Jqe=class Iee{constructor(t,n,r,a,i,o){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=a,this.startWidth=i,this.endWidth=o}static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,a=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new Iee(t[1],r,a,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const a=t.x-n.x,i=t.y-n.y,o=n.x-r.x,l=n.y-r.y,c={x:(t.x+n.x)/2,y:(t.y+n.y)/2},u={x:(n.x+r.x)/2,y:(n.y+r.y)/2},d=Math.sqrt(a*a+i*i),f=Math.sqrt(o*o+l*l),p=c.x-u.x,h=c.y-u.y,m=d+f==0?0:f/(d+f),g={x:u.x+p*m,y:u.y+h*m},v=n.x-g.x,y=n.y-g.y;return{c1:new kj(c.x+v,c.y+y),c2:new kj(u.x+v,u.y+y)}}length(){let n=0,r,a;for(let i=0;i<=10;i+=1){const o=i/10,l=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),c=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(i>0){const u=l-r,d=c-a;n+=Math.sqrt(u*u+d*d)}r=l,a=c}return n}point(t,n,r,a,i){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*a*(1-t)*t*t+i*t*t*t}},Qqe=class{constructor(){qe(this,"_et");try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}};function eVe(e,t=250){let n=0,r=null,a,i,o;const l=()=>{n=Date.now(),r=null,a=e.apply(i,o),r||(i=null,o=[])};return function(...u){const d=Date.now(),f=t-(d-n);return i=this,o=u,f<=0||f>t?(r&&(clearTimeout(r),r=null),n=d,a=e.apply(i,o),r||(i=null,o=[])):r||(r=window.setTimeout(l,f)),a}}var tVe=class H4 extends Qqe{constructor(n,r={}){super();qe(this,"dotSize");qe(this,"minWidth");qe(this,"maxWidth");qe(this,"penColor");qe(this,"minDistance");qe(this,"velocityFilterWeight");qe(this,"compositeOperation");qe(this,"backgroundColor");qe(this,"throttle");qe(this,"canvasContextOptions");qe(this,"_ctx");qe(this,"_drawingStroke",!1);qe(this,"_isEmpty",!0);qe(this,"_dataUrl");qe(this,"_dataUrlOptions");qe(this,"_lastPoints",[]);qe(this,"_data",[]);qe(this,"_lastVelocity",0);qe(this,"_lastWidth",0);qe(this,"_strokeMoveUpdate");qe(this,"_strokePointerId");this.canvas=n,this.velocityFilterWeight=r.velocityFilterWeight||.7,this.minWidth=r.minWidth||.5,this.maxWidth=r.maxWidth||2.5,this.throttle=r.throttle??16,this.minDistance=r.minDistance??5,this.dotSize=r.dotSize||0,this.penColor=r.penColor||"black",this.backgroundColor=r.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=r.compositeOperation||"source-over",this.canvasContextOptions=r.canvasContextOptions??{},this._strokeMoveUpdate=this.throttle?eVe(H4.prototype._strokeUpdate,this.throttle):H4.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handlePointerCancel=this._handlePointerCancel.bind(this),this._handleTouchCancel=this._handleTouchCancel.bind(this),this._ctx=n.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:n,canvas:r}=this;
vendor: 6,580 bytes, line 738
738n.fillStyle=this.backgroundColor,n.clearRect(0,0,r.width,r.height),n.fillRect(0,0,r.width,r.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._dataUrl=void 0,this._dataUrlOptions=void 0,this._strokePointerId=void 0}redraw(){const n=this._data,r=this._dataUrl,a=this._dataUrlOptions;this.clear(),r&&this.fromDataURL(r,a),this.fromData(n,{clear:!1})}fromDataURL(n,r={}){return new Promise((a,i)=>{const o=new Image,l=r.ratio||window.devicePixelRatio||1,c=r.width||this.canvas.width/l,u=r.height||this.canvas.height/l,d=r.xOffset||0,f=r.yOffset||0;this._reset(this._getPointGroupOptions()),o.onload=()=>{this._ctx.drawImage(o,d,f,c,u),a()},o.onerror=p=>{i(p)},o.crossOrigin="anonymous",o.src=n,this._isEmpty=!1,this._dataUrl=n,this._dataUrlOptions={...r}})}toDataURL(n="image/png",r){switch(n){case"image/svg+xml":return typeof r!="object"&&(r=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(r))}`;default:return typeof r!="number"&&(r=void 0),this.canvas.toDataURL(n,r)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none",this.canvas.style.webkitUserSelect="none";const n=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!n?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.style.webkitUserSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){const n=window.document===this.canvas.ownerDocument?window:this.canvas.ownerDocument.defaultView??this.canvas.ownerDocument;return{addEventListener:n.addEventListener.bind(n),removeEventListener:n.removeEventListener.bind(n)}}_removeMoveUpEventListeners(){const{removeEventListener:n}=this._getListenerFunctions();n("pointermove",this._handlePointerMove),n("pointerup",this._handlePointerUp),n("pointercancel",this._handlePointerCancel),n("mousemove",this._handleMouseMove),n("mouseup",this._handleMouseUp),n("touchmove",this._handleTouchMove),n("touchend",this._handleTouchEnd),n("touchcancel",this._handleTouchCancel)}isEmpty(){return this._isEmpty}fromData(n,{clear:r=!0}={}){r&&this.clear(),this._fromData(n,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(n)}toData(){return this._data}_isLeftButtonPressed(n,r){return r?n.buttons===1:(n.buttons&1)===1}_pointerEventToSignatureEvent(n){return{event:n,type:n.type,x:n.clientX,y:n.clientY,pressure:"pressure"in n?n.pressure:0}}_touchEventToSignatureEvent(n){const r=n.changedTouches[0];return{event:n,type:n.type,x:r.clientX,y:r.clientY,pressure:r.force}}_handleMouseDown(n){!this._isLeftButtonPressed(n,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(n))}_handleMouseMove(n){if(!this._isLeftButtonPressed(n,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(n),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(n))}_handleMouseUp(n){this._isLeftButtonPressed(n)||this._strokeEnd(this._pointerEventToSignatureEvent(n))}_handleTouchStart(n){n.targetTouches.length!==1||this._drawingStroke||(n.cancelable&&n.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(n)))}_handleTouchMove(n){if(n.targetTouches.length===1){if(n.cancelable&&n.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(n),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(n))}}_handleTouchEnd(n){n.targetTouches.length===0&&(n.cancelable&&n.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(n)))}_handlePointerCancel(n){this._allowPointerId(n)&&(n.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(n),!1))}_handleTouchCancel(n){n.cancelable&&n.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(n),!1)}_getPointerId(n){return n.persistentDeviceId||n.pointerId}_allowPointerId(n,r=!1){return typeof this._strokePointerId>"u"?r:this._getPointerId(n)===this._strokePointerId}_handlePointerDown(n){this._drawingStroke||!this._isLeftButtonPressed(n)||!this._allowPointerId(n,!0)||(this._strokePointerId=this._getPointerId(n),n.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(n)))}_handlePointerMove(n){if(this._allowPointerId(n)){if(!this._isLeftButtonPressed(n,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(n),!1);return}n.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(n))}}_handlePointerUp(n){this._isLeftButtonPressed(n)||!this._allowPointerId(n)||(n.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(n)))}_getPointGroupOptions(n){return{penColor:n&&"penColor"in n?n.penColor:this.penColor,dotSize:n&&"dotSize"in n?n.dotSize:this.dotSize,minWidth:n&&"minWidth"in n?n.minWidth:this.minWidth,maxWidth:n&&"maxWidth"in n?n.maxWidth:this.maxWidth,velocityFilterWeight:n&&"velocityFilterWeight"in n?n.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:n&&"compositeOperation"in n?n.compositeOperation:this.compositeOperation}}_strokeBegin(n){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:n,cancelable:!0})))return;const{addEventListener:a}=this._getListenerFunctions();switch(n.event.type){case"mousedown":a("mousemove",this._handleMouseMove,{passive:!1}),a("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":a("touchmove",this._handleTouchMove,{passive:!1}),a("touchend",this._handleTouchEnd,{passive:!1}),a("touchcancel",this._handleTouchCancel,{passive:!1});break;case"pointerdown":a("pointermove",this._handlePointerMove,{passive:!1}),a("pointerup",this._handlePointerUp,{passive:!1}),a("pointercancel",this._handlePointerCancel,{passive:!1});break}this._drawingStroke=!0;const i=this._getPointGroupOptions(),o={...i,points:[]};this._data.push(o),this._reset(i),this._strokeUpdate(n)}_strokeUpdate(n){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(n);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:n}));const r=this._createPoint(n.x,n.y,n.pressure),a=this._data[this._data.length-1],i=a.points,o=i.length>0&&i[i.length-1],l=o?r.distanceTo(o)<=this.minDistance:!1,c=this._getPointGroupOptions(a);if(!o||!(o&&l)){const u=this._addPoint(r,c);
738o?u&&this._drawCurve(u,c):this._drawDot(r,c),i.push({time:r.time,x:r.x,y:r.y,pressure:r.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:n}))}_strokeEnd(n,r=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(r&&this._strokeUpdate(n),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:n})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(n){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(n.minWidth+n.maxWidth)/2,this._ctx.fillStyle=n.penColor,this._ctx.globalCompositeOperation=n.compositeOperation}_createPoint(n,r,a){const i=this.canvas.getBoundingClientRect();return new kj(n-i.left,r-i.top,a,new Date().getTime())}_addPoint(n,r){const{_lastPoints:a}=this;if(a.push(n),a.length>2){a.length===3&&a.unshift(a[0]);const i=this._calculateCurveWidths(a[1],a[2],r),o=Jqe.fromPoints(a,i);return a.shift(),o}return null}_calculateCurveWidths(n,r,a){const i=a.velocityFilterWeight*r.velocityFrom(n)+(1-a.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(i,a),l={end:o,start:this._lastWidth};return this._lastVelocity=i,this._lastWidth=o,l}_strokeWidth(n,r){return Math.max(r.maxWidth/(n+1),r.minWidth)}_drawCurveSegment(n,r,a){const i=this._ctx;i.moveTo(n,r),i.arc(n,r,a,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(n,r){const a=this._ctx,i=n.endWidth-n.startWidth,o=Math.ceil(n.length())*2;a.beginPath(),a.fillStyle=r.penColor;for(let l=0;l<o;l+=1){const c=l/o,u=c*c,d=u*c,f=1-c,p=f*f,h=p*f;let m=h*n.startPoint.x;m+=3*p*c*n.control1.x,m+=3*f*u*n.control2.x,m+=d*n.endPoint.x;let g=h*n.startPoint.y;g+=3*p*c*n.control1.y,g+=3*f*u*n.control2.y,g+=d*n.endPoint.y;const v=Math.min(n.startWidth+d*i,r.maxWidth);this._drawCurveSegment(m,g,v)}a.closePath(),a.fill()}_drawDot(n,r){const a=this._ctx,i=r.dotSize>0?r.dotSize:(r.minWidth+r.maxWidth)/2;a.beginPath(),this._drawCurveSegment(n.x,n.y,i),a.closePath(),a.fillStyle=r.penColor,a.fill()}_fromData(n,r,a){for(const i of n){const{points:o}=i,l=this._getPointGroupOptions(i);if(o.length>1)for(let c=0;c<o.length;c+=1){const u=o[c],d=new kj(u.x,u.y,u.pressure,u.time);c===0&&this._reset(l);const f=this._addPoint(d,l);f&&r(f,l)}else this._reset(l),a(o[0],l)}}toSVG({includeBackgroundColor:n=!1,includeDataUrl:r=!1}={}){var f,p,h,m,g;const a=this._data,i=Math.max(window.devicePixelRatio||1,1),o=0,l=0,c=this.canvas.width/i,u=this.canvas.height/i,d=document.createElementNS("http://www.w3.org/2000/svg","svg");if(d.setAttribute("xmlns","http://www.w3.org/2000/svg"),d.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),d.setAttribute("viewBox",`${o} ${l} ${c} ${u}`),d.setAttribute("width",c.toString()),d.setAttribute("height",u.toString()),n&&this.backgroundColor){const v=document.createElement("rect");v.setAttribute("width","100%"),v.setAttribute("height","100%"),v.setAttribute("fill",this.backgroundColor),d.appendChild(v)}if(r&&this._dataUrl){const v=((f=this._dataUrlOptions)==null?void 0:f.ratio)||window.devicePixelRatio||1,y=((p=this._dataUrlOptions)==null?void 0:p.width)||this.canvas.width/v,b=((h=this._dataUrlOptions)==null?void 0:h.height)||this.canvas.height/v,w=((m=this._dataUrlOptions)==null?void 0:m.xOffset)||0,j=((g=this._dataUrlOptions)==null?void 0:g.yOffset)||0,S=document.createElement("image");S.setAttribute("x",w.toString()),S.setAttribute("y",j.toString()),S.setAttribute("width",y.toString()),S.setAttribute("height",b.toString()),S.setAttribute("preserveAspectRatio","none"),S.setAttribute("href",this._dataUrl),d.appendChild(S)}return this._fromData(a,(v,{penColor:y})=>{const b=document.createElement("path");if(!isNaN(v.control1.x)&&!isNaN(v.control1.y)&&!isNaN(v.control2.x)&&!isNaN(v.control2.y)){const w=`M ${v.startPoint.x.toFixed(3)},${v.startPoint.y.toFixed(3)} C ${v.control1.x.toFixed(3)},${v.control1.y.toFixed(3)} ${v.control2.x.toFixed(3)},${v.control2.y.toFixed(3)} ${v.endPoint.x.toFixed(3)},${v.endPoint.y.toFixed(3)}`;b.setAttribute("d",w),b.setAttribute("stroke-width",(v.endWidth*2.25).toFixed(3)),b.setAttribute("stroke",y),b.setAttribute("fill","none"),b.setAttribute("stroke-linecap","round"),d.appendChild(b)}},(v,{penColor:y,dotSize:b,minWidth:w,maxWidth:j})=>{const S=document.createElement("circle"),A=b>0?b:(w+j)/2;S.setAttribute("r",A.toString()),S.setAttribute("cx",v.x.toString()),S.setAttribute("cy",v.y.toString()),S.setAttribute("fill",y),d.appendChild(S)}),d.outerHTML}};const nVe="modulepreload",rVe=function(e){return"/"+e},G7={}
vendor: 4,680 bytes, line 738
738,c_=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.allSettled(n.map(c=>{if(c=rVe(c),c in G7)return;G7[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":nVe,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((p,h)=>{f.addEventListener("load",p),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function br(e){"@babel/helpers - typeof";return br=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},br(e)}var Rl=Uint8Array,lo=Uint16Array,vI=Int32Array,yI=new Rl([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xI=new Rl([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Y7=new Rl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Lee=function(e,t){for(var n=new lo(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var a=new vI(n[30]),r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)a[i]=i-n[r]<<5|r;return{b:n,r:a}},Mee=Lee(yI,2),aVe=Mee.b,G4=Mee.r;aVe[28]=258,G4[258]=28;var iVe=Lee(xI,0),K7=iVe.r,Y4=new lo(32768);for(var Yr=0;Yr<32768;++Yr){var nd=(Yr&43690)>>1|(Yr&21845)<<1;nd=(nd&52428)>>2|(nd&13107)<<2,nd=(nd&61680)>>4|(nd&3855)<<4,Y4[Yr]=((nd&65280)>>8|(nd&255)<<8)>>1}var R0=function(e,t,n){for(var r=e.length,a=0,i=new lo(t);a<r;++a)e[a]&&++i[e[a]-1];var o=new lo(t);for(a=1;a<t;++a)o[a]=o[a-1]+i[a-1]<<1;var l;if(n){l=new lo(1<<t);var c=15-t;for(a=0;a<r;++a)if(e[a])for(var u=a<<4|e[a],d=t-e[a],f=o[e[a]-1]++<<d,p=f|(1<<d)-1;f<=p;++f)l[Y4[f]>>c]=u}else for(l=new lo(r),a=0;a<r;++a)e[a]&&(l[a]=Y4[o[e[a]-1]++]>>15-e[a]);return l},hp=new Rl(288);for(var Yr=0;Yr<144;++Yr)hp[Yr]=8;for(var Yr=144;Yr<256;++Yr)hp[Yr]=9;for(var Yr=256;Yr<280;++Yr)hp[Yr]=7;for(var Yr=280;Yr<288;++Yr)hp[Yr]=8;var Ej=new Rl(32);for(var Yr=0;Yr<32;++Yr)Ej[Yr]=5;var sVe=R0(hp,9,0),oVe=R0(Ej,5,0),$ee=function(e){return(e+7)/8|0},lVe=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new Rl(e.subarray(t,n))},qc=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Yy=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},wk=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,i=n.slice();if(!a)return{t:Fee,l:0};if(a==1){var o=new Rl(n[0].s+1);return o[n[0].s]=1,{t:o,l:1}}n.sort(function(S,A){return S.f-A.f}),n.push({s:-1,f:25001});var l=n[0],c=n[1],u=0,d=1,f=2;for(n[0]={s:-1,f:l.f+c.f,l,r:c};d!=a-1;)l=n[n[u].f<n[f].f?u++:f++],c=n[u!=d&&n[u].f<n[f].f?u++:f++],n[d++]={s:-1,f:l.f+c.f,l,r:c};for(var p=i[0].s,r=1;r<a;++r)i[r].s>p&&(p=i[r].s);var h=new lo(p+1),m=K4(n[d-1],h,0);if(m>t){var r=0,g=0,v=m-t,y=1<<v;for(i.sort(function(A,E){return h[E.s]-h[A.s]||A.f-E.f});r<a;++r){var b=i[r].s;if(h[b]>t)g+=y-(1<<m-h[b]),h[b]=t;else break}for(g>>=v;g>0;){var w=i[r].s;h[w]<t?g-=1<<t-h[w]++-1:++r}for(;r>=0&&g;--r){var j=i[r].s;h[j]==t&&(--h[j],++g)}m=t}return{t:new Rl(h),l:m}},K4=function(e,t,n){return e.s==-1?Math.max(K4(e.l,t,n+1),K4(e.r,t,n+1)):t[e.s]=n},Z7=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new lo(++t),r=0,a=e[0],i=1,o=function(c){n[r++]=c},l=1;l<=t;++l)if(e[l]==a&&l!=t)++i;else{if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(a);i=1,a=e[l]}return{c:n.subarray(0,r),n:t}},Ky=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Dee=function(e,t,n){var r=n.length,a=$ee(t+2);e[a]=r&255,e[a+1]=r>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var i=0;i<r;++i)e[a+i+4]=n[i];return(a+4+r)*8},X7=function(e,t,n,r,a,i,o,l,c,u,d){qc(t,d++,n),++a[256];for(var f=wk(a,15),p=f.t,h=f.l,m=wk(i,15),g=m.t,v=m.l,y=Z7(p),b=y.c,w=y.n,j=Z7(g),S=j.c,A=j.n,E=new lo(19),k=0;k<b.length;++k)++E[b[k]&31];for(var k=0;k<S.length;++k)++E[S[k]&31];for(var P=wk(E,7),R=P.t,C=P.l,I=19;I>4&&!R[Y7[I-1]];--I);var D=u+5<<3,U=Ky(a,hp)+Ky(i,Ej)+o,q=Ky(a,p)+Ky(i,g)+o+14+3*I+Ky(E,R)+2*E[16]+3*E[17]+7*E[18];if(c>=0&&D<=U&&D<=q)return Dee(t,d,e.subarray(c,c+u));var Z,H,$,W;
vendor: 10,902 bytes, lines 738-739
738if(qc(t,d,1+(q<U)),d+=2,q<U){Z=R0(p,h,0),H=p,$=R0(g,v,0),W=g;var ee=R0(R,C,0);qc(t,d,w-257),qc(t,d+5,A-1),qc(t,d+10,I-4),d+=14;for(var k=0;k<I;++k)qc(t,d+3*k,R[Y7[k]]);d+=3*I;for(var V=[b,S],O=0;O<2;++O)for(var M=V[O],k=0;k<M.length;++k){var B=M[k]&31;qc(t,d,ee[B]),d+=R[B],B>15&&(qc(t,d,M[k]>>5&127),d+=M[k]>>12)}}else Z=sVe,H=hp,$=oVe,W=Ej;for(var k=0;k<l;++k){var G=r[k];if(G>255){var B=G>>18&31;Yy(t,d,Z[B+257]),d+=H[B+257],B>7&&(qc(t,d,G>>23&31),d+=yI[B]);var te=G&31;Yy(t,d,$[te]),d+=W[te],te>3&&(Yy(t,d,G>>5&8191),d+=xI[te])}else Yy(t,d,Z[G]),d+=H[G]}return Yy(t,d,Z[256]),d+H[256]},cVe=new vI([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fee=new Rl(0),uVe=function(e,t,n,r,a,i){var o=i.z||e.length,l=new Rl(r+o+5*(1+Math.ceil(o/7e3))+a),c=l.subarray(r,l.length-a),u=i.l,d=(i.r||0)&7;if(t){d&&(c[0]=i.r>>3);for(var f=cVe[t-1],p=f>>13,h=f&8191,m=(1<<n)-1,g=i.p||new lo(32768),v=i.h||new lo(m+1),y=Math.ceil(n/3),b=2*y,w=function(ie){return(e[ie]^e[ie+1]<<y^e[ie+2]<<b)&m},j=new vI(25e3),S=new lo(288),A=new lo(32),E=0,k=0,P=i.i||0,R=0,C=i.w||0,I=0;P+2<o;++P){var D=w(P),U=P&32767,q=v[D];if(g[U]=q,v[D]=U,C<=P){var Z=o-P;if((E>7e3||R>24576)&&(Z>423||!u)){d=X7(e,c,0,j,S,A,k,R,I,P-I,d),R=E=k=0,I=P;for(var H=0;H<286;++H)S[H]=0;for(var H=0;H<30;++H)A[H]=0}var $=2,W=0,ee=h,V=U-q&32767;if(Z>2&&D==w(P-V))for(var O=Math.min(p,Z)-1,M=Math.min(32767,P),B=Math.min(258,Z);V<=M&&--ee&&U!=q;){if(e[P+$]==e[P+$-V]){for(var G=0;G<B&&e[P+G]==e[P+G-V];++G);if(G>$){if($=G,W=V,G>O)break;for(var te=Math.min(V,G-2),ne=0,H=0;H<te;++H){var ce=P-V+H&32767,oe=g[ce],X=ce-oe&32767;X>ne&&(ne=X,q=ce)}}}U=q,q=g[U],V+=U-q&32767}if(W){j[R++]=268435456|G4[$]<<18|K7[W];var se=G4[$]&31,Q=K7[W]&31;k+=yI[se]+xI[Q],++S[257+se],++A[Q],C=P+$,++E}else j[R++]=e[P],++S[e[P]]}}for(P=Math.max(P,C);P<o;++P)j[R++]=e[P],++S[e[P]];d=X7(e,c,u,j,S,A,k,R,I,P-I,d),u||(i.r=d&7|c[d/8|0]<<3,d-=7,i.h=v,i.p=g,i.i=P,i.w=C)}else{for(var P=i.w||0;P<o+u;P+=65535){var ye=P+65535;ye>=o&&(c[d/8|0]=u,ye=o),d=Dee(c,d+1,e.subarray(P,ye))}i.i=o}return lVe(l,0,r+$ee(d)+a)},Bee=function(){var e=1,t=0;return{p:function(n){for(var r=e,a=t,i=n.length|0,o=0;o!=i;){for(var l=Math.min(o+2655,i);o<l;++o)a+=r+=n[o];r=(r&65535)+15*(r>>16),a=(a&65535)+15*(a>>16)}e=r,t=a},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},dVe=function(e,t,n,r,a){if(!a&&(a={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),o=new Rl(i.length+e.length);o.set(i),o.set(e,i.length),e=o,a.w=i.length}return uVe(e,t.level==null?6:t.level,t.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,a)},Uee=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},fVe=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var a=Bee();a.p(t.dictionary),Uee(e,2,a.d())}};function Z4(e,t){t||(t={});var n=Bee();n.p(e);var r=dVe(e,t,t.dictionary?6:2,4);return fVe(r,t),Uee(r,r.length-4,n.d()),r}var hVe=typeof TextDecoder<"u"&&new TextDecoder,pVe=0;try{hVe.decode(Fee,{stream:!0}),pVe=1}catch{}function mVe(e){if(Array.isArray(e))return e}function gVe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function J7(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vVe(e,t){if(e){if(typeof e=="string")return J7(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J7(e,t):void 0}}function yVe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
739In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q7(e,t){return mVe(e)||gVe(e,t)||vVe(e,t)||yVe()}function eB(e,t="utf8"){return new TextDecoder(t).decode(e)}const xVe=new TextEncoder;function bVe(e){return xVe.encode(e)}const wVe=1024*8,_Ve=(()=>{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),_k={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class bI{constructor(t=wVe,n={}){qe(this,"buffer");qe(this,"byteLength");qe(this,"byteOffset");qe(this,"length");qe(this,"offset");qe(this,"lastWrittenByte");qe(this,"littleEndian");qe(this,"_data");qe(this,"_mark");qe(this,"_marks");let r=!1;typeof t=="number"?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);const a=n.offset?n.offset>>>0:0,i=t.byteLength-a;let o=a;(ArrayBuffer.isView(t)||t instanceof bI)&&(t.byteLength!==t.buffer.byteLength&&(o=t.byteOffset+a),t=t.buffer),r?this.lastWrittenByte=i:this.lastWrittenByte=0,this.buffer=t,this.length=i,this.byteLength=i,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,i),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const r=(this.offset+t)*2,a=new Uint8Array(r);a.set(new Uint8Array(this.buffer)),this.buffer=a.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,n){const r=_k[n].BYTES_PER_ELEMENT*t,a=this.byteOffset+this.offset,i=this.buffer.slice(a,a+r);if(this.littleEndian===_Ve&&n!=="uint8"&&n!=="int8"){const l=new Uint8Array(this.buffer.slice(a,a+r));l.reverse();const c=new _k[n](l.buffer);return this.offset+=r,c.reverse(),c}const o=new _k[n](i);return this.offset+=r,o}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let n="";for(let r=0;r<t;r++)n+=this.readChar();return n}readUtf8(t=1){return eB(this.readBytes(t))}decodeText(t=1,n="utf8"){return eB(this.readBytes(t),n)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let n=0;n<t.length;n++)this._data.setUint8(this.offset++,t[n]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let n=0;n<t.length;n++)this.writeUint8(t.charCodeAt(n));return this}writeUtf8(t){return this.writeBytes(bVe(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const jVe=4,tB=0,nB=1,SVe=2;function Qv(e){let t=e.length;for(;--t>=0;)e[t]=0}const NVe=0,zee=1,AVe=2,kVe=3,EVe=258,wI=29,Vb=256,ab=Vb+1+wI,og=30,_I=19,Wee=2*ab+1,Ah=15,jk=16,CVe=7,jI=256,qee=16,Vee=17,Hee=18,X4=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),u_=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),PVe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Gee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),TVe=512,Jc=new Array((ab+2)*2);Qv(Jc);const I0=new Array(og*2);Qv(I0);const ib=new Array(TVe);Qv(ib);const sb=new Array(EVe-kVe+1);Qv(sb);const SI=new Array(wI);Qv(SI);const Cj=new Array(og);Qv(Cj);function Sk(e,t,n,r,a){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=a,this.has_stree=e&&e.length}let Yee,Kee,Zee;function Nk(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const Xee=e=>e<256?ib[e]:ib[256+(e>>>7)],ob=(e,t)=>
vendor: 23,597 bytes, line 739
739{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Rs=(e,t,n)=>{e.bi_valid>jk-n?(e.bi_buf|=t<<e.bi_valid&65535,ob(e,e.bi_buf),e.bi_buf=t>>jk-e.bi_valid,e.bi_valid+=n-jk):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},ic=(e,t,n)=>{Rs(e,n[t*2],n[t*2+1])},Jee=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},OVe=e=>{e.bi_valid===16?(ob(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},RVe=(e,t)=>{const n=t.dyn_tree,r=t.max_code,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,d,f,p,h,m,g=0;for(p=0;p<=Ah;p++)e.bl_count[p]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<Wee;u++)d=e.heap[u],p=n[n[d*2+1]*2+1]+1,p>c&&(p=c,g++),n[d*2+1]=p,!(d>r)&&(e.bl_count[p]++,h=0,d>=l&&(h=o[d-l]),m=n[d*2],e.opt_len+=m*(p+h),i&&(e.static_len+=m*(a[d*2+1]+h)));if(g!==0){do{for(p=c-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(p=c;p!==0;p--)for(d=e.bl_count[p];d!==0;)f=e.heap[--u],!(f>r)&&(n[f*2+1]!==p&&(e.opt_len+=(p-n[f*2+1])*n[f*2],n[f*2+1]=p),d--)}},Qee=(e,t,n)=>{const r=new Array(Ah+1);let a=0,i,o;for(i=1;i<=Ah;i++)a=a+n[i-1]<<1,r[i]=a;for(o=0;o<=t;o++){let l=e[o*2+1];l!==0&&(e[o*2]=Jee(r[l]++,l))}},IVe=()=>{let e,t,n,r,a;const i=new Array(Ah+1);for(n=0,r=0;r<wI-1;r++)for(SI[r]=n,e=0;e<1<<X4[r];e++)sb[n++]=r;for(sb[n-1]=r,a=0,r=0;r<16;r++)for(Cj[r]=a,e=0;e<1<<u_[r];e++)ib[a++]=r;for(a>>=7;r<og;r++)for(Cj[r]=a<<7,e=0;e<1<<u_[r]-7;e++)ib[256+a++]=r;for(t=0;t<=Ah;t++)i[t]=0;for(e=0;e<=143;)Jc[e*2+1]=8,e++,i[8]++;for(;e<=255;)Jc[e*2+1]=9,e++,i[9]++;for(;e<=279;)Jc[e*2+1]=7,e++,i[7]++;for(;e<=287;)Jc[e*2+1]=8,e++,i[8]++;for(Qee(Jc,ab+1,i),e=0;e<og;e++)I0[e*2+1]=5,I0[e*2]=Jee(e,5);Yee=new Sk(Jc,X4,Vb+1,ab,Ah),Kee=new Sk(I0,u_,0,og,Ah),Zee=new Sk(new Array(0),PVe,0,_I,CVe)},ete=e=>{let t;for(t=0;t<ab;t++)e.dyn_ltree[t*2]=0;for(t=0;t<og;t++)e.dyn_dtree[t*2]=0;for(t=0;t<_I;t++)e.bl_tree[t*2]=0;e.dyn_ltree[jI*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},tte=e=>{e.bi_valid>8?ob(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},rB=(e,t,n,r)=>{const a=t*2,i=n*2;return e[a]<e[i]||e[a]===e[i]&&r[t]<=r[n]},Ak=(e,t,n)=>{const r=e.heap[n];let a=n<<1;for(;a<=e.heap_len&&(a<e.heap_len&&rB(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!rB(t,r,e.heap[a],e.depth));)e.heap[n]=e.heap[a],n=a,a<<=1;e.heap[n]=r},aB=(e,t,n)=>{let r,a,i=0,o,l;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+i++]&255,r+=(e.pending_buf[e.sym_buf+i++]&255)<<8,a=e.pending_buf[e.sym_buf+i++],r===0?ic(e,a,t):(o=sb[a],ic(e,o+Vb+1,t),l=X4[o],l!==0&&(a-=SI[o],Rs(e,a,l)),r--,o=Xee(r),ic(e,o,n),l=u_[o],l!==0&&(r-=Cj[o],Rs(e,r,l)));while(i<e.sym_next);ic(e,jI,t)},J4=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,i=t.stat_desc.elems;let o,l,c=-1,u;for(e.heap_len=0,e.heap_max=Wee,o=0;o<i;o++)n[o*2]!==0?(e.heap[++e.heap_len]=c=o,e.depth[o]=0):n[o*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,a&&(e.static_len-=r[u*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Ak(e,n,o);u=i;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ak(e,n,1),l=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=l,n[u*2]=n[o*2]+n[l*2],e.depth[u]=(e.depth[o]>=e.depth[l]?e.depth[o]:e.depth[l])+1,n[o*2+1]=n[l*2+1]=u,e.heap[1]=u++,Ak(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],RVe(e,t),Qee(n,c,e.bl_count)},iB=(e,t,n)=>{let r,a=-1,i,o=t[0*2+1],l=0,c=7,u=4;for(o===0&&(c=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)i=o,o=t[(r+1)*2+1],!(++l<c&&i===o)&&(l<u?e.bl_tree[i*2]+=l:i!==0?(i!==a&&e.bl_tree[i*2]++,e.bl_tree[qee*2]++):l<=10?e.bl_tree[Vee*2]++:e.bl_tree[Hee*2]++,l=0,a=i,o===0?(c=138,u=3):i===o?(c=6,u=3):(c=7,u=4))},sB=(e,t,n)=>{let r,a=-1,i,o=t[0*2+1],l=0,c=7,u=4;for(o===0&&(c=138,u=3),r=0;r<=n;r++)if(i=o,o=t[(r+1)*2+1],!(++l<c&&i===o)){if(l<u)do ic(e,i,e.bl_tree);while(--l!==0);else i!==0?(i!==a&&(ic(e,i,e.bl_tree),l--),ic(e,qee,e.bl_tree),Rs(e,l-3,2)):l<=10?(ic(e,Vee,e.bl_tree),Rs(e,l-3,3)):(ic(e,Hee,e.bl_tree),Rs(e,l-11,7));l=0,a=i,o===0?(c=138,u=3):i===o?(c=6,u=3):(c=7,u=4)}},LVe=e=>{let t;for(iB(e,e.dyn_ltree,e.l_desc.max_code),iB(e,e.dyn_dtree,e.d_desc.max_code),J4(e,e.bl_desc),t=_I-1;t>=3&&e.bl_tree[Gee[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},MVe=(e,t,n,r)=>{let a;for(Rs(e,t-257,5),Rs(e,n-1,5),Rs(e,r-4,4),a=0;a<r;a++)Rs(e,e.bl_tree[Gee[a]*2+1],3);sB(e,e.dyn_ltree,t-1),sB(e,e.dyn_dtree,n-1)},$Ve=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return tB;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return nB;for(n=32;n<Vb;n++)if(e.dyn_ltree[n*2]!==0)return nB;return tB};let oB=!1;const DVe=e=>{oB||(IVe(),oB=!0),e.l_desc=new Nk(e.dyn_ltree,Yee),e.d_desc=new Nk(e.dyn_dtree,Kee),e.bl_desc=new Nk(e.bl_tree,Zee),e.bi_buf=0,e.bi_valid=0,ete(e)},nte=(e,t,n,r)=>{Rs(e,(NVe<<1)+(r?1:0),3),tte(e),ob(e,n),ob(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},FVe=e=>{Rs(e,zee<<1,3),ic(e,jI,Jc),OVe(e)},BVe=(e,t,n,r)=>{let a,i,o=0;e.level>0?(e.strm.data_type===SVe&&(e.strm.data_type=$Ve(e)),J4(e,e.l_desc),J4(e,e.d_desc),o=LVe(e),a=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=a&&(a=i)):a=i=n+5,n+4<=a&&t!==-1?nte(e,t,n,r):e.strategy===jVe||i===a?(Rs(e,(zee<<1)+(r?1:0),3),aB(e,Jc,I0)):(Rs(e,(AVe<<1)+(r?1:0),3),MVe(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),aB(e,e.dyn_ltree,e.dyn_dtree)),ete(e),r&&tte(e)},UVe=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(sb[n]+Vb+1)*2]++,e.dyn_dtree[Xee(t)*2]++),e.sym_next===e.sym_end);var zVe=DVe,WVe=nte,qVe=BVe,VVe=UVe,HVe=FVe,GVe={_tr_init:zVe,_tr_stored_block:WVe,_tr_flush_block:qVe,_tr_tally:VVe,_tr_align:HVe};const YVe=(e,t,n,r)=>{let a=e&65535|0,i=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do a=a+t[r++]|0,i=i+a|0;while(--o);a%=65521,i%=65521}return a|i<<16|0};var lb=YVe;const KVe=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},ZVe=new Uint32Array(KVe()),XVe=(e,t,n,r)=>{const a=ZVe,i=r+n;e^=-1;for(let o=r;o<i;o++)e=e>>>8^a[(e^t[o])&255];return e^-1};var hi=XVe,jv={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Hb={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:JVe,_tr_stored_block:Q4,_tr_flush_block:QVe,_tr_tally:Zd,_tr_align:eHe}=GVe,{Z_NO_FLUSH:Xd,Z_PARTIAL_FLUSH:tHe,Z_FULL_FLUSH:nHe,Z_FINISH:Do,Z_BLOCK:lB,Z_OK:Ri,Z_STREAM_END:cB,Z_STREAM_ERROR:vc,Z_DATA_ERROR:rHe,Z_BUF_ERROR:kk,Z_DEFAULT_COMPRESSION:aHe,Z_FILTERED:iHe,Z_HUFFMAN_ONLY:Nw,Z_RLE:sHe,Z_FIXED:oHe,Z_DEFAULT_STRATEGY:lHe,Z_UNKNOWN:cHe,Z_DEFLATED:HN}=Hb,uHe=9,dHe=15,fHe=8,hHe=29,pHe=256,eT=pHe+1+hHe,mHe=30,gHe=19,vHe=2*eT+1,yHe=15,Gn=3,Id=258,yc=Id+Gn+1,xHe=32,Sv=42,NI=57,tT=69,nT=73,rT=91,aT=103,kh=113,h0=666,ps=1,ey=2,pp=3,ty=4,bHe=3,Eh=(e,t)=>(e.msg=jv[t],t),uB=e=>e*2-(e>4?9:0),md=e=>{let t=e.length;for(;--t>=0;)e[t]=0},wHe=e=>{let t,n,r,a=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=a?n-a:0;while(--t);t=a,r=t;do n=e.prev[--r],e.prev[r]=n>=a?n-a:0;while(--t)};let _He=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Jd=_He;const eo=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},co=(e,t)=>{QVe(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,eo(e.strm)},cr=(e,t)=>{e.pending_buf[e.pending++]=t},Zy=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},iT=(e,t,n,r)=>{let a=e.avail_in;return a>r&&(a=r),a===0?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),n),e.state.wrap===1?e.adler=lb(e.adler,t,a,n):e.state.wrap===2&&(e.adler=hi(e.adler,t,a,n)),e.next_in+=a,e.total_in+=a,a)},rte=(e,t)=>{let n=e.max_chain_length,r=e.strstart,a,i,o=e.prev_length,l=e.nice_match;const c=e.strstart>e.w_size-yc?e.strstart-(e.w_size-yc):0,u=e.window,d=e.w_mask,f=e.prev,p=e.strstart+Id;let h=u[r+o-1],m=u[r+o];e.prev_length>=e.good_match&&(n>>=2),l>e.lookahead&&(l=e.lookahead);do if(a=t,!(u[a+o]!==m||u[a+o-1]!==h||u[a]!==u[r]||u[++a]!==u[r+1])){r+=2,a++;do;while(u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&r<p);if(i=Id-(p-r),r=p-Id,i>o){if(e.match_start=t,o=i,i>=l)break;h=u[r+o-1],m=u[r+o]}}while((t=f[t&d])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},Nv=e=>{const t=e.w_size;let n,r,a;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-yc)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),wHe(e),r+=t),e.strm.avail_in===0)break;if(n=iT(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=Gn)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=Jd(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=Jd(e,e.ins_h,e.window[a+Gn-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<Gn)););}while(e.lookahead<yc&&e.strm.avail_in!==0)},ate=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,a,i,o=0,l=e.strm.avail_in;do{if(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i||(i=e.strm.avail_out-i,a=e.strstart-e.block_start,r>a+e.strm.avail_in&&(r=a+e.strm.avail_in),r>i&&(r=i),r<n&&(r===0&&t!==Do||t===Xd||r!==a+e.strm.avail_in)))break;o=t===Do&&r===a+e.strm.avail_in?1:0,Q4(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,eo(e.strm),a&&(a>r&&(a=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,r-=a),r&&(iT(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return l-=e.strm.avail_in,l&&(l>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=l&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?ty:t!==Xd&&t!==Do&&e.strm.avail_in===0&&e.strstart===e.block_start?ey:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(iT(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,n=i>e.w_size?e.w_size:i,a=e.strstart-e.block_start,(a>=n||(a||t===Do)&&t!==Xd&&e.strm.avail_in===0&&a<=i)&&(r=a>i?i:a,o=t===Do&&e.strm.avail_in===0&&r===a?1:0,Q4(e,e.block_start,r,o),e.block_start+=r,eo(e.strm)),o?pp:ps)},Ek=(e,t)=>{let n,r;for(;;){if(e.lookahead<yc){if(Nv(e),e.lookahead<yc&&t===Xd)return ps;if(e.lookahead===0)break}if(n=0,e.lookahead>=Gn&&(e.ins_h=Jd(e,e.ins_h,e.window[e.strstart+Gn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-yc&&(e.match_length=rte(e,n)),e.match_length>=Gn)if(r=Zd(e,e.strstart-e.match_start,e.match_length-Gn),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Gn){e.match_length--;do e.strstart++,e.ins_h=Jd(e,e.ins_h,e.window[e.strstart+Gn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Jd(e,e.ins_h,e.window[e.strstart+1]);else r=Zd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(co(e,!1),e.strm.avail_out===0))return ps}return e.insert=e.strstart<Gn-1?e.strstart:Gn-1,t===Do?(co(e,!0),e.strm.avail_out===0?pp:ty):e.sym_next&&(co(e,!1),e.strm.avail_out===0)?ps:ey},dm=(e,t)=>{let n,r,a;for(;;){if(e.lookahead<yc){if(Nv(e),e.lookahead<yc&&t===Xd)return ps;if(e.lookahead===0)break}if(n=0,e.lookahead>=Gn&&(e.ins_h=Jd(e,e.ins_h,e.window[e.strstart+Gn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Gn-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-yc&&(e.match_length=rte(e,n),e.match_length<=5&&(e.strategy===iHe||e.match_length===Gn&&e.strstart-e.match_start>4096)&&(e.match_length=Gn-1)),e.prev_length>=Gn&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-Gn,r=Zd(e,e.strstart-1-e.prev_match,e.prev_length-Gn),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=Jd(e,e.ins_h,e.window[e.strstart+Gn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Gn-1,e.strstart++,r&&(co(e,!1),e.strm.avail_out===0))return ps}else if(e.match_available){if(r=Zd(e,0,e.window[e.strstart-1]),r&&co(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return ps}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Zd(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Gn-1?e.strstart:Gn-1,t===Do?(co(e,!0),e.strm.avail_out===0?pp:ty):e.sym_next&&(co(e,!1),e.strm.avail_out===0)?ps:ey},jHe=(e,t)=>{let n,r,a,i;const o=e.window;for(;;){if(e.lookahead<=Id){if(Nv(e),e.lookahead<=Id&&t===Xd)return ps;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Gn&&e.strstart>0&&(a=e.strstart-1,r=o[a],r===o[++a]&&r===o[++a]&&r===o[++a])){i=e.strstart+Id;do;while(r===o[++a]&&r===o[++a]&&r===o[++a]&&r===o[++a]&&r===o[++a]&&r===o[++a]&&r===o[++a]&&r===o[++a]&&a<i);e.match_length=Id-(i-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Gn?(n=Zd(e,1,e.match_length-Gn),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Zd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(co(e,!1),e.strm.avail_out===0))return ps}return e.insert=0,t===Do?(co(e,!0),e.strm.avail_out===0?pp:ty):e.sym_next&&(co(e,!1),e.strm.avail_out===0)?ps:ey},SHe=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Nv(e),e.lookahead===0)){if(t===Xd)return ps;break}if(e.match_length=0,n=Zd(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(co(e,!1),e.strm.avail_out===0))return ps}return e.insert=0,t===Do?(co(e,!0),e.strm.avail_out===0?pp:ty):e.sym_next&&(co(e,!1),e.strm.avail_out===0)?ps:ey};function Gl(e,t,n,r,a){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=a}const p0=[new Gl(0,0,0,0,ate),new Gl(4,4,8,4,Ek),new Gl(4,5,16,8,Ek),new Gl(4,6,32,32,Ek),new Gl(4,4,16,16,dm),new Gl(8,16,32,32,dm),new Gl(8,16,128,128,dm),new Gl(8,32,128,256,dm),new Gl(32,128,258,1024,dm),new Gl(32,258,258,4096,dm)],NHe=e=>{e.window_size=2*e.w_size,md(e.head),e.max_lazy_match=p0[e.level].max_lazy,e.good_match=p0[e.level].good_length,e.nice_match=p0[e.level].nice_length,e.max_chain_length=p0[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Gn-1,e.match_available=0,e.ins_h=0};function AHe(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=HN,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(vHe*2),this.dyn_dtree=new Uint16Array((2*mHe+1)*2),this.bl_tree=new Uint16Array((2*gHe+1)*2),md(this.dyn_ltree),md(this.dyn_dtree),md(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(yHe+1),this.heap=new Uint16Array(2*eT+1),md(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*eT+1),md(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Gb=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Sv&&t.status!==NI&&t.status!==tT&&t.status!==nT&&t.status!==rT&&t.status!==aT&&t.status!==kh&&t.status!==h0?1:0},ite=e=>{if(Gb(e))return Eh(e,vc);e.total_in=e.total_out=0,e.data_type=cHe;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?NI:t.wrap?Sv:kh,e.adler=t.wrap===2?0:1,t.last_flush=-2,JVe(t),Ri},ste=e=>{const t=ite(e);return t===Ri&&NHe(e.state),t},kHe=(e,t)=>Gb(e)||e.state.wrap!==2?vc:(e.state.gzhead=t,Ri),ote=(e,t,n,r,a,i)=>{if(!e)return vc;let o=1;if(t===aHe&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),a<1||a>uHe||n!==HN||r<8||r>15||t<0||t>9||i<0||i>oHe||r===8&&o!==1)return Eh(e,vc);r===8&&(r=9);const l=new AHe;return e.state=l,l.strm=e,l.status=Sv,l.wrap=o,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Gn-1)/Gn),l.window=new Uint8Array(l.w_size*2),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=(l.lit_bufsize-1)*3,l.level=t,l.strategy=i,l.method=n,ste(e)},EHe=(e,t)=>ote(e,t,HN,dHe,fHe,lHe),CHe=(e,t)=>{if(Gb(e)||t>lB||t<0)return e?Eh(e,vc):vc;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===h0&&t!==Do)return Eh(e,e.avail_out===0?kk:vc);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(eo(e),e.avail_out===0)return n.last_flush=-1,Ri}else if(e.avail_in===0&&uB(t)<=uB(r)&&t!==Do)return Eh(e,kk);if(n.status===h0&&e.avail_in!==0)return Eh(e,kk);if(n.status===Sv&&n.wrap===0&&(n.status=kh),n.status===Sv){let a=HN+(n.w_bits-8<<4)<<8,i=-1;if(n.strategy>=Nw||n.level<2?i=0:n.level<6?i=1:n.level===6?i=2:i=3,a|=i<<6,n.strstart!==0&&(a|=xHe),a+=31-a%31,Zy(n,a),n.strstart!==0&&(Zy(n,e.adler>>>16),Zy(n,e.adler&65535)),e.adler=1,n.status=kh,eo(e),n.pending!==0)return n.last_flush=-1,Ri}if(n.status===NI){if(e.adler=0,cr(n,31),cr(n,139),cr(n,8),n.gzhead)cr(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),cr(n,n.gzhead.time&255),cr(n,n.gzhead.time>>8&255),cr(n,n.gzhead.time>>16&255),cr(n,n.gzhead.time>>24&255),cr(n,n.level===9?2:n.strategy>=Nw||n.level<2?4:0),cr(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(cr(n,n.gzhead.extra.length&255),cr(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=hi(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=tT;else if(cr(n,0),cr(n,0),cr(n,0),cr(n,0),cr(n,0),cr(n,n.level===9?2:n.strategy>=Nw||n.level<2?4:0),cr(n,bHe),n.status=kh,eo(e),n.pending!==0)return n.last_flush=-1,Ri}if(n.status===tT){if(n.gzhead.extra){let a=n.pending,i=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+i>n.pending_buf_size;){let l=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+l),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>a&&(e.adler=hi(e.adler,n.pending_buf,n.pending-a,a)),n.gzindex+=l,eo(e),n.pending!==0)return n.last_flush=-1,Ri;a=0,i-=l}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending+=i,n.gzhead.hcrc&&n.pending>a&&(e.adler=hi(e.adler,n.pending_buf,n.pending-a,a)),n.gzindex=0}n.status=nT}if(n.status===nT){if(n.gzhead.name){let a=n.pending,i;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>a&&(e.adler=hi(e.adler,n.pending_buf,n.pending-a,a)),eo(e),n.pending!==0)return n.last_flush=-1,Ri;a=0}n.gzindex<n.gzhead.name.length?i=n.gzhead.name.charCodeAt(n.gzindex++)&255:i=0,cr(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>a&&(e.adler=hi(e.adler,n.pending_buf,n.pending-a,a)),n.gzindex=0}n.status=rT}if(n.status===rT){if(n.gzhead.comment){let a=n.pending,i;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>a&&(e.adler=hi(e.adler,n.pending_buf,n.pending-a,a)),eo(e),n.pending!==0)return n.last_flush=-1,Ri;a=0}n.gzindex<n.gzhead.comment.length?i=n.gzhead.comment.charCodeAt(n.gzindex++)&255:i=0,cr(n,i)}while(i!==0);n.gzhead.hcrc&&n.pending>a&&(e.adler=hi(e.adler,n.pending_buf,n.pending-a,a))}n.status=aT}if(n.status===aT){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(eo(e),n.pending!==0))return n.last_flush=-1,Ri;cr(n,e.adler&255),cr(n,e.adler>>8&255),e.adler=0}if(n.status=kh,eo(e),n.pending!==0)return n.last_flush=-1,Ri}if(e.avail_in!==0||n.lookahead!==0||t!==Xd&&n.status!==h0){let a=n.level===0?ate(n,t):n.strategy===Nw?SHe(n,t):n.strategy===sHe?jHe(n,t):p0[n.level].func(n,t);if((a===pp||a===ty)&&(n.status=h0),a===ps||a===pp)return e.avail_out===0&&(n.last_flush=-1),Ri;if(a===ey&&(t===tHe?eHe(n):t!==lB&&(Q4(n,0,0,!1),t===nHe&&(md(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),eo(e),e.avail_out===0))return n.last_flush=-1,Ri}return t!==Do?Ri:n.wrap<=0?cB:(n.wrap===2?(cr(n,e.adler&255),cr(n,e.adler>>8&255),cr(n,e.adler>>16&255),cr(n,e.adler>>24&255),cr(n,e.total_in&255),cr(n,e.total_in>>8&255),cr(n,e.total_in>>16&255),cr(n,e.total_in>>24&255)):(Zy(n,e.adler>>>16),Zy(n,e.adler&65535)),eo(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ri:cB)},PHe=e=>{if(Gb(e))return vc;const t=e.state.status;return e.state=null,t===kh?Eh(e,rHe):Ri},THe=(e,t)=>{let n=t.length;if(Gb(e))return vc;const r=e.state,a=r.wrap;if(a===2||a===1&&r.status!==Sv||r.lookahead)return vc;if(a===1&&(e.adler=lb(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){a===0&&(md(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(t.subarray(n-r.w_size,n),0),t=c,n=r.w_size}const i=e.avail_in,o=e.next_in,l=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Nv(r);r.lookahead>=Gn;){let c=r.strstart,u=r.lookahead-(Gn-1);do r.ins_h=Jd(r,r.ins_h,r.window[c+Gn-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--u);r.strstart=c,r.lookahead=Gn-1,Nv(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Gn-1,r.match_available=0,e.next_in=o,e.input=l,e.avail_in=i,r.wrap=a,Ri};
vendor: 7,181 bytes, line 739
739var OHe=EHe,RHe=ote,IHe=ste,LHe=ite,MHe=kHe,$He=CHe,DHe=PHe,FHe=THe,BHe="pako deflate (from Nodeca project)",L0={deflateInit:OHe,deflateInit2:RHe,deflateReset:IHe,deflateResetKeep:LHe,deflateSetHeader:MHe,deflate:$He,deflateEnd:DHe,deflateSetDictionary:FHe,deflateInfo:BHe};const UHe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var zHe=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)UHe(n,r)&&(e[r]=n[r])}}return e},WHe=e=>{let t=0;for(let r=0,a=e.length;r<a;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,a=0,i=e.length;r<i;r++){let o=e[r];n.set(o,a),a+=o.length}return n},GN={assign:zHe,flattenChunks:WHe};let lte=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{lte=!1}const cb=new Uint8Array(256);for(let e=0;e<256;e++)cb[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;cb[254]=cb[254]=1;var qHe=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,a,i,o=e.length,l=0;for(a=0;a<o;a++)n=e.charCodeAt(a),(n&64512)===55296&&a+1<o&&(r=e.charCodeAt(a+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),a++)),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(l),i=0,a=0;i<l;a++)n=e.charCodeAt(a),(n&64512)===55296&&a+1<o&&(r=e.charCodeAt(a+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),a++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|n&63):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|n&63):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|n&63);return t};const VHe=(e,t)=>{if(t<65534&&e.subarray&&lte)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var HHe=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,a;const i=new Array(n*2);for(a=0,r=0;r<n;){let o=e[r++];if(o<128){i[a++]=o;continue}let l=cb[o];if(l>4){i[a++]=65533,r+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&r<n;)o=o<<6|e[r++]&63,l--;if(l>1){i[a++]=65533;continue}o<65536?i[a++]=o:(o-=65536,i[a++]=55296|o>>10&1023,i[a++]=56320|o&1023)}return VHe(i,a)},GHe=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+cb[e[n]]>t?n:t},ub={string2buf:qHe,buf2string:HHe,utf8border:GHe};function YHe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var cte=YHe;const ute=Object.prototype.toString,{Z_NO_FLUSH:KHe,Z_SYNC_FLUSH:ZHe,Z_FULL_FLUSH:XHe,Z_FINISH:JHe,Z_OK:Pj,Z_STREAM_END:QHe,Z_DEFAULT_COMPRESSION:eGe,Z_DEFAULT_STRATEGY:tGe,Z_DEFLATED:nGe}=Hb;function AI(e){this.options=GN.assign({level:eGe,method:nGe,chunkSize:16384,windowBits:15,memLevel:8,strategy:tGe},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new cte,this.strm.avail_out=0;let n=L0.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Pj)throw new Error(jv[n]);if(t.header&&L0.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=ub.string2buf(t.dictionary):ute.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=L0.deflateSetDictionary(this.strm,r),n!==Pj)throw new Error(jv[n]);this._dict_set=!0}}AI.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let a,i;if(this.ended)return!1;for(t===~~t?i=t:i=t===!0?JHe:KHe,typeof e=="string"?n.input=ub.string2buf(e):ute.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(i===ZHe||i===XHe)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(a=L0.deflate(n,i),a===QHe)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=L0.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Pj;if(n.avail_out===0){this.onData(n.output);continue}if(i>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};AI.prototype.onData=function(e){this.chunks.push(e)};AI.prototype.onEnd=function(e){e===Pj&&(this.result=GN.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Aw=16209,rGe=16191;var aGe=function(t,n){let r,a,i,o,l,c,u,d,f,p,h,m,g,v,y,b,w,j,S,A,E,k,P,R;const C=t.state;r=t.next_in,P=t.input,a=r+(t.avail_in-5),i=t.next_out,R=t.output,o=i-(n-t.avail_out),l=i+(t.avail_out-257),c=C.dmax,u=C.wsize,d=C.whave,f=C.wnext,p=C.window,h=C.hold,m=C.bits,g=C.lencode,v=C.distcode,y=(1<<C.lenbits)-1,b=(1<<C.distbits)-1;e:do{m<15&&(h+=P[r++]<<m,m+=8,h+=P[r++]<<m,m+=8),w=g[h&y];t:for(;;){if(j=w>>>24,h>>>=j,m-=j,j=w>>>16&255,j===0)R[i++]=w&65535;else if(j&16){S=w&65535,j&=15,j&&(m<j&&(h+=P[r++]<<m,m+=8),S+=h&(1<<j)-1,h>>>=j,m-=j),m<15&&(h+=P[r++]<<m,m+=8,h+=P[r++]<<m,m+=8),w=v[h&b];n:for(;;){if(j=w>>>24,h>>>=j,m-=j,j=w>>>16&255,j&16){if(A=w&65535,j&=15,m<j&&(h+=P[r++]<<m,m+=8,m<j&&(h+=P[r++]<<m,m+=8)),A+=h&(1<<j)-1,A>c){t.msg="invalid distance too far back",C.mode=Aw;break e}if(h>>>=j,m-=j,j=i-o,A>j){if(j=A-j,j>d&&C.sane){t.msg="invalid distance too far back",C.mode=Aw;break e}if(E=0,k=p,f===0){if(E+=u-j,j<S){S-=j;do R[i++]=p[E++];while(--j);E=i-A,k=R}}else if(f<j){if(E+=u+f-j,j-=f,j<S){S-=j;do R[i++]=p[E++];while(--j);if(E=0,f<S){j=f,S-=j;do R[i++]=p[E++];while(--j);E=i-A,k=R}}}else if(E+=f-j,j<S){S-=j;do R[i++]=p[E++];while(--j);E=i-A,k=R}for(;S>2;)R[i++]=k[E++],R[i++]=k[E++],R[i++]=k[E++],S-=3;S&&(R[i++]=k[E++],S>1&&(R[i++]=k[E++]))}else{E=i-A;do R[i++]=R[E++],R[i++]=R[E++],R[i++]=R[E++],S-=3;while(S>2);S&&(R[i++]=R[E++],S>1&&(R[i++]=R[E++]))}}else if(j&64){t.msg="invalid distance code",C.mode=Aw;break e}else{w=v[(w&65535)+(h&(1<<j)-1)];continue n}break}}else if(j&64)if(j&32){C.mode=rGe;break e}else{t.msg="invalid literal/length code",C.mode=Aw;break e}else{w=g[(w&65535)+(h&(1<<j)-1)];continue t}break}}while(r<a&&i<l);S=m>>3,r-=S,m-=S<<3,h&=(1<<m)-1,t.next_in=r,t.next_out=i,t.avail_in=r<a?5+(a-r):5-(r-a),t.avail_out=i<l?257+(l-i):257-(i-l),C.hold=h,C.bits=m};const fm=15,dB=852,fB=592,hB=0,Ck=1,pB=2,iGe=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),sGe=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),oGe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),lGe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),cGe=(e,t,n,r,a,i,o,l)=>{const c=l.bits;let u=0,d=0,f=0,p=0,h=0,m=0,g=0,v=0,y=0,b=0,w,j,S,A,E,k=null,P;const R=new Uint16Array(fm+1),C=new Uint16Array(fm+1);let I=null,D,U,q;for(u=0;
vendor: 14,548 bytes, line 739
739u<=fm;u++)R[u]=0;for(d=0;d<r;d++)R[t[n+d]]++;for(h=c,p=fm;p>=1&&R[p]===0;p--);if(h>p&&(h=p),p===0)return a[i++]=1<<24|64<<16|0,a[i++]=1<<24|64<<16|0,l.bits=1,0;for(f=1;f<p&&R[f]===0;f++);for(h<f&&(h=f),v=1,u=1;u<=fm;u++)if(v<<=1,v-=R[u],v<0)return-1;if(v>0&&(e===hB||p!==1))return-1;for(C[1]=0,u=1;u<fm;u++)C[u+1]=C[u]+R[u];for(d=0;d<r;d++)t[n+d]!==0&&(o[C[t[n+d]]++]=d);if(e===hB?(k=I=o,P=20):e===Ck?(k=iGe,I=sGe,P=257):(k=oGe,I=lGe,P=0),b=0,d=0,u=f,E=i,m=h,g=0,S=-1,y=1<<h,A=y-1,e===Ck&&y>dB||e===pB&&y>fB)return 1;for(;;){D=u-g,o[d]+1<P?(U=0,q=o[d]):o[d]>=P?(U=I[o[d]-P],q=k[o[d]-P]):(U=96,q=0),w=1<<u-g,j=1<<m,f=j;do j-=w,a[E+(b>>g)+j]=D<<24|U<<16|q|0;while(j!==0);for(w=1<<u-1;b&w;)w>>=1;if(w!==0?(b&=w-1,b+=w):b=0,d++,--R[u]===0){if(u===p)break;u=t[n+o[d]]}if(u>h&&(b&A)!==S){for(g===0&&(g=h),E+=f,m=u-g,v=1<<m;m+g<p&&(v-=R[m+g],!(v<=0));)m++,v<<=1;if(y+=1<<m,e===Ck&&y>dB||e===pB&&y>fB)return 1;S=b&A,a[S]=h<<24|m<<16|E-i|0}}return b!==0&&(a[E+b]=u-g<<24|64<<16|0),l.bits=h,0};var M0=cGe;const uGe=0,dte=1,fte=2,{Z_FINISH:mB,Z_BLOCK:dGe,Z_TREES:kw,Z_OK:mp,Z_STREAM_END:fGe,Z_NEED_DICT:hGe,Z_STREAM_ERROR:Yo,Z_DATA_ERROR:hte,Z_MEM_ERROR:pte,Z_BUF_ERROR:pGe,Z_DEFLATED:gB}=Hb,YN=16180,vB=16181,yB=16182,xB=16183,bB=16184,wB=16185,_B=16186,jB=16187,SB=16188,NB=16189,Tj=16190,Vc=16191,Pk=16192,AB=16193,Tk=16194,kB=16195,EB=16196,CB=16197,PB=16198,Ew=16199,Cw=16200,TB=16201,OB=16202,RB=16203,IB=16204,LB=16205,Ok=16206,MB=16207,$B=16208,Qr=16209,mte=16210,gte=16211,mGe=852,gGe=592,vGe=15,yGe=vGe,DB=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function xGe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Op=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<YN||t.mode>gte?1:0},vte=e=>{if(Op(e))return Yo;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=YN,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(mGe),t.distcode=t.distdyn=new Int32Array(gGe),t.sane=1,t.back=-1,mp},yte=e=>{if(Op(e))return Yo;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,vte(e)},xte=(e,t)=>{let n;if(Op(e))return Yo;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Yo:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,yte(e))},bte=(e,t)=>{if(!e)return Yo;const n=new xGe;e.state=n,n.strm=e,n.window=null,n.mode=YN;const r=xte(e,t);return r!==mp&&(e.state=null),r},bGe=e=>bte(e,yGe);let FB=!0,Rk,Ik;const wGe=e=>{if(FB){Rk=new Int32Array(512),Ik=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(M0(dte,e.lens,0,288,Rk,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;M0(fte,e.lens,0,32,Ik,0,e.work,{bits:5}),FB=!1}e.lencode=Rk,e.lenbits=9,e.distcode=Ik,e.distbits=5},wte=(e,t,n,r)=>{let a;const i=e.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(n-i.wsize,n),0),i.wnext=0,i.whave=i.wsize):(a=i.wsize-i.wnext,a>r&&(a=r),i.window.set(t.subarray(n-r,n-r+a),i.wnext),r-=a,r?(i.window.set(t.subarray(n-r,n),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=a,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=a))),0},_Ge=(e,t)=>{let n,r,a,i,o,l,c,u,d,f,p,h,m,g,v=0,y,b,w,j,S,A,E,k;const P=new Uint8Array(4);let R,C;const I=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Op(e)||!e.output||!e.input&&e.avail_in!==0)return Yo;n=e.state,n.mode===Vc&&(n.mode=Pk),o=e.next_out,a=e.output,c=e.avail_out,i=e.next_in,r=e.input,l=e.avail_in,u=n.hold,d=n.bits,f=l,p=c,k=mp;e:for(;;)switch(n.mode){case YN:if(n.wrap===0){n.mode=Pk;break}for(;d<16;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,P[0]=u&255,P[1]=u>>>8&255,n.check=hi(n.check,P,2,0),u=0,d=0,n.mode=vB;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Qr;break}if((u&15)!==gB){e.msg="unknown compression method",n.mode=Qr;break}if(u>>>=4,d-=4,E=(u&15)+8,n.wbits===0&&(n.wbits=E),E>15||E>n.wbits){e.msg="invalid window size",n.mode=Qr;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=u&512?NB:Vc,u=0,d=0;break;case vB:for(;d<16;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if(n.flags=u,(n.flags&255)!==gB){e.msg="unknown compression method",n.mode=Qr;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Qr;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(P[0]=u&255,P[1]=u>>>8&255,n.check=hi(n.check,P,2,0)),u=0,d=0,n.mode=yB;case yB:for(;d<32;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(P[0]=u&255,P[1]=u>>>8&255,P[2]=u>>>16&255,P[3]=u>>>24&255,n.check=hi(n.check,P,4,0)),u=0,d=0,n.mode=xB;case xB:for(;d<16;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(P[0]=u&255,P[1]=u>>>8&255,n.check=hi(n.check,P,2,0)),u=0,d=0,n.mode=bB;case bB:if(n.flags&1024){for(;d<16;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(P[0]=u&255,P[1]=u>>>8&255,n.check=hi(n.check,P,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=wB;case wB:if(n.flags&1024&&(h=n.length,h>l&&(h=l),h&&(n.head&&(E=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(i,i+h),E)),n.flags&512&&n.wrap&4&&(n.check=hi(n.check,r,h,i)),l-=h,i+=h,n.length-=h),n.length))break e;n.length=0,n.mode=_B;case _B:if(n.flags&2048){if(l===0)break e;h=0;do E=r[i+h++],n.head&&E&&n.length<65536&&(n.head.name+=String.fromCharCode(E));while(E&&h<l);if(n.flags&512&&n.wrap&4&&(n.check=hi(n.check,r,h,i)),l-=h,i+=h,E)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=jB;case jB:if(n.flags&4096){if(l===0)break e;h=0;do E=r[i+h++],n.head&&E&&n.length<65536&&(n.head.comment+=String.fromCharCode(E));while(E&&h<l);if(n.flags&512&&n.wrap&4&&(n.check=hi(n.check,r,h,i)),l-=h,i+=h,E)break e}else n.head&&(n.head.comment=null);n.mode=SB;case SB:if(n.flags&512){for(;d<16;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if(n.wrap&4&&u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Qr;break}u=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Vc;break;case NB:for(;d<32;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}e.adler=n.check=DB(u),u=0,d=0,n.mode=Tj;case Tj:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=i,e.avail_in=l,n.hold=u,n.bits=d,hGe;e.adler=n.check=1,n.mode=Vc;case Vc:if(t===dGe||t===kw)break e;case Pk:if(n.last){u>>>=d&7,d-=d&7,n.mode=Ok;break}for(;d<3;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}switch(n.last=u&1,u>>>=1,d-=1,u&3){case 0:n.mode=AB;break;case 1:if(wGe(n),n.mode=Ew,t===kw){u>>>=2,d-=2;break e}break;case 2:n.mode=EB;break;case 3:e.msg="invalid block type",n.mode=Qr}u>>>=2,d-=2;break;case AB:for(u>>>=d&7,d-=d&7;d<32;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Qr;break}if(n.length=u&65535,u=0,d=0,n.mode=Tk,t===kw)break e;case Tk:n.mode=kB;case kB:if(h=n.length,h){if(h>l&&(h=l),h>c&&(h=c),h===0)break e;a.set(r.subarray(i,i+h),o),l-=h,i+=h,c-=h,o+=h,n.length-=h;break}n.mode=Vc;break;case EB:for(;d<14;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if(n.nlen=(u&31)+257,u>>>=5,d-=5,n.ndist=(u&31)+1,u>>>=5,d-=5,n.ncode=(u&15)+4,u>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Qr;break}n.have=0,n.mode=CB;case CB:for(;n.have<n.ncode;){for(;d<3;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}n.lens[I[n.have++]]=u&7,u>>>=3,d-=3}for(;n.have<19;)n.lens[I[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,R={bits:n.lenbits},k=M0(uGe,n.lens,0,19,n.lencode,0,n.work,R),n.lenbits=R.bits,k){e.msg="invalid code lengths set",n.mode=Qr;break}n.have=0,n.mode=PB;case PB:for(;n.have<n.nlen+n.ndist;){for(;v=n.lencode[u&(1<<n.lenbits)-1],y=v>>>24,b=v>>>16&255,w=v&65535,!(y<=d);){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if(w<16)u>>>=y,d-=y,n.lens[n.have++]=w;else{if(w===16){for(C=y+2;d<C;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if(u>>>=y,d-=y,n.have===0){e.msg="invalid bit length repeat",n.mode=Qr;break}E=n.lens[n.have-1],h=3+(u&3),u>>>=2,d-=2}else if(w===17){for(C=y+3;d<C;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}u>>>=y,d-=y,E=0,h=3+(u&7),u>>>=3,d-=3}else{for(C=y+7;d<C;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}u>>>=y,d-=y,E=0,h=11+(u&127),u>>>=7,d-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Qr;break}for(;h--;)n.lens[n.have++]=E}}if(n.mode===Qr)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Qr;break}if(n.lenbits=9,R={bits:n.lenbits},k=M0(dte,n.lens,0,n.nlen,n.lencode,0,n.work,R),n.lenbits=R.bits,k){e.msg="invalid literal/lengths set",n.mode=Qr;break}if(n.distbits=6,n.distcode=n.distdyn,R={bits:n.distbits},k=M0(fte,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,R),n.distbits=R.bits,k){e.msg="invalid distances set",n.mode=Qr;break}if(n.mode=Ew,t===kw)break e;case Ew:n.mode=Cw;case Cw:if(l>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=i,e.avail_in=l,n.hold=u,n.bits=d,aGe(e,p),o=e.next_out,a=e.output,c=e.avail_out,i=e.next_in,r=e.input,l=e.avail_in,u=n.hold,d=n.bits,n.mode===Vc&&(n.back=-1);break}for(n.back=0;v=n.lencode[u&(1<<n.lenbits)-1],y=v>>>24,b=v>>>16&255,w=v&65535,!(y<=d);){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if(b&&!(b&240)){for(j=y,S=b,A=w;v=n.lencode[A+((u&(1<<j+S)-1)>>j)],y=v>>>24,b=v>>>16&255,w=v&65535,!(j+y<=d);){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}u>>>=j,d-=j,n.back+=j}if(u>>>=y,d-=y,n.back+=y,n.length=w,b===0){n.mode=LB;break}if(b&32){n.back=-1,n.mode=Vc;break}if(b&64){e.msg="invalid literal/length code",n.mode=Qr;break}n.extra=b&15,n.mode=TB;case TB:if(n.extra){for(C=n.extra;d<C;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=OB;case OB:for(;v=n.distcode[u&(1<<n.distbits)-1],y=v>>>24,b=v>>>16&255,w=v&65535,!(y<=d);){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if(!(b&240)){for(j=y,S=b,A=w;v=n.distcode[A+((u&(1<<j+S)-1)>>j)],y=v>>>24,b=v>>>16&255,w=v&65535,!(j+y<=d);){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}u>>>=j,d-=j,n.back+=j}if(u>>>=y,d-=y,n.back+=y,b&64){e.msg="invalid distance code",n.mode=Qr;break}n.offset=w,n.extra=b&15,n.mode=RB;case RB:if(n.extra){for(C=n.extra;d<C;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Qr;break}n.mode=IB;case IB:if(c===0)break e;if(h=p-c,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Qr;break}h>n.wnext?(h-=n.wnext,m=n.wsize-h):m=n.wnext-h,h>n.length&&(h=n.length),g=n.window}else g=a,m=o-n.offset,h=n.length;h>c&&(h=c),c-=h,n.length-=h;do a[o++]=g[m++];while(--h);n.length===0&&(n.mode=Cw);break;case LB:if(c===0)break e;a[o++]=n.length,c--,n.mode=Cw;break;case Ok:if(n.wrap){for(;d<32;){if(l===0)break e;l--,u|=r[i++]<<d,d+=8}if(p-=c,e.total_out+=p,n.total+=p,n.wrap&4&&p&&(e.adler=n.check=n.flags?hi(n.check,a,p,o-p):lb(n.check,a,p,o-p)),p=c,n.wrap&4&&(n.flags?u:DB(u))!==n.check){e.msg="incorrect data check",n.mode=Qr;break}u=0,d=0}n.mode=MB;case MB:if(n.wrap&&n.flags){for(;d<32;){if(l===0)break e;l--,u+=r[i++]<<d,d+=8}if(n.wrap&4&&u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Qr;break}u=0,d=0}n.mode=$B;case $B:k=fGe;break e;case Qr:k=hte;break e;case mte:return pte;case gte:default:return Yo}return e.next_out=o,e.avail_out=c,e.next_in=i,e.avail_in=l,n.hold=u,n.bits=d,(n.wsize||p!==e.avail_out&&n.mode<Qr&&(n.mode<Ok||t!==mB))&&wte(e,e.output,e.next_out,p-e.avail_out),f-=e.avail_in,p-=e.avail_out,e.total_in+=f,e.total_out+=p,n.total+=p,n.wrap&4&&p&&(e.adler=n.check=n.flags?hi(n.check,a,p,e.next_out-p):lb(n.check,a,p,e.next_out-p)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Vc?128:0)+(n.mode===Ew||n.mode===Tk?256:0),(f===0&&p===0||t===mB)&&k===mp&&(k=pGe),k},jGe=e=>{if(Op(e))return Yo;let t=e.state;return t.window&&(t.window=null),e.state=null,mp},SGe=(e,t)=>{if(Op(e))return Yo;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,mp):Yo},NGe=(e,t)=>{const n=t.length;let r,a,i;return Op(e)||(r=e.state,r.wrap!==0&&r.mode!==Tj)?Yo:r.mode===Tj&&(a=1,a=lb(a,t,n,0),a!==r.check)?hte:(i=wte(e,t,n,n),i?(r.mode=mte,pte):(r.havedict=1,mp))};var AGe=yte,kGe=xte,EGe=vte,CGe=bGe,PGe=bte,TGe=_Ge,OGe=jGe,RGe=SGe,IGe=NGe,LGe="pako inflate (from Nodeca project)",Qc={inflateReset:AGe,inflateReset2:kGe,inflateResetKeep:EGe,inflateInit:CGe,inflateInit2:PGe,inflate:TGe,inflateEnd:OGe,inflateGetHeader:RGe,inflateSetDictionary:IGe,inflateInfo:LGe};function MGe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var $Ge=MGe;const _te=Object.prototype.toString,{Z_NO_FLUSH:DGe,Z_FINISH:FGe,Z_OK:db,Z_STREAM_END:Lk,Z_NEED_DICT:Mk,Z_STREAM_ERROR:BGe,Z_DATA_ERROR:BB,Z_MEM_ERROR:UGe}=Hb;function Yb(e){this.options=GN.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new cte,this.strm.avail_out=0;let n=Qc.inflateInit2(this.strm,t.windowBits);if(n!==db)throw new Error(jv[n]);if(this.header=new $Ge,Qc.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=ub.string2buf(t.dictionary):_te.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Qc.inflateSetDictionary(this.strm,t.dictionary),n!==db)))throw new Error(jv[n])}Yb.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,a=this.options.dictionary;let i,o,l;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?FGe:DGe,_te.call(e)==="[object ArrayBuffer]"?n.input=new 
vendor: 10,166 bytes, line 739
739Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=Qc.inflate(n,o),i===Mk&&a&&(i=Qc.inflateSetDictionary(n,a),i===db?i=Qc.inflate(n,o):i===BB&&(i=Mk));n.avail_in>0&&i===Lk&&n.state.wrap>0&&e[n.next_in]!==0;)Qc.inflateReset(n),i=Qc.inflate(n,o);switch(i){case BGe:case BB:case Mk:case UGe:return this.onEnd(i),this.ended=!0,!1}if(l=n.avail_out,n.next_out&&(n.avail_out===0||i===Lk))if(this.options.to==="string"){let c=ub.utf8border(n.output,n.next_out),u=n.next_out-c,d=ub.buf2string(n.output,c);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(c,c+u),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(i===db&&l===0)){if(i===Lk)return i=Qc.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};Yb.prototype.onData=function(e){this.chunks.push(e)};Yb.prototype.onEnd=function(e){e===db&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=GN.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function kI(e,t){const n=new Yb(t);if(n.push(e),n.err)throw n.msg||jv[n.err];return n.result}function zGe(e,t){return t=t||{},t.raw=!0,kI(e,t)}var WGe=Yb,qGe=kI,VGe=zGe,HGe=kI,GGe=Hb,YGe={Inflate:WGe,inflate:qGe,inflateRaw:VGe,ungzip:HGe,constants:GGe};const{Inflate:KGe,inflate:ZGe,inflateRaw:lQe,ungzip:cQe}=YGe;var UB=KGe,XGe=ZGe;const jte=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;jte[e]=t}const zB=4294967295;function JGe(e,t,n){let r=e;for(let a=0;a<n;a++)r=jte[(r^t[a])&255]^r>>>8;return r}function QGe(e,t){return(JGe(zB,e,t)^zB)>>>0}function WB(e,t,n){const r=e.readUint32(),a=QGe(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(a!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${a}`)}function Ste(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function Nte(e,t,n,r){let a=0;for(;a<r;a++)t[a]=e[a];for(;a<n;a++)t[a]=e[a]+t[a-r]&255}function Ate(e,t,n,r){let a=0;if(n.length===0)for(;a<r;a++)t[a]=e[a];else for(;a<r;a++)t[a]=e[a]+n[a]&255}function kte(e,t,n,r,a){let i=0;if(n.length===0){for(;i<a;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+(t[i-a]>>1)&255}else{for(;i<a;i++)t[i]=e[i]+(n[i]>>1)&255;for(;i<r;i++)t[i]=e[i]+(t[i-a]+n[i]>>1)&255}}function Ete(e,t,n,r,a){let i=0;if(n.length===0){for(;i<a;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+t[i-a]&255}else{for(;i<a;i++)t[i]=e[i]+n[i]&255;for(;i<r;i++)t[i]=e[i]+eYe(t[i-a],n[i],n[i-a])&255}}function eYe(e,t,n){const r=e+t-n,a=Math.abs(r-e),i=Math.abs(r-t),o=Math.abs(r-n);return a<=i&&a<=o?e:i<=o?t:n}function tYe(e,t,n,r,a,i){switch(e){case 0:Ste(t,n,a);break;case 1:Nte(t,n,a,i);break;case 2:Ate(t,n,r,a);break;case 3:kte(t,n,r,a,i);break;case 4:Ete(t,n,r,a,i);break;default:throw new Error(`Unsupported filter: ${e}`)}}const nYe=new Uint16Array([255]),rYe=new Uint8Array(nYe.buffer),aYe=rYe[0]===255;function iYe(e){const{data:t,width:n,height:r,channels:a,depth:i}=e,o=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],l=Math.ceil(i/8)*a,c=new Uint8Array(r*n*l);let u=0;for(let d=0;d<7;d++){const f=o[d],p=Math.ceil((n-f.x)/f.xStep),h=Math.ceil((r-f.y)/f.yStep);if(p<=0||h<=0)continue;const m=p*l,g=new Uint8Array(m);for(let v=0;v<h;v++){const y=t[u++],b=t.subarray(u,u+m);u+=m;const w=new Uint8Array(m);tYe(y,b,w,g,m,l),g.set(w);for(let j=0;j<p;j++){const S=f.x+j*f.xStep,A=f.y+v*f.yStep;if(!(S>=n||A>=r))for(let E=0;E<l;E++)c[(A*n+S)*l+E]=w[j*l+E]}}}if(i===16){const d=new Uint16Array(c.buffer);if(aYe)for(let f=0;f<d.length;f++)d[f]=sYe(d[f]);return d}else return c}function sYe(e){return(e&255)<<8|e>>8&255}const oYe=new Uint16Array([255]),lYe=new Uint8Array(oYe.buffer),cYe=lYe[0]===255,uYe=new Uint8Array(0);function qB(e){const{data:t,width:n,height:r,channels:a,depth:i}=e,o=Math.ceil(i/8)*a,l=Math.ceil(i/8*a*n),c=new Uint8Array(r*l);let u=uYe,d=0,f,p;for(let h=0;h<r;h++){switch(f=t.subarray(d+1,d+1+l),p=c.subarray(h*l,(h+1)*l),t[d]){case 0:Ste(f,p,l);break;case 1:Nte(f,p,l,o);break;case 2:Ate(f,p,u,l);break;case 3:kte(f,p,u,l,o);break;case 4:Ete(f,p,u,l,o);break;default:throw new Error(`Unsupported filter: ${t[d]}`)}u=p,d+=l+1}if(i===16){const h=new Uint16Array(c.buffer);if(cYe)for(let m=0;m<h.length;m++)h[m]=dYe(h[m]);return h}else return c}function dYe(e){return(e&255)<<8|e>>8&255}const d_=Uint8Array.of(137,80,78,71,13,10,26,10);function VB(e){if(!fYe(e.readBytes(d_.length)))throw new Error("wrong PNG signature")}function fYe(e){if(e.length<d_.length)return!1;for(let t=0;t<d_.length;t++)if(e[t]!==d_[t])return!1;return!0}const hYe="tEXt",pYe=0,Cte=new TextDecoder("latin1");function mYe(e){if(vYe(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}const gYe=/^[\u0000-\u00FF]*$/;function vYe(e){if(!gYe.test(e))throw new Error("invalid latin1 text")}function yYe(e,t,n){const r=Pte(t);e[r]=xYe(t,n-r.length-1)}function Pte(e){for(e.mark();e.readByte()!==pYe;);const t=e.offset;e.reset();const n=Cte.decode(e.readBytes(t-e.offset-1));return e.skip(1),mYe(n),n}function xYe(e,t){return Cte.decode(e.readBytes(t))}const Js={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},$k={UNKNOWN:-1,DEFLATE:0},HB={UNKNOWN:-1,ADAPTIVE:0},Dk={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},Pw={NONE:0,BACKGROUND:1,PREVIOUS:2},Fk={SOURCE:0,OVER:1};class bYe extends bI{constructor(n,r={}){super(n);qe(this,"_checkCrc");qe(this,"_inflator");qe(this,"_png");qe(this,"_apng");qe(this,"_end");qe(this,"_hasPalette");qe(this,"_palette");qe(this,"_hasTransparency");qe(this,"_transparency");qe(this,"_compressionMethod");qe(this,"_filterMethod");qe(this,"_interlaceMethod");qe(this,"_colorType");qe(this,"_isAnimated");qe(this,"_numberOfFrames");qe(this,"_numberOfPlays");qe(this,"_frames");qe(this,"_writingDataChunks");const{checkCrc:a=!1}=r;this._checkCrc=a,this._inflator=new UB,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=$k.UNKNOWN,this._filterMethod=HB.UNKNOWN,this._interlaceMethod=Dk.UNKNOWN,this._colorType=Js.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(VB(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeChunk(n,r)}return this.decodeImage(),this._png}decodeApng(){for(VB(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(n,r)}return this.decodeApngImage(),this._apng}decodeChunk(n,r){const a=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(n);break;case"IDAT":this.decodeIDAT(n);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(n);break;case"iCCP":this.decodeiCCP(n);break;case hYe:yYe(this._png.text,this,n);break;case"pHYs":this.decodepHYs();break;default:this.skip(n);break}if(this.offset-a!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?WB(this,n+4,r):this.skip(4)}decodeApngChunk(n,r){const a=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(n);break;default:this.decodeChunk(n,r),this.offset=a+n;break}if(this.offset-a!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?WB(this,n+4,r):this.skip(4)}decodeIHDR(){const n=this._png;n.width=this.readUint32(),n.height=this.readUint32(),n.depth=wYe(this.readUint8());const r=this.readUint8();this._colorType=r;let a;switch(r){case Js.GREYSCALE:a=1;break;case Js.TRUECOLOUR:a=3;break;case Js.INDEXED_COLOUR:a=1;break;case Js.GREYSCALE_ALPHA:a=2;break;case Js.TRUECOLOUR_ALPHA:a=4;break;case Js.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=a,this._compressionMethod=this.readUint8(),this._compressionMethod!==$k.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const n={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(n)}decodePLTE(n){if(n%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${n}`);const r=n/3;this._hasPalette=!0;const a=[];this._palette=a;for(let i=0;i<r;i++)a.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(n){this._writingDataChunks=!0;const r=n,a=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,a,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodeFDAT(n){this._writingDataChunks=!0;let r=n,a=this.offset+this.byteOffset;if(a+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,a,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodetRNS(n){switch(this._colorType){case Js.GREYSCALE:case Js.TRUECOLOUR:{if(n%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${n}`);if(n/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${n/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(n/2);for(let r=0;r<n/2;r++)this._transparency[r]=this.readUint16();break}case Js.INDEXED_COLOUR:{if(n>this._palette.length)throw new Error(`tRNS chunk contains more alph
739a values than there are palette colors (${n} vs ${this._palette.length})`);let r=0;for(;r<n;r++){const a=this.readByte();this._palette[r].push(a)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case Js.UNKNOWN:case Js.GREYSCALE_ALPHA:case Js.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(n){const r=Pte(this),a=this.readUint8();if(a!==$k.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${a}`);const i=this.readBytes(n-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:XGe(i)}}decodepHYs(){const n=this.readUint32(),r=this.readUint32(),a=this.readByte();this._png.resolution={x:n,y:r,unit:a}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let n=0;n<this._numberOfFrames;n++){const r={sequenceNumber:this._frames[n].sequenceNumber,delayNumber:this._frames[n].delayNumber,delayDenominator:this._frames[n].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},a=this._frames.at(n);if(a){if(a.data=qB({data:a.data,width:a.width,height:a.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),n===0||a.xOffset===0&&a.yOffset===0&&a.width===this._png.width&&a.height===this._png.height)r.data=a.data;else{const i=this._apng.frames.at(n-1);this.disposeFrame(a,i,r),this.addFrameDataToCanvas(r,a)}this._apng.frames.push(r)}}return this._apng}disposeFrame(n,r,a){switch(n.disposeOp){case Pw.NONE:break;case Pw.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let o=0;o<this._png.width;o++){const l=(i*n.width+o)*this._png.channels;for(let c=0;c<this._png.channels;c++)a.data[l+c]=0}break;case Pw.PREVIOUS:a.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(n,r){const a=1<<this._png.depth,i=(o,l)=>{const c=((o+r.yOffset)*this._png.width+r.xOffset+l)*this._png.channels,u=(o*r.width+l)*this._png.channels;return{index:c,frameIndex:u}};switch(r.blendOp){case Fk.SOURCE:for(let o=0;o<r.height;o++)for(let l=0;l<r.width;l++){const{index:c,frameIndex:u}=i(o,l);for(let d=0;d<this._png.channels;d++)n.data[c+d]=r.data[u+d]}break;case Fk.OVER:for(let o=0;o<r.height;o++)for(let l=0;l<r.width;l++){const{index:c,frameIndex:u}=i(o,l);for(let d=0;d<this._png.channels;d++){const f=r.data[u+this._png.channels-1]/a,p=d%(this._png.channels-1)===0?1:r.data[u+d],h=Math.floor(f*p+(1-f)*n.data[c+d]);n.data[c+d]+=h}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var r;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const n=this._isAnimated?((r=this._frames)==null?void 0:r.at(0)).data:this._inflator.result;if(this._filterMethod!==HB.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===Dk.NO_INTERLACE)this._png.data=qB({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===Dk.ADAM7)this._png.data=iYe({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const n=this._inflator.result,r=this._frames.at(-1);r?r.data=n:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:Pw.NONE,blendOp:Fk.SOURCE,data:n}),this._inflator=new UB,this._writingDataChunks=!1}}function wYe(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}var GB;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"})(GB||(GB={}));function _Ye(e,t){return new bYe(e,t).decode()}var ln=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function Bk(){ln.console&&typeof ln.console.log=="function"&&ln.console.log.apply(ln.console,arguments)}var Cr={log:Bk,warn:function(e){ln.console&&(typeof ln.console.warn=="function"?ln.console.warn.apply(ln.console,arguments):Bk.call(null,arguments))},error:function(e){ln.console&&(typeof ln.console.error=="function"?ln.console.error.apply(ln.console,arguments):Bk(e))}};function Uk(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){ch(r.response,t,n
vendor: 3,702 bytes, lines 739-744
739)},r.onerror=function(){Cr.error("could not download file")},r.send()}function YB(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Tw(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var ch=ln.saveAs||((typeof window>"u"?"undefined":br(window))!=="object"||window!==ln?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=ln.URL||ln.webkitURL,a=document.createElement("a");t=t||e.name||"download",a.download=t,a.rel="noopener",typeof e=="string"?(a.href=e,a.origin!==location.origin?YB(a.href)?Uk(e,t,n):Tw(a,a.target="_blank"):Tw(a)):(a.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(a.href)},4e4),setTimeout(function(){Tw(a)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e=="string")if(YB(e))Uk(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){Tw(r)})}else navigator.msSaveOrOpenBlob(function(a,i){return i===void 0?i={autoBom:!1}:br(i)!=="object"&&(Cr.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}(e,n),t)}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return Uk(e,t,n);var a=e.type==="application/octet-stream",i=/constructor/i.test(ln.HTMLElement)||ln.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||a&&i)&&(typeof FileReader>"u"?"undefined":br(FileReader))==="object"){var l=new FileReader;l.onloadend=function(){var d=l.result;d=o?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=d:location=d,r=null},l.readAsDataURL(e)}else{var c=ln.URL||ln.webkitURL,u=c.createObjectURL(e);r?r.location=u:location.href=u,r=null,setTimeout(function(){c.revokeObjectURL(u)},4e4)}});/**
740 * A class to parse color values
741 * @author Stoyan Stefanov <[email protected]>
742 * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
743 * @license Use it if you like it
744 */function Tte(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee9
7440",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],r=0;r<n.length;r++){var a=n[r].re,i=n[r].process,o=a.exec(e);o&&(t=i(o),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var l=this.r.toString(16),c=this.g.toString(16),u=this.b.toString(16);return l.length==1&&(l="0"+l),c.length==1&&(c="0"+c),u.length==1&&(u="0"+u),"#"+l+c+u}}var f_=ln.atob.bind(ln),KB=ln.btoa.bind(ln);/**
745 * @license
746 * Joseph Myers does not specify a particular license for his work.
747 *
748 * Author: Joseph Myers
749 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
750 *
751 * Modified by: Owen Leong
752 */function zk(e,t){var n=e[0],r=e[1],a=e[2],i=e[3];n=Wi(n,r,a,i,t[0],7,-680876936),i=Wi(i,n,r,a,t[1],12,-389564586),a=Wi(a,i,n,r,t[2],17,606105819),r=Wi(r,a,i,n,t[3],22,-1044525330),n=Wi(n,r,a,i,t[4],7,-176418897),i=Wi(i,n,r,a,t[5],12,1200080426),a=Wi(a,i,n,r,t[6],17,-1473231341),r=Wi(r,a,i,n,t[7],22,-45705983),n=Wi(n,r,a,i,t[8],7,1770035416),i=Wi(i,n,r,a,t[9],12,-1958414417),a=Wi(a,i,n,r,t[10],17,-42063),r=Wi(r,a,i,n,t[11],22,-1990404162),n=Wi(n,r,a,i,t[12],7,1804603682),i=Wi(i,n,r,a,t[13],12,-40341101),a=Wi(a,i,n,r,t[14],17,-1502002290),n=qi(n,r=Wi(r,a,i,n,t[15],22,1236535329),a,i,t[1],5,-165796510),i=qi(i,n,r,a,t[6],9,-1069501632),a=qi(a,i,n,r,t[11],14,643717713),r=qi(r,a,i,n,t[0],20,-373897302),n=qi(n,r,a,i,t[5],5,-701558691),i=qi(i,n,r,a,t[10],9,38016083),a=qi(a,i,n,r,t[15],14,-660478335),r=qi(r,a,i,n,t[4],20,-405537848),n=qi(n,r,a,i,t[9],5,568446438),i=qi(i,n,r,a,t[14],9,-1019803690),a=qi(a,i,n,r,t[3],14,-187363961),r=qi(r,a,i,n,t[8],20,1163531501),n=qi(n,r,a,i,t[13],5,-1444681467),i=qi(i,n,r,a,t[2],9,-51403784),a=qi(a,i,n,r,t[7],14,1735328473),n=Vi(n,r=qi(r,a,i,n,t[12],20,-1926607734),a,i,t[5],4,-378558),i=Vi(i,n,r,a,t[8],11,-2022574463),a=Vi(a,i,n,r,t[11],16,1839030562),r=Vi(r,a,i,n,t[14],23,-35309556),n=Vi(n,r,a,i,t[1],4,-1530992060),i=Vi(i,n,r,a,t[4],11,1272893353),a=Vi(a,i,n,r,t[7],16,-155497632),r=Vi(r,a,i,n,t[10],23,-1094730640),n=Vi(n,r,a,i,t[13],4,681279174),i=Vi(i,n,r,a,t[0],11,-358537222),a=Vi(a,i,n,r,t[3],16,-722521979),r=Vi(r,a,i,n,t[6],23,76029189),n=Vi(n,r,a,i,t[9],4,-640364487),i=Vi(i,n,r,a,t[12],11,-421815835),a=Vi(a,i,n,r,t[15],16,530742520),n=Hi(n,r=Vi(r,a,i,n,t[2],23,-995338651),a,i,t[0],6,-198630844),i=Hi(i,n,r,a,t[7],10,1126891415),a=Hi(a,i,n,r,t[14],15,-1416354905),r=Hi(r,a,i,n,t[5],21,-57434055),n=Hi(n,r,a,i,t[12],6,1700485571),i=Hi(i,n,r,a,t[3],10,-1894986606),a=Hi(a,i,n,r,t[10],15,-1051523),r=Hi(r,a,i,n,t[1],21,-2054922799),n=Hi(n,r,a,i,t[8],6,1873313359),i=Hi(i,n,r,a,t[15],10,-30611744),a=Hi(a,i,n,r,t[6],15,-1560198380),r=Hi(r,a,i,n,t[13],21,1309151649),n=Hi(n,r,a,i,t[4],6,-145523070),i=Hi(i,n,r,a,t[11],10,-1120210379),a=
vendor: 13,349 bytes, lines 752-769
752Hi(a,i,n,r,t[2],15,718787259),r=Hi(r,a,i,n,t[9],21,-343485551),e[0]=Ld(n,e[0]),e[1]=Ld(r,e[1]),e[2]=Ld(a,e[2]),e[3]=Ld(i,e[3])}function KN(e,t,n,r,a,i){return t=Ld(Ld(t,e),Ld(r,i)),Ld(t<<a|t>>>32-a,n)}function Wi(e,t,n,r,a,i,o){return KN(t&n|~t&r,e,t,a,i,o)}function qi(e,t,n,r,a,i,o){return KN(t&r|n&~r,e,t,a,i,o)}function Vi(e,t,n,r,a,i,o){return KN(t^n^r,e,t,a,i,o)}function Hi(e,t,n,r,a,i,o){return KN(n^(t|~r),e,t,a,i,o)}function Ote(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)zk(r,jYe(e.substring(t-64,t)));e=e.substring(t-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)a[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(zk(r,a),t=0;t<16;t++)a[t]=0;return a[14]=8*n,zk(r,a),r}function jYe(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}var ZB="0123456789abcdef".split("");function SYe(e){for(var t="",n=0;n<4;n++)t+=ZB[e>>8*n+4&15]+ZB[e>>8*n&15];return t}function NYe(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function sT(e){return Ote(e).map(NYe).join("")}var AYe=function(e){for(var t=0;t<e.length;t++)e[t]=SYe(e[t]);return e.join("")}(Ote("hello"))!="5d41402abc4b2a76b9719d911017c592";function Ld(e,t){if(AYe){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}return e+t&4294967295}/**
753 * @license
754 * FPDF is released under a permissive license: there is no usage restriction.
755 * You may embed it freely in your application (commercial or not), with or
756 * without modifications.
757 *
758 * Reference: http://www.fpdf.org/en/script/script37.php
759 */function oT(e,t){var n,r,a,i;if(e!==n){for(var o=(a=e,i=1+(256/e.length|0),new Array(i+1).join(a)),l=[],c=0;c<256;c++)l[c]=c;var u=0;for(c=0;c<256;c++){var d=l[c];u=(u+d+o.charCodeAt(c))%256,l[c]=l[u],l[u]=d}n=e,r=l}else l=r;var f=t.length,p=0,h=0,m="";for(c=0;c<f;c++)h=(h+(d=l[p=(p+1)%256]))%256,l[p]=l[h],l[h]=d,o=l[(l[p]+l[h])%256],m+=String.fromCharCode(t.charCodeAt(c)^o);return m}/**
760 * @license
761 * Licensed under the MIT License.
762 * http://opensource.org/licenses/mit-license
763 * Author: Owen Leong (@owenl131)
764 * Date: 15 Oct 2020
765 * References:
766 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
767 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
768 * http://www.fpdf.org/en/script/script37.php
769 */var XB={print:4,modify:8,copy:16,"annot-forms":32};function jm(e,t,n,r){this.v=1,this.r=2;var a=192;e.forEach(function(l){if(XB.perm!==void 0)throw new Error("Invalid permission: "+l);a+=XB[l]}),this.padding="(¿N^NuŠAd\0NVÿú�\b..\0¶Ðh>€/\f©þdSiz";var i=(t+this.padding).substr(0,32),o=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,o),this.P=-(1+(255^a)),this.encryptionKey=sT(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=oT(this.encryptionKey,this.padding)}function Sm(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",n=e.length,r=0;r<n;r++){var a=e.charCodeAt(r);t+=a<33||a===35||a===37||a===40||a===41||a===47||a===60||a===62||a===91||a===93||a===123||a===125||a>126?"#"+("0"+a.toString(16)).slice(-2):e[r]}return t}function JB(e){if(br(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(n,r,a){if(a=a||!1,typeof n!="string"||typeof r!="function"||typeof a!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(n)||(t[n]={});var i=Math.random().toString(35);return t[n][i]=[r,!!a],i},this.unsubscribe=function(n){for(var r in t)if(t[r][n])return delete t[r][n],Object.keys(t[r]).length===0&&delete t[r],!0;return!1},this.publish=function(n){if(t.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),a=[];for(var i in t[n]){var o=t[n][i];try{o[0].apply(e,r)}catch(l){ln.console&&Cr.error("jsPDF PubSub Error",l.message,l)}o[1]&&a.push(i)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function Oj(e){if(!(this instanceof Oj))return new Oj(e);var t="opacity,stroke-opacity".split(",");for(var n in e)e.hasOwnProperty(n)&&t.indexOf(n)>=0&&(this[n]=e[n]);this.id="",this.objectNumber=-1}function Rte(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function mh(e,t,n,r,a){if(!(this instanceof mh))return new mh(e,t,n,r,a);this.type=e==="axial"?2:3,this.coords=t,this.colors=n,Rte.call(this,r,a)}function qm(e,t,n,r,a){if(!(this instanceof qm))return new qm(e,t,n,r,a);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream="",this.cloneIndex=0,Rte.call(this,r,a)}function qt(e){var t,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],a=arguments[2],i=arguments[3],o=[],l=1,c=16,u="S",d=null;br(e=e||{})==="object"&&(n=e.orientation,r=e.unit||r,a=e.format||a,i=e.compress||e.compressPdf||i,(d=e.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),l=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(c=e.floatPrecision),u=e.defaultPathOperation||"S"),o=e.filters||(i===!0?["FlateEncode"]:o),r=r||"mm",n=(""+(n||"P")).toLowerCase();var f=e.putOnlyUsedFonts||!1,p={},h={internal:{},__private__:{}};h.__private__.PubSub=JB;var m="1.3",g=h.__private__.getPdfVersion=function(){return m};h.__private__.setPdfVersion=function(T){m=T};var v={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};h.__private__.getPageFormats=function(){return v};var y=h.__private__.getPageFormat=function(T){return v[T]};a=a||"a4";var b="compat",w="advanced",j=b;function S(){this.saveGraphicsState(),F(new at(ut,0,0,-ut,0,Rf()*ut).toString()+" cm"),this.setFontSize(this.getFontSize()/ut),u="n",j=w}function A(){this.restoreGraphicsState(),u="S",j=b}var E=h.__private__.combineFontStyleAndFontWeight=function(T,Y){if(T=="bold"&&Y=="normal"||T=="bold"&&Y==400||T=="normal"&&Y=="italic"||T=="bold"&&Y=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return Y&&(T=Y==400||Y==="normal"?T==="italic"?"italic":"normal":Y!=700&&Y!=="bold"||T!=="normal"?(Y==700?"bold":Y)+""+T:"bold"),T};h.advancedAPI=function(T){var Y=j===b;return Y&&S.call(this),typeof T!="function"||(T(this),Y&&A.call(this)),this},h.compatAPI=function(T){var Y=j===w;return Y&&A.call(this),typeof T!="function"||(T(this),Y&&S.call(this)),this},h.isAdvancedAPI=function(){return j===w};var k,P=function(T){if(j!==w)throw new Error(T+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},R=h.roundToPrecision=h.__private__.roundToPrecision=function(T,Y){var de=t||Y;if(isNaN(T)||isNaN(de))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return T.toFixed(de).replace(/0+$/,"")};k=h.hpf=h.__private__.hpf=typeof c=="number"?function(T){if(isNaN(T))throw new Error("Invalid argument passed to jsPDF.hpf");return R(T,c)}:c==="smart"?function(T){if(isNaN(T))throw new Error("Invalid argument passed to jsPDF.hpf");return R(T,T>-1&&T<1?16:5)}:function(T){if(isNaN(T))throw new Error("Invalid argument passed to jsPDF.hpf");return R(T,16)};var C=h.f2=h.__private__.f2=function(T){if(isNaN(T))throw new Error("Invalid argument passed to jsPDF.f2");return R(T,2)},I=h.__private__.f3=function(T){if(isNaN(T))throw new Error("Invalid argument passed to jsPDF.f3");return R(T,3)},D=h.scale=h.__private__.scale=function(T){if(isNaN(T))throw new Error("Invalid argument passed to jsPDF.scale");return j===b?T*ut:j===w?T:void 0},U=function(T){return D(function(Y){return j===b?Rf()-Y:j===w?Y:void 0}(T))};h.__private__.setPrecision=h.setPrecision=function(T){typeof parseInt(T,10)=="number"&&(t=parseInt(T,10))};var q,Z="00000000000000000000000000000000",H=h.__private__.getFileId=function(){return Z},$=h.__private__.setFileId=function(T){return Z=T!==void 0&&/^[a-fA-F0-9]{32}$/.test(T)?T.toUpperCase():Z.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(Xa=new jm(d.userPermissions,d.userPassword,d.ownerPassword,Z)),Z};h.setFileId=function(T){return $(T),this},h.getFileId=function(){return H()};var W=h.__private__.convertDateToPDFDate=function(T){var Y=T.getTimezoneOffset(),de=Y<0?"+":"-",xe=Math.floor(Math.abs(Y/60)),ke=Math.abs(Y%60),Be=[de,B(xe),"'",B(ke),"'"].join("");return["D:",T.getFullYear(),B(T.getMonth()+1),B(T.getDate()),B(T.getHours()),B(T.getMinutes()),B(T.getSeconds()),Be].join("")},ee=h.__private__.convertPDFDateToDate=function(T){var Y=parseInt(T.substr(2,4),10),de=parseInt(T.substr(6,2),10)-1,xe=parseInt(T.substr(8,2),10),ke=parseInt(T.substr(10,2),10),Be=parseInt(T.substr(12,2),10),Ze=parseInt(T.substr(14,2),10);return new Date(Y,de,xe,ke,Be,Ze,0)},V=h.__private__.setCreationDate=function(T){var Y;if(T===void 0&&(T=new Date),T instanceof Date)Y=W(T);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(T))throw new Error("Invalid argument passed to jsPDF.setCreationDate");Y=T}return q=Y},O=h.__private__.getCreationDate=function(T){var Y=q;return T==="jsDate"&&(Y=ee(q)),Y};h.setCreationDate=function(T){return V(T),this},h.getCreationDate=function(T){return O(T)};var M,B=h.__private__.padd2=function(T){return("0"+parseInt(T)).slice(-2)},G=h.__private__.padd2Hex=function(T){return("00"+(T=T.toString())).substr(T.length)},te=0,ne=[],ce=[],oe=0,X=[],se=[],Q=!1,ye=ce;h.__private__.setCustomOutputDestination=function(T){Q=!0,ye=T};var ie=function(T){Q||(ye=T)};h.__private__.resetCustomOutputDestination=function(){Q=!1,ye=ce};var F=h.__private__.out=function(T){return T=T.toString(),oe+=T.length+1,ye.push(T),ye},me=h.__private__.write=function(T){return F(arguments.length===1?T.toString():Array.prototype.join.call(arguments," "))},Ae=h.__private__.getArrayBuffer=function(T){for(var Y=T.length,de=new ArrayBuffer(Y),xe=new Uint8Array(de);Y--;)xe[Y]=T.charCodeAt(Y);return de},Ne=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];h.__private__.getStandardFonts=function(){return Ne};var ve=e.fontSize||16;h.__private__.setFontSize=h.setFontSize=function(T){return ve=j===w?T/ut:T,this};var pe,Pe=h.__private__.getFontSize=h.getFontSize=function(){return j===b?ve:ve*ut},Ee=e.R2L||!1;h.__private__.setR2L=h.setR2L=function(T){return Ee=T,this},h.__private__.getR2L=h.getR2L=function(){return Ee};var Ie,Me=h.__private__.setZoomMode=function(T){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(T))pe=T;else if(isNaN(T)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(T)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+T+'" is not recognized.');pe=T}else pe=parseInt(T,10)};h.__private__.getZoomMode=function(){return pe};var tt,De=h.__private__.setPageMode=function(T){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(T)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+T+'" is not recognized.');Ie=T};h.__private__.getPageMode=function(){return Ie};var Qe=h.__private__.setLayoutMode=function(T){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(T)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+T+'" is not recognized.');tt=T};h.__private__.getLayoutMode=function(){return tt},h.__private__.setDisplayMode=h.setDisplayMode=function(T,Y,de){return Me(T),Qe(Y),De(de),this};var vt={title:"",subject:"",author:"",keywords:"",creator:""};h.__private__.getDocumentProperty=function(T){if(Object.keys(vt).indexOf(T)===-1)throw new Error("Invalid argument passed to 
769jsPDF.getDocumentProperty");return vt[T]},h.__private__.getDocumentProperties=function(){return vt},h.__private__.setDocumentProperties=h.setProperties=h.setDocumentProperties=function(T){for(var Y in vt)vt.hasOwnProperty(Y)&&T[Y]&&(vt[Y]=T[Y]);return this},h.__private__.setDocumentProperty=function(T,Y){if(Object.keys(vt).indexOf(T)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return vt[T]=Y};var ct,ut,Fe,It,zt,Wt={},Jt={},Un=[],Pt={},Tn={},Lt={},Vt={},Mn=null,nn=0,yt=[],hn=new JB(h),Mt=e.hotfixes||[],Ht={},je={},rt=[],at=function T(Y,de,xe,ke,Be,Ze){if(!(this instanceof T))return new T(Y,de,xe,ke,Be,Ze);isNaN(Y)&&(Y=1),isNaN(de)&&(de=0),isNaN(xe)&&(xe=0),isNaN(ke)&&(ke=1),isNaN(Be)&&(Be=0),isNaN(Ze)&&(Ze=0),this._matrix=[Y,de,xe,ke,Be,Ze]};Object.defineProperty(at.prototype,"sx",{get:function(){return this._matrix[0]},set:function(T){this._matrix[0]=T}}),Object.defineProperty(at.prototype,"shy",{get:function(){return this._matrix[1]},set:function(T){this._matrix[1]=T}}),Object.defineProperty(at.prototype,"shx",{get:function(){return this._matrix[2]},set:function(T){this._matrix[2]=T}}),Object.defineProperty(at.prototype,"sy",{get:function(){return this._matrix[3]},set:function(T){this._matrix[3]=T}}),Object.defineProperty(at.prototype,"tx",{get:function(){return this._matrix[4]},set:function(T){this._matrix[4]=T}}),Object.defineProperty(at.prototype,"ty",{get:function(){return this._matrix[5]},set:function(T){this._matrix[5]=T}}),Object.defineProperty(at.prototype,"a",{get:function(){return this._matrix[0]},set:function(T){this._matrix[0]=T}}),Object.defineProperty(at.prototype,"b",{get:function(){return this._matrix[1]},set:function(T){this._matrix[1]=T}}),Object.defineProperty(at.prototype,"c",{get:function(){return this._matrix[2]},set:function(T){this._matrix[2]=T}}),Object.defineProperty(at.prototype,"d",{get:function(){return this._matrix[3]},set:function(T){this._matrix[3]=T}}),Object.defineProperty(at.prototype,"e",{get:function(){return this._matrix[4]},set:function(T){this._matrix[4]=T}}),Object.defineProperty(at.prototype,"f",{get:function(){return this._matrix[5]},set:function(T){this._matrix[5]=T}}),Object.defineProperty(at.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(at.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(at.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(at.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),at.prototype.join=function(T){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(k).join(T)},at.prototype.multiply=function(T){var Y=T.sx*this.sx+T.shy*this.shx,de=T.sx*this.shy+T.shy*this.sy,xe=T.shx*this.sx+T.sy*this.shx,ke=T.shx*this.shy+T.sy*this.sy,Be=T.tx*this.sx+T.ty*this.shx+this.tx,Ze=T.tx*this.shy+T.ty*this.sy+this.ty;return new at(Y,de,xe,ke,Be,Ze)},at.prototype.decompose=function(){var T=this.sx,Y=this.shy,de=this.shx,xe=this.sy,ke=this.tx,Be=this.ty,Ze=Math.sqrt(T*T+Y*Y),Ot=(T/=Ze)*de+(Y/=Ze)*xe;de-=T*Ot,xe-=Y*Ot;var Tt=Math.sqrt(de*de+xe*xe);return Ot/=Tt,T*(xe/=Tt)<Y*(de/=Tt)&&(T=-T,Y=-Y,Ot=-Ot,Ze=-Ze),{scale:new at(Ze,0,0,Tt,0,0),translate:new at(1,0,0,1,ke,Be),rotate:new at(T,Y,-Y,T,0,0),skew:new at(1,0,Ot,1,0,0)}},at.prototype.toString=function(T){return this.join(" ")},at.prototype.inversed=function(){var T=this.sx,Y=this.shy,de=this.shx,xe=this.sy,ke=this.tx,Be=this.ty,Ze=1/(T*xe-Y*de),Ot=xe*Ze,Tt=-Y*Ze,un=-de*Ze,bn=T*Ze;return new at(Ot,Tt,un,bn,-Ot*ke-un*Be,-Tt*ke-bn*Be)},at.prototype.applyToPoint=function(T){var Y=T.x*this.sx+T.y*this.shx+this.tx,de=T.x*this.shy+T.y*this.sy+this.ty;return new Of(Y,de)},at.prototype.applyToRectangle=function(T){var Y=this.applyToPoint(T),de=this.applyToPoint(new Of(T.x+T.w,T.y+T.h));return new sy(Y.x,Y.y,de.x-Y.x,de.y-Y.y)},at.prototype.clone=function(){var T=this.sx,Y=this.shy,de=this.shx,xe=this.sy,ke=this.tx,Be=this.ty;return new at(T,Y,de,xe,ke,Be)},h.Matrix=at;var xn=h.matrixMult=function(T,Y){return Y.multiply(T)},sr=new at(1,0,0,1,0,0);h.unitMatrix=h.identityMatrix=sr;var Yn=function(T,Y){if(!Tn[T]){var de=(Y instanceof mh?"Sh":"P")+(Object.keys(Pt).length+1).toString(10);Y.id=de,Tn[T]=de,Pt[de]=Y,hn.publish("addPattern",Y)}};h.ShadingPattern=mh,h.TilingPattern=qm,h.addShadingPattern=function(T,Y){return P("addShadingPattern()"),Yn(T,Y),this},h.beginTilingPattern=function(T){P("beginTilingPattern()"),oy(T.boundingBox[0],T.boundingBox[1],T.boundingBox[2]-T.boundingBox[0],T.boundingBox[3]-T.boundingBox[1],T.matrix)},h.endTilingPattern=function(T,Y){P("endTilingPattern()"),Y.stream=se[M].join(`
770`),Yn(T,Y),hn.publish("endTilingPattern",Y),rt.pop().restore()};var nr,Gt=h.__private__.newObject=function(){var T=Sn();return Zt(T,!0),T},Sn=h.__private__.newObjectDeferred=function(){return te++,ne[te]=function(){return oe},te},Zt=function(T,Y){return Y=typeof Y=="boolean"&&Y,ne[T]=oe,Y&&F(T+" 0 obj"),T},_i=h.__private__.newAdditionalObject=function(){var T={objId:Sn(),content:""};return X.push(T),T},ji=Sn(),Fa=Sn(),Za=h.__private__.decodeColorString=function(T){var Y=T.split(" ");if(Y.length!==2||Y[1]!=="g"&&Y[1]!=="G")Y.length!==5||Y[4]!=="k"&&Y[4]!=="K"||(Y=[(1-Y[0])*(1-Y[3]),(1-Y[1])*(1-Y[3]),(1-Y[2])*(1-Y[3]),"r"]);else{var de=parseFloat(Y[0]);Y=[de,de,de,"r"]}for(var xe="#",ke=0;ke<3;ke++)xe+=("0"+Math.floor(255*parseFloat(Y[ke])).toString(16)).slice(-2);return xe},Si=h.__private__.encodeColorString=function(T){var Y;typeof T=="string"&&(T={ch1:T});var de=T.ch1,xe=T.ch2,ke=T.ch3,Be=T.ch4,Ze=T.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof de=="string"&&de.charAt(0)!=="#"){var Ot=new Tte(de);if(Ot.ok)de=Ot.toHex();else if(!/^\d*\.?\d*$/.test(de))throw new Error('Invalid color "'+de+'" passed to jsPDF.encodeColorString.')}if(typeof de=="string"&&/^#[0-9A-Fa-f]{3}$/.test(de)&&(de="#"+de[1]+de[1]+de[2]+de[2]+de[3]+de[3]),typeof de=="string"&&/^#[0-9A-Fa-f]{6}$/.test(de)){var Tt=parseInt(de.substr(1),16);de=Tt>>16&255,xe=Tt>>8&255,ke=255&Tt}if(xe===void 0||Be===void 0&&de===xe&&xe===ke)Y=typeof de=="string"?de+" "+Ze[0]:T.precision===2?C(de/255)+" "+Ze[0]:I(de/255)+" "+Ze[0];else if(Be===void 0||br(Be)==="object"){if(Be&&!isNaN(Be.a)&&Be.a===0)return["1.","1.","1.",Ze[1]].join(" ");Y=typeof de=="string"?[de,xe,ke,Ze[1]].join(" "):T.precision===2?[C(de/255),C(xe/255),C(ke/255),Ze[1]].join(" "):[I(de/255),I(xe/255),I(ke/255),Ze[1]].join(" ")}else Y=typeof de=="string"?[de,xe,ke,Be,Ze[2]].join(" "):T.precision===2?[C(de),C(xe),C(ke),C(Be),Ze[2]].join(" "):[I(de),I(xe),I(ke),I(Be),Ze[2]].join(" ");return Y},Ni=h.__private__.getFilters=function(){return o},Jr=h.__private__.putStream=function(T){var Y=(T=T||{}).data||"",de=T.filters||Ni(),xe=T.alreadyAppliedFilters||[],ke=T.addLength1||!1,Be=Y.length,Ze=T.objectId,Ot=function(zr){return zr};if(d!==null&&Ze===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(Ot=Xa.encryptor(Ze,0));var Tt={};de===!0&&(de=["FlateEncode"]);var un=T.additionalKeyValues||[],bn=(Tt=qt.API.processDataByFilters!==void 0?qt.API.processDataByFilters(Y,de):{data:Y,reverseChain:[]}).reverseChain+(Array.isArray(xe)?xe.join(" "):xe.toString());if(Tt.data.length!==0&&(un.push({key:"Length",value:Tt.data.length}),ke===!0&&un.push({key:"Length1",value:Be})),bn.length!=0)if(bn.split("/").length-1==1)un.push({key:"Filter",value:bn});else{un.push({key:"Filter",value:"["+bn+"]"});for(var Kn=0;Kn<un.length;Kn+=1)if(un[Kn].key==="DecodeParms"){for(var Ua=[],kr=0;kr<Tt.reverseChain.split("/").length-1;kr+=1)Ua.push("null");Ua.push(un[Kn].value),un[Kn].value="["+Ua.join(" ")+"]"}}F("<<");for(var Sr=0;Sr<un.length;Sr++)F("/"+un[Sr].key+" "+un[Sr].value);F(">>"),Tt.data.length!==0&&(F("stream"),F(Ot(Tt.data)),F("endstream"))},wo=h.__private__.putPage=function(T){var Y=T.number,de=T.data,xe=T.objId,ke=T.contentsObjId;Zt(xe,!0),F("<</Type /Page"),F("/Parent "+T.rootDictionaryObjId+" 0 R"),F("/Resources "+T.resourceDictionaryObjId+" 0 R"),F("/MediaBox ["+parseFloat(k(T.mediaBox.bottomLeftX))+" "+parseFloat(k(T.mediaBox.bottomLeftY))+" "+k(T.mediaBox.topRightX)+" "+k(T.mediaBox.topRightY)+"]"),T.cropBox!==null&&F("/CropBox ["+k(T.cropBox.bottomLeftX)+" "+k(T.cropBox.bottomLeftY)+" "+k(T.cropBox.topRightX)+" "+k(T.cropBox.topRightY)+"]"),T.bleedBox!==null&&F("/BleedBox ["+k(T.bleedBox.bottomLeftX)+" "+k(T.bleedBox.bottomLeftY)+" "+k(T.bleedBox.topRightX)+" "+k(T.bleedBox.topRightY)+"]"),T.trimBox!==null&&F("/TrimBox ["+k(T.trimBox.bottomLeftX)+" "+k(T.trimBox.bottomLeftY)+" "+k(T.trimBox.topRightX)+" "+k(T.trimBox.topRightY)+"]"),T.artBox!==null&&F("/ArtBox ["+k(T.artBox.bottomLeftX)+" "+k(T.artBox.bottomLeftY)+" "+k(T.artBox.topRightX)+" "+k(T.artBox.topRightY)+"]"),typeof T.userUnit=="number"&&T.userUnit!==1&&F("/UserUnit "+T.userUnit),hn.publish("putPage",{objId:xe,pageContext:yt[Y],pageNumber:Y,page:de}),F("/Contents "+ke+" 0 R"),F(">>"),F("endobj");var Be=de.join(`
771`);return j===w&&(Be+=`
772Q`),Zt(ke,!0),Jr({data:Be,filters:Ni(),objectId:ke}),F("endobj"),xe},qs=h.__private__.putPages=function(){var T,Y,de=[];for(T=1;
vendor: 7,344 bytes, lines 772-773
772T<=nn;T++)yt[T].objId=Sn(),yt[T].contentsObjId=Sn();for(T=1;T<=nn;T++)de.push(wo({number:T,data:se[T],objId:yt[T].objId,contentsObjId:yt[T].contentsObjId,mediaBox:yt[T].mediaBox,cropBox:yt[T].cropBox,bleedBox:yt[T].bleedBox,trimBox:yt[T].trimBox,artBox:yt[T].artBox,userUnit:yt[T].userUnit,rootDictionaryObjId:ji,resourceDictionaryObjId:Fa}));Zt(ji,!0),F("<</Type /Pages");var xe="/Kids [";for(Y=0;Y<nn;Y++)xe+=de[Y]+" 0 R ";F(xe+"]"),F("/Count "+nn),F(">>"),F("endobj"),hn.publish("postPutPages")},Bl=function(T){hn.publish("putFont",{font:T,out:F,newObject:Gt,putStream:Jr}),T.isAlreadyPutted!==!0&&(T.objectNumber=Gt(),F("<<"),F("/Type /Font"),F("/BaseFont /"+Sm(T.postScriptName)),F("/Subtype /Type1"),typeof T.encoding=="string"&&F("/Encoding /"+T.encoding),F("/FirstChar 32"),F("/LastChar 255"),F(">>"),F("endobj"))},Ec=function(T){T.objectNumber=Gt();var Y=[];Y.push({key:"Type",value:"/XObject"}),Y.push({key:"Subtype",value:"/Form"}),Y.push({key:"BBox",value:"["+[k(T.x),k(T.y),k(T.x+T.width),k(T.y+T.height)].join(" ")+"]"}),Y.push({key:"Matrix",value:"["+T.matrix.toString()+"]"});var de=T.pages[1].join(`
773`);Jr({data:de,additionalKeyValues:Y,objectId:T.objectNumber}),F("endobj")},Cc=function(T,Y){Y||(Y=21);var de=Gt(),xe=function(Ze,Ot){var Tt,un=[],bn=1/(Ot-1);for(Tt=0;Tt<1;Tt+=bn)un.push(Tt);if(un.push(1),Ze[0].offset!=0){var Kn={offset:0,color:Ze[0].color};Ze.unshift(Kn)}if(Ze[Ze.length-1].offset!=1){var Ua={offset:1,color:Ze[Ze.length-1].color};Ze.push(Ua)}for(var kr="",Sr=0,zr=0;zr<un.length;zr++){for(Tt=un[zr];Tt>Ze[Sr+1].offset;)Sr++;var ia=Ze[Sr].offset,sa=(Tt-ia)/(Ze[Sr+1].offset-ia),$i=Ze[Sr].color,Lc=Ze[Sr+1].color;kr+=G(Math.round((1-sa)*$i[0]+sa*Lc[0]).toString(16))+G(Math.round((1-sa)*$i[1]+sa*Lc[1]).toString(16))+G(Math.round((1-sa)*$i[2]+sa*Lc[2]).toString(16))}return kr.trim()}(T.colors,Y),ke=[];ke.push({key:"FunctionType",value:"0"}),ke.push({key:"Domain",value:"[0.0 1.0]"}),ke.push({key:"Size",value:"["+Y+"]"}),ke.push({key:"BitsPerSample",value:"8"}),ke.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ke.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Jr({data:xe,additionalKeyValues:ke,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:de}),F("endobj"),T.objectNumber=Gt(),F("<< /ShadingType "+T.type),F("/ColorSpace /DeviceRGB");var Be="/Coords ["+k(parseFloat(T.coords[0]))+" "+k(parseFloat(T.coords[1]))+" ";T.type===2?Be+=k(parseFloat(T.coords[2]))+" "+k(parseFloat(T.coords[3])):Be+=k(parseFloat(T.coords[2]))+" "+k(parseFloat(T.coords[3]))+" "+k(parseFloat(T.coords[4]))+" "+k(parseFloat(T.coords[5])),F(Be+="]"),T.matrix&&F("/Matrix ["+T.matrix.toString()+"]"),F("/Function "+de+" 0 R"),F("/Extend [true true]"),F(">>"),F("endobj")},Pc=function(T,Y){var de=Sn(),xe=Gt();Y.push({resourcesOid:de,objectOid:xe}),T.objectNumber=xe;var ke=[];ke.push({key:"Type",value:"/Pattern"}),ke.push({key:"PatternType",value:"1"}),ke.push({key:"PaintType",value:"1"}),ke.push({key:"TilingType",value:"1"}),ke.push({key:"BBox",value:"["+T.boundingBox.map(k).join(" ")+"]"}),ke.push({key:"XStep",value:k(T.xStep)}),ke.push({key:"YStep",value:k(T.yStep)}),ke.push({key:"Resources",value:de+" 0 R"}),T.matrix&&ke.push({key:"Matrix",value:"["+T.matrix.toString()+"]"}),Jr({data:T.stream,additionalKeyValues:ke,objectId:T.objectNumber}),F("endobj")},Ip=function(T){for(var Y in T.objectNumber=Gt(),F("<<"),T)switch(Y){case"opacity":F("/ca "+C(T[Y]));break;case"stroke-opacity":F("/CA "+C(T[Y]))}F(">>"),F("endobj")},Mu=function(T){Zt(T.resourcesOid,!0),F("<<"),F("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var Y in F("/Font <<"),Wt)Wt.hasOwnProperty(Y)&&(f===!1||f===!0&&p.hasOwnProperty(Y))&&F("/"+Y+" "+Wt[Y].objectNumber+" 0 R");F(">>")}(),function(){if(Object.keys(Pt).length>0){for(var Y in F("/Shading <<"),Pt)Pt.hasOwnProperty(Y)&&Pt[Y]instanceof mh&&Pt[Y].objectNumber>=0&&F("/"+Y+" "+Pt[Y].objectNumber+" 0 R");hn.publish("putShadingPatternDict"),F(">>")}}(),function(Y){if(Object.keys(Pt).length>0){for(var de in F("/Pattern <<"),Pt)Pt.hasOwnProperty(de)&&Pt[de]instanceof h.TilingPattern&&Pt[de].objectNumber>=0&&Pt[de].objectNumber<Y&&F("/"+de+" "+Pt[de].objectNumber+" 0 R");hn.publish("putTilingPatternDict"),F(">>")}}(T.objectOid),function(){if(Object.keys(Lt).length>0){var Y;for(Y in F("/ExtGState <<"),Lt)Lt.hasOwnProperty(Y)&&Lt[Y].objectNumber>=0&&F("/"+Y+" "+Lt[Y].objectNumber+" 0 R");hn.publish("putGStateDict"),F(">>")}}(),function(){for(var Y in F("/XObject <<"),Ht)Ht.hasOwnProperty(Y)&&Ht[Y].objectNumber>=0&&F("/"+Y+" "+Ht[Y].objectNumber+" 0 R");hn.publish("putXobjectDict"),F(">>")}(),F(">>"),F("endobj")},Pf=function(T){Jt[T.fontName]=Jt[T.fontName]||{},Jt[T.fontName][T.fontStyle]=T.id},ge=function(T,Y,de,xe,ke){var Be={id:"F"+(Object.keys(Wt).length+1).toString(10),postScriptName:T,fontName:Y,fontStyle:de,encoding:xe,isStandardFont:ke||!1,metadata:{}};return hn.publish("addFont",{font:Be,instance:this}),Wt[Be.id]=Be,Pf(Be),Be.id},Le=h.__private__.pdfEscape=h.pdfEscape=function(T,Y){return function(de,xe){var ke,Be,Ze,Ot,Tt,un,bn,Kn,Ua;if(Ze=(xe=xe||{}).sourceEncoding||"Unicode",Tt=xe.outputEncoding,(xe.autoencode||Tt)&&Wt[ct].metadata&&Wt[ct].metadata[Ze]&&Wt[ct].metadata[Ze].encoding&&(Ot=Wt[ct].metadata[Ze].encoding,!Tt&&Wt[ct].encoding&&(Tt=Wt[ct].encoding),!Tt&&Ot.codePages&&(Tt=Ot.codePages[0]),typeof Tt=="string"&&(Tt=Ot[Tt]),Tt)){for(bn=!1,un=[],ke=0,Be=de.length;ke<Be;ke++)(Kn=Tt[de.charCodeAt(ke)])?un.push(String.fromCharCode(Kn)):un.push(de[ke]),un[ke].charCodeAt(0)>>8&&(bn=!0);de=un.join("")}for(ke=de.length;bn===void 0&&ke!==0;)de.charCodeAt(ke-1)>>8&&(bn=!0),ke--;if(!bn)return de;for(un=xe.noBOM?[]:[254,255],ke=0,Be=de.length;ke<Be;ke++){if((Ua=(Kn=de.charCodeAt(ke))>>8)>>8)throw new Error("Character at position "+ke+" of string '"+de+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");un.push(Ua),un.push(Kn-(Ua<<8))}return String.fromCharCode.apply(void 0,un)}(T,Y).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},nt=h.__private__.beginPage=function(T){se[++nn]=[],yt[nn]={objId:0,contentsObjId:0,userUnit:Number(l),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(T[0]),topRightY:Number(T[1])}},Yt(nn),ie(se[M])},Ke=function(T,Y){var de,xe,ke;switch(n=Y||n,typeof T=="string"&&(de=y(T.toLowerCase()),Array.isArray(de)&&(xe=de[0],ke=de[1])),Array.isArray(T)&&(xe=T[0]*ut,ke=T[1]*ut),isNaN(xe)&&(xe=a[0],ke=a[1]),(xe>14400||ke>14400)&&(Cr.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),xe=Math.min(14400,xe),ke=Math.min(14400,ke)),a=[xe,ke],n.substr(0,1)){case"l":ke>xe&&(a=[ke,xe]);break;case"p":xe>ke&&(a=[ke,xe])}nt(a),s5(on),F($p),ay!==0&&F(ay+" J"),Fu!==0&&F(Fu+" j"),hn.publish("addPage",{pageNumber:nn})},st=function(T){T>0&&T<=nn&&(se.splice(T,1),yt.splice(T,1),nn--,M>nn&&(M=nn),this.setPage(M))},Yt=function(T){T>0&&T<=nn&&(M=T)},or=h.__private__.getNumberOfPages=h.getNumberOfPages=function(){return se.length-1},Sa=function(T,Y,de){var xe,ke=void 0;return de=de||{},T=T!==void 0?T:Wt[ct].fontName,Y=Y!==void 0?Y:Wt[ct].fontStyle,xe=T.toLowerCase(),Jt[xe]!==void 0&&Jt[xe][Y]!==void 0?ke=Jt[xe][Y]:Jt[T]!==void 0&&Jt[T][Y]!==void 0?ke=Jt[T][Y]:de.disableWarning===!1&&Cr.warn("Unable to look up font label for font '"+T+"', '"+Y+"'. Refer to getFontList(
773) for available fonts."),ke||de.noFallback||(ke=Jt.times[Y])==null&&(ke=Jt.times.normal),ke},rr=h.__private__.putInfo=function(){var T=Gt(),Y=function(xe){return xe};for(var de in d!==null&&(Y=Xa.encryptor(T,0)),F("<<"),F("/Producer ("+Le(Y("jsPDF "+qt.version))+")"),vt)vt.hasOwnProperty(de)&&vt[de]&&F("/"+de.substr(0,1).toUpperCase()+de.substr(1)+" ("+Le(Y(vt[de]))+")");F("/CreationDate ("+Le(Y(q))+")"),F(">>"),F("endobj")},dr=h.__private__.putCatalog=function(T){var Y=(T=T||{}).rootDictionaryObjId||ji;switch(Gt(),F("<<"),F("/Type /Catalog"),F("/Pages "+Y+" 0 R"),pe||(pe="fullwidth"),pe){case"fullwidth":F("/OpenAction [3 0 R /FitH null]");break;case"fullheight":F("/OpenAction [3 0 R /FitV null]");break;case"fullpage":F("/OpenAction [3 0 R /Fit]");break;case"original":F("/OpenAction [3 0 R /XYZ null null 1]");break;default:var de=""+pe;de.substr(de.length-1)==="%"&&(pe=parseInt(pe)/100),typeof pe=="number"&&F("/OpenAction [3 0 R /XYZ null null "+C(pe)+"]")}switch(tt||(tt="continuous"),tt){case"continuous":F("/PageLayout /OneColumn");break;case"single":F("/PageLayout /SinglePage");break;case"two":case"twoleft":F("/PageLayout /TwoColumnLeft");break;case"tworight":F("/PageLayout /TwoColumnRight")}Ie&&F("/PageMode /"+Ie),hn.publish("putCatalog"),F(">>"),F("endobj")},aa=h.__private__.putTrailer=function(){F("trailer"),F("<<"),F("/Size "+(te+1)),F("/Root "+te+" 0 R"),F("/Info "+(te-1)+" 0 R"),d!==null&&F("/Encrypt "+Xa.oid+" 0 R"),F("/ID [ <"+Z+"> <"+Z+"> ]"),F(">>")},zn=h.__private__.putHeader=function(){F("%PDF-"+m),F("%ºß¬à")},Wn=h.__private__.putXRef=function(){var T="0000000000";F("xref"),F("0 "+(te+1)),F("0000000000 65535 f ");for(var Y=1;Y<=te;Y++)typeof ne[Y]=="function"?F((T+ne[Y]()).slice(-10)+" 00000 n "):ne[Y]!==void 0?F((T+ne[Y]).slice(-10)+" 00000 n "):F("0000000000 00000 n ")},Ba=h.__private__.buildDocument=function(){var T;te=0,oe=0,ce=[],ne=[],X=[],ji=Sn(),Fa=Sn(),ie(ce),hn.publish("buildDocument"),zn(),qs(),function(){hn.publish("putAdditionalObjects");for(var de=0;de<X.length;de++){var xe=X[de];Zt(xe.objId,!0),F(xe.content),F("endobj")}hn.publish("postPutAdditionalObjects")}(),T=[],function(){for(var de in Wt)Wt.hasOwnProperty(de)&&(f===!1||f===!0&&p.hasOwnProperty(de))&&Bl(Wt[de])}(),function(){var de;for(de in Lt)Lt.hasOwnProperty(de)&&Ip(Lt[de])}(),function(){for(var de in Ht)Ht.hasOwnProperty(de)&&Ec(Ht[de])}(),function(de){var xe;for(xe in Pt)Pt.hasOwnProperty(xe)&&(Pt[xe]instanceof mh?Cc(Pt[xe]):Pt[xe]instanceof qm&&Pc(Pt[xe],de))}(T),hn.publish("putResources"),T.forEach(Mu),Mu({resourcesOid:Fa,objectOid:Number.MAX_SAFE_INTEGER}),hn.publish("postPutResources"),d!==null&&(Xa.oid=Gt(),F("<<"),F("/Filter /Standard"),F("/V "+Xa.v),F("/R "+Xa.r),F("/U <"+Xa.toHexString(Xa.U)+">"),F("/O <"+Xa.toHexString(Xa.O)+">"),F("/P "+Xa.P),F(">>"),F("endobj")),rr(),dr();var Y=oe;return Wn(),aa(),F("startxref"),F(""+Y),F("%%EOF"),ie(se[M]),ce.join(`
774`)},$n=h.__private__.getBlob=function(T){return new Blob([Ae(T)],{type:"application/pdf"})},Mi=function(T){for(;T.firstChild;)T.removeChild(T.firstChild)},lr=function(T){var Y,de=T.document,xe=de.documentElement,ke=de.head,Be=de.body;return ke||(ke=de.createElement("head"),xe.appendChild(ke)),Be||(Be=de.createElement("body"),xe.appendChild(Be)),Mi(ke),Mi(Be),(Y=de.createElement("style")).appendChild(de.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),ke.appendChild(Y),{document:de,body:Be}},Ar=h.output=h.__private__.output=(nr=function(T,Y){switch(typeof(Y=Y||{})=="string"?Y={filename:Y}:Y.filename=Y.filename||"generated.pdf",T){case void 0:return Ba();case"save":h.save(Y.filename);break;case"arraybuffer":return Ae(Ba());case"blob":return $n(Ba());case"bloburi":case"bloburl":if(ln.URL!==void 0&&typeof ln.URL.createObjectURL=="function")return ln.URL&&ln.URL.createObjectURL($n(Ba()))||void 0;Cr.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var de="",xe=Ba();try{de=KB(xe)}catch{de=KB(unescape(encodeURIComponent(xe)))}return"data:application/pdf;filename="+encodeURIComponent(Y.filename)+";base64,"+de;case"pdfobjectnewwindow":if(Object.prototype.toString.call(ln)==="[object Window]"){var ke="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Be=!Y.pdfObjectUrl;Be||(ke=Y.pdfObjectUrl);var Ze=ln.open();if(Ze!==null){var Ot=lr(Ze),Tt=Ot.document.createElement("script"),un=this;Tt.src=ke,Be&&(Tt.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",Tt.crossOrigin="anonymous"),Tt.onload=function(){Ze.PDFObject.embed(un.output("dataurlstring"),Y)},Ot.body.appendChild(Tt)}return Ze}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(ln)==="[object Window]"){var bn=Y.pdfJsUrl||"examples/PDF.js/web/viewer.html",Kn=ln.open();if(Kn!==null){var Ua=lr(Kn),kr=Ua.document.createElement("iframe"),Sr=bn.indexOf("?")===-1?"?":"&";un=this,kr.id="pdfViewer",kr.width="500px",kr.height="400px",kr.src=bn+Sr+"file=&downloadName="+encodeURIComponent(Y.filename),kr.onload=function(){Kn.document.title=Y.filename,kr.contentWindow.PDFViewerApplication.open(un.output("bloburl"))},Ua.body.appendChild(kr)}return Kn}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(ln)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var zr=ln.open();if(zr!==null){var ia=lr(zr),sa=ia.document.createElement("iframe");sa.src=this.output("datauristring",Y),ia.body.appendChild(sa),zr.document.title=Y.filename}if(zr||typeof safari>"u")return zr;break;case"datauri":case"dataurl":return ln.document.location.href=this.output("datauristring",Y);default:return null}},nr.foo=function(){try{return nr.apply(this,arguments)}catch(de){var T=de.stack||"";~T.indexOf(" at ")&&(T=T.split(" at ")[1]);var Y="Error in function "+T.split(`
775`)[0].split("<")[0]+": "+de.message;if(!ln.console)throw new Error(Y);ln.console.error(Y,de),ln.alert&&alert(Y)}},nr.foo.bar=nr,nr.foo),nl=function(T){return Array.isArray(Mt)===!0&&Mt.indexOf(T)>-1};switch(r){case"pt":ut=1;break;case"mm":ut=72/25.4;break;case"cm":ut=72/2.54;break;case"in":ut=72;break;case"px":ut=nl("px_scaling")==1?.75:96/72;break;case"pc":case"em":ut=12;break;case"ex":ut=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);ut=r}var Xa=null;V(),$();var Xb=h.__private__.getPageInfo=h.getPageInfo=function(T){if(isNaN(T)||T%1!=0)throw new Error("Invalid argument passed to 
775jsPDF.getPageInfo");return{objId:yt[T].objId,pageNumber:T,pageContext:yt[T]}},JN=h.__private__.getPageInfoByObjId=function(T){if(isNaN(T)||T%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var Y in yt)if(yt[Y].objId===T)break;return Xb(Y)},QN=h.__private__.getCurrentPageInfo=h.getCurrentPageInfo=function(){return{objId:yt[M].objId,pageNumber:M,pageContext:yt[M]}};h.addPage=function(){return Ke.apply(this,arguments),this},h.setPage=function(){return Yt.apply(this,arguments),ie.call(this,se[M]),this},h.insertPage=function(T){return this.addPage(),this.movePage(M,T),this},h.movePage=function(T,Y){var de,xe;if(T>Y){de=se[T],xe=yt[T];for(var ke=T;ke>Y;ke--)se[ke]=se[ke-1],yt[ke]=yt[ke-1];se[Y]=de,yt[Y]=xe,this.setPage(Y)}else if(T<Y){de=se[T],xe=yt[T];for(var Be=T;Be<Y;Be++)se[Be]=se[Be+1],yt[Be]=yt[Be+1];se[Y]=de,yt[Y]=xe,this.setPage(Y)}return this},h.deletePage=function(){return st.apply(this,arguments),this},h.__private__.text=h.text=function(T,Y,de,xe,ke){var Be,Ze,Ot,Tt,un,bn,Kn,Ua,kr,Sr=(xe=xe||{}).scope||this;if(typeof T=="number"&&typeof Y=="number"&&(typeof de=="string"||Array.isArray(de))){var zr=de;de=Y,Y=T,T=zr}if(arguments[3]instanceof at==0?(Ot=arguments[4],Tt=arguments[5],br(Kn=arguments[3])==="object"&&Kn!==null||(typeof Ot=="string"&&(Tt=Ot,Ot=null),typeof Kn=="string"&&(Tt=Kn,Kn=null),typeof Kn=="number"&&(Ot=Kn,Kn=null),xe={flags:Kn,angle:Ot,align:Tt})):(P("The transform parameter of text() with a Matrix value"),kr=ke),isNaN(Y)||isNaN(de)||T==null)throw new Error("Invalid arguments passed to jsPDF.text");if(T.length===0)return Sr;var ia,sa="",$i=typeof xe.lineHeightFactor=="number"?xe.lineHeightFactor:Tf,Lc=Sr.internal.scaleFactor;function ly(Rr){return Rr=Rr.split("	").join(Array(xe.TabLen||9).join(" ")),Le(Rr,Kn)}function If(Rr){for(var Ir,Na=Rr.concat(),Ja=[],$c=Na.length;$c--;)typeof(Ir=Na.shift())=="string"?Ja.push(Ir):Array.isArray(Rr)&&(Ir.length===1||Ir[1]===void 0&&Ir[2]===void 0)?Ja.push(Ir[0]):Ja.push([Ir[0],Ir[1],Ir[2]]);return Ja}function Lf(Rr,Ir){var Na;if(typeof Rr=="string")Na=Ir(Rr)[0];else if(Array.isArray(Rr)){for(var Ja,$c,py=Rr.concat(),Kp=[],o1=py.length;o1--;)typeof(Ja=py.shift())=="string"?Kp.push(Ir(Ja)[0]):Array.isArray(Ja)&&typeof Ja[0]=="string"&&($c=Ir(Ja[0],Ja[1],Ja[2]),Kp.push([$c[0],$c[1],$c[2]]));Na=Kp}return Na}var Bu=!1,Mf=!0;if(typeof T=="string")Bu=!0;else if(Array.isArray(T)){var Up=T.concat();Ze=[];for(var zp,Di=Up.length;Di--;)(typeof(zp=Up.shift())!="string"||Array.isArray(zp)&&typeof zp[0]!="string")&&(Mf=!1);Bu=Mf}if(Bu===!1)throw new Error('Type of text must be string or Array. "'+T+'" is not recognized.');typeof T=="string"&&(T=T.match(/[\r?\n]/)?T.split(/\r\n|\r|\n/g):[T]);var $f=ve/Sr.internal.scaleFactor,Df=$f*($i-1);switch(xe.baseline){case"bottom":de-=Df;break;case"top":de+=$f-Df;break;case"hanging":de+=$f-2*Df;break;case"middle":de+=$f/2-Df}if((bn=xe.maxWidth||0)>0&&(typeof T=="string"?T=Sr.splitTextToSize(T,bn):Object.prototype.toString.call(T)==="[object Array]"&&(T=T.reduce(function(Rr,Ir){return Rr.concat(Sr.splitTextToSize(Ir,bn))},[]))),Be={text:T,x:Y,y:de,options:xe,mutex:{pdfEscape:Le,activeFontKey:ct,fonts:Wt,activeFontSize:ve}},hn.publish("preProcessText",Be),T=Be.text,Ot=(xe=Be.options).angle,kr instanceof at==0&&Ot&&typeof Ot=="number"){Ot*=Math.PI/180,xe.rotationDirection===0&&(Ot=-Ot),j===w&&(Ot=-Ot);var cy=Math.cos(Ot),Wl=Math.sin(Ot);kr=new at(cy,Wl,-Wl,cy,0,0)}else Ot&&Ot instanceof at&&(kr=Ot);j!==w||kr||(kr=sr),(un=xe.charSpace||Dp)!==void 0&&(sa+=k(D(un))+` Tc
776`,this.setCharSpace(this.getCharSpace()||0)),(Ua=xe.horizontalScale)!==void 0&&(sa+=k(100*Ua)+` Tz
777`),xe.lang;var es=-1,i1=xe.renderingMode!==void 0?xe.renderingMode:xe.stroke,Wp=Sr.internal.getCurrentPageInfo().pageContext;switch(i1){case 0:case!1:case"fill":es=0;break;case 1:case!0:case"stroke":es=1;break;case 2:case"fillThenStroke":es=2;break;case 3:case"invisible":es=3;break;case 4:case"fillAndAddForClipping":es=4;break;case 5:case"strokeAndAddPathForClipping":es=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":es=6;break;
vendor: 10,478 bytes, lines 777-789
777case 7:case"addToPathForClipping":es=7}var s1=Wp.usedRenderingMode!==void 0?Wp.usedRenderingMode:-1;es!==-1?sa+=es+` Tr
778`:s1!==-1&&(sa+=`0 Tr
779`),es!==-1&&(Wp.usedRenderingMode=es),Tt=xe.align||"left";var _o,Ff=ve*$i,uy=Sr.internal.pageSize.getWidth(),qp=Wt[ct];un=xe.charSpace||Dp,bn=xe.maxWidth||0,Kn=Object.assign({autoencode:!0,noBOM:!0},xe.flags);var Bf=[],dy=function(Rr){return Sr.getStringUnitWidth(Rr,{font:qp,charSpace:un,fontSize:ve,doKerning:!1})*ve/Lc};if(Object.prototype.toString.call(T)==="[object Array]"){var ts;Ze=If(T),Tt!=="left"&&(_o=Ze.map(dy));var ws,Vp=0;if(Tt==="right"){Y-=_o[0],T=[],Di=Ze.length;for(var Uu=0;Uu<Di;Uu++)Uu===0?(ws=Tc(Y),ts=Oc(de)):(ws=D(Vp-_o[Uu]),ts=-Ff),T.push([Ze[Uu],ws,ts]),Vp=_o[Uu]}else if(Tt==="center"){Y-=_o[0]/2,T=[],Di=Ze.length;for(var zu=0;zu<Di;zu++)zu===0?(ws=Tc(Y),ts=Oc(de)):(ws=D((Vp-_o[zu])/2),ts=-Ff),T.push([Ze[zu],ws,ts]),Vp=_o[zu]}else if(Tt==="left"){T=[],Di=Ze.length;for(var Hp=0;Hp<Di;Hp++)T.push(Ze[Hp])}else if(Tt==="justify"&&qp.encoding==="Identity-H"){T=[],Di=Ze.length,bn=bn!==0?bn:uy;for(var Uf=0,za=0;za<Di;za++)if(ts=za===0?Oc(de):-Ff,ws=za===0?Tc(Y):Uf,za<Di-1){var p5=D((bn-_o[za])/(Ze[za].split(" ").length-1)),ql=Ze[za].split(" ");T.push([ql[0]+" ",ws,ts]),Uf=0;for(var rl=1;rl<ql.length;rl++){var zf=(dy(ql[rl-1]+" "+ql[rl])-dy(ql[rl]))*Lc+p5;rl==ql.length-1?T.push([ql[rl],zf,0]):T.push([ql[rl]+" ",zf,0]),Uf-=zf}}else T.push([Ze[za],ws,ts]);T.push(["",Uf,0])}else{if(Tt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(T=[],Di=Ze.length,bn=bn!==0?bn:uy,za=0;za<Di;za++){ts=za===0?Oc(de):-Ff,ws=za===0?Tc(Y):0;var fy=Ze[za].split(" ").length-1,hy=fy>0?(bn-_o[za])/fy:0;za<Di-1?Bf.push(k(D(hy))):Bf.push(0),T.push([Ze[za],ws,ts])}}}(typeof xe.R2L=="boolean"?xe.R2L:Ee)===!0&&(T=Lf(T,function(Rr,Ir,Na){return[Rr.split("").reverse().join(""),Ir,Na]})),Be={text:T,x:Y,y:de,options:xe,mutex:{pdfEscape:Le,activeFontKey:ct,fonts:Wt,activeFontSize:ve}},hn.publish("postProcessText",Be),T=Be.text,ia=Be.mutex.isHex||!1;var Gp=Wt[ct].encoding;Gp!=="WinAnsiEncoding"&&Gp!=="StandardEncoding"||(T=Lf(T,function(Rr,Ir,Na){return[ly(Rr),Ir,Na]})),Ze=If(T),T=[];for(var Wf,qf,Wu,Mc=Array.isArray(Ze[0])?1:0,qu="",Yp=function(Rr,Ir,Na){var Ja="";return Na instanceof at?(Na=typeof xe.angle=="number"?xn(Na,new at(1,0,0,1,Rr,Ir)):xn(new at(1,0,0,1,Rr,Ir),Na),j===w&&(Na=xn(new at(1,0,0,-1,0,0),Na)),Ja=Na.join(" ")+` Tm
780`):Ja=k(Rr)+" "+k(Ir)+` Td
781`,Ja},Fi=0;Fi<Ze.length;Fi++){switch(qu="",Mc){case 1:Wu=(ia?"<":"(")+Ze[Fi][0]+(ia?">":")"),Wf=parseFloat(Ze[Fi][1]),qf=parseFloat(Ze[Fi][2]);break;case 0:Wu=(ia?"<":"(")+Ze[Fi]+(ia?">":")"),Wf=Tc(Y),qf=Oc(de)}Bf!==void 0&&Bf[Fi]!==void 0&&(qu=Bf[Fi]+` Tw
782`),Fi===0?T.push(qu+Yp(Wf,qf,kr)+Wu):Mc===0?T.push(qu+Wu):Mc===1&&T.push(qu+Yp(Wf,qf,kr)+Wu)}T=Mc===0?T.join(` Tj
783T* `):T.join(` Tj
784`),T+=` Tj
785`;var Vl=`BT
786/`;return Vl+=ct+" "+ve+` Tf
787`,Vl+=k(ve*$i)+` TL
788`,Vl+=zl+`
789`,Vl+=sa,Vl+=T,F(Vl+="ET"),p[ct]=!0,Sr};var e5=h.__private__.clip=h.clip=function(T){return F(T==="evenodd"?"W*":"W"),this};h.clipEvenOdd=function(){return e5("evenodd")},h.__private__.discardPath=h.discardPath=function(){return F("n"),this};var Ul=h.__private__.isValidStyle=function(T){var Y=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(T)!==-1&&(Y=!0),Y};h.__private__.setDefaultPathOperation=h.setDefaultPathOperation=function(T){return Ul(T)&&(u=T),this};var Jb=h.__private__.getStyle=h.getStyle=function(T){var Y=u;switch(T){case"D":case"S":Y="S";break;case"F":Y="f";break;case"FD":case"DF":Y="B";break;case"f":case"f*":case"B":case"B*":Y=T}return Y},Lp=h.close=function(){return F("h"),this};h.stroke=function(){return F("S"),this},h.fill=function(T){return Mp("f",T),this},h.fillEvenOdd=function(T){return Mp("f*",T),this},h.fillStroke=function(T){return Mp("B",T),this},h.fillStrokeEvenOdd=function(T){return Mp("B*",T),this};var Mp=function(T,Y){br(Y)==="object"?n5(Y,T):F(T)},ny=function(T){T===null||j===w&&T===void 0||(T=Jb(T),F(T))};function t5(T,Y,de,xe,ke){var Be=new qm(Y||this.boundingBox,de||this.xStep,xe||this.yStep,this.gState,ke||this.matrix);Be.stream=this.stream;var Ze=T+"$$"+this.cloneIndex+++"$$";return Yn(Ze,Be),Be}var n5=function(T,Y){var de=Tn[T.key],xe=Pt[de];if(xe instanceof mh)F("q"),F(r5(Y)),xe.gState&&h.setGState(xe.gState),F(T.matrix.toString()+" cm"),F("/"+de+" sh"),F("Q");else if(xe instanceof qm){var ke=new at(1,0,0,-1,0,Rf());T.matrix&&(ke=ke.multiply(T.matrix||sr),de=t5.call(xe,T.key,T.boundingBox,T.xStep,T.yStep,ke).id),F("q"),F("/Pattern cs"),F("/"+de+" scn"),xe.gState&&h.setGState(xe.gState),F(Y),F("Q")}},r5=function(T){switch(T){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},$u=h.moveTo=function(T,Y){return F(k(D(T))+" "+k(U(Y))+" m"),this},Qb=h.lineTo=function(T,Y){return F(k(D(T))+" "+k(U(Y))+" l"),this},Du=h.curveTo=function(T,Y,de,xe,ke,Be){return F([k(D(T)),k(U(Y)),k(D(de)),k(U(xe)),k(D(ke)),k(U(Be)),"c"].join(" ")),this};h.__private__.line=h.line=function(T,Y,de,xe,ke){if(isNaN(T)||isNaN(Y)||isNaN(de)||isNaN(xe)||!Ul(ke))throw new Error("Invalid arguments passed to jsPDF.line");return j===b?this.lines([[de-T,xe-Y]],T,Y,[1,1],ke||"S"):this.lines([[de-T,xe-Y]],T,Y,[1,1]).stroke()},h.__private__.lines=h.lines=function(T,Y,de,xe,ke,Be){var Ze,Ot,Tt,un,bn,Kn,Ua,kr,Sr,zr,ia,sa;if(typeof T=="number"&&(sa=de,de=Y,Y=T,T=sa),xe=xe||[1,1],Be=Be||!1,isNaN(Y)||isNaN(de)||!Array.isArray(T)||!Array.isArray(xe)||!Ul(ke)||typeof Be!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for($u(Y,de),Ze=xe[0],Ot=xe[1],un=T.length,zr=Y,ia=de,Tt=0;Tt<un;Tt++)(bn=T[Tt]).length===2?(zr=bn[0]*Ze+zr,ia=bn[1]*Ot+ia,Qb(zr,ia)):(Kn=bn[0]*Ze+zr,Ua=bn[1]*Ot+ia,kr=bn[2]*Ze+zr,Sr=bn[3]*Ot+ia,zr=bn[4]*Ze+zr,ia=bn[5]*Ot+ia,Du(Kn,Ua,kr,Sr,zr,ia));return Be&&Lp(),ny(ke),this},h.path=function(T){for(var Y=0;Y<T.length;Y++){var de=T[Y],xe=de.c;switch(de.op){case"m":$u(xe[0],xe[1]);break;case"l":Qb(xe[0],xe[1]);break;case"c":Du.apply(this,xe);break;case"h":Lp()}}return this},h.__private__.rect=h.rect=function(T,Y,de,xe,ke){if(isNaN(T)||isNaN(Y)||isNaN(de)||isNaN(xe)||!Ul(ke))throw new Error("Invalid arguments passed to jsPDF.rect");return j===b&&(xe=-xe),F([k(D(T)),k(U(Y)),k(D(de)),k(D(xe)),"re"].join(" ")),ny(ke),this},h.__private__.triangle=h.triangle=function(T,Y,de,xe,ke,Be,Ze){if(isNaN(T)||isNaN(Y)||isNaN(de)||isNaN(xe)||isNaN(ke)||isNaN(Be)||!Ul(Ze))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[de-T,xe-Y],[ke-de,Be-xe],[T-ke,Y-Be]],T,Y,[1,1],Ze,!0),this},h.__private__.roundedRect=h.roundedRect=function(T,Y,de,xe,ke,Be,Ze){if(isNaN(T)||isNaN(Y)||isNaN(de)||isNaN(xe)||isNaN(ke)||isNaN(Be)||!Ul(Ze))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Ot=4/3*(Math.SQRT2-1);return ke=Math.min(ke,.5*de),Be=Math.min(Be,.5*xe),this.lines([[de-2*ke,0],[ke*Ot,0,ke,Be-Be*Ot,ke,Be],[0,xe-2*Be],[0,Be*Ot,-ke*Ot,Be,-ke,Be],[2*ke-de,0],[-ke*Ot,0,-ke,-Be*Ot,-ke,-Be],[0,2*Be-xe],[0,-Be*Ot,ke*Ot,-Be,ke,-Be]],T+ke,Y,[1,1],Ze,!0),this},h.__private__.ellipse=h.ellipse=function(T,Y,de,xe,ke){if(isNaN(T)||isNaN(Y)||isNaN(de)||isNaN(xe)||!Ul(ke))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Be=4/3*(Math.SQRT2-1)*de,Ze=4/3*(Math.SQRT2-1)*xe;return $u(T+de,Y),Du(T+de,Y-Ze,T+Be,Y-xe,T,Y-xe),Du(T-Be,Y-xe,T-de,Y-Ze,T-de,Y),Du(T-de,Y+Ze,T-Be,Y+xe,T,Y+xe),Du(T+Be,Y+xe,T+de,Y+Ze,T+de,Y),ny(ke),this},h.__private__.circle=h.circle=function(T,Y,de,xe){if(isNaN(T)||isNaN(Y)||isNaN(de)||!Ul(xe))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(T,Y,de,de,xe)},h.setFont=function(T,Y,de){return de&&(Y=E(Y,de)),ct=Sa(T,Y,{disableWarning:!1}),this};var a5=h.__private__.getFont=h.getFont=function(){return Wt[Sa.apply(h,arguments)]};h.__private__.getFontList=h.getFontList=function(){var T,Y,de={};for(T in Jt)if(Jt.hasOwnProperty(T))for(Y in de[T]=[],Jt[T])Jt[T].hasOwnProperty(Y)&&de[T].push(Y);return de},h.addFont=function(T,Y,de,xe,ke){var Be=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Be.indexOf(arguments[3])!==-1?ke=arguments[3]:arguments[3]&&Be.indexOf(arguments[3])==-1&&(de=E(de,xe)),ge.call(this,T,Y,de,ke=ke||"Identity-H")};var Tf,on=e.lineWidth||.200025,i5=h.__private__.getLineWidth=h.getLineWidth=function(){return on},s5=h.__private__.setLineWidth=h.setLineWidth=function(T){return on=T,F(k(D(T))+" w"),this};h.__private__.setLineDash=qt.API.setLineDash=qt.API.setLineDashPattern=function(T,Y){if(T=T||[],Y=Y||0,isNaN(Y)||!Array.isArray(T))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return T=T.map(function(de){return k(D(de))}).join(" "),Y=k(D(Y)),F("["+T+"] "+Y+" d"),this};var o5=h.__private__.getLineHeight=h.getLineHeight=function(){return ve*Tf};h.__private__.getLineHeight=h.getLineHeight=function(){return ve*Tf};var l5=h.__private__.setLineHeightFactor=h.setLineHeightFactor=function(T){return typeof(T=T||1.15)=="number"&&(Tf=T),this},c5=h.__private__.getLineHeightFactor=h.getLineHeightFactor=function(){return Tf};l5(e.lineHeight);var Tc=h.__private__.getHorizontalCoordinate=function(T){return D(T)},Oc=h.__private__.getVerticalCoordinate=function(T){return j===w?T:yt[M].mediaBox.topRightY-yt[M].mediaBox.bottomLeftY-D(T)},u5=h.__private__.getHorizontalCoordinateString=h.getHorizontalCoordinateString=function(T){return k(Tc(T))},d5=h.__private__.getVerticalCoordinateString=h.getVerticalCoordinateString=function(T){return k(Oc(T))},$p=e.strokeColor||"0 G";h.__private__.getStrokeColor=h.getDrawColor=function(){return Za($p)},h.__private__.setStrokeColor=h.setDrawColor=function(T,Y,de,xe){return $p=Si({ch1:T,ch2:Y,ch3:de,ch4:xe,pdfColorType:"draw",precision:2}),F($p),this};var ry=e.fillColor||"0 g";h.__private__.getFillColor=h.getFillColor=function(){return Za(ry)},h.__private__.setFillColor=h.setFillColor=function(T,Y,de,xe){return ry=Si({ch1:T,ch2:Y,ch3:de,ch4:xe,pdfColorType:"fill",precision:2}),F(ry),this};var zl=e.textColor||"0 g",f5=h.__private__.getTextColor=h.getTextColor=function(){return Za(zl)};h.__private__.setTextColor=h.setTextColor=function(T,Y,de,xe){return zl=Si({ch1:T,ch2:Y,ch3:de,ch4:xe,pdfColorType:"text",precision:3}),this};var Dp=e.charSpace,h5=h.__private__.getCharSpace=h.getCharSpace=function(){return parseFloat(Dp||0)};h.__private__.setCharSpace=h.setCharSpace=function(T){if(isNaN(T))throw new Error("Invalid argument passed to 
789jsPDF.setCharSpace");return Dp=T,this};var ay=0;h.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},h.__private__.setLineCap=h.setLineCap=function(T){var Y=h.CapJoinStyles[T];if(Y===void 0)throw new Error("Line cap style of '"+T+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return ay=Y,F(Y+" J"),this};var Fu=0;h.__private__.setLineJoin=h.setLineJoin=function(T){var Y=h.CapJoinStyles[T];if(Y===void 0)throw new Error("Line join style of '"+T+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Fu=Y,F(Y+" j"),this},h.__private__.setLineMiterLimit=h.__private__.setMiterLimit=h.setLineMiterLimit=h.setMiterLimit=function(T){if(T=T||0,isNaN(T))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return F(k(D(T))+" M"),this},h.GState=Oj,h.setGState=function(T){(T=typeof T=="string"?Lt[Vt[T]]:iy(null,T)).equals(Mn)||(F("/"+T.id+" gs"),Mn=T)};var iy=function(T,Y){if(!T||!Vt[T]){var de=!1;for(var xe in Lt)if(Lt.hasOwnProperty(xe)&&Lt[xe].equals(Y)){de=!0;break}if(de)Y=Lt[xe];else{var ke="GS"+(Object.keys(Lt).length+1).toString(10);Lt[ke]=Y,Y.id=ke}return T&&(Vt[T]=Y.id),hn.publish("addGState",Y),Y}};h.addGState=function(T,Y){return iy(T,Y),this},h.saveGraphicsState=function(){return F("q"),Un.push({key:ct,size:ve,color:zl}),this},h.restoreGraphicsState=function(){F("Q");var T=Un.pop();return ct=T.key,ve=T.size,zl=T.color,Mn=null,this},h.setCurrentTransformationMatrix=function(T){return F(T.toString()+" cm"),this},h.comment=function(T){return F("#"+T),this};var Of=function(T,Y){var de=T||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return de},set:function(Be){isNaN(Be)||(de=parseFloat(Be))}});var xe=Y||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return xe},set:function(Be){isNaN(Be)||(xe=parseFloat(Be))}});var ke="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return ke},set:function(Be){ke=Be.toString()}}),this},sy=function(T,Y,de,xe){Of.call(this,T,Y),this.type="rect";var ke=de||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return ke},set:function(Ze){isNaN(Ze)||(ke=parseFloat(Ze))}});var Be=xe||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Be},set:function(Ze){isNaN(Ze)||(Be=parseFloat(Ze))}}),this},Fp=function(){this.page=nn,this.currentPage=M,this.pages=se.slice(0),this.pagesContext=yt.slice(0),this.x=Fe,this.y=It,this.matrix=zt,this.width=e1(M),this.height=Ic(M),this.outputDestination=ye,this.id="",this.objectNumber=-1};Fp.prototype.restore=function(){nn=this.page,M=this.currentPage,yt=this.pagesContext,se=this.pages,Fe=this.x,It=this.y,zt=this.matrix,Rc(M,this.width),t1(M,this.height),ye=this.outputDestination};var oy=function(T,Y,de,xe,ke){rt.push(new Fp),nn=M=0,se=[],Fe=T,It=Y,zt=ke,nt([de,xe])};for(var Bp in h.beginFormObject=function(T,Y,de,xe,ke){return oy(T,Y,de,xe,ke),this},h.endFormObject=function(T){return function(Y){if(je[Y])rt.pop().restore();else{var de=new Fp,xe="Xo"+(Object.keys(Ht).length+1).toString(10);de.id=xe,je[Y]=xe,Ht[xe]=de,hn.publish("addFormObject",de),rt.pop().restore()}}(T),this},h.doFormObject=function(T,Y){var de=Ht[je[T]];return F("q"),F(Y.toString()+" cm"),F("/"+de.id+" Do"),F("Q"),this},h.getFormObject=function(T){var Y=Ht[je[T]];return{x:Y.x,y:Y.y,width:Y.width,height:Y.height,matrix:Y.matrix}},h.save=function(T,Y){return T=T||"generated.pdf",(Y=Y||{}).returnPromise=Y.returnPromise||!1,Y.returnPromise===!1?(ch($n(Ba()),T),typeof ch.unload=="function"&&ln.setTimeout&&setTimeout(ch.unload,911),this):new Promise(function(de,xe){try{var ke=ch($n(Ba()),T);typeof ch.unload=="function"&&ln.setTimeout&&setTimeout(ch.unload,911),de(ke)}catch(Be){xe(Be.message)}})},qt.API)qt.API.hasOwnProperty(Bp)&&(Bp==="events"&&qt.API.events.length?function(T,Y){var de,xe,ke;for(ke=Y.length-1;ke!==-1;ke--)de=Y[ke][0],xe=Y[ke][1],T.subscribe.apply(T,[de].concat(typeof xe=="function"?[xe]:xe))}(hn,qt.API.events):h[Bp]=qt.API[Bp]);function e1(T){return yt[T].mediaBox.topRightX-yt[T].mediaBox.bottomLeftX}function Rc(T,Y){yt[T].mediaBox.topRightX=Y+yt[T].mediaBox.bottomLeftX}function Ic(T){return yt[T].mediaBox.topRightY-yt[T].mediaBox.bottomLeftY}function t1(T,Y){yt[T].mediaBox.topRightY=Y+yt[T].mediaBox.bottomLeftY}var n1=h.getPageWidth=function(T){return e1(T=T||M)/ut},r1=h.setPageWidth=function(T,Y){Rc(T,Y*ut)},Rf=h.getPageHeight=function(T){return Ic(T=T||M)/ut},a1=h.setPageHeight=function(T,Y){t1(T,Y*ut)};return h.internal={pdfEscape:Le,getStyle:Jb,getFont:a5,getFontSize:Pe,getCharSpace:h5,getTextColor:f5,getLineHeight:o5,getLineHeightFactor:c5,getLineWidth:i5,write:me,getHorizontalCoordinate:Tc,getVerticalCoordinate:Oc,getCoordinateString:u5,getVerticalCoordinateString:d5,collections:{},newObject:Gt,newAdditionalObject:_i,newObjectDeferred:Sn,newObjectDeferredBegin:Zt,getFilters:Ni,putStream:Jr,events:hn,scaleFactor:ut,pageSize:{getWidth:function(){return n1(M)},setWidth:function(T){r1(M,T)},getHeight:function(){return Rf(M)},setHeight:function(T){a1(M,T)}},encryptionOptions:d,encryption:Xa,getEncryptor:function(T){return d!==null?Xa.encryptor(T,0):function(Y){return Y}},output:Ar,getNumberOfPages:or,get pages(){return se},out:F,f2:C,f3:I,getPageInfo:Xb,getPageInfoByObjId:JN,getCurrentPageInfo:QN,getPDFVersion:g,Point:Of,Rectangle:sy,Matrix:at,hasHotfix:nl},Object.defineProperty(h.internal.pageSize,"width",{get:function(){return n1(M)},set:function(T){r1(M,T)},enumerable:!0,configurable:!0}),Object.defineProperty(h.internal.pageSize,"height",{get:function(){return Rf(M)},set:function(T){a1(M,T)},enumerable:!0,configurable:!0}),(function(T){for(var Y=0,de=Ne.length;Y<de;
vendor: 4,385 bytes, lines 789-791
789Y++){var xe=ge.call(this,T[Y][0],T[Y][1],T[Y][2],Ne[Y][3],!0);f===!1&&(p[xe]=!0);var ke=T[Y][0].split("-");Pf({id:xe,fontName:ke[0],fontStyle:ke[1]||""})}hn.publish("addFonts",{fonts:Wt,dictionary:Jt})}).call(h,Ne),ct="F1",Ke(a,n),hn.publish("initialized"),h}jm.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},jm.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},jm.prototype.hexToBytes=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(String.fromCharCode(parseInt(e.substr(n,2),16)));return t.join("")},jm.prototype.processOwnerPassword=function(e,t){return oT(sT(t).substr(0,5),e)},jm.prototype.encryptor=function(e,t){var n=sT(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(r){return oT(n,r)}},Oj.prototype.equals=function(e){var t,n="id,objectNumber,equals";if(!e||br(e)!==br(this))return!1;var r=0;for(t in this)if(!(n.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&n.indexOf(t)<0&&r--;return r===0},qt.API={events:[]},qt.version="4.2.1";var ya=qt.API,EI=1,Rp=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},hm=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},gp=function(e){return e.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(t){var n=t.charCodeAt(0).toString(16).toUpperCase();return"#"+(n.length===1?"0"+n:n)})},pn=function(e){return e.toFixed(2)},rd=function(e){return e.toFixed(5)};ya.__acroform__={};var zs=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},QB=function(e){return e*EI},Yl=function(e){var t=new Lte,n=Ct.internal.getHeight(e)||0,r=Ct.internal.getWidth(e)||0;return t.BBox=[0,0,Number(pn(r)),Number(pn(n))],t},kYe=ya.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},EYe=ya.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},CYe=ya.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},Ta=ya.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return CYe(e,t-1)},Oa=ya.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return kYe(e,t-1)},Ra=ya.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return EYe(e,t-1)},PYe=ya.__acroform__.calculateCoordinates=function(e,t){var n=t.internal.getHorizontalCoordinate,r=t.internal.getVerticalCoordinate,a=e[0],i=e[1],o=e[2],l=e[3],c={};return c.lowerLeft_X=n(a)||0,c.lowerLeft_Y=r(i+l)||0,c.upperRight_X=n(a+o)||0,c.upperRight_Y=r(i)||0,[Number(pn(c.lowerLeft_X)),Number(pn(c.lowerLeft_Y)),Number(pn(c.upperRight_X)),Number(pn(c.upperRight_Y))]},TYe=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,r=lT(e,n),a=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+a+" "+pn(r.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(r.text),t.push("ET"),t.push("Q"),t.push("EMC");var i=Yl(e);return i.scope=e.scope,i.stream=t.join(`
790`),i}},lT=function(e,t){var n=e.fontSize===0?e.maxFontSize:e.fontSize,r={text:"",fontSize:""},a=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");a=e.multiline?a.map(function(C){return C.split(`
791`)}):a.map(function(C){return[C]});var i=n,o=Ct.internal.getHeight(e)||0;o=o<0?-o:o;var l=Ct.internal.getWidth(e)||0;l=l<0?-l:l;var c=function(C,I,D){if(C+1<a.length){var U=I+" "+a[C+1][0];return Ow(U,e,D).width<=l-4}return!1};i++;e:for(;i>0;){t="",i--;var u,d,f=Ow("3",e,i).height,p=e.multiline?o-i:(o-f)/2,h=p+=2,m=0,g=0,v=0;if(i<=0){t=`(...) Tj
792`,t+="% Width of Text: "+Ow(t,e,i=12).width+", FieldWidth:"+l+`
793`;break}for(var y="",b=0,w=0;w<a.length;w++)if(a.hasOwnProperty(w)){var j=!1;if(a[w].length!==1&&v!==a[w].length-1){if((f+2)*(b+2)+2>o)continue e;y+=a[w][v],j=!0,g=w,w--}else{y=(y+=a[w][v]+" ").substr(y.length-1)==" "?y.substr(0,y.length-1):y;var S=parseInt(w),A=c(S,y,i),E=w>=a.length-1;if(A&&!E){y+=" ",v=0;continue}if(A||E){if(E)g=S;else if(e.multiline&&(f+2)*(b+2)+2>o)continue e}else{if(!e.multiline||(f+2)*(b+2)+2>o)continue e;g=S}}for(var k="",P=m;P<=g;P++){var R=a[P];if(e.multiline){if(P===g){k+=R[v]+" ",v=(v+1)%R.length;continue}if(P===m){k+=R[R.length-1]+" ";continue}}k+=R[0]+" "}switch(k=k.substr(k.length-1)==" "?k.substr(0,k.length-1):k,d=Ow(k,e,i).width,e.textAlign){case"right":u=l-d-2;break;case"center":u=(l-d)/2;break;default:u=2}t+=pn(u)+" "+pn(h)+` Td
794`,t+="("+Rp(k)+`) Tj
795`,t+=-pn(u)+` 0 Td
796`,h=-(i+2),d=0,m=j?g:g+1,b++,y=""}break}return r.text=t,r.fontSize=i,r},Ow=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),a=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:a}},OYe={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},RYe=function(e,t){var n={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},IYe=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(Dl.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(OYe)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");EI=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new Mte,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var a in r)if(r.hasOwnProperty(a)){var i=r[a];i.objId=void 0,i.hasAnnotation&&RYe(i,n)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(n){(function(r,a){var i=!r;for(var o in r||(a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||a.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(o)){var l=r[o],c=[],u=l.Rect;if(l.Rect&&(l.Rect=PYe(l.Rect,a)),a.internal.newObjectDeferredBegin(l.objId,!0),l.DA=Ct.createDefaultAppearanceStream(l),br(l)==="object"&&typeof l.getKeyValueListForStream=="function"&&(c=l.getKeyValueListForStream()),l.Rect=u,l.hasAppearanceStream&&!l.appearanceStreamContent){var d=TYe(l);c.push({key:"AP",value:"<</N "+d+">>"}),a.internal.acroformPlugin.xForms.push(d)}if(l.appearanceStreamContent){var f="";for(var p in l.appearanceStreamContent)if(l.appearanceStreamContent.hasOwnProperty(p)){var h=l.appearanceStreamContent[p];if(f+="/"+p+" ",f+="<<",Object.keys(h).length>=1||Array.isArray(h)){for(var o in h)if(h.hasOwnProperty(o)){var m=h[o];typeof m=="function"&&(m=m.call(a,l)),f+="/"+o+" "+m+" ",a.internal.acroformPlugin.xForms.indexOf(m)>=0||a.internal.acroformPlugin.xForms.push(m)}}else typeof(m=h)=="function"&&(m=m.call(a,l)),f+="/"+o+" "+m,a.internal.acroformPlugin.xForms.indexOf(m)>=0||a.internal.acroformPlugin.xForms.push(m);f+=">>"}c.push({key:"AP",value:`<<
797`+f+">>"})}a.internal.putStream({additionalKeyValues:c,objectId:l.objId}),a.internal.out("endobj")}i&&function(g,v){for(var y in g)if(g.hasOwnProperty(y)){var b=y,w=g[y];v.internal.newObjectDeferredBegin(w.objId,!0),br(w)==="object"&&typeof w.putStream=="function"&&w.putStream(),delete g[b]}}(a.internal.acroformPlugin.xForms,a)})(n,e)}),e.internal.acroformPlugin.isInitialized=!0}},Ite=ya.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(o){return o};if(Array.isArray(e)){for(var a="[",i=0;i<e.length;i++)switch(i!==0&&(a+=" "),br(e[i])){case"boolean":case"number":case"object":a+=e[i].toString();break;case"string":e[i].substr(0,1)==="/"?a+="/"+gp(e[i].substr(1)):(t!==void 0&&n&&(r=n.internal.getEncryptor(t)),a+="("+Rp(r
vendor: 21,914 bytes, lines 797-808
797(e[i].toString()))+")")}return a+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},Wk=function(e,t,n){var r=function(a){return a};return t!==void 0&&n&&(r=n.internal.getEncryptor(t)),(e=e||"").toString(),"("+Rp(r(e))+")"},cc=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};cc.prototype.toString=function(){return this.objId+" 0 R"},cc.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},cc.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(i){return i!="content"&&i!="appearanceStreamContent"&&i!="scope"&&i!="objId"&&i.substring(0,1)!="_"});for(var n in t)if(Object.getOwnPropertyDescriptor(this,t[n]).configurable===!1){var r=t[n],a=this[r];a&&(Array.isArray(a)?e.push({key:r,value:Ite(a,this.objId,this.scope)}):a instanceof cc?(a.scope=this.scope,e.push({key:r,value:a.objId+" 0 R"})):typeof a!="function"&&e.push({key:r,value:a}))}return e};var Lte=function(){cc.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){e=n.trim()},get:function(){return e||null}})};zs(Lte,cc);var Mte=function(){cc.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Rp(n(e))+")"}},set:function(n){e=n}})};zs(Mte,cc);var Dl=function e(){cc.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute F supplied.');t=y}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Ta(t,3)},set:function(y){y?this.F=Oa(t,3):this.F=Ra(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute Ff supplied.');n=y}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(y){r=y!==void 0?y:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(y){r[0]=y}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(y){r[1]=y}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(y){r[2]=y}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(y){r[3]=y}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(y){switch(y){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=y;break;default:throw new Error('Invalid value "'+y+'" for attribute FT supplied.')}}});var i=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!i||i.length<1){if(this instanceof Rj)return;i="FieldObject"+e.FieldNum++}var y=function(b){return b};return this.scope&&(y=this.scope.internal.getEncryptor(this.objId)),"("+Rp(y(i))+")"},set:function(y){i=y.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(y){i=y}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(y){o=y}});var l="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return l},set:function(y){l=y}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(y){c=y}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/EI:u},set:function(y){u=y}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(y){d=y}});var f="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!f||this instanceof Rj||this instanceof Hh))return Wk(f,this.objId,this.scope)},set:function(y){y=y.toString(),f=y}});var p=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof gi==0?Wk(p,this.objId,this.scope):p},set:function(y){y=y.toString(),p=this instanceof gi==0?y.substr(0,1)==="("?hm(y.substr(1,y.length-2)):hm(y):y}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof gi==1?hm(p.substr(1,p.length-1)):p},set:function(y){y=y.toString(),p=this instanceof gi==1?"/"+gp(y):y}});var h=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(h)return h},set:function(y){this.V=y}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(h)return this instanceof gi==0?Wk(h,this.objId,this.scope):h},set:function(y){y=y.toString(),h=this instanceof gi==0?y.substr(0,1)==="("?hm(y.substr(1,y.length-2)):hm(y):y}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof gi==1?hm(h.substr(1,h.length-1)):h},set:function(y){y=y.toString(),h=this instanceof gi==1?"/"+gp(y):y}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var m,g=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return g},set:function(y){y=!!y,g=y}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(m)return m},set:function(y){m=y}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,1)},set:function(y){y?this.Ff=Oa(this.Ff,1):this.Ff=Ra(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,2)},set:function(y){y?this.Ff=Oa(this.Ff,2):this.Ff=Ra(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,3)},set:function(y){y?this.Ff=Oa(this.Ff,3):this.Ff=Ra(this.Ff,3)}});var v=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(v!==null)return v},set:function(y){if([0,1,2].indexOf(y)===-1)throw new Error('Invalid value "'+y+'" for attribute Q supplied.');v=y}}),Object.defineProperty(this,"textAlign",{get:function(){var y;switch(v){case 0:default:y="left";break;case 1:y="center";break;case 2:y="right"}return y},configurable:!0,enumerable:!0,set:function(y){switch(y){case"right":case 2:v=2;break;case"center":case 1:v=1;break;default:v=0}}})};zs(Dl,cc);var lg=function(){Dl.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(n){e=n}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return Ite(t,this.objId,this.scope)},set:function(n){var r,a;a=[],typeof(r=n)=="string"&&(a=function(i,o,l){l||(l=1);for(var c,u=[];c=o.exec(i);)u.push(c[l]);return u}(r,/\((.*?)\)/g)),t=a}}),this.getOptions=function(){return t},this.setOptions=function(n){t=n,this.sort&&t.sort()},this.addOption=function(n){n=(n=n||"").toString(),t.push(n),this.sort&&t.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();t.indexOf(n)!==-1&&(t.splice(t.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,18)},set:function(n){n?this.Ff=Oa(this.Ff,18):this.Ff=Ra(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=Oa(this.Ff,19):this.Ff=Ra(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,20)},set:function(n){n?(this.Ff=Oa(this.Ff,20),t.sort()):this.Ff=Ra(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,22)},set:function(n){n?this.Ff=Oa(this.Ff,22):this.Ff=Ra(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,23)},set:function(n){n?this.Ff=Oa(this.Ff,23):this.Ff=Ra(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,27)},set:function(n){n?this.Ff=Oa(this.Ff,27):this.Ff=Ra(this.Ff,27)}}),this.hasAppearanceStream=!1};zs(lg,Dl);var cg=function(){lg.call(this),this.fontName="helvetica",this.combo=!1};zs(cg,lg);var ug=function(){cg.call(this),this.combo=!0};zs(ug,cg);var h_=function(){ug.call(this),this.edit=!0};zs(h_,ug);var gi=function(){Dl.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,15)},set:function(n){n?this.Ff=Oa(this.Ff,15):this.Ff=Ra(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,16)},set:function(n){n?this.Ff=Oa(this.Ff,16):this.Ff=Ra(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,17)},set:function(n){n?this.Ff=Oa(this.Ff,17):this.Ff=Ra(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,26)},set:function(n){n?this.Ff=Oa(this.Ff,26):this.Ff=Ra(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(i){return i};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var r,a=[];for(r in a.push("<<"),t)a.push("/"+r+" ("+Rp(n(t[r]))+")");return a.push(">>"),a.join(`
798`)}},set:function(n){br(n)==="object"&&(t=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(n){typeof n=="string"&&(t.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(n){var r=n==null?"":n.toString();r.substr(0,1)==="/"&&(r=r.substr(1)),e="/"+gp(r)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(n){e="/"+gp(n)}})};zs(gi,Dl);var p_=function(){gi.call(this),this.pushButton=!0};zs(p_,gi);var dg=function(){gi.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};zs(dg,gi);var Rj=function(){var e,t;Dl.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(a){e=a}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(a){t=a}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var a=function(l){return l};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var i,o=[];for(i in o.push("<<"),r)o.push("/"+i+" ("+Rp(a(r[i]))+")");return o.push(">>"),o.join(`
799`)},set:function(a){br(a)==="object"&&(r=a)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(a){typeof a=="string"&&(r.CA=a)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(a){var i=a==null?"":a.toString();i.substr(0,1)==="/"&&(i=i.substr(1)),n="/"+gp(i)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(a){var i=a==null?"":a.toString();i.substr(0,1)==="/"&&(i=i.substr(1)),n="/"+gp(i)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Ct.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};zs(Rj,Dl),dg.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},dg.prototype.createOption=function(e){var t=new Rj;return t.Parent=this,t.optionName=e,this.Kids.push(t),LYe.call(this.scope,t),t};var m_=function(){gi.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Ct.CheckBox.createAppearanceStream()};zs(m_,gi);var Hh=function(){Dl.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,13)},set:function(t){t?this.Ff=Oa(this.Ff,13):this.Ff=Ra(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,21)},set:function(t){t?this.Ff=Oa(this.Ff,21):this.Ff=Ra(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,23)},set:function(t){t?this.Ff=Oa(this.Ff,23):this.Ff=Ra(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,24)},set:function(t){t?this.Ff=Oa(this.Ff,24):this.Ff=Ra(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,25)},set:function(t){t?this.Ff=Oa(this.Ff,25):this.Ff=Ra(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,26)},set:function(t){t?this.Ff=Oa(this.Ff,26):this.Ff=Ra(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};zs(Hh,Dl);var g_=function(){Hh.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Ta(this.Ff,14)},set:function(e){e?this.Ff=Oa(this.Ff,14):this.Ff=Ra(this.Ff,14)}}),this.password=!0};zs(g_,Hh);var Ct={CheckBox:{createAppearanceStream:function(){return{N:{On:Ct.CheckBox.YesNormal},D:{On:Ct.CheckBox.YesPushDown,Off:Ct.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Yl(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,a=e.scope.__private__.encodeColorString(e.color),i=lT(e,e.caption);return n.push("0.749023 g"),n.push("0 0 "+pn(Ct.internal.getWidth(e))+" "+pn(Ct.internal.getHeight(e))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+pn(i.fontSize)+" Tf "+a),n.push("BT"),n.push(i.text),n.push("ET"),n.push("Q"),n.push("EMC"),t.stream=n.join(`
800`),t},YesNormal:function(e){var t=Yl(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),a=[],i=Ct.internal.getHeight(e),o=Ct.internal.getWidth(e),l=lT(e,e.caption);return a.push("1 g"),a.push("0 0 "+pn(o)+" "+pn(i)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+pn(o-1)+" "+pn(i-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+n+" "+pn(l.fontSize)+" Tf "+r),a.push(l.text),a.push("ET"),a.push("Q"),t.stream=a.join(`
801`),t},OffPushDown:function(e){var t=Yl(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+pn(Ct.internal.getWidth(e))+" "+pn(Ct.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
802`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Ct.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Ct.RadioButton.Circle.YesNormal,t.D[e]=Ct.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Yl(e);t.scope=e.scope;var n=[],r=Ct.internal.getWidth(e)<=Ct.internal.getHeight(e)?Ct.internal.getWidth(e)/4:Ct.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var a=Ct.internal.Bezier_C,i=Number((r*a).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+rd(Ct.internal.getWidth(e)/2)+" "+rd(Ct.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+i+" "+i+" "+r+" 0 "+r+" c"),n.push("-"+i+" "+r+" -"+r+" "+i+" -"+r+" 0 c"),n.push("-"+r+" -"+i+" -"+i+" -"+r+" 0 -"+r+" c"),n.push(i+" -"+r+" "+r+" -"+i+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
803`),t},YesPushDown:function(e){var t=Yl(e);t.scope=e.scope;var n=[],r=Ct.internal.getWidth(e)<=Ct.internal.getHeight(e)?Ct.internal.getWidth(e)/4:Ct.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),i=Number((a*Ct.internal.Bezier_C).toFixed(5)),o=Number((r*Ct.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+rd(Ct.internal.getWidth(e)/2)+" "+rd(Ct.internal.getHeight(e)/2)+" cm"),n.push(a+" 0 m"),n.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),n.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),n.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),n.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+rd(Ct.internal.getWidth(e)/2)+" "+rd(Ct.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
804`),t},OffPushDown:function(e){var t=Yl(e);t.scope=e.scope;var n=[],r=Ct.internal.getWidth(e)<=Ct.internal.getHeight(e)?Ct.internal.getWidth(e)/4:Ct.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),i=Number((a*Ct.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+rd(Ct.internal.getWidth(e)/2)+" "+rd(Ct.internal.getHeight(e)/2)+" cm"),n.push(a+" 0 m"),n.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),n.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),n.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),n.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
805`),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Ct.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Ct.RadioButton.Cross.YesNormal,t.D[e]=Ct.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Yl(e);t.scope=e.scope;var n=[],r=Ct.internal.calculateCross(e);return n.push("q"),n.push("1 1 "+pn(Ct.internal.getWidth(e)-2)+" "+pn(Ct.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(pn(r.x1.x)+" "+pn(r.x1.y)+" m"),n.push(pn(r.x2.x)+" "+pn(r.x2.y)+" l"),n.push(pn(r.x4.x)+" "+pn(r.x4.y)+" m"),n.push(pn(r.x3.x)+" "+pn(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
806`),t},YesPushDown:function(e){var t=Yl(e);t.scope=e.scope;var n=Ct.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+pn(Ct.internal.getWidth(e))+" "+pn(Ct.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+pn(Ct.internal.getWidth(e)-2)+" "+pn(Ct.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(pn(n.x1.x)+" "+pn(n.x1.y)+" m"),r.push(pn(n.x2.x)+" "+pn(n.x2.y)+" l"),r.push(pn(n.x4.x)+" "+pn(n.x4.y)+" m"),r.push(pn(n.x3.x)+" "+pn(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
807`),t},OffPushDown:function(e){var t=Yl(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+pn(Ct.internal.getWidth(e))+" "+pn(Ct.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
808`),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+n}};Ct.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Ct.internal.getWidth(e),n=Ct.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},Ct.internal.getWidth=function(e){var t=0;return br(e)==="object"&&(t=QB(e.Rect[2])),t},Ct.internal.getHeight=function(e){var t=0;return br(e)==="object"&&(t=QB(e.Rect[3])),t};var LYe=ya.addField=function(e){if(IYe(this,e),!(e instanceof Dl))throw new Error("Invalid argument passed to 
808jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};ya.AcroFormChoiceField=lg,ya.AcroFormListBox=cg,ya.AcroFormComboBox=ug,ya.AcroFormEditBox=h_,ya.AcroFormButton=gi,ya.AcroFormPushButton=p_,ya.AcroFormRadioButton=dg,ya.AcroFormCheckBox=m_,ya.AcroFormTextField=Hh,ya.AcroFormPasswordField=g_,ya.AcroFormAppearance=Ct,ya.AcroForm={ChoiceField:lg,ListBox:cg,ComboBox:ug,EditBox:h_,Button:gi,PushButton:p_,RadioButton:dg,CheckBox:m_,TextField:Hh,PasswordField:g_,Appearance:Ct},qt.AcroForm={ChoiceField:lg,ListBox:cg,ComboBox:ug,EditBox:h_,Button:gi,PushButton:p_,RadioButton:dg,CheckBox:m_,TextField:Hh,PasswordField:g_,Appearance:Ct};function $te(e){return e.reduce(function(t,n,r){return t[n]=r,t},{})}(function(e){var t="addImage_";e.__addimage__={};var n="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},a=e.__addimage__.getImageFileTypeByImageData=function(C,I){var D,U,q,Z,H,$=n;if((I=I||n)==="RGBA"||C.data!==void 0&&C.data instanceof Uint8ClampedArray&&"height"in C&&"width"in C)return"RGBA";if(A(C))for(H in r)for(q=r[H],D=0;D<q.length;D+=1){for(Z=!0,U=0;U<q[D].length;U+=1)if(q[D][U]!==void 0&&q[D][U]!==C[U]){Z=!1;break}if(Z===!0){$=H;break}}else for(H in r)for(q=r[H],D=0;D<q.length;D+=1){for(Z=!0,U=0;U<q[D].length;U+=1)if(q[D][U]!==void 0&&q[D][U]!==C.charCodeAt(U)){Z=!1;break}if(Z===!0){$=H;break}}return $===n&&I!==n&&($=I),$},i=function C(I){for(var D=this.internal.write,U=this.internal.putStream,q=(0,this.internal.getFilters)();q.indexOf("FlateEncode")!==-1;)q.splice(q.indexOf("FlateEncode"),1);I.objectId=this.internal.newObject();var Z=[];if(Z.push({key:"Type",value:"/XObject"}),Z.push({key:"Subtype",value:"/Image"}),Z.push({key:"Width",value:I.width}),Z.push({key:"Height",value:I.height}),I.colorSpace===y.INDEXED?Z.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(I.palette.length/3-1)+" "+("sMask"in I&&I.sMask!==void 0?I.objectId+2:I.objectId+1)+" 0 R]"}):(Z.push({key:"ColorSpace",value:"/"+I.colorSpace}),I.colorSpace===y.DEVICE_CMYK&&Z.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),Z.push({key:"BitsPerComponent",value:I.bitsPerComponent}),"decodeParameters"in I&&I.decodeParameters!==void 0&&Z.push({key:"DecodeParms",value:"<<"+I.decodeParameters+">>"}),"transparency"in I&&Array.isArray(I.transparency)&&I.transparency.length>0){for(var H="",$=0,W=I.transparency.length;$<W;$++)H+=I.transparency[$]+" "+I.transparency[$]+" ";Z.push({key:"Mask",value:"["+H+"]"})}I.sMask!==void 0&&Z.push({key:"SMask",value:I.objectId+1+" 0 R"});var ee=I.filter!==void 0?["/"+I.filter]:void 0;if(U({data:I.data,additionalKeyValues:Z,alreadyAppliedFilters:ee,objectId:I.objectId}),D("endobj"),"sMask"in I&&I.sMask!==void 0){var V,O=(V=I.sMaskBitsPerComponent)!==null&&V!==void 0?V:I.bitsPerComponent,M={width:I.width,height:I.height,colorSpace:"DeviceGray",bitsPerComponent:O,data:I.sMask};"filter"in I&&(M.decodeParameters="/Predictor ".concat(I.predictor," /Colors 1 /BitsPerComponent ").concat(O," /Columns ").concat(I.width),M.filter=I.filter),C.call(this,M)}
vendor: 32,070 bytes, lines 808-832
808if(I.colorSpace===y.INDEXED){var B=this.internal.newObject();U({data:k(new Uint8Array(I.palette)),objectId:B}),D("endobj")}},o=function(){var C=this.internal.collections[t+"images"];for(var I in C)i.call(this,C[I])},l=function(){var C,I=this.internal.collections[t+"images"],D=this.internal.write;for(var U in I)D("/I"+(C=I[U]).index,C.objectId,"0","R")},c=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",l))},u=function(){var C=this.internal.collections[t+"images"];return c.call(this),C},d=function(){return Object.keys(this.internal.collections[t+"images"]).length},f=function(C){return typeof e["process"+C.toUpperCase()]=="function"},p=function(C){return br(C)==="object"&&C.nodeType===1},h=function(C,I){if(C.nodeName==="IMG"&&C.hasAttribute("src")){var D=""+C.getAttribute("src");if(D.indexOf("data:image/")===0)return f_(unescape(D).split("base64,").pop());var U=e.loadFile(D,!0);if(U!==void 0)return U}if(C.nodeName==="CANVAS"){if(C.width===0||C.height===0)throw new Error("Given canvas must have data. Canvas width: "+C.width+", height: "+C.height);var q;switch(I){case"PNG":q="image/png";break;case"WEBP":q="image/webp";break;default:q="image/jpeg"}return f_(C.toDataURL(q,1).split("base64,").pop())}},m=function(C){var I=this.internal.collections[t+"images"];if(I){for(var D in I)if(C===I[D].alias)return I[D]}},g=function(C,I,D){return C||I||(C=-96,I=-96),C<0&&(C=-1*D.width*72/C/this.internal.scaleFactor),I<0&&(I=-1*D.height*72/I/this.internal.scaleFactor),C===0&&(C=I*D.width/D.height),I===0&&(I=C*D.height/D.width),[C,I]},v=function(C,I,D,U,q,Z){var H=g.call(this,D,U,q),$=this.internal.getCoordinateString,W=this.internal.getVerticalCoordinateString,ee=u.call(this);if(D=H[0],U=H[1],ee[q.index]=q,Z){Z*=Math.PI/180;var V=Math.cos(Z),O=Math.sin(Z),M=function(G){return G.toFixed(4)},B=[M(V),M(O),M(-1*O),M(V),0,0,"cm"]}this.internal.write("q"),Z?(this.internal.write([1,"0","0",1,$(C),W(I+U),"cm"].join(" ")),this.internal.write(B.join(" ")),this.internal.write([$(D),"0","0",$(U),"0","0","cm"].join(" "))):this.internal.write([$(D),"0","0",$(U),$(C),W(I+U),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+q.index+" Do"),this.internal.write("Q")},y=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var b=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},w=e.__addimage__.sHashCode=function(C){var I,D,U=0;if(typeof C=="string")for(D=C.length,I=0;I<D;I++)U=(U<<5)-U+C.charCodeAt(I),U|=0;else if(A(C))for(D=C.byteLength/2,I=0;I<D;I++)U=(U<<5)-U+C[I],U|=0;return U},j=e.__addimage__.validateStringAsBase64=function(C){(C=C||"").toString().trim();var I=!0;return C.length===0&&(I=!1),C.length%4!=0&&(I=!1),/^[A-Za-z0-9+/]+$/.test(C.substr(0,C.length-2))===!1&&(I=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(C.substr(-2))===!1&&(I=!1),I},S=e.__addimage__.extractImageFromDataUrl=function(C){if(C==null||!(C=C.trim()).startsWith("data:"))return null;var I=C.indexOf(",");return I<0?null:C.substring(0,I).trim().endsWith("base64")?C.substring(I+1):null};e.__addimage__.isArrayBuffer=function(C){return C instanceof ArrayBuffer};var A=e.__addimage__.isArrayBufferView=function(C){return C instanceof Int8Array||C instanceof Uint8Array||C instanceof Uint8ClampedArray||C instanceof Int16Array||C instanceof Uint16Array||C instanceof Int32Array||C instanceof Uint32Array||C instanceof Float32Array||C instanceof Float64Array},E=e.__addimage__.binaryStringToUint8Array=function(C){for(var I=C.length,D=new Uint8Array(I),U=0;U<I;U++)D[U]=C.charCodeAt(U);return D},k=e.__addimage__.arrayBufferToBinaryString=function(C){for(var I="",D=A(C)?C:new Uint8Array(C),U=0;U<D.length;U+=8192)I+=String.fromCharCode.apply(null,D.subarray(U,U+8192));return I};e.addImage=function(){var C,I,D,U,q,Z,H,$,W;if(typeof arguments[1]=="number"?(I=n,D=arguments[1],U=arguments[2],q=arguments[3],Z=arguments[4],H=arguments[5],$=arguments[6],W=arguments[7]):(I=arguments[1],D=arguments[2],U=arguments[3],q=arguments[4],Z=arguments[5],H=arguments[6],$=arguments[7],W=arguments[8]),br(C=arguments[0])==="object"&&!p(C)&&"imageData"in C){var ee=C;C=ee.imageData,I=ee.format||I||n,D=ee.x||D||0,U=ee.y||U||0,q=ee.w||ee.width||q,Z=ee.h||ee.height||Z,H=ee.alias||H,$=ee.compression||$,W=ee.rotation||ee.angle||W}var V=this.internal.getFilters();if($===void 0&&V.indexOf("FlateEncode")!==-1&&($="SLOW"),isNaN(D)||isNaN(U))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var O=P.call(this,C,I,H,$);return v.call(this,D,U,q,Z,O,W),this};var P=function(C,I,D,U){var q,Z,H;if(typeof C=="string"&&a(C)===n){C=unescape(C);var $=R(C,!1);($!==""||($=e.loadFile(C,!0))!==void 0)&&(C=$)}if(p(C)&&(C=h(C,I)),I=a(C,I),!f(I))throw new Error("addImage does not support files of type '"+I+"', please ensure that a plugin for '"+I+"' support is added.");if(((H=D)==null||H.length===0)&&(D=function(W){return typeof W=="string"||A(W)?w(W):A(W.data)?w(W.data):null}(C)),(q=m.call(this,D))||(C instanceof Uint8Array||I==="RGBA"||(Z=C,C=E(C)),q=this["process"+I.toUpperCase()](C,d.call(this),D,function(W){return W&&typeof W=="string"&&(W=W.toUpperCase()),W in e.image_compression?W:b.NONE}(U),Z)),!q)throw new Error("An unknown error occurred whilst processing the image.");return q},R=e.__addimage__.convertBase64ToBinaryString=function(C,I){I=typeof I!="boolean"||I;var D,U="";if(typeof C=="string"){var q;D=(q=S(C))!==null&&q!==void 0?q:C;try{U=f_(D)}catch(Z){if(I)throw j(D)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+Z.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return U};e.getImageProperties=function(C){var I,D,U="";if(p(C)&&(C=h(C)),typeof C=="string"&&a(C)===n&&((U=R(C,!1))===""&&(U=e.loadFile(C)||""),C=U),D=a(C),!f(D))throw new Error("addImage does not support files of type '"+D+"', please ensure that a plugin for '"+D+"' support is added.");if(C instanceof Uint8Array||(C=E(C)),!(I=this["process"+D.toUpperCase()](C)))throw new Error("An unknown error occurred whilst processing the image");return I.fileType=D,I}})(qt.API),function(e){var t=function(n){if(n!==void 0&&n!="")return!0};qt.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(n){for(var r,a,i,o=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(n.objId),u=n.pageContext.annotations,d=!1,f=0;f<u.length&&!d;f++)switch((r=u[f]).type){case"link":(t(r.options.url)||t(r.options.pageNumber))&&(d=!0);break;case"reference":case"text":case"freetext":d=!0}if(d!=0){this.internal.write("/Annots [");for(var p=0;p<u.length;p++){r=u[p];var h=this.internal.pdfEscape,m=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var g=this.internal.newAdditionalObject(),v=this.internal.newAdditionalObject(),y=this.internal.getEncryptor(g.objId),b=r.title||"Note";i="<</Type /Annot /Subtype /Text "+(a="/Rect ["+o(r.bounds.x)+" "+l(r.bounds.y+r.bounds.h)+" "+o(r.bounds.x+r.bounds.w)+" "+l(r.bounds.y)+"] ")+"/Contents ("+h(y(r.contents))+")",i+=" /Popup "+v.objId+" 0 R",i+=" /P "+c.objId+" 0 R",i+=" /T ("+h(y(b))+") >>",g.content=i;var w=g.objId+" 0 R";i="<</Type /Annot /Subtype /Popup "+(a="/Rect ["+o(r.bounds.x+30)+" "+l(r.bounds.y+r.bounds.h)+" "+o(r.bounds.x+r.bounds.w+30)+" "+l(r.bounds.y)+"] ")+" /Parent "+w,r.open&&(i+=" /Open true"),i+=" >>",v.content=i,this.internal.write(g.objId,"0 R",v.objId,"0 R");break;case"freetext":a="/Rect ["+o(r.bounds.x)+" "+l(r.bounds.y)+" "+o(r.bounds.x+r.bounds.w)+" "+l(r.bounds.y+r.bounds.h)+"] ";var j="font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+(r.color||"#000000");i="<</Type /Annot /Subtype /FreeText "+a+"/Contents ("+h(m(r.contents))+")",i+=" /DS("+h(m(j))+")",i+=" /Border [0 0 0]",i+=" >>",this.internal.write(i);break;case"link":if(r.options.name){var S=this.annotations._nameMap[r.options.name];r.options.pageNumber=S.page,r.options.top=S.y}else r.options.top||(r.options.top=0);if(a="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",i="",r.options.url)i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /A <</S /URI /URI ("+h(m(r.options.url))+") >>";else if(r.options.pageNumber)switch(i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":i+=" /Fit]";break;case"FitH":i+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,i+=" /FitV "+r.options.left+"]";break;default:var A=l(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),i+=" /XYZ "+r.options.left+" "+A+" "+r.options.zoom+"]"}i!=""&&(i+=" >>",this.internal.write(i))}}this.internal.write("]")}}]),e.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},e.link=function(n,r,a,i,o){var l=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;l.pageContext.annotations.push({finalBounds:{x:c(n),y:u(r),w:c(n+a),h:u(r+i)},options:o,type:"link"})},e.textWithLink=function(n,r,a,i){var o,l,c=this.getTextWidth(n),u=this.internal.getLineHeight()/this.internal.scaleFactor;if(i.maxWidth!==void 0){l=i.maxWidth;var d=this.splitTextToSize(n,l).length;o=Math.ceil(u*d)}else l=c,o=u;return this.text(n,r,a,i),a+=.2*u,i.align==="center"&&(r-=c/2),i.align==="right"&&(r-=c),this.link(r,a-u,l,o,i),c},e.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}}(qt.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},a=[1570,1571,1573,1575];e.__arabicParser__={};var i=e.__arabicParser__.isInArabicSubstitutionA=function(g){return t[g.charCodeAt(0)]!==void 0},o=e.__arabicParser__.isArabicLetter=function(g){return typeof g=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(g)},l=e.__arabicParser__.isArabicEndLetter=function(g){return o(g)&&i(g)&&t[g.charCodeAt(0)].length<=2},c=e.__arabicParser__.isArabicAlfLetter=function(g){return o(g)&&a.indexOf(g.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(g){return o(g)&&i(g)&&t[g.charCodeAt(0)].length>=1};var u=e.__arabicParser__.arabicLetterHasFinalForm=function(g){return o(g)&&i(g)&&t[g.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(g){return o(g)&&i(g)&&t[g.charCodeAt(0)].length>=3};var d=e.__arabicParser__.arabicLetterHasMedialForm=function(g){return o(g)&&i(g)&&t[g.charCodeAt(0)].length==4},f=e.__arabicParser__.resolveLigatures=function(g){var v=0,y=n,b="",w=0;for(v=0;v<g.length;v+=1)y[g.charCodeAt(v)]!==void 0?(w++,typeof(y=y[g.charCodeAt(v)])=="number"&&(b+=String.fromCharCode(y),y=n,w=0),v===g.length-1&&(y=n,b+=g.charAt(v-(w-1)),v-=w-1,w=0)):(y=n,b+=g.charAt(v-w),v-=w,w=0);return b};e.__arabicParser__.isArabicDiacritic=function(g){return g!==void 0&&r[g.charCodeAt(0)]!==void 0};var p=e.__arabicParser__.getCorrectForm=function(g,v,y){return o(g)?i(g)===!1?-1:!u(g)||!o(v)&&!o(y)||!o(y)&&l(v)||l(g)&&!o(v)||l(g)&&c(v)||l(g)&&l(v)?0:d(g)&&o(v)&&!l(v)&&o(y)&&u(y)?3:l(g)||!o(y)?1:2:-1},h=function(g){var v=0,y=0,b=0,w="",j="",S="",A=(g=g||"").split("\\s+"),E=[];for(v=0;v<A.length;v+=1){for(E.push(""),y=0;y<A[v].length;y+=1)w=A[v][y],j=A[v][y-1],S=A[v][y+1],o(w)?(b=p(w,j,S),E[v]+=b!==-1?String.fromCharCode(t[w.charCodeAt(0)][b]):w):E[v]+=w;E[v]=f(E[v])}return E.join(" ")},m=e.__arabicParser__.processArabic=e.processArabic=function(){var g,v=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,y=[];if(Array.isArray(v)){var b=0;for(y=[],b=0;b<v.length;b+=1)Array.isArray(v[b])?y.push([h(v[b][0]),v[b][1],v[b][2]]):y.push([h(v[b])]);g=y}else g=h(v);return typeof arguments[0]=="string"?g:(arguments[0].text=g,arguments[0])};e.events.push(["preProcessText",m])}(qt.API),qt.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform",e.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})),this},function(e){var t=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(l){n=l}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(l){r=isNaN(l)||Number.isInteger(l)===!1||l<0?150:l,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(l){a=isNaN(l)||Number.isInteger(l)===!1||l<0?300:l,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(l){i=l}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(l){o=l}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(n,r){var a;if((n=n||"2d")!=="2d")return null;for(a in r)this.pdf.context2d.hasOwnProperty(a)&&(this.pdf.context2d[a]=r[a]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(qt.API),function(e){var t={left:0,top:0,bottom:0,right:0},n=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new i,this.internal.__cell__.pages=1},i=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(g){c=g}});var u=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return u},set:function(g){u=g}});var d=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return d},set:function(g){d=g}});var f=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return f},set:function(g){f=g}});var p=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return p},set:function(g){p=g}});var h=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return h},set:function(g){h=g}});var m=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return m},set:function(g){m=g}}),this};i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},i.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(c){return r.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},e.getTextDimensions=function(c,u){r.call(this);var d=(u=u||{}).fontSize||this.getFontSize(),f=u.font||this.getFont(),p=u.scaleFactor||this.internal.scaleFactor,h=0,m=0,g=0,v=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var y=u.maxWidth;y>0?typeof c=="string"?c=this.splitTextToSize(c,y):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(w,j){return w.concat(v.splitTextToSize(j,y))},[])):c=Array.isArray(c)?c:[c];for(var b=0;b<c.length;b++)h<(g=this.getStringUnitWidth(c[b],{font:f})*d)&&(h=g);return h!==0&&(m=c.length),{w:h/=p,h:Math.max((m*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/p,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var c=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new i(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=e.cell=function(){var c;c=arguments[0]instanceof i?arguments[0]:new i(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var u=this.internal.__cell__.lastCell,d=this.internal.__cell__.padding,f=this.internal.__cell__.margins||t,p=this.internal.__cell__.tableHeaderRow,h=this.internal.__cell__.printHeaders;return u.lineNumber!==void 0&&(u.lineNumber===c.lineNumber?(c.x=(u.x||0)+(u.width||0),c.y=u.y||0):u.y+u.height+c.height+f.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=f.top,h&&p&&(this.printHeaderRow(c.lineNumber,!0),c.y+=p[0].height)):c.y=u.y+u.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,n===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-d,c.y+d,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+d,{align:"center",baseline:"top",maxWidth:c.width-d-d}):this.text(c.text,c.x+d,c.y+d,{align:"left",baseline:"top",maxWidth:c.width-d-d})),this.internal.__cell__.lastCell=c,this};e.table=function(c,u,d,f,p){if(r.call(this),!d)throw new Error("No data for PDF table.");var h,m,g,v,y=[],b=[],w=[],j={},S={},A=[],E=[],k=(p=p||{}).autoSize||!1,P=p.printHeaders!==!1,R=p.css&&p.css["font-size"]!==void 0?16*p.css["font-size"]:p.fontSize||12,C=p.margins||Object.assign({width:this.getPageWidth()},t),I=typeof p.padding=="number"?p.padding:3,D=p.headerBackgroundColor||"#c8c8c8",U=p.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=P,this.internal.__cell__.margins=C,this.internal.__cell__.table_font_size=R,this.internal.__cell__.padding=I,this.internal.__cell__.headerBackgroundColor=D,this.internal.__cell__.headerTextColor=U,this.setFontSize(R),f==null)b=y=Object.keys(d[0]),w=y.map(function(){return"left"});else if(Array.isArray(f)&&br(f[0])==="object")for(y=f.map(function(ee){return ee.name}),b=f.map(function(ee){return ee.prompt||ee.name||""}),w=f.map(function(ee){return ee.align||"left"}),h=0;h<f.length;h+=1)S[f[h].name]=.7499990551181103*f[h].width;else Array.isArray(f)&&typeof f[0]=="string"&&(b=y=f,w=y.map(function(){return"left"}));if(k||Array.isArray(f)&&typeof f[0]=="string")for(h=0;h<y.length;h+=1){for(j[v=y[h]]=d.map(function(ee){return ee[v]}),this.setFont(void 0,"bold"),A.push(this.getTextDimensions(b[h],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),m=j[v],this.setFont(void 0,"normal"),g=0;g<m.length;g+=1)A.push(this.getTextDimensions(m[g],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);S[v]=Math.max.apply(null,A)+I+I,A=[]}if(P){var q={};for(h=0;h<y.length;h+=1)q[y[h]]={},q[y[h]].text=b[h],q[y[h]].align=w[h];var Z=l.call(this,q,S);E=y.map(function(ee){return new i(c,u,S[ee],Z,q[ee].text,void 0,q[ee].align)}),this.setTableHeaderRow(E),this.printHeaderRow(1,!1)}var H=f.reduce(function(ee,V){return ee[V.name]=V.align,ee},{});for(h=0;h<d.length;h+=1){"rowStart"in p&&p.rowStart instanceof Function&&p.rowStart({row:h,data:d[h]},this);var $=l.call(this,d[h],S);for(g=0;g<y.length;g+=1){var W=d[h][y[g]];"cellStart"in p&&p.cellStart instanceof Function&&p.cellStart({row:h,col:g,data:W},this),o.call(this,new i(c,u,S[y[g]],$,W,h+2,H[y[g]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=u,this};var l=function(c,u){var d=this.internal.__cell__.padding,f=this.internal.__cell__.table_font_size,p=this.internal.scaleFactor;return Object.keys(c).map(function(h){var m=c[h];return this.splitTextToSize(m.hasOwnProperty("text")?m.text:m,u[h]-d-d)},this).map(function(h){return this.getLineHeightFactor()*h.length*f/p+d+d},this).reduce(function(h,m){return Math.max(h,m)},0)};e.setTableHeaderRow=function(c){r.call(this),this.internal.__cell__.tableHeaderRow=c},e.printHeaderRow=function(c,u){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var d;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var f=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new i(f[0],f[1],f[2],f[3],void 0,-1)}this.setFont(void 0,"bold");for(var p=[],h=0;h<this.internal.__cell__.tableHeaderRow.length;h+=1){d=this.internal.__cell__.tableHeaderRow[h].clone(),u&&(d.y=this.internal.__cell__.margins.top||0,p.push(d)),d.lineNumber=c;var m=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,d),this.setTextColor(m)}p.length>0&&this.setTableHeaderRow(p),this.setFont(void 0,"normal"),n=!1}}(qt.API);var Dte={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Fte=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],cT=$te(Fte),Bte=[100,200,300,400,500,600,700,800,900],MYe=$te(Bte);function qk(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=function(i){return Dte[i=i||"normal"]?i:"normal"}(e.style),r=function(i){return i?typeof i=="number"?i>=100&&i<=900&&i%100==0?i:400:/^\d00$/.test(i)?parseInt(i):i==="bold"?700:400:400}(e.weight),a=function(i){return typeof cT[i=i||"normal"]=="number"?i:"normal"}(e.stretch);return{family:t,style:n,weight:r,stretch:a,src:e.src||[],ref:e.ref||{name:t,style:[a,n,r].join(" ")}}}function e9(e,t,n,r){var a;for(a=n;a>=0&&a<t.length;a+=r)if(e[t[a]])return e[t[a]];for(a=n;a>=0&&a<t.length;a-=r)if(e[t[a]])return e[t[a]]}var $Ye={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},t9={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function n9(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function r9(e){return e.trimLeft()}function DYe(e,t){for(var n=0;n<e.length;){if(e.charAt(n)===t)return[e.substring(0,n),e.substring(n+1)];n+=1}return null}function FYe(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var pm,Rw,a9,i9,s9,Vk=["times"];function o9(e,t,n,r,a){var i=4,o=c9;switch(a){case qt.API.image_compression.FAST:i=1,o=l9;break;case qt.API.image_compression.MEDIUM:i=6,o=u9;break;case qt.API.image_compression.SLOW:i=9,o=d9}e=function(c,u,d,f){for(var p,h=c.length/u,m=new Uint8Array(c.length+h),g=[BYe,l9,c9,u9,d9],v=0;v<h;v+=1){var y=v*u,b=c.subarray(y,y+u);if(f)m.set(f(b,d,p),y+v);else{for(var w=g.length,j=[],S=0;S<w;S+=1)j[S]=g[S](b,d,p);var A=zYe(j.concat());m.set(j[A],y+v)}p=b}return m}(e,t,Math.ceil(n*r/8),o);var l=Z4(e,{level:i});return qt.API.__addimage__.arrayBufferToBinaryString(l)}function BYe(e){var t=Array.apply([],e);return t.unshift(0),t}function l9(e,t){var n=e.length,r=[];r[0]=1;for(var a=0;a<n;a+=1){var i=e[a-t]||0;r[a+1]=e[a]-i+256&255}return r}function c9(e,t,n){var r=e.length,a=[];a[0]=2;for(var i=0;i<r;i+=1){var o=n&&n[i]||0;a[i+1]=e[i]-o+256&255}return a}function u9(e,t,n){var r=e.length,a=[];a[0]=3;for(var i=0;i<r;i+=1){var o=e[i-t]||0,l=n&&n[i]||0;a[i+1]=e[i]+256-(o+l>>>1)&255}return a}function d9(e,t,n){var r=e.length,a=[];a[0]=4;for(var i=0;i<r;i+=1){var o=UYe(e[i-t]||0,n&&n[i]||0,n&&n[i-t]||0);a[i+1]=e[i]-o+256&255}return a}function UYe(e,t,n){if(e===t&&t===n)return e;var r=Math.abs(t-n),a=Math.abs(e-n),i=Math.abs(e+t-n-n);return r<=a&&r<=i?e:a<=i?t:n}function zYe(e){var t=e.map(function(n){return n.reduce(function(r,a){return r+Math.abs(a)},0)});return t.indexOf(Math.min.apply(null,t))}function Hk(e,t,n){var r=t*n,a=Math.floor(r/8),i=16-(r-8*a+n),o=(1<<n)-1;return Ute(e,a)>>i&o}function f9(e,t,n,r){var a=n*r,i=Math.floor(a/8),o=16-(a-8*i+r),l=(1<<r)-1,c=(t&l)<<o;(function(u,d,f){if(d+1<u.byteLength)u.setUint16(d,f,!1);else{var p=f>>8&255;u.setUint8(d,p)}})(e,i,Ute(e,i)&~(l<<o)&65535|c)}function Ute(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function WYe(e){var t=0;if(e[t++]!==71||e[t++]!==73||e[t++]!==70||e[t++]!==56||(e[t++]+1&253)!=56||e[t++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=e[t++]|e[t++]<<8,r=e[t++]|e[t++]<<8,a=e[t++],i=a>>7,o=1<<1+(7&a);e[t++],e[t++];var l=null,c=null;i&&(l=t,c=o,t+=3*o);var u=!0,d=[],f=0,p=null,h=0,m=null;for(this.width=n,this.height=r;u&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(e[t]!==11||e[t+1]==78&&e[t+2]==69&&e[t+3]==84&&e[t+4]==83&&e[t+5]==67&&e[t+6]==65&&e[t+7]==80&&e[t+8]==69&&e[t+9]==50&&e[t+10]==46&&e[t+11]==48&&e[t+12]==3&&e[t+13]==1&&e[t+16]==0)t+=14,m=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((C=e[t++])>=0))throw Error("Invalid block size");if(C===0)break;t+=C}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var g=e[t++];f=e[t++]|e[t++]<<8,p=e[t++],1&g||(p=null),h=g>>2&7,t++;break;case 254:for(;;){if(!((C=e[t++])>=0))throw Error("Invalid block size");if(C===0)break;t+=C}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var v=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,w=e[t++]|e[t++]<<8,j=e[t++],S=j>>6&1,A=1<<1+(7&j),E=l,k=c,P=!1;j>>7&&(P=!0,E=t,k=A,t+=3*A);var R=t;for(t++;;){var C;if(!((C=e[t++])>=0))throw Error("Invalid block size");if(C===0)break;t+=C}d.push({x:v,y,width:b,height:w,has_local_palette:P,palette_offset:E,palette_size:k,data_offset:R,data_length:t-R,transparent_index:p,interlaced:!!S,delay:f,disposal:h});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return d.length},this.loopCount=function(){return m},this.frameInfo=function(I){if(I<0||I>=d.length)throw new Error("Frame index out of range.");return d[I]},this.decodeAndBlitFrameBGRA=function(I,D){var U=this.frameInfo(I),q=U.width*U.height;if(q>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var Z=new Uint8Array(q);h9(e,U.data_offset,Z,q);var H=U.palette_offset,$=U.transparent_index;$===null&&($=256);var W=U.width,ee=n-W,V=W,O=4*(U.y*n+U.x),M=4*((U.y+U.height)*n+U.x),B=O,G=4*ee;U.interlaced===!0&&(G+=4*n*7);for(var te=8,ne=0,ce=Z.length;ne<ce;++ne){var oe=Z[ne];if(V===0&&(V=W,(B+=G)>=M&&(G=4*ee+4*n*(te-1),B=O+(W+ee)*(te<<1),te>>=1)),oe===$)B+=4;else{var X=e[H+3*oe],se=e[H+3*oe+1],Q=e[H+3*oe+2];D[B++]=Q,D[B++]=se,D[B++]=X,D[B++]=255}--V}},this.decodeAndBlitFrameRGBA=function(I,D){var U=this.frameInfo(I),q=U.width*U.height;if(q>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var Z=new Uint8Array(q);h9(e,U.data_offset,Z,q);var H=U.palette_offset,$=U.transparent_index;$===null&&($=256);var W=U.width,ee=n-W,V=W,O=4*(U.y*n+U.x),M=4*((U.y+U.height)*n+U.x),B=O,G=4*ee;U.interlaced===!0&&(G+=4*n*7);for(var te=8,ne=0,ce=Z.length;ne<ce;++ne){var oe=Z[ne];if(V===0&&(V=W,(B+=G)>=M&&(G=4*ee+4*n*(te-1),B=O+(W+ee)*(te<<1),te>>=1)),oe===$)B+=4;else{var X=e[H+3*oe],se=e[H+3*oe+1],Q=e[H+3*oe+2];D[B++]=X,D[B++]=se,D[B++]=Q,D[B++]=255}--V}}}function h9(e,t,n,r){for(var a=e[t++],i=1<<a,o=i+1,l=o+1,c=a+1,u=(1<<c)-1,d=0,f=0,p=0,h=e[t++],m=new Int32Array(4096),g=null;;){for(;d<16&&h!==0;)f|=e[t++]<<d,d+=8,h===1?h=e[t++]:--h;if(d<c)break;var v=f&u;if(f>>=c,d-=c,v!==i){if(v===o)break;for(var y=v<l?v:g,b=0,w=y;w>i;)w=m[w]>>8,++b;var j=w;if(p+b+(y!==v?1:0)>r)return void Cr.log("Warning, gif stream longer than expected.");n[p++]=j;var S=p+=b;for(y!==v&&(n[p++]=j),w=y;b--;)w=m[w],n[--S]=255&w,w>>=8;g!==null&&l<4096&&(m[l++]=g<<8|j,l>=u+1&&c<12&&(++c,u=u<<1|1)),g=v}else l=o+1,u=(1<<(c=a+1))-1,g=null}return p!==r&&Cr.log("Warning, gif stream shorter than expected."),n}/**
809 * @license
810  Copyright (c) 2008, Adobe Systems Incorporated
811  All rights reserved.
812
813  Redistribution and use in source and binary forms, with or without 
814  modification, are permitted provided that the following conditions are
815  met:
816
817  * Redistributions of source code must retain the above copyright notice, 
818    this list of conditions and the following disclaimer.
819  
820  * Redistributions in binary form must reproduce the above copyright
821    notice, this list of conditions and the following disclaimer in the 
822    documentation and/or other materials provided with the distribution.
823  
824  * Neither the name of Adobe Systems Incorporated nor the names of its 
825    contributors may be used to endorse or promote products derived from 
826    this software without specific prior written permission.
827
828  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
829  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
830  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
831  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
832  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
vendor: 5,806 bytes, lines 833-839
833  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
834  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
835  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
836  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
837  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
838  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
839*/function Gk(e){var t,n,r,a,i,o=Math.floor,l=new Array(64),c=new Array(64),u=new Array(64),d=new Array(64),f=new Array(65535),p=new Array(65535),h=new Array(64),m=new Array(64),g=[],v=0,y=7,b=new Array(64),w=new Array(64),j=new Array(64),S=new Array(256),A=new Array(2048),E=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],k=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],P=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],C=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],I=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],D=[0,1,2,3,4,5,6,7,8,9,10,11],U=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],q=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Z(O,M){for(var B=0,G=0,te=new Array,ne=1;ne<=16;ne++){for(var ce=1;ce<=O[ne];ce++)te[M[G]]=[],te[M[G]][0]=B,te[M[G]][1]=ne,G++,B++;B*=2}return te}function H(O){for(var M=O[0],B=O[1]-1;B>=0;)M&1<<B&&(v|=1<<y),B--,--y<0&&(v==255?($(255),$(0)):$(v),y=7,v=0)}function $(O){g.push(O)}function W(O){$(O>>8&255),$(255&O)}function ee(O,M,B,G,te){for(var ne,ce=te[0],oe=te[240],X=function(ve,pe){var Pe,Ee,Ie,Me,tt,De,Qe,vt,ct,ut,Fe=0;for(ct=0;ct<8;++ct){Pe=ve[Fe],Ee=ve[Fe+1],Ie=ve[Fe+2],Me=ve[Fe+3],tt=ve[Fe+4],De=ve[Fe+5],Qe=ve[Fe+6];var It=Pe+(vt=ve[Fe+7]),zt=Pe-vt,Wt=Ee+Qe,Jt=Ee-Qe,Un=Ie+De,Pt=Ie-De,Tn=Me+tt,Lt=Me-tt,Vt=It+Tn,Mn=It-Tn,nn=Wt+Un,yt=Wt-Un;ve[Fe]=Vt+nn,ve[Fe+4]=Vt-nn;var hn=.707106781*(yt+Mn);ve[Fe+2]=Mn+hn,ve[Fe+6]=Mn-hn;var Mt=.382683433*((Vt=Lt+Pt)-(yt=Jt+zt)),Ht=.5411961*Vt+Mt,je=1.306562965*yt+Mt,rt=.707106781*(nn=Pt+Jt),at=zt+rt,xn=zt-rt;ve[Fe+5]=xn+Ht,ve[Fe+3]=xn-Ht,ve[Fe+1]=at+je,ve[Fe+7]=at-je,Fe+=8}for(Fe=0,ct=0;ct<8;++ct){Pe=ve[Fe],Ee=ve[Fe+8],Ie=ve[Fe+16],Me=ve[Fe+24],tt=ve[Fe+32],De=ve[Fe+40],Qe=ve[Fe+48];var sr=Pe+(vt=ve[Fe+56]),Yn=Pe-vt,nr=Ee+Qe,Gt=Ee-Qe,Sn=Ie+De,Zt=Ie-De,_i=Me+tt,ji=Me-tt,Fa=sr+_i,Za=sr-_i,Si=nr+Sn,Ni=nr-Sn;ve[Fe]=Fa+Si,ve[Fe+32]=Fa-Si;var Jr=.707106781*(Ni+Za);ve[Fe+16]=Za+Jr,ve[Fe+48]=Za-Jr;var wo=.382683433*((Fa=ji+Zt)-(Ni=Gt+Yn)),qs=.5411961*Fa+wo,Bl=1.306562965*Ni+wo,Ec=.707106781*(Si=Zt+Gt),Cc=Yn+Ec,Pc=Yn-Ec;ve[Fe+40]=Pc+qs,ve[Fe+24]=Pc-qs,ve[Fe+8]=Cc+Bl,ve[Fe+56]=Cc-Bl,Fe++}for(ct=0;ct<64;++ct)ut=ve[ct]*pe[ct],h[ct]=ut>0?ut+.5|0:ut-.5|0;return h}(O,M),se=0;se<64;++se)m[E[se]]=X[se];var Q=m[0]-B;B=m[0],Q==0?H(G[0]):(H(G[p[ne=32767+Q]]),H(f[ne]));for(var ye=63;ye>0&&m[ye]==0;)ye--;if(ye==0)return H(ce),B;for(var ie,F=1;F<=ye;){for(var me=F;m[F]==0&&F<=ye;)++F;var Ae=F-me;if(Ae>=16){ie=Ae>>4;for(var Ne=1;Ne<=ie;++Ne)H(oe);Ae&=15}ne=32767+m[F],H(te[(Ae<<4)+p[ne]]),H(f[ne]),F++}return ye!=63&&H(ce),B}function V(O){O=Math.min(Math.max(O,1),100),i!=O&&(function(M){for(var B=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],G=0;G<64;G++){var te=o((B[G]*M+50)/100);te=Math.min(Math.max(te,1),255),l[E[G]]=te}for(var ne=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],ce=0;ce<64;ce++){var oe=o((ne[ce]*M+50)/100);oe=Math.min(Math.max(oe,1),255),c[E[ce]]=oe}for(var X=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],se=0,Q=0;Q<8;Q++)for(var ye=0;ye<8;ye++)u[se]=1/(l[E[se]]*X[Q]*X[ye]*8),d[se]=1/(c[E[se]]*X[Q]*X[ye]*8),se++}(O<50?Math.floor(5e3/O):Math.floor(200-2*O)),i=O)}this.encode=function(O,M){M&&V(M),g=new Array,v=0,y=7,W(65496),W(65504),W(16),$(74),$(70),$(73),$(70),$(0),$(1),$(1),$(0),W(1),W(1),$(0),$(0),function(){W(65499),W(132),$(0);for(var Ee=0;Ee<64;Ee++)$(l[Ee]);$(1);for(var Ie=0;Ie<64;Ie++)$(c[Ie])}(),function(Ee,Ie){W(65472),W(17),$(8),W(Ie),W(Ee),$(3),$(1),$(17),$(0),$(2),$(17),$(1),$(3),$(17),$(1)}(O.width,O.height),function(){W(65476),W(418),$(0);for(var Ee=0;Ee<16;Ee++)$(k[Ee+1]);for(var Ie=0;Ie<=11;Ie++)$(P[Ie]);$(16);for(var Me=0;Me<16;Me++)$(R[Me+1]);for(var tt=0;tt<=161;tt++)$(C[tt]);$(1);for(var De=0;De<16;De++)$(I[De+1]);for(var Qe=0;Qe<=11;Qe++)$(D[Qe]);$(17);for(var vt=0;vt<16;vt++)$(U[vt+1]);for(var ct=0;ct<=161;ct++)$(q[ct])}(),W(65498),W(12),$(3),$(1),$(0),$(2),$(17),$(3),$(17),$(0),$(63),$(0);var B=0,G=0,te=0;
vendor: 26,489 bytes, lines 839-845
839v=0,y=7,this.encode.displayName="_encode_";for(var ne,ce,oe,X,se,Q,ye,ie,F,me=O.data,Ae=O.width,Ne=O.height,ve=4*Ae,pe=0;pe<Ne;){for(ne=0;ne<ve;){for(se=ve*pe+ne,ye=-1,ie=0,F=0;F<64;F++)Q=se+(ie=F>>3)*ve+(ye=4*(7&F)),pe+ie>=Ne&&(Q-=ve*(pe+1+ie-Ne)),ne+ye>=ve&&(Q-=ne+ye-ve+4),ce=me[Q++],oe=me[Q++],X=me[Q++],b[F]=(A[ce]+A[oe+256|0]+A[X+512|0]>>16)-128,w[F]=(A[ce+768|0]+A[oe+1024|0]+A[X+1280|0]>>16)-128,j[F]=(A[ce+1280|0]+A[oe+1536|0]+A[X+1792|0]>>16)-128;B=ee(b,u,B,t,r),G=ee(w,d,G,n,a),te=ee(j,d,te,n,a),ne+=32}pe+=8}if(y>=0){var Pe=[];Pe[1]=y+1,Pe[0]=(1<<y+1)-1,H(Pe)}return W(65497),new Uint8Array(g)},e=e||50,function(){for(var O=String.fromCharCode,M=0;M<256;M++)S[M]=O(M)}(),t=Z(k,P),n=Z(I,D),r=Z(R,C),a=Z(U,q),function(){for(var O=1,M=2,B=1;B<=15;B++){for(var G=O;G<M;G++)p[32767+G]=B,f[32767+G]=[],f[32767+G][1]=B,f[32767+G][0]=G;for(var te=-(M-1);te<=-O;te++)p[32767+te]=B,f[32767+te]=[],f[32767+te][1]=B,f[32767+te][0]=M-1+te;O<<=1,M<<=1}}(),function(){for(var O=0;O<256;O++)A[O]=19595*O,A[O+256|0]=38470*O,A[O+512|0]=7471*O+32768,A[O+768|0]=-11059*O,A[O+1024|0]=-21709*O,A[O+1280|0]=32768*O+8421375,A[O+1536|0]=-27439*O,A[O+1792|0]=-5329*O}(),V(e)}/**
840 * @license
841 * Copyright (c) 2017 Aras Abbasi
842 *
843 * Licensed under the MIT License.
844 * http://opensource.org/licenses/mit-license
845 */function ul(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function p9(e){function t(P){if(!P)throw Error("assert :P")}function n(P,R,C){for(var I=0;4>I;I++)if(P[R+I]!=C.charCodeAt(I))return!0;return!1}function r(P,R,C,I,D){for(var U=0;U<D;U++)P[R+U]=C[I+U]}function a(P,R,C,I){for(var D=0;D<I;D++)P[R+D]=C}function i(P){return new Int32Array(P)}function o(P,R){for(var C=[],I=0;I<P;I++)C.push(new R);return C}function l(P,R){var C=[];return function I(D,U,q){for(var Z=q[U],H=0;H<Z&&(D.push(q.length>U+1?[]:new R),!(q.length<U+1));H++)I(D[H],U+1,q)}(C,0,P),C}var c=function(){var P=this;function R(_,N){for(var L=1<<N-1>>>0;_&L;)L>>>=1;return L?(_&L-1)+L:_}function C(_,N,L,z,K){t(!(z%L));do _[N+(z-=L)]=K;while(0<z)}function I(_,N,L,z,K){if(t(2328>=K),512>=K)var J=i(512);else if((J=i(K))==null)return 0;return function(re,ae,le,fe,_e,Oe){var he,Se,Ce=ae,Ue=1<<le,Te=i(16),We=i(16);for(t(_e!=0),t(fe!=null),t(re!=null),t(0<le),Se=0;Se<_e;++Se){if(15<fe[Se])return 0;++Te[fe[Se]]}if(Te[0]==_e)return 0;for(We[1]=0,he=1;15>he;++he){if(Te[he]>1<<he)return 0;We[he+1]=We[he]+Te[he]}for(Se=0;Se<_e;++Se)he=fe[Se],0<fe[Se]&&(Oe[We[he]++]=Se);if(We[15]==1)return(fe=new D).g=0,fe.value=Oe[0],C(re,Ce,1,Ue,fe),Ue;var Ge,it=-1,Xe=Ue-1,Ut=0,kt=1,Nn=1,$t=1<<le;for(Se=0,he=1,_e=2;he<=le;++he,_e<<=1){if(kt+=Nn<<=1,0>(Nn-=Te[he]))return 0;for(;0<Te[he];--Te[he])(fe=new D).g=he,fe.value=Oe[Se++],C(re,Ce+Ut,_e,$t,fe),Ut=R(Ut,he)}for(he=le+1,_e=2;15>=he;++he,_e<<=1){if(kt+=Nn<<=1,0>(Nn-=Te[he]))return 0;for(;0<Te[he];--Te[he]){if(fe=new D,(Ut&Xe)!=it){for(Ce+=$t,Ge=1<<(it=he)-le;15>it&&!(0>=(Ge-=Te[it]));)++it,Ge<<=1;Ue+=$t=1<<(Ge=it-le),re[ae+(it=Ut&Xe)].g=Ge+le,re[ae+it].value=Ce-ae-it}fe.g=he-le,fe.value=Oe[Se++],C(re,Ce+(Ut>>le),_e,$t,fe),Ut=R(Ut,he)}}return kt!=2*We[15]-1?0:Ue}(_,N,L,z,K,J)}function D(){this.value=this.g=0}function U(){this.value=this.g=0}function q(){this.G=o(5,D),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(qp,U)}function Z(_,N,L,z){t(_!=null),t(N!=null),t(2147483648>z),_.Ca=254,_.I=0,_.b=-8,_.Ka=0,_.oa=N,_.pa=L,_.Jd=N,_.Yc=L+z,_.Zc=4<=z?L+z-4+1:L,ce(_)}function H(_,N){for(var L=0;0<N--;)L|=X(_,128)<<N;return L}function $(_,N){var L=H(_,N);return oe(_)?-L:L}function W(_,N,L,z){var K,J=0;for(t(_!=null),t(N!=null),t(4294967288>z),_.Sb=z,_.Ra=0,_.u=0,_.h=0,4<z&&(z=4),K=0;K<z;++K)J+=N[L+K]<<8*K;_.Ra=J,_.bb=z,_.oa=N,_.pa=L}function ee(_){for(;8<=_.u&&_.bb<_.Sb;)_.Ra>>>=8,_.Ra+=_.oa[_.pa+_.bb]<<ts-8>>>0,++_.bb,_.u-=8;G(_)&&(_.h=1,_.u=0)}function V(_,N){if(t(0<=N),!_.h&&N<=dy){var L=B(_)&Bf[N];return _.u+=N,ee(_),L}return _.h=1,_.u=0}function O(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function M(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function B(_){return _.Ra>>>(_.u&ts-1)>>>0}function G(_){return t(_.bb<=_.Sb),_.h||_.bb==_.Sb&&_.u>ts}function te(_,N){_.u=N,_.h=G(_)}function ne(_){_.u>=ws&&(t(_.u>=ws),ee(_))}function ce(_){t(_!=null&&_.oa!=null),_.pa<_.Zc?(_.I=(_.oa[_.pa++]|_.I<<8)>>>0,_.b+=8):(t(_!=null&&_.oa!=null),_.pa<_.Yc?(_.b+=8,_.I=_.oa[_.pa++]|_.I<<8):_.Ka?_.b=0:(_.I<<=8,_.b+=8,_.Ka=1))}function oe(_){return H(_,1)}function X(_,N){var L=_.Ca;0>_.b&&ce(_);var z=_.b,K=L*N>>>8,J=(_.I>>>z>K)+0;for(J?(L-=K,_.I-=K+1<<z>>>0):L=K+1,z=L,K=0;256<=z;)K+=8,z>>=8;return z=7^K+Vp[z],_.b-=z,_.Ca=(L<<z)-1,J}function se(_,N,L){_[N+0]=L>>24&255,_[N+1]=L>>16&255,_[N+2]=L>>8&255,_[N+3]=255&L}function Q(_,N){return _[N+0]|_[N+1]<<8}function ye(_,N){return Q(_,N)|_[N+2]<<16}function ie(_,N){return Q(_,N)|Q(_,N+2)<<16}function F(_,N){var L=1<<N;return t(_!=null),t(0<N),_.X=i(L),_.X==null?0:(_.Mb=32-N,_.Xa=N,1)}function me(_,N){t(_!=null),t(N!=null),t(_.Xa==N.Xa),r(N.X,0,_.X,0,1<<N.Xa)}function Ae(){this.X=[],this.Xa=this.Mb=0}function Ne(_,N,L,z){t(L!=null),t(z!=null);var K=L[0],J=z[0];return K==0&&(K=(_*J+N/2)/N),J==0&&(J=(N*K+_/2)/_),0>=K||0>=J?0:(L[0]=K,z[0]=J,1)}function ve(_,N){return _+(1<<N)-1>>>N}function pe(_,N){return((4278255360&_)+(4278255360&N)>>>0&4278255360)+((16711935&_)+(16711935&N)>>>0&16711935)>>>0}function Pe(_,N){P[N]=function(L,z,K,J,re,ae,le){var fe;for(fe=0;fe<re;++fe){var _e=P[_](ae[le+fe-1],K,J+fe);ae[le+fe]=pe(L[z+fe],_e)}}}function Ee(){this.ud=this.hd=this.jd=0}function Ie(_,N){return((4278124286&(_^N))>>>1)+(_&N)>>>0}function Me(_){return 0<=_&&256>_?_:0>_?0:255<_?255:void 0}function tt(_,N){return Me(_+(_-N+.5>>1))}function De(_,N,L){return Math.abs(N-L)-Math.abs(_-L)}function Qe(_,N,L,z,K,J,re){for(z=J[re-1],L=0;L<K;++L)J[re+L]=z=pe(_[N+L],z)}function vt(_,N,L,z,K){var J;for(J=0;J<L;++J){var re=_[N+J],ae=re>>8&255,le=16711935&(le=(le=16711935&re)+((ae<<16)+ae));z[K+J]=(4278255360&re)+le>>>0}}function ct(_,N){N.jd=255&_,N.hd=_>>8&255,N.ud=_>>16&255}function ut(_,N,L,z,K,J){var re;for(re=0;re<z;++re){var ae=N[L+re],le=ae>>>8,fe=ae,_e=255&(_e=(_e=ae>>>16)+((_.jd<<24>>24)*(le<<24>>24)>>>5));fe=255&(fe=(fe+=(_.hd<<24>>24)*(le<<24>>24)>>>5)+((_.ud<<24>>24)*(_e<<24>>24)>>>5)),K[J+re]=(4278255360&ae)+(_e<<16)+fe}}function Fe(_,N,L,z,K){P[N]=function(J,re,ae,le,fe,_e,Oe,he,Se){for(le=Oe;le<he;++le)for(Oe=0;Oe<Se;++Oe)fe[_e++]=K(ae[z(J[re++])])},P[_]=function(J,re,ae,le,fe,_e,Oe){var he=8>>J.b,Se=J.Ea,Ce=J.K[0],Ue=J.w;if(8>he)for(J=(1<<J.b)-1,Ue=(1<<he)-1;re<ae;++re){var Te,We=0;for(Te=0;Te<Se;++Te)Te&J||(We=z(le[fe++])),_e[Oe++]=K(Ce[We&Ue]),We>>=he}else P["VP8LMapColor"+L](le,fe,Ce,Ue,_e,Oe,re,ae,Se)}}function It(_,N,L,z,K){for(L=N+L;N<L;){var J=_[N++];z[K++]=J>>16&255,z[K++]=J>>8&255,z[K++]=255&J}}function zt(_,N,L,z,K){for(L=N+L;N<L;){var J=_[N++];z[K++]=J>>16&255,z[K++]=J>>8&255,z[K++]=255&J,z[K++]=J>>24&255}}function Wt(_,N,L,z,K){for(L=N+L;N<L;){var J=(re=_[N++])>>16&240|re>>12&15,re=240&re|re>>28&15;z[K++]=J,z[K++]=re}}function Jt(_,N,L,z,K){for(L=N+L;N<L;){var J=(re=_[N++])>>16&248|re>>13&7,re=re>>5&224|re>>3&31;z[K++]=J,z[K++]=re}}function Un(_,N,L,z,K){for(L=N+L;N<L;){var J=_[N++];z[K++]=255&J,z[K++]=J>>8&255,z[K++]=J>>16&255}}function Pt(_,N,L,z,K,J){if(J==0)for(L=N+L;N<L;)se(z,((J=_[N++])[0]>>24|J[1]>>8&65280|J[2]<<8&16711680|J[3]<<24)>>>0),K+=32;else r(z,K,_,N,L)}function Tn(_,N){P[N][0]=P[_+"0"],P[N][1]=P[_+"1"],P[N][2]=P[_+"2"],P[N][3]=P[_+"3"],P[N][4]=P[_+"4"],P[N][5]=P[_+"5"],P[N][6]=P[_+"6"],P[N][7]=P[_+"7"],P[N][8]=P[_+"8"],P[N][9]=P[_+"9"],P[N][10]=P[_+"10"],P[N][11]=P[_+"11"],P[N][12]=P[_+"12"],P[N][13]=P[_+"13"],P[N][14]=P[_+"0"],P[N][15]=P[_+"0"]}function Lt(_){return _==v5||_==y5||_==h1||_==x5}function Vt(){this.eb=[],this.size=this.A=this.fb=0}function Mn(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function nn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Vt,this.f.kb=new Mn,this.sd=null}function yt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function hn(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Mt(_){return alert("todo:WebPSamplerProcessPlane"),_.T}function Ht(_,N){var L=_.T,z=N.ba.f.RGBA,K=z.eb,J=z.fb+_.ka*z.A,re=So[N.ba.S],ae=_.y,le=_.O,fe=_.f,_e=_.N,Oe=_.ea,he=_.W,Se=N.cc,Ce=N.dc,Ue=N.Mc,Te=N.Nc,We=_.ka,Ge=_.ka+_.T,it=_.U,Xe=it+1>>1;for(We==0?re(ae,le,null,null,fe,_e,Oe,he,fe,_e,Oe,he,K,J,null,null,it):(re(N.ec,N.fc,ae,le,Se,Ce,Ue,Te,fe,_e,Oe,he,K,J-z.A,K,J,it),++L);We+2<Ge;We+=2)Se=fe,Ce=_e,Ue=Oe,Te=he,_e+=_.Rc,he+=_.Rc,J+=2*z.A,re(ae,(le+=2*_.fa)-_.fa,ae,le,Se,Ce,Ue,Te,fe,_e,Oe,he,K,J-z.A,K,J,it);return le+=_.fa,_.j+Ge<_.o?(r(N.ec,N.fc,ae,le,it),r(N.cc,N.dc,fe,_e,Xe),r(N.Mc,N.Nc,Oe,he,Xe),L--):1&Ge||re(ae,le,null,null,fe,_e,Oe,he,fe,_e,Oe,he,K,J+z.A,null,null,it),L}function je(_,N,L){var z=_.F,K=[_.J];if(z!=null){var J=_.U,re=N.ba.S,ae=re==f1||re==h1;N=N.ba.f.RGBA;var le=[0],fe=_.ka;le[0]=_.T,_.Kb&&(fe==0?--le[0]:(--fe,K[0]-=_.width),_.j+_.ka+_.T==_.o&&(le[0]=_.o-_.j-fe));var _e=N.eb;fe=N.fb+fe*N.A,_=MI(z,K[0],_.width,J,le,_e,fe+(ae?0:3),N.A),t(L==le),_&&Lt(re)&&my(_e,fe,ae,J,le,N.A)}return 0}function rt(_){var N=_.ma,L=N.ba.S,z=11>L,K=L==u1||L==d1||L==f1||L==g5||L==12||Lt(L);if(N.memory=null,N.Ib=null,N.Jb=null,N.Nd=null,!_o(N.Oa,_,K?11:12))return 0;if(K&&Lt(L)&&Lc(),_.da)alert("todo:use_scaling");else{if(z){if(N.Ib=Mt,_.Kb){if(L=_.U+1>>1,N.memory=i(_.U+2*L),N.memory==null)return 0;N.ec=N.memory,N.fc=0,N.cc=N.ec,N.dc=N.fc+_.U,N.Mc=N.cc,N.Nc=N.dc+L,N.Ib=Ht,Lc()}}else alert("todo:EmitYUV");K&&(N.Jb=je,z&&sa())}if(z&&!QI){for(_=0;256>_;++_)nre[_]=89858*(_-128)+m1>>p1,ire[_]=-22014*(_-128)+m1,are[_]=-45773*(_-128),rre[_]=113618*(_-128)+m1>>p1;for(_=vy;_<_5;++_)N=76283*(_-16)+m1>>p1,sre[_-vy]=rr(N,255),ore[_-vy]=rr(N+8>>4,15);QI=1}return 1}function at(_){var N=_.ma,L=_.U,z=_.T;return t(!(1&_.ka)),0>=L||0>=z?0:(L=N.Ib(_,N),N.Jb!=null&&N.Jb(_,N,L),N.Dc+=L,1)}function xn(_){_.ma.memory=null}function sr(_,N,L,z){return V(_,8)!=47?0:(N[0]=V(_,14)+1,L[0]=V(_,14)+1,z[0]=V(_,1),V(_,3)!=0?0:!_.h)}function Yn(_,N){if(4>_)return _+1;var L=_-2>>1;return(2+(1&_)<<L)+V(N,L)+1}function nr(_,N){return 120<N?N-120:1<=(L=((L=zne[N-1])>>4)*_+(8-(15&L)))?L:1;var L}function Gt(_,N,L){var z=B(L),K=_[N+=255&z].g-8;return 0<K&&(te(L,L.u+8),z=B(L),N+=_[N].value,N+=z&(1<<K)-1),te(L,L.u+_[N].g),_[N].value}function Sn(_,N,L){return L.g+=_.g,L.value+=_.value<<N>>>0,t(8>=L.g),_.g}function Zt(_,N,L){var z=_.xc;return t((N=z==0?0:_.vc[_.md*(L>>z)+(N>>z)])<_.Wb),_.Ya[N]}function _i(_,N,L,z){var K=_.ab,J=_.c*N,re=_.C;N=re+N;var ae=L,le=z;for(z=_.Ta,L=_.Ua;0<K--;){var fe=_.gc[K],_e=re,Oe=N,he=ae,Se=le,Ce=(le=z,ae=L,fe.Ea);switch(t(_e<Oe),t(Oe<=fe.nc),fe.hc){case 2:Hp(he,Se,(Oe-_e)*Ce,le,ae);break;case 0:var Ue=_e,Te=Oe,We=le,Ge=ae,it=($t=fe).Ea;Ue==0&&(Uu(he,Se,null,null,1,We,Ge),Qe(he,Se+1,0,0,it-1,We,Ge+1),Se+=it,Ge+=it,++Ue);for(var Xe=1<<$t.b,Ut=Xe-1,kt=ve(it,$t.b),Nn=$t.K,$t=$t.w+(Ue>>$t.b)*kt;Ue<Te;){var Vn=Nn,Qa=$t,An=1;for(zu(he,Se,We,Ge-it,1,We,Ge);An<it;){var Dt=(An&~Ut)+Xe;Dt>it&&(Dt=it),(0,rl[Vn[Qa++]>>8&15])(he,Se+ +An,We,Ge+An-it,Dt-An,We,Ge+An),An=Dt}Se+=it,Ge+=it,++Ue&Ut||($t+=kt)}Oe!=fe.nc&&r(le,ae-Ce,le,ae+(Oe-_e-1)*Ce,Ce);break;case 1:for(Ce=he,Te=Se,it=(he=fe.Ea)-(Ge=he&~(We=(Se=1<<fe.b)-1)),Ue=ve(he,fe.b),Xe=fe.K,fe=fe.w+(_e>>fe.b)*Ue;_e<Oe;){for(Ut=Xe,kt=fe,Nn=new Ee,$t=Te+Ge,Vn=Te+he;Te<$t;)ct(Ut[kt++],Nn),zf(Nn,Ce,Te,Se,le,ae),Te+=Se,ae+=Se;Te<Vn&&(ct(Ut[kt++],Nn),zf(Nn,Ce,Te,it,le,ae),Te+=it,ae+=it),++_e&We||(fe+=Ue)}break;case 3:if(he==le&&Se==ae&&0<fe.b){for(Te=le,he=Ce=ae+(Oe-_e)*Ce-(Ge=(Oe-_e)*ve(fe.Ea,fe.b)),Se=le,We=ae,Ue=[],Ge=(it=Ge)-1;0<=Ge;--Ge)Ue[Ge]=Se[We+Ge];for(Ge=it-1;0<=Ge;--Ge)Te[he+Ge]=Ue[Ge];Uf(fe,_e,Oe,le,Ce,le,ae)}else Uf(fe,_e,Oe,he,Se,le,ae)}ae=z,le=L}le!=L&&r(z,L,ae,le,J)}function ji(_,N){var L=_.V,z=_.Ba+_.c*_.C,K=N-_.C;if(t(N<=_.l.o),t(16>=K),0<K){var J=_.l,re=_.Ta,ae=_.Ua,le=J.width;if(_i(_,K,L,z),K=ae=[ae],t((L=_.C)<(z=N)),t(J.v<J.va),z>J.o&&(z=J.o),L<J.j){var fe=J.j-L;L=J.j,K[0]+=fe*le}if(L>=z?L=0:(K[0]+=4*J.v,J.ka=L-J.j,J.U=J.va-J.v,J.T=z-L,L=1),L){if(ae=ae[0],11>(L=_.ca).S){var _e=L.f.RGBA,Oe=(z=L.S,K=J.U,J=J.T,fe=_e.eb,_e.A),he=J;for(_e=_e.fb+_.Ma*_e.A;0<he--;){var Se=re,Ce=ae,Ue=K,Te=fe,We=_e;switch(z){case c1:fy(Se,Ce,Ue,Te,We);break;case u1:hy(Se,Ce,Ue,Te,We);break;case v5:hy(Se,Ce,Ue,Te,We),my(Te,We,0,Ue,1,0);break;case WI:qf(Se,Ce,Ue,Te,We);break;case d1:Pt(Se,Ce,Ue,Te,We,1);break;case y5:Pt(Se,Ce,Ue,Te,We,1),my(Te,We,0,Ue,1,0);break;case f1:Pt(Se,Ce,Ue,Te,We,0);break;case h1:Pt(Se,Ce,Ue,Te,We,0),my(Te,We,1,Ue,1,0);break;case g5:Gp(Se,Ce,Ue,Te,We);break;case x5:Gp(Se,Ce,Ue,Te,We),LI(Te,We,Ue,1,0);break;case qI:Wf(Se,Ce,Ue,Te,We);break;default:t(0)}ae+=le,_e+=Oe}_.Ma+=J}else alert("todo:EmitRescaledRowsYUVA");t(_.Ma<=L.height)}}_.C=N,t(_.C<=_.i)}function Fa(_){var N;if(0<_.ua)return 0;for(N=0;N<_.Wb;++N){var L=_.Ya[N].G,z=_.Ya[N].H;if(0<L[1][z[1]+0].g||0<L[2][z[2]+0].g||0<L[3][z[3]+0].g)return 0}return 1}function Za(_,N,L,z,K,J){if(_.Z!=0){var re=_.qd,ae=_.rd;for(t(Hu[_.Z]!=null);N<L;++N)Hu[_.Z](re,ae,z,K,z,K,J),re=z,ae=K,K+=J;_.qd=re,_.rd=ae}}function Si(_,N){var L=_.l.ma,z=L.Z==0||L.Z==1?_.l.j:_.C;if(z=_.C<z?z:_.C,t(N<=_.l.o),N>z){var K=_.l.width,J=L.ca,re=L.tb+K*z,ae=_.V,le=_.Ba+_.c*z,fe=_.gc;t(_.ab==1),t(fe[0].hc==3),p5(fe[0],z,N,ae,le,J,re),Za(L,z,N,J,re,K)}_.C=_.Ma=N}function Ni(_,N,L,z,K,J,re){var ae=_.$/z,le=_.$%z,fe=_.m,_e=_.s,Oe=L+_.$,he=Oe;K=L+z*K;var Se=L+z*J,Ce=280+_e.ua,Ue=_.Pb?ae:16777216,Te=0<_e.ua?_e.Wa:null,We=_e.wc,Ge=Oe<Se?Zt(_e,le,ae):null;t(_.C<J),t(Se<=K);var it=!1;e:for(;;){for(;it||Oe<Se;){var Xe=0;if(ae>=Ue){var Ut=Oe-L;t((Ue=_).Pb),Ue.wd=Ue.m,Ue.xd=Ut,0<Ue.s.ua&&me(Ue.s.Wa,Ue.s.vb),Ue=ae+qne}if(le&We||(Ge=Zt(_e,le,ae)),t(Ge!=null),Ge.Qb&&(N[Oe]=Ge.qb,it=!0),!it)if(ne(fe),Ge.jc){Xe=fe,Ut=N;var kt=Oe,Nn=Ge.pd[B(Xe)&qp-1];t(Ge.jc),256>Nn.g?(te(Xe,Xe.u+Nn.g),Ut[kt]=Nn.value,Xe=0):(te(Xe,Xe.u+Nn.g-256),t(256<=Nn.value),Xe=Nn.value),Xe==0&&(it=!0)}else Xe=Gt(Ge.G[0],Ge.H[0],fe);if(fe.h)break;if(it||256>Xe){if(!it)if(Ge.nd)N[Oe]=(Ge.qb|Xe<<8)>>>0;else{if(ne(fe),it=Gt(Ge.G[1],Ge.H[1],fe),ne(fe),Ut=Gt(Ge.G[2],Ge.H[2],fe),kt=Gt(Ge.G[3],Ge.H[3],fe),fe.h)break;N[Oe]=(kt<<24|it<<16|Xe<<8|Ut)>>>0}if(it=!1,++Oe,++le>=z&&(le=0,++ae,re!=null&&ae<=J&&!(ae%16)&&re(_,ae),Te!=null))for(;he<Oe;)Xe=N[he++],Te.X[(506832829*Xe&4294967295)>>>Te.Mb]=Xe}else if(280>Xe){if(Xe=Yn(Xe-256,fe),Ut=Gt(Ge.G[4],Ge.H[4],fe),ne(fe),Ut=nr(z,Ut=Yn(Ut,fe)),fe.h)break;if(Oe-L<Ut||K-Oe<Xe)break e;for(kt=0;kt<Xe;++kt)N[Oe+kt]=N[Oe+kt-Ut];for(Oe+=Xe,le+=Xe;le>=z;)le-=z,++ae,re!=null&&ae<=J&&!(ae%16)&&re(_,ae);if(t(Oe<=K),le&We&&(Ge=Zt(_e,le,ae)),Te!=null)for(;he<Oe;)Xe=N[he++],Te.X[(506832829*Xe&4294967295)>>>Te.Mb]=Xe}else{if(!(Xe<Ce))break e;for(it=Xe-280,t(Te!=null);he<Oe;)Xe=N[he++],Te.X[(506832829*Xe&4294967295)>>>Te.Mb]=Xe;Xe=Oe,t(!(it>>>(Ut=Te).Xa)),N[Xe]=Ut.X[it],it=!0}it||t(fe.h==G(fe))}if(_.Pb&&fe.h&&Oe<K)t(_.m.h),_.a=5,_.m=_.wd,_.$=_.xd,0<_.s.ua&&me(_.s.vb,_.s.Wa);else{if(fe.h)break e;re!=null&&re(_,ae>J?J:ae),_.a=0,_.$=Oe-L}return 1}return _.a=3,0}function Jr(_){t(_!=null),_.vc=null,_.yc=null,_.Ya=null;var N=_.Wa;N!=null&&(N.X=null),_.vb=null,t(_!=null)}function wo(){var _=new Ot;return _==null?null:(_.a=0,_.xb=GI,Tn("Predictor","VP8LPredictors"),Tn("Predictor","VP8LPredictors_C"),Tn("PredictorAdd","VP8LPredictorsAdd"),Tn("PredictorAdd","VP8LPredictorsAdd_C"),Hp=vt,zf=ut,fy=It,hy=zt,Gp=Wt,Wf=Jt,qf=Un,P.VP8LMapColor32b=za,P.VP8LMapColor8b=ql,_)}function qs(_,N,L,z,K){var J=1,re=[_],ae=[N],le=z.m,fe=z.s,_e=null,Oe=0;e:for(;;){if(L)for(;J&&V(le,1);){var he=re,Se=ae,Ce=z,Ue=1,Te=Ce.m,We=Ce.gc[Ce.ab],Ge=V(Te,2);if(Ce.Oc&1<<Ge)J=0;else{switch(Ce.Oc|=1<<Ge,We.hc=Ge,We.Ea=he[0],We.nc=Se[0],We.K=[null],++Ce.ab,t(4>=Ce.ab),Ge){case 0:case 1:We.b=V(Te,3)+2,Ue=qs(ve(We.Ea,We.b),ve(We.nc,We.b),0,Ce,We.K),We.K=We.K[0];break;case 3:var it,Xe=V(Te,8)+1,Ut=16<Xe?0:4<Xe?1:2<Xe?2:3;if(he[0]=ve(We.Ea,Ut),We.b=Ut,it=Ue=qs(Xe,1,0,Ce,We.K)){var kt,Nn=Xe,$t=We,Vn=1<<(8>>$t.b),Qa=i(Vn);if(Qa==null)it=0;else{var An=$t.K[0],Dt=$t.w;for(Qa[0]=$t.K[0][0],kt=1;kt<1*Nn;++kt)Qa[kt]=pe(An[Dt+kt],Qa[kt-1]);for(;kt<4*Vn;++kt)Qa[kt]=0;$t.K[0]=null,$t.K[0]=Qa,it=1}}Ue=it;break;case 2:break;default:t(0)}J=Ue}}if(re=re[0],ae=ae[0],J&&V(le,1)&&!(J=1<=(Oe=V(le,4))&&11>=Oe)){z.a=3;break e}var mt;if(mt=J)t:{var Aa,wn,Zn,Wr=z,Ai=re,ns=ae,ma=Oe,Bi=L,rs=Wr.m,ei=Wr.s,Jn=[null],gr=1,ga=0,vr=Wne[ma];n:for(;;){if(Bi&&V(rs,1)){var ki=V(rs,3)+2,il=ve(Ai,ki),ka=ve(ns,ki),_s=il*ka;if(!qs(il,ka,0,Wr,Jn))break n;for(Jn=Jn[0],ei.xc=ki,Aa=0;Aa<_s;++Aa){var Er=Jn[Aa]>>8&65535;Jn[Aa]=Er,Er>=gr&&(gr=Er+1)}}if(rs.h)break n;for(wn=0;5>wn;++wn){var ti=VI[wn];!wn&&0<ma&&(ti+=1<<ma),ga<ti&&(ga=ti)}var Hs=o(gr*vr,D),as=gr,Gs=o(as,q);if(Gs==null)var Ys=null;else t(65536>=as),Ys=Gs;var js=i(ga);if(Ys==null||js==null||Hs==null){Wr.a=1;break n}var Ks=Hs;for(Aa=Zn=0;Aa<gr;++Aa){var Lr=Ys[Aa],Zs=Lr.G,sl=Lr.H,Vf=0,Fc=1,Ei=0;for(wn=0;5>wn;++wn){ti=VI[wn],Zs[wn]=Ks,sl[wn]=Zn,!wn&&0<ma&&(ti+=1<<ma);a:{var v1,j5=ti,y1=Wr,yy=js,ure=Ks,dre=Zn,S5=0,Gu=y1.m,fre=V(Gu,1);if(a(yy,0,0,j5),fre){var hre=V(Gu,1)+1,pre=V(Gu,1),n6=V(Gu,pre==0?1:8);yy[n6]=1,hre==2&&(yy[n6=V(Gu,8)]=1);var x1=1}else{var r6=i(19),a6=V(Gu,4)+4;if(19<a6){y1.a=3;var b1=0;break a}for(v1=0;v1<a6;++v1)r6[Une[v1]]=V(Gu,3);var N5=void 0,xy=void 0,i6=y1,mre=r6,w1=j5,s6=yy,A5=0,Yu=i6.m,o6=8,l6=o(128,D);r:for(;I(l6,0,7,mre,19);){if(V(Yu,1)){var gre=2+2*V(Yu,3);if((N5=2+V(Yu,gre))>w1)break r}else N5=w1;for(xy=0;xy<w1&&N5--;){ne(Yu);var c6=l6[0+(127&B(Yu))];te(Yu,Yu.u+c6.g);var Zp=c6.value;if(16>Zp)s6[xy++]=Zp,Zp!=0&&(o6=Zp);else{var vre=Zp==16,u6=Zp-16,yre=Fne[u6],d6=V(Yu,Dne[u6])+yre;if(xy+d6>w1)break r;for(var xre=vre?o6:0;0<d6--;)s6[xy++]=xre}}A5=1;break r}A5||(i6.a=3),x1=A5}(x1=x1&&!Gu.h)&&(S5=I(ure,dre,8,yy,j5)),x1&&S5!=0?b1=S5:(y1.a=3,b1=0)}if(b1==0)break n;if(Fc&&Bne[wn]==1&&(Fc=Ks[Zn].g==0),Vf+=Ks[Zn].g,Zn+=b1,3>=wn){var by,k5=js[0];for(by=1;by<ti;++by)js[by]>k5&&(k5=js[by]);Ei+=k5}}if(Lr.nd=Fc,Lr.Qb=0,Fc&&(Lr.qb=(Zs[3][sl[3]+0].value<<24|Zs[1][sl[1]+0].value<<16|Zs[2][sl[2]+0].value)>>>0,Vf==0&&256>Zs[0][sl[0]+0].value&&(Lr.Qb=1,Lr.qb+=Zs[0][sl[0]+0].value<<8)),Lr.jc=!Lr.Qb&&6>Ei,Lr.jc){var _1,Bc=Lr;for(_1=0;_1<qp;++_1){var Ku=_1,Zu=Bc.pd[Ku],j1=Bc.G[0][Bc.H[0]+Ku];256<=j1.value?(Zu.g=j1.g+256,Zu.value=j1.value):(Zu.g=0,Zu.value=0,Ku>>=Sn(j1,8,Zu),Ku>>=Sn(Bc.G[1][Bc.H[1]+Ku],16,Zu),Ku>>=Sn(Bc.G[2][Bc.H[2]+Ku],0,Zu),Sn(Bc.G[3][Bc.H[3]+Ku],24,Zu))}}}ei.vc=Jn,ei.Wb=gr,ei.Ya=Ys,ei.yc=Hs,mt=1;break t}mt=0}if(!(J=mt)){z.a=3;break e}if(0<Oe){if(fe.ua=1<<Oe,!F(fe.Wa,Oe)){z.a=1,J=0;break e}}else fe.ua=0;var E5=z,f6=re,bre=ae,C5=E5.s,P5=C5.xc;if(E5.c=f6,E5.i=bre,C5.md=ve(f6,P5),C5.wc=P5==0?-1:(1<<P5)-1,L){z.xb=Xne;break e}if((_e=i(re*ae))==null){z.a=1,J=0;break e}J=(J=Ni(z,_e,0,re,ae,ae,null))&&!le.h;break e}return J?(K!=null?K[0]=_e:(t(_e==null),t(L)),z.$=0,L||Jr(fe)):Jr(fe),J}function Bl(_,N){var L=_.c*_.i,z=L+N+16*N;return t(_.c<=N),_.V=i(z),_.V==null?(_.Ta=null,_.Ua=0,_.a=1,0):(_.Ta=_.V,_.Ua=_.Ba+L+N,1)}function Ec(_,N){var L=_.C,z=N-L,K=_.V,J=_.Ba+_.c*L;for(t(N<=_.l.o);0<z;){var re=16<z?16:z,ae=_.l.ma,le=_.l.width,fe=le*re,_e=ae.ca,Oe=ae.tb+le*L,he=_.Ta,Se=_.Ua;_i(_,re,K,J),$I(he,Se,_e,Oe,fe),Za(ae,L,L+re,_e,Oe,le),z-=re,K+=re*_.c,L+=re}t(L==N),_.C=_.Ma=N}function Cc(){this.ub=this.yd=this.td=this.Rb=0}function Pc(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Ip(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function Mu(){this.Yb=function(){var _=[];return function N(L,z,K){for(var J=K[z],re=0;re<J&&(L.push(K.length>z+1?[]:0),!(K.length<z+1));re++)N(L[re],z+1,K)}(_,0,[3,11]),_}()}function Pf(){this.jb=i(3),this.Wc=l([4,8],Mu),this.Xc=l([4,17],Mu)}function ge(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function Le(){this.ld=this.La=this.dd=this.tc=0}function nt(){this.Na=this.la=0}function Ke(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function st(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Yt(){this.uc=this.M=this.Nb=0,this.wa=Array(new Le),this.Y=0,this.ya=Array(new st),this.aa=0,this.l=new dr}function or(){this.y=i(16),this.f=i(8),this.ea=i(8)}function Sa(){this.cb=this.a=0,this.sc="",this.m=new O,this.Od=new Cc,this.Kc=new Pc,this.ed=new ge,this.Qa=new Ip,this.Ic=this.$c=this.Aa=0,this.D=new Yt,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,O),this.ia=0,this.pb=o(4,Ke),this.Pa=new Pf,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new or),this.Hd=0,this.rb=Array(new nt),this.sb=0,this.wa=Array(new Le),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new st),this.L=this.aa=0,this.gd=l([4,2],Le),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function rr(_,N){return 0>_?0:_>N?N:_}function dr(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function aa(){var _=new Sa;return _!=null&&(_.a=0,_.sc="OK",_.cb=0,_.Xb=0,gy||(gy=$n)),_}function zn(_,N,L){return _.a==0&&(_.a=N,_.sc=L,_.cb=0),0}function Wn(_,N,L){return 3<=L&&_[N+0]==157&&_[N+1]==1&&_[N+2]==42}function Ba(_,N){if(_==null)return 0;if(_.a=0,_.sc="OK",N==null)return zn(_,2,"null VP8Io passed to VP8GetHeaders()");var L=N.data,z=N.w,K=N.ha;if(4>K)return zn(_,7,"Truncated header.");var J=L[z+0]|L[z+1]<<8|L[z+2]<<16,re=_.Od;if(re.Rb=!(1&J),re.td=J>>1&7,re.yd=J>>4&1,re.ub=J>>5,3<re.td)return zn(_,3,"Incorrect keyframe parameters.");if(!re.yd)return zn(_,4,"Frame not displayable.");z+=3,K-=3;var ae=_.Kc;if(re.Rb){if(7>K)return zn(_,7,"cannot parse picture header");if(!Wn(L,z,K))return zn(_,3,"Bad code word");ae.c=16383&(L[z+4]<<8|L[z+3]),ae.Td=L[z+4]>>6,ae.i=16383&(L[z+6]<<8|L[z+5]),ae.Ud=L[z+6]>>6,z+=7,K-=7,_.za=ae.c+15>>4,_.Ub=ae.i+15>>4,N.width=ae.c,N.height=ae.i,N.Da=0,N.j=0,N.v=0,N.va=N.width,N.o=N.height,N.da=0,N.ib=N.width,N.hb=N.height,N.U=N.width,N.T=N.height,a((J=_.Pa).jb,0,255,J.jb.length),t((J=_.Qa)!=null),J.Cb=0,J.Bb=0,J.Fb=1,a(J.Zb,0,0,J.Zb.length),a(J.Lb,0,0,J.Lb)}if(re.ub>K)return zn(_,7,"bad partition length");Z(J=_.m,L,z,re.ub),z+=re.ub,K-=re.ub,re.Rb&&(ae.Ld=oe(J),ae.Kd=oe(J)),ae=_.Qa;var le,fe=_.Pa;if(t(J!=null),t(ae!=null),ae.Cb=oe(J),ae.Cb){if(ae.Bb=oe(J),oe(J)){for(ae.Fb=oe(J),le=0;4>le;++le)ae.Zb[le]=oe(J)?$(J,7):0;for(le=0;4>le;++le)ae.Lb[le]=oe(J)?$(J,6):0}if(ae.Bb)for(le=0;3>le;++le)fe.jb[le]=oe(J)?H(J,8):255}else ae.Bb=0;if(J.Ka)return zn(_,3,"cannot parse segment header");if((ae=_.ed).zd=oe(J),ae.Tb=H(J,6),ae.wb=H(J,3),ae.Pc=oe(J),ae.Pc&&oe(J)){for(fe=0;4>fe;++fe)oe(J)&&(ae.vd[fe]=$(J,6));for(fe=0;4>fe;++fe)oe(J)&&(ae.od[fe]=$(J,6))}if(_.L=ae.Tb==0?0:ae.zd?1:2,J.Ka)return zn(_,3,"cannot parse filter header");var _e=K;if(K=le=z,z=le+_e,ae=_e,_.Xb=(1<<H(_.m,2))-1,_e<3*(fe=_.Xb))L=7;else{for(le+=3*fe,ae-=3*fe,_e=0;_e<fe;++_e){var Oe=L[K+0]|L[K+1]<<8|L[K+2]<<16;Oe>ae&&(Oe=ae),Z(_.Jc[+_e],L,le,Oe),le+=Oe,ae-=Oe,K+=3}Z(_.Jc[+fe],L,le,ae),L=le<z?0:5}if(L!=0)return zn(_,L,"cannot parse partitions");for(L=H(le=_.m,7),K=oe(le)?$(le,4):0,z=oe(le)?$(le,4):0,ae=oe(le)?$(le,4):0,fe=oe(le)?$(le,4):0,le=oe(le)?$(le,4):0,_e=_.Qa,Oe=0;4>Oe;++Oe){if(_e.Cb){var he=_e.Zb[Oe];_e.Fb||(he+=L)}else{if(0<Oe){_.pb[Oe]=_.pb[0];continue}he=L}var Se=_.pb[Oe];Se.Sc[0]=b5[rr(he+K,127)],Se.Sc[1]=w5[rr(he+0,127)],Se.Eb[0]=2*b5[rr(he+z,127)],Se.Eb[1]=101581*w5[rr(he+ae,127)]>>16,8>Se.Eb[1]&&(Se.Eb[1]=8),Se.Qc[0]=b5[rr(he+fe,117)],Se.Qc[1]=w5[rr(he+le,127)],Se.lc=he+le}if(!re.Rb)return zn(_,4,"Not a key frame.");for(oe(J),re=_.Pa,L=0;4>L;++L){for(K=0;8>K;++K)for(z=0;3>z;++z)for(ae=0;11>ae;++ae)fe=X(J,Kne[L][K][z][ae])?H(J,8):Gne[L][K][z][ae],re.Wc[L][K].Yb[z][ae]=fe;for(K=0;17>K;++K)re.Xc[L][K]=re.Wc[L][Zne[K]]}return _.kc=oe(J),_.kc&&(_.Bd=H(J,8)),_.cb=1}function $n(_,N,L,z,K,J,re){var ae=N[K].Yb[L];for(L=0;16>K;++K){if(!X(_,ae[L+0]))return K;for(;!X(_,ae[L+1]);)if(ae=N[++K].Yb[0],L=0,K==16)return 16;var le=N[K+1].Yb;if(X(_,ae[L+2])){var fe=_,_e=0;if(X(fe,(he=ae)[(Oe=L)+3]))if(X(fe,he[Oe+6])){for(ae=0,Oe=2*(_e=X(fe,he[Oe+8]))+(he=X(fe,he[Oe+9+_e])),_e=0,he=Vne[Oe];he[ae];++ae)_e+=_e+X(fe,he[ae]);_e+=3+(8<<Oe)}else X(fe,he[Oe+7])?(_e=7+2*X(fe,165),_e+=X(fe,145)):_e=5+X(fe,159);else _e=X(fe,he[Oe+4])?3+X(fe,he[Oe+5]):2;ae=le[2]}else _e=1,ae=le[1];le=re+Hne[K],0>(fe=_).b&&ce(fe);var Oe,he=fe.b,Se=(Oe=fe.Ca>>1)-(fe.I>>he)>>31;--fe.b,fe.Ca+=Se,fe.Ca|=1,fe.I-=(Oe+1&Se)<<he,J[le]=((_e^Se)-Se)*z[(0<K)+0]}return 16}function Mi(_){var N=_.rb[_.sb-1];N.la=0,N.Na=0,a(_.zc,0,0,_.zc.length),_.ja=0}function lr(_,N,L,z,K){K=_[N+L+32*z]+(K>>3),_[N+L+32*z]=-256&K?0>K?0:255:K}function Ar(_,N,L,z,K,J){lr(_,N,0,L,z+K),lr(_,N,1,L,z+J),lr(_,N,2,L,z-J),lr(_,N,3,L,z-K)}function nl(_){return(20091*_>>16)+_}function Xa(_,N,L,z){var K,J=0,re=i(16);for(K=0;4>K;++K){var ae=_[N+0]+_[N+8],le=_[N+0]-_[N+8],fe=(35468*_[N+4]>>16)-nl(_[N+12]),_e=nl(_[N+4])+(35468*_[N+12]>>16);re[J+0]=ae+_e,re[J+1]=le+fe,re[J+2]=le-fe,re[J+3]=ae-_e,J+=4,N++}for(K=J=0;4>K;++K)ae=(_=re[J+0]+4)+re[J+8],le=_-re[J+8],fe=(35468*re[J+4]>>16)-nl(re[J+12]),lr(L,z,0,0,ae+(_e=nl(re[J+4])+(35468*re[J+12]>>16))),lr(L,z,1,0,le+fe),lr(L,z,2,0,le-fe),lr(L,z,3,0,ae-_e),J++,z+=32}function Xb(_,N,L,z){var K=_[N+0]+4,J=35468*_[N+4]>>16,re=nl(_[N+4]),ae=35468*_[N+1]>>16;Ar(L,z,0,K+re,_=nl(_[N+1]),ae),Ar(L,z,1,K+J,_,ae),Ar(L,z,2,K-J,_,ae),Ar(L,z,3,K-re,_,ae)}function JN(_,N,L,z,K){Xa(_,N,L,z),K&&Xa(_,N+16,L,z+4)}function QN(_,N,L,z){Mc(_,N+0,L,z,1),Mc(_,N+32,L,z+128,1)}function e5(_,N,L,z){var K;for(_=_[N+0]+4,K=0;4>K;++K)for(N=0;4>N;++N)lr(L,z,N,K,_)}function Ul(_,N,L,z){_[N+0]&&Fi(_,N+0,L,z),_[N+16]&&Fi(_,N+16,L,z+4),_[N+32]&&Fi(_,N+32,L,z+128),_[N+48]&&Fi(_,N+48,L,z+128+4)}function Jb(_,N,L,z){var K,J=i(16);for(K=0;4>K;++K){var re=_[N+0+K]+_[N+12+K],ae=_[N+4+K]+_[N+8+K],le=_[N+4+K]-_[N+8+K],fe=_[N+0+K]-_[N+12+K];
vendor: 4,086 bytes, line 845
845J[0+K]=re+ae,J[8+K]=re-ae,J[4+K]=fe+le,J[12+K]=fe-le}for(K=0;4>K;++K)re=(_=J[0+4*K]+3)+J[3+4*K],ae=J[1+4*K]+J[2+4*K],le=J[1+4*K]-J[2+4*K],fe=_-J[3+4*K],L[z+0]=re+ae>>3,L[z+16]=fe+le>>3,L[z+32]=re-ae>>3,L[z+48]=fe-le>>3,z+=64}function Lp(_,N,L){var z,K=N-32,J=Vs,re=255-_[K-1];for(z=0;z<L;++z){var ae,le=J,fe=re+_[N-1];for(ae=0;ae<L;++ae)_[N+ae]=le[fe+_[K+ae]];N+=32}}function Mp(_,N){Lp(_,N,4)}function ny(_,N){Lp(_,N,8)}function t5(_,N){Lp(_,N,16)}function n5(_,N){var L;for(L=0;16>L;++L)r(_,N+32*L,_,N-32,16)}function r5(_,N){var L;for(L=16;0<L;--L)a(_,N,_[N-1],16),N+=32}function $u(_,N,L){var z;for(z=0;16>z;++z)a(N,L+32*z,_,16)}function Qb(_,N){var L,z=16;for(L=0;16>L;++L)z+=_[N-1+32*L]+_[N+L-32];$u(z>>5,_,N)}function Du(_,N){var L,z=8;for(L=0;16>L;++L)z+=_[N-1+32*L];$u(z>>4,_,N)}function a5(_,N){var L,z=8;for(L=0;16>L;++L)z+=_[N+L-32];$u(z>>4,_,N)}function Tf(_,N){$u(128,_,N)}function on(_,N,L){return _+2*N+L+2>>2}function i5(_,N){var L,z=N-32;for(z=new Uint8Array([on(_[z-1],_[z+0],_[z+1]),on(_[z+0],_[z+1],_[z+2]),on(_[z+1],_[z+2],_[z+3]),on(_[z+2],_[z+3],_[z+4])]),L=0;4>L;++L)r(_,N+32*L,z,0,z.length)}function s5(_,N){var L=_[N-1],z=_[N-1+32],K=_[N-1+64],J=_[N-1+96];se(_,N+0,16843009*on(_[N-1-32],L,z)),se(_,N+32,16843009*on(L,z,K)),se(_,N+64,16843009*on(z,K,J)),se(_,N+96,16843009*on(K,J,J))}function o5(_,N){var L,z=4;for(L=0;4>L;++L)z+=_[N+L-32]+_[N-1+32*L];for(z>>=3,L=0;4>L;++L)a(_,N+32*L,z,4)}function l5(_,N){var L=_[N-1+0],z=_[N-1+32],K=_[N-1+64],J=_[N-1-32],re=_[N+0-32],ae=_[N+1-32],le=_[N+2-32],fe=_[N+3-32];_[N+0+96]=on(z,K,_[N-1+96]),_[N+1+96]=_[N+0+64]=on(L,z,K),_[N+2+96]=_[N+1+64]=_[N+0+32]=on(J,L,z),_[N+3+96]=_[N+2+64]=_[N+1+32]=_[N+0+0]=on(re,J,L),_[N+3+64]=_[N+2+32]=_[N+1+0]=on(ae,re,J),_[N+3+32]=_[N+2+0]=on(le,ae,re),_[N+3+0]=on(fe,le,ae)}function c5(_,N){var L=_[N+1-32],z=_[N+2-32],K=_[N+3-32],J=_[N+4-32],re=_[N+5-32],ae=_[N+6-32],le=_[N+7-32];_[N+0+0]=on(_[N+0-32],L,z),_[N+1+0]=_[N+0+32]=on(L,z,K),_[N+2+0]=_[N+1+32]=_[N+0+64]=on(z,K,J),_[N+3+0]=_[N+2+32]=_[N+1+64]=_[N+0+96]=on(K,J,re),_[N+3+32]=_[N+2+64]=_[N+1+96]=on(J,re,ae),_[N+3+64]=_[N+2+96]=on(re,ae,le),_[N+3+96]=on(ae,le,le)}function Tc(_,N){var L=_[N-1+0],z=_[N-1+32],K=_[N-1+64],J=_[N-1-32],re=_[N+0-32],ae=_[N+1-32],le=_[N+2-32],fe=_[N+3-32];_[N+0+0]=_[N+1+64]=J+re+1>>1,_[N+1+0]=_[N+2+64]=re+ae+1>>1,_[N+2+0]=_[N+3+64]=ae+le+1>>1,_[N+3+0]=le+fe+1>>1,_[N+0+96]=on(K,z,L),_[N+0+64]=on(z,L,J),_[N+0+32]=_[N+1+96]=on(L,J,re),_[N+1+32]=_[N+2+96]=on(J,re,ae),_[N+2+32]=_[N+3+96]=on(re,ae,le),_[N+3+32]=on(ae,le,fe)}function Oc(_,N){var L=_[N+0-32],z=_[N+1-32],K=_[N+2-32],J=_[N+3-32],re=_[N+4-32],ae=_[N+5-32],le=_[N+6-32],fe=_[N+7-32];_[N+0+0]=L+z+1>>1,_[N+1+0]=_[N+0+64]=z+K+1>>1,_[N+2+0]=_[N+1+64]=K+J+1>>1,_[N+3+0]=_[N+2+64]=J+re+1>>1,_[N+0+32]=on(L,z,K),_[N+1+32]=_[N+0+96]=on(z,K,J),_[N+2+32]=_[N+1+96]=on(K,J,re),_[N+3+32]=_[N+2+96]=on(J,re,ae),_[N+3+64]=on(re,ae,le),_[N+3+96]=on(ae,le,fe)}function u5(_,N){var L=_[N-1+0],z=_[N-1+32],K=_[N-1+64],J=_[N-1+96];_[N+0+0]=L+z+1>>1,_[N+2+0]=_[N+0+32]=z+K+1>>1,_[N+2+32]=_[N+0+64]=K+J+1>>1,_[N+1+0]=on(L,z,K),_[N+3+0]=_[N+1+32]=on(z,K,J),_[N+3+32]=_[N+1+64]=on(K,J,J),_[N+3+64]=_[N+2+64]=_[N+0+96]=_[N+1+96]=_[N+2+96]=_[N+3+96]=J}function d5(_,N){var L=_[N-1+0],z=_[N-1+32],K=_[N-1+64],J=_[N-1+96],re=_[N-1-32],ae=_[N+0-32],le=_[N+1-32],fe=_[N+2-32];_[N+0+0]=_[N+2+32]=L+re+1>>1,_[N+0+32]=_[N+2+64]=z+L+1>>1,_[N+0+64]=_[N+2+96]=K+z+1>>1,_[N+0+96]=J+K+1>>1,_[N+3+0]=on(ae,le,fe),_[N+2+0]=on(re,ae,le),_[N+1+0]=_[N+3+32]=on(L,re,ae),_[N+1+32]=_[N+3+64]=on(z,L,re),_[N+1+64]=_[N+3+96]=on(K,z,L),_[N+1+96]=on(J,K,z)}function $p(_,N){var L;for(L=0;8>L;++L)r(_,N+32*L,_,N-32,8)}function ry(_,N){var L;for(L=0;8>L;++L)a(_,N,_[N-1],8),N+=32}function zl(_,N,L){var z;for(z=0;8>z;++z)a(N,L+32*z,_,8)}function f5(_,N){var L,z=8;for(L=0;8>L;++L)z+=_[N+L-32]+_[N-1+32*L];zl(z>>4,_,N)}function Dp(_,N){var L,z=4;for(L=0;8>L;++L)z+=_[N+L-32];zl(z>>3,_,N)}function h5(_,N){var L,z=4;for(L=0;8>L;++L)z+=_[N-1+32*L];zl(z>>3,_,N)}function ay(_,N){zl(128,_,N)}function Fu(_,N,L){var z=_[N-L],K=_[N+0],J=3*(K-z)+m5[1020+_[N-2*L]-_[N+L]],re=l1[112+(J+4>>
vendor: 19,992 bytes, line 845
8453)];_[N-L]=Vs[255+z+l1[112+(J+3>>3)]],_[N+0]=Vs[255+K-re]}function iy(_,N,L,z){var K=_[N+0],J=_[N+L];return jo[255+_[N-2*L]-_[N-L]]>z||jo[255+J-K]>z}function Of(_,N,L,z){return 4*jo[255+_[N-L]-_[N+0]]+jo[255+_[N-2*L]-_[N+L]]<=z}function sy(_,N,L,z,K){var J=_[N-3*L],re=_[N-2*L],ae=_[N-L],le=_[N+0],fe=_[N+L],_e=_[N+2*L],Oe=_[N+3*L];return 4*jo[255+ae-le]+jo[255+re-fe]>z?0:jo[255+_[N-4*L]-J]<=K&&jo[255+J-re]<=K&&jo[255+re-ae]<=K&&jo[255+Oe-_e]<=K&&jo[255+_e-fe]<=K&&jo[255+fe-le]<=K}function Fp(_,N,L,z){var K=2*z+1;for(z=0;16>z;++z)Of(_,N+z,L,K)&&Fu(_,N+z,L)}function oy(_,N,L,z){var K=2*z+1;for(z=0;16>z;++z)Of(_,N+z*L,1,K)&&Fu(_,N+z*L,1)}function Bp(_,N,L,z){var K;for(K=3;0<K;--K)Fp(_,N+=4*L,L,z)}function e1(_,N,L,z){var K;for(K=3;0<K;--K)oy(_,N+=4,L,z)}function Rc(_,N,L,z,K,J,re,ae){for(J=2*J+1;0<K--;){if(sy(_,N,L,J,re))if(iy(_,N,L,ae))Fu(_,N,L);else{var le=_,fe=N,_e=L,Oe=le[fe-2*_e],he=le[fe-_e],Se=le[fe+0],Ce=le[fe+_e],Ue=le[fe+2*_e],Te=27*(Ge=m5[1020+3*(Se-he)+m5[1020+Oe-Ce]])+63>>7,We=18*Ge+63>>7,Ge=9*Ge+63>>7;le[fe-3*_e]=Vs[255+le[fe-3*_e]+Ge],le[fe-2*_e]=Vs[255+Oe+We],le[fe-_e]=Vs[255+he+Te],le[fe+0]=Vs[255+Se-Te],le[fe+_e]=Vs[255+Ce-We],le[fe+2*_e]=Vs[255+Ue-Ge]}N+=z}}function Ic(_,N,L,z,K,J,re,ae){for(J=2*J+1;0<K--;){if(sy(_,N,L,J,re))if(iy(_,N,L,ae))Fu(_,N,L);else{var le=_,fe=N,_e=L,Oe=le[fe-_e],he=le[fe+0],Se=le[fe+_e],Ce=l1[112+(4+(Ue=3*(he-Oe))>>3)],Ue=l1[112+(Ue+3>>3)],Te=Ce+1>>1;le[fe-2*_e]=Vs[255+le[fe-2*_e]+Te],le[fe-_e]=Vs[255+Oe+Ue],le[fe+0]=Vs[255+he-Ce],le[fe+_e]=Vs[255+Se-Te]}N+=z}}function t1(_,N,L,z,K,J){Rc(_,N,L,1,16,z,K,J)}function n1(_,N,L,z,K,J){Rc(_,N,1,L,16,z,K,J)}function r1(_,N,L,z,K,J){var re;for(re=3;0<re;--re)Ic(_,N+=4*L,L,1,16,z,K,J)}function Rf(_,N,L,z,K,J){var re;for(re=3;0<re;--re)Ic(_,N+=4,1,L,16,z,K,J)}function a1(_,N,L,z,K,J,re,ae){Rc(_,N,K,1,8,J,re,ae),Rc(L,z,K,1,8,J,re,ae)}function T(_,N,L,z,K,J,re,ae){Rc(_,N,1,K,8,J,re,ae),Rc(L,z,1,K,8,J,re,ae)}function Y(_,N,L,z,K,J,re,ae){Ic(_,N+4*K,K,1,8,J,re,ae),Ic(L,z+4*K,K,1,8,J,re,ae)}function de(_,N,L,z,K,J,re,ae){Ic(_,N+4,1,K,8,J,re,ae),Ic(L,z+4,1,K,8,J,re,ae)}function xe(){this.ba=new nn,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new hn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function ke(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Be(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Ze(){this.ua=0,this.Wa=new Ae,this.vb=new Ae,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new q,this.yc=new D}function Ot(){this.xb=this.a=0,this.l=new dr,this.ca=new nn,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new M,this.Pb=0,this.wd=new M,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Ze,this.ab=0,this.gc=o(4,Be),this.Oc=0}function Tt(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new dr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function un(_,N,L,z,K,J,re){for(_=_==null?0:_[N+0],N=0;N<re;++N)K[J+N]=_+L[z+N]&255,_=K[J+N]}function bn(_,N,L,z,K,J,re){var ae;if(_==null)un(null,null,L,z,K,J,re);else for(ae=0;ae<re;++ae)K[J+ae]=_[N+ae]+L[z+ae]&255}function Kn(_,N,L,z,K,J,re){if(_==null)un(null,null,L,z,K,J,re);else{var ae,le=_[N+0],fe=le,_e=le;for(ae=0;ae<re;++ae)fe=_e+(le=_[N+ae])-fe,_e=L[z+ae]+(-256&fe?0>fe?0:255:fe)&255,fe=le,K[J+ae]=_e}}function Ua(_,N,L,z){var K=N.width,J=N.o;if(t(_!=null&&N!=null),0>L||0>=z||L+z>J)return null;if(!_.Cc){if(_.ga==null){var re;if(_.ga=new Tt,(re=_.ga==null)||(re=N.width*N.o,t(_.Gb.length==0),_.Gb=i(re),_.Uc=0,_.Gb==null?re=0:(_.mb=_.Gb,_.nb=_.Uc,_.rc=null,re=1),re=!re),!re){re=_.ga;var ae=_.Fa,le=_.P,fe=_.qc,_e=_.mb,Oe=_.nb,he=le+1,Se=fe-1,Ce=re.l;if(t(ae!=null&&_e!=null&&N!=null),Hu[0]=null,Hu[1]=un,Hu[2]=bn,Hu[3]=Kn,re.ca=_e,re.tb=Oe,re.c=N.width,re.i=N.height,t(0<re.c&&0<re.i),1>=fe)N=0;else if(re.$a=3&ae[le+0],re.Z=ae[le+0]>>2&3,re.Lc=ae[le+0]>>4&3,le=ae[le+0]>>6&3,0>re.$a||1<re.$a||4<=re.Z||1<re.Lc||le)N=0;else if(Ce.put=at,Ce.ac=rt,Ce.bc=xn,Ce.ma=re,Ce.width=N.width,Ce.height=N.height,Ce.Da=N.Da,Ce.v=N.v,Ce.va=N.va,Ce.j=N.j,Ce.o=N.o,re.$a)e:{t(re.$a==1),N=wo();t:for(;;){if(N==null){N=0;break e}if(t(re!=null),re.mc=N,N.c=re.c,N.i=re.i,N.l=re.l,N.l.ma=re,N.l.width=re.c,N.l.height=re.i,N.a=0,W(N.m,ae,he,Se),!qs(re.c,re.i,1,N,null)||(N.ab==1&&N.gc[0].hc==3&&Fa(N.s)?(re.ic=1,ae=N.c*N.i,N.Ta=null,N.Ua=0,N.V=i(ae),N.Ba=0,N.V==null?(N.a=1,N=0):N=1):(re.ic=0,N=Bl(N,re.c)),!N))break t;N=1;break e}re.mc=null,N=0}else N=Se>=re.c*re.i;re=!N}if(re)return null;_.ga.Lc!=1?_.Ga=0:z=J-L}t(_.ga!=null),t(L+z<=J);e:{if(N=(ae=_.ga).c,J=ae.l.o,ae.$a==0){if(he=_.rc,Se=_.Vc,Ce=_.Fa,le=_.P+1+L*N,fe=_.mb,_e=_.nb+L*N,t(le<=_.P+_.qc),ae.Z!=0)for(t(Hu[ae.Z]!=null),re=0;re<z;++re)Hu[ae.Z](he,Se,Ce,le,fe,_e,N),he=fe,Se=_e,_e+=N,le+=N;else for(re=0;re<z;++re)r(fe,_e,Ce,le,N),he=fe,Se=_e,_e+=N,le+=N;_.rc=he,_.Vc=Se}else{if(t(ae.mc!=null),N=L+z,t((re=ae.mc)!=null),t(N<=re.i),re.C>=N)N=1;else if(ae.ic||sa(),ae.ic){ae=re.V,he=re.Ba,Se=re.c;var Ue=re.i,Te=(Ce=1,le=re.$/Se,fe=re.$%Se,_e=re.m,Oe=re.s,re.$),We=Se*Ue,Ge=Se*N,it=Oe.wc,Xe=Te<Ge?Zt(Oe,fe,le):null;t(Te<=We),t(N<=Ue),t(Fa(Oe));t:for(;;){for(;!_e.h&&Te<Ge;){if(fe&it||(Xe=Zt(Oe,fe,le)),t(Xe!=null),ne(_e),256>(Ue=Gt(Xe.G[0],Xe.H[0],_e)))ae[he+Te]=Ue,++Te,++fe>=Se&&(fe=0,++le<=N&&!(le%16)&&Si(re,le));else{if(!(280>Ue)){Ce=0;break t}Ue=Yn(Ue-256,_e);var Ut,kt=Gt(Xe.G[4],Xe.H[4],_e);if(ne(_e),!(Te>=(kt=nr(Se,kt=Yn(kt,_e)))&&We-Te>=Ue)){Ce=0;break t}for(Ut=0;Ut<Ue;++Ut)ae[he+Te+Ut]=ae[he+Te+Ut-kt];for(Te+=Ue,fe+=Ue;fe>=Se;)fe-=Se,++le<=N&&!(le%16)&&Si(re,le);Te<Ge&&fe&it&&(Xe=Zt(Oe,fe,le))}t(_e.h==G(_e))}Si(re,le>N?N:le);break t}!Ce||_e.h&&Te<We?(Ce=0,re.a=_e.h?5:3):re.$=Te,N=Ce}else N=Ni(re,re.V,re.Ba,re.c,re.i,N,Ec);if(!N){z=0;break e}}L+z>=J&&(_.Cc=1),z=1}if(!z)return null;if(_.Cc&&((z=_.ga)!=null&&(z.mc=null),_.ga=null,0<_.Ga))return alert("todo:WebPDequantizeLevels"),null}return _.nb+L*K}function kr(_,N,L,z,K,J){for(;0<K--;){var re,ae=_,le=N+(L?1:0),fe=_,_e=N+(L?0:3);for(re=0;re<z;++re){var Oe=fe[_e+4*re];Oe!=255&&(Oe*=32897,ae[le+4*re+0]=ae[le+4*re+0]*Oe>>23,ae[le+4*re+1]=ae[le+4*re+1]*Oe>>23,ae[le+4*re+2]=ae[le+4*re+2]*Oe>>23)}N+=J}}function Sr(_,N,L,z,K){for(;0<z--;){var J;for(J=0;J<L;++J){var re=_[N+2*J+0],ae=15&(fe=_[N+2*J+1]),le=4369*ae,fe=(240&fe|fe>>4)*le>>16;_[N+2*J+0]=(240&re|re>>4)*le>>16&240|(15&re|re<<4)*le>>16>>4&15,_[N+2*J+1]=240&fe|ae}N+=K}}function zr(_,N,L,z,K,J,re,ae){var le,fe,_e=255;for(fe=0;fe<K;++fe){for(le=0;le<z;++le){var Oe=_[N+le];J[re+4*le]=Oe,_e&=Oe}N+=L,re+=ae}return _e!=255}function ia(_,N,L,z,K){var J;for(J=0;J<K;++J)L[z+J]=_[N+J]>>8}function sa(){my=kr,LI=Sr,MI=zr,$I=ia}function $i(_,N,L){P[_]=function(z,K,J,re,ae,le,fe,_e,Oe,he,Se,Ce,Ue,Te,We,Ge,it){var Xe,Ut=it-1>>1,kt=ae[le+0]|fe[_e+0]<<16,Nn=Oe[he+0]|Se[Ce+0]<<16;t(z!=null);var $t=3*kt+Nn+131074>>2;for(N(z[K+0],255&$t,$t>>16,Ue,Te),J!=null&&($t=3*Nn+kt+131074>>2,N(J[re+0],255&$t,$t>>16,We,Ge)),Xe=1;Xe<=Ut;++Xe){var Vn=ae[le+Xe]|fe[_e+Xe]<<16,Qa=Oe[he+Xe]|Se[Ce+Xe]<<16,An=kt+Vn+Nn+Qa+524296,Dt=An+2*(Vn+Nn)>>3;$t=Dt+kt>>1,kt=(An=An+2*(kt+Qa)>>3)+Vn>>1,N(z[K+2*Xe-1],255&$t,$t>>16,Ue,Te+(2*Xe-1)*L),N(z[K+2*Xe-0],255&kt,kt>>16,Ue,Te+(2*Xe-0)*L),J!=null&&($t=An+Nn>>1,kt=Dt+Qa>>1,N(J[re+2*Xe-1],255&$t,$t>>16,We,Ge+(2*Xe-1)*L),N(J[re+2*Xe+0],255&kt,kt>>16,We,Ge+(2*Xe+0)*L)),kt=Vn,Nn=Qa}1&it||($t=3*kt+Nn+131074>>2,N(z[K+it-1],255&$t,$t>>16,Ue,Te+(it-1)*L),J!=null&&($t=3*Nn+kt+131074>>2,N(J[re+it-1],255&$t,$t>>16,We,Ge+(it-1)*L)))}}function Lc(){So[c1]=Jne,So[u1]=YI,So[WI]=Qne,So[d1]=KI,So[f1]=ZI,So[g5]=XI,So[qI]=ere,So[v5]=YI,So[y5]=KI,So[h1]=ZI,So[x5]=XI}function ly(_){return _&~tre?0>_?0:255:_>>JI}function If(_,N){return ly((19077*_>>8)+(26149*N>>8)-14234)}function Lf(_,N,L){return ly((19077*_>>8)-(6419*N>>8)-(13320*L>>8)+8708)}function Bu(_,N){return ly((19077*_>>8)+(33050*N>>8)-17685)}function Mf(_,N,L,z,K){z[K+0]=If(_,L),z[K+1]=Lf(_,N,L),z[K+2]=Bu(_,N)}function Up(_,N,L,z,K){z[K+0]=Bu(_,N),z[K+1]=Lf(_,N,L),z[K+2]=If(_,L)}function zp(_,N,L,z,K){var J=Lf(_,N,L);N=J<<3&224|Bu(_,N)>>3,z[K+0]=248&If(_,L)|J>>5,z[K+1]=N}function Di(_,N,L,z,K){var J=240&Bu(_,N)|15;z[K+0]=240&If(_,L)|Lf(_,N,L)>>4,z[K+1]=J}function $f(_,N,L,z,K){z[K+0]=255,Mf(_,N,L,z,K+1)}function Df(_,N,L,z,K){Up(_,N,L,z,K),z[K+3]=255}function cy(_,N,L,z,K){Mf(_,N,L,z,K),z[K+3]=255}function Wl(_,N,L){P[_]=function(z,K,J,re,ae,le,fe,_e,Oe){for(var he=_e+(-2&Oe)*L;_e!=he;)N(z[K+0],J[re+0],ae[le+0],fe,_e),N(z[K+1],J[re+0],ae[le+0],fe,_e+L),K+=2,++re,++le,_e+=2*L;1&Oe&&N(z[K+0],J[re+0],ae[le+0],fe,_e)}}function es(_,N,L){return L==0?_==0?N==0?6:5:N==0?4:0:L}function i1(_,N,L,z,K){switch(_>>>30){case 3:Mc(N,L,z,K,0);break;case 2:qu(N,L,z,K);break;case 1:Fi(N,L,z,K)}}function Wp(_,N){var L,z,K=N.M,J=N.Nb,re=_.oc,ae=_.pc+40,le=_.oc,fe=_.pc+584,_e=_.oc,Oe=_.pc+600;for(L=0;16>L;++L)re[ae+32*L-1]=129;for(L=0;8>L;++L)le[fe+32*L-1]=129,_e[Oe+32*L-1]=129;for(0<K?re[ae-1-32]=le[fe-1-32]=_e[Oe-1-32]=129:(a(re,ae-32-1,127,21),a(le,fe-32-1,127,9),a(_e,Oe-32-1,127,9)),z=0;z<_.za;++z){var he=N.ya[N.aa+z];if(0<z){for(L=-1;16>L;++L)r(re,ae+32*L-4,re,ae+32*L+12,4);for(L=-1;8>L;++L)r(le,fe+32*L-4,le,fe+32*L+4,4),r(_e,Oe+32*L-4,_e,Oe+32*L+4,4)}var Se=_.Gd,Ce=_.Hd+z,Ue=he.ad,Te=he.Hc;if(0<K&&(r(re,ae-32,Se[Ce].y,0,16),r(le,fe-32,Se[Ce].f,0,8),r(_e,Oe-32,Se[Ce].ea,0,8)),he.Za){var We=re,Ge=ae-32+16;for(0<K&&(z>=_.za-1?a(We,Ge,Se[Ce].y[15],4):r(We,Ge,Se[Ce+1].y,0,4)),L=0;4>L;L++)We[Ge+128+L]=We[Ge+256+L]=We[Ge+384+L]=We[Ge+0+L];for(L=0;16>L;++L,Te<<=2)We=re,Ge=ae+e6[L],al[he.Ob[L]](We,Ge),i1(Te,Ue,16*+L,We,Ge)}else if(We=es(z,K,he.Ob[0]),Vu[We](re,ae),Te!=0)for(L=0;16>L;++L,Te<<=2)i1(Te,Ue,16*+L,re,ae+e6[L]);for(L=he.Gc,We=es(z,K,he.Dd),Dc[We](le,fe),Dc[We](_e,Oe),Te=Ue,We=le,Ge=fe,255&(he=0|L)&&(170&he?Yp(Te,256,We,Ge):Vl(Te,256,We,Ge)),he=_e,Te=Oe,255&(L>>=8)&&(170&L?Yp(Ue,320,he,Te):Vl(Ue,320,he,Te)),K<_.Ub-1&&(r(Se[Ce].y,0,re,ae+480,16),r(Se[Ce].f,0,le,fe+224,8),r(Se[Ce].ea,0,_e,Oe+224,8)),L=8*J*_.B,Se=_.sa,Ce=_.ta+16*z+16*J*_.R,Ue=_.qa,he=_.ra+8*z+L,Te=_.Ha,We=_.Ia+8*z+L,L=0;16>L;++L)r(Se,Ce+L*_.R,re,ae+32*L,16);for(L=0;8>L;++L)r(Ue,he+L*_.B,le,fe+32*L,8),r(Te,We+L*_.B,_e,Oe+32*L,8)}}function s1(_,N,L,z,K,J,re,ae,le){var fe=[0],_e=[0],Oe=0,he=le!=null?le.kd:0,Se=le??new ke;if(_==null||12>L)return 7;Se.data=_,Se.w=N,Se.ha=L,N=[N],L=[L],Se.gb=[Se.gb];e:{var Ce=N,Ue=L,Te=Se.gb;if(t(_!=null),t(Ue!=null),t(Te!=null),Te[0]=0,12<=Ue[0]&&!n(_,Ce[0],"RIFF")){if(n(_,Ce[0]+8,"WEBP")){Te=3;break e}var We=ie(_,Ce[0]+4);if(12>We||4294967286<We){Te=3;break e}if(he&&We>Ue[0]-8){Te=7;break e}Te[0]=We,Ce[0]+=12,Ue[0]-=12}Te=0}if(Te!=0)return Te;for(We=0<Se.gb[0],L=L[0];;){e:{var Ge=_;Ue=N,Te=L;var it=fe,Xe=_e,Ut=Ce=[0];if(($t=Oe=[Oe])[0]=0,8>Te[0])Te=7;else{if(!n(Ge,Ue[0],"VP8X")){if(ie(Ge,Ue[0]+4)!=10){Te=3;break e}if(18>Te[0]){Te=7;break e}var kt=ie(Ge,Ue[0]+8),Nn=1+ye(Ge,Ue[0]+12);if(2147483648<=Nn*(Ge=1+ye(Ge,Ue[0]+15))){Te=3;break e}Ut!=null&&(Ut[0]=kt),it!=null&&(it[0]=Nn),Xe!=null&&(Xe[0]=Ge),Ue[0]+=18,Te[0]-=18,$t[0]=1}Te=0}}if(Oe=Oe[0],Ce=Ce[0],Te!=0)return Te;if(Ue=!!(2&Ce),!We&&Oe)return 3;if(J!=null&&(J[0]=!!(16&Ce)),re!=null&&(re[0]=Ue),ae!=null&&(ae[0]=0),re=fe[0],Ce=_e[0],Oe&&Ue&&le==null){Te=0;break}if(4>L){Te=7;break}if(We&&Oe||!We&&!Oe&&!n(_,N[0],"ALPH")){L=[L],Se.na=[Se.na],Se.P=[Se.P],Se.Sa=[Se.Sa];e:{kt=_,Te=N,We=L;var $t=Se.gb;it=Se.na,Xe=Se.P,Ut=Se.Sa,Nn=22,t(kt!=null),t(We!=null),Ge=Te[0];var Vn=We[0];for(t(it!=null),t(Ut!=null),it[0]=null,Xe[0]=null,Ut[0]=0;;){if(Te[0]=Ge,We[0]=Vn,8>Vn){Te=7;break e}var Qa=ie(kt,Ge+4);if(4294967286<Qa){Te=3;break e}var An=8+Qa+1&-2;if(Nn+=An,0<$t&&Nn>$t){Te=3;break e}if(!n(kt,Ge,"VP8 ")||!n(kt,Ge,"VP8L")){Te=0;break e}if(Vn[0]<An){Te=7;break e}n(kt,Ge,"ALPH")||(it[0]=kt,Xe[0]=Ge+8,Ut[0]=Qa),Ge+=An,Vn-=An}}if(L=L[0],Se.na=Se.na[0],Se.P=Se.P[0],Se.Sa=Se.Sa[0],Te!=0)break}L=[L],Se.Ja=[Se.Ja],Se.xa=[Se.xa];e:if($t=_,Te=N,We=L,it=Se.gb[0],Xe=Se.Ja,Ut=Se.xa,kt=Te[0],Ge=!n($t,kt,"VP8 "),Nn=!n($t,kt,"VP8L"),t($t!=null),t(We!=null),t(Xe!=null),t(Ut!=null),8>We[0])Te=7;else{if(Ge||Nn){if($t=ie($t,kt+4),12<=it&&$t>it-12){Te=3;break e}if(he&&$t>We[0]-8){Te=7;break e}Xe[0]=$t,Te[0]+=8,We[0]-=8,Ut[0]=Nn}else Ut[0]=5<=We[0]&&$t[kt+0]==47&&!($t[kt+4]>>5),Xe[0]=We[0];Te=0}if(L=L[0],Se.Ja=Se.Ja[0],Se.xa=Se.xa[0],N=N[0],Te!=0)break;if(4294967286<Se.Ja)return 3;if(ae==null||Ue||(ae[0]=Se.xa?2:1),re=[re],Ce=[Ce],Se.xa){if(5>L){Te=7;break}ae=re,he=Ce,Ue=J,_==null||5>L?_=0:5<=L&&_[N+0]==47&&!(_[N+4]>>5)?(We=[0],$t=[0],it=[0],W(Xe=new M,_,N,L),sr(Xe,We,$t,it)?(ae!=null&&(ae[0]=We[0]),he!=null&&(he[0]=$t[0]),Ue!=null&&(Ue[0]=it[0]),_=1):_=0):_=0}else{if(10>L){Te=7;break}ae=Ce,_==null||10>L||!Wn(_,N+3,L-3)?_=0:(he=_[N+0]|_[N+1]<<8|_[N+2]<<16,Ue=16383&(_[N+7]<<8|_[N+6]),_=16383&(_[N+9]<<8|_[N+8]),1&he||3<(he>>1&7)||!(he>>4&1)||he>>5>=Se.Ja||!Ue||!_?_=0:(re&&(re[0]=Ue),ae&&(ae[0]=_),_=1))}if(!_||(re=re[0],Ce=Ce[0],Oe&&(fe[0]!=re||_e[0]!=Ce)))return 3;le!=null&&(le[0]=Se,le.offset=N-le.w,t(4294967286>N-le.w),t(le.offset==le.ha-L));break}return Te==0||Te==7&&Oe&&le==null?(J!=null&&(J[0]|=Se.na!=null&&0<Se.na.length),z!=null&&(z[0]=re),K!=null&&(K[0]=Ce),0):Te}function _o(_,N,L){var z=N.width,K=N.height,J=0,re=0,ae=z,le=K;if(N.Da=_!=null&&0<_.Da,N.Da&&(ae=_.cd,le=_.bd,J=_.v,re=_.j,11>L||(J&=-2,re&=-2),0>J||0>re||0>=ae||0>=le||J+ae>z||re+le>K))return 0;if(N.v=J,N.j=re,N.va=J+ae,N.o=re+le,N.U=ae,N.T=le,N.da=_!=null&&0<_.da,N.da){if(!Ne(ae,le,L=[_.ib],J=[_.hb]))return 0;N.ib=L[0],N.hb=J[0]}return N.ob=_!=null&&_.ob,N.Kb=_==null||!_.Sd,N.da&&(N.ob=N.ib<3*z/4&&N.hb<3*K/4,N.Kb=0),1}function Ff(_){if(_==null)return 2;if(11>_.S){var N=_.f.RGBA;N.fb+=(_.height-1)*N.A,N.A=-N.A}else N=_.f.kb,_=_.height,N.O+=(_-1)*N.fa,N.fa=-N.fa,N.N+=(_-1>>1)*N.Ab,N.Ab=-N.Ab,N.W+=(_-1>>1)*N.Db,N.Db=-N.Db,N.F!=null&&(N.J+=(_-1)*N.lb,N.lb=-N.lb);return 0}function uy(_,N,L,z){if(z==null||0>=_||0>=N)return 2;if(L!=null){if(L.Da){var K=L.cd,J=L.bd,re=-2&L.v,ae=-2&L.j;if(0>re||0>ae||0>=K||0>=J||re+K>_||ae+J>N)return 2;_=K,N=J}if(L.da){if(!Ne(_,N,K=[L.ib],J=[L.hb]))return 2;_=K[0],N=J[0]}}z.width=_,z.height=N;e:{var le=z.width,fe=z.height;if(_=z.S,0>=le||0>=fe||!(_>=c1&&13>_))_=2;else{if(0>=z.Rd&&z.sd==null){re=J=K=N=0;var _e=(ae=le*t6[_])*fe;if(11>_||(J=(fe+1)/2*(N=(le+1)/2),_==12&&(re=(K=le)*fe)),(fe=i(_e+2*J+re))==null){_=1;break e}z.sd=fe,11>_?((le=z.f.RGBA).eb=fe,le.fb=0,le.A=ae,le.size=_e):((le=z.f.kb).y=fe,le.O=0,le.fa=ae,le.Fd=_e,le.f=fe,le.N=0+_e,le.Ab=N,le.Cd=J,le.ea=fe,le.W=0+_e+J,le.Db=N,le.Ed=J,_==12&&(le.F=fe,le.J=0+_e+2*J),le.Tc=re,le.lb=K)}if(N=1,K=z.S,J=z.width,re=z.height,K>=c1&&13>K)if(11>K)_=z.f.RGBA,N&=(ae=Math.abs(_.A))*(re-1)+J<=_.size,N&=ae>=J*t6[K],N&=_.eb!=null;else{_=z.f.kb,ae=(J+1)/2,_e=(re+1)/2,le=Math.abs(_.fa),fe=Math.abs(_.Ab);var Oe=Math.abs(_.Db),he=Math.abs(_.lb),Se=he*(re-1)+J;N&=le*(re-1)+J<=_.Fd,N&=fe*(_e-1)+ae<=_.Cd,N=(N&=Oe*(_e-1)+ae<=_.Ed)&le>=J&fe>=ae&Oe>=ae,N&=_.y!=null,N&=_.f!=null,N&=_.ea!=null,K==12&&(N&=he>=J,N&=Se<=_.Tc,N&=_.F!=null)}else N=0;_=N?0:2}}return _!=0||L!=null&&L.fd&&(_=Ff(z)),_}var qp=64,Bf=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],dy=24,ts=32,ws=8,Vp=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Pe("Predictor0","PredictorAdd0"),P.Predictor0=function(){return 4278190080},P.Predictor1=function(_){return _},P.Predictor2=function(_,N,L){return N[L+0]},P.Predictor3=function(_,N,L){return N[L+1]},P.Predictor4=function(_,N,L){return N[L-1]},P.Predictor5=function(_,N,L){return Ie(Ie(_,N[L+1]),N[L+0])},P.Predictor6=function(_,N,L){return Ie(_,N[L-1])},P.Predictor7=function(_,N,L){return Ie(_,N[L+0])},P.Predictor8=function(_,N,L){return Ie(N[L-1],N[L+0])},P.Predictor9=function(_,N,L){return Ie(N[L+0],N[L+1])},P.Predictor10=function(_,N,L){return Ie(Ie(_,N[L-1]),Ie(N[L+0],N[L+1]))},P.Predictor11=function(_,N,L){var z=N[L+0];return 0>=De(z>>24&255,_>>24&255,(N=N[L-1])>>24&255)+De(z>>16&255,_>>16&255,N>>16&255)+De(z>>8&255,_>>8&255,N>>8&255)+De(255&z,255&_,255&N)?z:_},P.Predictor12=function(_,N,L){var z=N[L+0];return(Me((_>>24&255)+(z>>24&255)-((N=N[L-1])>>24&255))<<24|Me((_>>16&255)+(z>>16&255)-(N>>16&255))<<16|Me((_>>8&255)+(z>>8&255)-(N>>8&255))<<8|Me((255&_)+(255&z)-(255&N)))>>>0},P.Predictor13=function(_,N,L){var z=N[L-1];return(tt((_=Ie(_,N[L+0]))>>24&255,z>>24&255)<<24|tt(_>>16&255,z>>16&255)<<16|tt(_>>8&255,z>>8&255)<<8|tt(255&_,255&z))>>>0};var Uu=P.PredictorAdd0;P.PredictorAdd1=Qe,Pe("Predictor2","PredictorAdd2"),Pe("Predictor3","PredictorAdd3"),Pe("Predictor4","PredictorAdd4"),Pe("Predictor5","PredictorAdd5"),Pe("Predictor6","PredictorAdd6"),Pe("Predictor7","PredictorAdd7"),Pe("Predictor8","PredictorAdd8"),Pe("Predictor9","PredictorAdd9"),Pe("Predictor10","PredictorAdd10"),Pe("Predictor11","PredictorAdd11"),Pe("Predictor12","PredictorAdd12"),Pe("Predictor13","PredictorAdd13");var zu=P.PredictorAdd2;Fe("ColorIndexInverseTransform","MapARGB","32b",function(_){return _>>8&255},function(_){return _}),Fe("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(_){return _},function(_){return _>>8&255});var Hp,Uf=P.ColorIndexInverseTransform,za=P.MapARGB,p5=P.VP8LColorIndexInverseTransformAlpha,ql=P.MapAlpha,rl=P.VP8LPredictorsAdd=[];rl.length=16,(P.VP8LPredictors=[]).length=16,(P.VP8LPredictorsAdd_C=[]).length=16,(P.VP8LPredictors_C=[]).length=16;var zf,fy,hy,Gp,Wf,qf,Wu,Mc,qu,Yp,Fi,Vl,Rr,Ir,Na,Ja,$c,py,Kp,o1,TI,OI,RI,II,my,LI,MI,$I,DI=i(511),FI=i(2041),BI=i(225),UI=i(767),zI=0,m5=FI,l1=BI,Vs=UI,jo=DI,c1=0,u1=1,WI=2,d1=3,f1=4,g5=5,qI=6,v5=7,y5=8,h1=9,x5=10,Dne=[2,3,7],Fne=[3,3,11],VI=[280,256,256,256,40],Bne=[0,1,1,1,0],Une=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],zne=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Wne=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],qne=8,b5=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],w5=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],gy=null,Vne=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Hne=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],HI=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Gne=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,25
8455,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],Yne=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,25
8455,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Kne=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,25
vendor: 25,921 bytes, lines 845-869
8455,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Zne=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Vu=[],al=[],Dc=[],Xne=1,GI=2,Hu=[],So=[];$i("UpsampleRgbLinePair",Mf,3),$i("UpsampleBgrLinePair",Up,3),$i("UpsampleRgbaLinePair",cy,4),$i("UpsampleBgraLinePair",Df,4),$i("UpsampleArgbLinePair",$f,4),$i("UpsampleRgba4444LinePair",Di,2),$i("UpsampleRgb565LinePair",zp,2);var Jne=P.UpsampleRgbLinePair,Qne=P.UpsampleBgrLinePair,YI=P.UpsampleRgbaLinePair,KI=P.UpsampleBgraLinePair,ZI=P.UpsampleArgbLinePair,XI=P.UpsampleRgba4444LinePair,ere=P.UpsampleRgb565LinePair,p1=16,m1=1<<p1-1,vy=-227,_5=482,JI=6,tre=(256<<JI)-1,QI=0,nre=i(256),rre=i(256),are=i(256),ire=i(256),sre=i(_5-vy),ore=i(_5-vy);Wl("YuvToRgbRow",Mf,3),Wl("YuvToBgrRow",Up,3),Wl("YuvToRgbaRow",cy,4),Wl("YuvToBgraRow",Df,4),Wl("YuvToArgbRow",$f,4),Wl("YuvToRgba4444Row",Di,2),Wl("YuvToRgb565Row",zp,2);var e6=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],g1=[0,2,8],lre=[8,7,6,4,4,2,2,2,1,1,1,1],cre=1;this.WebPDecodeRGBA=function(_,N,L,z,K){var J=u1,re=new xe,ae=new nn;re.ba=ae,ae.S=J,ae.width=[ae.width],ae.height=[ae.height];var le=ae.width,fe=ae.height,_e=new yt;if(_e==null||_==null)var Oe=2;else t(_e!=null),Oe=s1(_,N,L,_e.width,_e.height,_e.Pd,_e.Qd,_e.format,null);if(Oe!=0?le=0:(le!=null&&(le[0]=_e.width[0]),fe!=null&&(fe[0]=_e.height[0]),le=1),le){ae.width=ae.width[0],ae.height=ae.height[0],z!=null&&(z[0]=ae.width),K!=null&&(K[0]=ae.height);e:{if(z=new dr,(K=new ke).data=_,K.w=N,K.ha=L,K.kd=1,N=[0],t(K!=null),((_=s1(K.data,K.w,K.ha,null,null,null,N,null,K))==0||_==7)&&N[0]&&(_=4),(N=_)==0){if(t(re!=null),z.data=K.data,z.w=K.w+K.offset,z.ha=K.ha-K.offset,z.put=at,z.ac=rt,z.bc=xn,z.ma=re,K.xa){if((_=wo())==null){re=1;break e}if(function(he,Se){var Ce=[0],Ue=[0],Te=[0];t:for(;;){if(he==null)return 0;if(Se==null)return he.a=2,0;if(he.l=Se,he.a=0,W(he.m,Se.data,Se.w,Se.ha),!sr(he.m,Ce,Ue,Te)){he.a=3;break t}if(he.xb=GI,Se.width=Ce[0],Se.height=Ue[0],!qs(Ce[0],Ue[0],1,he,null))break t;return 1}return t(he.a!=0),0}(_,z)){if(z=(N=uy(z.width,z.height,re.Oa,re.ba))==0){t:{z=_;n:for(;;){if(z==null){z=0;break t}if(t(z.s.yc!=null),t(z.s.Ya!=null),t(0<z.s.Wb),t((L=z.l)!=null),t((K=L.ma)!=null),z.xb!=0){if(z.ca=K.ba,z.tb=K.tb,t(z.ca!=null),!_o(K.Oa,L,d1)){z.a=2;break n}if(!Bl(z,L.width)||L.da)break n;if((L.da||Lt(z.ca.S))&&sa(),11>z.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),z.ca.f.kb.F!=null&&sa()),z.Pb&&0<z.s.ua&&z.s.vb.X==null&&!F(z.s.vb,z.s.Wa.Xa)){z.a=1;break n}z.xb=0}if(!Ni(z,z.V,z.Ba,z.c,z.i,L.o,ji))break n;K.Dc=z.Ma,z=1;break t}t(z.a!=0),z=0}z=!z}z&&(N=_.a)}else N=_.a}else{if((_=new aa)==null){re=1;break e}if(_.Fa=K.na,_.P=K.P,_.qc=K.Sa,Ba(_,z)){if((N=uy(z.width,z.height,re.Oa,re.ba))==0){if(_.Aa=0,L=re.Oa,t((K=_)!=null),L!=null){if(0<(le=0>(le=L.Md)?0:100<le?255:255*le/100)){for(fe=_e=0;4>fe;++fe)12>(Oe=K.pb[fe]).lc&&(Oe.ia=le*lre[0>Oe.lc?0:Oe.lc]>>3),_e|=Oe.ia;_e&&(alert("todo:VP8InitRandom"),K.ia=1)}K.Ga=L.Id,100<K.Ga?K.Ga=100:0>K.Ga&&(K.Ga=0)}(function(he,Se){if(he==null)return 0;if(Se==null)return zn(he,2,"NULL VP8Io parameter in VP8Decode().");if(!he.cb&&!Ba(he,Se))return 0;if(t(he.cb),Se.ac==null||Se.ac(Se)){Se.ob&&(he.L=0);var Ce=g1[he.L];if(he.L==2?(he.yb=0,he.zb=0):(he.yb=Se.v-Ce>>4,he.zb=Se.j-Ce>>4,0>he.yb&&(he.yb=0),0>he.zb&&(he.zb=0)),he.Va=Se.o+15+Ce>>4,he.Hb=Se.va+15+Ce>>4,he.Hb>he.za&&(he.Hb=he.za),he.Va>he.Ub&&(he.Va=he.Ub),0<he.L){var Ue=he.ed;for(Ce=0;4>Ce;++Ce){var Te;if(he.Qa.Cb){var We=he.Qa.Lb[Ce];he.Qa.Fb||(We+=Ue.Tb)}else We=Ue.Tb;for(Te=0;1>=Te;++Te){var Ge=he.gd[Ce][Te],it=We;if(Ue.Pc&&(it+=Ue.vd[0],Te&&(it+=Ue.od[0])),0<(it=0>it?0:63<it?63:it)){var Xe=it;0<Ue.wb&&(Xe=4<Ue.wb?Xe>>2:Xe>>1)>9-Ue.wb&&(Xe=9-Ue.wb),1>Xe&&(Xe=1),Ge.dd=Xe,Ge.tc=2*it+Xe,Ge.ld=40<=it?2:15<=it?1:0}else Ge.tc=0;Ge.La=Te}}}Ce=0}else zn(he,6,"Frame setup failed"),Ce=he.a;if(Ce=Ce==0){if(Ce){he.$c=0,0<he.Aa||(he.Ic=cre);t:{Ce=he.Ic,Ue=4*(Xe=he.za);var Ut=32*Xe,kt=Xe+1,Nn=0<he.L?Xe*(0<he.Aa?2:1):0,$t=(he.Aa==2?2:1)*Xe;if((Ge=Ue+832+(Te=3*(16*Ce+g1[he.L])/2*Ut)+(We=he.Fa!=null&&0<he.Fa.length?he.Kc.c*he.Kc.i:0))!=Ge)Ce=0;else{if(Ge>he.Vb){if(he.Vb=0,he.Ec=i(Ge),he.Fc=0,he.Ec==null){Ce=zn(he,1,"no memory during frame initialization.");break t}he.Vb=Ge}Ge=he.Ec,it=he.Fc,he.Ac=Ge,he.Bc=it,it+=Ue,he.Gd=o(Ut,or),he.Hd=0,he.rb=o(kt+1,nt),he.sb=1,he.wa=Nn?o(Nn,Le):null,he.Y=0,he.D.Nb=0,he.D.wa=he.wa,he.D.Y=he.Y,0<he.Aa&&(he.D.Y+=Xe),t(!0),he.oc=Ge,he.pc=it,it+=832,he.ya=o($t,st),he.aa=0,he.D.ya=he.ya,he.D.aa=he.aa,he.Aa==2&&(he.D.aa+=Xe),he.R=16*Xe,he.B=8*Xe,Xe=(Ut=g1[he.L])*he.R,Ut=Ut/2*he.B,he.sa=Ge,he.ta=it+Xe,he.qa=he.sa,he.ra=he.ta+16*Ce*he.R+Ut,he.Ha=he.qa,he.Ia=he.ra+8*Ce*he.B+Ut,he.$c=0,it+=Te,he.mb=We?Ge:null,he.nb=We?it:null,t(it+We<=he.Fc+he.Vb),Mi(he),a(he.Ac,he.Bc,0,Ue),Ce=1}}if(Ce){if(Se.ka=0,Se.y=he.sa,Se.O=he.ta,Se.f=he.qa,Se.N=he.ra,Se.ea=he.Ha,Se.Vd=he.Ia,Se.fa=he.R,Se.Rc=he.B,Se.F=null,Se.J=0,!zI){for(Ce=-255;255>=Ce;++Ce)DI[255+Ce]=0>Ce?-Ce:Ce;for(Ce=-1020;1020>=Ce;++Ce)FI[1020+Ce]=-128>Ce?-128:127<Ce?127:Ce;for(Ce=-112;112>=Ce;++Ce)BI[112+Ce]=-16>Ce?-16:15<Ce?15:Ce;for(Ce=-255;510>=Ce;++Ce)UI[255+Ce]=0>Ce?0:255<Ce?255:Ce;zI=1}Wu=Jb,Mc=JN,Yp=QN,Fi=e5,Vl=Ul,qu=Xb,Rr=t1,Ir=n1,Na=a1,Ja=T,$c=r1,py=Rf,Kp=Y,o1=de,TI=Fp,OI=oy,RI=Bp,II=e1,al[0]=o5,al[1]=Mp,al[2]=i5,al[3]=s5,al[4]=l5,al[5]=Tc,al[6]=c5,al[7]=Oc,al[8]=d5,al[9]=u5,Vu[0]=Qb,Vu[1]=t5,Vu[2]=n5,Vu[3]=r5,Vu[4]=Du,Vu[5]=a5,Vu[6]=Tf,Dc[0]=f5,Dc[1]=ny,Dc[2]=$p,Dc[3]=ry,Dc[4]=h5,Dc[5]=Dp,Dc[6]=ay,Ce=1}else Ce=0}Ce&&(Ce=function(Vn,Qa){for(Vn.M=0;Vn.M<Vn.Va;++Vn.M){var An,Dt=Vn.Jc[Vn.M&Vn.Xb],mt=Vn.m,Aa=Vn;for(An=0;An<Aa.za;++An){var wn=mt,Zn=Aa,Wr=Zn.Ac,Ai=Zn.Bc+4*An,ns=Zn.zc,ma=Zn.ya[Zn.aa+An];if(Zn.Qa.Bb?ma.$b=X(wn,Zn.Pa.jb[0])?2+X(wn,Zn.Pa.jb[2]):X(wn,Zn.Pa.jb[1]):ma.$b=0,Zn.kc&&(ma.Ad=X(wn,Zn.Bd)),ma.Za=!X(wn,145)+0,ma.Za){var Bi=ma.Ob,rs=0;for(Zn=0;4>Zn;++Zn){var ei,Jn=ns[0+Zn];for(ei=0;4>ei;++ei){Jn=Yne[Wr[Ai+ei]][Jn];for(var gr=HI[X(wn,Jn[0])];0<gr;)gr=HI[2*gr+X(wn,Jn[gr])];Jn=-gr,Wr[Ai+ei]=Jn}r(Bi,rs,Wr,Ai,4),rs+=4,ns[0+Zn]=Jn}}else Jn=X(wn,156)?X(wn,128)?1:3:X(wn,163)?2:0,ma.Ob[0]=Jn,a(Wr,Ai,Jn,4),a(ns,0,Jn,4);ma.Dd=X(wn,142)?X(wn,114)?X(wn,183)?1:3:2:0}if(Aa.m.Ka)return zn(Vn,7,"Premature end-of-partition0 encountered.");for(;Vn.ja<Vn.za;++Vn.ja){if(Aa=Dt,wn=(mt=Vn).rb[mt.sb-1],Wr=mt.rb[mt.sb+mt.ja],An=mt.ya[mt.aa+mt.ja],Ai=mt.kc?An.Ad:0)wn.la=Wr.la=0,An.Za||(wn.Na=Wr.Na=0),An.Hc=0,An.Gc=0,An.ia=0;else{var ga,vr;if(wn=Wr,Wr=Aa,Ai=mt.Pa.Xc,ns=mt.ya[mt.aa+mt.ja],ma=mt.pb[ns.$b],Zn=ns.ad,Bi=0,rs=mt.rb[mt.sb-1],Jn=ei=0,a(Zn,Bi,0,384),ns.Za)var ki=0,il=Ai[3];else{gr=i(16);var ka=wn.Na+rs.Na;if(ka=gy(Wr,Ai[1],ka,ma.Eb,0,gr,0),wn.Na=rs.Na=(0<ka)+0,1<ka)Wu(gr,0,Zn,Bi);else{var _s=gr[0]+3>>3;for(gr=0;256>gr;gr+=16)Zn[Bi+gr]=_s}ki=1,il=Ai[0]}var Er=15&wn.la,ti=15&rs.la;for(gr=0;4>gr;++gr){var Hs=1&ti;for(_s=vr=0;4>_s;++_s)Er=Er>>1|(Hs=(ka=gy(Wr,il,ka=Hs+(1&Er),ma.Sc,ki,Zn,Bi))>ki)<<7,vr=vr<<2|(3<ka?3:1<ka?2:Zn[Bi+0]!=0),Bi+=16;Er>>=4,ti=ti>>1|Hs<<7,ei=(ei<<8|vr)>>>0}for(il=Er,ki=ti>>4,ga=0;4>ga;ga+=2){for(vr=0,Er=wn.la>>4+ga,ti=rs.la>>4+ga,gr=0;2>gr;++gr){for(Hs=1&ti,_s=0;2>_s;++_s)ka=Hs+(1&Er),Er=Er>>1|(Hs=0<(ka=gy(Wr,Ai[2],ka,ma.Qc,0,Zn,Bi)))<<3,vr=vr<<2|(3<ka?3:1<ka?2:Zn[Bi+0]!=0),Bi+=16;Er>>=2,ti=ti>>1|Hs<<5}Jn|=vr<<4*ga,il|=Er<<4<<ga,ki|=(240&ti)<<ga}wn.la=il,rs.la=ki,ns.Hc=ei,ns.Gc=Jn,ns.ia=43690&Jn?0:ma.ia,Ai=!(ei|Jn)}if(0<mt.L&&(mt.wa[mt.Y+mt.ja]=mt.gd[An.$b][An.Za],mt.wa[mt.Y+mt.ja].La|=!Ai),Aa.Ka)return zn(Vn,7,"Premature end-of-file encountered.")}if(Mi(Vn),mt=Qa,Aa=1,An=(Dt=Vn).D,wn=0<Dt.L&&Dt.M>=Dt.zb&&Dt.M<=Dt.Va,Dt.Aa==0)t:{if(An.M=Dt.M,An.uc=wn,Wp(Dt,An),Aa=1,An=(vr=Dt.D).Nb,wn=(Jn=g1[Dt.L])*Dt.R,Wr=Jn/2*Dt.B,gr=16*An*Dt.R,_s=8*An*Dt.B,Ai=Dt.sa,ns=Dt.ta-wn+gr,ma=Dt.qa,Zn=Dt.ra-Wr+_s,Bi=Dt.Ha,rs=Dt.Ia-Wr+_s,ti=(Er=vr.M)==0,ei=Er>=Dt.Va-1,Dt.Aa==2&&Wp(Dt,vr),vr.uc)for(Hs=(ka=Dt).D.M,t(ka.D.uc),vr=ka.yb;vr<ka.Hb;++vr){ki=vr,il=Hs;var as=(Gs=(Ei=ka).D).Nb;ga=Ei.R;var Gs=Gs.wa[Gs.Y+ki],Ys=Ei.sa,js=Ei.ta+16*as*ga+16*ki,Ks=Gs.dd,Lr=Gs.tc;if(Lr!=0)if(t(3<=Lr),Ei.L==1)0<ki&&OI(Ys,js,ga,Lr+4),Gs.La&&II(Ys,js,ga,Lr),0<il&&TI(Ys,js,ga,Lr+4),Gs.La&&RI(Ys,js,ga,Lr);else{var Zs=Ei.B,sl=Ei.qa,Vf=Ei.ra+8*as*Zs+8*ki,Fc=Ei.Ha,Ei=Ei.Ia+8*as*Zs+8*ki;as=Gs.ld,0<ki&&(Ir(Ys,js,ga,Lr+4,Ks,as),Ja(sl,Vf,Fc,Ei,Zs,Lr+4,Ks,as)),Gs.La&&(py(Ys,js,ga,Lr,Ks,as),o1(sl,Vf,Fc,Ei,Zs,Lr,Ks,as)),0<il&&(Rr(Ys,js,ga,Lr+4,Ks,as),Na(sl,Vf,Fc,Ei,Zs,Lr+4,Ks,as)),Gs.La&&($c(Ys,js,ga,Lr,Ks,as),Kp(sl,Vf,Fc,Ei,Zs,Lr,Ks,as))}}if(Dt.ia&&alert("todo:DitherRow"),mt.put!=null){if(vr=16*Er,Er=16*(Er+1),ti?(mt.y=Dt.sa,mt.O=Dt.ta+gr,mt.f=Dt.qa,mt.N=Dt.ra+_s,mt.ea=Dt.Ha,mt.W=Dt.Ia+_s):(vr-=Jn,mt.y=Ai,mt.O=ns,mt.f=ma,mt.N=Zn,mt.ea=Bi,mt.W=rs),ei||(Er-=Jn),Er>mt.o&&(Er=mt.o),mt.F=null,mt.J=null,Dt.Fa!=null&&0<Dt.Fa.length&&vr<Er&&(mt.J=Ua(Dt,mt,vr,Er-vr),mt.F=Dt.mb,mt.F==null&&mt.F.length==0)){Aa=zn(Dt,3,"Could not decode alpha data.");break t}vr<mt.j&&(Jn=mt.j-vr,vr=mt.j,t(!(1&Jn)),mt.O+=Dt.R*Jn,mt.N+=Dt.B*(Jn>>1),mt.W+=Dt.B*(Jn>>1),mt.F!=null&&(mt.J+=mt.width*Jn)),vr<Er&&(mt.O+=mt.v,mt.N+=mt.v>>1,mt.W+=mt.v>>1,mt.F!=null&&(mt.J+=mt.v),mt.ka=vr-mt.j,mt.U=mt.va-mt.v,mt.T=Er-vr,Aa=mt.put(mt))}An+1!=Dt.Ic||ei||(r(Dt.sa,Dt.ta-wn,Ai,ns+16*Dt.R,wn),r(Dt.qa,Dt.ra-Wr,ma,Zn+8*Dt.B,Wr),r(Dt.Ha,Dt.Ia-Wr,Bi,rs+8*Dt.B,Wr))}if(!Aa)return zn(Vn,6,"Output aborted.")}return 1}(he,Se)),Se.bc!=null&&Se.bc(Se),Ce&=1}return Ce?(he.cb=0,Ce):0})(_,z)||(N=_.a)}}else N=_.a}N==0&&re.Oa!=null&&re.Oa.fd&&(N=Ff(re.ba))}re=N}J=re!=0?null:11>J?ae.f.RGBA.eb:ae.f.kb.y}else J=null;return J};var t6=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(P,R){for(var C="",I=0;I<4;I++)C+=String.fromCharCode(P[R++]);return C}function d(P,R){return P[R+0]|P[R+1]<<8}function f(P,R){return(P[R+0]|P[R+1]<<8|P[R+2]<<16)>>>0}function p(P,R){return(P[R+0]|P[R+1]<<8|P[R+2]<<16|P[R+3]<<24)>>>0}new c;var h=[0],m=[0],g=[],v=new c,y=e,b=function(P,R){var C={},I=0,D=!1,U=0,q=0;if(C.frames=[],!function(O,M){for(var B=0;B<4;B++)if(O[M+B]!="RIFF".charCodeAt(B))return!0;return!1}(P,R)){for(p(P,R+=4),R+=8;R<P.length;){var Z=u(P,R),H=p(P,R+=4);R+=4;var $=H+(1&H);switch(Z){case"VP8 ":case"VP8L":C.frames[I]===void 0&&(C.frames[I]={}),(V=C.frames[I]).src_off=D?q:R-8,V.src_size=U+H+8,I++,D&&(D=!1,U=0,q=0);break;case"VP8X":(V=C.header={}).feature_flags=P[R];var W=R+4;V.canvas_width=1+f(P,W),W+=3,V.canvas_height=1+f(P,W),W+=3;break;case"ALPH":D=!0,U=$+8,q=R-8;break;case"ANIM":(V=C.header).bgcolor=p(P,R),W=R+4,V.loop_count=d(P,W),W+=2;break;case"ANMF":var ee,V;(V=C.frames[I]={}).offset_x=2*f(P,R),R+=3,V.offset_y=2*f(P,R),R+=3,V.width=1+f(P,R),R+=3,V.height=1+f(P,R),R+=3,V.duration=f(P,R),R+=3,ee=P[R++],V.dispose=1&ee,V.blend=ee>>1&1}Z!="ANMF"&&(R+=$)}return C}}(y,0);b.response=y,b.rgbaoutput=!0,b.dataurl=!1;var w=b.header?b.header:null,j=b.frames?b.frames:null;if(w){w.loop_counter=w.loop_count,h=[w.canvas_height],m=[w.canvas_width];for(var S=0;S<j.length&&j[S].blend!=0;S++);}var A=j[0],E=v.WebPDecodeRGBA(y,A.src_off,A.src_size,m,h);A.rgba=E,A.imgwidth=m[0],A.imgheight=h[0];for(var k=0;k<m[0]*h[0]*4;k++)g[k]=E[k];return this.width=m,this.height=h,this.data=g,this}/** ====================================================================
846 * @license
847 * jsPDF XMP metadata plugin
848 * Copyright (c) 2016 Jussi Utunen, [email protected]
849 *
850 * Permission is hereby granted, free of charge, to any person obtaining
851 * a copy of this software and associated documentation files (the
852 * "Software"), to deal in the Software without restriction, including
853 * without limitation the rights to use, copy, modify, merge, publish,
854 * distribute, sublicense, and/or sell copies of the Software, and to
855 * permit persons to whom the Software is furnished to do so, subject to
856 * the following conditions:
857 *
858 * The above copyright notice and this permission notice shall be
859 * included in all copies or substantial portions of the Software.
860 *
861 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
862 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
863 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
864 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
865 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
866 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
867 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
868 * ====================================================================
869 */function qYe(){var e,t=this.internal.__metadata__.metadata,n=unescape(encodeURIComponent(t));e=this.internal.__metadata__.rawXml?n:'<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceUri+'"><jspdf:metadata>'+n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")+"</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+e.length+" >>"),this.internal.write("stream"),this.internal.write(e),this.internal.write("endstream"),this.internal.write("endobj")}function VYe(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(e){var t,n,r,a,i,o,l,c,u,d=function(O){return O=O||{},this.isStrokeTransparent=O.isStrokeTransparent||!1,this.strokeOpacity=O.strokeOpacity||1,this.strokeStyle=O.strokeStyle||"#000000",this.fillStyle=O.fillStyle||"#000000",this.isFillTransparent=O.isFillTransparent||!1,this.fillOpacity=O.fillOpacity||1,this.font=O.font||"10px sans-serif",this.textBaseline=O.textBaseline||"alphabetic",this.textAlign=O.textAlign||"left",this.lineWidth=O.lineWidth||1,this.lineJoin=O.lineJoin||"miter",this.lineCap=O.lineCap||"butt",this.path=O.path||[],this.transform=O.transform!==void 0?O.transform.clone():new c,this.globalCompositeOperation=O.globalCompositeOperation||"normal",this.globalAlpha=O.globalAlpha||1,this.clip_path=O.clip_path||[],this.currentPoint=O.currentPoint||new o,this.miterLimit=O.miterLimit||10,this.lastPoint=O.lastPoint||new o,this.lineDashOffset=O.lineDashOffset||0,this.lineDash=O.lineDash||[],this.margin=O.margin||[0,0,0,0],this.prevPageLastElemOffset=O.prevPageLastElemOffset||0,this.ignoreClearRect=typeof O.ignoreClearRect!="boolean"||O.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new f(this),t=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,a=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,o=this.internal.Point,l=this.internal.Rectangle,c=this.internal.Matrix,u=new d}]);var f=function(O){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var M=O;Object.defineProperty(this,"pdf",{get:function(){return M}});var B=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return B},set:function(F){B=!!F}});var G=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return G},set:function(F){G=!!F}});var te=0;Object.defineProperty(this,"posX",{get:function(){return te},set:function(F){isNaN(F)||(te=F)}});var ne=0;Object.defineProperty(this,"posY",{get:function(){return ne},set:function(F){isNaN(F)||(ne=F)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(F){var me;typeof F=="number"?me=[F,F,F,F]:((me=new Array(4))[0]=F[0],me[1]=F.length>=2?F[1]:me[0],me[2]=F.length>=3?F[2]:me[0],me[3]=F.length>=4?F[3]:me[1]),u.margin=me}});var ce=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ce},set:function(F){ce=F}});var oe=0;Object.defineProperty(this,"lastBreak",{get:function(){return oe},set:function(F){oe=F}});var X=[];Object.defineProperty(this,"pageBreaks",{get:function(){return X},set:function(F){X=F}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(F){F instanceof d&&(u=F)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(F){u.path=F}});var se=[];Object.defineProperty(this,"ctxStack",{get:function(){return se},set:function(F){se=F}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(F){var me;me=p(F),this.ctx.fillStyle=me.style,this.ctx.isFillTransparent=me.a===0,this.ctx.fillOpacity=me.a,this.pdf.setFillColor(me.r,me.g,me.b,{a:me.a}),this.pdf.setTextColor(me.r,me.g,me.b,{a:me.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(F){var me=p(F);this.ctx.strokeStyle=me.style,this.ctx.isStrokeTransparent=me.a===0,this.ctx.strokeOpacity=me.a,me.a===0?this.pdf.setDrawColor(255,255,255):(me.a,this.pdf.setDrawColor(me.r,me.g,me.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(F){["butt","round","square"].indexOf(F)!==-1&&(this.ctx.lineCap=F,this.pdf.setLineCap(F))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(F){isNaN(F)||(this.ctx.lineWidth=F,this.pdf.setLineWidth(F))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(F){["bevel","round","miter"].indexOf(F)!==-1&&(this.ctx.lineJoin=F,this.pdf.setLineJoin(F))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(F){isNaN(F)||(this.ctx.miterLimit=F,this.pdf.setMiterLimit(F))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(F){this.ctx.textBaseline=F}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(F){["right","end","center","left","start"].indexOf(F)!==-1&&(this.ctx.textAlign=F)}});var Q=null,ye=null,ie=null;Object.defineProperty(this,"fontFaces",{get:function(){return ie},set:function(F){Q=null,ye=null,ie=F}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(F){var me;if(this.ctx.font=F,(me=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(F))!==null){var Ae=me[1];me[2];var Ne=me[3],ve=me[4];me[5];var pe=me[6],Pe=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(ve)[2];ve=Math.floor(Pe==="px"?parseFloat(ve)*this.pdf.internal.scaleFactor:Pe==="em"?parseFloat(ve)*this.pdf.getFontSize():parseFloat(ve)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(ve);var Ee=function(Fe){var It,zt,Wt=[],Jt=Fe.trim();if(Jt==="")return Vk;if(Jt in t9)return[t9[Jt]];for(;Jt!=="";){switch(zt=null,It=(Jt=r9(Jt)).charAt(0)){case'"':case"'":zt=DYe(Jt.substring(1),It);break;default:zt=FYe(Jt)}if(zt===null||(Wt.push(zt[0]),(Jt=r9(zt[1]))!==""&&Jt.charAt(0)!==","))return Vk;Jt=Jt.replace(/^,/,"")}return Wt}(pe);if(this.fontFaces){var Ie=function(Fe,It){var zt=Fe.getFontList(),Wt=JSON.stringify(zt);if(Q===null||ye!==Wt){var Jt=function(Un){var Pt=[];return Object.keys(Un).forEach(function(Tn){Un[Tn].forEach(function(Lt){var Vt=null;switch(Lt){case"bold":Vt={family:Tn,weight:"bold"};break;case"italic":Vt={family:Tn,style:"italic"};break;case"bolditalic":Vt={family:Tn,weight:"bold",style:"italic"};break;case"":case"normal":Vt={family:Tn}}Vt!==null&&(Vt.ref={name:Tn,style:Lt},Pt.push(Vt))})}),Pt}(zt);Q=function(Un){for(var Pt={},Tn=0;Tn<Un.length;++Tn){var Lt=qk(Un[Tn]),Vt=Lt.family,Mn=Lt.stretch,nn=Lt.style,yt=Lt.weight;Pt[Vt]=Pt[Vt]||{},Pt[Vt][Mn]=Pt[Vt][Mn]||{},Pt[Vt][Mn][nn]=Pt[Vt][Mn][nn]||{},Pt[Vt][Mn][nn][yt]=Lt}return Pt}(Jt.concat(It)),ye=Wt}return Q}(this.pdf,this.fontFaces),Me=Ee.map(function(Fe){return{family:Fe,stretch:"normal",weight:Ne,style:Ae}}),tt=function(Fe,It,zt){for(var Wt=(zt=zt||{}).defaultFontFamily||"times",Jt=Object.assign({},$Ye,zt.genericFontFamilies||{}),Un=null,Pt=null,Tn=0;Tn<It.length;++Tn)if(Jt[(Un=qk(It[Tn])).family]&&(Un.family=Jt[Un.family]),Fe.hasOwnProperty(Un.family)){Pt=Fe[Un.family];break}if(!(Pt=Pt||Fe[Wt]))throw new Error("Could not find a font-family for the rule '"+n9(Un)+"' and default family '"+Wt+"'.");if(Pt=function(Lt,Vt){if(Vt[Lt])return Vt[Lt];var Mn=cT[Lt],nn=Mn<=cT.normal?-1:1,yt=e9(Vt,Fte,Mn,nn);if(!yt)throw new Error("Could not find a matching font-stretch value for "+Lt);return yt}(Un.stretch,Pt),Pt=function(Lt,Vt){if(Vt[Lt])return Vt[Lt];for(var Mn=Dte[Lt],nn=0;nn<Mn.length;++nn)if(Vt[Mn[nn]])return Vt[Mn[nn]];throw new Error("Could not find a matching font-style for "+Lt)}(Un.style,Pt),!(Pt=function(Lt,Vt){if(Vt[Lt])return Vt[Lt];if(Lt===400&&Vt[500])return Vt[500];if(Lt===500&&Vt[400])return Vt[400];var Mn=MYe[Lt],nn=e9(Vt,Bte,Mn,Lt<400?-1:1);if(!nn)throw new Error("Could not find a matching font-weight for value "+Lt);return nn}(Un.weight,Pt)))throw new Error("Failed to resolve a font for the rule '"+n9(Un)+"'.");return Pt}(Ie,Me);this.pdf.setFont(tt.ref.name,tt.ref.style)}else{var De="";(Ne==="bold"||parseInt(Ne,10)>=700||Ae==="bold")&&(De="bold"),Ae==="italic"&&(De+="italic"),De.length===0&&(De="normal");for(var Qe="",vt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},ct=0;ct<Ee.length;ct++){if(this.pdf.internal.getFont(Ee[ct],De,{noFallback:!0,disableWarning:!0})!==void 0){Qe=Ee[ct];break}if(De==="bolditalic"&&this.pdf.internal.getFont(Ee[ct],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Qe=Ee[ct],De="bold";else if(this.pdf.internal.getFont(Ee[ct],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Qe=Ee[ct],De="normal";break}}if(Qe===""){for(var ut=0;ut<Ee.length;ut++)if(vt[Ee[ut]]){Qe=vt[Ee[ut]];break}}Qe=Qe===""?"Times":Qe,this.pdf.setFont(Qe,De)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(F){this.ctx.globalCompositeOperation=F}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(F){this.ctx.globalAlpha=F}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(F){this.ctx.lineDashOffset=F,V.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(F){this.ctx.lineDash=F,V.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(F){this.ctx.ignoreClearRect=!!F}})};f.prototype.setLineDash=function(O){this.lineDash=O},f.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},f.prototype.fill=function(){j.call(this,"fill",!1)},f.prototype.stroke=function(){j.call(this,"stroke",!1)},f.prototype.beginPath=function(){this.path=[{type:"begin"}]},f.prototype.moveTo=function(O,M){if(isNaN(O)||isNaN(M))throw Cr.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var B=this.ctx.transform.applyToPoint(new o(O,M));this.path.push({type:"mt",x:B.x,y:B.y}),this.ctx.lastPoint=new o(O,M)},f.prototype.closePath=function(){var O=new o(0,0),M=0;for(M=this.path.length-1;M!==-1;M--)if(this.path[M].type==="begin"&&br(this.path[M+1])==="object"&&typeof this.path[M+1].x=="number"){O=new o(this.path[M+1].x,this.path[M+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(O.x,O.y)},f.prototype.lineTo=function(O,M){if(isNaN(O)||isNaN(M))throw Cr.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var B=this.ctx.transform.applyToPoint(new o(O,M));this.path.push({type:"lt",x:B.x,y:B.y}),this.ctx.lastPoint=new o(B.x,B.y)},f.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),j.call(this,null,!0)},f.prototype.quadraticCurveTo=function(O,M,B,G){if(isNaN(B)||isNaN(G)||isNaN(O)||isNaN(M))throw Cr.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var te=this.ctx.transform.applyToPoint(new o(B,G)),ne=this.ctx.transform.applyToPoint(new o(O,M));this.path.push({type:"qct",x1:ne.x,y1:ne.y,x:te.x,y:te.y}),this.ctx.lastPoint=new o(te.x,te.y)},f.prototype.bezierCurveTo=function(O,M,B,G,te,ne){if(isNaN(te)||isNaN(ne)||isNaN(O)||isNaN(M)||isNaN(B)||isNaN(G))throw Cr.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ce=this.ctx.transform.applyToPoint(new o(te,ne)),oe=this.ctx.transform.applyToPoint(new o(O,M)),X=this.ctx.transform.applyToPoint(new o(B,G));this.path.push({type:"bct",x1:oe.x,y1:oe.y,x2:X.x,y2:X.y,x:ce.x,y:ce.y}),this.ctx.lastPoint=new o(ce.x,ce.y)},f.prototype.arc=function(O,M,B,G,te,ne){if(isNaN(O)||isNaN(M)||isNaN(B)||isNaN(G)||isNaN(te))throw Cr.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to 
869jsPDF.context2d.arc");if(ne=!!ne,!this.ctx.transform.isIdentity){var ce=this.ctx.transform.applyToPoint(new o(O,M));O=ce.x,M=ce.y;var oe=this.ctx.transform.applyToPoint(new o(0,B)),X=this.ctx.transform.applyToPoint(new o(0,0));B=Math.sqrt(Math.pow(oe.x-X.x,2)+Math.pow(oe.y-X.y,2))}Math.abs(te-G)>=2*Math.PI&&(G=0,te=2*Math.PI),this.path.push({type:"arc",x:O,y:M,radius:B,startAngle:G,endAngle:te,counterclockwise:ne})},f.prototype.arcTo=function(O,M,B,G,te){throw new Error("arcTo not implemented.")},f.prototype.rect=function(O,M,B,G){if(isNaN(O)||isNaN(M)||isNaN(B)||isNaN(G))throw Cr.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(O,M),this.lineTo(O+B,M),this.lineTo(O+B,M+G),this.lineTo(O,M+G),this.lineTo(O,M),this.lineTo(O+B,M),this.lineTo(O,M)},f.prototype.fillRect=function(O,M,B,G){if(isNaN(O)||isNaN(M)||isNaN(B)||isNaN(G))throw Cr.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!h.call(this)){var te={};this.lineCap!=="butt"&&(te.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(te.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(O,M,B,G),this.fill(),te.hasOwnProperty("lineCap")&&(this.lineCap=te.lineCap),te.hasOwnProperty("lineJoin")&&(this.lineJoin=te.lineJoin)}},f.prototype.strokeRect=function(O,M,B,G){if(isNaN(O)||isNaN(M)||isNaN(B)||isNaN(G))throw Cr.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");m.call(this)||(this.beginPath(),this.rect(O,M,B,G),this.stroke())},f.prototype.clearRect=function(O,M,B,G){if(isNaN(O)||isNaN(M)||isNaN(B)||isNaN(G))throw Cr.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(O,M,B,G))},f.prototype.save=function(O){O=typeof O!="boolean"||O;for(var M=this.pdf.internal.getCurrentPageInfo().pageNumber,B=0;B<this.pdf.internal.getNumberOfPages();B++)this.pdf.setPage(B+1),this.pdf.internal.out("q");if(this.pdf.setPage(M),O){this.ctx.fontSize=this.pdf.internal.getFontSize();var G=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=G}},f.prototype.restore=function(O){O=typeof O!="boolean"||O;for(var M=this.pdf.internal.getCurrentPageInfo().pageNumber,B=0;B<this.pdf.internal.getNumberOfPages();B++)this.pdf.setPage(B+1),this.pdf.internal.out("Q");this.pdf.setPage(M),O&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},f.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var p=function(O){var M,B,G,te;if(O.isCanvasGradient===!0&&(O=O.getColor()),!O)return{r:0,g:0,b:0,a:0,style:O};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(O))M=0,B=0,G=0,te=0;else{var ne=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(O);if(ne!==null)M=parseInt(ne[1]),B=parseInt(ne[2]),G=parseInt(ne[3]),te=1;else if((ne=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(O))!==null)M=parseInt(ne[1]),B=parseInt(ne[2]),G=parseInt(ne[3]),te=parseFloat(ne[4]);else{if(te=1,typeof O=="string"&&O.charAt(0)!=="#"){var ce=new Tte(O);O=ce.ok?ce.toHex():"#000000"}O.length===4?(M=O.substring(1,2),M+=M,B=O.substring(2,3),B+=B,G=O.substring(3,4),G+=G):(M=O.substring(1,3),B=O.substring(3,5),G=O.substring(5,7)),M=parseInt(M,16),B=parseInt(B,16),G=parseInt(G,16)}}return{r:M,g:B,b:G,a:te,style:O}},h=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},m=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};f.prototype.fillText=function(O,M,B,G){if(isNaN(M)||isNaN(B)||typeof O!="string")throw Cr.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to 
869jsPDF.context2d.fillText");if(G=isNaN(G)?void 0:G,!h.call(this)){var te=$(this.ctx.transform.rotation),ne=this.ctx.transform.scaleX;I.call(this,{text:O,x:M,y:B,scale:ne,angle:te,align:this.textAlign,maxWidth:G})}},f.prototype.strokeText=function(O,M,B,G){if(isNaN(M)||isNaN(B)||typeof O!="string")throw Cr.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!m.call(this)){G=isNaN(G)?void 0:G;var te=$(this.ctx.transform.rotation),ne=this.ctx.transform.scaleX;I.call(this,{text:O,x:M,y:B,scale:ne,renderingMode:"stroke",angle:te,align:this.textAlign,maxWidth:G})}},f.prototype.measureText=function(O){if(typeof O!="string")throw Cr.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var M=this.pdf,B=this.pdf.internal.scaleFactor,G=M.internal.getFontSize(),te=M.getStringUnitWidth(O)*G/M.internal.scaleFactor;return new function(ne){var ce=(ne=ne||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return ce}}),this}({width:te*=Math.round(96*B/72*1e4)/1e4})},f.prototype.scale=function(O,M){if(isNaN(O)||isNaN(M))throw Cr.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var B=new c(O,0,0,M,0,0);this.ctx.transform=this.ctx.transform.multiply(B)},f.prototype.rotate=function(O){if(isNaN(O))throw Cr.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var M=new c(Math.cos(O),Math.sin(O),-Math.sin(O),Math.cos(O),0,0);this.ctx.transform=this.ctx.transform.multiply(M)},f.prototype.translate=function(O,M){if(isNaN(O)||isNaN(M))throw Cr.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var B=new c(1,0,0,1,O,M);this.ctx.transform=this.ctx.transform.multiply(B)},f.prototype.transform=function(O,M,B,G,te,ne){if(isNaN(O)||isNaN(M)||isNaN(B)||isNaN(G)||isNaN(te)||isNaN(ne))throw Cr.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ce=new c(O,M,B,G,te,ne);this.ctx.transform=this.ctx.transform.multiply(ce)},f.prototype.setTransform=function(O,M,B,G,te,ne){O=isNaN(O)?1:O,M=isNaN(M)?0:M,B=isNaN(B)?0:B,G=isNaN(G)?1:G,te=isNaN(te)?0:te,ne=isNaN(ne)?0:ne,this.ctx.transform=new c(O,M,B,G,te,ne)};var g=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};f.prototype.drawImage=function(O,M,B,G,te,ne,ce,oe,X){var se=this.pdf.getImageProperties(O),Q=1,ye=1,ie=1,F=1;G!==void 0&&oe!==void 0&&(ie=oe/G,F=X/te,Q=se.width/G*oe/G,ye=se.height/te*X/te),ne===void 0&&(ne=M,ce=B,M=0,B=0),G!==void 0&&oe===void 0&&(oe=G,X=te),G===void 0&&oe===void 0&&(oe=se.width,X=se.height);var me=this.ctx.transform.decompose(),Ae=$(me.rotate.shx),Ne=new c,ve=(Ne=(Ne=(Ne=Ne.multiply(me.translate)).multiply(me.skew)).multiply(me.scale)).applyToRectangle(new l(ne-M*ie,ce-B*F,G*Q,te*ye));if(this.autoPaging){for(var pe,Pe=v.call(this,ve),Ee=[],Ie=0;Ie<Pe.length;Ie+=1)Ee.indexOf(Pe[Ie])===-1&&Ee.push(Pe[Ie]);w(Ee);for(var Me=Ee[0],tt=Ee[Ee.length-1],De=Me;De<tt+1;De++){this.pdf.setPage(De);var Qe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],vt=De===1?this.posY+this.margin[0]:this.margin[0],ct=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ut=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Fe=De===1?0:ct+(De-2)*ut;if(this.ctx.clip_path.length!==0){var It=this.path;pe=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(pe,this.posX+this.margin[3],-Fe+vt+this.ctx.prevPageLastElemOffset),S.call(this,"fill",!0),this.path=It}var zt=JSON.parse(JSON.stringify(ve));zt=b([zt],this.posX+this.margin[3],-Fe+vt+this.ctx.prevPageLastElemOffset)[0];var Wt=(De>Me||De<tt)&&g.call(this);Wt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Qe,ut,null).clip().discardPath()),this.pdf.addImage(O,"JPEG",zt.x,zt.y,zt.w,zt.h,null,
vendor: 41,937 bytes, lines 869-875
869null,Ae),Wt&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(O,"JPEG",ve.x,ve.y,ve.w,ve.h,null,null,Ae)};var v=function(O,M,B){var G=[];M=M||this.pdf.internal.pageSize.width,B=B||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var te=this.posY+this.ctx.prevPageLastElemOffset;switch(O.type){default:case"mt":case"lt":G.push(Math.floor((O.y+te)/B)+1);break;case"arc":G.push(Math.floor((O.y+te-O.radius)/B)+1),G.push(Math.floor((O.y+te+O.radius)/B)+1);break;case"qct":var ne=W(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x,O.y);G.push(Math.floor((ne.y+te)/B)+1),G.push(Math.floor((ne.y+ne.h+te)/B)+1);break;case"bct":var ce=ee(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x2,O.y2,O.x,O.y);G.push(Math.floor((ce.y+te)/B)+1),G.push(Math.floor((ce.y+ce.h+te)/B)+1);break;case"rect":G.push(Math.floor((O.y+te)/B)+1),G.push(Math.floor((O.y+O.h+te)/B)+1)}for(var oe=0;oe<G.length;oe+=1)for(;this.pdf.internal.getNumberOfPages()<G[oe];)y.call(this);return G},y=function(){var O=this.fillStyle,M=this.strokeStyle,B=this.font,G=this.lineCap,te=this.lineWidth,ne=this.lineJoin;this.pdf.addPage(),this.fillStyle=O,this.strokeStyle=M,this.font=B,this.lineCap=G,this.lineWidth=te,this.lineJoin=ne},b=function(O,M,B){for(var G=0;G<O.length;G++)switch(O[G].type){case"bct":O[G].x2+=M,O[G].y2+=B;case"qct":O[G].x1+=M,O[G].y1+=B;default:O[G].x+=M,O[G].y+=B}return O},w=function(O){return O.sort(function(M,B){return M-B})},j=function(O,M){var B=this.fillStyle,G=this.strokeStyle,te=this.lineCap,ne=this.lineWidth,ce=Math.abs(ne*this.ctx.transform.scaleX),oe=this.lineJoin;if(this.autoPaging){for(var X,se,Q=JSON.parse(JSON.stringify(this.path)),ye=JSON.parse(JSON.stringify(this.path)),ie=[],F=0;F<ye.length;F++)if(ye[F].x!==void 0)for(var me=v.call(this,ye[F]),Ae=0;Ae<me.length;Ae+=1)ie.indexOf(me[Ae])===-1&&ie.push(me[Ae]);for(var Ne=0;Ne<ie.length;Ne++)for(;this.pdf.internal.getNumberOfPages()<ie[Ne];)y.call(this);w(ie);for(var ve=ie[0],pe=ie[ie.length-1],Pe=ve;Pe<pe+1;Pe++){this.pdf.setPage(Pe),this.fillStyle=B,this.strokeStyle=G,this.lineCap=te,this.lineWidth=ce,this.lineJoin=oe;var Ee=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ie=Pe===1?this.posY+this.margin[0]:this.margin[0],Me=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],tt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],De=Pe===1?0:Me+(Pe-2)*tt;if(this.ctx.clip_path.length!==0){var Qe=this.path;X=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(X,this.posX+this.margin[3],-De+Ie+this.ctx.prevPageLastElemOffset),S.call(this,O,!0),this.path=Qe}if(se=JSON.parse(JSON.stringify(Q)),this.path=b(se,this.posX+this.margin[3],-De+Ie+this.ctx.prevPageLastElemOffset),M===!1||Pe===0){var vt=(Pe>ve||Pe<pe)&&g.call(this);vt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ee,tt,null).clip().discardPath()),S.call(this,O,M),vt&&this.pdf.restoreGraphicsState()}this.lineWidth=ne}this.path=Q}else this.lineWidth=ce,S.call(this,O,M),this.lineWidth=ne},S=function(O,M){if((O!=="stroke"||M||!m.call(this))&&(O==="stroke"||M||!h.call(this))){for(var B,G,te=[],ne=this.path,ce=0;ce<ne.length;ce++){var oe=ne[ce];switch(oe.type){case"begin":te.push({begin:!0});break;case"close":te.push({close:!0});break;case"mt":te.push({start:oe,deltas:[],abs:[]});break;case"lt":var X=te.length;if(ne[ce-1]&&!isNaN(ne[ce-1].x)&&(B=[oe.x-ne[ce-1].x,oe.y-ne[ce-1].y],X>0)){for(;X>=0;X--)if(te[X-1].close!==!0&&te[X-1].begin!==!0){te[X-1].deltas.push(B),te[X-1].abs.push(oe);break}}break;case"bct":B=[oe.x1-ne[ce-1].x,oe.y1-ne[ce-1].y,oe.x2-ne[ce-1].x,oe.y2-ne[ce-1].y,oe.x-ne[ce-1].x,oe.y-ne[ce-1].y],te[te.length-1].deltas.push(B);break;case"qct":var se=ne[ce-1].x+2/3*(oe.x1-ne[ce-1].x),Q=ne[ce-1].y+2/3*(oe.y1-ne[ce-1].y),ye=oe.x+2/3*(oe.x1-oe.x),ie=oe.y+2/3*(oe.y1-oe.y),F=oe.x,me=oe.y;B=[se-ne[ce-1].x,Q-ne[ce-1].y,ye-ne[ce-1].x,ie-ne[ce-1].y,F-ne[ce-1].x,me-ne[ce-1].y],te[te.length-1].deltas.push(B);break;case"arc":te.push({deltas:[],abs:[],arc:!0}),Array.isArray(te[te.length-1].abs)&&te[te.length-1].abs.push(oe)}}G=M?null:O==="stroke"?"stroke":"fill";for(var Ae=!1,Ne=0;Ne<te.length;Ne++)if(te[Ne].arc)for(var ve=te[Ne].abs,pe=0;pe<ve.length;pe++){var Pe=ve[pe];Pe.type==="arc"?k.call(this,Pe.x,Pe.y,Pe.radius,Pe.startAngle,Pe.endAngle,Pe.counterclockwise,void 0,M,!Ae):D.call(this,Pe.x,Pe.y),Ae=!0}else if(te[Ne].close===!0)this.pdf.internal.out("h"),Ae=!1;else if(te[Ne].begin!==!0){var Ee=te[Ne].start.x,Ie=te[Ne].start.y;U.call(this,te[Ne].deltas,Ee,Ie),Ae=!0}G&&P.call(this,G),M&&R.call(this)}},A=function(O){var M=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,B=M*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return O-B;case"top":return O+M-B;case"hanging":return O+M-2*B;case"middle":return O+M/2-B;default:return O}},E=function(O){return O+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};f.prototype.createLinearGradient=function(){var O=function(){};return O.colorStops=[],O.addColorStop=function(M,B){this.colorStops.push([M,B])},O.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},O.isCanvasGradient=!0,O},f.prototype.createPattern=function(){return this.createLinearGradient()},f.prototype.createRadialGradient=function(){return this.createLinearGradient()};var k=function(O,M,B,G,te,ne,ce,oe,X){for(var se=Z.call(this,B,G,te,ne),Q=0;Q<se.length;Q++){var ye=se[Q];Q===0&&(X?C.call(this,ye.x1+O,ye.y1+M):D.call(this,ye.x1+O,ye.y1+M)),q.call(this,O,M,ye.x2,ye.y2,ye.x3,ye.y3,ye.x4,ye.y4)}oe?R.call(this):P.call(this,ce)},P=function(O){switch(O){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},R=function(){this.pdf.clip(),this.pdf.discardPath()},C=function(O,M){this.pdf.internal.out(n(O)+" "+r(M)+" m")},I=function(O){var M;switch(O.align){case"right":case"end":M="right";break;case"center":M="center";break;default:M="left"}var B,G,te,ne=this.pdf.getTextDimensions(O.text),ce=A.call(this,O.y),oe=E.call(this,ce)-ne.h,X=this.ctx.transform.applyToPoint(new o(O.x,ce));if(this.autoPaging){var se=this.ctx.transform.decompose(),Q=new c;Q=(Q=(Q=Q.multiply(se.translate)).multiply(se.skew)).multiply(se.scale);for(var ye=this.ctx.transform.applyToRectangle(new l(O.x,ce,ne.w,ne.h)),ie=Q.applyToRectangle(new l(O.x,oe,ne.w,ne.h)),F=v.call(this,ie),me=[],Ae=0;Ae<F.length;Ae+=1)me.indexOf(F[Ae])===-1&&me.push(F[Ae]);w(me);for(var Ne=me[0],ve=me[me.length-1],pe=Ne;pe<ve+1;pe++){this.pdf.setPage(pe);var Pe=pe===1?this.posY+this.margin[0]:this.margin[0],Ee=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ie=this.pdf.internal.pageSize.height-this.margin[2],Me=Ie-this.margin[0],tt=this.pdf.internal.pageSize.width-this.margin[1],De=tt-this.margin[3],Qe=pe===1?0:Ee+(pe-2)*Me;if(this.ctx.clip_path.length!==0){var vt=this.path;B=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(B,this.posX+this.margin[3],-1*Qe+Pe),S.call(this,"fill",!0),this.path=vt}var ct=b([JSON.parse(JSON.stringify(ie))],this.posX+this.margin[3],-Qe+Pe+this.ctx.prevPageLastElemOffset)[0];O.scale>=.01&&(G=this.pdf.internal.getFontSize(),this.pdf.setFontSize(G*O.scale),te=this.lineWidth,this.lineWidth=te*O.scale);var ut=this.autoPaging!=="text";if(ut||ct.y+ct.h<=Ie){if(ut||ct.y>=Pe&&ct.x<=tt){var Fe=ut?O.text:this.pdf.splitTextToSize(O.text,O.maxWidth||tt-ct.x)[0],It=b([JSON.parse(JSON.stringify(ye))],this.posX+this.margin[3],-Qe+Pe+this.ctx.prevPageLastElemOffset)[0],zt=ut&&(pe>Ne||pe<ve)&&g.call(this);zt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],De,Me,null).clip().discardPath()),this.pdf.text(Fe,It.x,It.y,{angle:O.angle,align:M,renderingMode:O.renderingMode}),zt&&this.pdf.restoreGraphicsState()}}else ct.y<Ie&&(this.ctx.prevPageLastElemOffset+=Ie-ct.y);O.scale>=.01&&(this.pdf.setFontSize(G),this.lineWidth=te)}}else O.scale>=.01&&(G=this.pdf.internal.getFontSize(),this.pdf.setFontSize(G*O.scale),te=this.lineWidth,this.lineWidth=te*O.scale),this.pdf.text(O.text,X.x+this.posX,X.y+this.posY,{angle:O.angle,align:M,renderingMode:O.renderingMode,maxWidth:O.maxWidth}),O.scale>=.01&&(this.pdf.setFontSize(G),this.lineWidth=te)},D=function(O,M,B,G){B=B||0,G=G||0,this.pdf.internal.out(n(O+B)+" "+r(M+G)+" l")},U=function(O,M,B){return this.pdf.lines(O,M,B,null,null)},q=function(O,M,B,G,te,ne,ce,oe){this.pdf.internal.out([t(a(B+O)),t(i(G+M)),t(a(te+O)),t(i(ne+M)),t(a(ce+O)),t(i(oe+M)),"c"].join(" "))},Z=function(O,M,B,G){for(var te=2*Math.PI,ne=Math.PI/2;M>B;)M-=te;var ce=Math.abs(B-M);ce<te&&G&&(ce=te-ce);for(var oe=[],X=G?-1:1,se=M;ce>1e-5;){var Q=se+X*Math.min(ce,ne);oe.push(H.call(this,O,se,Q)),ce-=Math.abs(Q-se),se=Q}return oe},H=function(O,M,B){var G=(B-M)/2,te=O*Math.cos(G),ne=O*Math.sin(G),ce=te,oe=-ne,X=ce*ce+oe*oe,se=X+ce*te+oe*ne,Q=4/3*(Math.sqrt(2*X*se)-se)/(ce*ne-oe*te),ye=ce-Q*oe,ie=oe+Q*ce,F=ye,me=-ie,Ae=G+M,Ne=Math.cos(Ae),ve=Math.sin(Ae);return{x1:O*Math.cos(M),y1:O*Math.sin(M),x2:ye*Ne-ie*ve,y2:ye*ve+ie*Ne,x3:F*Ne-me*ve,y3:F*ve+me*Ne,x4:O*Math.cos(B),y4:O*Math.sin(B)}},$=function(O){return 180*O/Math.PI},W=function(O,M,B,G,te,ne){var ce=O+.5*(B-O),oe=M+.5*(G-M),X=te+.5*(B-te),se=ne+.5*(G-ne),Q=Math.min(O,te,ce,X),ye=Math.max(O,te,ce,X),ie=Math.min(M,ne,oe,se),F=Math.max(M,ne,oe,se);return new l(Q,ie,ye-Q,F-ie)},ee=function(O,M,B,G,te,ne,ce,oe){var X,se,Q,ye,ie,F,me,Ae,Ne,ve,pe,Pe,Ee,Ie,Me=B-O,tt=G-M,De=te-B,Qe=ne-G,vt=ce-te,ct=oe-ne;for(se=0;se<41;se++)Ne=(me=(Q=O+(X=se/40)*Me)+X*((ie=B+X*De)-Q))+X*(ie+X*(te+X*vt-ie)-me),ve=(Ae=(ye=M+X*tt)+X*((F=G+X*Qe)-ye))+X*(F+X*(ne+X*ct-F)-Ae),se==0?(pe=Ne,Pe=ve,Ee=Ne,Ie=ve):(pe=Math.min(pe,Ne),Pe=Math.min(Pe,ve),Ee=Math.max(Ee,Ne),Ie=Math.max(Ie,ve));return new l(Math.round(pe),Math.round(Pe),Math.round(Ee-pe),Math.round(Ie-Pe))},V=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var O,M,B=(O=this.ctx.lineDash,M=this.ctx.lineDashOffset,JSON.stringify({lineDash:O,lineDashOffset:M}));this.prevLineDash!==B&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=B)}}})(qt.API),function(e){var t=function(o){var l,c,u,d,f,p,h,m,g,v;for(c=[],u=0,d=(o+=l="\0\0\0\0".slice(o.length%4||4)).length;d>u;u+=4)(f=(o.charCodeAt(u)<<24)+(o.charCodeAt(u+1)<<16)+(o.charCodeAt(u+2)<<8)+o.charCodeAt(u+3))!==0?(p=(f=((f=((f=((f=(f-(v=f%85))/85)-(g=f%85))/85)-(m=f%85))/85)-(h=f%85))/85)%85,c.push(p+33,h+33,m+33,g+33,v+33)):c.push(122);return function(y,b){for(var w=b;w>0;w--)y.pop()}(c,l.length),String.fromCharCode.apply(String,c)+"~>"},n=function(o){var l,c,u,d,f,p=String,h="length",m=255,g="charCodeAt",v="slice",y="replace";for(o[v](-2),o=o[v](0,-2)[y](/\s/g,"")[y]("z","!!!!!"),u=[],d=0,f=(o+=l="uuuuu"[v](o[h]%5||5))[h];f>d;d+=5)c=52200625*(o[g](d)-33)+614125*(o[g](d+1)-33)+7225*(o[g](d+2)-33)+85*(o[g](d+3)-33)+(o[g](d+4)-33),u.push(m&c>>24,m&c>>16,m&c>>8,m&c);return function(b,w){for(var j=w;j>0;j--)b.pop()}(u,l[h]),p.fromCharCode.apply(p,u)},r=function(o){return o.split("").map(function(l){return("0"+l.charCodeAt().toString(16)).slice(-2)}).join("")+">"},a=function(o){var l=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),l.test(o)===!1)return"";for(var c="",u=0;u<o.length;u+=2)c+=String.fromCharCode("0x"+(o[u]+o[u+1]));return c},i=function(o){for(var l=new Uint8Array(o.length),c=o.length;c--;)l[c]=o.charCodeAt(c);return(l=Z4(l)).reduce(function(u,d){return u+String.fromCharCode(d)},"")};e.processDataByFilters=function(o,l){var c=0,u=o||"",d=[];for(typeof(l=l||[])=="string"&&(l=[l]),c=0;c<l.length;c+=1)switch(l[c]){case"ASCII85Decode":case"/ASCII85Decode":u=n(u),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=t(u),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=a(u),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=r(u),d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=i(u),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+l[c]+'" is not implemented')}return{data:u,reverseChain:d.reverse().join(" ")}}}(qt.API),function(e){e.loadFile=function(t,n,r){return function(a,i,o){i=i!==!1,o=typeof o=="function"?o:function(){};var l=void 0;try{l=function(c,u,d){var f=new XMLHttpRequest,p=0,h=function(m){var g=m.length,v=[],y=String.fromCharCode;for(p=0;p<g;p+=1)v.push(y(255&m.charCodeAt(p)));return v.join("")};if(f.open("GET",c,!u),f.overrideMimeType("text/plain; charset=x-user-defined"),u===!1&&(f.onload=function(){f.status===200?d(h(this.responseText)):d(void 0)}),f.send(null),u&&f.status===200)return h(f.responseText)}(a,i,o)}catch{}return l}(t,n,r)},e.allowFsRead=void 0,e.loadImageFile=e.loadFile}(qt.API),function(e){function t(){return(ln.html2canvas?Promise.resolve(ln.html2canvas):c_(()=>import("./html2canvas.esm-CBrSDip1.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load html2canvas: "+l))}).then(function(l){return l.default?l.default:l})}function n(){return(ln.DOMPurify?Promise.resolve(ln.DOMPurify):c_(()=>import("./purify.es-C5KSVp3G.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load dompurify: "+l))}).then(function(l){return l.default?l.default:l})}var r=function(l){var c=br(l);return c==="undefined"?"undefined":c==="string"||l instanceof String?"string":c==="number"||l instanceof Number?"number":c==="function"||l instanceof Function?"function":l&&l.constructor===Array?"array":l&&l.nodeType===1?"element":c==="object"?"object":"unknown"},a=function(l,c){var u=document.createElement(l);for(var d in c.className&&(u.className=c.className),c.innerHTML&&c.dompurify&&(u.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)u.style[d]=c.style[d];return u},i=function l(c,u){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),f=c.firstChild;f;f=f.nextSibling)u!==!0&&f.nodeType===1&&f.nodeName==="SCRIPT"||d.appendChild(l(f,u));return c.nodeType===1&&(c.nodeName==="CANVAS"?(d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(d.value=c.value),d.addEventListener("load",function(){d.scrollTop=c.scrollTop,d.scrollLeft=c.scrollLeft},!0)),d},o=function l(c){var u=Object.assign(l.convert(Promise.resolve()),JSON.parse(JSON.stringify(l.template))),d=l.convert(Promise.resolve(),u);return(d=d.setProgress(1,l,1,[l])).set(c)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(l,c){return l.__proto__=c||o.prototype,l},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(l,c){return this.then(function(){switch(c=c||function(u){switch(r(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(l),c){case"string":return this.then(n).then(function(u){return this.set({src:a("div",{innerHTML:l,dompurify:u})})});case"element":return this.set({src:l});case"canvas":return this.set({canvas:l});case"img":return this.set({img:l});default:return this.error("Unknown source type.")}})},o.prototype.to=function(l){switch(l){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var l={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},c=i(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(l.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:l}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(t).then(function(c){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,c(this.prop.container,u)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(t).then(function(c){var u=this.opt.jsPDF,d=this.opt.fontFaces,f=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,p=Object.assign({async:!0,allowTaint:!0,scale:f,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete p.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=d,d)for(var h=0;h<d.length;++h){var m=d[h],g=m.src.find(function(v){return v.format==="truetype"});g&&u.addFont(g.url,m.ref.name,m.ref.style)}return p.windowHeight=p.windowHeight||0,p.windowHeight=p.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):p.windowHeight,u.context2d.save(!0),c(this.prop.container,p)}).then(function(c){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var l=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=l})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(l,c,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(l,c):this.outputPdf(l,c)},o.prototype.outputPdf=function(l,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(l,c)})},o.prototype.outputImg=function(l){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(l){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+l+'" is not supported.'}})},o.prototype.save=function(l){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(l?{filename:l}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(l){if(r(l)!=="object")return this;var c=Object.keys(l||{}).map(function(u){if(u in o.template.prop)return function(){this.prop[u]=l[u]};switch(u){case"margin":return this.setMargin.bind(this,l.margin);case"jsPDF":return function(){return this.opt.jsPDF=l.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,l.pageSize);default:return function(){this.opt[u]=l[u]}}},this);return this.then(function(){return this.thenList(c)})},o.prototype.get=function(l,c){return this.then(function(){var u=l in o.template.prop?this.prop[l]:this.opt[l];return c?c(u):u})},o.prototype.setMargin=function(l){return this.then(function(){switch(r(l)){case"number":l=[l,l,l,l];case"array":if(l.length===2&&(l=[l[0],l[1],l[0],l[1]]),l.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=l}).then(this.setPageSize)},o.prototype.setPageSize=function(l){function c(u,d){return Math.floor(u*d/72*96)}return this.then(function(){(l=l||qt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(l.inner={width:l.width-this.opt.margin[1]-this.opt.margin[3],height:l.height-this.opt.margin[0]-this.opt.margin[2]},l.inner.px={width:c(l.inner.width,l.k),height:c(l.inner.height,l.k)},l.inner.ratio=l.inner.height/l.inner.width),this.prop.pageSize=l})},o.prototype.setProgress=function(l,c,u,d){return l!=null&&(this.progress.val=l),c!=null&&(this.progress.state=c),u!=null&&(this.progress.n=u),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(l,c,u,d){return this.setProgress(l?this.progress.val+l:null,c||null,u?this.progress.n+u:null,d?this.progress.stack.concat(d):null)},o.prototype.then=function(l,c){var u=this;return this.thenCore(l,c,function(d,f){return u.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(p){return u.updateProgress(null,d),p}).then(d,f).then(function(p){return u.updateProgress(1),p})})},o.prototype.thenCore=function(l,c,u){u=u||Promise.prototype.then;var d=this;l&&(l=l.bind(d)),c&&(c=c.bind(d));var f=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?d:o.convert(Object.assign({},d),Promise.prototype),p=u.call(f,l,c);return o.convert(p,d.__proto__)},o.prototype.thenExternal=function(l,c){return Promise.prototype.then.call(this,l,c)},o.prototype.thenList=function(l){var c=this;return l.forEach(function(u){c=c.thenCore(u)}),c},o.prototype.catch=function(l){l&&(l=l.bind(this));var c=Promise.prototype.catch.call(this,l);return o.convert(c,this)},o.prototype.catchExternal=function(l){return Promise.prototype.catch.call(this,l)},o.prototype.error=function(l){return this.then(function(){throw new Error(l)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,qt.getPageSize=function(l,c,u){if(br(l)==="object"){var d=l;l=d.orientation,c=d.unit||c,u=d.format||u}c=c||"mm",u=u||"a4",l=(""+(l||"P")).toLowerCase();var f,p=(""+u).toLowerCase(),h={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(c){case"pt":f=1;break;case"mm":f=72/25.4;break;case"cm":f=72/2.54;break;case"in":f=72;break;case"px":f=.75;break;case"pc":case"em":f=12;break;case"ex":f=6;break;default:throw"Invalid unit: "+c}var m,g=0,v=0;if(h.hasOwnProperty(p))g=h[p][1]/f,v=h[p][0]/f;else try{g=u[1],v=u[0]}catch{throw new Error("Invalid format: "+u)}if(l==="p"||l==="portrait")l="p",v>g&&(m=v,v=g,g=m);else{if(l!=="l"&&l!=="landscape")throw"Invalid orientation: "+l;l="l",g>v&&(m=v,v=g,g=m)}return{width:v,height:g,unit:c,k:f,orientation:l}},e.html=function(l,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(qk):null;var u=new o(c);return c.worker?u:u.from(l).doCallback()}}(qt.API),qt.API.addJS=function(e){var t,n,r=function(a){for(var i="",o=0;o<a.length;o++){var l=a[o];if(l==="("||l===")"){for(var c=0,u=o-1;u>=0&&a[u]==="\\";u--)c++;i+=c%2==0?"\\"+l:l}else i+=l}return i}(e);return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),n=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+r+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){t!==void 0&&n!==void 0&&this.internal.out("/Names <</JavaScript "+t+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var a=n.outline.render().split(/\r\n/),i=0;i<a.length;i++){var o=a[i],l=r.exec(o);if(l!=null){var c=l[1];n.internal.newObjectDeferredBegin(c,!1)}n.internal.write(o)}if(this.outline.createNamedDestinations){var u=this.internal.pages.length,d=[];for(i=0;i<u;i++){var f=n.internal.newObject();d.push(f);var p=n.internal.getPageInfo(i+1);n.internal.write("<< /D["+p.objId+" 0 R /XYZ null null null]>> endobj")}var h=n.internal.newObject();for(n.internal.write("<< /Names [ "),i=0;i<d.length;i++)n.internal.write("(page_"+(i+1)+")"+d[i]+" 0 R");n.internal.write(" ] >>","endobj"),t=n.internal.newObject(),n.internal.write("<< /Dests "+h+" 0 R"),n.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var n=this;n.outline.root.children.length>0&&(n.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&n.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,a,i){var o={title:a,options:i,children:[]};return r==null&&(r=this.root),r.children.push(o),o},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var a=0;a<r.children.length;a++)this.genIds_r(r.children[a])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var a=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i<r.children.length;i++){var o=r.children[i];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(r)),i>0&&this.line("/Prev "+this.makeRef(r.children[i-1])),i<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[i+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var l=this.count=this.count_r({count:0},o);if(l>0&&this.line("/Count "+l),o.options&&o.options.pageNumber){var c=n.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+a(0)+" 0]")}this.objEnd()}for(var u=0;u<r.children.length;u++)this.renderItems(r.children[u])},n.outline.line=function(r){this.ctx.val+=r+`\r
870`},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r
871`+r.id+` 0 obj\r
872<<\r
873`},n.outline.objEnd=function(){this.ctx.val+=`>> \r
874endobj\r
875`},n.outline.count_r=function(r,a){for(var i=0;i<a.children.length;i++)r.count++,this.count_r(r,a.children[i]);return r.count}}])}(qt.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(n,r,a,i,o,l){var c,u=this.decode.DCT_DECODE,d=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=o||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,c=function(f){for(var p,h=256*f.charCodeAt(4)+f.charCodeAt(5),m=f.length,g={width:0,height:0,numcomponents:1},v=4;v<m;v+=2){if(v+=h,t.indexOf(f.charCodeAt(v+1))!==-1){p=256*f.charCodeAt(v+5)+f.charCodeAt(v+6),g={width:256*f.charCodeAt(v+7)+f.charCodeAt(v+8),height:p,numcomponents:f.charCodeAt(v+9)};break}h=256*f.charCodeAt(v+2)+f.charCodeAt(v+3)}return g}(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),c.numcomponents){case 1:l=this.color_spaces.DEVICE_GRAY;break;case 4:l=this.color_spaces.DEVICE_CMYK;break;case 3:l=this.color_spaces.DEVICE_RGB}d={data:n,width:c.width,height:c.height,colorSpace:l,bitsPerComponent:8,filter:u,index:r,alias:a}}return d}}(qt.API),qt.API.processPNG=function(e,t,n,r){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var a,i=_Ye(e,{checkCrc:!0}),o=i.width,l=i.height,c=i.channels,u=i.palette,d=i.depth;a=u&&c===1?function(k){for(var P=k.width,R=k.height,C=k.data,I=k.palette,D=k.depth,U=!1,q=[],Z=[],H=void 0,$=!1,W=0,ee=0;ee<I.length;ee++){var V=Q7(I[ee],4),O=V[0],M=V[1],B=V[2],G=V[3];q.push(O,M,B),G!=null&&(G===0?(W++,Z.length<1&&Z.push(ee)):G<255&&($=!0))}if($||W>1){U=!0,Z=void 0;var te=P*R;H=new Uint8Array(te);for(var ne=new DataView(C.buffer),ce=0;ce<te;ce++){var oe=Hk(ne,ce,D),X=Q7(I[oe],4)[3];H[ce]=X}}else W===0&&(Z=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:U?8:void 0,colorBytes:C,alphaBytes:H,needSMask:U,palette:q,mask:Z}}(i):c===2||c===4?function(k){for(var P=k.data,R=k.width,C=k.height,I=k.channels,D=k.depth,U=I===2?"DeviceGray":"DeviceRGB",q=I-1,Z=R*C,H=q,$=Z*H,W=1*Z,ee=Math.ceil($*D/8),V=Math.ceil(W*D/8),O=new Uint8Array(ee),M=new Uint8Array(V),B=new DataView(P.buffer),G=new DataView(O.buffer),te=new DataView(M.buffer),ne=!1,ce=0;ce<Z;ce++){for(var oe=ce*I,X=0;X<H;X++)f9(G,Hk(B,oe+X,D),ce*H+X,D);var se=Hk(B,oe+H,D);se<(1<<D)-1&&(ne=!0),f9(te,se,1*ce,D)}return{colorSpace:U,colorsPerPixel:q,sMaskBitsPerComponent:ne?D:void 0,colorBytes:O,alphaBytes:M,needSMask:ne}}(i):function(k){var P=k.data,R=k.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:R,colorsPerPixel:R==="DeviceGray"?1:3,colorBytes:P instanceof Uint16Array?function(C){for(var I=C.length,D=new Uint8Array(2*I),U=new DataView(D.buffer,D.byteOffset,D.byteLength),q=0;q<I;q++)U.setUint16(2*q,C[q],!1);return D}(P):P,needSMask:!1}}(i);var f,p,h,m=a,g=m.colorSpace,v=m.colorsPerPixel,y=m.sMaskBitsPerComponent,b=m.colorBytes,w=m.alphaBytes,j=m.needSMask,S=m.palette,A=m.mask,E=null;return r!==qt.API.image_compression.NONE&&typeof Z4=="function"?(E=function(k){var P;switch(k){case qt.API.image_compression.FAST:P=11;break;case qt.API.image_compression.MEDIUM:P=13;break;case qt.API.image_compression.SLOW:P=14;break;default:P=12}return P}(r),f=this.decode.FLATE_DECODE,p="/Predictor ".concat(E," /Colors ").concat(v," /BitsPerComponent ").concat(d," /Columns ").concat(o),e=o9(b,Math.ceil(o*v*d/8),v,d,r),j&&(h=o9(w,Math.ceil(o*y/8),1,y,r))):(f=void 0,p=void 0,e=b,j&&(h=w)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(h&&this.__addimage__.isArrayBuffer(h)||this.__addimage__.isArrayBufferView(h))&&(h=this.__addimage__.arrayBufferToBinaryString(h)),{alias:n,data:e,index:t,filter:f,decodeParameters:p,transparency:A,palette:S,sMask:h,predictor:E,width:o,height:l,bitsPerComponent:d,sMaskBitsPerComponent:y,colorSpace:g}}},function(e){e.processGIF89A=function(t,n,r,a){var i=new WYe(t),o=i.width,l=i.height,c=[];i.decodeAndBlitFrameRGBA(0,c);var u={data:c,width:o,height:l},d=new Gk(100).encode(u,100);return e.processJPEG.call(this,d,n,r,a)},e.processGIF87A=e.processGIF89A}(qt.API),ul.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:a,green:r,blue:n,quad:i}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},ul.prototype.parseBGR=function(){this.pos=this.offset;var e="bit"+this.bitPP,t=this.width*this.height*4;if(t>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(t);try{this[e]()}catch(n){Cr.log("bit decode error:"+n)}},ul.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,a=0;a<t;a++)for(var i=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+8*a*4,l=0;l<8&&8*a+l<this.width;l++){var c=this.palette[i>>7-l&1];this.data[o+4*l]=c.blue,this.data[o+4*l+1]=c.green,this.data[o+4*l+2]=c.red,this.data[o+4*l+3]=255}n!==0&&(this.pos+=4-n)}},ul.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,a=0;a<e;a++){var i=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+2*a*4,l=i>>4,c=15&i,u=this.palette[l];if(this.data[o]=u.blue,this.data[o+1]=u.green,this.data[o+2]=u.red,this.data[o+3]=255,2*a+1>=this.width)break;u=this.palette[c],this.data[o+4]=u.blue,this.data[o+4+1]=u.green,this.data[o+4+2]=u.red,this.data[o+4+3]=255}t!==0&&(this.pos+=4-t)}},ul.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var a=this.datav.getUint8(this.pos++,!0),i=n*this.width*4+4*r;if(a<this.palette.length){var o=this.palette[a];this.data[i]=o.red,this.data[i+1]=o.green,this.data[i+2]=o.blue,this.data[i+3]=255}else this.data[i]=255,this.data[i+1]=255,this.data[i+2]=255,this.data[i+3]=255}e!==0&&(this.pos+=4-e)}},ul.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var i=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(i&t)/t*255|0,l=(i>>5&t)/t*255|0,c=(i>>10&t)/t*255|0,u=i>>15?255:0,d=r*this.width*4+4*a;this.data[d]=c,this.data[d+1]=l,this.data[d+2]=o,this.data[d+3]=u}this.pos+=e}},ul.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var a=this.bottom_up?r:this.height-1-r,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var l=(o&t)/t*255|0,c=(o>>5&n)/n*255|0,u=(o>>11)/t*255|0,d=a*this.width*4+4*i;this.data[d]=u,this.data[d+1]=c,this.data[d+2]=l,this.data[d+3]=255}this.pos+=e}},ul.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*n;this.data[o]=i,this.data[o+1]=a,this.data[o+2]=r,this.data[o+3]=255}this.pos+=this.width%4}},ul.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),l=t*this.width*4+4*n;this.data[l]=i,this.data[l+1]=a,this.data[l+2]=r,this.data[l+3]=o}},ul.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,n,r,a){var i=new ul(t,!1),o=i.width,l=i.height,c={data:i.getData(),width:o,height:l},u=new Gk(100).encode(c,100);return e.processJPEG.call(this,u,n,r,a)}}(qt.API),p9.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,n,r,a){var i=new p9(t),o=i.width,l=i.height,c={data:i.getData(),width:o,height:l},u=new Gk(100).encode(c,100);return e.processJPEG.call(this,u,n,r,a)}}(qt.API),qt.API.processRGBA=function(e,t,n){for(var r=e.data,a=r.length,i=new Uint8Array(a/4*3),o=new Uint8Array(a/4),l=0,c=0,u=0;u<a;u+=4){var d=r[u],f=r[u+1],p=r[u+2],h=r[u+3];i[l++]=d,i[l++]=f,i[l++]=p,o[c++]=h}var m=this.__addimage__.arrayBufferToBinaryString(i);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:m,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},qt.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Sp
875ain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},pm=qt.API,Rw=pm.getCharWidthsArray=function(e,t){var n,r,a=(t=t||{}).font||this.internal.getFont(),i=t.fontSize||this.internal.getFontSize(),o=t.charSpace||this.internal.getCharSpace(),l=t.widths?t.widths:a.metadata.Unicode.widths,c=l.fof?l.fof:1,u=t.kerning?t.kerning:a.metadata.Unicode.kerning,d=u.fof?u.fof:1,f=t.doKerning!==!1,p=0,h=e.length,m=0,g=l[0]||c,v=[];for(n=0;n<h;n++)r=e.charCodeAt(n),typeof a.metadata.widthOfString=="function"?v.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(r))+o*(1e3/i)||0)/1e3):(p=f&&br(u[r])==="object"&&!isNaN(parseInt(u[r][m],10))?u[r][m]/d:0,v.push((l[r]||g)/c+p)),m=r;return v},a9=pm.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),r=t.font||this.internal.getFont(),a=t.charSpace||this.internal.getCharSpace();return pm.processArabic&&(e=pm.processArabic(e)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(e,n,a)/n:Rw.apply(this,arguments).reduce(function(i,o){return i+o},0)},i9=function(e,t,n,r){for(var a=[],i=0,o=e.length,l=0;i!==o&&l+t[i]<n;)l+=t[i],i++;a.push(e.slice(0,i));var c=i;for(l=0;i!==o;)l+t[i]>r&&(a.push(e.slice(c,i)),l=0,c=i),l+=t[i],i++;return c!==i&&a.push(e.slice(c,i)),a},s9=function(e,t,n){n||(n={});var r,a,i,o,l,c,u,d=[],f=[d],p=n.textIndent||0,h=0,m=0,g=e.split(" "),v=Rw.apply(this,[" ",n])[0];if(c=n.lineIndent===-1?g[0].length+2:n.lineIndent||0){var y=Array(c).join(" "),b=[];g.map(function(j){(j=j.split(/\s*\n/)).length>1?b=b.concat(j.map(function(S,A){return(A&&S.length?`
876`:"")+S})):b.push(j[0])}),g=b,c=a9.apply(this,[y,n])}for(i=0,o=g.length;i<o;i++){var w=0;if(r=g[i],c&&r[0]==`
877`&&(r=r.substr(1),w=1),p+h+(m=(a=Rw.apply(this,[r,n])).reduce(function(j,S){return j+S},0))>t||w){if(m>t){for(l=i9.apply(this,[r,a,t-(p+h),t]),d.push(l.shift()),d=[l.pop()];l.length;)f.push([l.shift()]);m=a.slice(r.length-(d[0]?d[0].length:0)).reduce(function(j,S){return j+S},0)}else d=[r];f.push(d),p=m+c,h=v}else d.push(r),p+=h+m,h=v}return u=c?function(j,S){return(S?y:"")+j.join(" ")}:function(j){return j.join(" ")},f.map(u)},pm.splitTextToSize=function(e,t,n){var r,a=(n=n||{}).fontSize||this.internal.getFontSize(),i=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var f=this.internal.getFont(d.fontName,d.fontStyle),p="Unicode";return f.metadata[p]?{widths:f.metadata[p].widths||{0:1},kerning:f.metadata[p].kerning||{}}:{font:f.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*t/a;i.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/a:0,i.lineIndent=n.lineIndent;var l,c,u=[];for(l=0,c=r.length;l<c;l++)u=u.concat(s9.apply(this,[r[l],o,i]));return u},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",n="klmnopqrstuvwxyz",r={},a={},i=0;i<16;i++)r[n[i]]=t[i],a[t[i]]=n[i];var o=function(p){return"0x"+parseInt(p,10).toString(16)},l=e.__fontmetrics__.compress=function(p){var h,m,g,v,y=["{"];for(var b in p){if(h=p[b],isNaN(parseInt(b,10))?m="'"+b+"'":(b=parseInt(b,10),m=(m=o(b).slice(2)).slice(0,-1)+a[m.slice(-1)]),typeof h=="number")h<0?(g=o(h).slice(3),v="-"):(g=o(h).slice(2),v=""),g=v+g.slice(0,-1)+a[g.slice(-1)];else{if(br(h)!=="object")throw new Error("Don't know what to do with value type "+br(h)+".");g=l(h)}y.push(m+g)}return y.push("}"),y.join("")},c=e.__fontmetrics__.uncompress=function(p){if(typeof p!="string")throw new Error("Invalid argument passed to uncompress.");for(var h,m,g,v,y={},b=1,w=y,j=[],S="",A="",E=p.length-1,k=1;k<E;k+=1)(v=p[k])=="'"?h?(g=h.join(""),h=void 0):h=[]:h?h.push(v):v=="{"?(j.push([w,g]),w={},g=void 0):v=="}"?((m=j.pop())[0][m[1]]=w,g=void 0,w=m[0]):v=="-"?b=-1:g===void 0?r.hasOwnProperty(v)?(S+=r[v],g=parseInt(S,16)*b,b=1,S=""):S+=v:r.hasOwnProperty(v)?(A+=r[v],w[g]=parseInt(A,16)*b,b=1,g=void 0,A=""):A+=v;return y},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:u,"Courier-Bold":u,"Courier-BoldOblique":u,"Courier-Oblique":u,Helvetica:u,"Helvetica-Bold":u,"Helvetica-BoldOblique":u,"Helvetica-Oblique":u,"Times-Roman":u,"Times-Bold":u,"Times-BoldItalic":u,"Times-Italic":u}},f
vendor: 14,727 bytes, line 877
877={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":c("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(
vendor: 46,654 bytes, lines 877-905
877p){var h=p.font,m=f.Unicode[h.postScriptName];m&&(h.metadata.Unicode={},h.metadata.Unicode.widths=m.widths,h.metadata.Unicode.kerning=m.kerning);var g=d.Unicode[h.postScriptName];g&&(h.metadata.Unicode.encoding=g,h.encoding=g.codePages[0])}])}(qt.API),function(e){var t=function(n){for(var r=n.length,a=new Uint8Array(r),i=0;i<r;i++)a[i]=n.charCodeAt(i);return a};e.API.events.push(["addFont",function(n){var r=void 0,a=n.font,i=n.instance;if(!a.isStandardFont){if(i===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if(typeof(r=i.existsFileInVFS(a.postScriptName)===!1?i.loadFile(a.postScriptName):i.getFileFromVFS(a.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");(function(o,l){l=/^\x00\x01\x00\x00/.test(l)?t(l):t(f_(l)),o.metadata=e.API.TTFFont.open(l),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(a,r)}}])}(qt),qt.API.addSvgAsImage=function(e,t,n,r,a,i,o,l){if(isNaN(t)||isNaN(n))throw Cr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(a))throw Cr.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=r,c.height=a;var u=c.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,c.width,c.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return(ln.canvg?Promise.resolve(ln.canvg):c_(()=>import("./index.es-Ds9zNN7U.js"),[])).catch(function(p){return Promise.reject(new Error("Could not load canvg: "+p))}).then(function(p){return p.default?p.default:p}).then(function(p){return p.fromString(u,e,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(p){return p.render(d)}).then(function(){f.addImage(c.toDataURL("image/jpeg",1),t,n,r,a,o,l)})},qt.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var a=0;a<this.internal.pages[r].length;a++)this.internal.pages[r][a]=this.internal.pages[r][a].replace(t,n);return this},qt.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,a,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},l=Object.keys(o),c=[],u=0,d=0,f=0;function p(m,g){var v,y=!1;for(v=0;v<m.length;v+=1)m[v]===g&&(y=!0);return y}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var h=l.length;for(f=0;f<h;f+=1)n[l[f]].value=n[l[f]].defaultValue,n[l[f]].explicitSet=!1}if(br(e)==="object"){for(a in e)if(i=e[a],p(l,a)&&i!==void 0){if(n[a].type==="boolean"&&typeof i=="boolean")n[a].value=i;else if(n[a].type==="name"&&p(n[a].valueSet,i))n[a].value=i;else if(n[a].type==="integer"&&Number.isInteger(i))n[a].value=i;else if(n[a].type==="array"){for(u=0;u<i.length;u+=1)if(r=!0,i[u].length===1&&typeof i[u][0]=="number")c.push(String(i[u]-1));else if(i[u].length>1){for(d=0;d<i[u].length;d+=1)typeof i[u][d]!="number"&&(r=!1);r===!0&&c.push([i[u][0]-1,i[u][1]-1].join(" "))}n[a].value="["+c.join(" ")+"]"}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var m,g=[];for(m in n)n[m].explicitSet===!0&&(n[m].type==="name"?g.push("/"+m+" /"+n[m].value):g.push("/"+m+" "+n[m].value));g.length!==0&&this.internal.write(`/ViewerPreferences
878<<
879`+g.join(`
880`)+`
881>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},qt.API.addMetadata=function(e,t){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:e,namespaceUri:t??"http://jspdf.default.namespaceuri/",rawXml:typeof t=="boolean"&&t},this.internal.events.subscribe("putCatalog",VYe),this.internal.events.subscribe("postPutResources",qYe)),this},function(e){var t=e.API,n=t.pdfEscape16=function(i,o){for(var l,c=o.metadata.Unicode.widths,u=["","0","00","000","0000"],d=[""],f=0,p=i.length;f<p;++f){if(l=o.metadata.characterToGlyph(i.charCodeAt(f)),o.metadata.glyIdsUsed.push(l),o.metadata.toUnicode[l]=i.charCodeAt(f),c.indexOf(l)==-1&&(c.push(l),c.push([parseInt(o.metadata.widthOfGlyph(l),10)])),l=="0")return d.join("");l=l.toString(16),d.push(u[4-l.length],l)}return d.join("")},r=function(i){var o,l,c,u,d,f,p;for(d=`/CIDInit /ProcSet findresource begin
88212 dict begin
883begincmap
884/CIDSystemInfo <<
885  /Registry (Adobe)
886  /Ordering (UCS)
887  /Supplement 0
888>> def
889/CMapName /Adobe-Identity-UCS def
890/CMapType 2 def
8911 begincodespacerange
892<0000><ffff>
893endcodespacerange`,c=[],f=0,p=(l=Object.keys(i).sort(function(h,m){return h-m})).length;f<p;f++)o=l[f],c.length>=100&&(d+=`
894`+c.length+` beginbfchar
895`+c.join(`
896`)+`
897endbfchar`,c=[]),i[o]!==void 0&&i[o]!==null&&typeof i[o].toString=="function"&&(u=("0000"+i[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),c.push("<"+o+"><"+u+">"));return c.length&&(d+=`
898`+c.length+` beginbfchar
899`+c.join(`
900`)+`
901endbfchar
902`),d+`endcmap
903CMapName currentdict /CMap defineresource pop
904end
905end`};t.events.push(["putFont",function(i){(function(o){var l=o.font,c=o.out,u=o.newObject,d=o.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="Identity-H"){for(var f=l.metadata.Unicode.widths,p=l.metadata.subset.encode(l.metadata.glyIdsUsed,1),h="",m=0;m<p.length;m++)h+=String.fromCharCode(p[m]);var g=u();d({data:h,addLength1:!0,objectId:g}),c("endobj");var v=u();d({data:r(l.metadata.toUnicode),addLength1:!0,objectId:v}),c("endobj");var y=u();c("<<"),c("/Type /FontDescriptor"),c("/FontName /"+Sm(l.fontName)),c("/FontFile2 "+g+" 0 R"),c("/FontBBox "+e.API.PDFObject.convert(l.metadata.bbox)),c("/Flags "+l.metadata.flags),c("/StemV "+l.metadata.stemV),c("/ItalicAngle "+l.metadata.italicAngle),c("/Ascent "+l.metadata.ascender),c("/Descent "+l.metadata.decender),c("/CapHeight "+l.metadata.capHeight),c(">>"),c("endobj");var b=u();c("<<"),c("/Type /Font"),c("/BaseFont /"+Sm(l.fontName)),c("/FontDescriptor "+y+" 0 R"),c("/W "+e.API.PDFObject.convert(f)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+l.encoding+")"),c(">>"),c(">>"),c("endobj"),l.objectNumber=u(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+v+" 0 R"),c("/BaseFont /"+Sm(l.fontName)),c("/Encoding /"+l.encoding),c("/DescendantFonts ["+b+" 0 R]"),c(">>"),c("endobj"),l.isAlreadyPutted=!0}})(i)}]),t.events.push(["putFont",function(i){(function(o){var l=o.font,c=o.out,u=o.newObject,d=o.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="WinAnsiEncoding"){for(var f=l.metadata.rawData,p="",h=0;h<f.length;h++)p+=String.fromCharCode(f[h]);var m=u();d({data:p,addLength1:!0,objectId:m}),c("endobj");var g=u();d({data:r(l.metadata.toUnicode),addLength1:!0,objectId:g}),c("endobj");var v=u();c("<<"),c("/Descent "+l.metadata.decender),c("/CapHeight "+l.metadata.capHeight),c("/StemV "+l.metadata.stemV),c("/Type /FontDescriptor"),c("/FontFile2 "+m+" 0 R"),c("/Flags 96"),c("/FontBBox "+e.API.PDFObject.convert(l.metadata.bbox)),c("/FontName /"+Sm(l.fontName)),c("/ItalicAngle "+l.metadata.italicAngle),c("/Ascent "+l.metadata.ascender),c(">>"),c("endobj"),l.objectNumber=u();for(var y=0;y<l.metadata.hmtx.widths.length;y++)l.metadata.hmtx.widths[y]=parseInt(l.metadata.hmtx.widths[y]*(1e3/l.metadata.head.unitsPerEm));c("<</Subtype/TrueType/Type/Font/ToUnicode "+g+" 0 R/BaseFont/"+Sm(l.fontName)+"/FontDescriptor "+v+" 0 R/Encoding/"+l.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(l.metadata.hmtx.widths)+">>"),c("endobj"),l.isAlreadyPutted=!0}})(i)}]);var a=function(i){var o,l=i.text||"",c=i.x,u=i.y,d=i.options||{},f=i.mutex||{},p=f.pdfEscape,h=f.activeFontKey,m=f.fonts,g=h,v="",y=0,b="",w=m[g].encoding;if(m[g].encoding!=="Identity-H")return{text:l,x:c,y:u,options:d,mutex:f};for(b=l,g=h,Array.isArray(l)&&(b=l[0]),y=0;y<b.length;y+=1)m[g].metadata.hasOwnProperty("cmap")&&(o=m[g].metadata.cmap.unicode.codeMap[b[y].charCodeAt(0)]),o||b[y].charCodeAt(0)<256&&m[g].metadata.hasOwnProperty("Unicode")?v+=b[y]:v+="";var j="";return parseInt(g.slice(1))<14||w==="WinAnsiEncoding"?j=p(v,g).split("").map(function(S){return S.charCodeAt(0).toString(16)}).join(""):w==="Identity-H"&&(j=n(v,m[g])),f.isHex=!0,{text:j,x:c,y:u,options:d,mutex:f}};t.events.push(["postProcessText",function(i){var o=i.text||"",l=[],c={text:o,x:i.x,y:i.y,options:i.options,mutex:i.mutex};if(Array.isArray(o)){var u=0;for(u=0;u<o.length;u+=1)Array.isArray(o[u])&&o[u].length===3?l.push([a(Object.assign({},c,{text:o[u][0]})).text,o[u][1],o[u][2]]):l.push(a(Object.assign({},c,{text:o[u]})).text);i.text=l}else i.text=a(Object.assign({},c,{text:o})).text}])}(qt),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0},e.addFileToVFS=function(n,r){return t.call(this),this.internal.vFS[n]=r,this},e.getFileFromVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}}(qt.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(r){var a,i,o,l,c,u,d,f=t,p=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],h=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],m={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},g={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},v=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],y=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),b=!1,w=0;this.__bidiEngine__={};var j=function(C){var I=C.charCodeAt(),D=I>>8,U=g[D];return U!==void 0?f[256*U+(255&I)]:D===252||D===253?"AL":y.test(D)?"L":D===8?"R":"N"},S=function(C){for(var I,D=0;D<C.length;D++){if((I=j(C.charAt(D)))==="L")return!1;if(I==="R")return!0}return!1},A=function(C,I,D,U){var q,Z,H,$,W=I[U];switch(W){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":b=!1;break;case"N":case"AN":break;case"EN":b&&(W="AN");break;case"AL":b=!0,W="R";break;case"WS":case"BN":W="N";break;case"CS":U<1||U+1>=I.length||(q=D[U-1])!=="EN"&&q!=="AN"||(Z=I[U+1])!=="EN"&&Z!=="AN"?W="N":b&&(Z="AN"),W=Z===q?Z:"N";break;case"ES":W=(q=U>0?D[U-1]:"B")==="EN"&&U+1<I.length&&I[U+1]==="EN"?"EN":"N";break;case"ET":if(U>0&&D[U-1]==="EN"){W="EN";break}if(b){W="N";break}for(H=U+1,$=I.length;H<$&&I[H]==="ET";)H++;W=H<$&&I[H]==="EN"?"EN":"N";break;case"NSM":if(o&&!l){for($=I.length,H=U+1;H<$&&I[H]==="NSM";)H++;if(H<$){var ee=C[U],V=ee>=1425&&ee<=2303||ee===64286;if(q=I[H],V&&(q==="R"||q==="AL")){W="R";break}}}W=U<1||(q=I[U-1])==="B"?"N":D[U-1];break;case"B":b=!1,a=!0,W=w;break;case"S":i=!0,W="N"}return W},E=function(C,I,D){var U=C.split("");return D&&k(U,D,{hiLevel:w}),U.reverse(),I&&I.reverse(),U.join("")},k=function(C,I,D){var U,q,Z,H,$,W=-1,ee=C.length,V=0,O=[],M=w?h:p,B=[];for(b=!1,a=!1,i=!1,q=0;q<ee;q++)B[q]=j(C[q]);for(Z=0;Z<ee;Z++){if($=V,O[Z]=A(C,B,O,Z),U=240&(V=M[$][m[O[Z]]]),V&=15,I[Z]=H=M[V][5],U>0)if(U===16){for(q=W;q<Z;q++)I[q]=1;W=-1}else W=-1;if(M[V][6])W===-1&&(W=Z);else if(W>-1){for(q=W;q<Z;q++)I[q]=H;W=-1}B[Z]==="B"&&(I[Z]=0),D.hiLevel|=H}i&&function(G,te,ne){for(var ce=0;ce<ne;ce++)if(G[ce]==="S"){te[ce]=w;for(var oe=ce-1;oe>=0&&G[oe]==="WS";oe--)te[oe]=w}}(B,I,ee)},P=function(C,I,D,U,q){if(!(q.hiLevel<C)){if(C===1&&w===1&&!a)return I.reverse(),void(D&&D.reverse());for(var Z,H,$,W,ee=I.length,V=0;V<ee;){if(U[V]>=C){for($=V+1;$<ee&&U[$]>=C;)$++;for(W=V,H=$-1;W<H;W++,H--)Z=I[W],I[W]=I[H],I[H]=Z,D&&(Z=D[W],D[W]=D[H],D[H]=Z);V=$}V++}}},R=function(C,I,D){var U=C.split(""),q={hiLevel:w};return D||(D=[]),k(U,D,q),function(Z,H,$){if($.hiLevel!==0&&d)for(var W,ee=0;ee<Z.length;ee++)H[ee]===1&&(W=v.indexOf(Z[ee]))>=0&&(Z[ee]=v[W+1])}(U,D,q),P(2,U,I,D,q),P(1,U,I,D,q),U.join("")};return this.__bidiEngine__.doBidiReorder=function(C,I,D){if(function(q,Z){if(Z)for(var H=0;H<q.length;H++)Z[H]=H;l===void 0&&(l=S(q)),u===void 0&&(u=S(q))}(C,I),o||!c||u)if(o&&c&&l^u)w=l?1:0,C=E(C,I,D);else if(!o&&c&&u)w=l?1:0,C=R(C,I,D),C=E(C,I);else if(!o||l||c||u){if(o&&!c&&l^u)C=E(C,I),l?(w=0,C=R(C,I,D)):(w=1,C=R(C,I,D),C=E(C,I));else if(o&&l&&!c&&u)w=1,C=R(C,I,D),C=E(C,I);else if(!o&&!c&&l^u){var U=d;l?(w=1,C=R(C,I,D),w=0,d=!1,C=R(C,I,D),d=U):(w=0,C=R(C,I,D),C=E(C,I),w=1,d=!1,C=R(C,I,D),d=U,C=E(C,I))}}else w=0,C=R(C,I,D);else w=l?1:0,C=R(C,I,D);return C},this.__bidiEngine__.setOptions=function(C){C&&(o=C.isInputVisual,c=C.isOutputVisual,l=C.isInputRtl,u=C.isOutputRtl,d=C.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(r){var a=r.text;r.x,r.y;var i=r.options||{};r.mutex,i.lang;var o=[];if(i.isInputVisual=typeof i.isInputVisual!="boolean"||i.isInputVisual,n.setOptions(i),Object.prototype.toString.call(a)==="[object Array]"){var l=0;for(o=[],l=0;l<a.length;l+=1)Object.prototype.toString.call(a[l])==="[object Array]"?o.push([n.doBidiReorder(a[l][0]),a[l][1],a[l][2]]):o.push([n.doBidiReorder(a[l])]);r.text=o}else r.text=n.doBidiReorder(a);n.setOptions({isInputVisual:!0})}])}(qt),qt.API.TTFFont=function(){function e(t){var n;if(this.rawData=t,n=this.contents=new hf(t),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new sKe(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new HYe(this.contents),this.head=new YYe(this),this.name=new QYe(this),this.cmap=new zte(this),this.toUnicode={},this.hhea=new KYe(this),this.maxp=new eKe(this),this.hmtx=new tKe(this),this.post=new XYe(this),this.os2=new ZYe(this),this.loca=new iKe(this),this.glyf=new nKe(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var t,n,r,a,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,l,c,u;for(u=[],o=0,l=(c=this.bbox).length;o<l;o++)t=c[o],u.push(Math.round(t*this.scaleFactor));return u}).call(this),this.stemV=0,this.post.exists?(r=255&(a=this.post.italic_angle),32768&(n=a>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(i=this.familyClass)===1||i===2||i===3||i===4||i===5||i===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(t){var n;return((n=this.cmap.unicode)!=null?n.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*n},e.prototype.widthOfString=function(t,n,r){var a,i,o,l;for(o=0,i=0,l=(t=""+t).length;0<=l?i<l:i>l;i=0<=l?++i:--i)a=t.charCodeAt(i),o+=this.widthOfGlyph(this.characterToGlyph(a))+r*(1e3/n)||0;return o*(n/1e3)},e.prototype.lineHeight=function(t,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*t},e}();var Fl,hf=function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var n,r;for(r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},e.prototype.writeString=function(t){var n,r,a;for(a=[],n=0,r=t.length;0<=r?n<r:n>r;n=0<=r?++n:--n)a.push(this.writeByte(t.charCodeAt(n)));return a},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,n,r,a,i,o,l,c;return t=this.readByte(),n=this.readByte(),r=this.readByte(),a=this.readByte(),i=this.readByte(),o=this.readByte(),l=this.readByte(),c=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^a)+16777216*(255^i)+65536*(255^o)+256*(255^l)+(255^c)+1):72057594037927940*t+281474976710656*n+1099511627776*r+4294967296*a+16777216*i+65536*o+256*l+c},e.prototype.writeLongLong=function(t){var n,r;return n=Math.floor(t/4294967296),r=4294967295&t,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var n,r;for(n=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)n.push(this.readByte());return n},e.prototype.write=function(t){var n,r,a,i;for(i=[],r=0,a=t.length;r<a;r++)n=t[r],i.push(this.writeByte(n));return i},e}(),HYe=function(){var e;function t(n){var r,a,i;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},a=0,i=this.tableCount;0<=i?a<i:a>i;a=0<=i?++a:--a)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return t.prototype.encode=function(n){var r,a,i,o,l,c,u,d,f,p,h,m,g;for(g in h=Object.keys(n).length,c=Math.log(2),f=16*Math.floor(Math.log(h)/c),o=Math.floor(f/c),d=16*h-f,(a=new hf).writeInt(this.scalarType),a.writeShort(h),a.writeShort(f),a.writeShort(o),a.writeShort(d),i=16*h,u=a.pos+i,l=null,m=[],n)for(p=n[g],a.writeString(g),a.writeInt(e(p)),a.writeInt(u),a.writeInt(p.length),m=m.concat(p),g==="head"&&(l=u),u+=p.length;u%4;)m.push(0),u++;return a.write(m),r=2981146554-e(a.data),a.pos=l+8,a.writeUInt32(r),a.data},e=function(n){var r,a,i,o;for(n=Wte.call(n);n.length%4;)n.push(0);for(i=new hf(n),a=0,r=0,o=n.length;r<o;r=r+=4)a+=i.readUInt32();return 4294967295&a},t}(),GYe={}.hasOwnProperty,kc=function(e,t){for(var n in t)GYe.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};Fl=function(){function e(t){var n;this.file=t,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var YYe=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="head",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},e.prototype.encode=function(t){var n;return(n=new hf).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t),n.writeShort(this.glyphDataFormat),n.data},e}(),m9=function(){function e(t,n){var r,a,i,o,l,c,u,d,f,p,h,m,g,v,y,b,w;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),f=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(c=0;c<256;++c)this.codeMap[c]=t.readByte();break;case 4:for(h=t.readUInt16(),p=h/2,t.pos+=6,i=function(){var j,S;for(S=[],c=j=0;0<=p?j<p:j>p;c=0<=p?++j:--j)S.push(t.readUInt16());return S}(),t.pos+=2,g=function(){var j,S;for(S=[],c=j=0;0<=p?j<p:j>p;c=0<=p?++j:--j)S.push(t.readUInt16());return S}(),u=function(){var j,S;for(S=[],c=j=0;0<=p?j<p:j>p;c=0<=p?++j:--j)S.push(t.readUInt16());return S}(),d=function(){var j,S;for(S=[],c=j=0;0<=p?j<p:j>p;c=0<=p?++j:--j)S.push(t.readUInt16());return S}(),a=(this.length-t.pos+this.offset)/2,l=function(){var j,S;for(S=[],c=j=0;0<=a?j<a:j>a;c=0<=a?++j:--j)S.push(t.readUInt16());return S}(),c=y=0,w=i.length;y<w;c=++y)for(v=i[c],r=b=m=g[c];m<=v?b<=v:b>=v;r=m<=v?++b:--b)d[c]===0?o=r+u[c]:(o=l[d[c]/2+(r-m)-(p-c)]||0)!==0&&(o+=u[c]),this.codeMap[r]=65535&o}t.pos=f}return e.encode=function(t,n){var r,a,i,o,l,c,u,d,f,p,h,m,g,v,y,b,w,j,S,A,E,k,P,R,C,I,D,U,q,Z,H,$,W,ee,V,O,M,B,G,te,ne,ce,oe,X,se,Q;switch(U=new hf,o=Object.keys(t).sort(function(ye,ie){return ye-ie}),n){case"macroman":for(g=0,v=function(){var ye=[];for(m=0;m<256;++m)ye.push(0);return ye}(),b={0:0},i={},q=0,W=o.length;q<W;q++)b[oe=t[a=o[q]]]==null&&(b[oe]=++g),i[a]={old:t[a],new:b[t[a]]},v[a]=b[t[a]];return U.writeUInt16(1),U.writeUInt16(0),U.writeUInt32(12),U.writeUInt16(0),U.writeUInt16(262),U.writeUInt16(0),U.write(v),{charMap:i,subtable:U.data,maxGlyphID:g+1};case"unicode":for(I=[],f=[],w=0,b={},r={},y=u=null,Z=0,ee=o.length;Z<ee;Z++)b[S=t[a=o[Z]]]==null&&(b[S]=++w),r[a]={old:S,new:b[S]},l=b[S]-a,y!=null&&l===u||(y&&f.push(y),I.push(a),u=l),y=a;for(y&&f.push(y),f.push(65535),I.push(65535),R=2*(P=I.length),k=2*Math.pow(Math.log(P)/Math.LN2,2),p=Math.log(k/2)/Math.LN2,E=2*P-k,c=[],A=[],h=[],m=H=0,V=I.length;H<V;m=++H){if(C=I[m],d=f[m],C===65535){c.push(0),A.push(0);break}if(C-(D=r[C].new)>=32768)for(c.push(0),A.push(2*(h.length+P-m)),a=$=C;C<=d?$<=d:$>=d;a=C<=d?++$:--$)h.push(r[a].new);else c.push(D-C),A.push(0)}for(U.writeUInt16(3),U.writeUInt16(1),U.writeUInt32(12),U.writeUInt16(4),U.writeUInt16(16+8*P+2*h.length),U.writeUInt16(0),U.writeUInt16(R),U.writeUInt16(k),U.writeUInt16(p),U.writeUInt16(E),ne=0,O=f.length;ne<O;ne++)a=f[ne],U.writeUInt16(a);for(U.writeUInt16(0),ce=0,M=I.length;ce<M;ce++)a=I[ce],U.writeUInt16(a);for(X=0,B=c.length;X<B;X++)l=c[X],U.writeUInt16(l);for(se=0,G=A.length;se<G;se++)j=A[se],U.writeUInt16(j);for(Q=0,te=h.length;Q<te;Q++)g=h[Q],U.writeUInt16(g);return{charMap:r,subtable:U.data,maxGlyphID:w+1}}},e}(),zte=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="cmap",e.prototype.parse=function(t){var n,r,a;for(t.pos=this.offset,this.version=t.readUInt16(),a=t.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=a?r<a:r>a;r=0<=a?++r:--r)n=new m9(t,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},e.encode=function(t,n){var r,a;return n==null&&(n="macroman"),r=m9.encode(t,n),(a=new hf).writeUInt16(0),a.writeUInt16(1),r.table=a.data.concat(r.subtable),r},e}(),KYe=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="hhea",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e}(),ZYe=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="OS/2",e.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var n,r;for(r=[],n=0;n<10;++n)r.push(t.readByte());return r}(),this.charRange=function(){var n,r;for(r=[],n=0;n<4;++n)r.push(t.readInt());return r}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var n,r;for(r=[],n=0;n<2;n=++n)r.push(t.readInt());return r}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},e}(),XYe=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="post",e.prototype.parse=function(t){var n,r,a;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var i;for(r=t.readUInt16(),this.glyphNameIndex=[],i=0;0<=r?i<r:i>r;i=0<=r?++i:--i)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],a=[];t.pos<this.offset+this.length;)n=t.readByte(),a.push(this.names.push(t.readString(n)));return a;case 151552:return r=t.readUInt16(),this.offsets=t.read(r);case 262144:return this.map=(function(){var o,l,c;for(c=[],i=o=0,l=this.file.maxp.numGlyphs;0<=l?o<l:o>l;i=0<=l?++o:--o)c.push(t.readUInt32());return c}).call(this)}},e}(),JYe=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},QYe=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="name",e.prototype.parse=function(t){var n,r,a,i,o,l,c,u,d,f,p;for(t.pos=this.offset,t.readShort(),n=t.readShort(),l=t.readShort(),r=[],i=0;0<=n?i<n:i>n;i=0<=n?++i:--i)r.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+l+t.readShort()});for(c={},i=d=0,f=r.length;d<f;i=++d)a=r[i],t.pos=a.offset,u=t.readString(a.length),o=new JYe(u,a),c[p=a.nameID]==null&&(c[p]=[]),c[a.nameID].push(o);this.strings=c,this.copyright=c[0],this.fontFamily=c[1],this.fontSubfamily=c[2],this.uniqueSubfamily=c[3],this.fontName=c[4],this.version=c[5];try{this.postscriptName=c[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=c[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=c[7],this.manufacturer=c[8],this.designer=c[9],this.description=c[10],this.vendorUrl=c[11],this.designerUrl=c[12],this.license=c[13],this.licenseUrl=c[14],this.preferredFamily=c[15],this.preferredSubfamily=c[17],this.compatibleFull=c[18],this.sampleText=c[19]},e}(),eKe=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="maxp",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},e}(),tKe=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="hmtx",e.prototype.parse=function(t){var n,r,a,i,o,l,c;for(t.pos=this.offset,this.metrics=[],n=0,l=this.file.hhea.numberOfMetrics;0<=l?n<l:n>l;n=0<=l?++n:--n)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(a=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var u,d;for(d=[],n=u=0;0<=a?u<a:u>a;n=0<=a?++u:--u)d.push(t.readInt16());return d}(),this.widths=(function(){var u,d,f,p;for(p=[],u=0,d=(f=this.metrics).length;u<d;u++)i=f[u],p.push(i.advance);return p}).call(this),r=this.widths[this.widths.length-1],c=[],n=o=0;0<=a?o<a:o>a;n=0<=a?++o:--o)c.push(this.widths.push(r));return c},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e}(),Wte=[].slice,nKe=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var n,r,a,i,o,l,c,u,d,f;return t in this.cache?this.cache[t]:(i=this.file.loca,n=this.file.contents,r=i.indexOf(t),(a=i.lengthOf(t))===0?this.cache[t]=null:(n.pos=this.offset+r,o=(l=new hf(n.read(a))).readShort(),u=l.readShort(),f=l.readShort(),c=l.readShort(),d=l.readShort(),this.cache[t]=o===-1?new aKe(l,u,f,c,d):new rKe(l,o,u,f,c,d),this.cache[t]))},e.prototype.encode=function(t,n,r){var a,i,o,l,c;for(o=[],i=[],l=0,c=n.length;l<c;l++)a=t[n[l]],i.push(o.length),a&&(o=o.concat(a.encode(r)));return i.push(o.length),{table:o,offsets:i}},e}(),rKe=function(){function e(t,n,r,a,i,o){this.raw=t,this.numberOfContours=n,this.xMin=r,this.yMin=a,this.xMax=i,this.yMax=o,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),aKe=function(){function e(t,n,r,a,i){var o,l;for(this.raw=t,this.xMin=n,this.yMin=r,this.xMax=a,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;l=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&l;)o.pos+=1&l?4:2,128&l?o.pos+=8:64&l?o.pos+=4:8&l&&(o.pos+=2)}return e.prototype.encode=function(){var t,n,r;for(n=new hf(Wte.call(this.raw.data)),t=0,r=this.glyphIDs.length;t<r;++t)n.pos=this.glyphOffsets[t];return n.data},e}(),iKe=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return kc(e,Fl),e.prototype.tag="loca",e.prototype.parse=function(t){var n,r;return t.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var a,i;for(i=[],r=0,a=this.length;r<a;r+=2)i.push(2*t.readUInt16());return i}).call(this):(function(){var a,i;for(i=[],r=0,a=this.length;r<a;r+=4)i.push(t.readUInt32());return i}).call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,n){for(var r=new Uint32Array(this.offsets.length),a=0,i=0,o=0;o<r.length;++o)if(r[o]=a,i<n.length&&n[i]==o){++i,r[o]=a;var l=this.offsets[o],c=this.offsets[o+1]-l;c>0&&(a+=c)}for(var u=new Array(4*r.length),d=0;d<r.length;++d)u[4*d+3]=255&r[d],u[4*d+2]=(65280&r[d])>>8,u[4*d+1]=(16711680&r[d])>>16,u[4*d]=(4278190080&r[d])>>24;return u},e}(),sKe=function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,n,r,a,i;for(n in a=this.font.cmap.tables[0].codeMap,t={},i=this.subset)r=i[n],t[n]=a[r];return t},e.prototype.glyphsFor=function(t){var n,r,a,i,o,l,c;for(a={},o=0,l=t.length;o<l;o++)a[i=t[o]]=this.font.glyf.glyphFor(i);for(i in n=[],a)(r=a[i])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(i in c=this.glyphsFor(n))r=c[i],a[i]=r;return a},e.prototype.encode=function(t,n){var r,a,i,o,l,c,u,d,f,p,h,m,g,v,y;for(a in r=zte.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(t),h={0:0},y=r.charMap)h[(c=y[a]).old]=c.new;for(m in p=r.maxGlyphID,o)m in h||(h[m]=p++);return d=function(b){var w,j;for(w in j={},b)j[b[w]]=w;return j}(h),f=Object.keys(d).sort(function(b,w){return b-w}),g=function(){var b,w,j;for(j=[],b=0,w=f.length;b<w;b++)l=f[b],j.push(d[l]);return j}(),i=this.font.glyf.encode(o,g,h),u=this.font.loca.encode(i.offsets,g),v={cmap:this.font.cmap.raw(),glyf:i.table,loca:u,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(v["OS/2"]=this.font.os2.raw()),this.font.directory.encode(v)},e}();qt.API.PDFObject=function(){var e;function t(){}return e=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},t.convert=function(n){var r,a,i,o;
905if(Array.isArray(n))return"["+function(){var l,c,u;for(u=[],l=0,c=n.length;l<c;l++)r=n[l],u.push(t.convert(r));return u}().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n!=null&&n.isString)return"("+n+")";if(n instanceof Date)return"(D:"+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(a in i=["<<"],n)o=n[a],i.push("/"+a+" "+t.convert(o));return i.push(">>"),i.join(`
906`)}return""+n},t}();const oKe=({guardianIndex:e,guardianName:t,applicationId:n,data:r,onUpdate:a,onSubmit:i})=>{const[o,l]=x.useState(!1),c=x.useRef(null),u=x.useRef(null);x.useEffect(()=>{if(c.current&&!r.isSubmitted){u.current=new tVe(c.current,{backgroundColor:"rgb(255, 255, 255)",penColor:"rgb(0, 0, 0)"}),r.signatureData&&u.current.fromDataURL(r.signatureData);const v=()=>{const y=c.current;if(y&&u.current){const b=Math.max(window.devicePixelRatio||1,1),w=y.getBoundingClientRect();y.width=w.width*b,y.height=w.height*b;const j=y.getContext("2d");j==null||j.scale(b,b),u.current.clear(),r.signatureData&&u.current.fromDataURL(r.signatureData)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)}},[r.isSubmitted]);const d=v=>{const y=WN(v);a({...r,paymentAmount:y})},f=()=>{var v;(v=u.current)==null||v.clear(),a({...r,signatureData:""})},p=()=>{if(u.current&&!u.current.isEmpty()){const v=u.current.toDataURL();a({...r,signatureData:v,signatureDate:new Date().toLocaleDateString()})}},h=()=>{var y;if(!r.ownerName.trim())return et({title:"Please enter the owner's name",variant:"destructive"}),!1;if(!r.businessName.trim())return et({title:"Please enter the business name",variant:"destructive"}),!1;if(!r.paymentPeriod)return et({title:"Please select a payment period",variant:"destructive"}),!1;const v=ph(r.paymentAmount);return!v||parseFloat(v)<=0?(et({title:"Please enter a valid payment amount",variant:"destructive"}),!1):r.taxFormType?(y=u.current)!=null&&y.isEmpty()?(et({title:"Please provide your signature",variant:"destructive"}),!1):!0:(et({title:"Please select a tax form type",variant:"destructive"}),!1)},m=()=>{const v=new qt,y=v.internal.pageSize.getWidth();v.setFontSize(16),v.setFont("helvetica","bold"),v.text("STAR SPONSORSHIP PROGRAM, INC",y/2,20,{align:"center"}),v.setFontSize(14),v.text("Statement of Self-Employment",y/2,30,{align:"center"}),v.setFontSize(11),v.setFont("helvetica","normal");let b=50;const w=20;v.text(`Period Paid: ${r.paymentPeriod==="weekly"?"Weekly":"Monthly"}`,w,b),b+=15,v.text(`Owner's Name: ${r.ownerName}`,w,b),b+=10,v.text(`Name of Business: ${r.businessName}`,w,b),b+=10;const j=ph(r.paymentAmount);v.text(`How much paid each time: $${j}`,w,b),b+=10;const S=r.taxFormType==="W-2"?"W-2":r.taxFormType==="1099"?"1099":"I did not file with a form";if(v.text(`Form filed for taxes: ${S}`,w,b),b+=20,v.setFont("helvetica","italic"),v.text("I declare that the information provided on my income is true, correct, and complete.",w,b),b+=20,v.setFont("helvetica","normal"),v.text(`Name (Print): ${r.ownerName}`,w,b),b+=15,r.signatureData){v.text("Signature:",w,b);try{v.addImage(r.signatureData,"PNG",w+25,b-8,60,20)}catch(A){console.error("Error adding signature to PDF:",A)}b+=15}return v.text(`Date: ${r.signatureDate}`,w+100,b),v.output("blob")},g=async()=>{var v;if(h()){p(),l(!0);try{const{data:{user:y}}=await Re.auth.getUser();if(!y)throw new Error("Not authenticated");const b=m(),w=`self-employment-statement-guardian-${e+1}-${Date.now()}.pdf`,j=`${y.id}/${n}/${w}`,{error:S}=await Re.storage.from("application-documents").upload(j,b,{contentType:"application/pdf",upsert:!0});if(S)throw S;const{error:A}=await Re.from("documents").insert({application_id:n,user_id:y.id,file_name:w,file_path:j,file_type:"application/pdf",file_size:b.size,document_type:"Self-Employment Statement",document_category:"financial_documents",status:"uploaded"});if(A)throw A;a({...r,signatureData:((v=u.current)==null?void 0:v.toDataURL())||"",signatureDate:new Date().toLocaleDateString(),isSubmitted:!0}),et({title:"Statement Submitted Successfully",description:"Your Self-Employment Statement has been received and saved. Administrators can now review it."}),i()}catch(y){console.error("Error submitting self-employment statement:",y),et({title:"Submission Failed",description:y.message||"Failed to submit statement. Please try again.",variant:"destructive"})}finally{l(!1)}}};return r.isSubmitted?s.jsx(Ve,{className:"border-green-200 bg-green-50 dark:bg-green-950/20 dark:border-green-800",children:s.jsx(He,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Xse,{className:"h-6 w-6 text-green-600"}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-green-800 dark:text-green-200",children:"Self-Employment Statement Submitted"}),s.jsxs("p",{className:"text-sm text-green-600 dark:text-green-400",children:["Statement for ",t," was submitted on ",r.signatureDate]})]})]})})}):s.jsxs(Ve,{className:"border-primary/20",children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2 text-lg",children:[s.jsx(En,{className:"h-5 w-5"}),"Self-Employment Statement"]}),s.jsxs(qn,{children:["Complete this statement for ",t,". All fields are required."]})]}),s.jsxs(He,{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:`owner_name_${e}`,children:"Owner's Name *"}),s.jsx(xt,{id:`owner_name_${e}`,value:r.ownerName,onChange:v=>a({...r,ownerName:v.target.value}),placeholder:"Enter your full legal name"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter your full legal name as it appears on your tax documents"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:`business_name_${e}`,children:"Name of Business *"}),s.jsx(xt,{id:`business_name_${e}`,value:r.businessName,onChange:v=>a({...r,businessName:v.target.value}),placeholder:"Enter your business or trade name"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Examples: "ABC Landscaping", "Smith Cleaning Services", "Freelance Photography"'})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx($e,{children:"Period Paid *"}),s.jsxs(rb,{value:r.paymentPeriod,onValueChange:v=>a({...r,paymentPeriod:v}),className:"flex gap-6",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ac,{value:"weekly",id:`weekly_${e}`}),s.jsx($e,{htmlFor:`weekly_${e}`,className:"font-normal",children:"Weekly"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ac,{value:"monthly",id:`monthly_${e}`}),s.jsx($e,{htmlFor:`monthly_${e}`,className:"font-normal",children:"Monthly"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Select how often you receive income from your business"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:`payment_amount_${e}`,children:"How much paid each time? *"}),s.jsx(xt,{id:`payment_amount_${e}`,value:r.paymentAmount,onChange:v=>d(v.target.value),placeholder:"$0.00",inputMode:"decimal"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Enter the average amount you earn per ",r.paymentPeriod||"payment period"," (numbers only)"]}
906)]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx($e,{children:"Form filed for taxes *"}),s.jsxs(rb,{value:r.taxFormType,onValueChange:v=>a({...r,taxFormType:v}),className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ac,{value:"W-2",id:`w2_${e}`}),s.jsx($e,{htmlFor:`w2_${e}`,className:"font-normal",children:"W-2"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ac,{value:"1099",id:`1099_${e}`}),s.jsx($e,{htmlFor:`1099_${e}`,className:"font-normal",children:"1099"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ac,{value:"none",id:`none_${e}`}),s.jsx($e,{htmlFor:`none_${e}`,className:"font-normal",children:"I did not file with a form"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Select the tax form you use to report this income. Most self-employed individuals use 1099."})]}),s.jsx(Nu,{children:s.jsx(Au,{className:"italic text-sm",children:"I declare that the information provided on my income is true, correct, and complete."})}),s.jsxs("div",{className:"space-y-3",children:[s.jsx($e,{children:"Digital Signature *"}),s.jsx("div",{className:"border rounded-lg p-1 bg-white",children:s.jsx("canvas",{ref:c,className:"w-full h-32 cursor-crosshair touch-none",style:{touchAction:"none"}})}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use your mouse or finger to sign above"}),s.jsxs(we,{type:"button",variant:"outline",size:"sm",onClick:f,className:"gap-1",children:[s.jsx(Al,{className:"h-3 w-3"}),"Clear"]})]})]}),s.jsx(we,{onClick:g,disabled:o,className:"w-full",children:o?"Submitting...":"Sign & Submit Statement"})]})]})},lKe=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"],cKe=[{value:"single",label:"Single"},{value:"married",label:"Married"},{value:"divorced",label:"Divorced"},{value:"widowed",label:"Widowed"}],uKe=[{value:"mother",label:"Mother"},{value:"father",label:"Father"},{value:"stepparent",label:"Stepparent"},{value:"grandparent",label:"Grandparent"},{value:"aunt",label:"Aunt"},{value:"uncle",label:"Uncle"},{value:"legal_guardian",label:"Legal Guardian"},{value:"other",label:"Other"}],dKe=e=>{const n=e.replace(/\D/g,"").slice(0,10);return n.length===0?"":n.length<=3?`(${n}`:n.length<=6?`(${n.slice(0,3)}) ${n.slice(3)}`:`(${n.slice(0,3)}) ${n.slice(3,6)}-${n.slice(6)}`},fKe=[{value:"employed",label:"Employed"},{value:"self_employed",label:"Self-Employed"},{value:"unemployed",label:"Unemployed"},{value:"retired",label:"Retired"},{value:"other",label:"Other"}],g9=({guardian:e,index:t,title:n,subtitle:r,onUpdate:a,applicationId:i})=>{const o=e.employment_status==="employed"||e.employment_status==="self_employed",l=e.employment_status==="self_employed";x.useEffect(()=>{if(l&&!e.selfEmploymentData){const u=H7();u.ownerName=`${e.first_name} ${e.last_name}`.trim(),u.businessName=e.employer_name||"",a("selfEmploymentData",u)}},[l,e.first_name,e.last_name,e.employer_name]);const c=u=>{const d=WN(u);a("annual_salary",d)};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-md font-medium text-foreground",children:n}),r&&s.jsx("p",{className:"text-muted-foreground text-sm",children:r})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`guardian_${t}_first_name`,children:["First Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:`guardian_${t}_first_name`,value:e.first_name,onChange:u=>a("first_name",u.target.value),placeholder:"Enter first name",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`guardian_${t}_last_name`,children:["Last Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:`guardian_${t}_last_name`,value:e.last_name,onChange:u=>a("last_name",u.target.value),placeholder:"Enter last name",required:!0})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`guardian_${t}_phone`,children:["Phone Number ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:`guardian_${t}_phone`,type:"tel",value:e.phone,onChange:u=>a("phone",dKe(u.target.value)),placeholder:"(___) ___-____",maxLength:14,required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`guardian_${t}_email`,children:["Email Address ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:`guardian_${t}_email`,type:"email",value:e.email,onChange:u=>a("email",u.target.value),placeholder:"Enter email address",required:!0})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`guardian_${t}_relationship`,children:["Relationship to Student ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:e.relationship,onValueChange:u=>a("relationship",u),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select relationship"})}),s.jsx(fn,{children:uKe.map(u=>s.jsx(ot,{value:u.value,children:u.label},u.value))})]})]}),s.jsx(_v,{className:"my-4"}),s.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Employment Information"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`guardian_${t}_employment_status`,children:["Employment Status ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:e.employment_status,onValueChange:u=>a("employment_status",u),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select employment status"})}),s.jsx(fn,{children:fKe.map(u=>s.jsx(ot,{value:u.value,children:u.label},u.value))})]})]}),(e.employment_status==="employed"||e.employment_status==="self_employed")&&s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:`guardian_${t}
906_employer_name`,children:l?"Business Name":"Employer Name"}),s.jsx(xt,{id:`guardian_${t}_employer_name`,value:e.employer_name,onChange:u=>a("employer_name",u.target.value),placeholder:l?"Enter business name":"Enter employer name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:`guardian_${t}_job_title`,children:"Job Title"}),s.jsx(xt,{id:`guardian_${t}_job_title`,value:e.job_title,onChange:u=>a("job_title",u.target.value),placeholder:"Enter job title"})]})]}),o&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:`guardian_${t}_annual_salary`,children:["Annual Salary/Income ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:`guardian_${t}_annual_salary`,value:e.annual_salary,onChange:u=>c(u.target.value),placeholder:"$0.00",inputMode:"decimal"})]}),l&&i&&s.jsx("div",{className:"mt-4",children:s.jsx(oKe,{guardianIndex:t,guardianName:`${e.first_name} ${e.last_name}`.trim()||(e.is_primary?"Primary Guardian":"Second Guardian"),applicationId:i,data:e.selfEmploymentData||H7(),onUpdate:u=>a("selfEmploymentData",u),onSubmit:()=>{}})})]})},hKe=({formData:e,updateFormData:t,applicationId:n})=>{const r=e.marital_status==="married"||e.marital_status==="divorced";x.useEffect(()=>{e.guardians.length===0&&t({guardians:[O0(!0)]})},[]),x.useEffect(()=>{r&&e.guardians.length<2?t({guardians:[...e.guardians,O0(!1)]}):!r&&e.guardians.length>1&&t({guardians:[e.guardians[0]]})},[r]);const a=(l,c,u)=>{const d=[...e.guardians];d[l]={...d[l],[c]:u},t({guardians:d})},i=e.guardians[0]||O0(!0),o=e.guardians[1];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Parent/Guardian Information"}),s.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Please provide the primary contact information for the parent or guardian."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:"marital_status",children:["What is your marital status? ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:e.marital_status,onValueChange:l=>t({marital_status:l}),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select marital status"})}),s.jsx(fn,{children:cKe.map(l=>s.jsx(ot,{value:l.value,children:l.label},l.value))})]})]}),s.jsx(g9,{guardian:i,index:0,title:"Primary Parent/Guardian",onUpdate:(l,c)=>a(0,l,c),applicationId:n}),r&&o&&s.jsxs(s.Fragment,{children:[s.jsx(_v,{className:"my-4"}),s.jsx(g9,{guardian:o,index:1,title:"Second Parent/Guardian",subtitle:`Because you selected "${e.marital_status}", please provide information for the second parent/guardian.`,onUpdate:(l,c)=>a(1,l,c),applicationId:n})]}),s.jsx(_v,{className:"my-4"}),s.jsx("h4",{className:"text-sm font-medium text-foreground mb-4",children:"Home Address"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:"address",children:["Address Line 1 ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:"address",value:e.address,onChange:l=>t({address:l.target.value}),placeholder:"Street address",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"address_line_2",children:"Address Line 2"}),s.jsx(xt,{id:"address_line_2",value:e.address_line_2,onChange:l=>t({address_line_2:l.target.value}),placeholder:"Apt, Suite, Unit, Lot (optional)"})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:"city",children:["City ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:"city",value:e.city,onChange:l=>t({city:l.target.value}),placeholder:"Enter city",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:"state",children:["State ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:e.state,onValueChange:l=>t({state:l}),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select state"})}),s.jsx(fn,{children:lKe.map(l=>s.jsx(ot,{value:l,children:l},l))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:"zip_code",children:["ZIP Code ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:"zip_code",value:e.zip_code,onChange:l=>t({zip_code:l.target.value}),placeholder:"12345",maxLength:10,required:!0})]})]})]})};var v9=1,pKe=.9,mKe=.8,gKe=.17,Yk=.1,Kk=.999,vKe=.9999,yKe=.99,xKe=/[\\\/_+.#"@\[\(\{&]/,bKe=/[\\\/_+.#"@\[\(\{&]/g,wKe=/[\s-]/,qte=/[\s-]/g;function uT(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?v9:yKe;var l=`${a},${i}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(i),u=n.indexOf(c,a),d=0,f,p,h,m;u>=0;)f=uT(e,t,n,r,u+1,i+1,o),f>d&&(u===a?f*=v9:xKe.test(e.charAt(u-1))?(f*=mKe,h=e.slice(a,u-1).match(bKe),h&&a>0&&(f*=Math.pow(Kk,h.length))):wKe.test(e.charAt(u-1))?(f*=pKe,m=e.slice(a,u-1).match(qte),m&&a>0&&(f*=Math.pow(Kk,m.length))):(f*=gKe,a>0&&(f*=Math.pow(Kk,u-a))),e.charAt(u)!==t.charAt(i)&&(f*=vKe)),(f<Yk&&n.charAt(u-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(u-1)!==r.charAt(i))&&(p=uT(e,t,n,r,u+1,i+2,o),p*Yk>f&&(f=p*Yk)),f>d&&(d=f),u=n.indexOf(c,u+1);return o[l]=d,d}function y9(e){return e.toLowerCase().replace(qte," ")}function _Ke(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,uT(e,t,y9(e),y9(t),0,0,{})}var Xy='[cmdk-group=""]',Zk='[cmdk-group-items=""]',jKe='[cmdk-group-heading=""]',Vte='[cmdk-item=""]',x9=`${Vte}:not([aria-disabled="true"])`,dT="cmdk-item-select",Nm="data-value",SKe=(e,t,n)=>_Ke(e,t,n),Hte=x.createContext(void 0),Kb=()=>x.useContext(Hte),Gte=x.createContext(void 0),CI=()=>x.useContext(Gte),Yte=x.createContext(void 0),Kte=x.forwardRef((e,t)=>
vendor: 18,317 bytes, line 906
906{let n=Am(()=>{var O,M;return{search:"",value:(M=(O=e.value)!=null?O:e.defaultValue)!=null?M:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Am(()=>new Set),a=Am(()=>new Map),i=Am(()=>new Map),o=Am(()=>new Set),l=Zte(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:h,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,b=Ga(),w=Ga(),j=Ga(),S=x.useRef(null),A=LKe();vp(()=>{if(d!==void 0){let O=d.trim();n.current.value=O,E.emit()}},[d]),vp(()=>{A(6,D)},[]);let E=x.useMemo(()=>({subscribe:O=>(o.current.add(O),()=>o.current.delete(O)),snapshot:()=>n.current,setState:(O,M,B)=>{var G,te,ne,ce;if(!Object.is(n.current[O],M)){if(n.current[O]=M,O==="search")I(),R(),A(1,C);else if(O==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let oe=document.getElementById(j);oe?oe.focus():(G=document.getElementById(b))==null||G.focus()}if(A(7,()=>{var oe;n.current.selectedItemId=(oe=U())==null?void 0:oe.id,E.emit()}),B||A(5,D),((te=l.current)==null?void 0:te.value)!==void 0){let oe=M??"";(ce=(ne=l.current).onValueChange)==null||ce.call(ne,oe);return}}E.emit()}},emit:()=>{o.current.forEach(O=>O())}}),[]),k=x.useMemo(()=>({value:(O,M,B)=>{var G;M!==((G=i.current.get(O))==null?void 0:G.value)&&(i.current.set(O,{value:M,keywords:B}),n.current.filtered.items.set(O,P(M,B)),A(2,()=>{R(),E.emit()}))},item:(O,M)=>(r.current.add(O),M&&(a.current.has(M)?a.current.get(M).add(O):a.current.set(M,new Set([O]))),A(3,()=>{I(),R(),n.current.value||C(),E.emit()}),()=>{i.current.delete(O),r.current.delete(O),n.current.filtered.items.delete(O);let B=U();A(4,()=>{I(),(B==null?void 0:B.getAttribute("id"))===O&&C(),E.emit()})}),group:O=>(a.current.has(O)||a.current.set(O,new Set),()=>{i.current.delete(O),a.current.delete(O)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:j,labelId:w,listInnerRef:S}),[]);function P(O,M){var B,G;let te=(G=(B=l.current)==null?void 0:B.filter)!=null?G:SKe;return O?te(O,n.current.search,M):0}function R(){if(!n.current.search||l.current.shouldFilter===!1)return;let O=n.current.filtered.items,M=[];n.current.filtered.groups.forEach(G=>{let te=a.current.get(G),ne=0;te.forEach(ce=>{let oe=O.get(ce);ne=Math.max(oe,ne)}),M.push([G,ne])});let B=S.current;q().sort((G,te)=>{var ne,ce;let oe=G.getAttribute("id"),X=te.getAttribute("id");return((ne=O.get(X))!=null?ne:0)-((ce=O.get(oe))!=null?ce:0)}).forEach(G=>{let te=G.closest(Zk);te?te.appendChild(G.parentElement===te?G:G.closest(`${Zk} > *`)):B.appendChild(G.parentElement===B?G:G.closest(`${Zk} > *`))}),M.sort((G,te)=>te[1]-G[1]).forEach(G=>{var te;let ne=(te=S.current)==null?void 0:te.querySelector(`${Xy}[${Nm}="${encodeURIComponent(G[0])}"]`);ne==null||ne.parentElement.appendChild(ne)})}function C(){let O=q().find(B=>B.getAttribute("aria-disabled")!=="true"),M=O==null?void 0:O.getAttribute(Nm);E.setState("value",M||void 0)}function I(){var O,M,B,G;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let te=0;for(let ne of r.current){let ce=(M=(O=i.current.get(ne))==null?void 0:O.value)!=null?M:"",oe=(G=(B=i.current.get(ne))==null?void 0:B.keywords)!=null?G:[],X=P(ce,oe);n.current.filtered.items.set(ne,X),X>0&&te++}for(let[ne,ce]of a.current)for(let oe of ce)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(ne);break}n.current.filtered.count=te}function D(){var O,M,B;let G=U();G&&(((O=G.parentElement)==null?void 0:O.firstChild)===G&&((B=(M=G.closest(Xy))==null?void 0:M.querySelector(jKe))==null||B.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function U(){var O;return(O=S.current)==null?void 0:O.querySelector(`${Vte}[aria-selected="true"]`)}function q(){var O;return Array.from(((O=S.current)==null?void 0:O.querySelectorAll(x9))||[])}function Z(O){let M=q()[O];M&&E.setState("value",M.getAttribute(Nm))}function H(O){var M;let B=U(),G=q(),te=G.findIndex(ce=>ce===B),ne=G[te+O];(M=l.current)!=null&&M.loop&&(ne=te+O<0?G[G.length-1]:te+O===G.length?G[0]:G[te+O]),ne&&E.setState("value",ne.getAttribute(Nm))}function $(O){let M=U(),B=M==null?void 0:M.closest(Xy),G;for(;B&&!G;)B=O>0?RKe(B,Xy):IKe(B,Xy),G=B==null?void 0:B.querySelector(x9);G?E.setState("value",G.getAttribute(Nm)):H(O)}let W=()=>Z(q().length-1),ee=O=>{O.preventDefault(),O.metaKey?W():O.altKey?$(1):H(1)},V=O=>{O.preventDefault(),O.metaKey?Z(0):O.altKey?$(-1):H(-1)};return x.createElement(pt.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:O=>{var M;(M=y.onKeyDown)==null||M.call(y,O);let B=O.nativeEvent.isComposing||O.keyCode===229;if(!(O.defaultPrevented||B))switch(O.key){case"n":case"j":{v&&O.ctrlKey&&ee(O);break}case"ArrowDown":{ee(O);break}case"p":case"k":{v&&O.ctrlKey&&V(O);break}case"ArrowUp":{V(O);break}case"Home":{O.preventDefault(),Z(0);break}case"End":{O.preventDefault(),W();break}case"Enter":{O.preventDefault();let G=U();if(G){let te=new Event(dT);G.dispatchEvent(te)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:$Ke},c),ZN(e,O=>x.createElement(Gte.Provider,{value:E},x.createElement(Hte.Provider,{value:k},O))))}),NKe=x.forwardRef((e,t)=>{var n,r;let a=Ga(),i=x.useRef(null),o=x.useContext(Yte),l=Kb(),c=Zte(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;vp(()=>{if(!u)return l.item(a,o==null?void 0:o.id)},[u]);let d=Xte(a,i,[e.value,e.children,i],e.keywords),f=CI(),p=pf(A=>A.value&&A.value===d.current),h=pf(A=>u||l.filter()===!1?!0:A.search?A.filtered.items.get(a)>0:!0);x.useEffect(()=>{let A=i.current;if(!(!A||e.disabled))return A.addEventListener(dT,m),()=>A.removeEventListener(dT,m)},[h,e.onSelect,e.disabled]);function m(){var A,E;g(),(E=(A=c.current).onSelect)==null||E.call(A,d.current)}function g(){f.setState("value",d.current,!0)}if(!h)return null;let{disabled:v,value:y,onSelect:b,forceMount:w,keywords:j,...S}=e;return x.createElement(pt.div,{ref:rf(i,t),...S,id:a,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||l.getDisablePointerSelection()?void 0:g,onClick:v?void 0:m},e.children)}),AKe=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=Ga(),l=x.useRef(null),c=x.useRef(null),u=Ga(),d=Kb(),f=pf(h=>a||d.filter()===!1?!0:h.search?h.filtered.groups.has(o):!0);vp(()=>d.group(o),[]),Xte(o,l,[e.value,e.heading,c]);let p=x.useMemo(()=>({id:o,forceMount:a}),[a]);return x.createElement(pt.div,{ref:rf(l,t),...i,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),ZN(e,h=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},x.createElement(Yte.Provider,{value:p},h))))}),kKe=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=x.useRef(null),i=pf(o=>!o.search);return!n&&!i?null:x.createElement(pt.div,{ref:rf(a,t),...r,"cmdk-separator":"",role:"separator"})}),EKe=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=CI(),o=pf(u=>u.search),l=pf(u=>u.selectedItemId),c=Kb();return x.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),x.createElement(pt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:o,onChange:u=>{a||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),CKe=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=x.useRef(null),o=x.useRef(null),l=pf(u=>u.selectedItemId),c=Kb();return x.useEffect(()=>{if(o.current&&i.current){let u=o.current,d=i.current,f,p=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let h=u.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(f),p.unobserve(u)}}},[]),x.createElement(pt.div,{ref:rf(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},ZN(e,u=>x.createElement("div",{ref:rf(o,c.listInnerRef),"cmdk-list-sizer":""},u)))}),PKe=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...l}=e;return x.createElement(xR,{open:n,onOpenChange:r},x.createElement(bR,{container:o},x.createElement(_N,{"cmdk-overlay":"",className:a}),x.createElement(jN,{"aria-label":e.label,"cmdk-dialog":"",className:i},x.createElement(Kte,{ref:t,...l}))))}),TKe=x.forwardRef((e,t)=>pf(n=>n.filtered.count===0)?x.createElement(pt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),OKe=x.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return x.createElement(pt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},ZN(e,o=>x.createElement("div",{"aria-hidden":!0},o)))}),Ws=Object.assign(Kte,{List:CKe,Item:NKe,Input:EKe,Group:AKe,Separator:kKe,Dialog:PKe,Empty:TKe,Loading:OKe});function RKe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function IKe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Zte(e){let t=x.useRef(e);return vp(()=>{t.current=e}),t}var vp=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Am(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function pf(e){let t=CI(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function Xte(e,t,n,r=[]){let a=x.useRef(),i=Kb();return vp(()=>{var o;let l=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():a.current}})(),c=r.map(u=>u.trim());i.value(e,l,c),(o=t.current)==null||o.setAttribute(Nm,l),a.current=l}),a}var LKe=()=>{let[e,t]=x.useState(),n=Am(()=>new Map);return vp(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function MKe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ZN({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(MKe(t),{ref:t.ref},n(t.props.children)):n(t)}var $Ke={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Jte=x.forwardRef(({className:e,...t},n)=>s.jsx(Ws,{ref:n,className:Ye("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Jte.displayName=Ws.displayName;const Qte=x.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(lf,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Ws.Input,{ref:n,className:Ye("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Qte.displayName=Ws.Input.displayName;const ene=x.forwardRef(({className:e,...t},n)=>s.jsx(Ws.List,{ref:n,className:Ye("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));ene.displayName=Ws.List.displayName;const tne=x.forwardRef((e,t)=>s.jsx(Ws.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));tne.displayName=Ws.Empty.displayName;const nne=x.forwardRef(({className:e,...t},n)=>s.jsx(Ws.Group,{ref:n,className:Ye("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));nne.displayName=Ws.Group.displayName;const DKe=x.forwardRef(({className:e,...t},n)=>s.jsx(Ws.Separator,{ref:n,className:Ye("-mx-1 h-px bg-border",e),...t}));DKe.displayName=Ws.Separator.displayName;const rne=x.forwardRef(({className:e,...t},n)=>s.jsx(Ws.Item,{ref:n,className:Ye("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));rne.displayName=Ws.Item.displayName;var XN="Popover",[ane,uQe]=ui(XN,[Lv]),Zb=Lv(),[FKe,Cf]=ane(XN),ine=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=Zb(t),c=x.useRef(null),[u,d]=x.useState(!1),[f,p]=vs({prop:r,defaultProp:a??!1,onChange:i,caller:XN});return s.jsx(PO,{...l,children:s.jsx(FKe,{scope:t,contentId:Ga(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:u,onCustomAnchorAdd:x.useCallback(()=>d(!0),[]),onCustomAnchorRemove:x.useCallback(()=>d(!1),[]),modal:o,children:n})})};ine.displayName=XN;var sne="PopoverAnchor",BKe=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Cf(sne,n),i=Zb(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return x.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(lS,{...i,...r,ref:t})});BKe.displayName=sne;var one="PopoverTrigger",lne=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Cf(one,n),i=Zb(n),o=sn(t,a.triggerRef),l=s.jsx(pt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":hne(a.open),...r,ref:o,onClick:ht(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(lS,{asChild:!0,...i,children:l})});lne.displayName=one;var PI="PopoverPortal",[UKe,zKe]=ane(PI,{forceMount:void 0}),cne=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Cf(PI,t);return s.jsx(UKe,{scope:t,forceMount:n,children:s.jsx(Ka,{present:n||i.open,children:s.jsx(_b,{asChild:!0,container:a,children:r})})})};cne.displayName=PI;var Av="PopoverContent",une=x.forwardRef((e,t)=>{const n=zKe(Av,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Cf(Av,e.__scopePopover);return s.jsx(Ka,{present:r||i.open,children:i.modal?s.jsx(qKe,{...a,ref:t}):s.jsx(VKe,{...a,ref:t})})});une.displayName=Av;var WKe=Jh("PopoverContent.RemoveScroll"),qKe=x.forwardRef((e,t)=>{const n=Cf(Av,e.__scopePopover),r=x.useRef(null),a=sn(t,r),i=x.useRef(!1);return x.useEffect(()=>{const o=r.current;if(o)return mR(o)},[]),s.jsx(bN,{as:WKe,allowPinchZoom:!0,children:s.jsx(dne,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ht(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ht(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ht(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),VKe=x.forwardRef((e,t)=>{const n=Cf(Av,e.__scopePopover),r=x.useRef(!1),a=x.useRef(!1);return s.jsx(dne,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),dne=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,p=Cf(Av,n),h=Zb(n);return pR(),s.jsx(yN,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(_p,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:s.jsx(TO,{"data-state":hne(p.open),role:"dialog",id:p.contentId,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),fne="PopoverClose",HKe=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Cf(fne,n);return s.jsx(pt.button,{type:"button",...r,ref:t,onClick:ht(e.onClick,()=>a.onOpenChange(!1))})});HKe.displayName=fne;var GKe="PopoverArrow",YKe=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Zb(n);return s.jsx(OO,{...a,...r,ref:t})});YKe.displayName=GKe;function hne(e){return e?"open":"closed"}var KKe=ine,ZKe=lne,XKe=cne,pne=une;const JKe=KKe,QKe=ZKe,mne=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(XKe,{children:s.jsx(pne,{ref:a,align:t,sideOffset:n,className:Ye("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",e),...r})}));mne.displayName=pne.displayName;const eZe=["Kindergarten","1st Grade","2nd Grade","3rd Grade","4th Grade","5th Grade","6th Grade","7th Grade","8th Grade"],tZe=["All Saints Catholic School","Bethesda Christian School","Braveheart Christian Academy","Christian Life Preparatory School","Crossing Heritage Academy","Fellowship Academy","Holy Family Catholic School","Hope Works Christian Academy","Mercy Culture Preparatory","Mid-Cities Christian Academy","Mosaic Academy","St. Andrew Catholic School","St. George Catholic School","St. John the Apostle Catholic School","St. Peter Catholic School","St. Rita Catholic School","Southwest Christian School","Temple Christian School","Wedgwood Aca
906demy"],nZe=[{value:"returning",label:"Returning Student"},{value:"new",label:"New Student (Joining for the First Time)"}],rZe=[{value:"latino",label:"Latino"},{value:"african_american",label:"African American"},{value:"white",label:"White"},{value:"asian",label:"Asian"}],aZe=[{value:"male",label:"Male"},{value:"female",label:"Female"}],b9=({formData:e,updateFormData:t,isReturningFamily:n=!1,lockedStudentIds:r=[]})=>{const[a,i]=x.useState(null),o=x.useRef(!1),l=f=>r.includes(f),c=()=>{const f=e.students.length===0,p={id:Date.now().toString(),first_name:"",last_name:"",date_of_birth:"",grade:"",school:"",status:n?f?"returning":"":"new",race:"",gender:"",tefa_status:"",tefa_waitlist_position:""};t({students:[...e.students,p]})},u=f=>{t({students:e.students.filter(p=>p.id!==f)})},d=(f,p,h)=>{t({students:e.students.map(m=>m.id===f?{...m,[p]:h}:m)})};return x.useEffect(()=>{e.students.length===0&&!o.current&&n!==void 0&&(o.current=!0,c())},[e.students.length,n]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Student Information"}),s.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Add information for each student you are applying for. You can add multiple students."})]}),s.jsxs("div",{className:"space-y-4",children:[e.students.map((f,p)=>l(f.id)?s.jsx(Ve,{className:"bg-muted/40",children:s.jsx(He,{className:"py-4",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"font-medium",children:[f.first_name," ",f.last_name]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:[f.grade,f.school].filter(Boolean).join(" • ")})]}),s.jsx("span",{className:"text-xs text-muted-foreground bg-background border rounded-full px-3 py-1",children:"Already on file — nothing to re-enter"})]})})},f.id):s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(jt,{className:"text-base",children:["Student ",p+1]}),e.students.length>1&&s.jsx(we,{variant:"ghost",size:"sm",onClick:()=>u(f.id),className:"text-destructive hover:text-destructive",children:s.jsx(Al,{className:"w-4 h-4"})})]})}),s.jsxs(He,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["First Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{value:f.first_name,onChange:h=>d(f.id,"first_name",h.target.value),placeholder:"Enter first name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["Last Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{value:f.last_name,onChange:h=>d(f.id,"last_name",h.target.value),placeholder:"Enter last name"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["Student Status ",s.jsx("span",{className:"text-destructive",children:"*"})]}),n?s.jsxs(s.Fragment,{children:[s.jsxs(gn,{value:f.status,onValueChange:h=>d(f.id,"status",h),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select One..."})}),s.jsx(fn,{children:nZe.map(h=>s.jsx(ot,{value:h.value,children:h.label},h.value))})]}),s.jsxs(Nu,{className:"bg-muted/50 border-muted",children:[s.jsx(Ed,{className:"h-4 w-4"}),s.jsx(Au,{className:"text-xs text-muted-foreground",children:p===0?"Your first student defaults to 'Returning Student.' Change only if this is a new student joining for the first time.":"Select 'New Student' if this child has not been sponsored before. Select 'Returning Student' if you are updating their grade and information."})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs(gn,{value:"new",disabled:!0,children:[s.jsx(dn,{className:"bg-muted cursor-not-allowed",children:s.jsx(vn,{children:"New Student (Joining for the First Time)"})}),s.jsx(fn,{children:s.jsx(ot,{value:"new",children:"New Student (Joining for the First Time)"})})]}),s.jsxs(Nu,{className:"bg-muted/50 border-muted",children:[s.jsx(Ed,{className:"h-4 w-4"}),s.jsx(Au,{className:"text-xs text-muted-foreground",children:"All students in new family applications are automatically classified as new students."})]})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["Date of Birth ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{type:"date",value:f.date_of_birth,onChange:h=>d(f.id,"date_of_birth",h.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["Race/Ethnicity ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:f.race||"",onValueChange:h=>d(f.id,"race",h),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select race/ethnicity"})}),s.jsx(fn,{children:rZe.map(h=>s.jsx(ot,{value:h.value,children:h.label},h.value))})]})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["Gender ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:f.gender||"",onValueChange:h=>d(f.id,"gender",h),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select gender"})}),s.jsx(fn,{children:aZe.map(h=>s.jsx(ot,{value:h.value,children:h.label},h.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["2026–27 Grade ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:f.grade,onValueChange:h=>d(f.id,"grade",h),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select grade"})}),s.jsx(fn,{children:eZe.map(h=>s.jsx(ot,{value:h,children:h},h))})]})]})]}),s.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["School ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(JKe,{open:a===f.id,onOpenChange:h=>i(h?f.id:null),children:[s.jsx(QKe,{asChild:!0,children:s.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":a===f.id,className:"w-full justify-between font-normal",children:[f.school||"Select school...",s.jsx(lf,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(mne,{className:"w-[300px] p-0",align:"start",children:s.jsxs(Jte,{children:[s.jsx(Qte,{placeholder:"Search schools..."}),s.jsxs(ene,{children:[s.jsx(tne,{children:"No school found."}),s.jsx(nne,{children:tZe.map(h=>s.jsx(rne,{value:h,onSelect:()=>{d(f.id,"school",h),i(null)},className:Ye("cursor-pointer",f.school===h&&"bg-accent"),children:h},h))})]})]})})]})]})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["Texas Education Freedom Account (TEFA) Status"," ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:f.tefa_status||"",onValueChange:h=>{h==="waitlist"?d(f.id,"tefa_status",h):t({students:e.students.map(m=>m.id===f.id?{...m,tefa_status:h,tefa_waitlist_position:""}:m)})},children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select TEFA status"})}),s.jsx(fn,{children:yee.map(h=>s.jsx(ot,{value:h.value,children:h.label},h.value))})]})]}),f.tefa_status==="waitlist"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["Current Waitlist Position ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{type:"text",inputMode:"numeric",placeholder:"e.g. 42",value:f.tefa_waitlist_position||"",onChange:h=>d(f.id,"tefa_waitlist_position",h.target.value.replace(/[^0-9]/g,""))})]})]})]})]},f.id)),s.jsxs(we,{variant:"outline",onClick:c,className:"w-full",children:[s.jsx(zh,{className:"w-4 h-4 mr-2"}),"Add Another Student"]})]})]})},Qd=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:Ye("w-full caption-bottom text-sm",e),...t})}));Qd.displayName="Table";const yp=x.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:Ye("[&_tr]:border-b",e),...t}));yp.displayName="TableHeader";const ef=x.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Ye("[&_tr:last-child]:border-0",e),...t}));
906ef.displayName="TableBody";const iZe=x.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:Ye("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));iZe.displayName="TableFooter";const us=x.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:Ye("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));us.displayName="TableRow";const Xn=x.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:Ye("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Xn.displayName="TableHead";const On=x.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Ye("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));On.displayName="TableCell";const sZe=x.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:Ye("mt-4 text-sm text-muted-foreground",e),...t}));sZe.displayName="TableCaption";const oZe=({dependents:e,onChange:t})=>{const n=()=>{t([...e,Uqe()])},r=i=>{t(e.filter(o=>o.id!==i))},a=(i,o,l)=>{t(e.map(c=>c.id===i?{...c,[o]:l}:c))};return s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"rounded-md border overflow-x-auto",children:s.jsxs(Qd,{children:[s.jsx(yp,{children:s.jsxs(us,{children:[s.jsx(Xn,{className:"min-w-[160px]",children:"Child's Full Name"}),s.jsx(Xn,{className:"min-w-[70px]",children:"Age"}),s.jsx(Xn,{className:"min-w-[140px]",children:"Date of Birth"}),s.jsx(Xn,{className:"min-w-[170px]",children:"Current Grade in School"}),s.jsx(Xn,{className:"min-w-[180px]",children:"Annual Tuition (2025–2026)"}),s.jsx(Xn,{className:"w-[50px]"})]})}),s.jsxs(ef,{children:[e.length===0&&s.jsx(us,{children:s.jsx(On,{colSpan:6,className:"text-center text-muted-foreground py-6",children:'No dependents added yet. Click "Add Child" below.'})}),e.map(i=>s.jsxs(us,{children:[s.jsx(On,{children:s.jsx(xt,{value:i.full_name,onChange:o=>a(i.id,"full_name",o.target.value),placeholder:"Full name",className:"min-w-[140px]"})}),s.jsx(On,{children:s.jsx(xt,{type:"number",min:"0",max:"30",value:i.age,onChange:o=>a(i.id,"age",o.target.value),placeholder:"Age",className:"w-[70px]"})}),s.jsx(On,{children:s.jsx(xt,{type:"date",value:i.date_of_birth,onChange:o=>a(i.id,"date_of_birth",o.target.value),className:"min-w-[130px]"})}),s.jsx(On,{children:s.jsxs(gn,{value:i.grade,onValueChange:o=>a(i.id,"grade",o),children:[s.jsx(dn,{className:"min-w-[150px]",children:s.jsx(vn,{placeholder:"Select grade"})}),s.jsx(fn,{children:Bqe.map(o=>s.jsx(ot,{value:o,children:o},o))})]})}),s.jsx(On,{children:s.jsx(xt,{type:"text",inputMode:"decimal",value:i.annual_tuition,onChange:o=>a(i.id,"annual_tuition",WN(o.target.value)),placeholder:"$0.00",className:"min-w-[120px]"})}),s.jsx(On,{children:s.jsx(we,{type:"button",variant:"ghost",size:"icon",onClick:()=>r(i.id),className:"text-destructive hover:text-destructive",children:s.jsx(Al,{className:"h-4 w-4"})})})]},i.id))]})]})}),s.jsxs(we,{type:"button",variant:"outline",size:"sm",onClick:n,children:[s.jsx(zh,{className:"h-4 w-4 mr-1"})," Add Child"]})]})},lZe=["Under $25,000","$25,000 - $35,000","$35,000 - $50,000","$50,000 - $75,000","$75,000 - $100,000","Over $100,000"],cZe=["School","Friend or Family","Social Media","Church or Community Organization","Previous Participant","Web Search","Other"],uZe=({formData:e,updateFormData:t})=>{const n=e.marital_status==="divorced",r=a=>i=>{const o=WN(i.target.value);t({[a]:o})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Financial Information"}),s.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"This information helps us determine eligibility for the sponsorship program. All information is kept confidential."})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:"household_size",children:["Household Size ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(xt,{id:"household_size",type:"number",min:"1",max:"20",value:e.household_size||"",onChange:a=>t({household_size:a.target.value?parseInt(a.target.value):void 0}),placeholder:"Number of people in household"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:"household_income",children:["Annual Household Income ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:e.household_income,onValueChange:a=>t({household_income:a}),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select income range"})}),s.jsx(fn,{children:lZe.map(a=>s.jsx(ot,{value:a,children:a},a))})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-md font-medium border-b pb-2",children:"Children/Dependents in Household"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"List all children and dependents living in y
906our household."}),s.jsx(oZe,{dependents:e.dependents,onChange:a=>t({dependents:a})})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-md font-medium border-b pb-2",children:"Monthly Expenses"}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"monthly_rent_payment",children:"Rent or House Payment (per month)"}),s.jsx(xt,{id:"monthly_rent_payment",type:"text",inputMode:"decimal",value:e.monthly_rent_payment||"",onChange:r("monthly_rent_payment"),placeholder:"$0.00"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"monthly_car_payment",children:"Car Payment(s) (per month)"}),s.jsx(xt,{id:"monthly_car_payment",type:"text",inputMode:"decimal",value:e.monthly_car_payment||"",onChange:r("monthly_car_payment"),placeholder:"$0.00"})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-md font-medium border-b pb-2",children:"Additional Income Sources"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(T4,{id:"receives_social_security",checked:e.receives_social_security||!1,onCheckedChange:a=>t({receives_social_security:a,social_security_amount:a?e.social_security_amount:""})}),s.jsx($e,{htmlFor:"receives_social_security",className:"text-sm font-normal",children:"I/We receive Social Security benefits"})]}),e.receives_social_security&&s.jsxs("div",{className:"space-y-2 ml-6",children:[s.jsx($e,{htmlFor:"social_security_amount",children:"Monthly Social Security Amount (you and spouse combined)"}),s.jsx("div",{className:"max-w-xs",children:s.jsx(xt,{id:"social_security_amount",type:"text",inputMode:"decimal",value:e.social_security_amount||"",onChange:r("social_security_amount"),placeholder:"$0.00"})})]})]}),n&&s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"ex_spouse_support_amount",children:"Monthly Support Received from Ex-Spouse"}),s.jsx("div",{className:"max-w-xs",children:s.jsx(xt,{id:"ex_spouse_support_amount",type:"text",inputMode:"decimal",value:e.ex_spouse_support_amount||"",onChange:r("ex_spouse_support_amount"),placeholder:"$0.00"})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx($e,{children:"Do you have any other source of income?"}),s.jsxs(rb,{value:e.has_other_income?"yes":"no",onValueChange:a=>t({has_other_income:a==="yes",other_income_description:a==="yes"?e.other_income_description:""}),className:"flex gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ac,{value:"yes",id:"other_income_yes"}),s.jsx($e,{htmlFor:"other_income_yes",className:"font-normal",children:"Yes"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ac,{value:"no",id:"other_income_no"}),s.jsx($e,{htmlFor:"other_income_no",className:"font-normal",children:"No"})]})]}),e.has_other_income&&s.jsxs("div",{className:"space-y-2 ml-6",children:[s.jsx($e,{htmlFor:"other_income_description",children:"Please describe your other income source(s)"}),s.jsx(wc,{id:"other_income_description",value:e.other_income_description||"",onChange:a=>t({other_income_description:a.target.value}),placeholder:"Describe the source and amount of additional income...",rows:3,className:"resize-none"})]})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(T4,{id:"receives_assistance",checked:e.receives_assistance,onCheckedChange:a=>t({receives_assistance:a})}),s.jsx($e,{htmlFor:"receives_assistance",className:"text-sm font-normal",children:"Our household currently receives government assistance (SNAP, Medicaid, TANF, etc.)"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-md font-medium border-b pb-2",children:"STAR Family Connection"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx($e,{children:"Do you have any siblings or other family members that have been a STAR student?"}),s.jsxs(rb,{value:e.has_star_family_member?"yes":"no",onValueChange:a=>t({has_star_family_member:a==="yes",star_family_member_names:a==="yes"?e.star_family_member_names:""}),className:"flex gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ac,{value:"yes",id:"star_family_yes"}),s.jsx($e,{htmlFor:"star_family_yes",className:"font-normal",children:"Yes"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ac,{value:"no",id:"star_family_no"}),s.jsx($e,{htmlFor:"star_family_no",className:"font-normal",children:"No"})]})]}),e.has_star_family_member&&s.jsxs("div",{className:"space-y-2 ml-6",children:[s.jsx($e,{htmlFor:"star_family_member_names",children:"Please provide their name(s)"}),s.jsx(xt,{id:"star_family_member_names",type:"text",value:e.star_family_member_names||"",onChange:a=>t({star_family_member_names:a.target.value}),placeholder:"Enter name(s) of STAR family members"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:"how_heard",children:["How did you hear about us? ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsxs(gn,{value:e.how_heard_about_us,onValueChange:a=>t({how_heard_about_us:a}),children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select an option"})}),s.jsx(fn,{children:cZe.map(a=>s.jsx(ot,{value:a,children:a},a))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{htmlFor:"essay",children:["Please tell us why your family would benefit from this sponsorship ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(wc,{id:"essay",value:e.essay,onChange:a=>t({essay:a.target.value}),placeholder:"Share your story and how this program would help your family...",rows:6,className:"resize-none"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.essay.length,"/1000 characters"]})]})]})},dZe=["application/pdf","image/jpeg","image/png","image/webp","image/heic","image/heif","image/tiff","image/bmp"],fZe=50*1024*1024,hZe=["current_tax_return","w2_forms","last_year_tax_return"],Xk=[{id:"current_tax_return",label:"2025 Tax Documents (Upload all pages)",description:"Upload all pages of your 2025 tax return. You may upload multiple files.",required:!0,excludeForNewStudent:!0,category:"financial_documents",multiFile:!0},{id:"w2_forms",label:"2025 – W-2, 1099, or Schedule C",description:"2025 W-2 wage statements, 1099 forms, or Schedule C for each employed or self-employed guardian. You may upload multiple files.",required:!0,excludeForNewStudent:!0,category:"financial_documents",multiFile:!0},{id:"last_year_tax_return",label:"2024 Tax Return (Recommended)",description:"If available, please upload your 2024 federal tax return (Form 1040). If you do not have it yet, you may still submit your application. The STAR Program may request this document later during the review process. You may upload multiple files.",required:!1,newFamiliesOnly:!0,excludeForNewStudent:!0,category:"financial_documents",multiFile:!0}],mm={pending:{label:"Pending Review",variant:"secondary",icon:Fn},uploaded:{label:"Uploaded",variant:"outline",icon:fa},approved:{label:"Approved",variant:"default",icon:Nt},needs_resubmission:{label:"Needs Resubmission",variant:"destructive",icon:er}},w9=e=>{const t=e.first_name||"Student",n=`${e.first_name} ${e.last_name}
906`.trim(),r=[],a=[];return r.push({id:`star_form_${e.id}`,label:`${t}'s Parent/Guardian Commitment Form`,description:`Required — download and print the STAR Parent/Guardian Commitment Form, sign it and upload it for ${n}. No notary stamp is required.`,required:!0,hasDownload:!0,downloadUrl:"/forms/STAR_Verification_Form_2026-2027.pdf",category:"verification_documents"}),e.status==="new"&&r.push({id:`principal_referral_${e.id}`,label:`${t}'s Principal Referral Form`,description:`Principal referral form for ${n}`,required:!0,hasDownload:!0,downloadUrl:"/forms/2026-27_Principal_Referral_Form.pdf",category:"verification_documents"}),r.push({id:`student_form_${e.id}`,label:`${t}'s Student Form`,description:`Student form for ${n}`,required:!0,hasDownload:!0,downloadUrl:"/forms/Student_Form_2026-2027.pdf",category:"verification_documents"}),e.status==="new"&&(a.push({id:`teacher_recommendation_${e.id}`,label:`${t}'s Teacher Recommendation (Recommended)`,description:`If available, please upload ${n}'s teacher recommendation form. If you do not have this document yet, you may still submit your application. The STAR Program may request this document later during the review process.`,required:!1,hasDownload:!0,downloadUrl:"/forms/Teacher_Recommendation_Form_2026-2027.pdf",category:"verification_documents"}),a.push({id:`report_card_${e.id}`,label:`${t}'s Most Recent Report Card (Recommended)`,description:`If available, please upload ${n}'s most recent report card. If it is not yet available, you may still submit your application. The STAR Program may request this document later during the review process.`,required:!1,category:"verification_documents"})),[...r,...a]},Jk=({applicationId:e,documents:t,setDocuments:n,isNewStudentApplication:r=!1,hasSelfEmployedGuardian:a=!1,selfEmploymentStatementSubmitted:i=!1,students:o=[],documentWaivers:l=[],focusStudentIds:c,hideFamilyDocuments:u=!1})=>{const d=x.useMemo(()=>c?o.filter(M=>c.includes(M.id)):o,[o,c]),{user:f,profile:p}=bi(),[h,m]=x.useState(null),[g,v]=x.useState(null),y=x.useRef({}),b=(p==null?void 0:p.applicant_type)==="new",w=t.find(M=>M.document_type==="Self-Employment Statement"||M.document_type==="self_employment"),j=i||!!w,S=x.useMemo(()=>r||d.length===0?[]:d.flatMap(M=>w9(M)),[r,d]),A=x.useMemo(()=>Xk.filter(M=>r?!1:!M.newFamiliesOnly||b),[r,b]),E=x.useMemo(()=>{if(r){const M=d[0],B=M&&`${M.first_name} ${M.last_name}`.trim()||"Student";return[{id:"teacher_recommendation",label:`${B}'s Teacher Recommendation (Recommended)`,description:`If available, please upload ${B}'s teacher recommendation form. If you do not have this document yet, you may still submit your application. The STAR Program may request this document later during the review process.`,required:!1,hasDownload:!0,downloadUrl:"/forms/Teacher_Recommendation_Form_2026-2027.pdf",category:"verification_documents"},{id:"principal_referral",label:`${B}'s Principal Referral Form`,description:`Principal referral form for ${B}`,required:!0,hasDownload:!0,downloadUrl:"/forms/2026-27_Principal_Referral_Form.pdf",category:"verification_documents"},{id:"student_form",label:`${B}'s Student Form`,description:`Student form for ${B}`,required:!0,hasDownload:!0,downloadUrl:"/forms/Student_Form_2026-2027.pdf",category:"verification_documents"},{id:"report_card",label:`${B}'s Most Recent Report Card (Recommended)`,description:`If available, please upload ${B}'s most recent report card. If it is not yet available, you may still submit your application. The STAR Program may request this document later during the review process.`,required:!1,category:"verification_documents"}]}return[...A,...S]},[A,S,r,d]),k=x.useMemo(()=>E.map(M=>l.includes(M.id)?{...M,required:!1,waived:!0}:M),[E,l]),[P,R]=x.useState(!1);x.useEffect(()=>{if(P||!f||!e||!b||r||d.length===0)return;const M=d.filter(G=>{if(G.status!=="new")return!1;const te=`principal_referral_${G.id}`;return!t.some(ne=>ne.document_type===te)});if(M.length===0){R(!0);return}let B=!1;return(async()=>{const{data:G,error:te}=await Re.from("referral_documents").select("id, student_first_name, student_last_name, file_path, file_name, status").eq("user_id",f.id).eq("status","approved");if(B)return;if(te||!G||G.length===0){R(!0);return}const ne=oe=>(oe||"").trim().toLowerCase(),ce=[];for(const oe of M){const X=G.find(ie=>ne(ie.student_first_name)===ne(oe.first_name)&&ne(ie.student_last_name)===ne(oe.last_name));if(!X)continue;const se=`principal_referral_${oe.id}`,{data:Q,error:ye}=await Re.from("documents").insert({application_id:e,user_id:f.id,file_path:X.file_path,file_name:X.file_name,document_type:se,document_category:"verification_documents",status:"uploaded"}).select().single();!ye&&Q&&ce.push({id:Q.id,file_path:Q.file_path,file_name:Q.file_name,document_type:Q.document_type,status:Q.status})}!B&&ce.length>0&&n([...t,...ce]),B||R(!0)})(),()=>{B=!0}},[f,e,b,r,d,t,P,n]);const C=M=>t.find(B=>B.document_type===M),I=M=>t.filter(B=>B.document_type===M||B.document_type.startsWith(`${M}_page_`)),D=M=>hZe.includes(M),U=async(M,B)=>{const G=M.target.files;if(!G||G.length===0||!f)return;const te=G[0];if(!dZe.includes(te.type)&&!te.name.toLowerCase().match(/\.(heic|heif|tiff|tif|bmp)$/)){et({title:"Invalid file type",description:"Please upload a PDF, JPEG, PNG, WebP, HEIC, TIFF, or BMP file.",variant:"destructive"});return}if(te.size>fZe){et({title:"File too large",description:"Maximum file size is 50MB.",variant:"destructive"});return}const ne=B.replace(/_page_\d+$/,""),ce=D(ne);if(m(B),!ce){const Ne=C(B);Ne&&(await Re.storage.from("application-documents").remove([Ne.file_path]),await Re.from("documents").delete().eq("id",Ne.id))}const oe=ce?I(ne).length===0?ne:`${ne}_page_${Date.now()}`:B,X=te.name.split(".").pop(),se=`${oe}_${Date.now()}.${X}`,Q=`${f.id}/${e}/${se}`,{error:ye}=await Re.storage.from("application-documents").upload(Q,te);if(ye){et({title:"Upload failed",description:ye.message,variant:"destructive"}),m(null);return}const ie=Xk.find(Ne=>Ne.id===ne)||Xk.find(Ne=>Ne.id===B),{data:F,error:me}=await Re.from("documents").insert({application_id:e,user_id:f.id,file_path:Q,file_name:te.name,file_type:te.type,file_size:te.size,document_type:oe,document_category:(ie==null?void 0:ie.category)||"general",status:"uploaded"}).select().single();if(me||!F)et({title:"Error",description:"Failed to save document reference.",variant:"destructive"});else{const Ne={id:F.id,file_path:F.file_path,file_name:F.file_name,document_type:F.document_type||oe,status:F.status||"uploaded",admin_feedback:F.admin_feedback||void 0,uploaded_by_admin:F.uploaded_by_admin};if(ce)n([...t,Ne]);else{const pe=C(B)?t.map(Pe=>Pe.document_type===B?Ne:Pe):[...t,Ne];n(pe)}et({title:"Document uploaded",description:"Your document has been uploaded successfully."})}m(null);const Ae=ce?ne:B;y.current[Ae]&&(y.current[Ae].value="")},q=async(M,B,G)=>{if(!f)return;v(M);const{error:te}=await Re.storage.from("application-documents").remove([B]);if(te){et({title:"Delete failed",description:te.message,variant:"destructive"}),v(null);return}const{error:ne}=await Re.from("documents").delete().eq("id",M);ne&&console.error("Failed to delete document reference:",ne),n(t.filter(ce=>ce.id!==M)),et({title:"Document deleted",description:"The document has been removed."}),v(null)},Z=a&&j&&!r?1:0,H=a&&!r?1:0;k.filter(M=>D(M.id)?I(M.id).length>0:C(M.id)).length+Z;const $=k.filter(M=>M.required).length+H,W=k.filter(M=>M.required&&(D(M.id)?I(M.id).length>0:C(M.id))).length+Z,ee=M=>D(M.id)?I(M.id).length>0:!!C(M.id),V=M=>{const B=D(M.id),G=B?I(M.id):[],te=B?null:C(M.id),ne=B?G.length>0:!!te;return s.jsxs(Ve,{className:ne?"border-primary/30":"",children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[M.label,M.id==="w2_forms"&&s.jsx(i0,{children:s.jsxs(xh,{children:[s.jsx(bh,{asChild:!0,children:s.jsx(Ed,{className:"w-4 h-4 text-muted-foreground cursor-help"})}),s.jsx(Pd,{className:"max-w-xs",children:s.jsx("p",{children:"Self-employed applicants must submit either a 1099 or a Schedule C (Profit and Loss) from their 2025 tax return. If available, submitting both is acceptable but not required."})})]})}),M.hasDownload&&s.jsx(i0,{children:s.jsxs(xh,{children:[s.jsx(bh,{asChild:!0,children:s.jsx(Ed,{className:"w-4 h-4 text-muted-foreground cursor-help"})}),s.jsx(Pd,{className:"max-w-xs",children:s.jsx("p",{children:"This document must be downloaded to your computer and printed to be filled out. You will need to complete all required information on this form, then scan and upload it back into this section. If you require assistance, please contact the STAR Sponsorship Office."})})]})}),M.required&&s.jsx("span",{className:"text-destructive text-xs",children:"*Required"}),M.waived&&s.jsx(Je,{variant:"secondary",className:"text-xs",children:"Waived by STAR"}),M.newFamiliesOnly&&s.jsx(Je,{variant:"outline",className:"text-xs",children:"New Families"})]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:M.description})]}),B&&G.length>0&&s.jsxs(Je,{variant:"default",className:"flex items-center gap-1",children:[s.jsx(Nt,{className:"w-3 h-3"}),G.length," file",G.length!==1?"s":""," uploaded"]}),!B&&te&&mm[te.status]&&s.jsxs(Je,{variant:mm[te.status].variant,className:"flex items-center gap-1",children:[(()=>{const ce=mm[te.status].icon;return s.jsx(ce,{className:"w-3 h-3"})})(),mm[te.status].label]})]})}),s.jsxs(He,{children:[B?s.jsxs("div",{className:"space-y-3",children:[G.map(ce=>{const oe=mm[ce.status],X=(oe==null?void 0:oe.icon)||En;return s.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(En,{className:"w-5 h-5 text-primary flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"text-sm truncate block",children:ce.file_name}),ce.uploaded_by_admin&&s.jsxs("span",{className:"text-xs text-blue-600 flex items-center gap-1 mt-0.5",children:[s.jsx(Nt,{className:"w-3 h-3"}),"Uploaded by administrator"]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[oe&&s.jsxs(Je,{variant:oe.variant,className:"flex items-center gap-1",children:[s.jsx(X,{className:"w-3 h-3"}),oe.label]}),s.jsx(we,{variant:"ghost",size:"sm",onClick:()=>q(ce.id,ce.file_path,ce.document_type),disabled:g===ce.id,className:"text-destructive hover:text-destructive",children:g===ce.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsx(Al,{className:"w-4 h-4"})})]})]},ce.id)}),G.some(ce=>ce.status==="needs_resubmission"&&ce.admin_feedback)&&s.jsx("div",{className:"p-3 bg-destructive/10 rounded-lg border border-destructive/20",children:G.filter(ce=>ce.status==="needs_resubmission"&&ce.admin_feedback).map(ce=>s.jsxs("p",{className:"text-sm text-destructive flex items-start gap-2",children:[s.jsx(er,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),s.jsxs("span",{children:[s.jsxs("strong",{children:["Feedback (",ce.file_name,"):"]})," ",ce.admin_feedback]})]},ce.id))}),s.jsx(we,{variant:"outline",onClick:()=>{var ce;return(ce=y.current[M.id])==null?void 0:ce.click()},disabled:h===M.id,className:"w-full justify-center",children:h===M.id?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):s.jsxs(s.Fragment,{children:[s.jsx(fa,{className:"w-4 h-4 mr-2"}),G.length>0?"Add Another File":"Upload File"]})})]}):te?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(En,{className:"w-5 h-5 text-primary flex-shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"text-sm truncate block",children:te.file_name}),te.uploaded_by_admin&&s.jsxs("span",{className:"text-xs text-blue-600 flex items-center gap-1 mt-0.5",children:[s.jsx(Nt,{className:"w-3 h-3"}),"Uploaded by administrator"]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(we,{variant:"outline",size:"sm",onClick:()=>{var ce;return(ce=y.current[M.id])==null?void 0:ce.click()},disabled:h===M.id,children:h===M.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):"Replace"}),s.jsx(we,{variant:"ghost",size:"sm",onClick:()=>q(te.id,te.file_path,M.id),disabled:g===te.id,className:"text-destructive hover:text-destructive",children:g===te.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsx(Al,{className:"w-4 h-4"})})]})]}),te.status==="needs_resubmission"&&te.admin_feedback&&s.jsx("div",{className:"p-3 bg-destructive/10 rounded-lg border border-destructive/20",children:s.jsxs("p",{className:"text-sm text-destructive flex items-start gap-2",children:[s.jsx(er,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Feedback:"})," ",te.admin_feedback]})]})})]}):s.jsxs("div",{className:"space-y-3",children:[M.hasDownload&&M.downloadUrl&&s.jsxs("a",{href:M.downloadUrl,download:!0,className:"flex items-center justify-center gap-2 p-3 bg-primary/10 rounded-lg border border-primary/20 hover:bg-primary/20 transition-colors",children:[s.jsx(Lg,{className:"w-4 h-4 text-primary"}),s.jsx("span",{className:"text-sm font-medium text-primary",children:M.id.startsWith("star_form")?"Download STAR Parent/Guardian Commitment Form":M.id.startsWith("teacher_recommendation")?"Download Teacher Recommendation Form":M.id.startsWith("principal_referral")?"Download Principal Referral Form 2026-27":M.id.startsWith("student_form")?"Download Student Form":`Download ${M.label}`})]}),s.jsx(we,{variant:"outline",onClick:()=>{var ce;return(ce=y.current[M.id])==null?void 0:ce.click()},disabled:h===M.id,className:"w-full justify-center",children:h===M.id?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):s.jsxs(s.Fragment,{children:[s.jsx(fa,{className:"w-4 h-4 mr-2"}),"Upload Completed Form"]})})]}),s.jsx("input",{ref:ce=>y.current[M.id]=ce,type:"file",accept:".pdf,.jpg,.jpeg,.png,.webp,.heic,.heif,.tiff,.tif,.bmp",onChange:ce=>U(ce,M.id),className:"hidden"})]})]},M.id)},O=(M,B)=>{var Q,ye;const G=w9(M).map(ie=>l.includes(ie.id)?{...ie,required:!1,waived:!0}:ie),te=G.filter(ie=>ie.required),ne=G.filter(ie=>!ie.required),ce=`${M.first_name} ${M.last_name}`.trim()||"Student",oe=(((Q=M.first_name)==null?void 0:Q[0])||"")+(((ye=M.last_name)==null?void 0:ye[0])||""),X=te.filter(ee).length,se=X===te.length&&ne.every(ie=>ee(ie));return s.jsxs(Co,{value:M.id,className:Ye("border rounded-lg px-4 data-[state=open]:shadow-sm",B%2===0?"bg-background":"bg-muted/30"),children:[s.jsx(Po,{className:"hover:no-underline py-4",children:s.jsxs("div",{className:"flex items-center gap-3 text-left w-full pr-4",children:[s.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-full bg-primary/10 text-primary font-semibold text-sm shrink-0",children:oe||s.jsx(ci,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-semibold text-base truncate",children:ce}),s.jsxs("div",{className:"text-sm text-muted-foreground",children:[X," of ",te.length," required documents uploaded"]})]}),se&&s.jsxs(Je,{variant:"default",className:"bg-green-600 shrink-0",children:[s.jsx(Nt,{className:"w-3 h-3 mr-1"}),"Complete"]})]})}),s.jsx(To,{children:s.jsxs("div",{className:"space-y-4 pt-2",children:[s.jsx("div",{className:"space-y-4",children:te.map(V)}),ne.length>0&&s.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Recommended (optional)"}),s.jsx(i0,{children:s.jsxs(xh,{children:[s.jsx(bh,{asChild:!0,children:s.jsx(Ed,{className:"w-4 h-4 text-muted-foreground cursor-help"})}),s.jsx(Pd,{className:"max-w-xs",children:s.jsx("p",{children:"These documents are helpful but not required to submit your application. You can upload them later if needed."})})]})})]}),ne.map(V)]})]})})]},M.id)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Document Uploads"}),s.jsx("p",{className:"text-muted-foreground text-sm mb-2",children
906:r?"As a returning family adding a new student, the Teacher Referral Form and Principal Referral Form are required.":"Please upload the required documents for your application. Accepted formats: PDF, JPEG, PNG, WebP, HEIC, TIFF, BMP. Maximum file size: 50MB."}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:W})," of"," ",s.jsx("span",{className:"font-medium",children:$})," required documents uploaded"]})]}),r&&s.jsx(Ve,{className:"bg-green-50 dark:bg-green-950/20 border-green-200",children:s.jsx(He,{className:"pt-4",children:s.jsxs("p",{className:"text-sm text-green-800 dark:text-green-200",children:[s.jsx("strong",{children:"Returning Family Benefit:"})," Your existing tax documents are on file. You only need to upload the Teacher Referral Form for this new student."]})})}),b&&!r&&s.jsx(Ve,{className:"bg-blue-50 dark:bg-blue-950/20 border-blue-200",children:s.jsx(He,{className:"pt-4",children:s.jsx("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"As a new family, you have additional document requirements marked below."})})}),a&&!r&&s.jsxs(Ve,{className:j?"border-green-300 bg-green-50 dark:bg-green-950/20":"border-amber-300 bg-amber-50 dark:bg-amber-950/20",children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:["Self-Employment Income Statement",s.jsx("span",{className:"text-destructive text-xs",children:"*Required"})]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j?"Completed via in-app signature in the Parent/Guardian Information section.":"Please complete and sign the Self-Employment Statement in the Parent/Guardian Information section (Step 1)."})]}),j?s.jsxs(Je,{variant:"default",className:"flex items-center gap-1 bg-green-600",children:[s.jsx(Nt,{className:"w-3 h-3"}),"Completed"]}):s.jsxs(Je,{variant:"secondary",className:"flex items-center gap-1",children:[s.jsx(Fn,{className:"w-3 h-3"}),"Pending Signature"]})]})}),w&&s.jsx(He,{className:"pt-0",children:s.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted/50 rounded-lg",children:[s.jsx(En,{className:"w-5 h-5 text-primary flex-shrink-0"}),s.jsx("span",{className:"text-sm",children:w.file_name}),w.status==="approved"&&s.jsx(Je,{variant:"default",className:"ml-auto bg-green-600",children:"Approved"})]})})]}),!u&&!r&&A.length>0&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"text-base font-semibold",children:"Family Financial Documents"}),s.jsx(i0,{children:s.jsxs(xh,{children:[s.jsx(bh,{asChild:!0,children:s.jsx(Ed,{className:"w-4 h-4 text-muted-foreground cursor-help"})}),s.jsx(Pd,{className:"max-w-xs",children:s.jsx("p",{children:"These documents apply to your whole household and only need to be uploaded once."})})]})})]}),A.map(M=>l.includes(M.id)?{...M,required:!1,waived:!0}:M).map(V)]}),!r&&d.length>0&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("h3",{className:"text-base font-semibold",children:"Student Documents"}),s.jsx(uj,{type:"multiple",defaultValue:d.map(M=>M.id),className:"space-y-3",children:d.map(O)})]}),r&&k.length>0&&s.jsx("div",{className:"space-y-4",children:k.map(V)}),s.jsxs(Ve,{children:[s.jsxs(_t,{className:"pb-3",children:[s.jsx(jt,{className:"text-base",children:"Supplemental Documents"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Add any additional documentation that you think might be helpful for the STAR Program to evaluate your need for a scholarship."})]}),s.jsx(He,{children:s.jsxs("div",{className:"space-y-3",children:[t.filter(M=>M.document_type.startsWith("supplemental_")).map(M=>{const B=mm[M.status],G=(B==null?void 0:B.icon)||En;return s.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(En,{className:"w-5 h-5 text-primary flex-shrink-0"}),s.jsx("span",{className:"text-sm truncate",children:M.file_name})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[B&&s.jsxs(Je,{variant:B.variant,className:"flex items-center gap-1",children:[s.jsx(G,{className:"w-3 h-3"}),B.label]}),s.jsx(we,{variant:"ghost",size:"sm",onClick:()=>q(M.id,M.file_path,M.document_type),disabled:g===M.id,className:"text-destructive hover:text-destructive",children:g===M.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsx(Al,{className:"w-4 h-4"})})]})]},M.id)}),s.jsx(we,{variant:"outline",onClick:()=>{var M;return(M=y.current.supplemental)==null?void 0:M.click()},disabled:(h==null?void 0:h.startsWith("supplemental"))||!1,className:"w-full justify-center",children:h!=null&&h.startsWith("supplemental")?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):s.jsxs(s.Fragment,{children:[s.jsx(fa,{className:"w-4 h-4 mr-2"}),"Upload Supplemental Document"]})}),s.jsx("input",{ref:M=>y.current.supplemental=M,type:"file",accept:".pdf,.jpg,.jpeg,.png,.webp,.heic,.heif,.tiff,.tif,.bmp",onChange:M=>U(M,`supplemental_${Date.now()}`),className:"hidden"})]})})]})]})}
906,pZe=["current_tax_return","w2_forms"],mZe=["last_year_tax_return"],Iw={pending:{label:"Pending",variant:"secondary",icon:Fn},uploaded:{label:"Uploaded",variant:"outline",icon:fa},approved:{label:"Approved",variant:"default",icon:Nt},needs_resubmission:{label:"Needs Resubmission",variant:"destructive",icon:er}},_9={current_tax_return:"2025 Tax Documents (Upload all pages)",w2_forms:"2025 – W-2, 1099, or Schedule C",self_employment:"Self-Employment Income Statement","Self-Employment Statement":"Self-Employment Statement (Signed In-App)",star_form:"Parent/Guardian Commitment Form",last_year_tax_return:"2024 Tax Return",teacher_recommendation:"Teacher Referral Form",principal_referral:"Principal Referral Form",report_card:"Most Recent Report Card"},gZe={mother:"Mother",father:"Father",stepparent:"Stepparent",grandparent:"Grandparent",aunt:"Aunt",uncle:"Uncle",legal_guardian:"Legal Guardian",other:"Other"},vZe={employed:"Employed",self_employed:"Self-Employed",unemployed:"Unemployed",retired:"Retired",other:"Other"},yZe=e=>e?wm(e):"—",xZe=({formData:e,documents:t,hasSelfEmployedGuardian:n=!1,selfEmploymentStatementSubmitted:r=!1,isNewFamily:a,onGoToDocuments:i,missingDocuments:o=[],documentWaivers:l=[]})=>{const{profile:c}=bi(),u=a??(c==null?void 0:c.applicant_type)==="new",d=(c==null?void 0:c.applicant_type)==="returning",f=e.guardians.find($=>$.is_primary)||e.guardians[0],p=e.guardians.find($=>!$.is_primary),h=$=>$?!!($.first_name&&$.last_name&&$.relationship&&$.email&&$.phone):!1,m=$=>!$||!$.employment_status?!1:$.employment_status==="employed"||$.employment_status==="self_employed"?!!($.employer_name&&$.job_title&&$.annual_salary):!0,g=$=>h($)&&m($),v=($,W)=>{const ee=[];return $?($.first_name||ee.push(`${W}: First Name`),$.last_name||ee.push(`${W}: Last Name`),$.relationship||ee.push(`${W}: Relationship`),$.email||ee.push(`${W}: Email`),$.phone||ee.push(`${W}: Phone`),$.employment_status||ee.push(`${W}: Employment Status`),($.employment_status==="employed"||$.employment_status==="self_employed")&&($.employer_name||ee.push(`${W}: ${$.employment_status==="self_employed"?"Business Name":"Employer Name"}`),$.job_title||ee.push(`${W}: Job Title`),$.annual_salary||ee.push(`${W}: Annual Salary`)),ee):[`${W}: No information provided`]},y=e.marital_status==="married"||e.marital_status==="divorced",w=(()=>{const $=[];return e.marital_status||$.push("Marital Status"),e.address||$.push("Address"),e.city||$.push("City"),e.state||$.push("State"),e.zip_code||$.push("Zip Code"),$.push(...v(f,"Primary Guardian")),y&&$.push(...v(p,"Second Guardian")),$})(),j=e.marital_status&&g(f)&&e.address&&e.city&&e.state&&e.zip_code&&(!y||g(p)),S=e.students.length>0&&e.students.every($=>{const W=!!$.tefa_status&&($.tefa_status!=="waitlist"||!!$.tefa_waitlist_position);return!!($.first_name&&$.last_name&&$.date_of_birth&&$.grade&&$.school&&W)}),A=e.household_size&&e.household_income&&e.how_heard_about_us&&e.essay,E=t.find($=>$.document_type==="Self-Employment Statement"||$.document_type==="self_employment"),k=r||!!E,P=$=>l.includes($),R=[...pZe],C=t.map($=>$.document_type),I=$=>C.some(W=>W===$||W.startsWith(`${$}_page_`)),D=R.every($=>P($)||I($)),U=(e.students||[]).every($=>P(`star_form_${$.id}`)||I(`star_form_${$.id}`)),q=D&&U&&(!n||k),Z=j&&S&&A&&q,H=($,W)=>$?s.jsxs("div",{className:"space-y-2 border-b pb-4 last:border-0 last:pb-0",children:[s.jsx("p",{className:"font-medium text-sm",children:W}),s.jsxs("div",{className:"grid gap-2 md:grid-cols-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Name:"})," ",$.first_name," ",$.last_name||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Relationship:"})," ",gZe[$.relationship]||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Email:"})," ",$.email||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Phone:"})," ",$.phone||"—"]}),$.employment_status&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Employment:"})," ",vZe[$.employment_status]||"—"]}
906),($.employment_status==="employed"||$.employment_status==="self_employed")&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:$.employment_status==="self_employed"?"Business:":"Employer:"})," ",$.employer_name||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Job Title:"})," ",$.job_title||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Annual Salary:"})," ",yZe($.annual_salary)]})]})]})]})]}):null;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Review Your Application"}),s.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Please review all information before submitting. You can go back to any section to make changes."})]}),!Z&&s.jsx(Ve,{className:"border-yellow-500 bg-yellow-50 dark:bg-yellow-950/20",children:s.jsxs(He,{className:"pt-6 space-y-3",children:[s.jsx("p",{className:"text-yellow-800 dark:text-yellow-200 text-sm font-medium",children:"⚠️ Cannot Submit - Application Incomplete"}),o.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-yellow-800 dark:text-yellow-200 text-sm mb-2",children:"Missing Required Documents:"}),s.jsx("ul",{className:"text-yellow-700 dark:text-yellow-300 text-sm list-disc ml-5 space-y-1",children:o.map(($,W)=>s.jsx("li",{children:$},W))})]}),i&&o.length>0&&s.jsx(we,{variant:"outline",size:"sm",onClick:i,className:"mt-2",children:"Go to Document Uploads"})]})}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[s.jsx(ci,{className:"w-4 h-4"}),"Parent/Guardian Information"]}),s.jsx(Je,{variant:j?"default":"outline",children:j?s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"w-3 h-3 mr-1"}),"Complete"]}):"Incomplete"})]})}),s.jsxs(He,{className:"text-sm space-y-4",children:[!j&&w.length>0&&s.jsxs("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded-md mb-4",children:[s.jsxs("p",{className:"text-amber-800 font-medium text-sm mb-2 flex items-center gap-1",children:[s.jsx(er,{className:"w-4 h-4"}),"Missing Required Fields:"]}),s.jsxs("ul",{className:"text-amber-700 text-xs space-y-1 ml-5 list-disc",children:[w.slice(0,6).map(($,W)=>s.jsx("li",{children:$},W)),w.length>6&&s.jsxs("li",{children:["...and ",w.length-6," more"]})]})]}),e.marital_status&&s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Marital Status:"})," ",s.jsx("span",{className:"capitalize",children:e.marital_status})]}),H(f,"Primary Parent/Guardian"),y&&H(p,"Second Parent/Guardian"),s.jsxs("div",{className:"pt-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Address:"})," ",e.address?`${e.address}${e.address_line_2?`, ${e.address_line_2}`:""}, ${e.city}, ${e.state} ${e.zip_code}`:"—"]})]})]}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[s.jsx(Zr,{className:"w-4 h-4"}),"Student Information (",e.students.length," student",e.students.length!==1?"s":"",")"]}),s.jsx(Je,{variant:S?"default":"outline",children:S?s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"w-3 h-3 mr-1"}),"Complete"]}):"Incomplete"})]})}),s.jsx(He,{className:"text-sm",children:e.students.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No students added"}):s.jsx("div",{className:"space-y-4",children:e.students.map(($,W)=>{const ee=t.find(O=>O.document_type===`teacher_recommendation_${$.id}`||O.document_type==="teacher_recommendation"),V=$.status==="new";return s.jsxs("div",{className:"border-b pb-3 last:border-0",children:[s.jsxs("p",{className:"font-medium mb-1",children:["Student ",W+1]}),s.jsxs("div",{className:"grid gap-1 md:grid-cols-2 text-muted-foreground",children:[s.jsxs("div",{children:["Name: ",$.first_name," ",$.last_name||"—"]}),s.jsxs("div",{children:["DOB: ",$.date_of_birth||"—"]}
906),s.jsxs("div",{children:["2026–27 Grade: ",$.grade||"—"]}),s.jsxs("div",{children:["School: ",$.school||"—"]}),s.jsxs("div",{children:["TEFA Status: ",xee($.tefa_status)]}),$.tefa_status==="waitlist"&&s.jsxs("div",{children:["Waitlist Position: ",$.tefa_waitlist_position||"—"]})]}),V&&s.jsx("div",{className:"mt-2",children:ee?s.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[s.jsx(Nt,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Teacher Recommendation Form Uploaded"})]}):s.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[s.jsx(er,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm",children:"Teacher Recommendation Form (optional — may be requested later)"})]})})]},$.id)})})})]}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[s.jsx(sf,{className:"w-4 h-4"}),"Financial Information"]}),s.jsx(Je,{variant:A?"default":"outline",children:A?s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"w-3 h-3 mr-1"}),"Complete"]}):"Incomplete"})]})}),s.jsxs(He,{className:"text-sm space-y-2",children:[s.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Household Size:"})," ",e.household_size||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Income Range:"})," ",e.household_income||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Receives Assistance:"})," ",e.receives_assistance?"Yes":"No"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"How Heard:"})," ",e.how_heard_about_us||"—"]})]}),e.essay&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"text-muted-foreground mb-1",children:"Essay:"}),s.jsx("p",{className:"text-foreground whitespace-pre-wrap",children:e.essay.length>300?e.essay.substring(0,300)+"...":e.essay})]})]})]}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[s.jsx(En,{className:"w-4 h-4"}),"Documents"]}),s.jsx(Je,{variant:q?"default":"outline",children:q?s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"w-3 h-3 mr-1"}),"Complete"]}):"Incomplete"})]})}),s.jsx(He,{className:"text-sm",children:s.jsxs("div",{className:"space-y-2",children:[R.map($=>{const W=t.find(O=>O.document_type===$),ee=W?Iw[W.status]:null,V=(ee==null?void 0:ee.icon)||En;return s.jsxs("div",{className:"flex items-center justify-between py-2 border-b last:border-0",children:[s.jsx("span",{className:"text-muted-foreground",children:_9[$]||$}),W?s.jsxs(Je,{variant:ee==null?void 0:ee.variant,className:"flex items-center gap-1",children:[s.jsx(V,{className:"w-3 h-3"}),ee==null?void 0:ee.label]}):P($)?s.jsx(Je,{variant:"secondary",children:"Waived by STAR"}):s.jsx(Je,{variant:"outline",className:"text-destructive",children:"Not Uploaded"})]},$)}),e.students.flatMap($=>{const W=`${$.first_name} ${$.last_name}`.trim()||"Student";return[{id:`star_form_${$.id}`,label:`${$.first_name||"Student"}'s Parent/Guardian Commitment Form`,optional:!1},...$.status==="new"?[{id:`teacher_recommendation_${$.id}`,label:`${W}'s Teacher Recommendation`,optional:!0},{id:`principal_referral_${$.id}`,label:`${W}'s Principal Referral Form`,optional:!1},{id:`report_card_${$.id}`,label:`${W}'s Most Recent Report Card`,optional:!0}]:[]].map(({id:V,label:O,optional:M})=>{const B=t.find(ne=>ne.document_type===V),G=B?Iw[B.status]:null,te=(G==null?void 0:G.icon)||En;return s.jsxs("div",{className:"flex items-center justify-between py-2 border-b last:border-0",children:[s.jsxs("span",{className:"text-muted-foreground",children:[O,M&&s.jsx("span",{className:"ml-1 text-xs",children:"(Recommended)"})]}),B?s.jsxs(Je,{variant:G==null?void 0:G.variant,className:"flex items-center gap-1",children:[s.jsx(te,{className:"w-3 h-3"}),G==null?void 0:G.label]}):P(V)?s.jsx(Je,{variant:"secondary",children:"Waived by STAR"}):M?s.jsx(Je,{variant:"secondary",children:"Can be submitted later"}):s.jsx(Je,{variant:"outline",className:"text-destructive",children:"Not Uploaded"})]},V)})}),u&&mZe.map($=>{const W=t.find(O=>O.document_type===$||O.document_type.startsWith(`${$}_page_`)),ee=W?Iw[W.status]:null,V=(ee==null?void 0:ee.icon)||En;return s.jsxs("div",{className:"flex items-center justify-between py-2 border-b last:border-0",children:[s.jsxs("span",{className:"text-muted-foreground",children:[_9[$]||$,s.jsx("span",{className:"ml-1 text-xs",children:"(Recommended)"})]}),W?s.jsxs(Je,{variant:ee==null?void 0:ee.variant,className:"flex items-center gap-1",children:[s.jsx(V,{className:"w-3 h-3"}),ee==null?void 0:ee.label]}):s.jsx(Je,{variant:"secondary",children:"Can be submitted later"})]},$)}),e.students.map($=>{const W=`student_form_${$.id}`,ee=t.find(B=>B.document_type===W),V=ee?Iw[ee.status]:null,O=(V==null?void 0:V.icon)||En,M=`${$.first_name} ${$.last_name}`.trim()||"Student";return s.jsxs("div",{className:"flex items-center justify-between py-2 border-b last:border-0",children:[s.jsxs("span",{className:"text-muted-foreground",children:[M,"'s Student Form"]}),ee?s.jsxs(Je,{variant:V==null?void 0:V.variant,className:"flex items-center gap-1",children:[s.jsx(O,{className:"w-3 h-3"}),V==null?void 0:V.label]}):s.jsx(Je,{variant:"outline",className:"text-destructive",children:"Not Uploaded"})]},W)}),n&&s.jsxs("div",{className:"flex items-center justify-between py-2 border-b last:border-0",children:[s.jsx("span",{className:"text-muted-foreground",children:"Self-Employment Income Statement"}),k?s.jsxs(Je,{variant:"default",className:"flex items-center gap-1 bg-green-600",children:[s.jsx(Nt,{className:"w-3 h-3"}),E&&E.status==="approved"?"Approved":"Signed In-App"]}):s.jsx(Je,{variant:"outline",className:"text-destructive",children:"Not Completed"})]})]})})]}),Z&&s.jsx(Ve,{className:"border-green-500 bg-green-50 dark:bg-green-950/20",children:s.jsxs(He,{className:"pt-6 space-y-2",children:[s.jsxs("p",{className:"text-green-800 dark:text-green-200 text-sm flex items-center gap-2",children:[s.jsx(Nt,{className:"w-4 h-4"}),"Your application is complete and ready to submit!"]}
906),d&&s.jsx("p",{className:"text-green-700 dark:text-green-300 text-sm ml-6",children:"As a returning family, no interview is required."})]})})]})},bZe={mother:"Mother",father:"Father",stepparent:"Stepparent",grandparent:"Grandparent",aunt:"Aunt",uncle:"Uncle",legal_guardian:"Legal Guardian",other:"Other"},wZe={employed:"Employed",self_employed:"Self-Employed",unemployed:"Unemployed",retired:"Retired",other:"Other"},j9={current_tax_return:"2025 Tax Documents (Upload all pages)",w2_forms:"2025 – W-2, 1099, or Schedule C",self_employment:"Self-Employment Income Statement","Self-Employment Statement":"Self-Employment Statement (Signed In-App)",star_form:"STAR Parent/Guardian Commitment Form",last_year_tax_return:"2024 Tax Return",teacher_recommendation:"Teacher Referral Form",principal_referral:"Principal Referral Form",report_card:"Most Recent Report Card"},S9={submitted:{label:"Submitted",status:"submitted"},under_review:{label:"Under Review",status:"under_review"},approved:{label:"Approved",status:"approved"},rejected:{label:"Not Approved",status:"rejected"}},_Ze=({formData:e,documents:t,applicationStatus:n,submittedAt:r,isNewFamily:a=!1})=>{const i=di(),o=e.guardians.find(m=>m.is_primary)||e.guardians[0],l=e.guardians.find(m=>!m.is_primary),c=e.marital_status==="married"||e.marital_status==="divorced",u=m=>{if(!m)return"—";try{return Dn(new Date(m),"MMMM d, yyyy 'at' h:mm a")}catch{return m}},d=S9[n]||S9.submitted,f=(m,g)=>m?s.jsxs("div",{className:"space-y-2 border-b pb-4 last:border-0 last:pb-0",children:[s.jsx("p",{className:"font-medium text-sm",children:g}),s.jsxs("div",{className:"grid gap-2 md:grid-cols-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Name:"})," ",m.first_name," ",m.last_name||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Relationship:"})," ",bZe[m.relationship]||m.relationship||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Email:"})," ",m.email||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Phone:"})," ",m.phone||"—"]}),m.employment_status&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Employment:"})," ",wZe[m.employment_status]||m.employment_status||"—"]}),(m.employment_status==="employed"||m.employment_status==="self_employed")&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:m.employment_status==="self_employed"?"Business:":"Employer:"})," ",m.employer_name||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Job Title:"})," ",m.job_title||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Annual Salary:"})," ",m.annual_salary?wm(m.annual_salary):"—"]})]})]})]})]}):null,p=[{prefix:"star_form_",fallback:"Parent/Guardian Commitment Form",labelFn:m=>`${m}'s Parent/Guardian Commitment Form`},{prefix:"teacher_recommendation_",fallback:"Teacher Recommendation",labelFn:m=>`${m}'s Teacher Recommendation`},{prefix:"principal_referral_",fallback:"Principal Referral Form",labelFn:m=>`${m}'s Principal Referral Form`},{prefix:"report_card_",fallback:"Most Recent Report Card",labelFn:m=>`${m}'s Most Recent Report Card`},{prefix:"student_form_",fallback:"Student Form",labelFn:m=>`${m}'s Student Form`}],h=m=>{const g=["current_tax_return","w2_forms","last_year_tax_return"];for(const v of g)if(m.startsWith(`${v}_page_`))return j9[v]||v;for(const{prefix:v,fallback:y,labelFn:b}of p)if(m.startsWith(v)){const w=m.replace(v,""),j=e.students.find(S=>S.id===w);return j?b(`${j.first_name} ${j.last_name}`.trim()):y}return j9[m]||m};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Ve,{className:"border-primary/30 bg-primary/5",children:[s.jsx(_t,{className:"pb-3",children:s.jsxs(jt,{className:"flex items-center gap-2 text-primary",children:[s.jsx(Mg,{className:"w-5 h-5"}),"Your Application Has Been Submitted"]})}),s.jsx(He,{children:s.jsx("p",{className:"text-muted-foreground text-sm",children:"Your application has been submitted and is now locked. If you need to make changes, please contact us."})})]}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsx(jt,{className:"text-base",children:"Submission Details"})}),s.jsxs(He,{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Status:"}),s.jsx(jj,{status:d.status,size:"md"})]}),s.jsxs("div",{className:"text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Submitted:"})," ",u(r)]})]})]}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[s.jsx(ci,{className:"w-4 h-4"}),"Parent/Guardian Information"]}),s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-[hsl(var(--status-approved))]",children:[s.jsx(Nt,{className:"w-3.5 h-3.5"}),"Complete"]})]})}),s.jsxs(He,{className:"text-sm space-y-4",children:[e.marital_status&&s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Marital Status:"})," ",s.jsx("span",{className:"capitalize",children:e.marital_status})]}),f(o,"Primary Parent/Guardian"),c&&f(l,"Second Parent/Guardian"),s.jsxs("div",{className:"pt-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Address:"})," ",e.address?`${e.address}${e.address_line_2?`, ${e.address_line_2}`:""}, ${e.city}, ${e.state} ${e.zip_code}`:"—"]})]})]}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[s.jsx(Zr,{className:"w-4 h-4"}),"Student Information (",e.students.length," student",e.students.length!==1?"s":"",")"]}),s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-[hsl(var(--status-approved))]",children:[s.jsx(Nt,{className:"w-3.5 h-3.5"}),"Complete"]})]})}),s.jsx(He,{className:"text-sm",children:e.students.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No students added"}):s.jsx("div",{className:"space-y-4",children:e.students.map((m,g)=>s.jsxs("div",{className:"border-b pb-3 last:border-0 last:pb-0",children:[s.jsxs("p",{className:"font-medium mb-1",children:["Student ",g+1]}),s.jsxs("div",{className:"grid gap-1 md:grid-cols-2 text-muted-foreground",children:[s.jsxs("div",{children:["Name: ",m.first_name," ",m.last_name||"—"]}),s.jsxs("div",{children:["DOB: ",m.date_of_birth||"—"]}
906),s.jsxs("div",{children:["2026–27 Grade: ",m.grade||"—"]}),s.jsxs("div",{children:["School: ",m.school||"—"]}),m.status&&s.jsxs("div",{children:["Status: ",s.jsx("span",{className:"capitalize",children:m.status==="new"?"New Student":"Returning Student"})]})]})]},m.id))})})]}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[s.jsx(sf,{className:"w-4 h-4"}),"Financial Information"]}),s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-[hsl(var(--status-approved))]",children:[s.jsx(Nt,{className:"w-3.5 h-3.5"}),"Complete"]})]})}),s.jsxs(He,{className:"text-sm space-y-2",children:[s.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Household Size:"})," ",e.household_size||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Income Bracket:"})," ",e.household_income||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Receives Assistance:"})," ",e.receives_assistance?"Yes":"No"]}),e.monthly_rent_payment&&s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Monthly Rent/Mortgage:"})," ",wm(e.monthly_rent_payment)]}),e.monthly_car_payment&&s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Monthly Car Payment:"})," ",wm(e.monthly_car_payment)]}),e.receives_social_security&&e.social_security_amount&&s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Social Security:"})," ",wm(e.social_security_amount)]}),e.ex_spouse_support_amount&&s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Spousal/Child Support:"})," ",wm(e.ex_spouse_support_amount)]})]}),e.has_other_income&&e.other_income_description&&s.jsxs("div",{className:"pt-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Other Income:"})," ",e.other_income_description]}),e.has_star_family_member&&e.star_family_member_names&&s.jsxs("div",{className:"pt-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"STAR Family Members:"})," ",e.star_family_member_names]}),e.how_heard_about_us&&s.jsxs("div",{className:"pt-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"How Heard About Us:"})," ",e.how_heard_about_us]}),e.essay&&s.jsxs("div",{className:"pt-2",children:[s.jsx("p",{className:"text-muted-foreground mb-1",children:"Essay:"}),s.jsx("p",{className:"bg-muted/50 p-3 rounded-md whitespace-pre-wrap",children:e.essay})]})]})]}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(jt,{className:"text-base flex items-center gap-2",children:[s.jsx(En,{className:"w-4 h-4"}),"Documents"]}),s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-[hsl(var(--status-approved))]",children:[s.jsx(Nt,{className:"w-3.5 h-3.5"}),"Complete"]})]})}),s.jsx(He,{children:t.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No documents uploaded"}):s.jsx("div",{className:"space-y-2",children:t.map(m=>s.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/30 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(En,{className:"w-4 h-4 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:h(m.document_type)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:m.file_name}),m.uploaded_by_admin&&s.jsx("p",{className:"text-xs text-blue-600 mt-0.5",children:"Uploaded by administrator"})]})]}),s.jsx(jj,{status:m.status,size:"sm"})]},m.id))})})]}),s.jsx("div",{className:"flex justify-center pt-4",children:s.jsxs(we,{onClick:()=>i("/portal/family"),size:"lg",children:[s.jsx(fc,{className:"w-4 h-4 mr-2"}),"Back to Dashboard"]})})]})}
906,jZe=({steps:e,currentStep:t,stepStatuses:n,onStepClick:r})=>{const a=(i,o)=>{const l=i===t;return i===5?o.isComplete?s.jsx("div",{className:"w-8 h-8 rounded-full bg-green-100 text-green-600 flex items-center justify-center font-semibold text-sm",children:s.jsx(tx,{className:"h-4 w-4"})}):s.jsx("div",{className:Ye("w-8 h-8 rounded-full flex items-center justify-center font-semibold text-sm",l?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:i}):o.isComplete?s.jsx("div",{className:"w-8 h-8 rounded-full bg-green-100 text-green-600 flex items-center justify-center font-semibold text-sm",children:s.jsx(tx,{className:"h-4 w-4"})}):s.jsx("div",{className:Ye("w-8 h-8 rounded-full flex items-center justify-center font-semibold text-sm",l?"bg-destructive text-destructive-foreground":"bg-red-100 text-destructive"),children:i})};return s.jsx("div",{className:"w-56 shrink-0 hidden md:block",children:s.jsx("div",{className:"sticky top-4 space-y-2",children:e.map((i,o)=>{const l=n[o]||{isComplete:!1,missing:[]},c=i.number===t;return s.jsxs("button",{onClick:()=>r(i.number),className:Ye("w-full flex items-center gap-3 p-3 rounded-lg text-left transition-colors",c?"bg-accent":"hover:bg-muted"),children:[a(i.number,l),s.jsx("span",{className:Ye("text-sm font-medium",c?"text-foreground":"text-muted-foreground"),children:i.title})]},i.number)})})})},SZe=({steps:e,currentStep:t,stepStatuses:n,onStepClick:r})=>s.jsx("div",{className:"md:hidden mb-6",children:s.jsx("div",{className:"flex items-center justify-between gap-1",children:e.map((a,i)=>{const o=n[i]||{isComplete:!1,missing:[]},l=a.number===t,c=a.number===5;let u="bg-muted",d="text-muted-foreground";return o.isComplete?(u="bg-green-100",d="text-green-600"):c?l&&(u="bg-primary",d="text-primary-foreground"):(u=l?"bg-destructive":"bg-red-100",d=l?"text-destructive-foreground":"text-destructive"),s.jsxs("button",{onClick:()=>r(a.number),className:Ye("flex-1 flex flex-col items-center gap-1 p-2 rounded-lg transition-colors",l?"bg-accent":"hover:bg-muted"),children:[s.jsx("div",{className:Ye("w-7 h-7 rounded-full flex items-center justify-center font-semibold text-xs",u,d),children:o.isComplete?s.jsx(tx,{className:"h-3 w-3"}):a.number}),s.jsx("span",{className:"text-[10px] text-muted-foreground text-center line-clamp-1",children:a.title.split(" ")[0]})]},a.number)})})}),NZe=({missingFields:e})=>e.length===0?null:s.jsxs(Nu,{variant:"destructive",className:"mb-6",children:[s.jsx(er,{className:"h-4 w-4"}),s.jsx(cJ,{children:"Please Complete Required Fields"}),s.jsxs(Au,{children:[s.jsx("p",{className:"mb-2",children:"The following fields must be completed before proceeding:"}),s.jsx("ul",{className:"list-disc ml-4 space-y-1",children:e.map((t,n)=>s.jsx("li",{children:t},n))})]})]}),Qk=[{number:1,title:"Parent/Guardian Info"},{number:2,title:"Student Information"},{number:3,title:"Financial Information"},{number:4,title:"Document Uploads"},{number:5,title:"Review & Submit"}],Jy=async(e,t=1e4)=>{let n;const r=new Promise(a=>{n=setTimeout(()=>a(null),t)});return Promise.race([e,r]).finally(()=>{n&&clearTimeout(n)})},AZe=()=>{var ye;const{id:e}=qq(),t=di(),{user:n,profile:r,session:a}=bi(),i=Ab(),[o,l]=x.useState(!0),[c,u]=x.useState(!1),[d,f]=x.useState(1),[p,h]=x.useState(!1),[m,g]=x.useState({address:"",address_line_2:"",city:"",state:"",zip_code:"",marital_status:"",guardians:[O0(!0)],students:[],dependents:[],household_size:void 0,household_income:"",receives_assistance:!1,monthly_rent_payment:"",monthly_car_payment:"",receives_social_security:!1,social_security_amount:"",ex_spouse_support_amount:"",has_other_income:!1,other_income_description:"",has_star_family_member:!1,star_family_member_names:"",how_heard_about_us:"",essay:""}),[v,y]=x.useState([]),[b,w]=x.useState([]),[j,S]=x.useState(!1),[A,E]=x.useState([]),[k,P]=x.useState("draft"),[R,C]=x.useState(null),[I,D]=x.useState(!1),U=(r==null?void 0:r.applicant_type)==="new",q=(r==null?void 0:r.referral_status)==="approved",Z=(r==null?void 0:r.applicant_type)==="returning";x.useEffect(()=>{(async()=>{var F;if(!e){l(!1),t("/portal/family");return}if(n){l(!0);try{let me=null,Ae=null,Ne=null;const ve=await Jy(Re.from("applications").select("*").eq("id",e).eq("user_id",n.id).maybeSingle());let pe=ve==null?void 0:ve.data;if(ve!=null&&ve.error||!pe){const Fe=await Jy(Re.functions.invoke("family-profile",{body:{action:"get-application",applicationId:e}}),1e4);if(Fe!=null&&Fe.error||!((F=Fe==null?void 0:Fe.data)!=null&&F.application)){et({title:"Error",description:"Application not found or access denied.",variant:"destructive"}),t("/portal/family",{replace:!0,state:{skipAutoResume:!0}});return}pe=Fe.data.application,me=Fe.data.students??[],Ae=Fe.data.guardians??[],Ne=Fe.data.documents??[]}const Pe=me===null?await Jy(Re.from("students").select("*").eq("application_id",e).order("created_at",{ascending:!0})):null,Ee=me??((Pe==null?void 0:Pe.data)||[]),Ie=(r==null?void 0:r.applicant_type)==="returning";let Me=[];if(Ee&&Ee.length>0)Me=Ee.map((Fe,It)=>({id:Fe.id,first_name:Fe.first_name,last_name:Fe.last_name,date_of_birth:Fe.date_of_birth||"",grade:Fe.grade||"",school:Fe.school||"",status:Ie?Fe.status||(It===0?"returning":""):"new",race:Fe.race||"",gender:Fe.gender||"",tefa_status:Fe.tefa_status||"",tefa_waitlist_position:Fe.tefa_waitlist_position!=null?String(Fe.tefa_waitlist_position):""}));else if((r==null?void 0:r.applicant_type)==="new"){const{data:Fe}=await Re.from("referral_documents").select("student_first_name, student_last_name").eq("user_id",n.id).eq("status","approved").order("created_at",{ascending:!0});Fe&&Fe.length>0&&(Me=Fe.map((It,zt)=>({id:`prefilled-${Date.now()}-${zt}`,first_name:It.student_first_name||"",last_name:It.student_last_name||"",date_of_birth:"",grade:"",school:"",status:"new",race:"",gender:"",tefa_status:"",tefa_waitlist_position:""})))}const tt=Ae===null?await Jy(Re.from("guardians").select("*").eq("application_id",e).order("is_primary",{ascending:!1})):null,De=Ae??((tt==null?void 0:tt.data)||[]),Qe=De&&De.length>0?De.map(Fe=>({id:Fe.id,application_id:Fe.application_id,user_id:Fe.user_id,is_primary:Fe.is_primary,first_name:Fe.first_name,last_name:Fe.last_name,email:Fe.email||"",phone:Fe.phone||"",relationship:Fe.relationship,employment_status:Fe.employment_status||"",employer_name:Fe.employer_name||"",job_title:Fe.job_title||"",annual_salary:Fe.annual_salary?_m(Fe.annual_salary):""}
906)):[O0(!0)],vt=Array.isArray(pe.dependents)?pe.dependents:[];g({address:pe.address||"",address_line_2:pe.address_line_2||"",city:pe.city||"",state:pe.state||"",zip_code:pe.zip_code||"",marital_status:pe.marital_status||"",guardians:Qe,students:Me,dependents:vt,household_size:pe.household_size||void 0,household_income:pe.household_income||"",receives_assistance:pe.receives_assistance||!1,monthly_rent_payment:_m(pe.monthly_rent_payment),monthly_car_payment:_m(pe.monthly_car_payment),receives_social_security:pe.receives_social_security||!1,social_security_amount:_m(pe.social_security_amount),ex_spouse_support_amount:_m(pe.ex_spouse_support_amount),has_other_income:pe.has_other_income||!1,other_income_description:pe.other_income_description||"",has_star_family_member:pe.has_star_family_member||!1,star_family_member_names:pe.star_family_member_names||"",how_heard_about_us:pe.how_heard_about_us||"",essay:pe.essay||""}),f(pe.current_step||1),P(pe.status),C(pe.submitted_at),w(pe.document_waivers||[]),S(pe.student_edit_unlocked===!0),E(Me.map(Fe=>Fe.id)),i.invalidateQueries({queryKey:["family-applications",n.id]}),h(pe.application_type==="new_student_existing_family");const ct=Ne===null?await Jy(Re.from("documents").select("id, file_path, file_name, document_type, status, admin_feedback").eq("application_id",e)):null,ut=Ne??((ct==null?void 0:ct.data)||[]);ut&&y(ut.map(Fe=>({id:Fe.id,file_path:Fe.file_path,file_name:Fe.file_name,document_type:Fe.document_type||"",status:Fe.status||"uploaded",admin_feedback:Fe.admin_feedback||void 0})))}catch(me){console.error("Error loading application:",me),et({title:"Error",description:"We could not load your application. Please refresh and try again.",variant:"destructive"}),t("/portal/family",{replace:!0,state:{skipAutoResume:!0}})}finally{l(!1)}}})()},[e,n,t,r==null?void 0:r.applicant_type,a==null?void 0:a.access_token]);const H=async()=>{if(!e||!n)return!1;for(const F of m.students){if(!F.first_name||!F.last_name){console.log("Skipping student without name:",F);continue}const me={application_id:e,user_id:n.id,first_name:F.first_name,last_name:F.last_name,date_of_birth:F.date_of_birth||null,grade:F.grade||null,school:F.school||null,status:F.status||"new",race:F.race||null,gender:F.gender||null,tefa_status:F.tefa_status||null,tefa_waitlist_position:F.tefa_status==="waitlist"&&F.tefa_waitlist_position?parseInt(F.tefa_waitlist_position,10):null};if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(F.id)){const{error:ve}=await Re.from("students").update(me).eq("id",F.id);ve&&console.error("Error updating student:",ve)}else{const{data:ve,error:pe}=await Re.from("students").insert(me).select("id").single();pe?(console.error("Error inserting student:",pe),et({title:"Error saving student",description:`Could not save ${F.first_name} ${F.last_name}. ${pe.message}`,variant:"destructive"})):ve&&(F.id=ve.id,console.log("Student saved with ID:",ve.id))}}const ie=new Set(m.students.filter(F=>F.id.includes("-")&&F.id.length>20).map(F=>F.id));if(ie.size>0){const{data:F}=await Re.from("students").select("id").eq("application_id",e),me=(F||[]).filter(Ae=>!ie.has(Ae.id)).map(Ae=>Ae.id);for(const Ae of me)await Re.from("students").delete().eq("id",Ae).eq("application_id",e)}return!0},$=async()=>{if(!e||!n)return;u(!0);const ie=await H();u(!1),ie?(g(F=>({...F,students:F.students.map(me=>({...me}))})),i.invalidateQueries({queryKey:["family-applications",n.id]}),et({title:"Students saved",description:"Your student information has been updated. You may upload any required documents for the new student(s) below."})):et({title:"Error",description:"Failed to save student information. Please try again.",variant:"destructive"})},W=async(ie=!0)=>{if(!e||!n)return!1;u(!0);const F=m.students[0],me={address:m.address,address_line_2:m.address_line_2||null,city:m.city,state:m.state,zip_code:m.zip_code,marital_status:m.marital_status||null,student_first_name:(F==null?void 0:F.first_name)||null,student_last_name:(F==null?void 0:F.last_name)||null,student_date_of_birth:(F==null?void 0:F.date_of_birth)||null,student_grade:(F==null?void 0:F.grade)||null,student_school:(F==null?void 0:F.school)||null,student_status:(F==null?void 0:F.status)||"new",household_size:m.household_size||null,household_income:m.household_income||null,receives_assistance:m.receives_assistance,monthly_rent_payment:ph(m.monthly_rent_payment)||null,monthly_car_payment:ph(m.monthly_car_payment)||null,receives_social_security:m.receives_social_security,social_security_amount:ph(m.social_security_amount)||null,ex_spouse_support_amount:ph(m.ex_spouse_support_amount)||null,has_other_income:m.has_other_income,other_income_description:m.other_income_description||null,has_star_family_member:m.has_star_family_member,star_family_member_names:m.star_family_member_names||null,how_heard_about_us:m.how_heard_about_us||null,essay:m.essay||null,dependents:m.dependents||[],current_step:d},{error:Ae}=await Re.from("applications").update(me).eq("id",e);if(Ae)return u(!1),et({title:"Error",description:"Failed to save progress. Please try again.",variant:"destructive"}),!1;if(!await H())return!1;const Ne=m.students.some(Ee=>Ee.status==="new"),ve=U||Ne;await Re.from("applications").update({interview_required:ve}).eq("id",e);for(const Ee of m.guardians){if(!Ee.first_name||!Ee.relationship
906)continue;const Ie={application_id:e,user_id:n.id,is_primary:Ee.is_primary,first_name:Ee.first_name,last_name:Ee.last_name,email:Ee.email||null,phone:Ee.phone||null,relationship:Ee.relationship||null,employment_status:Ee.employment_status||null,employer_name:Ee.employer_name||null,job_title:Ee.job_title||null,annual_salary:Ee.annual_salary?parseFloat(ph(Ee.annual_salary)):null};if(Ee.id)await Re.from("guardians").update(Ie).eq("id",Ee.id);else{const{data:Me}=await Re.from("guardians").insert(Ie).select("id").single();Me&&(Ee.id=Me.id)}}const pe=m.guardians.find(Ee=>Ee.is_primary);pe!=null&&pe.first_name&&(pe!=null&&pe.last_name)&&await Re.from("applications").update({parent_first_name:pe.first_name,parent_last_name:pe.last_name,email:pe.email||null}).eq("id",e);const Pe=new Set(m.guardians.filter(Ee=>Ee.id).map(Ee=>Ee.id));if(Pe.size>0){const{data:Ee}=await Re.from("guardians").select("id").eq("application_id",e),Ie=(Ee||[]).filter(Me=>!Pe.has(Me.id)).map(Me=>Me.id);for(const Me of Ie)await Re.from("guardians").delete().eq("id",Me).eq("application_id",e)}return u(!1),ie&&et({title:"Saved",description:"Your progress has been saved."}),!0},ee=async()=>{const ie=B[d-1];if(!(ie!=null&&ie.isComplete)){D(!0),et({title:"Missing Required Fields",description:"Please complete all required fields before proceeding.",variant:"destructive"});return}D(!1),await W(!1)&&d<5&&f(d+1)},V=()=>{d>1&&(D(!1),f(d-1))},O=ie=>{D(!1),f(ie)},M=x.useMemo(()=>hI(v,m,U,p,b).missing,[v,m,U,p,b]),B=x.useMemo(()=>Sqe(m,v,U,Z,p,b),[m,v,U,Z,p,b]);x.useEffect(()=>{var ie;I&&((ie=B[d-1])!=null&&ie.isComplete)&&D(!1)},[B,d,I]);const G=async()=>{const ie=B[1];if(ie&&!ie.isComplete){f(2),D(!0),et({title:"Cannot Submit Application",description:`Missing student information: ${ie.missing.slice(0,3).join(", ")}${ie.missing.length>3?` and ${ie.missing.length-3} more`:""}`,variant:"destructive"});return}if(M.length>0){et({title:"Cannot Submit Application",description:`Missing required documents: ${M.slice(0,3).join(", ")}${M.length>3?` and ${M.length-3} more`:""}`,variant:"destructive"});return}if(!await W(!1)){console.error("Failed to save progress before submission"),et({title:"Error",description:"Failed to save application progress. Please try again.",variant:"destructive"});return}if(!e){console.error("No application ID available");return}console.log("Attempting to submit application:",e);const{data:me,error:Ae}=await Re.functions.invoke("submit-application",{body:{applicationId:e}});if(Ae||me!=null&&me.error){console.error("Submit application error:",Ae||(me==null?void 0:me.error));const Ne=Array.isArray(me==null?void 0:me.missingItems)&&me.missingItems.length>0?` Missing: ${me.missingItems.slice(0,3).join(", ")}${me.missingItems.length>3?"…":""}`:"";et({title:"Error",description:`Failed to submit application.${Ne}`,variant:"destructive"});return}et({title:"Application Submitted!",description:"Your application has been submitted for review."}),t("/portal/submission-success")},te=x.useCallback(ie=>{g(F=>({...F,...ie}))},[]),ne=x.useRef(null),ce=x.useRef(!1);if(x.useEffect(()=>{if(!o){const ie=setTimeout(()=>{ce.current=!0},1e3);return()=>clearTimeout(ie)}},[o]),x.useEffect(()=>{if(!(!ce.current||k!=="draft"))return ne.current&&clearTimeout(ne.current),ne.current=setTimeout(()=>{W(!1)},5e3),()=>{ne.current&&clearTimeout(ne.current)}},[m,d]),x.useEffect(()=>{if(k!=="draft")return;const ie=()=>{ce.current&&W(!1)};return window.addEventListener("beforeunload",ie),()=>window.removeEventListener("beforeunload",ie)},[m,d,k]),U&&!q)return s.jsx(Bo,{to:"/portal/referral",replace:!0});if(o)return s.jsx(so,{children:s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading application..."})})});const oe=M.length>0,X=ie=>v.some(F=>{var me;return F.document_type===ie||((me=F.document_type)==null?void 0:me.startsWith(`${ie}_page_`))}),se=m.students.filter(ie=>{const F=[`star_form_${ie.id}`,`student_form_${ie.id}`];return ie.status==="new"&&F.push(`principal_referral_${ie.id}`),F.some(me=>
906!b.includes(me)&&!X(me))});if(k!=="draft"&&(j||se.length>0)){const ie=m.students.filter(F=>!A.includes(F.id)||se.some(me=>me.id===F.id));return s.jsx(so,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Ve,{className:"border-blue-500 bg-blue-50 dark:bg-blue-950/20",children:[s.jsx(_t,{children:s.jsxs(jt,{className:"flex items-center gap-2 text-blue-800 dark:text-blue-200",children:[s.jsx(er,{className:"w-5 h-5"}),j?"Add Students to Your Application":"Student Documents Needed"]})}),s.jsx(He,{children:s.jsx("p",{className:"text-blue-700 dark:text-blue-300",children:j?s.jsxs(s.Fragment,{children:["Your application is already submitted and everything you sent us is saved — you do ",s.jsx("strong",{children:"not"})," need to start over or re-upload anything. Just click ",s.jsx("strong",{children:"Add Another Student"})," below, fill in the new child's details, press ",s.jsx("strong",{children:"Save Students"}),", and then upload only that child's forms. Your other children and documents stay exactly as they are."]}):s.jsx(s.Fragment,{children:"Your application remains submitted. Upload only the missing forms shown below; everything else already on file stays unchanged."})})})]}),j&&s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsx(jt,{children:"Student Information"})}),s.jsxs(He,{children:[s.jsx(b9,{formData:m,updateFormData:te,applicationId:e,isReturningFamily:Z,lockedStudentIds:A}),s.jsx("div",{className:"flex justify-end mt-6",children:s.jsxs(we,{onClick:$,disabled:c,children:[s.jsx(z_,{className:"w-4 h-4 mr-2"}),c?"Saving...":"Save Students"]})})]})]}),s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsx(jt,{children:"Documents for New Students"})}),s.jsx(He,{children:ie.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:'Once you add a new student above and press "Save Students", their document uploads will appear here. Nothing already on file needs to be uploaded again.'}):s.jsx(Jk,{applicationId:e??"",documents:v,setDocuments:y,isNewStudentApplication:p,hasSelfEmployedGuardian:!1,selfEmploymentStatementSubmitted:!0,students:m.students,documentWaivers:b,focusStudentIds:ie.map(F=>F.id),hideFamilyDocuments:!0})})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(we,{onClick:()=>t("/portal/family"),children:[s.jsx(fc,{className:"w-4 h-4 mr-2"}),"Back to Dashboard"]})})]})})}if(k!=="draft"&&!oe)return s.jsx(so,{children:s.jsx(_Ze,{formData:m,documents:v,applicationStatus:k,submittedAt:R,isNewFamily:U})});if(k!=="draft"&&oe)return s.jsx(so,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Ve,{className:"border-amber-500 bg-amber-50 dark:bg-amber-950/20",children:[s.jsx(_t,{children:s.jsxs(jt,{className:"flex items-center gap-2 text-amber-800 dark:text-amber-200",children:[s.jsx(er,{className:"w-5 h-5"}),"Application Submitted - Documents Required"]})}),s.jsxs(He,{children:[s.jsx("p",{className:"text-amber-700 dark:text-amber-300 mb-4",children:"Your application has been submitted but is missing the following required documents. Please upload them to complete your application."}),s.jsx("ul",{className:"list-disc ml-5 text-amber-700 dark:text-amber-300 mb-4 space-y-1",children:M.map((ie,F)=>s.jsx("li",{children:ie},F))})]})]}),s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsx(jt,{children:"Upload Missing Documents"})}),s.jsx(He,{children:s.jsx(Jk,{applicationId:e,documents:v,setDocuments:y,isNewStudentApplication:p,hasSelfEmployedGuardian:m.guardians.some(ie=>ie.employment_status==="self_employed"),selfEmploymentStatementSubmitted:m.guardians.some(ie=>{var F;return ie.employment_status==="self_employed"&&((F=ie.selfEmploymentData)==null?void 0:F.isSubmitted)}),students:m.students,documentWaivers:b})})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(we,{onClick:()=>t("/portal/family"),children:[s.jsx(fc,{className:"w-4 h-4 mr-2"}),"Back to Dashboard"]})})]})});const Q=((ye=B[d-1])==null?void 0:ye.missing)||[];return s.jsx(so,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-display font-semibold text-foreground",children:"Sponsorship Application"}),s.jsxs("p",{className:"text-muted-foreground",children:["Step ",d," of 5: ",Qk[d-1].title]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(we,{variant:"outline",onClick:()=>t("/portal/family"),children:[s.jsx(fc,{className:"w-4 h-4 mr-2"}),"Dashboard"]}),s.jsxs(we,{variant:"outline",onClick:()=>
906W(),disabled:c,children:[s.jsx(z_,{className:"w-4 h-4 mr-2"}),c?"Saving...":"Save Progress"]})]})]}),s.jsx(SZe,{steps:Qk,currentStep:d,stepStatuses:B,onStepClick:O}),s.jsxs("div",{className:"flex gap-6",children:[s.jsx(jZe,{steps:Qk,currentStep:d,stepStatuses:B,onStepClick:O}),s.jsxs("div",{className:"flex-1 min-w-0",children:[I&&Q.length>0&&s.jsx(NZe,{missingFields:Q}),s.jsx(Ve,{children:s.jsxs(He,{className:"pt-6",children:[d===1&&s.jsx(hKe,{formData:m,updateFormData:te,applicationId:e}),d===2&&s.jsx(b9,{formData:m,updateFormData:te,applicationId:e,isReturningFamily:Z}),d===3&&s.jsx(uZe,{formData:m,updateFormData:te}),d===4&&s.jsx(Jk,{applicationId:e,documents:v,setDocuments:y,isNewStudentApplication:p,hasSelfEmployedGuardian:m.guardians.some(ie=>ie.employment_status==="self_employed"),selfEmploymentStatementSubmitted:m.guardians.some(ie=>{var F;return ie.employment_status==="self_employed"&&((F=ie.selfEmploymentData)==null?void 0:F.isSubmitted)}),students:m.students,documentWaivers:b}),d===5&&s.jsx(xZe,{formData:m,documents:v,hasSelfEmployedGuardian:m.guardians.some(ie=>ie.employment_status==="self_employed"),selfEmploymentStatementSubmitted:m.guardians.some(ie=>{var F;return ie.employment_status==="self_employed"&&((F=ie.selfEmploymentData)==null?void 0:F.isSubmitted)}),isNewFamily:U,onGoToDocuments:()=>f(4),missingDocuments:M,documentWaivers:b})]})}),s.jsxs("div",{className:"flex justify-between mt-6",children:[s.jsxs(we,{variant:"outline",onClick:V,disabled:d===1,children:[s.jsx(Og,{className:"w-4 h-4 mr-2"}),"Previous"]}),d<5?s.jsxs(we,{onClick:ee,children:["Next",s.jsx(Rg,{className:"w-4 h-4 ml-2"})]}):s.jsx(we,{onClick:G,className:"bg-green-600 hover:bg-green-700",disabled:M.length>0,children:"Submit Application"})]})]})]})]})})},kZe=()=>{const e=di(),{user:t,profile:n}=bi(),[r,a]=x.useState(null),[i,o]=x.useState([]),[l,c]=x.useState(null),[u,d]=x.useState(!0),[f,p]=x.useState(!1),[h,m]=x.useState(!1),g=x.useRef(!1),[v,y]=x.useState(!1),b=(n==null?void 0:n.applicant_type)==="returning";x.useEffect(()=>{(async()=>{if(!t)return;let R=!1;const{data:C,error:I}=await Re.from("applications").select("id, status, interview_required").eq("user_id",t.id).eq("status","submitted").order("submitted_at",{ascending:!1}).limit(1).maybeSingle();if(I)console.error("Error fetching application:",I);else if(C){a(C);const{data:q}=await Re.from("interview_bookings").select("id, slot_id, status, interview_slots(*)").eq("user_id",t.id).eq("application_id",C.id).neq("status","cancelled").order("created_at",{ascending:!1}).limit(1).maybeSingle();q?(R=!0,c(q)):c(null)}const{data:D}=await Re.from("interview_slots").select("*").eq("is_booked",!1).gte("slot_date",bm()).order("slot_date",{ascending:!0}).order("start_time",{ascending:!0}),U=(D||[]).filter(hh);o(U),d(!1),!g.current&&(C!=null&&C.interview_required)&&!R&&U.length>0&&(g.current=!0,m(!0))})();const P=Re.channel("interview-slots-changes").on("postgres_changes",{event:"*",schema:"public",table:"interview_slots"},R=>{if(R.eventType==="UPDATE"){const C=R.new;if(C.is_booked)o(I=>I.filter(D=>D.id!==C.id));else{const I=bm();C.slot_date>=I&&hh(C)&&o(D=>D.some(U=>U.id===C.id)?D:[...D,C].sort((U,q)=>{const Z=U.slot_date.localeCompare(q.slot_date);return Z!==0?Z:U.start_time.localeCompare(q.start_time)}))}}else if(R.eventType==="INSERT"){const C=R.new,I=bm();!C.is_booked&&C.slot_date>=I&&hh(C)&&o(D=>D.some(U=>U.id===C.id)?D:[...D,C].sort((U,q)=>{const Z=U.slot_date.localeCompare(q.slot_date);return Z!==0?Z:U.start_time.localeCompare(q.start_time)}))}else if(R.eventType==="DELETE"){const C=R.old;o(I=>I.filter(D=>D.id!==C.id))}}).subscribe();return()=>{Re.removeChannel(P)}},[t]);const w=k=>{const[P,R]=k.split(":"),C=parseInt(P);return`${C%12||12}:${R} ${C>=12?"PM":"AM"}`},j=k=>Dn(xr(k),"EEEE, MMMM d, yyyy"),S=async k=>{if(!(!t||!r)){p(!0);try{const{data:P,error:R}=await Re.rpc("book_interview_slot",{p_slot_id:k,p_application_id:r.id,p_user_id:t.id});if(R){console.error("Booking error:",R),et({title:"Error",description:"Failed to book interview. Please try again.",variant:"destructive"});return}const C=P;if(!C.success){et({title:"Slot No Longer Available",description:C.error||"This time slot has been booked by another family. Please select a different time.",variant:"destructive"}),o(D=>D.filter(U=>U.id!==k));return}et({title:"Interview Scheduled!",description:"Your interview has been booked successfully."}),m(!1);const{data:I}=await Re.from("interview_bookings").select("id, slot_id, status, interview_slots(*)").eq("user_id",t.id).eq("application_id",r.id).neq("status","cancelled").order("created_at",{ascending:!1}).limit(1).maybeSingle();I&&c(I),o(D=>D.filter(U=>U.id!==k))}finally{p(!1)}}},A=async(k,P,R)=>{if(!(!t||!r)){p(!0);try{const{data:C,error:I}=await Re.rpc("reschedule_interview_slot",{p_booking_id:R,p_old_slot_id:P,p_new_slot_id:k});if(I){console.error("Reschedule error:",I),et({title:"Error",description:"Failed to reschedule interview. Please try again.",variant:"destructive"});return}const D=C;if(!D.success){et({title:"Slot No Longer Available",description:D.error||"This time slot has been booked by another family. Please select a different time.",variant:"destructive"}),o(Z=>Z.filter(H=>H.id!==k));return}et({title:"Interview Rescheduled!",description:"Your interview has been successfully rescheduled to the new time."}),y(!1);const{data:U}=await Re.from("interview_bookings").select("id, slot_id, status, interview_slots(*)").eq("user_id",t.id).eq("application_id",r.id).neq("status","cancelled").order("created_at",{ascending:!1}).limit(1).maybeSingle();
906U&&c(U);const{data:q}=await Re.from("interview_slots").select("*").eq("is_booked",!1).gte("slot_date",bm()).order("slot_date",{ascending:!0}).order("start_time",{ascending:!0});o((q||[]).filter(hh))}finally{p(!1)}}},E=async()=>{if(l){p(!0);try{const{data:k,error:P}=await Re.rpc("cancel_interview_booking",{p_booking_id:l.id});if(P){et({title:"Error",description:"Failed to cancel interview. Please try again.",variant:"destructive"});return}const R=k;if(!R.success){et({title:"Error",description:R.error||"Failed to cancel interview.",variant:"destructive"});return}et({title:"Interview Cancelled",description:"You can now schedule a new interview time."}),c(null);const{data:C}=await Re.from("interview_slots").select("*").eq("is_booked",!1).gte("slot_date",bm()).order("slot_date",{ascending:!0}).order("start_time",{ascending:!0});o((C||[]).filter(hh))}finally{p(!1)}}};return u?s.jsx(so,{children:s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsx(Xt,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):s.jsx(so,{children:s.jsxs("div",{className:"max-w-3xl mx-auto py-8 px-4 space-y-8",children:[s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-green-100 dark:bg-green-900/30",children:s.jsx(doe,{className:"w-10 h-10 text-green-600 dark:text-green-400"})}),s.jsx("h1",{className:"text-3xl font-display font-bold text-foreground",children:"Application Submitted!"}),s.jsx("p",{className:"text-muted-foreground text-lg max-w-md mx-auto",children:"Congratulations! Your application has been successfully submitted and is now under review."})]}),s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(Nt,{className:"w-5 h-5 text-green-600"}),"What Happens Next?"]})}),s.jsxs(He,{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold",children:"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Application Review"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Our team will review your application and documents within 5-7 business days."})]})]}),(r==null?void 0:r.interview_required)&&s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Schedule Your Interview"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select an available time slot below for your family interview. At least one parent/guardian and the student(s) applying must be present."})]})]}),s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold",children:r!=null&&r.interview_required?"3":"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Decision Notification"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"You'll receive an email notification once a decision has been made on your application."})]})]})]})]}),(r==null?void 0:r.interview_required)&&s.jsxs(s.Fragment,{children:[s.jsxs(Ve,{className:"border-primary/20",children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(yi,{className:"w-5 h-5 text-primary"}),"Schedule Your Family Interview"]}),s.jsx(qn,{children:"Select an available time slot for your interview. All family members applying should attend."})]}),s.jsx(He,{children:l?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-6 text-center",children:[s.jsx(Kse,{className:"w-12 h-12 text-green-600 mx-auto mb-3"}),s.jsx("h3",{className:"font-semibold text-lg text-green-800 dark:text-green-200",children:"Interview Scheduled!"}),s.jsx("p",{className:"text-green-700 dark:text-green-300 mt-2",children:l.interview_slots?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"font-medium",children:j(l.interview_slots.slot_date)}),s.jsx("br",{}),w(l.interview_slots.start_time)," - ",w(l.interview_slots.end_time)]}):s.jsx("span",{className:"font-medium",children:"Your interview is scheduled."})}),s.jsx(Je,{className:"mt-3",variant:"outline",children:l.status==="scheduled"?"Confirmed":l.status}),s.jsxs("p",{className:"text-sm text-green-700 dark:text-green-300 mt-3 font-medium",children:[s.jsx(Zr,{className:"w-4 h-4 inline-block mr-1 -mt-0.5"}),"At least one parent/guardian and the student(s) applying must be present for the interview."]})]}),(()=>{const k=GQ(l);return k.allowed?s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsxs(we,{variant:"outline",className:"w-full",onClick:()=>y(!0),disabled:f,children:[s.jsx(yO,{className:"w-4 h-4 mr-2"}),"Reschedule Interview"]}),s.jsxs(we,{variant:"outline",className:"w-full",onClick:E,disabled:f,children:[s.jsx(Pa,{className:"w-4 h-4 mr-2"}),"Cancel Interview"]})]}):s.jsx("div",{className:"p-3 bg-muted rounded-lg",children:s.jsxs("p",{className:"text-sm text-muted-foreground flex items-start gap-2",children:[s.jsx(Fn,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),s.jsx("span",{children:k.message})]})})})()]}):i.length===0?s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(Fn,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),s.jsx("p",{children:"No interview slots are currently available."}),s.jsx("p",{className:"text-sm mt-1",children:"Please check back later or contact us for assistance."})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Click the button below to open the calendar and select your preferred interview time."}),s.jsxs(we,{onClick:()=>m(!0),className:"w-full",size:"lg",children:[s.jsx(yi,{className:"w-4 h-4 mr-2"}),"Open Interview Calendar"]})]})})]}),s.jsx(_j,{open:h,onOpenChange:m,availableSlots:i,onBookSlot:S,isBooking:f}),s.jsx(_j,{open:v,onOpenChange:y,availableSlots:i,onBookSlot:S,isBooking:f,isResc
906heduling:!0,existingBooking:l,onReschedule:A})]}),b&&s.jsx(Ve,{className:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",children:s.jsx(He,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Zr,{className:"w-8 h-8 text-blue-600"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-blue-800 dark:text-blue-200",children:"Returning Family - No Interview Required"}),s.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:"As a returning family, you are not required to schedule an interview."})]})]})})}),s.jsx("div",{className:"text-center pt-4",children:s.jsxs(we,{onClick:()=>e("/portal/family"),variant:"outline",size:"lg",children:["Return to Dashboard",s.jsx(Rg,{className:"w-4 h-4 ml-2"})]})})]})})};var gne="AlertDialog",[EZe,dQe]=ui(gne,[GZ]),Lu=GZ(),vne=e=>{const{__scopeAlertDialog:t,...n}=e,r=Lu(t);return s.jsx(xR,{...r,...n,modal:!0})};vne.displayName=gne;var CZe="AlertDialogTrigger",yne=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Lu(n);return s.jsx(E$e,{...a,...r,ref:t})});yne.displayName=CZe;var PZe="AlertDialogPortal",xne=e=>{const{__scopeAlertDialog:t,...n}=e,r=Lu(t);return s.jsx(bR,{...r,...n})};xne.displayName=PZe;var TZe="AlertDialogOverlay",bne=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Lu(n);return s.jsx(_N,{...a,...r,ref:t})});bne.displayName=TZe;var fg="AlertDialogContent",[OZe,RZe]=EZe(fg),IZe=dW("AlertDialogContent"),wne=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=Lu(n),o=x.useRef(null),l=sn(t,o),c=x.useRef(null);return s.jsx(S$e,{contentName:fg,titleName:_ne,docsSlug:"alert-dialog",children:s.jsx(OZe,{scope:n,cancelRef:c,children:s.jsxs(jN,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:ht(a.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[s.jsx(IZe,{children:r}),s.jsx(MZe,{contentRef:o})]})})})});wne.displayName=fg;var _ne="AlertDialogTitle",jne=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Lu(n);return s.jsx(wR,{...a,...r,ref:t})});jne.displayName=_ne;var Sne="AlertDialogDescription",Nne=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Lu(n);return s.jsx(_R,{...a,...r,ref:t})});Nne.displayName=Sne;var LZe="AlertDialogAction",Ane=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Lu(n);return s.jsx(jR,{...a,...r,ref:t})});Ane.displayName=LZe;var kne="AlertDialogCancel",Ene=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=RZe(kne,n),i=Lu(n),o=sn(t,a);return s.jsx(jR,{...i,...r,ref:o})});Ene.displayName=kne;var MZe=({contentRef:e})=>{const t=`\`${fg}\` requires a description for the component to be accessible for screen reader users.
907
908You can add a description to the \`${fg}\` by passing a \`${Sne}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
909
910Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${fg}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
911
912For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},$Ze=vne,DZe=yne,FZe=xne,Cne=bne,Pne=wne,Tne=Ane,One=Ene,Rne=jne,Ine=Nne;const fT=$Ze,N9=DZe,BZe=FZe,Lne=x.forwardRef(({className:e,...t},n)=>s.jsx(Cne,{className:Ye("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",e),...t,ref:n}));Lne.displayName=Cne.displayName;const Ij=x.forwardRef(({className:e,...t},n)=>s.jsxs(BZe,{children:[s.jsx(Lne,{}),s.jsx(Pne,{ref:n,className:Ye("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:rou
912nded-lg",e),...t})]}));Ij.displayName=Pne.displayName;const Lj=({className:e,...t})=>s.jsx("div",{className:Ye("flex flex-col space-y-2 text-center sm:text-left",e),...t});Lj.displayName="AlertDialogHeader";const Mj=({className:e,...t})=>s.jsx("div",{className:Ye("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Mj.displayName="AlertDialogFooter";const $j=x.forwardRef(({className:e,...t},n)=>s.jsx(Rne,{ref:n,className:Ye("text-lg font-semibold",e),...t}));$j.displayName=Rne.displayName;const Dj=x.forwardRef(({className:e,...t},n)=>s.jsx(Ine,{ref:n,className:Ye("text-sm text-muted-foreground",e),...t}));Dj.displayName=Ine.displayName;const Fj=x.forwardRef(({className:e,...t},n)=>s.jsx(Tne,{ref:n,className:Ye(hx(),e),...t}));Fj.displayName=Tne.displayName;const Bj=x.forwardRef(({className:e,...t},n)=>s.jsx(One,{ref:n,className:Ye(hx({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Bj.displayName=One.displayName;const UZe=()=>{const{user:e}=bi();rJ();const[t,n]=x.useState([]),[r,a]=x.useState(!0),[i,o]=x.useState(null),[l,c]=x.useState(null);x.useEffect(()=>
912{e&&u()},[e]);const u=async()=>{if(!e)return;a(!0);const{data:p,error:h}=await Re.from("trusted_devices").select("*").eq("user_id",e.id).eq("is_active",!0).order("last_used_at",{ascending:!1});h?(console.error("Error fetching devices:",h),et({title:"Error",description:"Failed to load trusted devices",variant:"destructive"})):n(p||[]),a(!1)},d=async()=>{if(!e||!l)return;o(l.id);const{data:p,error:h}=await Re.functions.invoke("device-auth",{body:{action:"revoke-device",userId:e.id,deviceId:l.id}});o(null),c(null),h||!(p!=null&&p.success)?et({title:"Error",description:"Failed to revoke device. Please try again.",variant:"destructive"}):(et({title:"Device Revoked",description:"The device has been removed from your trusted devices."}),u())},f=p=>{if(!p)return cA;const h=p.toLowerCase();return h.includes("iphone")||h.includes("android")?W_:h.includes("ipad")||h.includes("tablet")?hoe:cA};return r?s.jsx(so,{children:s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Xt,{className:"w-6 h-6 animate-spin text-muted-foreground"})})}):s.jsxs(so,{children:[s.jsxs("div",{className:"max-w-3xl mx-auto p-6 space-y-6",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-3xl font-display font-semibold text-foreground flex items-center gap-3",children:[s.jsx(Cd,{className:"w-8 h-8"}),"Trusted Devices"]}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Manage the devices that can access your account without additional verification."})]}),s.jsx(Ve,{className:"bg-blue-50 border-blue-200",children:s.jsx(He,{className:"py-4",children:s.jsx("p",{className:"text-sm text-blue-800",children:"When you sign in from a new device, we'll send you a verification code via email. Once verified, the device will be added to this list and won't require verification again."})})}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsx(jt,{children:"Your Devices"}),s.jsxs(qn,{children:[t.length," device",t.length!==1?"s":""," trusted"]})]}),s.jsx(He,{children:t.length===0?s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(cA,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),s.jsx("p",{children:"No trusted devices found."})]}):s.jsx("div",{className:"space-y-4",children:t.map(p=>{const h=f(p.device_name),m=p.is_current;return s.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg border ${m?"border-primary bg-primary/5":"bg-muted/50"}`,children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:`p-3 rounded-full ${m?"bg-primary/10":"bg-muted"}`,children:s.jsx(h,{className:`w-5 h-5 ${m?"text-primary":"text-muted-foreground"}`})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("p",{className:"font-medium",children:p.device_name||"Unknown Device"}),m&&s.jsxs(Je,{variant:"outline",className:"text-xs border-primary text-primary",children:[s.jsx(Nt,{className:"w-3 h-3 mr-1"}),"Current"]})]}),s.jsxs("div",{className:"text-sm text-muted-foreground space-y-0.5",children:[s.jsxs("p",{children:["Last used: ",Dn(new Date(p.last_used_at),"MMM d, yyyy 'at' h:mm a")]}),s.jsxs("p",{children:["Added: ",Dn(new Date(p.created_at),"MMM d, yyyy")]})]})]})]}),s.jsx(we,{variant:"ghost",size:"sm",onClick:()=>c(p),disabled:i===p.id,className:"text-destructive hover:text-destructive hover:bg-destructive/10",children:i===p.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsx(Al,{className:"w-4 h-4"})})]},p.id)})})})]}),s.jsx(Ve,{children:s.jsxs(He,{className:"py-4",children:[s.jsx("h4",{className:"font-medium mb-2",children:"Security Tips"}),s.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1",children:[s.jsx("li",{children:"• Remove devices you no longer use or don't recognize"}),s.jsx("li",{children:"• If you suspect unauthorized access, revoke all devices and change your password"}),s.jsx("li",{children:"• Only verify devices on trusted networks"})]})]})})]}),s.jsx(fT,{open:!!l,onOpenChange:()=>c(null),children:s.jsxs(Ij,{children:[s.jsxs(Lj,{children:[s.jsx($j,{children:"Revoke Device Access?"}),s.jsxs(Dj,{children:['Are you sure you want to revoke access for "',(l==null?void 0:l.device_name)||"Unknown Device",`"? You'll need to verify again when signing in from this device.`]})]}),s.jsxs(Mj,{children:[s.jsx(Bj,{children:"Cancel"}),s.jsx(Fj,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Revoke Access"})]})]})})]})},zZe=({userId:e,phone:t,onVerified:n,onSkip:r})=>{const[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(!1),[d,f]=x.use
912State(!1),[p,h]=x.useState(0),[m,g]=x.useState(!1);x.useEffect(()=>{m||v()},[]),x.useEffect(()=>{if(p>0){const w=setTimeout(()=>h(p-1),1e3);return()=>clearTimeout(w)}},[p]);const v=async()=>{f(!0),l("");try{const{data:w,error:j}=await Re.functions.invoke("account-verification",{body:{action:"send-phone-code",userId:e,phone:t}});j||!(w!=null&&w.success)?l((w==null?void 0:w.error)||(j==null?void 0:j.message)||"Failed to send verification code"):(g(!0),h(60))}catch(w){console.error("Error sending verification code:",w),l("Failed to send verification code. Please try again.")}finally{f(!1)}},y=async()=>{if(a.length!==6){l("Please enter the complete 6-digit code");return}u(!0),l("");try{const{data:w,error:j}=await Re.functions.invoke("account-verification",{body:{action:"verify-phone",userId:e,code:a}});j||!(w!=null&&w.success)?(l((w==null?void 0:w.error)||(j==null?void 0:j.message)||"Verification failed"),i("")):n()}catch(w){console.error("Error verifying code:",w),l("Verification failed. Please try again."),i("")}finally{u(!1)}},b=w=>{const j=w.replace(/\D/g,"");return j.length>=4?`***-***-${j.slice(-4)}`:"***-***-****"};return s.jsxs(Ve,{className:"w-full max-w-md mx-auto",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"mx-auto mb-4 h-12 w-12 rounded-full bg-green-100 flex items-center justify-center",children:s.jsx(W_,{className:"h-6 w-6 text-green-600"})}),s.jsx(jt,{children:"Verify Your Phone Number"}),s.jsxs(qn,{children:["We sent a verification code to"," ",s.jsx("span",{className:"font-medium text-foreground",children:b(t)})]})]}),s.jsxs(He,{className:"space-y-6",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(kN,{maxLength:6,value:a,onChange:w=>{i(w),l("")},disabled:c,children:s.jsxs(EN,{children:[s.jsx(si,{index:0}),s.jsx(si,{index:1}),s.jsx(si,{index:2}),s.jsx(si,{index:3}),s.jsx(si,{index:4}),s.jsx(si,{index:5})]})})}),o&&s.jsxs(Nu,{variant:"destructive",children:[s.jsx(er,{className:"h-4 w-4"}),s.jsx(Au,{children:o})]}),s.jsx(we,{onClick:y,disabled:a.length!==6||c,className:"w-full",children:c?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"mr-2 h-4 w-4 animate-spin"}),"Verifying..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"mr-2 h-4 w-4"}),"Verify Phone"]})}),s.jsx("div",{className:"text-center",children:s.jsx(we,{variant:"ghost",onClick:v,disabled:d||p>0,className:"text-sm",children:d?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):p>0?`Resend code in ${p}s`:"Resend verification code"})}),s.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"The verification code will expire in 10 minutes."}),s.jsxs("div",{className:"pt-4 border-t",children:[s.jsx(we,{variant:"outline",onClick:r,className:"w-full",children:"Skip phone verification"}),s.jsx("p",{className:"text-xs text-center text-muted-foreground mt-2",children:"You can verify your phone number later in your account settings."})]})]})]})},WZe=()=>{const e=di(),{user:t,loading:n}=bi(),[r,a]=x.useState(null),[i,o]=x.useState(!0);x.useEffect(()=>{if(!n&&!t){e("/portal/auth",{replace:!0});return}t&&l()},[t,n]);const l=async()=>{if(t)try{const{data:d}=await Re.from("profiles").select("phone_verified, phone").eq("user_id",t.id).single(),{data:f}=await Re.from("sms_consent").select("opted_in, phone_number").eq("user_id",t.id).eq("opted_in",!0).maybeSingle(),p={phoneVerified:(d==null?void 0:d.phone_verified)??!1,smsOptedIn:!!(f!=null&&f.opted_in),smsPhone:(f==null?void 0:f.phone_number)||(d==null?void 0:d.phone)||null};if(a(p),!p.smsOptedIn||p.phoneVerified){e("/portal",{replace:!0});return}}catch(d){console.error("Error checking verification status:",d),e("/portal",{replace:!0})}finally{o(!1)}},c=()=>{e("/portal",{replace:!0})},u=()=>{e("/portal",{replace:!0})};return n||i?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted",children:s.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})}):t?r!=null&&r.smsPhone?s.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-muted p-4",children:[s.jsx("div",{className:"mb-8",children:s.jsx("img",{src:Fs,alt:"STAR Logo",className:"h-16 w-auto"})}),s.jsx(zZe,{userId:t.id,phone:r.smsPhone,onVerified:c,onSkip:u}),s.jsx("div",{className:"flex items-center gap-2 mt-8",children:s.jsx("div",{className:"h-2 w-2 rounded-full bg-primary"})})]}):(e("/portal",{replace:!0}),null):null},qZe=({userId:e,email:t,onVerified:n,onSkip:r})=>{const[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(!1),[d,f]=x.use
912State(!1),[p,h]=x.useState(0),[m,g]=x.useState(!1);x.useEffect(()=>{const w=`email_code_sent_${e}`;if(sessionStorage.getItem(w)){g(!0);return}sessionStorage.setItem(w,"true"),v()},[]),x.useEffect(()=>{if(p>0){const w=setTimeout(()=>h(p-1),1e3);return()=>clearTimeout(w)}},[p]);const v=async()=>{f(!0),l("");try{const{data:w,error:j}=await Re.functions.invoke("account-verification",{body:{action:"send-email-code",userId:e,email:t}});j||!(w!=null&&w.success)?l((w==null?void 0:w.error)||(j==null?void 0:j.message)||"Failed to send verification code"):(g(!0),h(60))}catch(w){console.error("Error sending verification code:",w),l("Failed to send verification code. Please try again.")}finally{f(!1)}},y=async()=>{if(a.length!==6){l("Please enter the complete 6-digit code");return}u(!0),l("");try{const{data:w,error:j}=await Re.functions.invoke("account-verification",{body:{action:"verify-email",userId:e,code:a}});j||!(w!=null&&w.success)?(l((w==null?void 0:w.error)||(j==null?void 0:j.message)||"Verification failed"),i("")):n()}catch(w){console.error("Error verifying code:",w),l("Verification failed. Please try again."),i("")}finally{u(!1)}},b=w=>{const[j,S]=w.split("@");return j.length<=2?`${j[0]}***@${S}`:`${j[0]}${j[1]}***@${S}`};return s.jsxs(Ve,{className:"w-full max-w-md mx-auto",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"mx-auto mb-4 h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx(lu,{className:"h-6 w-6 text-primary"})}),s.jsx(jt,{children:"Verify Your Email"}),s.jsxs(qn,{children:["We sent a verification code to"," ",s.jsx("span",{className:"font-medium text-foreground",children:b(t)})]})]}),s.jsxs(He,{className:"space-y-6",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(kN,{maxLength:6,value:a,onChange:w=>{i(w),l("")},disabled:c,children:s.jsxs(EN,{children:[s.jsx(si,{index:0}),s.jsx(si,{index:1}),s.jsx(si,{index:2}),s.jsx(si,{index:3}),s.jsx(si,{index:4}),s.jsx(si,{index:5})]})})}),o&&s.jsxs(Nu,{variant:"destructive",children:[s.jsx(er,{className:"h-4 w-4"}),s.jsx(Au,{children:o})]}),s.jsx(we,{onClick:y,disabled:a.length!==6||c,className:"w-full",children:c?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"mr-2 h-4 w-4 animate-spin"}),"Verifying..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"mr-2 h-4 w-4"}),"Verify Email"]})}),s.jsx("div",{className:"text-center",children:s.jsx(we,{variant:"ghost",onClick:v,disabled:d||p>0,className:"text-sm",children:d?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):p>0?`Resend code in ${p}s`:"Resend verification code"})}),s.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"The verification code will expire in 10 minutes."}),r&&s.jsx(we,{variant:"outline",onClick:r,className:"w-full",children:"Skip for now"})]})]})},VZe="[email protected]",HZe=()=>{var o;const{user:e,profile:t,refreshProfile:n,loading:r}=bi(),a=di();if(r)return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted",children:s.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})});if(!e)return a("/portal/auth",{replace:!0}),null;if(((o=e.email)==null?void 0:o.toLowerCase())===VZe)return a("/portal/onboarding",{replace:!0}),null;if(t!=null&&t.email_verified)return a("/portal/onboarding",{replace:!0}),null;const i=async()=>{await n(),a("/portal/onboarding",{replace:!0})};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted p-4",children:s.jsxs("div",{className:"w-full max-w-md",children:[s.jsx("div",{className:"flex items-center justify-center mb-6",children:s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program, Inc.",className:"h-14 w-auto"})}),s.jsx(qZe,{userId:e.id,email:e.email||(t==null?void 0:t.email)||"",onVerified:i})]})})},GZe=Pp().trim().email("Please enter a valid email address").max(255),YZe=()=>{const[e]=zO(),t=e.get("mode")==="activation",[n,r]=x.useState(""),[a,i]=x.useState(!1),[o,l]=x.useState(!1),[c,u]=x.useState(""),{toast:d}=_c(),f=async g=>{g.preventDefault(),u("");try{GZe.parse(n)}catch(v){v instanceof mo&&u(v.errors[0].message);return}i(!0);try{if(t)await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/account-verification",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"send-email-code",email:n.toLowerCase()})});else{const v="lqvuodcxdknhkawvunaq";if(!(await(await fetch(`https://${v}.supabase.co/functions/v1/auth-safeguards`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"check-reset-rate",email:n.toLowerCase()})})).json()).allowed){d({title:"Too many requests",description:"Please wait before requesting another password reset.",variant:"destructive"}),i(!1);return}await Re.auth.resetPasswordForEmail(n.toLowerCase(),{redirectTo:`${window.location.origin}/portal/reset-password`}),await fetch(`https://${v}.supabase.co/functions/v1/auth-safeguards`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"log-reset-request",email:n.toLowerCase()})})}l(!0)}catch{l(!0)}i(!1)},p=t?"If an account exists with this email, a verification email will be sent shortly.":"If an account exists with this email, you will receive a password reset link shortly.",h=t?"Resend Activation Email":"Forgot Password",m=t?"Enter the email address you used to create your account":"Enter the email address associated with your account";return s.jsxs("div",{className:"min-h-screen flex flex-col bg-muted p-4",children:[s.jsx("div",{className:"w-full max-w-md mx-auto mb-4",children:s.jsx(an,{to:"/",children:s.jsxs(we,{variant:"ghost",size:"sm",className:"gap-2",children:[s.jsx(fc,{className:"w-4 h-4"}),"Back to Home"]})})}),s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs(Ve,{className:"w-full max-w-md",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program",className:"h-16 w-auto"})}),s.jsx(jt,{className:"text-2xl font-display",children:h}
912),s.jsx(qn,{children:m})]}),s.jsx(He,{children:o?s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(Nt,{className:"h-12 w-12 text-primary"})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:p}),!t&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"The reset link will expire after 60 minutes. If you did not request this, you may safely ignore the email."}),s.jsx(an,{to:"/portal/auth",children:s.jsxs(we,{variant:"outline",className:"w-full mt-4 gap-2",children:[s.jsx(Og,{className:"w-4 h-4"}),"Back to Sign In"]})})]}):s.jsxs("form",{onSubmit:f,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"reset-email",children:"Email Address"}),s.jsxs("div",{className:"relative",children:[s.jsx(lu,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),s.jsx(xt,{id:"reset-email",type:"email",placeholder:"[email protected]",value:n,onChange:g=>r(g.target.value),className:"pl-10",maxLength:255,autoFocus:!0})]}),c&&s.jsx("p",{className:"text-sm text-destructive",children:c})]}),s.jsx(we,{type:"submit",className:"w-full",disabled:a,children:a?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Sending..."]}):t?"Send Activation Email":"Send Reset Link"}),s.jsx("div",{className:"text-center",children:s.jsx(an,{to:"/portal/auth",className:"text-sm text-muted-foreground hover:text-primary transition-colors",children:"← Back to Sign In"})})]})})]})})]})},KZe=Pp().min(12,"Password must be at least 12 characters").regex(/[A-Z]/,"Must contain at least one uppercase letter").regex(/[a-z]/,"Must contain at least one lowercase letter").regex(/[0-9]/,"Must contain at least one number").regex(/[!@#$%^&*(),.?":{}|<>]/,"Must contain at least one special character"),ZZe=()=>{const[e,t]=x.useState(""),[n,r]=x.useState(""),[a,i]=x.useState(!1),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState(!1),[p,h]=x.useState(null),[m,g]=x.useState({}),v=di(),{toast:y}=_c();x.useEffect(()=>{const w=new URLSearchParams(window.location.hash.substring(1)),j=w.get("type"),S=w.get("access_token"),A=w.get("refresh_token");j==="recovery"&&S?Re.auth.setSession({access_token:S,refresh_token:A||""}).then(({error:E})=>{E?(console.error("Failed to set recovery session:",E),h(!1)):h(!0)}):Re.auth.getSession().then(({data:E})=>{h(!!E.session)})},[]);const b=async w=>{w.preventDefault();const j={};try{KZe.parse(e)}catch(A){A instanceof mo&&(j.password=A.errors[0].message)}if(e!==n&&(j.confirm="Passwords do not match"),g(j),Object.keys(j).length>0)return;u(!0);const{error:S}=await Re.auth.updateUser({password:e});if(S){y({title:"Reset failed",description:S.message,variant:"destructive"}),u(!1);return}await Re.auth.signOut(),f(!0),u(!1),setTimeout(()=>v("/portal/auth"),3e3)};return p===null?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted",children:s.jsx(Xt,{className:"h-8 w-8 animate-spin text-primary"})}):p===!1?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted p-4",children:s.jsxs(Ve,{className:"w-full max-w-md",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program",className:"h-16 w-auto"})}),s.jsx(jt,{className:"text-2xl font-display",children:"Invalid or Expired Link"}),s.jsx(qn,{children:"This password reset link is invalid or has expired. Please request a new one."})]}),s.jsxs(He,{className:"text-center",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(er,{className:"h-12 w-12 text-destructive"})}),s.jsx(we,{onClick:()=>v("/portal/forgot-password"),className:"w-full",children:"Request New Reset Link"})]})]})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted p-4",children:s.jsxs(Ve,{className:"w-full max-w-md",children:[s.jsxs(_t,{className:"text-center",children:[s.jsx("div",{className:"flex items-center justify-center mb-4",children:s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program",className:"h-16 w-auto"})}),s.jsx(jt,{className:"text-2xl font-display",children:"Reset Your Password"}
912),s.jsx(qn,{children:"Enter your new password below"})]}),s.jsx(He,{children:d?s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx(Nt,{className:"h-12 w-12 text-primary"})}),s.jsx("p",{className:"font-medium text-foreground",children:"Your password has been successfully updated."}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Redirecting to sign in..."})]}):s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"new-password",children:"New Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(Mg,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),s.jsx(xt,{id:"new-password",type:a?"text":"password",placeholder:"••••••••",value:e,onChange:w=>t(w.target.value),className:"pl-10 pr-10",autoFocus:!0}),s.jsx("button",{type:"button",onClick:()=>i(!a),className:"absolute right-3 top-3 text-muted-foreground hover:text-foreground",children:a?s.jsx(nx,{className:"h-4 w-4"}):s.jsx($s,{className:"h-4 w-4"})})]}),m.password&&s.jsx("p",{className:"text-sm text-destructive",children:m.password}),s.jsxs("ul",{className:"text-xs text-muted-foreground space-y-0.5 ml-1",children:[s.jsx("li",{children:"• At least 12 characters"}),s.jsx("li",{children:"• Uppercase and lowercase letters"}),s.jsx("li",{children:"• At least one number"}),s.jsx("li",{children:"• At least one special character"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"confirm-new-password",children:"Confirm New Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(Mg,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),s.jsx(xt,{id:"confirm-new-password",type:o?"text":"password",placeholder:"••••••••",value:n,onChange:w=>r(w.target.value),className:"pl-10 pr-10"}),s.jsx("button",{type:"button",onClick:()=>l(!o),className:"absolute right-3 top-3 text-muted-foreground hover:text-foreground",children:o?s.jsx(nx,{className:"h-4 w-4"}):s.jsx($s,{className:"h-4 w-4"})})]}),m.confirm&&s.jsx("p",{className:"text-sm text-destructive",children:m.confirm})]}),s.jsx(we,{type:"submit",className:"w-full",disabled:c,children:c?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Updating password..."]}):"Update Password"})]})})]})})},XZe=()=>{const e=di(),{login:t,admin:n,loading:r}=bo(),[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(!1),[d,f]=x.useState(""),[p,h]=x.useState(!1);if(x.useEffect(()=>{!r&&n&&e("/portal/admin",{replace:!0})},[n,r,e]),r)return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),s.jsx("p",{className:"text-slate-400",children:"Checking authentication..."})]})});const m=async g=>{if(g.preventDefault(),f(""),!a.trim()||!o.trim()){f("Please enter both username and password");return}h(!0);const v=await t(a.trim(),o);h(!1),v.error?f(v.error):e("/portal/admin",{replace:!0})};return s.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 p-4",children:[s.jsx("div",{className:"w-full max-w-md mx-auto mb-4",children:s.jsx(an,{to:"/",children:s.jsxs(we,{variant:"ghost",size:"sm",className:"text-slate-400 hover:text-white hover:bg-slate-700 gap-2",children:[s.jsx(fc,{className:"w-4 h-4"}),"Back to Home"]})})}),s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs("div",{className:"w-full max-w-md",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx(an,{to:"/",className:"inline-block",children:s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program",className:"h-16 w-auto mx-auto mb-4 transition-transform hover:scale-105"})}),s.jsx("h1",{className:"text-2xl font-bold text-white",children:"STAR Sponsorship"}),s.jsx("p",{className:"text-slate-400 mt-1",children:"Administrator Portal"})]}),s.jsxs(Ve,{className:"border-slate-700 bg-slate-800/50 backdrop-blur",children:[s.jsxs(_t,{className:"space-y-1",children:[s.jsx(jt,{className:"text-xl text-white",children:"Admin Login"}
912),s.jsx(qn,{className:"text-slate-400",children:"Enter your credentials to access the admin dashboard"})]}),s.jsxs(He,{children:[s.jsxs("form",{onSubmit:m,className:"space-y-4",children:[d&&s.jsxs(Nu,{variant:"destructive",className:"bg-destructive/10 border-destructive/30",children:[s.jsx(er,{className:"h-4 w-4"}),s.jsx(Au,{children:d})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"username",className:"text-slate-200",children:"Username"}),s.jsxs("div",{className:"relative",children:[s.jsx(ci,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),s.jsx(xt,{id:"username",type:"text",placeholder:"Enter username",value:a,onChange:g=>i(g.target.value),className:"pl-10 bg-slate-900/50 border-slate-600 text-white placeholder:text-slate-500 focus:border-primary",disabled:p,autoComplete:"username"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"password",className:"text-slate-200",children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(Mg,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),s.jsx(xt,{id:"password",type:c?"text":"password",placeholder:"Enter password",value:o,onChange:g=>l(g.target.value),className:"pl-10 pr-10 bg-slate-900/50 border-slate-600 text-white placeholder:text-slate-500 focus:border-primary",disabled:p,autoComplete:"current-password"}),s.jsx("button",{type:"button",onClick:()=>u(!c),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-300",children:c?s.jsx(nx,{className:"h-4 w-4"}):s.jsx($s,{className:"h-4 w-4"})})]})]}),s.jsx(we,{type:"submit",className:"w-full bg-primary hover:bg-primary/90",disabled:p,children:p?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),"Signing in..."]}):"Sign In"})]}),s.jsx("div",{className:"mt-6 pt-4 border-t border-slate-700",children:s.jsx("p",{className:"text-center text-sm text-slate-500",children:"Need help? Contact your system administrator"})})]})]}),s.jsx("p",{className:"text-center text-sm text-slate-500 mt-6",children:"Protected area for authorized personnel only"})]})})]})},gs=({children:e})=>{var R;const{admin:t,logout:n,changePassword:r,mustChangePassword:a}=bo(),i=Ko(),o=di(),{toast:l}=_c(),[c,u]=x.useState(!1),[d,f]=x.useState(!1),[p,h]=x.useState(!1),[m,g]=x.useState(!1),[v,y]=x.useState(""),[b,w]=x.useState(""),[j,S]=x.useState(!1);x.useEffect(()=>{a&&g(!0)},[a]);const A=async()=>{await n(),o("/admin-login")},E=async()=>{if(v.length<12){l({title:"Error",description:"Password must be at least 12 characters",variant:"destructive"});return}if(!/[A-Z]/.test(v)){l({title:"Error",description:"Password must contain at least one uppercase letter",variant:"destructive"});return}if(!/[a-z]/.test(v)){l({title:"Error",description:"Password must contain at least one lowercase letter",variant:"destructive"});return}if(!/[0-9]/.test(v)){l({title:"Error",description:"Password must contain at least one number",variant:"destructive"});return}if(!/[!@#$%^&*(),.?":{}|<>]/.test(v)){l({title:"Error",description:"Password must contain at least one special character",variant:"destructive"});return}if(v!==b){l({title:"Error",description:"Passwords do not match",variant:"destructive"});return}S(!0);const C=await r(v);S(!1),C.error?l({title:"Error",description:C.error,variant:"destructive"}):(l({title:"Success",description:"Password changed successfully"}),h(!1),g(!1),y(""),w(""))},k=[{label:"Overview",path:"/portal/admin",icon:fc},{label:"Families",path:"/portal/admin/families",icon:Zr},{label:"Students",path:"/portal/admin/students",icon:Bh},{label:"Referrals",path:"/portal/admin/referrals",icon:mO},{label:"Applications",path:"/portal/admin/applications",icon:En},{label:"Documents",path:"/portal/admin/documents",icon:pO},{label:"Interviews",path:"/portal/admin/interviews",icon:yi},{label:"Messages",path:"/portal/admin/notifications",icon:ex},{label:"SMS Consent",path:"/portal/admin/sms-consent",icon:vO},{label:"Settings",path:"/portal/admin/settings",icon:Cd}],P=C=>C==="/portal/admin"?i.pathname===C:i.pathname.startsWith(C);return s.jsxs("div",{className:"min-h-screen bg-muted/50 flex w-full",children:[s.jsxs("aside",{className:Ye("hidden lg:flex flex-col bg-slate-900 border-r border-slate-700 sticky top-0 h-screen transition-all duration-300",d?"w-16":"w-64"),children:[s.jsx("div",{className:Ye("flex items-center border-b border-slate-700 h-16 px-4",d?"justify-center":"gap-3"),children:s.jsxs(an,{to:"/portal/admin",className:"flex items-center gap-2 group",children:[s.jsx("img",{src:Fs,alt:"STAR Sponsorship Program, Inc.",className:"h-9 w-auto transition-transform group-hover:scale-105"}),!d&&s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-xs font-semibold text-white leading-none",children:"Admin Portal"}),s.jsx("span",{className:"text-[10px] text-slate-400 leading-none mt-0.5",children:"Management Dashboard"})]})]})}),s.jsx("nav",{className:"flex-1 py-4 px-2 overflow-y-auto",children:s.jsx("div",{className:"space-y-1",children:k.map(C=>{const I=C.icon,D=P(C.path),U=s.jsxs(an,{to:C.path,className:Ye("flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors",D?"bg-primary text-white":"text-slate-300 hover:text-white hover:bg-slate-700/50",d&&"justify-center px-2"),children:[s.jsx(I,{className:"w-5 h-5 flex-shrink-0"}),!d&&s.jsx("span",{children:C.label})]},C.path);
912return d?s.jsxs(xh,{delayDuration:0,children:[s.jsx(bh,{asChild:!0,children:U}),s.jsx(Pd,{side:"right",className:"bg-slate-800 text-white border-slate-700",children:C.label})]},C.path):U})})}),s.jsx("div",{className:Ye("border-t border-slate-700 p-3",d&&"px-2"),children:d?s.jsxs("div",{className:"space-y-1",children:[s.jsxs(xh,{delayDuration:0,children:[s.jsx(bh,{asChild:!0,children:s.jsx(we,{variant:"ghost",size:"sm",onClick:()=>h(!0),className:"w-full justify-center text-slate-300 hover:text-white hover:bg-slate-700/50",children:s.jsx(lA,{className:"w-4 h-4"})})}),s.jsx(Pd,{side:"right",className:"bg-slate-800 text-white border-slate-700",children:"Change Password"})]}),s.jsxs(xh,{delayDuration:0,children:[s.jsx(bh,{asChild:!0,children:s.jsx(we,{variant:"ghost",size:"sm",onClick:A,className:"w-full justify-center text-slate-300 hover:text-white hover:bg-slate-700/50",children:s.jsx(Uh,{className:"w-4 h-4"})})}),s.jsx(Pd,{side:"right",className:"bg-slate-800 text-white border-slate-700",children:"Sign Out"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-3 px-2 py-2 mb-2",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-slate-700 flex items-center justify-center",children:s.jsx(Cd,{className:"w-4 h-4 text-slate-300"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-white truncate",children:(t==null?void 0:t.name)||(t==null?void 0:t.username)}),s.jsx("p",{className:"text-xs text-slate-400",children:"Administrator"})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(we,{variant:"ghost",size:"sm",onClick:()=>h(!0),className:"w-full justify-start gap-2 text-slate-300 hover:text-white hover:bg-slate-700/50",children:[s.jsx(lA,{className:"w-4 h-4"}),"Change Password"]}),s.jsxs(we,{variant:"ghost",size:"sm",onClick:A,className:"w-full justify-start gap-2 text-slate-300 hover:text-white hover:bg-slate-700/50",children:[s.jsx(Uh,{className:"w-4 h-4"}),"Sign Out"]})]})]})}),s.jsx("div",{className:"border-t border-slate-700 p-2",children:s.jsxs(we,{variant:"ghost",size:"sm",onClick:()=>f(!d),className:Ye("w-full text-slate-400 hover:text-white hover:bg-slate-700/50",d?"justify-center":"justify-between"),children:[!d&&s.jsx("span",{className:"text-xs",children:"Collapse"}),d?s.jsx(uoe,{className:"w-4 h-4"}):s.jsx(coe,{className:"w-4 h-4"})]})})]}),s.jsxs("div",{className:"lg:hidden fixed top-0 left-0 right-0 z-50 bg-slate-900 border-b border-slate-700",children:[s.jsxs("div",{className:"flex items-center justify-between h-14 px-4",children:[s.jsxs(an,{to:"/portal/admin",className:"flex items-center gap-2",children:[s.jsx("img",{src:Fs,alt:"STAR",className:"h-8 w-auto"}),s.jsx("span",{className:"text-sm font-semibold text-white",children:"Admin"})]}),s.jsx("button",{className:"p-2 rounded-lg text-slate-300 hover:bg-slate-700 transition-colors",onClick:()=>u(!c),"aria-label":"Toggle menu",children:c?s.jsx(yf,{className:"w-6 h-6"}):s.jsx(gO,{className:"w-6 h-6"})})]}),c&&s.jsx("div",{className:"border-t border-slate-700 bg-slate-800 animate-fade-in max-h-[calc(100vh-3.5rem)] overflow-y-auto",children:s.jsxs("nav",{className:"px-4 py-3",children:[s.jsx("div",{className:"space-y-1",children:k.map(C=>{const I=C.icon,D=P(C.path);return s.jsxs(an,{to:C.path,className:Ye("flex items-center justify-between py-3 px-4 rounded-lg transition-colors",D?"bg-primary text-white":"text-slate-300 hover:bg-slate-700"),onClick:()=>u(!1),children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(I,{className:"w-5 h-5"}),s.jsx("span",{className:"font-medium",children:C.label})]}),s.jsx(Ho,{className:Ye("w-4 h-4",D?"opacity-100":"opacity-40")})]},C.path)})}),s.jsxs("div",{className:"mt-4 pt-4 border-t border-slate-700",children:[s.jsxs("div",{className:"px-4 mb-3",children:[s.jsxs("p",{className:"text-sm font-medium text-white flex items-center gap-1",children:[s.jsx(Cd,{className:"w-3 h-3"}),(t==null?void 0:t.name)||(t==null?void 0:t.username)]}),s.jsx("p",{className:"text-xs text-slate-400",children:"Administrator"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(we,{variant:"outline",size:"sm",onClick:()=>{h(!0),u(!1)},className:"w-full justify-center gap-2 border-slate-600 text-slate-300",children:[s.jsx(lA,{className:"w-4 h-4"}),"Change Password"]}),s.jsxs(we,{variant:"outline",size:"sm",onClick:A,className:"w-full justify-center gap-2 border-slate-600 text-slate-300",children:[s.jsx(Uh,{className:"w-4 h-4"}),"Sign Out"]})]})]})]})})]}),s.jsxs("div",{className:"flex-1 flex flex-col min-h-screen lg:min-h-0",children:[s.jsx("div",{className:"lg:hidden h-14"}),s.jsx("div",{className:"lg:hidden bg-background border-b px-4 py-2",children:s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Admin"}),s.jsx(Ho,{className:"w-3 h-3 text-muted-foreground"}),s.jsx("span",{className:"font-medium text-foreground",children:((R=k.find(C=>P(C.path)))==null?void 0:R.label)||"Dashboard"})]})}),s.jsx("main",{className:"flex-1 px-4 lg:px-8 py-6 lg:py-8 overflow-auto",children:s.jsx("div",{className:"animate-fade-in max-w-7xl mx-auto",children:e})}),s.jsx("footer",{className:"bg-background border-t py-4 mt-auto",children:s.jsx("div",{className:"px-4 lg:px-8",children:s.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["© ",new Date().getFullYear()," STAR Sponsorship Program - Admin Portal"]})})})]}
912),s.jsx(_a,{open:p,onOpenChange:h,children:s.jsxs(ha,{children:[s.jsxs($a,{children:[s.jsx(Da,{children:"Change Password"}),s.jsx(Bs,{children:"Enter a new password for your admin account."})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"new-password",children:"New Password"}),s.jsx(xt,{id:"new-password",type:"password",value:v,onChange:C=>y(C.target.value),placeholder:"Enter new password"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"confirm-password",children:"Confirm Password"}),s.jsx(xt,{id:"confirm-password",type:"password",value:b,onChange:C=>w(C.target.value),placeholder:"Confirm new password"})]})]}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>h(!1),children:"Cancel"}),s.jsx(we,{onClick:E,disabled:j,children:j?"Changing...":"Change Password"})]})]})}),s.jsx(_a,{open:m,onOpenChange:()=>{},children:s.jsxs(ha,{className:"sm:max-w-md",onPointerDownOutside:C=>C.preventDefault(),children:[s.jsxs($a,{children:[s.jsxs(Da,{className:"flex items-center gap-2 text-destructive",children:[s.jsx(Cd,{className:"h-5 w-5"}),"Password Change Required"]}),s.jsx(Bs,{children:"You are using the default administrator password. For security reasons, you must change your password before continuing."})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"p-3 bg-destructive/10 border border-destructive/20 rounded-md text-sm text-destructive",children:[s.jsx("strong",{children:"Security Notice:"})," Your current password is publicly documented and must be changed immediately."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"forced-new-password",children:"New Password"}),s.jsx(xt,{id:"forced-new-password",type:"password",value:v,onChange:C=>y(C.target.value),placeholder:"Enter new password (min 12 characters)"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Must include: 12+ characters, uppercase, lowercase, number, and special character"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"forced-confirm-password",children:"Confirm Password"}),s.jsx(xt,{id:"forced-confirm-password",type:"password",value:b,onChange:C=>w(C.target.value),placeholder:"Confirm new password"})]})]}),s.jsx(Qi,{children:s.jsx(we,{onClick:E,disabled:j,className:"w-full",children:j?"Changing Password...":"Change Password & Continue"})})]})})]})},JZe=e=>{const n=new Date().getTime()-e.getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const a=Math.floor(r/60);if(a<24)return`${a}h ago`;const i=Math.floor(a/24);return i<7?`${i}d ago`:e.toLocaleDateString()},QZe=()=>{const{session:e}=bo(),[t,n]=x.useState({total:0,draft:0,submitted:0,under_review:0,approved:0,rejected:0,pending_review:0}),[r,a]=x.useState({total:0,pending:0,uploaded:0,approved:0,needs_resubmission:0}),[i,o]=x.useState({totalFamilies:0,pendingReview:0,approved:0,denied:0}),[l,c]=x.useState([]),[u,d]=x.useState([]),[f,p]=x.useState(void 0),[h,m]=x.useState(!0),g=A=>`https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/${A}`,v=x.useCallback(async()=>{if(e!=null&&e.access_token)try{const A=await fetch(g("admin-interviews"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.access_token}`}});if(!A.ok)return;const E=await A.json(),k=Os(new Date),P=(E.bookings||[]).filter(R=>{var I;if(R.status==="cancelled"||!((I=R.interview_slots)!=null&&I.slot_date))return!1;const C=xr(R.interview_slots.slot_date);return hu(C,k)||ca(C,k)});
912P.sort((R,C)=>{const I=R.interview_slots.slot_date+"T"+R.interview_slots.start_time,D=C.interview_slots.slot_date+"T"+C.interview_slots.start_time;return I.localeCompare(D)}),d(P)}catch(A){console.error("Error fetching interview data:",A)}},[e]);x.useEffect(()=>{(async()=>{var E,k;if(!(e!=null&&e.access_token)){m(!1);return}try{const[P,R]=await Promise.all([fetch(g("admin-applications"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.access_token}`}}),fetch(g("admin-referrals"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.access_token}`}})]),C=P;if(!C.ok)throw new Error("Failed to fetch applications");const I=await C.json(),{applications:D,students:U,documents:q,profiles:Z}=I;if(D){const H=new Map;U==null||U.forEach(M=>{H.has(M.application_id)||H.set(M.application_id,[]),H.get(M.application_id).push(M)});const $=(U==null?void 0:U.filter(M=>M.decision_status==="accepted").length)||0,W=(U==null?void 0:U.filter(M=>M.decision_status==="denied").length)||0,ee=D.filter(M=>{if(M.status!=="submitted"&&M.status!=="under_review")return!1;const B=H.get(M.id)||[];return B.length===0?!0:B.some(G=>!G.decision_status||G.decision_status==="pending")});n({total:D.length,draft:D.filter(M=>M.status==="draft").length,submitted:D.filter(M=>M.status==="submitted").length,under_review:D.filter(M=>
912M.status==="under_review").length,approved:$,rejected:W,pending_review:ee.length});const V=new Map;Z==null||Z.forEach(M=>V.set(M.user_id,M));const O=[...D].sort((M,B)=>new Date(B.created_at).getTime()-new Date(M.created_at).getTime());c(O.filter(M=>M.status==="draft").slice(0,4).map(M=>({...M,profile:V.get(M.user_id)})))}if(q){const H=q.filter($=>{var W;return(W=$.document_type)==null?void 0:W.startsWith("star_form")});a({total:H.length,pending:0,uploaded:H.filter($=>$.status==="uploaded").length,approved:H.filter($=>$.status==="approved").length,needs_resubmission:H.filter($=>$.status==="needs_resubmission").length})}if(R.ok){const H=await R.json(),$=((E=H.referrals)==null?void 0:E.flatMap(W=>W.documents))||[];o({totalFamilies:((k=H.referrals)==null?void 0:k.length)||0,pendingReview:$.filter(W=>W.status==="pending").length,approved:$.filter(W=>W.status==="approved").length,denied:$.filter(W=>W.status==="rejected").length})}}catch(P){console.error("Error fetching dashboard data:",P)}m(!1)})(),v()},[e,v]),x.useEffect(()=>{const A=Re.channel("dashboard-interviews").on("postgres_changes",{event:"*",schema:"public",table:"interview_bookings"},()=>{v()}).on("postgres_changes",{event:"*",schema:"public",table:"interview_slots"},()=>{v()}).subscribe();return()=>{Re.removeChannel(A)}},[v]);const y=u.filter(A=>A.status==="scheduled"||A.status==="completed").map(A=>xr(A.interview_slots.slot_date)),b=f?u.filter(A=>ca(xr(A.interview_slots.slot_date),f)):u,w=A=>{f&&ca(A,f)?p(void 0):p(A)},j=A=>{var k,P;return(k=A.applications)!=null&&k.is_returning_family?s.jsx(Je,{variant:"secondary",className:"text-xs",children:"Returning Family"}):((P=A.students)==null?void 0:P.some(R=>R.status==="new"))?s.jsx(Je,{variant:"outline",className:"text-xs border-blue-300 text-blue-700",children:"New Student"}):s.jsx(Je,{variant:"outline",className:"text-xs border-purple-300 text-purple-700",children:"New Family"})},S=A=>{switch(A){case"scheduled":return s.jsx(Je,{className:"bg-green-100 text-green-800 text-xs",children:"Scheduled"});case"completed":return s.jsx(Je,{className:"bg-blue-100 text-blue-800 text-xs",children:"Completed"});default:return s.jsx(Je,{variant:"secondary",className:"text-xs",children:A})}};return s.jsx(gs,{children:s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-display font-semibold text-foreground",children:"Admin Dashboard"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Overview of all sponsorship applications and system status."})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(an,{to:"/portal/admin/applications",children:s.jsx(Ve,{className:"cursor-pointer hover:border-primary transition-colors",children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-primary/10",children:s.jsx(En,{className:"w-6 h-6 text-primary"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:t.total}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Applications"})]})]})})}),s.jsx(an,{to:"/portal/admin/applications?status=submitted",children:s.jsx(Ve,{className:"cursor-pointer hover:border-primary transition-colors",children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-yellow-100",children:s.jsx(Fn,{className:"w-6 h-6 text-yellow-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:t.pending_review}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Pending Review"})]})]})})}),s.jsx(an,{to:"/portal/admin/students?filter=accepted",children:s.jsx(Ve,{className:"cursor-pointer hover:border-primary transition-colors",children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-green-100",children:s.jsx(Nt,{className:"w-6 h-6 text-green-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:t.approved}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Students Accepted"})]})]})})}
912),s.jsx(an,{to:"/portal/admin/students?filter=denied",children:s.jsx(Ve,{className:"cursor-pointer hover:border-primary transition-colors",children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-red-100",children:s.jsx(er,{className:"w-6 h-6 text-red-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:t.rejected}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Students Denied"})]})]})})})]}),s.jsxs(Ve,{className:"border-2 border-yellow-200 bg-yellow-50/30",children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(mO,{className:"w-5 h-5 text-yellow-600"}),"Principal Referral Queue",i.pendingReview>0&&s.jsxs("span",{className:"ml-2 px-2 py-1 bg-yellow-500 text-white text-xs font-bold rounded-full",children:[i.pendingReview," Pending"]})]}),s.jsx(qn,{children:"New families cannot start their application until their referral is approved"})]}),s.jsxs(He,{children:[s.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[s.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg text-center",children:[s.jsx("p",{className:"text-2xl font-bold",children:i.totalFamilies}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Families"})]}),s.jsxs("div",{className:"p-4 bg-yellow-50 rounded-lg text-center border border-yellow-200",children:[s.jsx("p",{className:"text-2xl font-bold text-yellow-700",children:i.pendingReview}),s.jsx("p",{className:"text-sm text-yellow-600",children:"Pending Review"})]}),s.jsxs("div",{className:"p-4 bg-green-50 rounded-lg text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-green-700",children:i.approved}),s.jsx("p",{className:"text-sm text-green-600",children:"Approved"})]}),s.jsxs("div",{className:"p-4 bg-red-50 rounded-lg text-center",children:[s.jsx("p",{className:"text-2xl font-bold text-red-700",children:i.denied}),s.jsx("p",{className:"text-sm text-red-600",children:"Denied"})]})]}),s.jsx(an,{to:"/portal/admin/referrals",className:"block mt-4",children:s.jsx(we,{className:"w-full bg-yellow-600 hover:bg-yellow-700",children:"Review Principal Referrals"})})]})]}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(Ig,{className:"w-5 h-5 text-purple-600"}),"Interviews",u.length>0&&s.jsxs("span",{className:"ml-2 px-2 py-1 bg-purple-500 text-white text-xs font-bold rounded-full",children:[u.length," Upcoming"]})]}),s.jsx(qn,{children:"Upcoming interview schedule and calendar overview"})]}),s.jsx(He,{children:s.jsxs("div",{className:"grid gap-6 md:grid-cols-[auto_1fr]",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx($N,{mode:"single",selected:f,onSelect:A=>A&&w(A),modifiers:{hasInterview:y},modifiersClassNames:{hasInterview:"bg-purple-100 text-purple-900 font-bold rounded-full"},className:"rounded-md border"})}),s.jsxs("div",{className:"min-h-[280px] flex flex-col",children:[s.jsx("h4",{className:"text-sm font-semibold text-muted-foreground mb-3",children:f?`Interviews on ${Dn(f,"MMM d, yyyy")}`:"Upcoming Interviews"}),b.length===0?s.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:f?"No interviews on this date":"No upcoming interviews"}):s.jsx("div",{className:"space-y-3 max-h-[300px] overflow-y-auto pr-1",children:b.slice(0,10).map(A=>{var P,R,C;const E=[(P=A.applications)==null?void 0:P.parent_first_name,(R=A.applications)==null?void 0:R.parent_last_name].filter(Boolean).join(" ")||"Unknown Family",k=(C=A.students)==null?void 0:C.map(I=>`${I.first_name} ${I.last_name}`).join(", ");return s.jsxs("div",{className:"p-3 border rounded-lg space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"font-medium text-sm",children:E}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[j(A),S(A.status)]})]}),k&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Students: ",k]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Dn(xr(A.interview_slots.slot_date),"EEE, MMM d, yyyy")," · ",Dn(xr(`2000-01-01T${A.interview_slots.start_time}`),"h:mm a")," – ",Dn(xr(`2000-01-01T${A.interview_slots.end_time}`),"h:mm a")]})]},A.id)})}),s.jsx(an,{to:"/portal/admin/interviews",className:"mt-3",children:s.jsxs(we,{variant:"outline",size:"sm",className:"w-full",children:["View All Interviews ",s.jsx(Rg,{className:"w-4 h-4 ml-1"})]})})]})]})})]}),s.jsx(Ve,{children:s.jsx(He,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-0",children:[s.jsxs("div",{className:"flex items-center gap-2 sm:mr-6",children:[s.jsx(pO,{className:"w-4 h-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm font-semibold",children:"STAR Parent/Guardian Commitment Forms"})]}),s.jsxs("div",{className:"flex items-center gap-0 flex-1 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-3",children:[s.jsx("span",{className:"font-bold",children:r.total}),s.jsx("span",{className:"text-muted-foreground",children:"Total"})]}),s.jsx("div",{className:"w-px h-4 bg-border"}),s.jsxs("div",{className:"flex items-center gap-1.5 px-3",children:[s.jsx("span",{className:"font-bold text-yellow-700",children:r.uploaded}),s.jsx("span",{className:"text-muted-foreground",children:"Pending"})]}),s.jsx("div",{className:"w-px h-4 bg-border"}),s.jsxs("div",{className:"flex items-center gap-1.5 px-3",children:[s.jsx("span",{className:"font-bold text-green-700",children:r.approved}),s.jsx("span",{className:"text-muted-foreground",children:"Approved"})]}),s.jsx("div",{className:"w-px h-4 bg-border"}),s.jsxs("div",{className:"flex items-center gap-1.5 px-3",children:[s.jsx("span",{className:"font-bold text-red-700",children:r.needs_resubmission}),s.jsx("span",{className:"text-muted-foreground",children:"Resubmit"})]})]}),s.jsx(an,{to:"/portal/admin/documents?type=star_form",className:"sm:ml-auto",children:s.jsxs(we,{variant:"link",size:"sm",className:"p-0 h-auto text-sm",children:["Review Forms ",s.jsx(Rg,{className:"w-3 h-3 ml-1"})]})})]})})}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(Fn,{className:"w-5 h-5 text-primary"}),"Recently Started Applications"]}
912),s.jsx(qn,{children:"Families who have begun their application (draft status)"})]}),s.jsx(He,{children:h?s.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"Loading..."}):l.length===0?s.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"No applications started yet"}):s.jsxs("div",{className:"space-y-3",children:[l.map(A=>{var R,C,I;const E=(A.parent_first_name?`${A.parent_first_name} ${A.parent_last_name||""}`.trim():null)||((R=A.profile)==null?void 0:R.full_name)||((C=A.profile)==null?void 0:C.email)||"Unknown Family",k=new Date(A.created_at),P=JZe(k);return s.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:E}),((I=A.profile)==null?void 0:I.email)&&s.jsx("p",{className:"text-xs text-muted-foreground",children:A.profile.email}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Started ",P," — ",k.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})," at ",k.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"})]})]}),s.jsx(jj,{status:"draft",size:"sm"})]},A.id)}),s.jsx(an,{to:"/portal/admin/applications?status=draft",children:s.jsx(we,{variant:"link",className:"w-full",children:"View All Draft Applications →"})})]})})]})]})})},eE={pending:{label:"Pending",variant:"secondary",icon:Fn,bgColor:"bg-yellow-100",textColor:"text-yellow-600"},approved:{label:"Approved",variant:"default",icon:Nt,bgColor:"bg-green-100",textColor:"text-green-600"},rejected:{label:"Rejected",variant:"destructive",icon:Pa,bgColor:"bg-red-100",textColor:"text-red-600"}},eXe=()=>{const{admin:e,session:t}=bo(),{toast:n}=_c(),[r,a]=x.useState([]),[i,o]=x.useState(!0),[l,c]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(null),[h,m]=x.useState(null),[g,v]=x.useState(null),[y,b]=x.useState(new Set),[w,j]=x.useState(!1),S=async(D={})=>{const{silent:U=!1}=D;if(!(t!=null&&t.access_token)){U||(n({title:"Error",description:"Admin session not found. Please log in again.",variant:"destructive"}),o(!1));return}U?c(!0):o(!0);try{const q=await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-referrals",{method:"GET",headers:{Authorization:`Bearer ${t.access_token}`,"Content-Type":"application/json"}}),Z=await q.json();if(!q.ok)throw new Error(Z.error||"Failed to fetch referrals");const H=Z.referrals||[];if(a(H),!w){const $=new Set;H.forEach(W=>{W.documents.some(ee=>ee.status==="pending")&&$.add(W.user_id)}),b($),j(!0)}}catch(q){console.error("Error fetching referrals:",q),U||n({title:"Error",description:"Failed to load referrals. Please try again.",variant:"destructive"})}U?c(!1):o(!1)};x.useEffect(()=>{t&&S();const D=setInterval(()=>{!u&&t&&S({silent:!0})},3e4);return()=>clearInterval(D)},[t]);const A=D=>{b(U=>{const q=new Set(U);return q.has(D)?q.delete(D):q.add(D),q})},E=async(D,U,q=!1)=>{if(t!=null&&t.access_token)try{const Z=await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-referrals",{method:"POST",headers:{Authorization:`Bearer ${t.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({filePath:D.file_path})}),H=await Z.json();if(!Z.ok)throw new Error(H.error||"Failed to load file");q?window.open(H.signedUrl,"_blank","noopener,noreferrer"):(v(H.signedUrl),p(D),m(U))}catch{n({title:"Error",description:"Failed to load file preview.",variant:"destructive"})}},k=async(D,U,q)=>{if(!e||!(t!=null&&t.access_token))return;d(D);const Z=r;a(H=>H.map($=>({...$,documents:$.documents.map(W=>W.id===D?{...W,status:U,admin_feedback:W.admin_feedback,reviewed_at:new Date().toISOString(),reviewed_by:e.id}:W)})));try{const H=await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-referrals",{method:"PATCH",headers:{Authorization:`Bearer ${t.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({documentId:D,status:U,adminFeedback:q,adminId:e.id})}),$=await H.json();if(!H.ok)throw new Error($.error||"Failed to update status");n({title:U==="approved"?"Document Approved":U==="rejected"?"Document Rejected":"Status Upd
912ated",description:`The referral document has been ${U}.`}),S({silent:!0})}catch(H){console.error("Error updating referral:",H),a(Z),n({title:"Error",description:"Failed to update referral status.",variant:"destructive"})}d(null),(f==null?void 0:f.id)===D&&(p(null),m(null),v(null))};r.reduce((D,U)=>D+U.documents.length,0);const P=r.reduce((D,U)=>D+U.documents.filter(q=>q.status==="pending").length,0),R=r.reduce((D,U)=>D+U.documents.filter(q=>q.status==="approved").length,0),C=r.reduce((D,U)=>D+U.documents.filter(q=>q.status==="rejected").length,0),I=D=>{if(D.documents.length===0||D.documents.length<D.expected_student_count)return"pending";const U=D.documents.slice(0,D.expected_student_count).every(Z=>Z.status==="approved"),q=D.documents.some(Z=>Z.status==="rejected");return U?"approved":q?"rejected":"pending"};return s.jsx(gs,{children:s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-display font-semibold text-foreground",children:"Referral Management"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Review and approve referral forms from new families. Each student requires an individual referral."})]}),s.jsxs(we,{variant:"outline",onClick:()=>S({silent:!0}),disabled:i||l,children:[s.jsx(of,{className:`w-4 h-4 mr-2 ${i||l?"animate-spin":""}`}),"Refresh"]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-muted",children:s.jsx(Zr,{className:"w-6 h-6 text-muted-foreground"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:r.length}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Families"})]})]})}),s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-yellow-100",children:s.jsx(Fn,{className:"w-6 h-6 text-yellow-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:P}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Pending Documents"})]})]})}),s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-green-100",children:s.jsx(Nt,{className:"w-6 h-6 text-green-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:R}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Approved"})]})]})}),s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-red-100",children:s.jsx(Pa,{className:"w-6 h-6 text-red-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:C}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Rejected"})]})]})})]}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsx(jt,{children:"Family Referrals"}),s.jsx(qn,{children:"Click on a family to view and manage their student referral documents"})]}),s.jsx(He,{children:i?s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(Xt,{className:"w-8 h-8 animate-spin mx-auto mb-2"}),"Loading referrals..."]}):r.length===0?s.jsxs("div",{className:"text-center py-8",children:[s.jsx(En,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"No referrals submitted yet."})]}):s.jsx("div",{className:"space-y-4",children:r.map(D=>{const U=I(D),q=eE[U],Z=y.has(D.user_id),H=D.documents.length,$=D.documents.filter(W=>W.status==="approved").length;return s.jsx(BN,{open:Z,onOpenChange:()=>A(D.user_id),children:s.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[s.jsx(UN,{asChild:!0,children:s.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer hover:bg-muted/50 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:`p-2 rounded-full ${q.bgColor}`,children:s.jsx(q.icon,{className:`w-5 h-5 ${q.textColor}`})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:D.full_name||D.email}),D.full_name&&s.jsx("p",{className:"text-sm text-muted-foreground",children:D.email}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[H," of ",D.expected_student_count," referrals uploaded • ",$," approved"]})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Je,{variant:q.variant,children:q.label}),Z?s.jsx(DW,{className:"w-5 h-5 text-muted-foreground"}):s.jsx(af,{className:"w-5 h-5 text-muted-foreground"})]})]})}),s.jsx(zN,{children:s.jsxs("div",{className:"border-t bg-muted/20 p-4 space-y-3",children:[D.documents.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No documents uploaded yet"}):D.documents.map(W=>{const ee=W.status,V=eE[ee]||eE.pending,O=V.icon;return s.jsxs("div",{className:"flex items-center justify-between p-3 bg-background rounded-lg border",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(En,{className:"w-5 h-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:W.student_first_name&&W.student_last_name?`${W.student_first_name} ${W.student_last_name} Referral Form`:`${W.student_label} Referral Form`}),s.jsx("p",{className:"text-xs text-muted-foreground",children:W.file_name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Uploaded ",new Date(W.uploaded_at).toLocaleDateString()]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Je,{variant:V.variant,className:"flex items-center gap-1",children:[s.jsx(O,{className:"w-3 h-3"}),V.label]}),s.jsxs(we,{variant:"outline",size:"sm",onClick:()=>E(W,D,!1),children:[s.jsx($s,{className:"w-4 h-4 mr-1"}),"View"]}
912),ee==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(we,{size:"sm",variant:"default",disabled:u===W.id,onClick:()=>k(W.id,"approved"),children:u===W.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"w-4 h-4 mr-1"}),"Approve"]})}),s.jsxs(we,{size:"sm",variant:"destructive",disabled:u===W.id,onClick:()=>k(W.id,"rejected"),children:[s.jsx(Pa,{className:"w-4 h-4 mr-1"}),"Reject"]})]}),ee==="approved"&&s.jsx(we,{size:"sm",variant:"outline",disabled:u===W.id,onClick:()=>k(W.id,"pending"),children:u===W.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(Fn,{className:"w-4 h-4 mr-1"}),"Revert"]})}),ee==="rejected"&&s.jsxs(s.Fragment,{children:[s.jsxs(we,{size:"sm",variant:"outline",disabled:u===W.id,onClick:()=>k(W.id,"pending"),children:[s.jsx(Fn,{className:"w-4 h-4 mr-1"}),"Revert"]}),s.jsxs(we,{size:"sm",variant:"default",disabled:u===W.id,onClick:()=>k(W.id,"approved"),children:[s.jsx(Nt,{className:"w-4 h-4 mr-1"}),"Approve"]})]})]})]},W.id)}),D.documents.length<D.expected_student_count&&s.jsxs("div",{className:"text-sm text-muted-foreground text-center py-2 border border-dashed rounded-lg",children:["Waiting for ",D.expected_student_count-D.documents.length," more referral(s) to be uploaded"]})]})})]})},D.user_id)})})})]}),s.jsx(_a,{open:!!f,onOpenChange:()=>{p(null),m(null),v(null)},children:s.jsxs(ha,{className:"max-w-4xl max-h-[90vh]",children:[s.jsxs($a,{children:[s.jsxs(Da,{children:[f&&(f.student_first_name&&f.student_last_name?`${f.student_first_name} ${f.student_last_name} Referral Form`:`${f.student_label} Referral Form`),h&&` — ${h.full_name||h.email}`]}),s.jsx(Bs,{children:"Review the referral document and approve or reject."})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:g&&s.jsx("iframe",{src:g,className:"w-full h-[60vh] border rounded",title:"Referral Preview"})}),(f==null?void 0:f.status)==="pending"&&s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>{p(null),m(null),v(null)},children:"Cancel"}),s.jsxs(we,{variant:"destructive",disabled:u===(f==null?void 0:f.id),onClick:()=>f&&k(f.id,"rejected"),children:[s.jsx(Pa,{className:"w-4 h-4 mr-2"}),"Reject"]}),s.jsx(we,{disabled:u===(f==null?void 0:f.id),onClick:()=>f&&k(f.id,"approved"),children:u===(f==null?void 0:f.id)?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Approve"]})})]})]})})]})})},hT={current_tax_return:"2025 Tax Documents (Upload all pages)",w2_forms:"2025 – W-2, 1099, or Schedule C",self_employment:"Self-Employment Income Statement","Self-Employment Statement":"Self-Employment Statement (Signed In-App)",star_form:"STAR Parent/Guardian Commitment Form",last_year_tax_return:"2024 Tax Return",teacher_recommendation:"Teacher Recommendation Form",principal_referral:"Principal Referral Form",report_card:"Most Recent Report Card",student_form:"Student Form",supporting:"Supporting Document"},tXe=[{prefix:"teacher_recommendation_",fallback:"Teacher Recommendation",labelFn:e=>`${e}'s Teacher Recommendation`},{prefix:"principal_referral_",fallback:"Principal Referral Form",labelFn:e=>`${e}'s Principal Referral Form`},{prefix:"report_card_",fallback:"Most Recent Report Card",labelFn:e=>`${e}'s Most Recent Report Card`},{prefix:"student_form_",fallback:"Student Form",labelFn:e=>`${e}'s Student Form`}],nXe=(e,t)=>{const n=["current_tax_return","w2_forms","last_year_tax_return"];for(const r of n)if(e.startsWith(`${r}_page_`))return hT[r]||r;for(const{prefix:r,fallback:a,labelFn:i}of tXe)if(e.startsWith(r)){const o=e.replace(r,""),l=t==null?void 0:t.find(c=>c.id===o);return l?i(`${l.first_name} ${l.last_name}`.trim()):a}return hT[e]||e},Lw={pending:{label:"Pending",variant:"secondary",icon:Fn},uploaded:{label:"Uploaded",variant:"outline",icon:fa},approved:{label:"Approved",variant:"default",icon:Nt},needs_resubmission:{label:"Needs Resubmission",variant:"destructive",icon:er}},Mw=[{value:"current_tax_return",label:"2025 Tax Return (Form 1040)",studentSpecific:!1},{value:"w2_forms",label:"2025 – W-2, 1099, or Schedule C",studentSpecific:!1},{value:"last_year_tax_return",label:"2024 Tax Return",studentSpecific:!1},{value:"star_form",label:"STAR Parent/Guardian Commitment Form",studentSpecific:!0}
912,{value:"self_employment",label:"Self-Employment Income Statement",studentSpecific:!1},{value:"teacher_recommendation",label:"Teacher Recommendation Form",studentSpecific:!0},{value:"principal_referral",label:"Principal Referral Form",studentSpecific:!0},{value:"report_card",label:"Most Recent Report Card",studentSpecific:!0},{value:"student_form",label:"Student Form",studentSpecific:!0},{value:"supporting",label:"Supporting Document",studentSpecific:!1}],rXe=()=>{var F,me,Ae,Ne,ve;const{admin:e,session:t}=bo(),[n,r]=x.useState([]),[a,i]=x.useState(!0),[o,l]=x.useState(""),[c,u]=x.useState("all"),[d,f]=x.useState(null),[p,h]=x.useState(null),[m,g]=x.useState(null),[v,y]=x.useState(""),[b,w]=x.useState(!1),[j,S]=x.useState(new Set),[A,E]=x.useState(!1),[k,P]=x.useState(null),[R,C]=x.useState(""),[I,D]=x.useState(""),[U,q]=x.useState(null),[Z,H]=x.useState(!1),$=x.useRef(null);x.useEffect(()=>{t&&W()},[t]);const W=async()=>{if(!(t!=null&&t.access_token)){i(!1);return}try{const pe=await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-documents?action=list",{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxxdnVvZGN4ZGtuaGthd3Z1bmFxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ5NTM5NjQsImV4cCI6MjA4MDUyOTk2NH0.vZw85S-GVfKk-hu5ZcEbtWfpo8KNK0YK2ONEpsZXj2k"}});if(!pe.ok){et({title:"Error",description:"Failed to fetch documents",variant:"destructive"}),i(!1);return}const{documents:Pe,guardians:Ee,students:Ie}=await pe.json();if(!Pe||Pe.length===0){r([]),i(!1);return}const Me=[...new Set(Pe.map(De=>De.application_id))],tt={};for(const De of Me){const Qe=(Ee||[]).filter(It=>It.application_id===De),vt=(Ie||[]).filter(It=>It.application_id===De),ct=Pe.filter(It=>It.application_id===De),ut=Qe.find(It=>It.is_primary)||Qe[0],Fe=ut?`${ut.first_name} ${ut.last_name}`:"Unknown Family";tt[De]={application_id:De,family_name:Fe,students:vt.map(It=>({id:It.id,first_name:It.first_name,last_name:It.last_name,application_id:It.application_id,status:It.status})),guardians:Qe.map(It=>({id:It.id,first_name:It.first_name,last_name:It.last_name,is_primary:It.is_primary,application_id:It.application_id})),documents:ct}}r(Object.values(tt))}catch(pe){console.error("Error fetching documents:",pe),et({title:"Error",description:"Failed to fetch documents",variant:"destructive"})}finally{i(!1)}},ee=async pe=>{if(!(t!=null&&t.access_token))return et({title:"Error",description:"Please log in again",variant:"destructive"}),null;try{const Pe=await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-documents?action=get-signed-url",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxxdnVvZGN4ZGtuaGthd3Z1bmFxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ5NTM5NjQsImV4cCI6MjA4MDUyOTk2NH0.vZw85S-GVfKk-hu5ZcEbtWfpo8KNK0YK2ONEpsZXj2k"},body:JSON.stringify({filePath:pe})});if(!Pe.ok)return et({title:"Error",description:"Failed to access document",variant:"destructive"}),null;const{signedUrl:Ee}=await Pe.json();return Ee}catch{return et({title:"Error",description:"Failed to access document",variant:"destructive"}),null}},V=async(pe,Pe)=>{f(pe),h(Pe);const Ee=await ee(pe.file_path);Ee&&g(Ee)},O=async pe=>{const Pe=await ee(pe.file_path);Pe&&window.open(Pe,"_blank")},M=async pe=>{if(!(!d||!e||!(t!=null&&t.access_token))){w(!0);try{const Pe=await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-documents?action=update-status",{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxxdnVvZGN4ZGtuaGthd3Z1bmFxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ5NTM5NjQsImV4cCI6MjA4MDUyOTk2NH0.vZw85S-GVfKk-hu5ZcEbtWfpo8KNK0YK2ONEpsZXj2k"},body:JSON.stringify({documentId:d.id,status:pe,adminFeedback:pe==="needs_resubmission"?v:null})});if(Pe.ok)et({title:"Status Updated",description:`Document has been marked as ${pe==="approved"?"approved":"needs resubmission"}.`}),r(Ee=>Ee.map(Ie=>({...Ie,documents:Ie.documents.map(Me=>Me.id===d.id?{...Me,status:pe,admin_feedback:pe==="needs_resubmission"?v:null}:Me)}))),f(null),h(null),g(null),y("");else{const Ee=await Pe.json();et({title:"Error",description:Ee.error||"Failed to update document status.",variant:"destructive"})}}catch{et({title:"Error",description:"Failed to update document status.",variant:"destructive"})}finally{w(!1)}}},B=pe=>{P(pe),C(""),D(""),q(null),E(!0)},G=async()=>
912{if(!k||!R||!U||!(t!=null&&t.access_token))return;const pe=Mw.find(De=>De.value===R),Pe=pe==null?void 0:pe.studentSpecific;let Ee=R;Pe&&I&&(Ee=`${R}_${I}`);const Ie=["current_tax_return","w2_forms","last_year_tax_return","self_employment"],Me=["star_form","teacher_recommendation","principal_referral","report_card","student_form"];let tt="general";Ie.includes(R)?tt="financial_documents":Me.includes(R)&&(tt="verification_documents"),H(!0);try{const De=new FormData;De.append("file",U),De.append("applicationId",k.application_id),De.append("documentType",Ee),De.append("documentCategory",tt);const Qe=await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-documents?action=admin-upload",{method:"POST",headers:{Authorization:`Bearer ${t.access_token}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImxxdnVvZGN4ZGtuaGthd3Z1bmFxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ5NTM5NjQsImV4cCI6MjA4MDUyOTk2NH0.vZw85S-GVfKk-hu5ZcEbtWfpo8KNK0YK2ONEpsZXj2k"},body:De});if(Qe.ok){const{document:vt}=await Qe.json();et({title:"Document Uploaded",description:"Document has been uploaded on behalf of the family."}),r(ct=>ct.map(ut=>ut.application_id===k.application_id?{...ut,documents:[vt,...ut.documents]}:ut)),E(!1)}else{const vt=await Qe.json();et({title:"Upload Failed",description:vt.error||"Failed to upload document.",variant:"destructive"})}}catch{et({title:"Error",description:"Failed to upload document.",variant:"destructive"})}finally{H(!1)}},te=pe=>{S(Pe=>{const Ee=new Set(Pe);return Ee.has(pe)?Ee.delete(pe):Ee.add(pe),Ee})},ne=n.flatMap(pe=>pe.documents),ce=n.filter(pe=>{const Pe=o===""||pe.family_name.toLowerCase().includes(o.toLowerCase())||pe.students.some(Ie=>`${Ie.first_name} ${Ie.last_name}`.toLowerCase().includes(o.toLowerCase()))||pe.documents.some(Ie=>Ie.file_name.toLowerCase().includes(o.toLowerCase())),Ee=c==="all"||pe.documents.some(Ie=>Ie.status===c);return Pe&&Ee}),oe={all:ne.length,uploaded:ne.filter(pe=>pe.status==="uploaded").length,approved:ne.filter(pe=>pe.status==="approved").length,needs_resubmission:ne.filter(pe=>pe.status==="needs_resubmission").length},X=(pe,Pe)=>{const Ee={},Ie={teacher_recommendation:{},student_form:{},principal_referral:{},report_card:{}};for(const Me of pe){const tt=Me.document_type||"other";let De=!1;for(const Qe of Object.keys(Ie))if(tt===Qe||tt.startsWith(`${Qe}_`)){let vt=null;if(tt.startsWith(`${Qe}_`)&&(vt=tt.replace(`${Qe}_`,"")),!vt)for(const ut of Pe){const Fe=ut.first_name.toLowerCase(),It=ut.last_name.toLowerCase();if(Me.file_name.toLowerCase().includes(Fe)||Me.file_name.toLowerCase().includes(It)){vt=ut.id;break}}const ct=vt||"unassigned";Ie[Qe][ct]||(Ie[Qe][ct]=[]),Ie[Qe][ct].push(Me),De=!0;break}De||(Ee[tt]||(Ee[tt]=[]),Ee[tt].push(Me))}return{documentGroups:Ee,studentDocGroups:Ie}},se=(pe,Pe)=>{const Ee=Pe.find(Ie=>Ie.id===pe);return Ee?`${Ee.first_name} ${Ee.last_name}`:"Unassigned Student"},Q={teacher_recommendation:"Teacher Recommendation Forms",student_form:"Student Forms",principal_referral:"Principal Referral Forms",report_card:"Report Cards"},ye={teacher_recommendation:"Teacher Recommendation",student_form:"Student Form",principal_referral:"Principal Referral Form",report_card:"Most Recent Report Card"},ie=(pe,Pe)=>{const Ee=Lw[pe.status]||Lw.uploaded,Ie=Ee.icon;return s.jsxs("div",{className:"flex items-center justify-between py-2 px-3 bg-muted/30 rounded-md hover:bg-muted/50 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[s.jsx("span",{className:"text-sm truncate",children:pe.file_name}),s.jsxs(Je,{variant:Ee.variant,className:"flex items-center gap-1 shrink-0",children:[s.jsx(Ie,{className:"w-3 h-3"}),Ee.label]}),pe.uploaded_by_admin&&s.jsxs(Je,{variant:"outline",className:"flex items-center gap-1 shrink-0 text-xs border-blue-300 text-blue-700 bg-blue-50",children:[s.jsx(QE,{className:"w-3 h-3"}),"Admin"]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsx(we,{variant:"ghost",size:"sm",onClick:Me=>{Me.stopPropagation(),O(pe)},children:s.jsx(Lg,{className:"w-4 h-4"})}),s.jsxs(we,{variant:"outline",size:"sm",onClick:Me=>{Me.stopPropagation(),V(pe,Pe)},children:[s.jsx($s,{className:"w-4 h-4 mr-1"}),"Review"]})]})]},pe.id)};return s.jsx(gs,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-display font-semibold text-foreground",children:"Document Review"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Review and approve uploaded documents organized by family application."})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[s.jsx(Ve,{className:`curs
912or-pointer transition-colors ${c==="all"?"border-primary":""}`,onClick:()=>u("all"),children:s.jsxs(He,{className:"flex items-center gap-4 p-4",children:[s.jsx(En,{className:"w-8 h-8 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold",children:oe.all}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Documents"})]})]})}),s.jsx(Ve,{className:`cursor-pointer transition-colors ${c==="uploaded"?"border-primary":""}`,onClick:()=>u("uploaded"),children:s.jsxs(He,{className:"flex items-center gap-4 p-4",children:[s.jsx(fa,{className:"w-8 h-8 text-blue-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold",children:oe.uploaded}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Pending Review"})]})]})}),s.jsx(Ve,{className:`cursor-pointer transition-colors ${c==="approved"?"border-primary":""}`,onClick:()=>u("approved"),children:s.jsxs(He,{className:"flex items-center gap-4 p-4",children:[s.jsx(Nt,{className:"w-8 h-8 text-green-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold",children:oe.approved}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Approved"})]})]})}),s.jsx(Ve,{className:`cursor-pointer transition-colors ${c==="needs_resubmission"?"border-primary":""}`,onClick:()=>u("needs_resubmission"),children:s.jsxs(He,{className:"flex items-center gap-4 p-4",children:[s.jsx(er,{className:"w-8 h-8 text-destructive"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold",children:oe.needs_resubmission}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Needs Resubmission"})]})]})})]}),s.jsxs("div",{className:"relative",children:[s.jsx(lf,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),s.jsx(xt,{placeholder:"Search by family name, student name, or file...",value:o,onChange:pe=>l(pe.target.value),className:"pl-10"})]}),s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(Zr,{className:"w-5 h-5"}),"Family Applications (",ce.length,")"]})}),s.jsx(He,{children:a?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):ce.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No applications with documents found"}):s.jsx("div",{className:"space-y-3",children:ce.map(pe=>{const Pe=j.has(pe.application_id),{documentGroups:Ee,studentDocGroups:Ie}=X(pe.documents,pe.students),Me=pe.documents.filter(De=>De.status==="uploaded").length,tt=pe.students.map(De=>`${De.first_name} ${De.last_name}`).join(", ");return s.jsxs(BN,{open:Pe,onOpenChange:()=>te(pe.application_id),children:[s.jsx(UN,{asChild:!0,children:s.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg hover:bg-muted/50 transition-colors cursor-pointer",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[Pe?s.jsx(af,{className:"w-5 h-5 text-muted-foreground"}):s.jsx(Ho,{className:"w-5 h-5 text-muted-foreground"}),s.jsx("div",{className:"p-2 rounded-full bg-primary/10",children:s.jsx(Zr,{className:"w-5 h-5 text-primary"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold text-foreground",children:pe.family_name}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Students: ",tt||"No students added"]})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(Je,{variant:"outline",children:[pe.documents.length," document",pe.documents.length!==1?"s":""]}),Me>0&&s.jsxs(Je,{variant:"secondary",className:"bg-blue-100 text-blue-700",children:[Me," pending"]})]})]})}),s.jsx(zN,{children:s.jsxs("div",{className:"ml-4 mt-2 border-l-2 border-muted pl-4 space-y-4 pb-2",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(we,{variant:"outline",size:"sm",onClick:()=>B(pe),children:[s.jsx(fa,{className:"w-4 h-4 mr-1"}),"Upload for Family"]})}),Object.entries(Ee).map(([De,Qe])=>s.jsxs("div",{className:"space-y-2",children:[s.jsxs("h4",{className:"font-medium text-sm text-foreground flex items-center gap-2",children:[s.jsx(En,{className:"w-4 h-4"}),hT[De]||De]}),s.jsx("div",{className:"space-y-1 ml-6",children:Qe.map(vt=>ie(vt,pe))})]}
912,De)),Object.entries(Ie).map(([De,Qe])=>Object.keys(Qe).length===0?null:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("h4",{className:"font-medium text-sm text-foreground flex items-center gap-2",children:[s.jsx(En,{className:"w-4 h-4"}),Q[De]||De]}),s.jsx("div",{className:"ml-6 space-y-3",children:Object.entries(Qe).map(([vt,ct])=>{const ut=se(vt,pe.students);return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:"text-xs font-medium text-muted-foreground flex items-center gap-1",children:[s.jsx(ci,{className:"w-3 h-3"}),ut,"'s ",ye[De]||De]}),ct.map(Fe=>ie(Fe,pe))]},vt)})})]},De)),pe.documents.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No documents uploaded yet"})]})})]},pe.application_id)})})})]}),s.jsx(_a,{open:!!d,onOpenChange:()=>{f(null),h(null),g(null),y("")},children:s.jsxs(ha,{className:"max-w-4xl max-h-[90vh] overflow-auto",children:[s.jsx($a,{children:s.jsx(Da,{children:"Document Review"})}),d&&p&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-2 text-sm",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"File:"})," ",d.file_name]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Type:"})," ",nXe(d.document_type||"",p.students)]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Family:"})," ",p.family_name]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Students:"})," ",p.students.map(pe=>`${pe.first_name} ${pe.last_name}`).join(", ")||"None"]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Current Status:"})," ",s.jsx(Je,{variant:((F=Lw[d.status])==null?void 0:F.variant)||"outline",children:((me=Lw[d.status])==null?void 0:me.label)||d.status})]}),d.uploaded_by_admin&&s.jsxs("p",{className:"flex items-center gap-1 text-blue-700",children:[s.jsx(QE,{className:"w-4 h-4"})," Uploaded by administrator"]})]}),m&&s.jsx("div",{className:"border rounded-lg overflow-hidden bg-muted",children:d.file_name.toLowerCase().endsWith(".pdf")?s.jsx("iframe",{src:m,className:"w-full h-[400px]",title:"Document Preview"}):s.jsx("img",{src:m,alt:"Document Preview",className:"max-w-full max-h-[400px] mx-auto"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:"Feedback (required for resubmission request)"}),s.jsx(wc,{value:v,onChange:pe=>y(pe.target.value),placeholder:"Enter feedback for the applicant...",rows:3})]})]}),s.jsxs(Qi,{className:"flex gap-2 sm:gap-2",children:[s.jsx(we,{variant:"outline",onClick:()=>{f(null),h(null),g(null),y("")},children:"Cancel"}),s.jsxs(we,{variant:"destructive",onClick:()=>M("needs_resubmission"),disabled:b||!v,children:[s.jsx(Pa,{className:"w-4 h-4 mr-2"}),"Request Resubmission"]}),s.jsxs(we,{onClick:()=>M("approved"),disabled:b,className:"bg-green-600 hover:bg-green-700",children:[s.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Approve"]})]})]})}),s.jsx(_a,{open:A,onOpenChange:E,children:s.jsxs(ha,{children:[s.jsx($a,{children:s.jsx(Da,{children:"Upload Document for Family"})}),k&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Uploading on behalf of ",s.jsx("strong",{children:k.family_name})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Document Type"}),s.jsxs(gn,{value:R,onValueChange:pe=>{C(pe),D("")},children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select document type"})}),s.jsx(fn,{children:Mw.map(pe=>s.jsx(ot,{value:pe.value,children:pe.label},pe.value))})]})]}),((Ae=Mw.find(pe=>pe.value===R))==null?void 0:Ae.studentSpecific)&&k.students.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Student"}),s.jsxs(gn,{value:I,onValueChange:D,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select student"})}),s.jsx(fn,{children:k.students.map(pe=>s.jsxs(ot,{value:pe.id,children:[pe.first_name," ",pe.last_name]},pe.id))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"File"}),s.jsx(xt,{type:"file",ref:$,accept:".pdf,.jpg,.jpeg,.png,.webp,.heic,.heif,.tiff,.tif,.bmp",onChange:pe=>{var Pe;return q(((Pe=pe.target.files)==null?void 0:Pe[0])||null)}}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"PDF, JPEG, PNG, WebP, HEIC, TIFF, or BMP. Max 50MB."})]})]}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>E(!1),children:"Cancel"}),s.jsx(we,{onClick:G,disabled:Z||!R||!U||((Ne=Mw.find(pe=>pe.value===R))==null?void 0:Ne.studentSpecific)&&!I&&(((ve=k==null?void 0:k.students)==null?void 0:ve.length)??0)>0,children:Z?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Uploading..."]}):s.jsxs(s.Fragment,{children:[s.jsx(fa,{className:"w-4 h-4 mr-2"}),"Upload"]})})]})]})})]})})},su={tefa_recipient:{key:"tefa_recipient",label:"TEFA Recipient",shortLabel:"TEFA",badgeClass:"bg-violet-100 text-violet-800 border-violet-300 hover:bg-violet-100"},over_income:{key:"over_income",label:"Over Income",shortLabel:"Over Income",badgeClass:"bg-amber-100 text-amber-900 border-amber-300 hover:bg-amber-100"}},Mne=Object.keys(su),aXe=e=>typeof e=="string"&&Mne.includes(e),iXe=e=>aXe(e)?su[e]:null,pT=({classification:e,className:t,showIcon:n=!0})=>{const r=iXe(e);return r?s.jsxs(Je,{variant:"outline",className:Ye("flex items-center gap-1 font-medium",r.badgeClass,t),children:[n&&s.jsx(ax,{className:"w-3 h-3"}),r.label]}):null},Qy=[{value:"last_year_tax_return",label:"2024 Tax Return",category:"financial",studentSpecific:!1},{value:"current_tax_return",label:"2025 Tax Return",category:"financial",studentSpecific:!1},{value:"w2_forms",label:"W-2, 1099, or Schedule C",category:"financial",studentSpecific:!1},{value:"self_employment",label:"Statement of Self-Employment",category:"financial",studentSpecific:!1},{value:"star_form",label:"STAR Parent/Guardian Commitment Form",category:"verification",studentSpecific:!0},{value:"teacher_recommendation",label:"Teacher Recommendation",category:"student",studentSpecific:!0},{value:"principal_referral",label:"Principal Referral Form",category:"student",studentSpecific:!0},{value:"report_card",label:"Most Recent Report Card",category:"student",studentSpecific:!0},{value:"student_form",label:"Student Form",category:"student",studentSpecific:!0},{value:"supplemental",label:"Supporting Document",category:"supplemental",studentSpecific:!1}],sXe=".pdf,.jpg,.jpeg,.png,.webp,.heic,.heif,.tiff,.tif,.bmp",A9=50*1024*1024,oXe={draft:{label:"Draft",variant:"outline",icon:En},submitted:{label:"Submitted",variant:"secondary",icon:Fn},under_review:{label:"Under Review",variant:"default",icon:$s},approved:{label:"Approved",variant:"default",icon:Nt},rejected:{label:"Rejected",variant:"destructive",icon:er},waitlisted:{label:"Waitlisted",variant:"secondary",icon:Fn}},lXe=["current_tax_return","w2_forms"],cXe=["current_tax_return","w2_forms"],uXe={current_tax_return:"2025 Tax Documents",w2_forms:"W-2 Forms",self_employment:"Self-Employment Form",star_form:"Parent/Guardian Commitment Form",last_year_tax_return:"2024 Tax Return",teacher_recommendation:"Teacher Recommendation"},dXe=()=>{var ce,oe;const e=di(),{session:t}=bo(),[n]=zO(),[r,a]=x.useState([]),[i,o]=x.useState({}),[l,c]=x.useState(!0),[u,d]=x.useState(""),[f,p]=x.useState(()=>n.get("status")||"all"),[h,m]=x.useState("all"),[g,v]=x.useState(null);x.useState(!1),x.useState("");
912const[y,b]=x.useState({}),[w,j]=x.useState(!1),[S,A]=x.useState(""),[E,k]=x.useState(""),[P,R]=x.useState(null),[C,I]=x.useState(!1),D=x.useRef(null),U=X=>{const[se,Q]=X.split(":").map(Number),ye=se>=12?"PM":"AM";return`${se%12||12}:${Q.toString().padStart(2,"0")} ${ye}`},q=X=>y[X]||null,Z=()=>"https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-applications";x.useEffect(()=>{H()},[t]),x.useEffect(()=>{const X=ye=>{(ye==null?void 0:ye.type)==="student.updated"&&H()};let se=null;"BroadcastChannel"in window&&(se=new BroadcastChannel("admin-students"),se.onmessage=ye=>X(ye.data));const Q=ye=>{if(ye.key==="admin-students"&&ye.newValue)try{X(JSON.parse(ye.newValue))}catch{}};return window.addEventListener("storage",Q),()=>{se&&se.close(),window.removeEventListener("storage",Q)}},[t]),x.useEffect(()=>{const X=Re.channel("students-changes-applications").on("postgres_changes",{event:"*",schema:"public",table:"students"},()=>{t&&H()}).on("postgres_changes",{event:"*",schema:"public",table:"interview_bookings"},()=>{t&&H()}).subscribe();return()=>{Re.removeChannel(X)}},[t]);const H=async()=>{if(!(t!=null&&t.access_token)){c(!1);return}try{const X=await fetch(Z(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`}});if(!X.ok)throw new Error("Failed to fetch applications");const se=await X.json(),{applications:Q,profiles:ye,guardians:ie,students:F,documents:me,bookings:Ae}=se;if(Q&&Q.length>0){const Ne=new Map((ye==null?void 0:ye.map(Me=>[Me.user_id,Me]))||[]),ve=new Map;ie==null||ie.forEach(Me=>{ve.has(Me.application_id)||ve.set(Me.application_id,[]),ve.get(Me.application_id).push(Me)});const pe=new Map;F==null||F.forEach(Me=>{pe.has(Me.application_id)||pe.set(Me.application_id,[]),pe.get(Me.application_id).push(Me)});const Pe=Q.map(Me=>({...Me,profiles:Ne.get(Me.user_id)||null,guardians:ve.get(Me.id)||[],students:pe.get(Me.id)||[]}));a(Pe);const Ee={};me==null||me.forEach(Me=>{Ee[Me.application_id]||(Ee[Me.application_id]=[]),Ee[Me.application_id].push({id:Me.id,document_type:Me.document_type||"",status:Me.status,file_path:Me.file_path||"",file_name:Me.file_name||"",uploaded_by_admin:Me.uploaded_by_admin||null})}),Object.keys(Ee).forEach(Me=>{const tt=Ee[Me];tt.some(Qe=>Qe.document_type.startsWith("teacher_recommendation_")&&Qe.document_type!=="teacher_recommendation")&&(Ee[Me]=tt.filter(Qe=>Qe.document_type!=="teacher_recommendation"))}),o(Ee);const Ie={};(Ae||[]).forEach(Me=>{const tt=Ie[Me.application_id];if(!tt)Ie[Me.application_id]=Me;else{const De=Me.status==="scheduled"||Me.status==="completed",Qe=tt.status==="scheduled"||tt.status==="completed";De&&!Qe&&(Ie[Me.application_id]=Me)}}),b(Ie)}else a([]),o({}),b({})}catch(X){console.error("Error fetching applications:",X)}c(!1)},$=X=>{var Me,tt;const se=[];let Q=0,ye=0;const ie=(Me=X.guardians)==null?void 0:Me.find(De=>De.is_primary),F=(ie==null?void 0:ie.first_name)&&(ie==null?void 0:ie.last_name),me=ie==null?void 0:ie.email,Ae=ie==null?void 0:ie.phone,Ne=[F,me,Ae,X.address,X.city,X.state,X.zip_code];ye+=Ne.length,Ne.forEach((De,Qe)=>{De?Q++:se.push(["Guardian Name","Email","Phone","Address","City","State","Zip"][Qe])}),X.students&&X.students.length>0?Q++:se.push("Students"),ye++;const pe=[X.household_income,X.household_size];ye+=pe.length,pe.forEach((De,Qe)=>{De!=null?Q++:se.push(["Household Income","Household Size"][Qe])});const Pe=i[X.id]||[],Ee=((tt=X.profiles)==null?void 0:tt.applicant_type)==="new"?cXe:lXe;return ye+=Ee.length,Ee.forEach(De=>{let Qe;De==="teacher_recommendation"?Qe=Pe.find(vt=>vt.document_type==="teacher_recommendation"||vt.document_type.startsWith("teacher_recommendation_")):Qe=Pe.find(vt=>vt.document_type===De),Qe?Q++:se.push(uXe[De]||De)}),(X.students||[]).forEach(De=>{ye++,Pe.some(Qe=>Qe.document_type===`star_form_${De.id}`)?Q++:se.push(`${De.first_name} ${De.last_name}'s Parent/Guardian Commitment Form`)}),{percentage:ye>0?Math.round(Q/ye*100):0,missing:se}},W=X=>X.students&&X.students.length>0?X.students.map(se=>`${se.first_name} ${se.last_name}`).join(", "):X.student_first_name?`${X.student_first_name} ${X.student_last_name||""}`:"No students",ee=X=>(X.students||[]).some(se=>se.decision_status==="accepted"),V=X=>{const se=(X.students||[]).filter(Q=>Q.decision_status==="accepted"&&Q.updated_at).map(Q=>new Date(Q.updated_at).getTime());return se.length>0?Math.max(...se):0},O=(X,se)=>{var F,me;const Q=X.admin_classification,ye=Q==="tefa_recipient"||Q==="over_income",ie=ee(X);switch(se){case"all":return!ye&&!ie;case"new":return!ye&&!ie&&((F=X.profiles)==null?void 0:F.applicant_type)==="new";case"returning":return!ye&&!ie&&((me=X.profiles)==null?void 0:me.applicant_type)==="returning";case"approved":return ie;case"waitlisted":return!ie&&X.status==="waitlisted";case"tefa_recipient":case"over_income":return Q===se;default:return!0}},M=X=>r.filter(se=>O(se,X)).length,B=(()=>{const X=r.filter(se=>{var Ee,Ie,Me,tt,De,Qe,vt,ct;
912const Q=(Ee=se.guardians)==null?void 0:Ee.find(ut=>ut.is_primary),ye=Q?`${Q.first_name} ${Q.last_name}`:"",ie=(Q==null?void 0:Q.email)||"",F=W(se).toLowerCase(),me=u===""||((Ie=se.parent_first_name)==null?void 0:Ie.toLowerCase().includes(u.toLowerCase()))||((Me=se.parent_last_name)==null?void 0:Me.toLowerCase().includes(u.toLowerCase()))||ye.toLowerCase().includes(u.toLowerCase())||F.includes(u.toLowerCase())||((tt=se.email)==null?void 0:tt.toLowerCase().includes(u.toLowerCase()))||ie.toLowerCase().includes(u.toLowerCase())||((Qe=(De=se.profiles)==null?void 0:De.full_name)==null?void 0:Qe.toLowerCase().includes(u.toLowerCase()))||((ct=(vt=se.profiles)==null?void 0:vt.email)==null?void 0:ct.toLowerCase().includes(u.toLowerCase())),Ae=se.students||[],Ne=Ae.some(ut=>ut.decision_status==="accepted"),ve=Ae.some(ut=>ut.decision_status==="denied"),pe=Ae.length===0||Ae.some(ut=>!ut.decision_status||ut.decision_status==="pending");let Pe=!1;return f==="all"?Pe=!0:f==="pending_review"?Pe=(se.status==="submitted"||se.status==="under_review")&&pe:f==="approved"?Pe=Ne:f==="rejected"?Pe=ve:Pe=se.status===f,me&&Pe&&O(se,h)});return h==="approved"?[...X].sort((se,Q)=>V(Q)-V(se)):X})(),G=X=>{var Q,ye,ie;const se=(Q=X.guardians)==null?void 0:Q.find(F=>F.is_primary);return se!=null&&se.first_name&&(se!=null&&se.last_name)?`${se.first_name} ${se.last_name}`:X.parent_first_name&&X.parent_last_name?`${X.parent_first_name} ${X.parent_last_name}`:(ye=X.profiles)!=null&&ye.full_name?X.profiles.full_name:(ie=X.profiles)!=null&&ie.email?X.profiles.email:"Unknown Family"},te=X=>{var Q,ye;const se=(Q=X.guardians)==null?void 0:Q.find(ie=>ie.is_primary);return(se==null?void 0:se.email)||X.email||((ye=X.profiles)==null?void 0:ye.email)||"No email"},ne=async()=>{if(!g||!S||!P||!(t!=null&&t.access_token))return;const X=Qy.find(se=>se.value===S);if(X){if(X.studentSpecific&&!E){tn.error("Please select a student for this document type");return}if(P.size>A9){tn.error("File size must be under 10MB");return}I(!0);try{const Q="https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-documents?action=admin-upload";let ye=S;X.studentSpecific&&E&&(ye=`${S}_${E}`),S==="supplemental"&&(ye=`supplemental_${Date.now()}`);const ie=new FormData;ie.append("file",P),ie.append("applicationId",g.id),ie.append("documentType",ye),ie.append("documentCategory",X.category);const F=await fetch(Q,{method:"POST",headers:{Authorization:`Bearer ${t.access_token}`},body:ie});if(!F.ok){const me=await F.json();throw new Error(me.error||"Upload failed")}tn.success("Document uploaded successfully"),j(!1),A(""),k(""),R(null),D.current&&(D.current.value=""),await H()}catch(se){tn.error(se.message||"Failed to upload document"),console.error("Admin upload error:",se)}finally{I(!1)}}};return s.jsx(gs,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-display font-semibold text-foreground",children:"All Applications"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"View and manage all family applications with completion tracking."})]}),(()=>{const X=[{id:"all",label:"All Applications",icon:Zr,badgeClass:""},{id:"new",label:"New Families",icon:ci,badgeClass:"bg-amber-100 text-amber-800"},{id:"returning",label:"Returning Families",icon:Zr,badgeClass:"bg-blue-100 text-blue-800"},{id:"approved",label:"Approved Families",icon:Nt,badgeClass:"bg-green-100 text-green-800"},{id:"waitlisted",label:"Waitlisted",icon:Fn,badgeClass:"bg-orange-100 text-orange-800"},{id:"tefa_recipient",label:`${su.tefa_recipient.label}s`,icon:ax,badgeClass:su.tefa_recipient.badgeClass},{id:"over_income",label:su.over_income.label,icon:ax,badgeClass:su.over_income.badgeClass}];return s.jsx("div",{className:"flex flex-wrap gap-2",children:X.map(se=>{const Q=se.icon;return s.jsxs(we,{variant:h===se.id?"default":"outline",size:"sm",onClick:()=>m(se.id),className:"flex items-center gap-2",children:[s.jsx(Q,{className:"w-4 h-4"}),se.label,s.jsx(Je,{variant:"secondary",className:`ml-1 ${se.badgeClass}`,children:M(se.id)})]},se.id)})})})(),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(lf,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),s.jsx(xt,{placeholder:"Search by name, student, or email...",value:u,onChange:X=>d(X.target.value),className:"pl-10"})]}),s.jsxs(gn,{value:f,onValueChange:p,children:[s.jsx(dn,{className:"w-full sm:w-[180px]",children:s.jsx(vn,{placeholder:"Filter by status"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"all",children:"All Statuses"}),s.jsx(ot,{value:"draft",children:"Draft"}),s.jsx(ot,{value:"submitted",children:"Submitted"}),s.jsx(ot,{value:"under_review",children:"Under Review"}),s.jsx(ot,{value:"approved",children:"Approved"}),s.jsx(ot,{value:"rejected",children:"Rejected"}),s.jsx(ot,{value:"waitlisted",children:"Waitlisted"})]})]})]}),s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsxs(jt,{children:["Applications (",B.length,")"]})}),s.jsx(He,{children:l?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):B.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No applications foun
912d"}):s.jsx("div",{className:"space-y-4",children:B.map(X=>{var me,Ae,Ne;const{percentage:se,missing:Q}=$(X),ye=oXe[X.status],ie=ye.icon,F=((me=X.students)==null?void 0:me.length)||0;return s.jsx("div",{className:"p-4 border rounded-lg hover:bg-muted/50 transition-colors",children:s.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center gap-4",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[s.jsx("h4",{className:"font-medium truncate",children:G(X)}),X.application_type==="new_student_existing_family"?s.jsxs(Je,{variant:"default",className:"bg-blue-600",children:[s.jsx(Zr,{className:"w-3 h-3 mr-1"})," Returning Family – New Student"]}):s.jsx(Je,{variant:((Ae=X.profiles)==null?void 0:Ae.applicant_type)==="new"?"secondary":"outline",children:((Ne=X.profiles)==null?void 0:Ne.applicant_type)==="new"?s.jsxs(s.Fragment,{children:[s.jsx(ci,{className:"w-3 h-3 mr-1"})," New"]}):s.jsxs(s.Fragment,{children:[s.jsx(Zr,{className:"w-3 h-3 mr-1"})," Returning"]})}),s.jsx(pT,{classification:X.admin_classification})]}),s.jsxs("div",{className:"text-sm text-muted-foreground flex items-start gap-2 flex-wrap mb-1",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Bh,{className:"w-3.5 h-3.5"}),F===0?s.jsx("span",{className:"text-amber-600",children:"No students added"}):F===1?s.jsxs("span",{children:[X.students[0].first_name," ",X.students[0].last_name,X.students[0].status&&s.jsx(Je,{variant:"outline",className:`ml-1 text-xs ${X.students[0].status==="new"?"bg-amber-100 text-amber-800 border-amber-300":""}`,children:X.students[0].status==="new"?"New":"Returning"})]}):s.jsxs("span",{children:[F," students: ",X.students.map(ve=>ve.first_name).join(", ")]})]}),s.jsxs("span",{className:"text-muted-foreground",children:["• ",te(X)]})]}),F>0&&(()=>{const ve=X.students.filter(Ee=>Ee.decision_status==="accepted").length,pe=X.students.filter(Ee=>Ee.decision_status==="denied").length,Pe=F-ve-pe;return s.jsxs("div",{className:"flex items-center gap-2 text-xs mb-1",children:[s.jsx("span",{className:"text-muted-foreground",children:"Decisions:"}),ve>0&&s.jsxs("span",{className:"flex items-center gap-1 text-green-600",children:[s.jsx(Nt,{className:"w-3 h-3"}),ve]}),Pe>0&&s.jsxs("span",{className:"flex items-center gap-1 text-amber-600",children:[s.jsx(Fn,{className:"w-3 h-3"}),Pe]}),pe>0&&s.jsxs("span",{className:"flex items-center gap-1 text-red-600",children:[s.jsx(er,{className:"w-3 h-3"}),pe]})]})})(),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Created ",new Date(X.created_at).toLocaleDateString(),X.status==="draft"&&` at ${new Date(X.created_at).toLocaleTimeString()}`,X.submitted_at&&` • Submitted ${new Date(X.submitted_at).toLocaleDateString()}`,h==="approved"&&V(X)>0&&s.jsxs("span",{className:"text-green-700 font-medium",children:[" • Approved ",new Date(V(X)).toLocaleDateString()]})]}),(()=>{const ve=q(X.id);if(!ve)return null;const pe=ve.interview_slots;return ve.status==="cancelled"||!pe?s.jsxs("p",{className:"text-xs text-amber-600 flex items-center gap-1 mt-0.5",children:[s.jsx(Ig,{className:"w-3 h-3"}),"Interview canceled – reschedule pending"]}):s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-0.5",children:[s.jsx(Ig,{className:"w-3 h-3"}),"Interview: ",new Date(pe.slot_date+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})," ",U(pe.start_time)," – ",U(pe.end_time)]})})()]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-3 lg:gap-4",children:[s.jsxs("div",{className:"w-full sm:w-32",children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Complete"}),s.jsxs("span",{className:"text-xs font-medium",children:[se,"%"]})]}),s.jsx(qN,{value:se,className:"h-2"})]}),Q.length>0&&s.jsxs(we,{variant:"ghost",size:"sm",className:"text-amber-600 hover:text-amber-700",onClick:()=>e(`/portal/admin/applications/${X.id}`),children:[s.jsx(er,{className:"w-4 h-4 mr-1"}),Q.length," missing"]}),s.jsxs(Je,{variant:ye.variant,className:"flex items-center gap-1",children:[s.jsx(ie,{className:"w-3 h-3"}),ye.label]}),s.jsxs(we,{variant:"outline",size:"sm",onClick:()=>e(`/portal/admin/applications/${X.id}`),children:[s.jsx($s,{className:"w-4 h-4 mr-1"}),"Details"]}
912)]})]})},X.id)})})})]}),s.jsx(_a,{open:w,onOpenChange:j,children:s.jsxs(ha,{className:"max-w-md",children:[s.jsx($a,{children:s.jsx(Da,{children:"Upload Document on Behalf of Family"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Document Type *"}),s.jsxs(gn,{value:S,onValueChange:X=>{A(X),k("")},children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select document type"})}),s.jsx(fn,{children:Qy.map(X=>s.jsx(ot,{value:X.value,children:X.label},X.value))})]})]}),S&&((ce=Qy.find(X=>X.value===S))==null?void 0:ce.studentSpecific)&&s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Select Student *"}),s.jsxs(gn,{value:E,onValueChange:k,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select student"})}),s.jsx(fn,{children:((g==null?void 0:g.students)||[]).map(X=>s.jsxs(ot,{value:X.id,children:[X.first_name," ",X.last_name]},X.id))})]}),(!(g!=null&&g.students)||g.students.length===0)&&s.jsx("p",{className:"text-xs text-destructive",children:"No students found on this application."})]}),S&&g&&(()=>{const X=i[g.id]||[],se=Qy.find(ie=>ie.value===S);let Q=S;return se!=null&&se.studentSpecific&&E&&(Q=`${S}_${E}`),X.find(ie=>ie.document_type===Q)?s.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-800",children:[s.jsx($g,{className:"w-4 h-4 mt-0.5 shrink-0"}),s.jsx("span",{children:"A document of this type already exists. Uploading will add an additional version."})]}):null})(),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"File *"}),s.jsx("input",{ref:D,type:"file",accept:sXe,onChange:X=>{var Q;const se=((Q=X.target.files)==null?void 0:Q[0])||null;if(se&&se.size>A9){tn.error("File size must be under 10MB"),X.target.value="",R(null);return}R(se)},className:"block w-full text-sm border rounded-md p-2 file:mr-4 file:rounded file:border-0 file:bg-primary file:text-primary-foreground file:px-3 file:py-1 file:text-sm file:cursor-pointer"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"PDF, JPEG, PNG, WebP, HEIC, TIFF, or BMP. Max 50MB."})]}),s.jsx(we,{className:"w-full",disabled:!S||!P||C||((oe=Qy.find(X=>X.value===S))==null?void 0:oe.studentSpecific)&&!E,onClick:ne,children:C?"Uploading...":"Upload Document"})]})]})})]})})};function fXe({slots:e,bookings:t,onUpdateBookingStatus:n}){const[r,a]=x.useState(new Date),i=x.useMemo(()=>r?t.filter(d=>ca(xr(d.interview_slots.slot_date),r)):[],[r,t]),o=x.useMemo(()=>r?e.filter(d=>!d.is_booked&&ca(xr(d.slot_date),r)):[],[r,e]),l=x.useMemo(()=>r?e.filter(d=>ca(xr(d.slot_date),r)):[],[r,e]),c=d=>{const[f,p]=d.split(":"),h=parseInt(f),m=h>=12?"PM":"AM";return`${h%12||12}:${p} ${m}`},u=x.useMemo(()=>{const d=[],f=[],p=new Set;return e.forEach(h=>p.add(h.slot_date)),p.forEach(h=>{const m=xr(h),g=t.filter(y=>ca(xr(y.interview_slots.slot_date),m)),v=e.filter(y=>!y.is_booked&&ca(xr(y.slot_date),m));g.length>0&&d.push(m),v.length>0&&f.push(m)}),{hasBookings:d,hasAvailable:f}},[t,e]);return s.jsxs("div",{className:"grid gap-6 lg:grid-cols-[400px_1fr]",children:[s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs(jt,{className:"flex items-center gap-2 text-lg",children:[s.jsx(Ig,{className:"w-5 h-5"}),"Interview Calendar"]})}),s.jsxs(He,{children:[s.jsx($N,{mode:"single",selected:r,onSelect:a,modifiers:u,modifiersClassNames:{hasBookings:"interview-has-bookings",hasAvailable:"interview-has-available"},className:"rounded-md border pointer-events-auto"}),s.jsxs("div",{className:"mt-4 flex flex-col gap-2 text-xs",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white"})}),s.jsx("span",{className:"text-muted-foreground",children:"Has booked interviews"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-primary"}),s.jsx("span",{className:"text-muted-foreground",children:"Has available slots"})]})]})]})]}),s.jsxs(Ve,{children:[s.jsx(_t,{className:"pb-3",children:s.jsxs(jt,{className:"flex items-center justify-between",children:[s.jsx("span",{children:r?Dn(r,"EEEE, MMMM d, yyyy"):"Select a date"}),r&&l.length>0&&s.jsxs(Je,{variant:"outline",children:[i.length," / ",l.length," booked"]})]})}),s.jsx(He,{children:r?l.length===0?s.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No interview slots on this date"}):s.jsx(fI,{className:"h-[400px] pr-4",children:s.jsxs("div",{className:"space-y-4",children:[i.length>0&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h4",{className:"font-medium text-sm text-muted-foreground uppercase tracking-wide",children:["Booked Interviews (",i.length,")"]}),i.sort((d,f)=>d.interview_slots.start_time.localeCompare(f.interview_slots.start_time)).map(d=>{var f,p,h,m,g,v;return s.jsxs("div",{className:"p-4 border rounded-lg bg-card",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"p-2 rounded-full bg-primary/10 mt-0.5",children:s.jsx(ci,{className:"w-4 h-4 text-primary"})}),s.jsxs("div",{children:[s.jsxs("h5",{className:"font-medium",children:[(f=d.applications)==null?void 0:f.parent_first_name," ",(p=d.applications)==null?void 0:p.parent_last_name]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:(()=>{const y=(d.students||[]).filter(b=>b.status==="new");return y.length>0?`Students: ${y.map(b=>b.first_name).join(", ")}`:"No students requiring interview"})()}),s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground mt-1",children:[s.jsx(Fn,{className:"w-3 h-3"}),c(d.interview_slots.start_time)," ","- ",c(d.interview_slots.end_time)]}),(((h=d.applications)==null?void 0:h.email)||((m=d.applications)==null?void 0:m.ph
912one))&&s.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs mt-1",children:[((g=d.applications)==null?void 0:g.email)&&s.jsxs("a",{href:`mailto:${d.applications.email}`,className:"flex items-center gap-1 text-primary hover:underline",children:[s.jsx(lu,{className:"w-3 h-3"}),d.applications.email]}),((v=d.applications)==null?void 0:v.phone)&&s.jsxs("a",{href:`tel:${d.applications.phone}`,className:"flex items-center gap-1 text-primary hover:underline",children:[s.jsx(rx,{className:"w-3 h-3"}),d.applications.phone]})]})]})]}),s.jsx(Je,{variant:d.status==="completed"?"default":d.status==="cancelled"?"destructive":"secondary",children:d.status})]}),d.status==="scheduled"&&s.jsxs("div",{className:"flex gap-2 mt-3 pt-3 border-t",children:[s.jsxs(we,{size:"sm",variant:"outline",className:"flex-1",onClick:()=>n(d.id,"completed"),children:[s.jsx(Nt,{className:"w-4 h-4 mr-1"}),"Complete"]}),s.jsxs(we,{size:"sm",variant:"destructive",className:"flex-1",onClick:()=>n(d.id,"cancelled"),children:[s.jsx(Pa,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})]},d.id)})]}),o.length>0&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h4",{className:"font-medium text-sm text-muted-foreground uppercase tracking-wide",children:["Available Slots (",o.length,")"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:o.sort((d,f)=>d.start_time.localeCompare(f.start_time)).map(d=>s.jsxs("div",{className:"p-3 border rounded-lg bg-muted/30 flex items-center gap-2",children:[s.jsx(Fn,{className:"w-4 h-4 text-muted-foreground"}),s.jsxs("span",{className:"text-sm",children:[c(d.start_time)," -"," ",c(d.end_time)]}),s.jsx(Je,{variant:"outline",className:"ml-auto text-xs",children:"Open"})]},d.id))})]})]})}):s.jsx("p",{className:"text-center text-muted-foreground py-8",children:"Click on a date to view interviews"})})]})]})}function hXe({open:e,onOpenChange:t,familyName:n,parentNames:r,students:a,adminNotes:i,bookingId:o,onUpdateAdminNotes:l}){const[c,u]=x.useState(i||""),[d,f]=x.useState(!1),p=async()=>{f(!0);try{await l(o,c),et({title:"Notes saved",description:"Admin notes have been updated."})}catch{et({title:"Error",description:"Failed to save notes.",variant:"destructive"})}f(!1)},h=m=>{switch(m){case"accepted":return s.jsx(Je,{className:"bg-green-500",children:"Accepted"});case"denied":return s.jsx(Je,{variant:"destructive",children:"Denied"});default:return s.jsx(Je,{variant:"secondary",children:"Pending"})}};return s.jsx(_a,{open:e,onOpenChange:t,children:s.jsxs(ha,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsx($a,{children:s.jsxs(Da,{className:"text-xl",children:[n," Family Interview Details"]})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wide mb-3",children:"Parents / Guardians"}),s.jsx("div",{className:"space-y-2",children:r.map((m,g)=>s.jsxs("div",{className:"flex items-center gap-2 text-foreground",children:[s.jsx(ci,{className:"w-4 h-4 text-muted-foreground"}),s.jsx("span",{children:m})]},g))})]}),s.jsx(_v,{}),s.jsx("div",{children:(()=>{const m=a.filter(v=>v.status==="new"),g=a.length-m.length;return s.jsxs(s.Fragment,{children:[s.jsxs("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wide mb-3",children:["Students Requiring Interview (",m.length,")"]}),g>0&&s.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:[g," returning student",g>1?"s":""," not shown (no interview required)"]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Application decisions can be managed from the Applications page."}),s.jsx("div",{className:"space-y-3",children:m.length>0?m.map(v=>s.jsx("div",{className:"p-4 border rounded-lg bg-card",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[s.jsx(Bh,{className:"w-4 h-4 text-primary"}),v.first_name," ",v.last_name]}),s.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[v.grade&&s.jsxs("span",{className:"flex items-center gap-1",children:["Grade: ",v.grade]}),v.school&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(FW,{className:"w-3 h-3"}),v.school]})]})]}),h(v.decision_status)]})},v.id)):s.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No new students requiring interview"})})]})})()}),s.jsx(_v,{}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wide mb-3",children:"Admin Notes"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(wc,{placeholder:"Add notes about this family interview...",value:c,onChange:m=>u(m.target.value),rows:4}),s.jsxs(we,{onClick:p,disabled:d,size:"sm",children:[d?s.jsx(Xt,{className:"w-4 h-4 animate-spin mr-2"}):s.jsx(z_,{className:"w-4 h-4 mr-2"}),"Save Notes"]})]})]})]})]})})}const pXe=[{label:"30 min",minutes:30},{label:"45 min",minutes:45},{label:"1 hour",minutes:60},{label:"1.5 hours",minutes:90}],mXe=["12:00","12:30","13:00","13:30","14:00"],gXe=[{label:"10 min",minutes:10},{label:"15 min",minutes:15},{label:"30 min",minutes:30}],vXe=()=>{const{admin:e,session:t}=bo(),n=di(),r=async(je,rt)=>{try{await navigator.clipboard.writeText(je),et({title:`${rt} copied`,description:je})}catch{et({title:"Copy failed",variant:"destructive"})}},[a,i]=x.useState([]),[o,l]=x.useState([]),[c,u]=x.useState(!0),[d,f]=x.use
912State(!1),[p,h]=x.useState(!1),[m,g]=x.useState(null),[v,y]=x.useState("all"),[b,w]=x.useState("scheduled"),[j,S]=x.useState("alphabetical"),[A,E]=x.useState(""),[k,P]=x.useState(null),[R,C]=x.useState(null),[I,D]=x.useState(!1),[U,q]=x.useState([]),[Z,H]=x.useState(!1),[$,W]=x.useState(""),[ee,V]=x.useState(""),[O,M]=x.useState(!1),[B,G]=x.useState("all"),[te,ne]=x.useState(""),[ce,oe]=x.useState(""),[X,se]=x.useState([]),[Q,ye]=x.useState(""),[ie,F]=x.useState(""),[me,Ae]=x.useState(60),[Ne,ve]=x.useState(1),[pe,Pe]=x.useState(0),Ee=Array.from(new Set([ce,...X].filter(Boolean))).sort(),Ie=()=>"https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-interviews";x.useEffect(()=>{Me();const je=Re.channel("admin-interview-changes").on("postgres_changes",{event:"*",schema:"public",table:"interview_bookings"},()=>{Me()}).on("postgres_changes",{event:"*",schema:"public",table:"interview_slots"},()=>{Me()}).subscribe();return()=>{Re.removeChannel(je)}},[t]);const Me=async()=>{if(!(t!=null&&t.access_token)){u(!1);return}try{const je=await fetch(Ie(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`}});if(!je.ok)throw new Error("Failed to fetch data");const rt=await je.json();i(rt.slots||[]),l(rt.bookings||[])}catch(je){console.error("Error fetching interview data:",je),et({title:"Error",description:"Failed to load interview data.",variant:"destructive"})}u(!1)};x.useEffect(()=>{if(Q&&me){const je=jw(Q,"HH:mm",new Date),rt=_w(je,me);F(Dn(rt,"HH:mm"))}},[Q,me]);const tt=()=>{if(!ce||!Q||!me)return[];const je=Ne>1?pe:0,rt=[];for(const at of Ee){let xn=jw(Q,"HH:mm",new Date);for(let sr=0;sr<Ne;sr++){const Yn=_w(xn,me);rt.push({slot_date:at,start_time:Dn(xn,"HH:mm:ss"),end_time:Dn(Yn,"HH:mm:ss")}),sr<Ne-1&&(xn=_w(xn,me+je))}}return rt},De=(()=>{if(!Q||!me||Ne<=0)return!1;const je=Ne>1?pe:0,rt=me*Ne+je*Math.max(0,Ne-1),at=jw(Q,"HH:mm",new Date),xn=_w(at,rt),sr=jw("23:59","HH:mm",new Date);return hu(xn,sr)})(),Qe=Ne>1&&pe===0,vt=async()=>{if(!(t!=null&&t.access_token)||!ce||!Q){et({title:"Error",description:"Please fill in all required fields.",variant:"destructive"});return}if(Qe){et({title:"Interval Required",description:"Please select an interval duration when creating multiple slots.",variant:"destructive"});return}if(De){et({title:"Time Window Exceeded",description:"The generated slots extend past 11:59 PM. Reduce the number of slots or adjust the start time.",variant:"destructive"});return}h(!0);const je=tt();if(je.length===0){et({title:"Error",description:"No valid slots to create.",variant:"destructive"}),h(!1);return}try{const rt=await fetch(Ie(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({slots:je})});if(!rt.ok){const at=await rt.json();throw new Error(at.error||"Failed to create slots")}et({title:"Success",description:`Created ${je.length} interview slot${je.length>1?"s":""} successfully.`}),f(!1),oe(""),se([]),ye(""),F(""),ve(1),Pe(0),Me()}catch(rt){console.error("Error creating slots:",rt),et({title:"Error",description:rt instanceof Error?rt.message:"Failed to create interview slot.",variant:"destructive"})}h(!1)},ct=async je=>{if(t!=null&&t.access_token){g(je);try{if(!(await fetch(`${Ie()}?slotId=${je}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`}})).ok)throw new Error("Failed to delete slot");et({title:"Success",description:"Interview slot deleted."}),Me()}catch(rt){console.error("Error deleting slot:",rt),et({title:"Error",description:"Failed to delete interview slot.",variant:"destructive"})}g(null)}},ut=async(je,rt)=>{if(t!=null&&t.access_token)try{if(!(await fetch(Ie(),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({bookingId:je,status:rt})})).ok)throw new Error("Failed to update booking");et({title:"Success",description:`Interview marked as ${rt}.`}),Me()}catch(at){console.error("Error updating booking:",at),et({title:"Error",description:"Failed to update booking status.",variant:"destructive"})}},Fe=async je=>{if(t!=null&&t.access_token){C(je);try{if(!(await fetch(Ie(),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({bookingId:je,cancelInterview:!0})})).ok)throw new Error("Failed to cancel interview");et({title:"Interview Cancelled",description:"The interview has been cancelled and the slot is now available."}),Me()}catch(rt){console.error("Error cancelling interview:",rt),et({title:"Error",description:"Failed to cancel interview.",variant:"destructive"})}C(null)}},It=async(je,rt)=>{if(!(t!=null&&t.access_token))return;if(!(await fetch(Ie(),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({bookingId:je,adminNotes:rt})})).ok)throw new Error("Failed to update admin notes");Me()},zt=je=>{ye(je)},Wt=async()=>
912{if(D(!0),W(""),V(""),!!(t!=null&&t.access_token)){H(!0);try{const je=await fetch(Ie(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({action:"list-bookable-applications"})}),rt=await je.json();if(!je.ok)throw new Error(rt.error||"Failed to load applications");q(rt.applications||[])}catch(je){console.error(je),et({title:"Error",description:"Could not load applications.",variant:"destructive"})}H(!1)}},Jt=async()=>{if(!(t!=null&&t.access_token)||!$||!ee){et({title:"Missing info",description:"Pick a family and an available slot.",variant:"destructive"});return}M(!0);try{const je=await fetch(Ie(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({action:"book-for-family",applicationId:$,slotId:ee})}),rt=await je.json();if(!je.ok)throw new Error(rt.error||"Failed to schedule interview");et({title:"Interview scheduled",description:"The family has been booked into the selected slot."}),D(!1),Me()}catch(je){et({title:"Could not schedule",description:je instanceof Error?je.message:"Unknown error",variant:"destructive"})}M(!1)};o.reduce((je,rt)=>{const at=rt.user_id;return je[at]||(je[at]=[]),je[at].push(rt),je},{});const Pt=o.filter(je=>{const rt=xr(je.interview_slots.slot_date),at=Os(new Date);switch(v){case"upcoming":return je.status==="scheduled"&&!Vh(rt,at);case"completed":return je.status==="completed";default:return!0}}).reduce((je,rt)=>{const at=rt.user_id;return je[at]||(je[at]=[]),je[at].push(rt),je},{}),Tn=Os(new Date),Lt=a.filter(je=>!je.is_booked&&!Vh(xr(je.slot_date),Tn)).sort((je,rt)=>{const at=je.slot_date.localeCompare(rt.slot_date);return at!==0?at:je.start_time.localeCompare(rt.start_time)}),Vt=Lt.filter(je=>{const rt=Os(xr(je.slot_date));return B==="today"?xj(rt,Tn):B==="7"?!hu(rt,Ea(Tn,7)):B==="30"?!hu(rt,Ea(Tn,30)):B==="date"&&te?xj(rt,Os(xr(te))):!0});a.filter(je=>je.is_booked);const Mn=o.filter(je=>je.status==="scheduled").length,nn=o.filter(je=>je.status==="completed").length;x.useEffect(()=>{if(!(t!=null&&t.access_token)||a.length===0)return;const je=a.filter(rt=>!rt.is_booked&&Vh(xr(rt.slot_date),Tn));je.length!==0&&(async()=>(await Promise.all(je.map(rt=>fetch(`${Ie()}?slotId=${rt.id}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`}}).catch(()=>null))),Me()))()},[a,t]);const yt=je=>{const[rt,at]=je.split(":"),xn=parseInt(rt),sr=xn>=12?"PM":"AM";return`${xn%12||12}:${at} ${sr}`},hn=tt(),Mt=je=>{var at,xn;const rt=[];return(at=je.applications)!=null&&at.parent_first_name&&rt.push(`${je.applications.parent_first_name} ${je.applications.parent_last_name||""}`),(xn=je.applications)!=null&&xn.parent2_first_name&&rt.push(`${je.applications.parent2_first_name} ${je.applications.parent2_last_name||""}`),rt},Ht=je=>{var rt;return((rt=je.applications)==null?void 0:rt.parent_last_name)||"Unknown"};return s.jsx(gs,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-display font-semibold text-foreground",children:"Interview Management"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Create available interview slots and manage bookings."})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(we,{variant:"outline",onClick:Wt,children:[s.jsx(ci,{className:"w-4 h-4 mr-2"}),"Schedule for Family"]}),s.jsxs(we,{onClick:()=>f(!0),children:[s.jsx(zh,{className:"w-4 h-4 mr-2"}),"Create Slot"]})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsx("button",{type:"button",className:`text-left rounded-lg border bg-card shadow-sm cursor-pointer transition-all hover:shadow-md ${v==="all"?"ring-2 ring-primary":""}`,onClick:()=>y("all"),children:s.jsxs("div",{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-blue-100",children:s.jsx(yi,{className:"w-6 h-6 text-blue-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:o.length}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"All Interviews"})]})]})}),s.jsx("button",{type:"button",className:`text-left rounded-lg border bg-card shadow-sm cursor-pointer transition-all hover:shadow-md ${v==="upcoming"?"ring-2 ring-primary":""}`,onClick:()=>y("upcoming"),children:s.jsxs("div",{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-amber-100",children:s.jsx(Fn,{className:"w-6 h-6 text-amber-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:Mn}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Upcoming / Scheduled"})]})]})}),s.jsx("button",{type:"button",className:`text-left rounded-lg border bg-card shadow-sm cursor-pointer transition-all hover:shadow-md ${v==="completed"?"ring-2 ring-primary":""}`,onClick:()=>y("completed"),children:s.jsxs("div",{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-green-100",children:s.jsx(Nt,{className:"w-6 h-6 text-green-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:nn}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Completed"})]})]})})]}),s.jsxs($R,{defaultValue:"calendar",className:"w-full",children:[s.jsxs(DR,{children:[s.jsxs(Qx,{value:"calendar",className:"flex items-center gap-2",children:[s.jsx(Ig,{className:"w-4 h-4"}),"Calendar View"]}),s.jsxs(Qx,{value:"list",className:"flex items-center gap-2",children:[s.jsx(ioe,{className:"w-4 h-4"}),"List View"]})]}),s.jsx(pv,{value:"calendar",className:"mt-6",children:s.jsx(fXe,{slots:a,bookings:o,onUpdateBookingStatus:ut})}),s.jsxs(pv,{value:"list",className:"mt-6 space-y-6",children:[s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsxs(jt,{className:"flex items-center gap-2",children:[s.jsx(Zr,{className:"w-5 h-5"}),"Family Interviews",s.jsx(Je,{variant:"outline",className:"ml-2",children:v==="all"?"All":v==="upcoming"?"Upcoming":"C
912ompleted"})]}),s.jsx(qn,{children:"Interviews grouped by family - click Details to see all students"})]}),s.jsx(He,{children:c?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):Object.keys(Pt).length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No interviews found for this filter."}):(()=>{const je=A.trim().toLowerCase(),rt=Gt=>{var ji,Fa,Za;if(!je)return!0;const Sn=(((ji=Gt.applications)==null?void 0:ji.parent_last_name)||"").toLowerCase(),Zt=(((Fa=Gt.applications)==null?void 0:Fa.parent2_last_name)||"").toLowerCase(),_i=(((Za=Gt.applications)==null?void 0:Za.parent_first_name)||"").toLowerCase();return Sn.includes(je)||Zt.includes(je)||_i.includes(je)},at=Object.entries(Pt).filter(([,Gt])=>rt(Gt[0])),xn=at.filter(([,Gt])=>Gt[0].status==="scheduled").sort(([,Gt],[,Sn])=>{const Zt=Gt[0].interview_slots.slot_date+"T"+Gt[0].interview_slots.start_time,_i=Sn[0].interview_slots.slot_date+"T"+Sn[0].interview_slots.start_time;return Zt.localeCompare(_i)}),sr=at.filter(([,Gt])=>Gt[0].status==="completed").sort(([,Gt],[,Sn])=>{if(j==="date_desc"){const Zt=Gt[0].interview_slots.slot_date+"T"+Gt[0].interview_slots.start_time;return(Sn[0].interview_slots.slot_date+"T"+Sn[0].interview_slots.start_time).localeCompare(Zt)}return(Ht(Gt[0])||"").localeCompare(Ht(Sn[0])||"")}),Yn=at.filter(([,Gt])=>Gt[0].status!=="scheduled"&&Gt[0].status!=="completed"),nr=(Gt,Sn)=>{var Fa,Za,Si,Ni;const Zt=Sn[0],_i=Mt(Zt),ji=Sn.flatMap(Jr=>Jr.students||[]).filter(Jr=>Jr.status==="new");return s.jsx("div",{className:"p-4 border rounded-lg bg-card",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(ci,{className:"w-5 h-5 text-primary"}),s.jsx("h4",{className:"font-semibold text-lg",children:_i.join(" & ")||"Unknown Parents"})]}),s.jsx("div",{className:"ml-7 space-y-1",children:ji.length>0?ji.map((Jr,wo)=>s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsxs("span",{children:["• ",Jr.first_name," ",Jr.last_name]}),s.jsx(Je,{variant:"outline",className:"text-xs",children:Jr.decision_status||"pending"})]},Jr.id||wo)):s.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No students linked"})}),(((Fa=Zt.applications)==null?void 0:Fa.email)||((Za=Zt.applications)==null?void 0:Za.phone))&&s.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm mt-2 ml-7",children:[((Si=Zt.applications)==null?void 0:Si.email)&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(lu,{className:"w-3.5 h-3.5 text-muted-foreground"}),s.jsx("a",{href:`mailto:${Zt.applications.email}`,className:"text-primary hover:underline",children:Zt.applications.email}),s.jsx("button",{type:"button",onClick:()=>r(Zt.applications.email,"Email"),className:"text-muted-foreground hover:text-foreground","aria-label":"Copy email",children:s.jsx(oA,{className:"w-3.5 h-3.5"})})]}),((Ni=Zt.applications)==null?void 0:Ni.phone)&&s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(rx,{className:"w-3.5 h-3.5 text-muted-foreground"}),s.jsx("a",{href:`tel:${Zt.applications.phone}`,className:"text-primary hover:underline",children:Zt.applications.phone})]})]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mt-3 ml-7",children:[s.jsx(yi,{className:"w-3 h-3"}),Dn(xr(Zt.interview_slots.slot_date),"MMMM d, yyyy"),s.jsx(Fn,{className:"w-3 h-3 ml-2"}),yt(Zt.interview_slots.start_time)," -"," ",yt(Zt.interview_slots.end_time)]})]}),s.jsxs("div",{className:"flex flex-col items-end gap-2",children:[s.jsx(Je,{variant:Zt.status==="completed"?"default":Zt.status==="cancelled"?"destructive":"secondary",children:Zt.status}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(we,{size:"sm",variant:"outline",onClick:()=>P(Zt),children:[s.jsx(En,{className:"w-4 h-4 mr-1"}),"Details"]}),s.jsxs(we,{size:"sm",variant:"outline",onClick:()=>n(`/portal/admin/applications/${Zt.application_id}`,{state:{from:"interviews"}}),children:[s.jsx(En,{className:"w-4 h-4 mr-1"}),"View Application"]}),Zt.status==="scheduled"&&s.jsxs(s.Fragment,{children:[s.jsxs(we,{size:"sm",variant:"outline",onClick:()=>ut(Zt.id,"completed"),children:[s.jsx(Nt,{className:"w-4 h-4 mr-1"}),"Complete"]}),s.jsxs(we,{size:"sm",variant:"destructive",disabled:R===Zt.id,onClick:()=>Fe(Zt.id),children:[R===Zt.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin mr-1"}):s.jsx(Yse,{className:"w-4 h-4 mr-1"}),"Cancel"]})]})]})]})]})},Gt)};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b pb-3",children:[s.jsxs(we,{size:"sm",variant:b==="scheduled"?"default":"outline",onClick:()=>w("scheduled"),children:[s.jsx(Fn,{className:"w-4 h-4 mr-1"}),"Scheduled (",xn.length,")"]}),s.jsxs(we,{size:"sm",variant:b==="completed"?"default":"outline",onClick:()=>w("completed"),children:[s.jsx(Nt,{className:"w-4 h-4 mr-1"}),"Completed (",sr.length,")"]}),s.jsx("div",{className:"ml-auto w-full sm:w-64",children:s.jsx(xt,{placeholder:"Search by last name…",value:A,onChange:Gt=>E(Gt.target.value),className:"h-9"})})]}),b==="scheduled"&&(xn.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No scheduled interviews."}):s.jsx("div",{className:"space-y-4",children:xn.map(([Gt,Sn])=>nr(Gt,Sn))})),b==="completed"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground mr-2",children:"Sort by:"}),s.jsx(we,{size:"sm",variant:j==="alphabetical"?"default":"outline",onClick:()=>S("alphabetical"),children:"A–Z by last name"}),s.jsx(we,{size:"sm",variant:j==="date_desc"?"default":"outline",onClick:()=>S("date_desc"),children:"Most recent first"})]}),sr.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No completed interviews."}):s.jsx("div",{className:"space-y-4",children:sr.map(([Gt,Sn])=>nr(Gt,Sn))})]}),Yn.length>0&&b==="scheduled"&&s.jsxs("div",{className:"space-y-3 pt-4 border-t",children:[s.jsxs("h3",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:["Other (",Yn.length,")"]}),s.jsx("div",{className:"space-y-4",children:Yn.map(([Gt,Sn])=>nr(Gt,Sn))})]})]})})()})]}),s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{children:[s.jsx(jt,{children:"Available Slots"}
912),s.jsx(qn,{children:"Open interview times that families can book"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(gn,{value:B,onValueChange:je=>G(je),children:[s.jsx(dn,{className:"h-9 w-[180px]",children:s.jsx(vn,{placeholder:"Filter slots"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"all",children:"All upcoming"}),s.jsx(ot,{value:"today",children:"Today"}),s.jsx(ot,{value:"7",children:"Next 7 days"}),s.jsx(ot,{value:"30",children:"Next 30 days"}),s.jsx(ot,{value:"date",children:"Specific date…"})]})]}),B==="date"&&s.jsx(xt,{type:"date",className:"h-9 w-[160px]",value:te,onChange:je=>ne(je.target.value)})]})]})}),s.jsx(He,{children:c?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):Vt.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:Lt.length===0?"No available slots. Create one to get started.":"No slots match the current filter."}):s.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:Vt.map(je=>s.jsxs("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[s.jsx(yi,{className:"w-4 h-4 text-primary"}),Dn(xr(je.slot_date),"MMM d, yyyy")]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mt-1",children:[s.jsx(Fn,{className:"w-3 h-3"}),yt(je.start_time)," - ",yt(je.end_time)]})]}),s.jsx(we,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",disabled:m===je.id,onClick:()=>ct(je.id),children:m===je.id?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsx(Al,{className:"w-4 h-4"})})]},je.id))})})]})]})]}),s.jsx(_a,{open:d,onOpenChange:f,children:s.jsxs(ha,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[s.jsxs($a,{children:[s.jsx(Da,{children:"Create Interview Slots"}),s.jsx(Bs,{children:"Add new available time slots for family interviews."})]}),s.jsxs("div",{className:"space-y-5 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"date",children:"Date"}),s.jsx(xt,{id:"date",type:"date",value:ce,onChange:je=>oe(je.target.value),min:new Date().toISOString().split("T")[0]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{className:"flex items-center gap-2",children:[s.jsx(oA,{className:"w-4 h-4 text-amber-500"}),"Apply to Additional Dates"]}),X.length>0&&s.jsx("div",{className:"space-y-2",children:X.map((je,rt)=>s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx(xt,{type:"date",value:je,min:new Date().toISOString().split("T")[0],onChange:at=>{const xn=[...X];xn[rt]=at.target.value,se(xn)}}),s.jsx(we,{type:"button",variant:"ghost",size:"icon",onClick:()=>se(X.filter((at,xn)=>xn!==rt)),"aria-label":"Remove date",children:s.jsx(Al,{className:"w-4 h-4"})})]},rt))}),s.jsxs(we,{type:"button",variant:"outline",size:"sm",onClick:()=>se([...X,""]),children:[s.jsx(zh,{className:"w-4 h-4 mr-2"}),"Add Another Date"]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The same time slots will be created on every selected date."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Quick Start Times"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:mXe.map(je=>s.jsx(we,{type:"button",variant:Q===je?"default":"outline",size:"sm",onClick:()=>zt(je),children:yt(je)},je))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"start",children:"Or enter custom start time"}),s.jsx(xt,{id:"start",type:"time",value:Q,onChange:je=>ye(je.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Duration"}),s.jsx("div",{className:"flex gap-2",children:pXe.map(je=>s.jsx(we,{type:"button",variant:me===je.minutes?"default":"outline",size:"sm",onClick:()=>Ae(je.minutes),children:je.label},je.minutes))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{className:"flex items-center gap-2",children:[s.jsx(voe,{className:"w-4 h-4 text-amber-500"}),"Create Multiple Back-to-Back Slots"]}),s.jsxs(gn,{value:Ne.toString(),onValueChange:je=>ve(parseInt(je)),children:[s.jsx(dn,{children:s.jsx(vn,{})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"1",children:"1 slot"}),s.jsx(ot,{value:"2",children:"2 slots"}),s.jsx(ot,{value:"3",children:"3 slots"}),s.jsx(ot,{value:"4",children:"4 slots"}),s.jsx(ot,{value:"5",children:"5 slots"}),s.jsx(ot,{value:"6",children:"6 slots"}),s.jsx(ot,{value:"7",children:"7 slots"}),s.jsx(ot,{value:"8",children:"8 slots"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Creates consecutive slots starting from your selected time"})]}),Ne>1&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs($e,{children:["Interval Between Interviews ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx("div",{className:"flex gap-2",children:gXe.map(je=>s.jsx(we,{type:"button",variant:pe===je.minutes?"default":"outline",size:"sm",onClick:()=>Pe(je.minutes),children:je.label},je.minutes))}),Qe&&s.jsx("p",{className:"text-xs text-destructive",children:"Please select an interval duration between interview slots"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Buffer time added between consecutive interview slots"})]}),hn.length>0&&ce&&Q&&s.jsxs("div",{className:"space-y-2 pt-2 border-t",children:[s.jsxs($e,{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(oA,{className:"w-4 h-4"}),"Preview (",hn.length," slot",hn.length>
9121?"s":"",")"]}),s.jsx("div",{className:"max-h-32 overflow-auto space-y-1",children:hn.map((je,rt)=>s.jsxs("div",{className:"text-sm bg-muted/50 rounded px-3 py-1.5 flex items-center gap-2",children:[s.jsx(Fn,{className:"w-3 h-3 text-muted-foreground"}),s.jsx("span",{className:"font-medium",children:Dn(xr(je.slot_date),"EEE, MMM d")}),s.jsxs("span",{className:"text-muted-foreground",children:[yt(je.start_time.slice(0,5))," -"," ",yt(je.end_time.slice(0,5))]})]},rt))}),De&&s.jsx("p",{className:"text-xs text-destructive font-medium",children:"⚠ These slots extend past 11:59 PM. Please reduce the number of slots or adjust the start time."})]})]}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),s.jsxs(we,{onClick:vt,disabled:p||!ce||!Q||Qe||De,children:[p?s.jsx(Xt,{className:"w-4 h-4 animate-spin mr-2"}):s.jsx(zh,{className:"w-4 h-4 mr-2"}),"Create ",Ne>1?`${Ne} Slots`:"Slot"]})]})]})}),s.jsx(_a,{open:I,onOpenChange:D,children:s.jsxs(ha,{className:"max-w-lg",children:[s.jsxs($a,{children:[s.jsx(Da,{children:"Schedule Interview for a Family"}),s.jsx(Bs,{children:"Book an existing available slot on behalf of a family. Only slots you've already created and that aren't booked are shown."})]}),s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Family / Application"}),Z?s.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading families…"}):s.jsxs(gn,{value:$,onValueChange:W,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select a family"})}),s.jsx(fn,{children:U.length===0?s.jsx("div",{className:"p-2 text-sm text-muted-foreground",children:"No eligible families found."}):U.map(je=>{const rt=`${je.parent_last_name||"Unknown"}, ${je.parent_first_name||""}`.trim();return s.jsxs(ot,{value:je.id,children:[rt," ",je.email?`(${je.email})`:"",je.has_active_booking?" — already scheduled (will reschedule)":""]},je.id)})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[s.jsx($e,{children:"Available Slot"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(gn,{value:B,onValueChange:je=>G(je),children:[s.jsx(dn,{className:"h-8 w-[150px] text-xs",children:s.jsx(vn,{placeholder:"Filter"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"all",children:"All upcoming"}),s.jsx(ot,{value:"today",children:"Today"}),s.jsx(ot,{value:"7",children:"Next 7 days"}),s.jsx(ot,{value:"30",children:"Next 30 days"}),s.jsx(ot,{value:"date",children:"Specific date…"})]})]}),B==="date"&&s.jsx(xt,{type:"date",className:"h-8 w-[140px] text-xs",value:te,onChange:je=>ne(je.target.value)})]})]}),s.jsxs(gn,{value:ee,onValueChange:V,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select an available slot"})}),s.jsx(fn,{children:Vt.length===0?s.jsx("div",{className:"p-2 text-sm text-muted-foreground",children:Lt.length===0?"No available slots. Create one first.":"No slots match the current filter."}):Vt.map(je=>s.jsxs(ot,{value:je.id,children:[Dn(xr(je.slot_date),"EEE, MMM d, yyyy")," • ",yt(je.start_time)," – ",yt(je.end_time)]},je.id))})]})]})]}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>D(!1),disabled:O,children:"Cancel"}),s.jsxs(we,{onClick:Jt,disabled:O||!$||!ee,children:[O?s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(yi,{className:"w-4 h-4 mr-2"}),"Schedule Interview"]})]})]})}),k&&s.jsx(hXe,{open:!!k,onOpenChange:je=>!je&&P(null),familyName:Ht(k),parentNames:Mt(k),students:(k.students||[]).map(je=>({id:je.id,first_name:je.first_name,last_name:je.last_name,grade:je.grade,school:je.school,decision_status:je.decision_status||"pending",status:je.status||"new"})),adminNotes:k.admin_notes,bookingId:k.id,onUpdateAdminNotes:It})]})})},tE=[{value:"info",label:"Information",icon:Ed,color:"text-blue-500"},{value:"success",label:"Success",icon:Nt,color:"text-green-500"},{value:"warning",label:"Warning",icon:$g,color:"text-amber-500"},{value:"action",label:"Action Required",icon:ex,color:"text-red-500"}],yXe=()=>
912{const[e,t]=x.useState([]),[n,r]=x.useState([]),[a,i]=x.useState(!0),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,f]=x.useState("all"),[p,h]=x.useState(""),[m,g]=x.useState(""),[v,y]=x.useState("info");x.useEffect(()=>{b()},[]);const b=async()=>{const{data:E,error:k}=await Re.from("profiles").select("id, user_id, full_name, email").order("full_name",{ascending:!0});k?console.error("Error fetching profiles:",k):t(E||[]);const{data:P,error:R}=await Re.from("notifications").select("*").order("created_at",{ascending:!1}).limit(50);R?console.error("Error fetching notifications:",R):r(P||[]),i(!1)},w=async()=>{if(!p||!m){et({title:"Error",description:"Please fill in all fields.",variant:"destructive"});return}l(!0);const k=(d==="all"?e.map(R=>R.user_id):[d]).map(R=>({user_id:R,title:p,message:m,type:v})),{error:P}=await Re.from("notifications").insert(k);P?et({title:"Error",description:"Failed to send notification(s).",variant:"destructive"}):(et({title:"Success",description:`Notification sent to ${d==="all"?"all families":"1 family"}.`}),u(!1),h(""),g(""),f("all"),y("info"),b()),l(!1)},j=E=>{const k=e.find(P=>P.user_id===E);return(k==null?void 0:k.full_name)||(k==null?void 0:k.email)||"Unknown User"},S=E=>tE.find(k=>k.value===E)||tE[0],A={total:n.length,info:n.filter(E=>E.type==="info").length,warning:n.filter(E=>E.type==="warning").length,action:n.filter(E=>E.type==="action").length};return s.jsx(gs,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-display font-semibold text-foreground",children:"Notifications & Messaging"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Send notifications and messages to families."})]}),s.jsxs(we,{onClick:()=>u(!0),children:[s.jsx(OL,{className:"w-4 h-4 mr-2"}),"Compose Message"]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-primary/10",children:s.jsx(vO,{className:"w-6 h-6 text-primary"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:A.total}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Sent"})]})]})}),s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-blue-100",children:s.jsx(Ed,{className:"w-6 h-6 text-blue-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:A.info}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Informational"})]})]})}),s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-amber-100",children:s.jsx($g,{className:"w-6 h-6 text-amber-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:A.warning}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Warnings"})]})]})}),s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-red-100",children:s.jsx(ex,{className:"w-6 h-6 text-red-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:A.action}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Action Required"})]})]})})]}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsx(jt,{children:"Quick Notifications"}),s.jsx(qn,{children:"Send common notification templates to families."})]}),s.jsxs(He,{className:"flex flex-wrap gap-3",children:[s.jsxs(we,{variant:"outline",onClick:()=>{h("Application Reminder"),g("This is a friendly reminder to complete your STAR Sponsorship application. Please log in to your portal to continue where you left off."),y("info"),u(!0)},children:[s.jsx(ex,{className:"w-4 h-4 mr-2"}),"Application Reminder"]}),s.jsxs(we,{variant:"outline",onClick:()=>{h("Document Required"),g("We're missing some required documents for your application. Please upload the missing documents to complete your application."),y("warning"),u(!0)},children:[s.jsx($g,{className:"w-4 h-4 mr-2"}),"Missing Documents"]}),s.jsxs(we,{variant:"outline",onClick:()=>{h("Interview Slots Available"),g("New interview slots are now available. Please log in to your portal to schedule your interview."),y("action"),u(!0)},children:[s.jsx(Nt,{className:"w-4 h-4 mr-2"}),"Interview Available"]})]})]}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsx(jt,{children:"Recent Notifications"}
912),s.jsx(qn,{children:"History of sent notifications"})]}),s.jsx(He,{children:a?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading..."}):n.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No notifications sent yet."}):s.jsx("div",{className:"space-y-3",children:n.map(E=>{const k=S(E.type),P=k.icon;return s.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg",children:[s.jsx("div",{className:`p-2 rounded-full bg-muted ${k.color}`,children:s.jsx(P,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("h4",{className:"font-medium",children:E.title}),s.jsx(Je,{variant:"outline",className:"text-xs",children:k.label})]}),s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:E.message}),s.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground",children:[s.jsx(ci,{className:"w-3 h-3"}),s.jsx("span",{children:j(E.user_id)}),s.jsx("span",{children:"•"}),s.jsxs("span",{children:[new Date(E.created_at).toLocaleDateString()," ",new Date(E.created_at).toLocaleTimeString()]})]})]})]},E.id)})})})]}),s.jsx(_a,{open:c,onOpenChange:u,children:s.jsxs(ha,{className:"max-w-lg",children:[s.jsxs($a,{children:[s.jsx(Da,{children:"Compose Notification"}),s.jsx(Bs,{children:"Send a notification to one or all families."})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Recipient"}),s.jsxs(gn,{value:d,onValueChange:f,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select recipient"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"all",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zr,{className:"w-4 h-4"}),"All Families (",e.length,")"]})}),e.map(E=>s.jsx(ot,{value:E.user_id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ci,{className:"w-4 h-4"}),E.full_name||E.email]})},E.user_id))]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Type"}),s.jsxs(gn,{value:v,onValueChange:y,children:[s.jsx(dn,{children:s.jsx(vn,{})}),s.jsx(fn,{children:tE.map(E=>{const k=E.icon;return s.jsx(ot,{value:E.value,children:s.jsxs("div",{className:`flex items-center gap-2 ${E.color}`,children:[s.jsx(k,{className:"w-4 h-4"}),E.label]})},E.value)})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"title",children:"Title"}),s.jsx(xt,{id:"title",value:p,onChange:E=>h(E.target.value),placeholder:"Notification title..."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"message",children:"Message"}),s.jsx(wc,{id:"message",value:m,onChange:E=>g(E.target.value),placeholder:"Enter your message...",rows:4})]})]}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),s.jsxs(we,{onClick:w,disabled:o,children:[o?s.jsx(Xt,{className:"w-4 h-4 animate-spin mr-2"}):s.jsx(OL,{className:"w-4 h-4 mr-2"}),"Send Notification"]})]})]})})]})})},xXe={draft:{label:"Draft",color:"bg-muted text-muted-foreground",icon:En},submitted:{label:"Submitted",color:"bg-blue-100 text-blue-700",icon:Fn},under_review:{label:"Under Review",color:"bg-amber-100 text-amber-700",icon:er},approved:{label:"Approved",color:"bg-green-100 text-green-700",icon:Nt},rejected:{label:"Rejected",color:"bg-red-100 text-red-700",icon:er}},bXe=["2026-2027","2025-2026","2024-2025","2023-2024"],wXe=()=>{const{session:e}=bo(),[t,n]=x.useState([]),[r,a]=x.useState(!0),[i,o]=x.useState(""),[l,c]=x.useState("all"),[u,d]=x.useState(null),[f,p]=x.useState(!1),[h,m]=x.useState([]),g=E=>{try{if("BroadcastChannel"in window){const k=new BroadcastChannel("admin-students");k.postMessage({type:"student.updated",...E,ts:Date.now()}),k.close()}else localStorage.setItem("admin-students",JSON.stringify({type:"student.updated",...E,ts:Date.now()}))}catch(k){console.warn("Failed to broadcast student update",k)}};x.useEffect(()=>{e&&v()},[e]),x.useEffect(()=>{const E=R=>{(R==null?void 0:R.type)==="student.updated"&&v()};let k=null;"BroadcastChannel"in window&&(k=new BroadcastChannel("admin-students"),k.onmessage=R=>E(R.data));const P=R=>{if(R.key==="admin-students"&&R.newValue)try{E(JSON.parse(R.newValue))}catch{}};return window.addEventListener("storage",P),()=>{k&&k.close(),window.removeEventListener("storage",P)}},[]),x.useEffect(()=>{const E=Re.channel("students-changes-family-mgmt").on("postgres_changes",{event:"*",schema:"public",table:"students"},()=>{v()}).subscribe();return()=>{Re.removeChannel(E)}},[]);const v=async()=>{a(!0);try{if(!(e!=null&&e.access_token)){console.error("No admin session found"),tn.error("Please log in again"),a(!1);return}const{data:E,error:k}=await Re.functions.invoke("admin-families");if(k){console.error("Error fetching families:",k),tn.error("Failed to fetch families"),a(!1);return}n(E.families||[])}catch(E){console.error("Error calling admin-families:",E),tn.error("Failed to fetch families")}a(!1)},y=async()=>
912{if(!u)return;p(!0);const{student:E,application:k}=u,P={decision_status:E.decision_status};E.status!==u.originalStatus&&(P.status=E.status);const{error:R}=await Re.from("students").update(P).eq("id",E.id);if(R){tn.error("Failed to update student"),console.error(R),p(!1);return}const{error:C}=await Re.from("applications").update({scholarship_amount:k.scholarship_amount,admin_notes:k.admin_notes}).eq("id",k.id);C?(tn.error("Failed to update application"),console.error(C)):(tn.success("Updated successfully"),g({studentId:E.id,decision_status:E.decision_status}),d(null),v()),p(!1)},b=async(E,k)=>{const{error:P}=await Re.from("profiles").update({applicant_type:k}).eq("user_id",E);P?(tn.error("Failed to update applicant type"),console.error(P)):(tn.success("Applicant type updated"),v())},w=E=>{m(k=>k.includes(E)?k.filter(P=>P!==E):[...k,E])},j=t.filter(E=>{var R;const k=i===""||((R=E.profile.full_name)==null?void 0:R.toLowerCase().includes(i.toLowerCase()))||E.profile.email.toLowerCase().includes(i.toLowerCase())||E.applications.some(C=>C.students.some(I=>{var D,U;return((D=I.first_name)==null?void 0:D.toLowerCase().includes(i.toLowerCase()))||((U=I.last_name)==null?void 0:U.toLowerCase().includes(i.toLowerCase()))})),P=l==="all"||E.applications.some(C=>C.application_year===l);return k&&P}),S=t.reduce((E,k)=>E+k.applications.reduce((P,R)=>P+R.students.length,0),0),A=E=>E==null?"—":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(E);return r?s.jsx(gs,{children:s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Xt,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):s.jsx(gs,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-display font-semibold text-foreground",children:"Family Management"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"View and manage families with submitted applications."})]}),s.jsxs(we,{variant:"outline",onClick:v,children:[s.jsx(of,{className:"w-4 h-4 mr-2"}),"Refresh"]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(lf,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),s.jsx(xt,{placeholder:"Search by family name, email, or student name...",value:i,onChange:E=>o(E.target.value),className:"pl-10"})]}),s.jsxs(gn,{value:l,onValueChange:c,children:[s.jsx(dn,{className:"w-full sm:w-[180px]",children:s.jsx(vn,{placeholder:"Filter by year"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"all",children:"All Years"}),bXe.map(E=>s.jsx(ot,{value:E,children:E},E))]})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-primary/10",children:s.jsx(Zr,{className:"w-6 h-6 text-primary"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:t.length}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Families with Submissions"})]})]})}),s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-blue-100",children:s.jsx(ci,{className:"w-6 h-6 text-blue-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:S}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Students"})]})]})}),s.jsx(Ve,{children:s.jsxs(He,{className:"flex items-center gap-4 p-6",children:[s.jsx("div",{className:"p-3 rounded-full bg-green-100",children:s.jsx(sf,{className:"w-6 h-6 text-green-600"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-2xl font-bold",children:A(t.reduce((E,k)=>E+k.applications.reduce((P,R)=>P+(R.scholarship_amount||0),0),0))}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Scholarships"})]})]})})]}),s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsxs(jt,{children:["Families (",j.length,")"]}
912),s.jsx(qn,{children:"Families with submitted applications. Click to view students."})]}),s.jsx(He,{children:j.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No families with submitted applications found"}):s.jsx("div",{className:"space-y-2",children:j.map(E=>s.jsxs(BN,{open:h.includes(E.profile.user_id),onOpenChange:()=>w(E.profile.user_id),children:[s.jsx(UN,{className:"w-full",children:s.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border hover:bg-muted/50 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(Ho,{className:Ye("w-5 h-5 transition-transform",h.includes(E.profile.user_id)&&"rotate-90")}),s.jsx("div",{className:"p-2 rounded-full bg-primary/10",children:s.jsx(Zr,{className:"w-5 h-5 text-primary"})}),s.jsxs("div",{className:"text-left",children:[s.jsx("h4",{className:"font-medium",children:E.profile.full_name||E.profile.email}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[E.profile.email," • ",E.applications.reduce((k,P)=>k+P.students.length,0)," student",E.applications.reduce((k,P)=>k+P.students.length,0)!==1?"s":""]})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Je,{variant:E.profile.applicant_type==="new"?"secondary":"outline",className:E.profile.applicant_type==="new"?"bg-blue-100 text-blue-700 border-blue-200":"bg-green-100 text-green-700 border-green-200",children:E.profile.applicant_type==="new"?"New Family":"Returning Family"})})]})}),s.jsx(zN,{children:s.jsxs("div",{className:"ml-6 mt-2 p-4 border-l-2 border-primary/20 space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-4 p-3 bg-muted/30 rounded-lg",children:[s.jsx($e,{className:"text-sm font-medium",children:"Family Type:"}),s.jsxs(gn,{value:E.profile.applicant_type||"new",onValueChange:k=>b(E.profile.user_id,k),children:[s.jsx(dn,{className:"w-[180px]",children:s.jsx(vn,{})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"new",children:"New Family"}),s.jsx(ot,{value:"returning",children:"Returning Family"})]})]})]}),Object.entries(E.applicationsByYear).sort(([k],[P])=>P.localeCompare(k)).map(([k,P])=>s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(yi,{className:"w-4 h-4 text-muted-foreground"}),s.jsxs("h5",{className:"font-medium text-sm",children:[k," School Year"]}),s.jsxs(Je,{variant:"outline",className:"text-xs",children:[P.reduce((R,C)=>R+C.students.length,0)," student",P.reduce((R,C)=>R+C.students.length,0)!==1?"s":""]})]}),P.map(R=>{const C=xXe[R.status],I=C.icon;return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-muted/50 rounded",children:[s.jsxs(Je,{className:C.color,children:[s.jsx(I,{className:"w-3 h-3 mr-1"}),C.label]}),R.scholarship_amount&&R.scholarship_amount>0&&s.jsxs(Je,{variant:"outline",className:"bg-green-50 text-green-700 border-green-200",children:[s.jsx(sf,{className:"w-3 h-3 mr-1"}),A(R.scholarship_amount)]})]}),s.jsx("div",{className:"space-y-2 pl-2",children:R.students.length===0?s.jsx("div",{className:"text-sm text-muted-foreground italic p-2",children:"No students added yet"}):R.students.map(D=>s.jsxs("div",{className:"flex items-center justify-between p-3 bg-background border rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 rounded-full bg-muted",children:s.jsx(ci,{className:"w-4 h-4"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("p",{className:"font-medium text-sm",children:[D.first_name||"Unnamed"," ",D.last_name||"Student"]}),s.jsx(Je,{variant:"secondary",className:D.status==="new"?"text-xs bg-amber-100 text-amber-700 border-amber-200":"text-xs bg-slate-100 text-slate-700 border-slate-200",children:D.status==="new"?"New Student":"Returning Student"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[D.grade&&s.jsxs("span",{children:["Grade ",D.grade]}),D.school&&s.jsxs("span",{children:["• ",D.school]}),D.status==="new"&&s.jsxs("span",{className:D.hasTeacherRecommendation?"text-green-600":"text-amber-600",children:["• Teacher Rec: ",D.hasTeacherRecommendation?"✓ Submitted":"Missing"]})]}),D.decision_status&&s.jsx("div",{className:"mt-1",children:s.jsxs(Je,{variant:"outline",className:D.decision_status==="accepted"?"bg-green-50 text-green-700 border-green-200":D.decision_status==="denied"?"bg-red-50 text-red-700 border-red-200":"bg-amber-50 text-amber-700 border-amber-200",children:[D.decision_status==="accepted"&&s.jsx(Nt,{className:"w-3 h-3 mr-1"}),D.decision_status==="denied"&&s.jsx(er,{className:"w-3 h-3 mr-1"}),D.decision_status==="pending"&&s.jsx(Fn,{className:"w-3 h-3 mr-1"}),"Decision: ",D.decision_status.charAt(0).toUpperCase()+D.decision_status.slice(1)]})})]})]}),s.jsx(we,{variant:"outline",size:"sm",onClick:U=>{U.stopPropagation(),d({student:D,application:R,originalStatus:D.status})},children:s.jsx(foe,{className:"w-4 h-4"})})]},D.id))})]},R.id)})]},k)),Object.keys(E.applicationsByYear).length>1&&s.jsx("div",{className:"pt-2 border-t",children:s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(J
912E,{className:"w-4 h-4"}),s.jsxs("span",{children:["Application history spans ",Object.keys(E.applicationsByYear).length," school years"]})]})})]})})]},E.profile.user_id))})})]}),s.jsx(_a,{open:!!u,onOpenChange:()=>d(null),children:s.jsxs(ha,{className:"max-w-lg",children:[s.jsxs($a,{children:[s.jsx(Da,{children:"Edit Student"}),s.jsx(Bs,{children:"Update student status, decision, and application details."})]}),u&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg",children:[s.jsxs("p",{className:"font-medium",children:[u.student.first_name," ",u.student.last_name]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[u.student.grade&&`Grade ${u.student.grade}`,u.student.school&&` • ${u.student.school}`]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Student Status"}),s.jsxs(gn,{value:u.student.status||"new",onValueChange:E=>d({...u,student:{...u.student,status:E}}),children:[s.jsx(dn,{children:s.jsx(vn,{})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"returning",children:"Returning Student"}),s.jsx(ot,{value:"new",children:"New Student"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Decision Status"}),s.jsxs(gn,{value:u.student.decision_status||"pending",onValueChange:E=>d({...u,student:{...u.student,decision_status:E}}),children:[s.jsx(dn,{children:s.jsx(vn,{})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"pending",children:"Pending"}),s.jsx(ot,{value:"accepted",children:"Accepted"}),s.jsx(ot,{value:"denied",children:"Denied"})]})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Scholarship Amount ($)"}),s.jsx(xt,{type:"number",placeholder:"0.00",value:u.application.scholarship_amount||"",onChange:E=>d({...u,application:{...u.application,scholarship_amount:E.target.value?parseFloat(E.target.value):null}})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Admin Notes"}),s.jsx(wc,{placeholder:"Add any notes about this student/application...",value:u.application.admin_notes||"",onChange:E=>d({...u,application:{...u.application,admin_notes:E.target.value}}),rows:3})]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsxs("p",{children:["Application Created: ",new Date(u.application.created_at).toLocaleDateString()]}),u.application.submitted_at&&s.jsxs("p",{children:["Submitted: ",new Date(u.application.submitted_at).toLocaleDateString()]})]})]}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>d(null),children:"Cancel"}),s.jsxs(we,{onClick:y,disabled:f,children:[f?s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(z_,{className:"w-4 h-4 mr-2"}),"Save Changes"]})]})]})})]})})},$ne=({status:e,waitlistPosition:t,className:n})=>{const r=V7[e||""]??V7[""],a=e?(r==null?void 0:r.label)??xee(e):r.label;return s.jsxs(Je,{variant:"outline",className:`whitespace-nowrap font-medium ${r.className} ${n||""}`,children:[a,e==="waitlist"&&t!=null?` (#${t})`:""]})},_Xe=[{value:"withdrew",label:"Withdrew from school"},{value:"financial",label:"Left due to financial issues"},{value:"transferred",label:"Transferred to a non-partner school"},{value:"other",label:"Other"}],jXe=[{value:"latino",label:"Latino"},{value:"african_american",label:"African American"},{value:"white",label:"White"},{value:"asian",label:"Asian"}],SXe=()=>{const{session:e}=bo(),t=Ab(),[n]=zO(),[r,a]=x.useState(""),[i,o]=x.useState(()=>n.get("filter")||"all"),[l,c]=x.useState(null),[u,d]=x.useState("asc"),[f,p]=x.useState(null),[h,m]=x.useState(""),[g,v]=x.useState(""),[y,b]=x.useState(""),w=()=>"https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-applications",{data:j,isLoading:S}=th({queryKey:["all-students",e==null?void 0:e.access_token],queryFn:async()=>{if(!(e!=null&&e.access_token))return[];const V=await fetch(w(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.access_token}`}});if(!V.ok)throw new Error("Failed to fetch students data");const O=await V.json();return(O.students||[]).map(B=>{const G=(O.applications||[]).find(te=>te.id===B.application_id);return{...B,race:B.race||null,gender:B.gender||null,application:G?{student_enrollment_status:G.student_enrollment_status,student_inactivation_reason:G.student_inactivation_reason,student_inactivation_date:G.student_inactivation_date,application_year:G.application_year,admin_classification:G.admin_classification??null}:null}}).sort((B,G)=>B.last_name.localeCompare(G.last_name))},enabled:!!(e!=null&&e.access_token)}),A=Xue({mutationFn:async V=>{if(!(await fetch(w(),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e==null?void 0:e.access_token}`},body:JSON.stringify({studentId:V.studentId,studentUpdates:{race:V.student_race}})})).ok)throw new Error("Failed to update student race");const{error:M}=await Re.from("applications").update({student_enrollment_status:V.student_enrollment_status,student_inactivation_reason:V.student_inactivation_reason,student_inactivation_date:V.student_inactivation_date}).eq("id",V.applicationId);if(M)throw M},onSuccess:()=>{t.invalidateQueries({queryKey:["all-students",e==null?void 0:e.access_token]}),tn.success("Student updated successfully"),p(null),E()},onError:V=>{console.error("Error updating student:",V),tn.error("Failed to update student")}}),E=()=>{m(""),v(""),b("")},k=V=>{var O,M;p(V),m(((O=V.application)==null?void 0:O.student_enrollment_status)||"active"),v(((M=V.application)==null?void 0:M.student_inactivation_reason)||""),b(V.race||"")},P=()=>{if(!f)return;const V={studentId:f.id,applicationId:f.application_id,student_enrollment_status:h,student_race:y||null};h==="inactive"?(V.student_inactivation_reason=g,V.student_inactivation_date=new Date().toISOString()):(V.student_inactivation_reason=null,V.student_inactivation_date=null),A.mutate(V)},R=V=>{l===V?d(O=>O==="asc"?"desc":"asc"):(c(V),d("asc"))},C=V=>l!==V?s.jsx(Vse,{className:"h-3 w-3 ml-1 inline"}):u==="asc"?s.jsx(Hse,{className:"h-3 w-3 ml-1 inline"}):s.jsx(qse,{className:"h-3 w-3 ml-1 inline"}),I=V=>{var O;return V.tefa_status?V.tefa_status:((O=V.application)==null?void 0:O.admin_classification)==="tefa_recipient"?"received_funds":null},D=V=>{var M;return(V.status==="inactive"?"inactive":((M=V.application)==null?void 0:M.student_enrollment_status)||"active")==="active"&&I(V)!=="received_funds"},U=j==null?void 0:j.filter(V=>{var te;const O=r===""||`${V.first_name} ${V.last_name}`.toLowerCase().includes(r.toLowerCase())||((te=V.school)==null?void 0:te.toLowerCase().includes(r.toLowerCase())),M=V.status||"new",B=V.decision_status||"pending";let G=!1;switch(i){case"all":G=!0;break;case"returning":G=M==="returning";break;case"active":G=D(V);break;case"new":G=M==="new";break;case"denied":G=B==="denied";break;case"tefa_received":G=I(V)==="received_funds";break;case"tefa_waitlist":G=I(V)==="waitlist";break;
912case"tefa_pending":G=I(V)==="applied_pending";break;case"tefa_did_not_apply":G=I(V)==="did_not_apply";break;default:G=!0}return O&&G}),q=U?[...U].sort((V,O)=>{if(!l)return V.last_name.localeCompare(O.last_name);const M=u==="asc"?1:-1;switch(l){case"first_name":return M*V.first_name.localeCompare(O.first_name);case"last_name":return M*V.last_name.localeCompare(O.last_name);case"school":return M*(V.school||"").localeCompare(O.school||"");default:return 0}}):[],Z=(j==null?void 0:j.length)||0,H=(j==null?void 0:j.filter(V=>V.status==="returning").length)||0,$=(j==null?void 0:j.filter(D).length)||0,W=(j==null?void 0:j.filter(V=>V.status==="new").length)||0,ee=(j==null?void 0:j.filter(V=>I(V)==="received_funds").length)||0;return s.jsx(gs,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Students"}),s.jsx("p",{className:"text-muted-foreground",children:"View and manage all students in the STAR Sponsorship Program"})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[s.jsx(Ve,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>o("all"),children:s.jsxs(He,{className:"p-4 flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-primary/10 rounded-full",children:s.jsx(Zr,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xl font-bold",children:Z}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Total"})]})]})}),s.jsx(Ve,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>o("returning"),children:s.jsxs(He,{className:"p-4 flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-primary/10 rounded-full",children:s.jsx(of,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xl font-bold",children:H}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Returning"})]})]})}),s.jsx(Ve,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>o("active"),children:s.jsxs(He,{className:"p-4 flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-green-500/10 rounded-full",children:s.jsx(q_,{className:"h-5 w-5 text-green-600"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xl font-bold",children:$}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Active STAR Students"})]})]})}),s.jsx(Ve,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>o("tefa_received"),children:s.jsxs(He,{className:"p-4 flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-amber-500/10 rounded-full",children:s.jsx(Gse,{className:"h-5 w-5 text-amber-600"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xl font-bold",children:ee}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"TEFA Recipients"})]})]})}),s.jsx(Ve,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>o("new"),children:s.jsxs(He,{className:"p-4 flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-blue-500/10 rounded-full",children:s.jsx(Qh,{className:"h-5 w-5 text-blue-600"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xl font-bold",children:W}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"New Student"})]})]})})]}),s.jsx(Ve,{children:s.jsx(He,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(lf,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(xt,{placeholder:"Search by name or school...",value:r,onChange:V=>a(V.target.value),className:"pl-10"})]}),s.jsxs(gn,{value:i,onValueChange:o,children:[s.jsx(dn,{className:"w-full sm:w-[180px]",children:s.jsx(vn,{placeholder:"Filter by status"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"all",children:"All Students"}),s.jsx(ot,{value:"returning",children:"Returning"}),s.jsx(ot,{value:"active",children:"Active STAR Students"}),s.jsx(ot,{value:"new",children:"New Student"}),s.jsx(ot,{value:"denied",children:"Denied"}),s.jsx(ot,{value:"tefa_received",children:"TEFA Recipients"}),s.jsx(ot,{value:"tefa_waitlist",children:"TEFA Waitlist"}),s.jsx(ot,{value:"tefa_pending",children:"TEFA Decision Pending"}),s.jsx(ot,{value:"tefa_did_not_apply",children:"Did Not Apply"})]})]})]})})}),s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsx(jt,{children:"Student Directory"})}),s.jsx(He,{children:S?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading students..."}):q.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No students found matching your criteria"}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Qd,{children:[s.jsx(yp,{children:s.jsxs(us,{children:[s.jsxs(Xn,{className:"cursor-pointer select-none",onClick:()=>R("first_name"),children:["First Name ",C("first_name")]}),s.jsxs(Xn,{className:"cursor-pointer select-none",onClick:()=>R("last_name"),children:["Last Name ",C("last_name")]}),s.jsxs(Xn,{className:"cursor-pointer select-none",onClick:()=>R("school"),children:["School ",C("school")]}),s.jsx(Xn,{children:"2026-2027 Grade"}),s.jsx(Xn,{children:"TEFA Status"}),s.jsx(Xn,{children:"Actions"})]})}),s.jsx(ef,{children:q.map(V=>s.jsxs(us,{children:[s.jsx(On,{className:"font-medium",children:V.first_name}),s.jsx(On,{className:"font-medium",children:V.last_name}),s.jsx(On,{className:"max-w-[200px] truncate",children:V.school||"N/A"}),s.jsx(On,{children:V.grade||"N/A"}),s.jsx(On,{children:s.jsx($ne,{status:I(V),waitlistPosition:V.tefa_waitlist_position})}),s.jsx(On,{children:s.jsx(we,{variant:"outline",size:"sm",onClick:()=>k(V),children:"Edit"})})]},V.id))})]})})})]}),s.jsx(_a,{open:!!f,onOpenChange:V=>
912!V&&p(null),children:s.jsxs(ha,{children:[s.jsx($a,{children:s.jsxs(Da,{children:["Edit Student: ",f==null?void 0:f.first_name," ",f==null?void 0:f.last_name]})}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Race/Ethnicity"}),s.jsxs(gn,{value:y,onValueChange:b,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select race/ethnicity"})}),s.jsx(fn,{children:jXe.map(V=>s.jsx(ot,{value:V.value,children:V.label},V.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Enrollment Status"}),s.jsxs(gn,{value:h,onValueChange:m,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select status"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"active",children:"Active"}),s.jsx(ot,{value:"inactive",children:"Inactive"})]})]})]}),h==="inactive"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Reason for Inactivation"}),s.jsxs(gn,{value:g,onValueChange:v,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select reason"})}),s.jsx(fn,{children:_Xe.map(V=>s.jsx(ot,{value:V.value,children:V.label},V.value))})]})]})]}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>p(null),children:"Cancel"}),s.jsx(we,{onClick:P,disabled:A.isPending||h==="inactive"&&!g,children:A.isPending?"Saving...":"Save Changes"})]})]})})]})})},NXe=()=>{const{admin:e,session:t}=bo(),{toast:n}=_c(),[r,a]=x.useState([]),[i,o]=x.useState([]),[l,c]=x.useState(!0),[u,d]=x.useState(!1),[f,p]=x.useState(!1),[h,m]=x.useState({username:"",name:"",password:""}),[g,v]=x.useState(!1),y=(e==null?void 0:e.role)==="super_admin";x.useEffect(()=>{y&&t?(b(),w()):c(!1)},[y,t]);const b=async()=>{try{const{data:k,error:P}=await Re.functions.invoke("admin-auth",{body:{action:"list-admins"}});if(P||k!=null&&k.error)throw new Error((k==null?void 0:k.error)||"Failed to fetch admins");a(k.admins||[])}catch(k){console.error("Error fetching admins:",k),n({title:"Error",description:"Failed to fetch admin accounts",variant:"destructive"})}},w=async()=>{try{const{data:k,error:P}=await Re.functions.invoke("admin-auth",{body:{action:"get-activity-logs"}});if(P||k!=null&&k.error)throw new Error((k==null?void 0:k.error)||"Failed to fetch activity logs");o(k.logs||[])}catch(k){console.error("Error fetching activity logs:",k)}finally{c(!1)}},j=async()=>{if(!h.username||!h.name||!h.password){n({title:"Error",description:"All fields are required",variant:"destructive"});return}if(h.password.length<8){n({title:"Error",description:"Password must be at least 8 characters",variant:"destructive"});return}p(!0);try{const{data:k,error:P}=await Re.functions.invoke("admin-auth",{body:{action:"create-admin",username:h.username,name:h.name,password:h.password}});if(P||k!=null&&k.error)throw new Error((k==null?void 0:k.error)||"Failed to create admin");n({title:"Success",description:"Admin account created successfully"}),d(!1),m({username:"",name:"",password:""}),b(),w()}catch(k){n({title:"Error",description:k.message||"Failed to create admin",variant:"destructive"})}finally{p(!1)}},S=async k=>{try{const{data:P,error:R}=await Re.functions.invoke("admin-auth",{body:{action:"toggle-admin-status",adminId:k}});if(R||P!=null&&P.error)throw new Error((P==null?void 0:P.error)||"Failed to update admin status");n({title:"Success",description:`Admin ${P.is_active?"activated":"deactivated"} successfully`}),b(),w()}catch(P){n({title:"Error",description:P.message||"Failed to update admin status",variant:"destructive"})}},A=k=>{switch(k){case"login":return s.jsx(ooe,{className:"w-4 h-4 text-green-500"});case"logout":return s.jsx(Uh,{className:"w-4 h-4 text-muted-foreground"});case"password_changed":return s.jsx(aoe,{className:"w-4 h-4 text-amber-500"});case"admin_created":return s.jsx(Qh,{className:"w-4 h-4 text-blue-500"});case"admin_activated":return s.jsx(Nt,{className:"w-4 h-4 text-green-500"});case"admin_deactivated":return s.jsx(Pa,{className:"w-4 h-4 text-destructive"});default:return s.jsx(PL,{className:"w-4 h-4 text-muted-foreground"})}},E=k=>{switch(k){case"login":return"Logged in";case"logout":return"Logged out";case"password_changed":return"Changed password";case"admin_created":return"Created admin account";case"admin_activated":return"Activated admin account";case"admin_deactivated":return"Deactivated admin account";default:return k.replace(/_/g," ")}};return y?s.jsxs(gs,{children:[s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[s.jsx(poe,{className:"w-7 h-7"}),"Admin Settings"]}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage admin accounts and view activity logs"})]}),s.jsxs(we,{onClick:()=>d(!0),className:"gap-2",children:[s.jsx(Qh,{className:"w-4 h-4"}),"Add Admin"]})]}),l?s.jsx("div",{className:"flex justify-center py-12",children:s.jsx(Xt,{className:"w-8 h-8 animate-spin text-muted-foreground"})}):s.jsxs($R,{defaultValue:"admins",className:"space-y-4",children:[s.jsxs(DR,{children:[s.jsxs(Qx,{value:"admins",className:"gap-2",children:[s.jsx(Zr,{className:"w-4 h-4"}),"Admin Accounts"]}),s.jsxs(Qx,{value:"activity",className:"gap-2",children:[s.jsx(PL,{className:"w-4 h-4"}
912),"Activity Log"]})]}),s.jsx(pv,{value:"admins",children:s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsx(jt,{children:"Admin Accounts"}),s.jsx(qn,{children:"Manage all administrator accounts and their access"})]}),s.jsx(He,{children:s.jsxs(Qd,{children:[s.jsx(yp,{children:s.jsxs(us,{children:[s.jsx(Xn,{children:"Name"}),s.jsx(Xn,{children:"Username"}),s.jsx(Xn,{children:"Role"}),s.jsx(Xn,{children:"Status"}),s.jsx(Xn,{children:"Last Login"}),s.jsx(Xn,{children:"Created"}),s.jsx(Xn,{className:"text-right",children:"Actions"})]})}),s.jsx(ef,{children:r.map(k=>s.jsxs(us,{children:[s.jsx(On,{className:"font-medium",children:k.name||"-"}),s.jsx(On,{children:k.username}),s.jsx(On,{children:s.jsxs(Je,{variant:k.role==="super_admin"?"default":"secondary",className:"gap-1",children:[k.role==="super_admin"?s.jsx(QE,{className:"w-3 h-3"}):s.jsx(Cd,{className:"w-3 h-3"}),k.role==="super_admin"?"Super Admin":"Admin"]})}),s.jsx(On,{children:s.jsx(Je,{variant:k.is_active?"outline":"destructive",className:"gap-1",children:k.is_active?s.jsxs(s.Fragment,{children:[s.jsx(Nt,{className:"w-3 h-3"}),"Active"]}):s.jsxs(s.Fragment,{children:[s.jsx(Pa,{className:"w-3 h-3"}),"Inactive"]})})}),s.jsx(On,{children:k.last_login_at?s.jsxs("span",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[s.jsx(Fn,{className:"w-3 h-3"}),Dn(new Date(k.last_login_at),"MMM d, yyyy h:mm a")]}):s.jsx("span",{className:"text-muted-foreground",children:"Never"})}),s.jsx(On,{className:"text-sm text-muted-foreground",children:Dn(new Date(k.created_at),"MMM d, yyyy")}),s.jsx(On,{className:"text-right",children:k.id!==(e==null?void 0:e.id)&&k.role!=="super_admin"&&s.jsx(we,{variant:k.is_active?"outline":"default",size:"sm",onClick:()=>S(k.id),children:k.is_active?"Deactivate":"Activate"})})]},k.id))})]})})]})}),s.jsx(pv,{value:"activity",children:s.jsxs(Ve,{children:[s.jsxs(_t,{children:[s.jsx(jt,{children:"Activity Log"}),s.jsx(qn,{children:"Recent admin activity across the system"})]}),s.jsx(He,{children:s.jsx("div",{className:"space-y-3",children:i.length===0?s.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No activity recorded yet"}):i.map(k=>{var P,R,C;return s.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-muted/50 hover:bg-muted transition-colors",children:[s.jsx("div",{className:"mt-0.5",children:A(k.action_type)}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:((P=k.admin_accounts)==null?void 0:P.name)||((R=k.admin_accounts)==null?void 0:R.username)})," ",E(k.action_type),((C=k.details)==null?void 0:C.username)&&s.jsxs("span",{className:"text-muted-foreground",children:[" ","(",k.details.username,")"]})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:Dn(new Date(k.created_at),"MMM d, yyyy 'at' h:mm a")})]})]},k.id)})})})]})})]})]}),s.jsx(_a,{open:u,onOpenChange:d,children:s.jsxs(ha,{children:[s.jsxs($a,{children:[s.jsx(Da,{children:"Add New Admin"}),s.jsx(Bs,{children:"Create a new administrator account. They will be able to access the admin portal."})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"admin-name",children:"Full Name"}),s.jsx(xt,{id:"admin-name",value:h.name,onChange:k=>m({...h,name:k.target.value}),placeholder:"Enter full name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"admin-username",children:"Username"}),s.jsx(xt,{id:"admin-username",value:h.username,onChange:k=>m({...h,username:k.target.value.toLowerCase().replace(/\s/g,"")}),placeholder:"Enter username"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"admin-password",children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(xt,{id:"admin-password",type:g?"text":"password",value:h.password,onChange:k=>m({...h,password:k.target.value}),placeholder:"Enter password (min 8 characters)"}),s.jsx(we,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>v(!g),children:g?s.jsx(nx,{className:"w-4 h-4"}):s.jsx($s,{className:"w-4 h-4"})})]})]})]}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),s.jsx(we,{onClick:j,disabled:f,children:f?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):"Create Admin"})]})]})})]}):s.jsx(gs,{children:s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[s.jsx(Cd,{className:"w-16 h-16 text-muted-foreground mb-4"}),s.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Access Restricted"}),s.jsx("p",{className:"text-muted-foreground max-w-md",children:"Admin management is only available to Super Admins. Contact your system administrator if you need access."})]})})},e0=20,AXe=()=>{var O,M;
912const[e,t]=x.useState([]),[n,r]=x.useState(!0),[a,i]=x.useState(!1),[o,l]=x.useState(""),[c,u]=x.useState("all"),[d,f]=x.useState(""),[p,h]=x.useState(""),[m,g]=x.useState(0),[v,y]=x.useState(0),[b,w]=x.useState(null),[j,S]=x.useState(!1),[A,E]=x.useState(!1),[k,P]=x.useState("manual"),[R,C]=x.useState(!1),{toast:I}=_c(),[D,U]=x.useState({total:0,optedIn:0,optedOut:0}),q=async()=>{r(!0);try{let B=Re.from("sms_consent").select("*",{count:"exact"});if(o){const se=o.replace(/\D/g,"");se.length>0&&(B=B.ilike("phone_number",`%${se}%`))}c==="opted_in"?B=B.eq("opted_in",!0):c==="opted_out"&&(B=B.eq("opted_in",!1)),d&&(B=B.gte("consent_timestamp",`${d}T00:00:00Z`)),p&&(B=B.lte("consent_timestamp",`${p}T23:59:59Z`)),B=B.order("consent_timestamp",{ascending:!1}).range(m*e0,(m+1)*e0-1);const{data:G,error:te,count:ne}=await B;if(te)throw te;const ce=[...new Set((G||[]).map(se=>se.user_id))];let oe={};if(ce.length>0){const{data:se}=await Re.from("profiles").select("user_id, full_name, email").in("user_id",ce);se&&(oe=se.reduce((Q,ye)=>(Q[ye.user_id]={full_name:ye.full_name,email:ye.email},Q),{}))}const X=(G||[]).map(se=>({...se,profiles:oe[se.user_id]||{full_name:null,email:""}}));t(X),y(ne||0)}catch(B){console.error("Error fetching SMS consent records:",B),I({title:"Error",description:"Failed to load SMS consent records",variant:"destructive"})}finally{r(!1)}},Z=async()=>{try{const{count:B}=await Re.from("sms_consent").select("*",{count:"exact",head:!0}),{count:G}=await Re.from("sms_consent").select("*",{count:"exact",head:!0}).eq("opted_in",!0),{count:te}=await Re.from("sms_consent").select("*",{count:"exact",head:!0}).eq("opted_in",!1);U({total:B||0,optedIn:G||0,optedOut:te||0})}catch(B){console.error("Error fetching stats:",B)}};x.useEffect(()=>{q(),Z()},[m,c]);const H=()=>{g(0),q()},$=async()=>{i(!0);try{let B=Re.from("sms_consent").select("*");if(o){const ie=o.replace(/\D/g,"");ie.length>0&&(B=B.ilike("phone_number",`%${ie}%`))}c==="opted_in"?B=B.eq("opted_in",!0):c==="opted_out"&&(B=B.eq("opted_in",!1)),d&&(B=B.gte("consent_timestamp",`${d}T00:00:00Z`)),p&&(B=B.lte("consent_timestamp",`${p}T23:59:59Z`)),B=B.order("consent_timestamp",{ascending:!1});const{data:G,error:te}=await B;if(te)throw te;const ne=[...new Set((G||[]).map(ie=>ie.user_id))];let ce={};if(ne.length>0){const{data:ie}=await Re.from("profiles").select("user_id, full_name, email").in("user_id",ne);ie&&(ce=ie.reduce((F,me)=>(F[me.user_id]={full_name:me.full_name,email:me.email},F),{}))}const oe=["Phone Number","User Name","Email","Opt-In Status","Consent Type","Consent Method","Consent Timestamp","Source URL","Consent Source","Consent Language","IP Address","Opt-Out Timestamp","Opt-Out Method","User ID"],X=(G||[]).map(ie=>{const F=ce[ie.user_id];return[ie.phone_number,(F==null?void 0:F.full_name)||"",(F==null?void 0:F.email)||"",ie.opted_in?"Opted In":"Opted Out",ie.consent_type||"",ie.consent_method||"",ie.consent_timestamp?Dn(new Date(ie.consent_timestamp),"yyyy-MM-dd HH:mm:ss zzz"):"",ie.source_url||"",ie.consent_source||"",`"${(ie.consent_language||"").replace(/"/g,'""')}"`,ie.ip_address||"",ie.opt_out_timestamp?Dn(new Date(ie.opt_out_timestamp),"yyyy-MM-dd HH:mm:ss zzz"):"",ie.opt_out_method||"",ie.user_id]}),se=oe.join(",")+`
913`+X.map(ie=>ie.map(F=>`"${F}"`).join(",")).join(`
914`),Q=new Blob([se],{type:"text/csv;charset=utf-8;"}),ye=document.createElement("a");ye.href=URL.createObjectURL(Q),ye.download=`sms_consent_audit_${Dn(new Date,"yyyy-MM-dd_HHmmss")}.csv`,ye.click(),I({title:"Export Complete",description:`Exported ${(G==null?void 0:G.length)||0} consent records`})}catch(B){console.error("Error exporting CSV:",B),I({title:"Export Failed",description:B.message||"Failed to export records",variant:"destructive"})}finally{i(!1)}},W=async()=>{if(b){C(!0);try{const{error:B}=await Re.from("sms_consent").update({opted_in:!1,opt_out_timestamp:new Date().toISOString(),opt_out_method:k,revoked_at:new Date().toISOString()}).eq("id",b.id);if(B)throw B;I({title:"Opt-Out Recorded",description:"User has been opted out of SMS communications"}),E(!1),w(null),q(),Z()}catch(B){console.error("Error recording opt-out:",B),I({title:"Error",description:B.message||"Failed to record opt-out",variant:"destructive"})}finally{C(!1)}}},ee=B=>{if(B.startsWith("+1")&&B.length===12){const G=B.slice(2);return`(${G.slice(0,3)}) ${G.slice(3,6)}-${G.slice(6)}`}return B},V=Math.ceil(v/e0);return s.jsx(gs,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"SMS Consent Records"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage SMS consent for TCPA/carrier compliance"})]}),s.jsxs(we,{onClick:$,disabled:a,className:"gap-2",children:[a?s.jsx(Xt,{className:"w-4 h-4 animate-spin"}):s.jsx(Lg,{className:"w-4 h-4"}),"Export CSV"]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[s.jsx(Ve,{children:s.jsx(He,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Records"}),s.jsx("p",{className:"text-2xl font-bold",children:D.total})]}),s.jsx(rx,{className:"w-8 h-8 text-muted-foreground"})]})})}),s.jsx(Ve,{children:s.jsx(He,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Opted In"}),s.jsx("p",{className:"text-2xl font-bold text-green-600",children:D.optedIn})]}),s.jsx(Nt,{className:"w-8 h-8 text-green-600"})]})})}),s.jsx(Ve,{children:s.jsx(He,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Opted Out"}),s.jsx("p",{className:"text-2xl font-bold text-red-600",children:D.optedOut})]}),s.jsx(Pa,{className:"w-8 h-8 text-red-600"})]})})})]}),s.jsxs(Ve,{children:[s.jsx(_t,{children:s.jsx(jt,{className:"text-lg",children:"Search & Filter"})}),s.jsxs(He,{children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"phone-search",children:"Phone Number"}),s.jsxs("div",{className:"relative",children:[s.jsx(lf,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),s.jsx(xt,{id:"phone-search",placeholder:"Search by phone...",value:o,onChange:B=>l(B.target.value),className:"pl-10"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"status-filter",children:"Status"}),s.jsxs(gn,{value:c,onValueChange:u,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"All statuses"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"all",children:"All"}),s.jsx(ot,{value:"opted_in",children:"Opted In"}),s.jsx(ot,{value:"opted_out",children:"Opted Out"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"date-from",children:"From Date"}),s.jsx(xt,{id:"date-from",type:"date",value:d,onChange:B=>f(B.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"date-to",children:"To Date"}),s.jsx(xt,{id:"date-to",type:"date",value:p,onChange:B=>h(B.target.value)})]})]}),s.jsx("div",{className:"mt-4",children:s.jsxs(we,{onClick:H,className:"gap-2",children:[s.jsx(lf,{className:"w-4 h-4"}),"Search"]})})]})]}),s.jsx(Ve,{children:s.jsx(He,{className:"p-0",children:n?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Xt,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[s.jsx(rx,{className:"w-12 h-12 mb-4 opacity-50"}
914),s.jsx("p",{children:"No consent records found"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Qd,{children:[s.jsx(yp,{children:s.jsxs(us,{children:[s.jsx(Xn,{children:"Phone Number"}),s.jsx(Xn,{children:"User"}),s.jsx(Xn,{children:"Status"}),s.jsx(Xn,{children:"Consent Date"}),s.jsx(Xn,{children:"Source"}),s.jsx(Xn,{className:"text-right",children:"Actions"})]})}),s.jsx(ef,{children:e.map(B=>{var G,te;return s.jsxs(us,{children:[s.jsx(On,{className:"font-mono",children:ee(B.phone_number)}),s.jsx(On,{children:s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:((G=B.profiles)==null?void 0:G.full_name)||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:(te=B.profiles)==null?void 0:te.email})]})}),s.jsx(On,{children:B.opted_in?s.jsxs(Je,{className:"bg-green-100 text-green-800 hover:bg-green-100",children:[s.jsx(Nt,{className:"w-3 h-3 mr-1"}),"Opted In"]}):s.jsxs(Je,{variant:"destructive",children:[s.jsx(Pa,{className:"w-3 h-3 mr-1"}),"Opted Out"]})}),s.jsx(On,{children:B.consent_timestamp?Dn(new Date(B.consent_timestamp),"MMM d, yyyy h:mm a"):"-"}),s.jsx(On,{children:s.jsx(Je,{variant:"outline",children:B.consent_source})}),s.jsx(On,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(we,{variant:"ghost",size:"sm",onClick:()=>{w(B),S(!0)},children:s.jsx($s,{className:"w-4 h-4"})}),B.opted_in&&s.jsx(we,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>{w(B),E(!0)},children:s.jsx($g,{className:"w-4 h-4"})})]})})]},B.id)})})]})}),s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing ",m*e0+1," -"," ",Math.min((m+1)*e0,v)," of ",v]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(we,{variant:"outline",size:"sm",onClick:()=>g(m-1),disabled:m===0,children:s.jsx(Sb,{className:"w-4 h-4"})}),s.jsxs("span",{className:"text-sm",children:["Page ",m+1," of ",V]}),s.jsx(we,{variant:"outline",size:"sm",onClick:()=>g(m+1),disabled:m>=V-1,children:s.jsx(Ho,{className:"w-4 h-4"})})]})]})]})})}),s.jsx(_a,{open:j,onOpenChange:S,children:s.jsxs(ha,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsxs($a,{children:[s.jsx(Da,{children:"Consent Record Details"}),s.jsx(Bs,{children:"Full audit trail for compliance review"})]}),b&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Phone Number"}),s.jsx("p",{className:"font-mono",children:ee(b.phone_number)})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"User ID"}),s.jsx("p",{className:"font-mono text-xs",children:b.user_id})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"User Name"}),s.jsx("p",{children:((O=b.profiles)==null?void 0:O.full_name)||"Unknown"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Email"}),s.jsx("p",{children:(M=b.profiles)==null?void 0:M.email})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Status"}),s.jsx("p",{children:b.opted_in?s.jsx(Je,{className:"bg-green-100 text-green-800",children:"Opted In"}):s.jsx(Je,{variant:"destructive",children:"Opted Out"})})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Consent Type"}),s.jsx("p",{children:b.consent_type||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Consent Method"}),s.jsx("p",{children:b.consent_method||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Consent Source"}),s.jsx("p",{children:b.consent_source||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Consent Timestamp"}),s.jsx("p",{children:b.consent_timestamp?Dn(new Date(b.consent_timestamp),"PPpp"):"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"IP Address"}),s.jsx("p",{className:"font-mono",children:b.ip_address||"Not captured"})]})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Source URL"}),s.jsx("p",{className:"text-sm break-all",children:b.source_url||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Consent Language"}),s.jsx("p",{className:"text-sm p-3 bg-muted rounded-lg",children:b.consent_language||"-"})]}),!b.opted_in&&s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("h4",{className:"font-medium mb-2",children:"Opt-Out Information"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Opt-Out Timestamp"}),s.jsx("p",{children:b.opt_out_timestamp?Dn(new Date(b.opt_out_timestamp),"PPpp"):"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-muted-foreground",children:"Opt-Out Method"}),s.jsx("p",{children:b.opt_out_method||"-"})]})]})]})]})]})}
914),s.jsx(_a,{open:A,onOpenChange:E,children:s.jsxs(ha,{children:[s.jsxs($a,{children:[s.jsx(Da,{children:"Record Opt-Out"}),s.jsxs(Bs,{children:["Record an opt-out for"," ",b&&ee(b.phone_number),". This will prevent future SMS messages."]})]}),s.jsx("div",{className:"space-y-4 py-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{htmlFor:"opt-out-method",children:"Opt-Out Method"}),s.jsxs(gn,{value:k,onValueChange:P,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select method"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"sms_stop",children:"SMS STOP Keyword"}),s.jsx(ot,{value:"phone_request",children:"Phone Request"}),s.jsx(ot,{value:"email_request",children:"Email Request"}),s.jsx(ot,{value:"in_person",children:"In-Person Request"}),s.jsx(ot,{value:"manual",children:"Manual (Admin)"})]})]})]})}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>E(!1),children:"Cancel"}),s.jsxs(we,{variant:"destructive",onClick:W,disabled:R,children:[R?s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}):null,"Record Opt-Out"]})]})]})})]})})},k9=e=>{const[t,n]=e.split(":"),r=parseInt(t,10),a=r>=12?"PM":"AM";return`${r%12||12}:${n} ${a}`};function kXe({applicationId:e,hasActiveBooking:t,onBooked:n}){const{session:r}=bo(),[a,i]=x.useState(!1),[o,l]=x.useState([]),[c,u]=x.useState(!1),[d,f]=x.useState(""),[p,h]=x.useState(!1),[m,g]=x.useState("all"),[v,y]=x.useState(""),b=Os(new Date),w=async()=>{u(!0);const{data:A,error:E}=await Re.from("interview_slots").select("id, slot_date, start_time, end_time, is_booked").eq("is_booked",!1).order("slot_date",{ascending:!0}).order("start_time",{ascending:!0});if(E)tn.error("Failed to load available slots"),l([]);
914else{const k=(A||[]).filter(P=>!Vh(xr(P.slot_date),b));l(k)}u(!1)};x.useEffect(()=>{a&&(f(""),w())},[a]);const j=o.filter(A=>{const E=Os(xr(A.slot_date));return m==="today"?xj(E,b):m==="7"?!hu(E,Ea(b,7)):m==="30"?!hu(E,Ea(b,30)):m==="date"&&v?xj(E,Os(xr(v))):!0}),S=async()=>{if(!(r!=null&&r.access_token)||!d){tn.error("Pick an available slot.");return}h(!0);try{const E=await fetch("https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-interviews",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r.access_token}`},body:JSON.stringify({action:"book-for-family",applicationId:e,slotId:d})}),k=await E.json();if(!E.ok)throw new Error(k.error||"Failed to schedule");tn.success("Interview scheduled for this family."),i(!1),n==null||n()}catch(A){tn.error(A instanceof Error?A.message:"Could not schedule")}h(!1)};return s.jsxs(s.Fragment,{children:[s.jsxs(we,{size:"sm",variant:"outline",onClick:()=>i(!0),children:[s.jsx(yi,{className:"w-4 h-4 mr-2"}),t?"Reschedule Interview":"Schedule Interview"]}),s.jsx(_a,{open:a,onOpenChange:i,children:s.jsxs(ha,{className:"max-w-lg",children:[s.jsxs($a,{children:[s.jsx(Da,{children:t?"Reschedule Interview":"Schedule Interview for Family"}),s.jsx(Bs,{children:"Book this family into one of your existing open interview slots. Only upcoming, unbooked slots are shown to prevent overlaps."})]}),s.jsx("div",{className:"space-y-4 py-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 flex-wrap",children:[s.jsx($e,{children:"Available Slot"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(gn,{value:m,onValueChange:A=>g(A),children:[s.jsx(dn,{className:"h-8 w-[150px] text-xs",children:s.jsx(vn,{placeholder:"Filter"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"all",children:"All upcoming"}),s.jsx(ot,{value:"today",children:"Today"}),s.jsx(ot,{value:"7",children:"Next 7 days"}),s.jsx(ot,{value:"30",children:"Next 30 days"}),s.jsx(ot,{value:"date",children:"Specific date…"})]})]}),m==="date"&&s.jsx(xt,{type:"date",className:"h-8 w-[140px] text-xs",value:v,onChange:A=>y(A.target.value)})]})]}),s.jsxs(gn,{value:d,onValueChange:f,disabled:c,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:c?"Loading slots…":"Select an open slot"})}),s.jsx(fn,{children:j.length===0?s.jsx("div",{className:"p-2 text-sm text-muted-foreground",children:o.length===0?"No open slots. Create one in Interview Management.":"No slots match the current filter."}):j.map(A=>s.jsxs(ot,{value:A.id,children:[Dn(xr(A.slot_date),"EEE, MMM d, yyyy")," •"," ",k9(A.start_time)," –"," ",k9(A.end_time)]},A.id))})]})]})}),s.jsxs(Qi,{children:[s.jsx(we,{variant:"outline",onClick:()=>i(!1),disabled:p,children:"Cancel"}),s.jsxs(we,{onClick:S,disabled:p||!d,children:[p?s.jsx(Xt,{className:"w-4 h-4 mr-2 animate-spin"}):s.jsx(yi,{className:"w-4 h-4 mr-2"}),t?"Reschedule":"Schedule Interview"]})]})]})})]})}const E9={draft:{label:"Draft",variant:"outline",color:"bg-muted text-muted-foreground"},submitted:{label:"Submitted",variant:"secondary",color:"bg-blue-100 text-blue-800"},under_review:{label:"Under Review",variant:"default",color:"bg-amber-100 text-amber-800"},approved:{label:"Approved",variant:"default",color:"bg-green-100 text-green-800"},rejected:{label:"Rejected",variant:"destructive",color:"bg-red-100 text-red-800"},waitlisted:{label:"Waitlisted",variant:"secondary",color:"bg-orange-100 text-orange-800"}},C9=["current_tax_return","w2_forms"],P9=["current_tax_return","w2_forms"],T9=["current_tax_return","w2_forms"],O9=["current_tax_return","w2_forms","last_year_tax_return"],Vm={current_tax_return:"2025 Tax Documents",w2_forms:"W-2 Forms",self_employment:"Self-Employment Form",star_form:"Parent/Guardian Commitment Form",last_year_tax_return:"2024 Tax Return",teacher_recommendation:"Teacher Recommendation"},Xf=[{value:"last_year_tax_return",label:"2024 Tax Return",category:"financial",studentSpecific:!1},{value:"current_tax_return",label:"2025 Tax Return",category:"financial",studentSpecific:!1},{value:"w2_forms",label:"W-2, 1099, or Schedule C",category:"financial",studentSpecific:!1},{value:"self_employment",label:"Statement of Self-Employment",category:"financial",studentSpecific:!1},{value:"star_form",label:"STAR Parent/Guardian Commitment Form",category:"verification",studentSpecific:!0},{value:"teacher_recommendation",label:"Teacher Recommendation",category:"student",studentSpecific:!0},{value:"principal_referral",label:"Principal Referral Form",category:"student",studentSpecific:!0},{value:"report_card",label:"Most Recent Report Card",category:"student",studentSpecific:!0},{value:"student_form",label:"Student Form",category:"student",studentSpecific:!0},{value:"supplemental",label:"Supporting Document",category:"supplemental",studentSpecific:!1}],EXe=".pdf,.jpg,.jpeg,.png,.webp,.heic,.heif,.tiff,.tif,.bmp",R9=50*1024*1024,I9={mother:"Mother",father:"Father",stepparent:"Stepparent",grandparent:"Grandparent",aunt:"Aunt",uncle:"Uncle",legal_guardian:"Legal Guardian",other:"Other"},L9={employed:"Employed",self_employed:"Self-Employed",unemployed:"Unemployed",retired:"Retired",other:"Other"},M9=(e,t)=>{if(e.startsWith("supplemental_"))return"Supplemental Document";const n=["current_tax_return","w2_forms","last_year_tax_return"];for(const a of n)if(e.startsWith(`${a}_page_`))return Vm[a]||a;const r=[{prefix:"star_form_",fallback:"Parent/Guardian Commitment Form",labelFn:a=>`${a}'s Parent/Guardian Commitment Form`},{prefix:"teacher_recommendation_",fallback:"Teacher Recommendation",labelFn:a=>`${a}'s Teacher Recommendation`},{prefix:"principal_referral_",fallback:"Principal Referral Form",labelFn:a=>`${a}'s Principal Referral Form`},{prefix:"report_card_",fallback:"Most Recent Report Card",labelFn:a=>`${a}'s Most Recent Report Card`},{prefix:"student_form_",fallback:"Student Form",labelFn:a=>`${a}'s Student Form`}];for(const{prefix:a,fallback:i,labelFn:o}of r)if(e.startsWith(a)){const l=e.replace(a,""),c=t==null?void 0:t.find(u=>u.id===l);return c?o(`${c.first_name} ${c.last_name}`.trim()):i}return Vm[e]||e},$9=e=>{var n,r,a;const t=(n=e.guardians)==null?void 0:n.find(i=>i.is_primary);return t!=null&&t.first_name&&(t!=null&&t.last_name)?`${t.first_name} ${t.last_name}`:e.parent_first_name&&e.parent_last_name?`${e.parent_first_name} ${e.parent_last_name}`:(r=e.profiles)!=null&&r.full_name?e.profiles.full_name:(a=e.profiles)!=null&&a.email?e.profiles.email:"Unknown Family"},D9=e=>{var n,r;const t=(n=e.guardians)==null?void 0:n.find(a=>a.is_primary);return(t==null?void 0:t.email)||e.email||((r=e.profiles)==null?void 0:r.email)||"No email"},F9=e=>{const[t,n]=e.split(":").map(Number),r=t>=12?"PM":"AM";return`${t%12||12}:${n.toString().padStart(2,"0")} ${r}`},CXe=({email:e,session:t})=>
914{const[n,r]=x.useState(null),[a,i]=x.useState(!1),[o,l]=x.useState(null),c=()=>"https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/auth-safeguards";x.useEffect(()=>{!e||!(t!=null&&t.access_token)||(i(!0),fetch(c(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({action:"get-auth-info",email:e})}).then(f=>f.json()).then(r).catch(()=>{}).finally(()=>i(!1)))},[e,t==null?void 0:t.access_token]);const u=async(f,p)=>{l(f);try{const m=await(await fetch(c(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({action:f,email:e})})).json();if(m.error)tn.error(m.error);else{tn.success(`${p} completed successfully`);const g=await fetch(c(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({action:"get-auth-info",email:e})});r(await g.json())}}catch{tn.error("Failed to complete action")}l(null)},d=f=>f?new Date(f).toLocaleString():"Never";return s.jsx("div",{className:"space-y-3",children:a?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading security info..."}):n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Last Reset Request:"})," ",d(n.last_reset_request)]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Last Failed Login:"})," ",d(n.last_login_failure)]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Failed Attempts:"})," ",n.failed_attempts||0]}),n.is_locked&&s.jsxs("p",{className:"text-destructive font-medium",children:["Locked until: ",d(n.locked_until)]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[s.jsx(we,{size:"sm",variant:"outline",disabled:!!o,onClick:()=>u("admin-resend-reset","Password reset link sent"),children:o==="admin-resend-reset"?"Sending...":"Resend Password Reset"}),s.jsx(we,{size:"sm",variant:"outline",disabled:!!o,onClick:()=>u("admin-resend-activation","Activation email sent"),children:o==="admin-resend-activation"?"Sending...":"Resend Activation Email"}),n.is_locked&&s.jsx(we,{size:"sm",variant:"destructive",disabled:!!o,onClick:()=>u("admin-unlock","Account unlocked"),children:o==="admin-unlock"?"Unlocking...":"Unlock Account"})]})]}):s.jsx("p",{className:"text-sm text-muted-foreground",children:"Unable to load security info"})})},PXe=()=>{var ji,Fa,Za,Si,Ni,Jr,wo,qs,Bl,Ec,Cc,Pc,Ip,Mu,Pf;const{id:e}=qq(),t=di(),r=((ji=Ko().state)==null?void 0:ji.from)==="interviews",a=r?"/portal/admin/interviews":"/portal/admin/applications",i=r?"Back to Interviews":"Back to Applications",{session:o}=bo(),[l,c]=x.useState(null),[u,d]=x.useState([]),[f,p]=x.useState(null),[h,m]=x.useState(!0),[g,v]=x.useState(!1),[y,b]=x.useState(""),[w,j]=x.useState(!1),[S,A]=x.useState(""),[E,k]=x.useState(!1),[P,R]=x.useState(!1),[C,I]=x.useState(""),[D,U]=x.useState(""),[q,Z]=x.useState(null),[H,$]=x.use
914State(!1),W=x.useRef(null),[ee,V]=x.useState(null),[O,M]=x.useState(!1),[B,G]=x.useState(!1),[te,ne]=x.useState(null),[ce,oe]=x.useState(""),[X,se]=x.useState("document"),[Q,ye]=x.useState(""),[ie,F]=x.useState(0),[me,Ae]=x.useState(!1),[Ne,ve]=x.useState(100),pe=()=>ve(ge=>Math.min(ge+25,200)),Pe=()=>ve(ge=>Math.max(ge-25,25)),Ee=()=>ve(100),Ie=()=>"https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-applications",Me=ge=>{try{if("BroadcastChannel"in window){const Le=new BroadcastChannel("admin-students");Le.postMessage({type:"student.updated",...ge,ts:Date.now()}),Le.close()}else localStorage.setItem("admin-students",JSON.stringify({type:"student.updated",...ge,ts:Date.now()}))}catch(Le){console.warn("Failed to broadcast student update",Le)}},tt=async()=>{if(!(o!=null&&o.access_token)||!e){m(!1);return}try{const ge=await fetch(Ie(),{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o.access_token}`}});if(!ge.ok)throw new Error("Failed to fetch applications");const Le=await ge.json(),{applications:nt,profiles:Ke,guardians:st,students:Yt,documents:or,bookings:Sa}=Le,rr=new Map((Ke==null?void 0:Ke.map(Wn=>[Wn.user_id,Wn]))||[]),dr=new Map;st==null||st.forEach(Wn=>{dr.has(Wn.application_id)||dr.set(Wn.application_id,[]),dr.get(Wn.application_id).push(Wn)});const aa=new Map;Yt==null||Yt.forEach(Wn=>{aa.has(Wn.application_id)||aa.set(Wn.application_id,[]),aa.get(Wn.application_id).push(Wn)});const zn=nt==null?void 0:nt.find(Wn=>Wn.id===e);if(zn){const Wn={...zn,profiles:rr.get(zn.user_id)||null,guardians:dr.get(zn.id)||[],students:aa.get(zn.id)||[]};c(Wn),b(Wn.admin_notes||"");const Ba=[];or==null||or.forEach(Ar=>{Ar.application_id===e&&Ba.push({id:Ar.id,document_type:Ar.document_type||"",status:Ar.status,file_path:Ar.file_path||"",file_name:Ar.file_name||"",uploaded_at:Ar.uploaded_at,uploaded_by_admin:Ar.uploaded_by_admin||null})});const $n=Ba.some(Ar=>Ar.document_type.startsWith("teacher_recommendation_")&&Ar.document_type!=="teacher_recommendation");d($n?Ba.filter(Ar=>Ar.document_type!=="teacher_recommendation"):Ba);const Mi=(Sa||[]).filter(Ar=>Ar.application_id===e);let lr=null;Mi.forEach(Ar=>{if(!lr){lr=Ar;return}const nl=Ar.status==="scheduled"||Ar.status==="completed",Xa=lr.status==="scheduled"||lr.status==="completed";nl&&!Xa&&(lr=Ar)}),p(lr)}else c(null)}catch(ge){console.error("Error fetching application:",ge),tn.error("Failed to load application")}m(!1)};x.useEffect(()=>{tt()},[o,e]),x.useEffect(()=>{const ge=st=>{(st==null?void 0:st.type)==="student.updated"&&tt()};let Le=null;"BroadcastChannel"in window&&(Le=new BroadcastChannel("admin-students"),Le.onmessage=st=>ge(st.data));const nt=st=>{if(st.key==="admin-students"&&st.newValue)try{ge(JSON.parse(st.newValue))}catch{}};window.addEventListener("storage",nt);const Ke=Re.channel("students-changes-detail").on("postgres_changes",{event:"*",schema:"public",table:"students"},()=>{o&&tt()}).on("postgres_changes",{event:"*",schema:"public",table:"interview_bookings"},()=>{o&&tt()}).subscribe();return()=>{Le&&Le.close(),window.removeEventListener("storage",nt),Re.removeChannel(Ke)}},[o,e]);const De=ge=>{var Wn,Ba;const Le=[];let nt=0,Ke=0;const st=(Wn=ge.guardians)==null?void 0:Wn.find($n=>$n.is_primary),Yt=(st==null?void 0:st.first_name)&&(st==null?void 0:st.last_name),or=st==null?void 0:st.email,Sa=st==null?void 0:st.phone,rr=[Yt,or,Sa,ge.address,ge.city,ge.state,ge.zip_code];Ke+=rr.length,rr.forEach(($n,Mi)=>{$n?nt++:Le.push(["Guardian Name","Email","Phone","Address","City","State","Zip"][Mi])}),ge.students&&ge.students.length>0?nt++:Le.push("Students"),Ke++;const aa=[ge.household_income,ge.household_size];Ke+=aa.length,aa.forEach(($n,Mi)=>{$n!=null?nt++:Le.push(["Household Income","Household Size"][Mi])});const zn=((Ba=ge.profiles)==null?void 0:Ba.applicant_type)==="new"?P9:C9;return Ke+=zn.length,zn.forEach($n=>{let Mi;$n==="teacher_recommendation"?Mi=u.find(lr=>lr.document_type==="teacher_recommendation"||lr.document_type.startsWith("teacher_recommendation_")):Mi=u.find(lr=>lr.document_type===$n),Mi?nt++:Le.push(Vm[$n]||$n)}
914),(ge.students||[]).forEach($n=>{Ke++,u.some(lr=>lr.document_type===`star_form_${$n.id}`)?nt++:Le.push(`${$n.first_name} ${$n.last_name}'s Parent/Guardian Commitment Form`),Ke++,u.find(lr=>lr.document_type===`student_form_${$n.id}`)?nt++:Le.push(`${$n.first_name} ${$n.last_name}'s Student Form`),$n.status==="new"&&(Ke+=1,u.some(lr=>lr.document_type===`principal_referral_${$n.id}`)?nt++:Le.push(`${$n.first_name} ${$n.last_name}'s Principal Referral Form`))}),{percentage:Ke>0?Math.round(nt/Ke*100):0,missing:Le}},Qe=()=>{var nt;if(!l)return 0;const ge=((nt=l.profiles)==null?void 0:nt.applicant_type)==="new"?P9:C9;let Le=0;return ge.forEach(Ke=>{(Ke==="teacher_recommendation"?u.some(Yt=>Yt.document_type==="teacher_recommendation"||Yt.document_type.startsWith("teacher_recommendation_")):u.some(Yt=>Yt.document_type===Ke))||Le++}),(l.students||[]).forEach(Ke=>{u.some(st=>st.document_type===`star_form_${Ke.id}`)||Le++,u.some(st=>st.document_type===`student_form_${Ke.id}`)||Le++,Ke.status==="new"&&(u.some(st=>st.document_type===`principal_referral_${Ke.id}`)||Le++)}),Le},vt=async ge=>{if(!(!l||!(o!=null&&o.access_token))){V(ge);try{if(!(await fetch(Ie(),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o.access_token}`},body:JSON.stringify({applicationId:l.id,updates:{status:ge,reviewed_at:new Date().toISOString()}})})).ok)throw new Error("Failed to update status");tn.success(`Application marked as ${E9[ge].label}`),c({...l,status:ge}),await tt()}catch{tn.error("Failed to update status")}V(null)}},ct=async()=>{if(!(!l||!(o!=null&&o.access_token))){j(!0);try{if(!(await fetch(Ie(),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o.access_token}`},body:JSON.stringify({applicationId:l.id,updates:{admin_notes:y}})})).ok)throw new Error("Failed to save note");tn.success("Admin note saved"),c({...l,admin_notes:y}),v(!1)}catch{tn.error("Failed to save note")}j(!1)}},ut=async(ge,Le)=>{var nt;try{if(!(await fetch(Ie(),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(o==null?void 0:o.access_token)||""}`},body:JSON.stringify({studentId:ge,studentUpdates:{decision_status:Le}})})).ok)throw new Error("Failed to update student decision");if(tn.success("Student decision updated"),Me({studentId:ge,decision_status:Le}),l){const st=(nt=l.students)==null?void 0:nt.map(Yt=>Yt.id===ge?{...Yt,decision_status:Le}:Yt);c({...l,students:st})}}catch{tn.error("Failed to update student decision")}},Fe=async(ge,Le)=>{var nt;if(o!=null&&o.access_token)try{if(!(await fetch(Ie(),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o.access_token}`},body:JSON.stringify({studentId:ge,studentUpdates:{status:Le}})})).ok)throw new Error("Failed to update student status");if(tn.success("Student status updated"),l){const st=(nt=l.students)==null?void 0:nt.map(Yt=>Yt.id===ge?{...Yt,status:Le}:Yt);c({...l,students:st})}}catch{tn.error("Failed to update student status")}},It=async()=>{var ge;if(!(!l||!S||S===((ge=l.profiles)==null?void 0:ge.applicant_type))){k(!0);try{const Le=await fetch(Ie(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(o==null?void 0:o.access_token)||""}`},body:JSON.stringify({action:"change-application-type",userId:l.user_id,newType:S})});if(!Le.ok){const nt=await Le.json();throw new Error(nt.error||"Failed to change type")}tn.success(`Application type changed to ${S==="new"?"New Family":"Returning Family"}`),A(""),await tt()}catch(Le){tn.error(Le.message||"Failed to change application type")}finally{k(!1)}}},[zt,Wt]=x.useState(!1),Jt=async ge=>{if(!l||!(o!=null&&o.access_token))return;Wt(!0);const Le=l.admin_classification;c({...l,admin_classification:ge});try{const nt=await fetch(Ie(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o.access_token}`},body:JSON.stringify({action:"set-classification",applicationId:l.id,classification:ge})});if(!nt.ok){const st=await nt.json().catch(()=>({}));throw new Error(st.error||"Failed to update classification")}const Ke=ge?su[ge].label:"None";tn.success(`Classification set to ${Ke}`);try{if("BroadcastChannel"in window){const st=new BroadcastChannel("admin-students");st.postMessage({type:"student.updated",classification:ge,ts:Date.now()}),st.close()}}catch{}}catch(nt){c({...l,admin_classification:Le}),tn.error(nt.message||"Failed to update classification")}finally{Wt(!1)}},Un=async()=>
914{if(!(!l||!(o!=null&&o.access_token))){M(!0);try{const ge=await fetch(Ie(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o.access_token}`},body:JSON.stringify({action:"submit-on-behalf",applicationId:l.id})}),Le=await ge.json();if(!ge.ok){Le.missingItems&&Le.missingItems.length>0?tn.error(`Cannot submit: ${Le.missingItems.length} missing items`,{description:Le.missingItems.slice(0,5).join(", ")+(Le.missingItems.length>5?` and ${Le.missingItems.length-5} more...`:""),duration:8e3}):tn.error(Le.error||"Failed to submit application");return}tn.success("Application submitted on behalf of family"),await tt()}catch{tn.error("Failed to submit application")}finally{M(!1)}}},[Pt,Tn]=x.useState(!1),Lt=async()=>{if(!l||!(o!=null&&o.access_token))return;const ge=!l.student_edit_unlocked;Tn(!0);try{const Le=await fetch(Ie(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o.access_token}`},body:JSON.stringify({action:"toggle-student-edit",applicationId:l.id,unlocked:ge})}),nt=await Le.json();if(!Le.ok)throw new Error(nt.error||"Failed to update student editing");c({...l,student_edit_unlocked:ge}),tn.success(ge?"Student editing unlocked — the family can now add or update students":"Student editing locked again")}catch(Le){tn.error(Le.message||"Failed to update student editing")}finally{Tn(!1)}},Vt=async()=>{if(!l||!C||!q||!(o!=null&&o.access_token))return;const ge=Xf.find(Le=>Le.value===C);if(ge){if(ge.studentSpecific&&!D){tn.error("Please select a student for this document type");return}if(q.size>R9){tn.error("File size must be under 10MB");return}$(!0);try{const nt="https://lqvuodcxdknhkawvunaq.supabase.co/functions/v1/admin-documents?action=admin-upload";let Ke=C;ge.studentSpecific&&D&&(Ke=`${C}_${D}`),C==="supplemental"&&(Ke=`supplemental_${Date.now()}`);const st=new FormData;st.append("file",q),st.append("applicationId",l.id),st.append("documentType",Ke),st.append("documentCategory",ge.category);const Yt=await fetch(nt,{method:"POST",headers:{Authorization:`Bearer ${o.access_token}`},body:st});if(!Yt.ok){const or=await Yt.json();throw new Error(or.error||"Upload failed")}tn.success("Document uploaded successfully"),R(!1),I(""),U(""),Z(null),W.current&&(W.current.value=""),await tt()}catch(Le){tn.error(Le.message||"Failed to upload document")}finally{$(!1)}}},Mn=()=>{const Le=rt().filter(nt=>{var Ke;return(Ke=nt.doc)==null?void 0:Ke.file_path}).map(nt=>({label:nt.label,filePath:nt.doc.file_path}));return u.filter(nt=>
914nt.document_type.startsWith("supplemental_")).forEach(nt=>{Le.some(Ke=>Ke.filePath===nt.file_path)||Le.push({label:nt.file_name,filePath:nt.file_path})}),Le},nn=async ge=>{try{const Le=await fetch(Ie(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(o==null?void 0:o.access_token)||""}`},body:JSON.stringify({action:"get-signed-url",filePath:ge})});if(!Le.ok)throw new Error("Failed to get document URL");const nt=await Le.json();if(!(nt!=null&&nt.signedUrl))return null;const Ke=nt.fileName||ge.split("/").pop()||"document",st=nt.mimeType||"application/octet-stream";return{signedUrl:nt.signedUrl,fileName:Ke,mimeType:st}}catch{return tn.error("Failed to open document"),null}},yt=async ge=>{const Le=await nn(ge);if(!Le)return null;try{const nt=await fetch(Le.signedUrl);if(!nt.ok)throw new Error("Failed to fetch document bytes");const Ke=await nt.arrayBuffer();let st=new Blob([Ke],{type:Le.mimeType}),Yt=Le.mimeType,or=Le.fileName;if(/image\/heic|image\/heif/i.test(Le.mimeType)||/\.(heic|heif)$/i.test(Le.fileName))try{const dr=(await c_(async()=>{const{default:zn}=await import("./heic2any-BWuSkwre.js").then(Wn=>Wn.h);return{default:zn}},[])).default,aa=await dr({blob:new Blob([Ke],{type:"image/heic"}),toType:"image/jpeg",quality:.9});st=Array.isArray(aa)?aa[0]:aa,Yt="image/jpeg",or=or.replace(/\.(heic|heif)$/i,".jpg")}catch(dr){console.error("HEIC conversion failed:",dr),tn.error("Could not convert HEIC image. Use Download to view.")}return{url:URL.createObjectURL(st),mimeType:Yt,fileName:or}}catch{return tn.error("Failed to load document"),null}},hn=ge=>{if(ge&&ge.startsWith("blob:"))try{URL.revokeObjectURL(ge)}catch{}};x.useEffect(()=>()=>{hn(te)},[]),x.useEffect(()=>{!B&&te&&(hn(te),ne(null),oe(""))},[B]);const Mt=async ge=>{const Le=Mn(),nt=Le.findIndex(st=>st.filePath===ge);F(nt>=0?nt:0),ye(nt>=0?Le[nt].label:"Document"),Ae(!0),G(!0),hn(te),ne(null),oe(""),ve(100);const Ke=await yt(ge);Ke&&(ne(Ke.url),oe(Ke.mimeType),se(Ke.fileName)),Ae(!1)},Ht=async ge=>{const Le=Mn();if(Le.length===0)return;const nt=ge==="next"?(ie+1)%Le.length:(ie-1+Le.length)%Le.length;F(nt),ye(Le[nt].label),Ae(!0),hn(te),ne(null),oe(""),ve(100);const Ke=await yt(Le[nt].filePath);Ke&&(ne(Ke.url),oe(Ke.mimeType),se(Ke.fileName)),Ae(!1)},je=()=>{if(!te)return;const ge=document.createElement("a");ge.href=te,ge.download=X||"document",document.body.appendChild(ge),ge.click(),document.body.removeChild(ge)},rt=()=>{var nt;if(!l)return[];const ge=((nt=l.profiles)==null?void 0:nt.applicant_type)==="new"?O9:T9,Le=[];return ge.forEach(Ke=>{let st;Ke==="teacher_recommendation"?st=u.find(Yt=>Yt.document_type==="teacher_recommendation"||Yt.document_type.startsWith("teacher_recommendation_")):st=u.find(Yt=>Yt.document_type===Ke),Le.push({label:Vm[Ke]||Ke,docType:Ke,doc:st||null})}),(l.students||[]).forEach(Ke=>{const st=`star_form_${Ke.id}`,Yt=u.find(rr=>rr.document_type===st);Le.push({label:`${Ke.first_name}'s Parent/Guardian Commitment Form`,docType:st,doc:Yt||null});const or=`student_form_${Ke.id}`,Sa=u.find(rr=>rr.document_type===or);if(Le.push({label:`${Ke.first_name} ${Ke.last_name}'s Student Form`,docType:or,doc:Sa||null}),Ke.status==="new"){const rr=`teacher_recommendation_${Ke.id}`,dr=u.find($n=>$n.document_type===rr);Le.push({label:`${Ke.first_name} ${Ke.last_name}'s Teacher Recommendation`,docType:rr,doc:dr||null});const aa=`principal_referral_${Ke.id}`,zn=u.find($n=>$n.document_type===aa);Le.push({label:`${Ke.first_name} ${Ke.last_name}'s Principal Referral Form`,docType:aa,doc:zn||null});const Wn=`report_card_${Ke.id}`,Ba=u.find($n=>$n.document_type===Wn);Le.push({label:`${Ke.first_name} ${Ke.last_name}'s Most Recent Report Card`,docType:Wn,doc:Ba||null})}}),u.forEach(Ke=>{!Le.some(st=>{var Yt;return((Yt=st.doc)==null?void 0:Yt.id)===Ke.id})&&!Ke.document_type.startsWith("supplemental_")&&Le.push({label:M9(Ke.document_type,l.students),docType:Ke.document_type,doc:Ke})}),Le},at=()=>{var Ke;if(!l)return[];const ge=((Ke=l.profiles)==null?void 0:Ke.applicant_type)==="new"?O9:T9,Le=[];ge.forEach(st=>{const Yt=u.find(or=>or.document_type===st);Le.push({label:Vm[st]||st,docType:st,doc:Yt||null})});const nt=u.find(st=>st.document_type==="self_employment");return nt&&Le.push({label:Vm.self_employment||"Self-Employment Form",docType:"self_employment",doc:nt}),u.forEach(st=>{const Yt=["star_form_","student_form_","teacher_recommendation_","principal_referral_","report_card_"].some(Sa=>st.document_type.startsWith(Sa)),or=st.document_type.startsWith("supplemental_");!Yt&&!or&&!Le.some(Sa=>{var rr;return((rr=Sa.doc)==null?void 0:rr.id)===st.id}
914)&&Le.push({label:M9(st.document_type,l.students),docType:st.document_type,doc:st})}),Le},xn=(ge,Le)=>{var rr;const nt=(rr=l==null?void 0:l.students)==null?void 0:rr.find(dr=>dr.id===ge);if(!nt)return[];const Ke=[],st=nt.first_name,Yt=`${nt.first_name} ${nt.last_name}`.trim(),or=`star_form_${ge}`;Ke.push({label:`${st}'s Parent/Guardian Commitment Form`,docType:or,doc:u.find(dr=>dr.document_type===or)||null});const Sa=`student_form_${ge}`;if(Ke.push({label:`${Yt}'s Student Form`,docType:Sa,doc:u.find(dr=>dr.document_type===Sa)||null}),Le==="new"){const dr=`teacher_recommendation_${ge}`;Ke.push({label:`${Yt}'s Teacher Recommendation`,docType:dr,doc:u.find(Wn=>Wn.document_type===dr)||null});const aa=`principal_referral_${ge}`;Ke.push({label:`${Yt}'s Principal Referral Form`,docType:aa,doc:u.find(Wn=>Wn.document_type===aa)||null});const zn=`report_card_${ge}`;Ke.push({label:`${Yt}'s Most Recent Report Card`,docType:zn,doc:u.find(Wn=>Wn.document_type===zn)||null})}return Ke},sr=(ge,Le)=>{const nt=xn(ge,Le),Ke=nt.length,st=nt.filter(or=>or.doc!==null).length,Yt=Ke-st;return{percentage:Ke>0?Math.round(st/Ke*100):100,missingCount:Yt}};if(h)return s.jsx(gs,{children:s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading application..."})]})})});if(!l)return s.jsx(gs,{children:s.jsxs("div",{className:"text-center py-20",children:[s.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Application Not Found"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"The application you're looking for doesn't exist."}),s.jsxs(we,{onClick:()=>t(a),children:[s.jsx(Og,{className:"w-4 h-4 mr-2"}),i]})]})});const{percentage:Yn,missing:nr}=De(l),Gt=E9[l.status],Sn=Qe(),Zt=((Fa=l.students)==null?void 0:Fa.length)||0,_i=[];return nr.length>0&&_i.push("missing-items"),s.jsxs(gs,{children:[s.jsxs("div",{className:"space-y-6 pb-24",children:[s.jsxs(we,{variant:"ghost",size:"sm",onClick:()=>t(a),className:"gap-2",children:[s.jsx(Og,{className:"w-4 h-4"}),i]}),s.jsx(Ve,{children:s.jsx(He,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-start gap-6",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-2",children:[s.jsx("h1",{className:"text-2xl font-bold",children:$9(l)}),s.jsx(Je,{className:Gt.color,children:Gt.label}),s.jsx(Je,{variant:((Za=l.profiles)==null?void 0:Za.applicant_type)==="new"?"secondary":"outline",children:((Si=l.profiles)==null?void 0:Si.applicant_type)==="new"?"New Family":"Returning Family"}),l.application_type==="new_student_existing_family"&&s.jsx(Je,{variant:"default",className:"bg-blue-600",children:"Returning – New Student"}),l.submitted_by_admin_id&&s.jsxs(Je,{className:"bg-purple-100 text-purple-800 border-purple-300 gap-1",children:[s.jsx(q_,{className:"w-3 h-3"}),"Submitted by Admin"]}),s.jsx(pT,{classification:l.admin_classification})]}),s.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[s.jsx("p",{children:D9(l)}),s.jsx("p",{children:l.address?`${l.address}${l.address_line_2?`, ${l.address_line_2}`:""}, ${l.city||""}, ${l.state||""} ${l.zip_code||""}`:"No address provided"}),s.jsxs("p",{children:["Created ",new Date(l.created_at).toLocaleDateString(),l.submitted_at&&` • Submitted ${new Date(l.submitted_at).toLocaleDateString()}`,l.submitted_by_admin_name&&` by ${l.submitted_by_admin_name}`]})]})]}),s.jsxs("div",{className:"w-full lg:w-72 space-y-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-1",children:[s.jsx("span",{className:"text-sm font-medium",children:"Completion"}),s.jsxs("span",{className:"text-sm font-bold",children:[Yn,"%"]})]}),s.jsx(qN,{value:Yn,className:"h-2.5"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[Sn>0&&s.jsxs(Je,{variant:"destructive",className:"gap-1",children:[s.jsx(En,{className:"w-3 h-3"})," ",Sn," Missing Docs"]}),nr.length>0&&s.jsxs(Je,{variant:"outline",className:"gap-1 border-amber-300 text-amber-700 bg-amber-50",children:[s.jsx(er,{className:"w-3 h-3"})," ",nr.length," Missing Fields"]}),s.jsxs(Je,{variant:"outline",className:"gap-1",children:[s.jsx(Bh,{className:"w-3 h-3"})," ",Zt," Student",Zt!==1?"s":""]})]})]})]})})}),s.jsxs(uj,{type:"multiple",defaultValue:_i,className:"space-y-3",children:[nr.length>0&&s.jsxs(Co,{value:"missing-items",className:"border rounded-lg px-4",children:[s.jsx(Po,{className:"hover:no-underline",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(er,{className:"w-4 h-4 text-amber-600"}),s.jsxs("span",{className:"font-medium",children:["Missing Items (",nr.length,")"]})]})}),s.jsx(To,{children:s.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:s.jsx("ul",{className:"text-sm text-amber-700 space-y-1",children:nr.map((ge,Le)=>s.jsxs("li",{children:["• ",ge]},Le))})})})]}),s.jsxs(Co,{value:"parent-info",className:"border rounded-lg px-4",children:[s.jsx(Po,{className:"hover:no-underline",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ci,{className:"w-4 h-4"}),s.jsx("span",{className:"font-medium",children:"Parent/Guardian Information"})]})}),s.jsx(To,{children:s.jsxs("div",{className:"space-y-4",children:[l.marital_status&&s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Marital Status:"})," ",s.jsx("span",{className:"capitalize",children:l.marital_status})]}),(()=>{var Le;const ge=(Le=l.guardians)==null?void 0:Le.find(nt=>nt.is_primary);return ge?s.jsxs("div",{className:"p-3 border rounded-lg bg-muted/30",children:[s.jsx("p",{className:"font-medium text-sm mb-2",children:"Primary Parent/Guardian"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Name:"})," ",ge.first_name," ",ge.last_name]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Relationship:"})," ",I9[ge.relationship||""]||ge.relationship||"—"]}
914),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Email:"})," ",ge.email||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Phone:"})," ",ge.phone||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Employment:"})," ",L9[ge.employment_status||""]||ge.employment_status||"—"]}),(ge.employment_status==="employed"||ge.employment_status==="self_employed")&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:ge.employment_status==="self_employed"?"Business:":"Employer:"})," ",ge.employer_name||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Job Title:"})," ",ge.job_title||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Annual Salary:"})," ",ge.annual_salary?`$${Number(ge.annual_salary).toLocaleString()}`:"—"]})]})]})]}):s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Name:"})," ",$9(l)]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Email:"})," ",D9(l)]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Phone:"})," ",l.phone||"—"]})]})})(),(()=>{var Le;const ge=(Le=l.guardians)==null?void 0:Le.find(nt=>!nt.is_primary);return ge?s.jsxs("div",{className:"p-3 border rounded-lg bg-muted/30",children:[s.jsx("p",{className:"font-medium text-sm mb-2",children:"Second Parent/Guardian"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Name:"})," ",ge.first_name," ",ge.last_name]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Relationship:"})," ",I9[ge.relationship||""]||ge.relationship||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Email:"})," ",ge.email||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Phone:"})," ",ge.phone||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Employment:"})," ",L9[ge.employment_status||""]||ge.employment_status||"—"]}),(ge.employment_status==="employed"||ge.employment_status==="self_employed")&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:ge.employment_status==="self_employed"?"Business:":"Employer:"})," ",ge.employer_name||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Job Title:"})," ",ge.job_title||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Annual Salary:"})," ",ge.annual_salary?`$${Number(ge.annual_salary).toLocaleString()}`:"—"]})]})]})]}):null})(),s.jsxs("div",{className:"text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Address:"})," ",l.address?`${l.address}${l.address_line_2?`, ${l.address_line_2}`:""}`:"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"City/State:"})," ",l.city||"—",", ",l.state||"—"," ",l.zip_code||""]})]})]})})]}),s.jsxs(Co,{value:"students",className:"border rounded-lg px-4",children:[s.jsx(Po,{className:"hover:no-underline",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Bh,{className:"w-4 h-4"}),s.jsxs("span",{className:"font-medium",children:["Students (",Zt,")"]})]})}),s.jsx(To,{children:Zt>0?s.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:l.students.map(ge=>s.jsx(Ve,{className:"overflow-hidden",children:s.jsxs(He,{className:"p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("h4",{className:"font-semibold",children:[ge.first_name," ",ge.last_name]}),s.jsx(Je,{variant:ge.status==="returning"?"outline":"secondary",className:ge.status==="new"?"bg-amber-100 text-amber-800 border-amber-300":"",children:ge.status==="returning"?"Returning":"New"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-1.5 text-sm mb-3",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"School:"})," ",ge.school||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Grade:"})," ",ge.grade||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"DOB:"})," ",ge.date_of_birth||"—"]}
914),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Race:"})," ",ge.race?ge.race==="african_american"?"African American":ge.race.charAt(0).toUpperCase()+ge.race.slice(1):"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Gender:"})," ",ge.gender?ge.gender.charAt(0).toUpperCase()+ge.gender.slice(1):"—"]}),s.jsxs("p",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"TEFA Status:"}),s.jsx($ne,{status:ge.tefa_status,waitlistPosition:ge.tefa_waitlist_position})]})]}),s.jsxs("div",{className:"border-t pt-3 flex items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground block mb-1",children:"Status"}),s.jsxs(gn,{value:ge.status||"new",onValueChange:Le=>Fe(ge.id,Le),children:[s.jsx(dn,{className:"w-[130px] h-8 text-xs",children:s.jsx(vn,{})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"new",children:"New Student"}),s.jsx(ot,{value:"returning",children:"Returning Student"})]})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(we,{size:"sm",variant:ge.decision_status==="accepted"?"default":"outline",className:ge.decision_status==="accepted"?"bg-green-600 hover:bg-green-700":"text-green-700 border-green-300 hover:bg-green-50",onClick:()=>ut(ge.id,ge.decision_status==="accepted"?"pending":"accepted"),children:[s.jsx(Nt,{className:"w-3.5 h-3.5 mr-1"}),"Accept"]}),s.jsxs(we,{size:"sm",variant:ge.decision_status==="denied"?"destructive":"outline",className:ge.decision_status!=="denied"?"text-red-700 border-red-300 hover:bg-red-50":"",onClick:()=>ut(ge.id,ge.decision_status==="denied"?"pending":"denied"),children:[s.jsx(Pa,{className:"w-3.5 h-3.5 mr-1"}),"Deny"]})]})]})]})},ge.id))}):s.jsx("p",{className:"text-sm text-muted-foreground",children:"No students added to this application"})})]}),s.jsxs(Co,{value:"financial",className:"border rounded-lg px-4",children:[s.jsx(Po,{className:"hover:no-underline",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(sf,{className:"w-4 h-4"}),s.jsx("span",{className:"font-medium",children:"Financial Information"})]})}),s.jsx(To,{children:s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Household Income:"})," ",l.household_income||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Household Size:"})," ",l.household_size||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Receives Assistance:"})," ",l.receives_assistance?"Yes":"No"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Monthly Rent:"})," ",l.monthly_rent_payment||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Monthly Car Payment:"})," ",l.monthly_car_payment||"—"]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Social Security:"})," ",l.receives_social_security?`Yes (${l.social_security_amount||"—"})`:"No"]}),l.has_other_income&&s.jsxs("p",{className:"col-span-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Other Income:"})," ",l.other_income_description||"—"]}),l.ex_spouse_support_amount&&s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Ex-Spouse Support:"})," ",l.ex_spouse_support_amount]})]})})]}),s.jsxs(Co,{value:"essay",className:"border rounded-lg px-4",children:[s.jsx(Po,{className:"hover:no-underline",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(uA,{className:"w-4 h-4"}),s.jsx("span",{className:"font-medium",children:"Family Statement"})]})}),s.jsx(To,{children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground font-medium",children:'"Please tell us why your family would benefit from this sponsorship"'}),l.essay?s.jsx("p",{className:"text-sm whitespace-pre-wrap bg-muted/50 rounded-md p-4",children:l.essay}):s.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No response provided"})]})})]}),s.jsxs(Co,{value:"documents",className:"border rounded-lg px-4",children:[s.jsx(Po,{className:"hover:no-underline",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(En,{className:"w-4 h-4"}),s.jsx("span",{className:"font-medium",children:"Documents"}),Sn>0&&s.jsxs(Je,{variant:"destructive",className:"ml-2 text-xs",children:[Sn," missing"]})]})}),s.jsx(To,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(we,{variant:"outline",size:"sm",onClick:()=>{I("supplemental"),U(""),Z(null),W.current&&(W.current.value=""),R(!0)},children:[s.jsx(fa,{className:"w-4 h-4 mr-1"}),"Upload Supporting Document"]})}),s.jsxs("div",{children:[s.jsxs("h5",{className:"text-sm font-semibold mb-2 flex items-center gap-2",children:[s.jsx(Zr,{className:"w-4 h-4"}),"Family Documents"]}),s.jsxs(Qd,{children:[s.jsx(yp,{children:s.jsxs(us,{children:[s.jsx(Xn,{children:"Document"}),s.jsx(Xn,{children:"Status"}),s.jsx(Xn,{children:"Upload Date"}),s.jsx(Xn,{className:"text-right",children:"Action"})]})}),s.jsx(ef,{children:at().map((ge,Le)=>{var nt,Ke,st;return s.jsxs(us,{children:[s.jsx(On,{className:"font-medium",children:s.jsxs("div",{className:"flex items-center gap-2",children:[ge.label,((nt=ge.doc)==null?void 0:nt.uploaded_by_admin)&&s.jsx(Je,{variant:"outline",className:"text-xs bg-blue-50 text-blue-700 border-blue-200",children:"Admin"})]})}),s.jsx(On,{children:ge.doc?s.jsx(Je,{className:"bg-green-100 text-green-800 border-green-200",children:"Uploaded"}):s.jsx(Je,{variant:"destructive",children:"Missing"})}),s.jsx(On,{className:"text-sm text-muted-foreground",children:(Ke
914=ge.doc)!=null&&Ke.uploaded_at?new Date(ge.doc.uploaded_at).toLocaleDateString():"—"}),s.jsx(On,{className:"text-right",children:(st=ge.doc)!=null&&st.file_path?s.jsxs(we,{variant:"outline",size:"sm",className:"h-7 px-2",onClick:()=>Mt(ge.doc.file_path),children:[s.jsx($s,{className:"w-3.5 h-3.5 mr-1"}),"View"]}):Xf.some(Yt=>Yt.value===ge.docType)?s.jsxs(we,{variant:"outline",size:"sm",className:"h-7 px-2",onClick:()=>{I(ge.docType),U(""),Z(null),W.current&&(W.current.value=""),R(!0)},children:[s.jsx(fa,{className:"w-3.5 h-3.5 mr-1"}),"Upload"]}):null})]},Le)})})]})]}),(((Ni=l.students)==null?void 0:Ni.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h5",{className:"text-sm font-semibold mb-2 flex items-center gap-2",children:[s.jsx(Bh,{className:"w-4 h-4"}),"Student Documents"]}),s.jsx(uj,{type:"single",collapsible:!0,className:"space-y-2",children:l.students.map(ge=>{const Le=sr(ge.id,ge.status),nt=xn(ge.id,ge.status);return s.jsxs(Co,{value:ge.id,className:"border rounded-lg",children:[s.jsx(Po,{className:"hover:no-underline px-4",children:s.jsxs("div",{className:"flex items-center justify-between w-full pr-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"font-medium",children:[ge.first_name," ",ge.last_name]}),s.jsx(Je,{variant:ge.status==="returning"?"outline":"secondary",className:ge.status==="new"?"bg-amber-100 text-amber-800 border-amber-300":"",children:ge.status==="returning"?"Returning":"New"}),ge.grade&&s.jsx("span",{className:"text-xs text-muted-foreground",children:ge.grade}),ge.school&&s.jsxs("span",{className:"text-xs text-muted-foreground hidden sm:inline",children:["• ",ge.school]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[Le.missingCount>0?s.jsxs(Je,{variant:"destructive",className:"text-xs",children:[Le.missingCount," missing"]}):s.jsx(Je,{className:"bg-green-100 text-green-800 border-green-200 text-xs",children:"Complete"}),s.jsxs("span",{className:"text-xs font-medium text-muted-foreground w-10 text-right",children:[Le.percentage,"%"]})]})]})}),s.jsx(To,{className:"px-4 pb-4",children:s.jsxs(Qd,{children:[s.jsx(yp,{children:s.jsxs(us,{children:[s.jsx(Xn,{children:"Document"}),s.jsx(Xn,{children:"Status"}),s.jsx(Xn,{children:"Upload Date"}),s.jsx(Xn,{className:"text-right",children:"Action"})]})}),s.jsx(ef,{children:nt.map((Ke,st)=>{var Yt,or,Sa;return s.jsxs(us,{children:[s.jsx(On,{className:"font-medium",children:s.jsxs("div",{className:"flex items-center gap-2",children:[Ke.label.replace(`${ge.first_name}'s `,"").replace(`${ge.first_name} ${ge.last_name}'s `,""),((Yt=Ke.doc)==null?void 0:Yt.uploaded_by_admin)&&s.jsx(Je,{variant:"outline",className:"text-xs bg-blue-50 text-blue-700 border-blue-200",children:"Admin"})]})}),s.jsx(On,{children:Ke.doc?s.jsx(Je,{className:"bg-green-100 text-green-800 border-green-200",children:"Uploaded"}):s.jsx(Je,{variant:"destructive",children:"Missing"})}),s.jsx(On,{className:"text-sm text-muted-foreground",children:(or=Ke.doc)!=null&&or.uploaded_at?new Date(Ke.doc.uploaded_at).toLocaleDateString():"—"}),s.jsx(On,{className:"text-right",children:(Sa=Ke.doc)!=null&&Sa.file_path?s.jsxs(we,{variant:"outline",size:"sm",className:"h-7 px-2",onClick:()=>Mt(Ke.doc.file_path),children:[s.jsx($s,{className:"w-3.5 h-3.5 mr-1"}),"View"]}
914):(()=>{const rr=Ke.docType.replace(`_${ge.id}`,""),dr=Xf.find(aa=>aa.value===rr);return dr?s.jsxs(we,{variant:"outline",size:"sm",className:"h-7 px-2",onClick:()=>{I(rr),U(dr.studentSpecific?ge.id:""),Z(null),W.current&&(W.current.value=""),R(!0)},children:[s.jsx(fa,{className:"w-3.5 h-3.5 mr-1"}),"Upload"]}):null})()})]},st)})})]})})]},ge.id)})})]}),u.some(ge=>ge.document_type.startsWith("supplemental_"))&&s.jsxs("div",{children:[s.jsx("h5",{className:"text-sm font-semibold mb-2",children:"Supplemental Documents"}),s.jsx(Qd,{children:s.jsx(ef,{children:u.filter(ge=>ge.document_type.startsWith("supplemental_")).map(ge=>s.jsxs(us,{children:[s.jsx(On,{className:"font-medium",children:ge.file_name}),s.jsx(On,{children:s.jsx(Je,{className:"bg-green-100 text-green-800 border-green-200",children:"Uploaded"})}),s.jsx(On,{className:"text-sm text-muted-foreground",children:ge.uploaded_at?new Date(ge.uploaded_at).toLocaleDateString():"—"}),s.jsx(On,{className:"text-right",children:s.jsxs(we,{variant:"outline",size:"sm",className:"h-7 px-2",onClick:()=>Mt(ge.file_path),children:[s.jsx($s,{className:"w-3.5 h-3.5 mr-1"}),"View"]}
914)})]},ge.id))})})]})]})})]}),s.jsxs(Co,{value:"interview",className:"border rounded-lg px-4",children:[s.jsx(Po,{className:"hover:no-underline",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ig,{className:"w-4 h-4"}),s.jsx("span",{className:"font-medium",children:"Interview"})]})}),s.jsxs(To,{children:[f?f.status==="cancelled"||!f.interview_slots?s.jsx("p",{className:"text-sm text-amber-600",children:"Interview canceled – reschedule pending"}):s.jsxs("div",{className:"p-3 border rounded-lg bg-muted/30",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Date:"})," ",new Date(f.interview_slots.slot_date+"T00:00:00").toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"})]}),s.jsxs("p",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Time:"})," ",F9(f.interview_slots.start_time)," – ",F9(f.interview_slots.end_time)]})]}),s.jsx(Je,{variant:f.status==="completed"?"default":"secondary",className:"mt-2",children:f.status.charAt(0).toUpperCase()+f.status.slice(1)})]}):s.jsx("p",{className:"text-sm text-muted-foreground",children:"Interview not scheduled"}),((Jr=l.profiles)==null?void 0:Jr.applicant_type)==="new"&&s.jsx("div",{className:"mt-4",children:s.jsx(kXe,{applicationId:l.id,hasActiveBooking:!!f&&f.status!=="cancelled"&&!!f.interview_slots,onBooked:()=>tt()})}),((wo=l.profiles)==null?void 0:wo.applicant_type)==="new"&&s.jsx("div",{className:"mt-4",children:s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Referral Status:"})," ",s.jsx(Je,{variant:((qs=l.profiles)==null?void 0:qs.referral_status)==="approved"?"default":((Bl=l.profiles)==null?void 0:Bl.referral_status)==="rejected"?"destructive":"secondary",children:((Ec=l.profiles)==null?void 0:Ec.referral_status)||"Pending"})]})})]})]}),s.jsxs(Co,{value:"admin-tools",className:"border rounded-lg px-4",children:[s.jsx(Po,{className:"hover:no-underline",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(moe,{className:"w-4 h-4"}),s.jsx("span",{className:"font-medium",children:"Administrative Tools"})]})}),s.jsx(To,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"p-4 border rounded-lg bg-muted/30",children:[s.jsxs("h4",{className:"font-medium mb-3 flex items-center gap-2",children:[s.jsx(RL,{className:"w-4 h-4"}),"Application Type Override"]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(gn,{value:S||((Cc=l.profiles)==null?void 0:Cc.applicant_type)||"",onValueChange:A,children:[s.jsx(dn,{className:"w-[180px]",children:s.jsx(vn,{placeholder:"Select type"})}),s.jsxs(fn,{children:[s.jsx(ot,{value:"new",children:"New Family"}),s.jsx(ot,{value:"returning",children:"Returning Family"})]})]}),s.jsxs(fT,{children:[s.jsx(N9,{asChild:!0,children:s.jsx(we,{variant:"destructive",size:"sm",disabled:!S||S===((Pc=l.profiles)==null?void 0:Pc.applicant_type)||E,children:E?"Changing...":"Change Type"})}),s.jsxs(Ij,{children:[s.jsxs(Lj,{children:[s.jsx($j,{children:"Change Application Type?"}),s.jsx(Dj,{children:"Changing the application type will reset the family's application progress. This action cannot be undone."})]}),s.jsxs(Mj,{children:[s.jsx(Bj,{children:"Cancel"}),s.jsx(Fj,{onClick:It,children:"Confirm Change"})]})]})]})]}),l.profiles&&l.profiles.applicant_type_changed_at&&s.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Type last changed on ",new Date(l.profiles.applicant_type_changed_at).toLocaleDateString()]})]}),s.jsxs("div",{className:"p-4 border rounded-lg bg-muted/30",children:[s.jsxs("h4",{className:"font-medium mb-1 flex items-center gap-2",children:[s.jsx(ax,{className:"w-4 h-4"}),"Admin Classification"]}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Operational label only. Removes the application from the active review queue and into its own filtered section. Does not change approval status or notify the family."}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsxs("div",{className:"text-sm",children:[s.jsx("span",{className:"text-muted-foreground mr-2",children:"Current:"}),l.admin_classification?s.jsx(pT,{classification:l.admin_classification}):s.jsx(Je,{variant:"outline",children:"None"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[Mne.map(ge=>l.admin_classification===ge?null:s.jsxs(we,{size:"sm",variant:"outline",disabled:zt,onClick:()=>Jt(ge),children:[s.jsx(ax,{className:"w-3.5 h-3.5 mr-1"}),"Mark as ",su[ge].label]},ge)),l.admin_classification&&s.jsxs(we,{size:"sm",variant:"ghost",disabled:zt,onClick:()=>Jt(null),children:["Remove ",((Ip=su[l.admin_classification])==null?void 0:Ip.label)??""," Classification"]})]})]})]}),l.email&&s.jsxs("div",{className:"p-4 border rounded-lg bg-muted/30",children:[s.jsxs("h4",{className:"font-medium mb-3 flex items-center gap-2",children:[s.jsx(RL,{className:"w-4 h-4"}),"Account Security"]}),s.jsx(CXe,{email:l.email,session:o})]}),l.admin_notes&&s.jsxs("div",{className:"p-4 border rounded-lg bg-muted/30",children:[s.jsxs("h4",{className:"font-medium mb-2 flex items-center gap-2",children:[s.jsx(uA,{className:"w-4 h-4"}),"Admin Notes"]}),s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:l.admin_notes})]})]})})]})]})]}),s.jsxs("div",{className:"fixed bottom-0 left-0 right-0 bg-background border-t px-6 py-3 flex items-center justify-end gap-3 z-50",children:[l.status==="draft"&&!l.submitted_at&&s.jsxs(fT,{children:[s.jsx(N9,{asChild:!0,children:s.jsxs(we,{size:"sm",disabled:O,className:"gap-1 bg-amber-600 hover:bg-amber-700 text-white",children:[s.jsx(q_,{className:"w-4 h-4"}),O?"Submitting...":"Submit on Behalf"]})}),s.jsxs(Ij,{children:[s.jsxs(Lj,{children:[s.jsx($j,{children:"Submit on Behalf of Family?"}),s.jsx(Dj,{children:"Are you sure you want to submit this application on behalf of the family? This will mark the application as submitted and notify the family. All required fields and documents must be complete."})]}),s.jsxs(Mj,{children:[s.jsx(Bj,{children:"Cancel"}),s.jsx(Fj,{onClick:Un,className:"bg-amber-600 hover:bg-amber-700",children:"Confirm Submission"})]})]})]}),s.jsxs(we,{variant:"outline",size:"sm",onClick:()=>v(!0),className:"gap-1",children:[s.jsx(uA,{className:"w-4 h-4"}),"Add Note"]}),l.status!=="draft"&&s.jsxs(we,{variant:"outline",size:"sm",disabled:Pt,onClick:Lt,className:"gap-1",children:[l.student_edit_unlocked?s.jsx(Mg,{className:"w-4 h-4"}):s.jsx(soe,{className:"w-4 h-4"}),Pt?"Updating...":l.student_edit_unlocked?"Lock Student Edits":"Unlock Student Edits"]}),s.jsxs(we,{variant:"outline",size:"sm",disabled:l.status==="under_review"||!!ee,onClick:()=>vt("under_review"),className:"gap-1",children:[s.jsx(Fn,{className:"w-4 h-4"}),ee==="under_review"?"Updating...":"Under Review"]}),s.jsxs(we,{variant:"outline",size:"sm",disabled:l.status==="waitlisted"||!!ee,onClick:()=>
914vt("waitlisted"),className:"gap-1 border-orange-300 text-orange-700 hover:bg-orange-50",children:[s.jsx(Fn,{className:"w-4 h-4"}),ee==="waitlisted"?"Updating...":"Waitlist"]}),s.jsxs(we,{variant:"destructive",size:"sm",disabled:l.status==="rejected"||!!ee,onClick:()=>vt("rejected"),className:"gap-1",children:[s.jsx(Pa,{className:"w-4 h-4"}),ee==="rejected"?"Updating...":"Deny"]}),s.jsxs(we,{size:"sm",disabled:l.status==="approved"||!!ee,onClick:()=>vt("approved"),className:"gap-1 bg-green-600 hover:bg-green-700",children:[s.jsx(Nt,{className:"w-4 h-4"}),ee==="approved"?"Updating...":"Approve"]})]}),s.jsx(_a,{open:g,onOpenChange:v,children:s.jsxs(ha,{className:"max-w-md",children:[s.jsx($a,{children:s.jsx(Da,{children:"Admin Note"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(wc,{value:y,onChange:ge=>b(ge.target.value),placeholder:"Add notes about this application...",rows:5}),s.jsx(we,{className:"w-full",onClick:ct,disabled:w,children:w?"Saving...":"Save Note"})]})]})}),s.jsx(_a,{open:P,onOpenChange:R,children:s.jsxs(ha,{className:"max-w-md",children:[s.jsx($a,{children:s.jsx(Da,{children:"Upload Document on Behalf of Family"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Document Type *"}),s.jsxs(gn,{value:C,onValueChange:ge=>{I(ge),U("")},children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select document type"})}),s.jsx(fn,{children:Xf.map(ge=>s.jsx(ot,{value:ge.value,children:ge.label},ge.value))})]})]}),C&&((Mu=Xf.find(ge=>ge.value===C))==null?void 0:Mu.studentSpecific)&&s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Select Student *"}),s.jsxs(gn,{value:D,onValueChange:U,children:[s.jsx(dn,{children:s.jsx(vn,{placeholder:"Select student"})}),s.jsx(fn,{children:(l.students||[]).map(ge=>s.jsxs(ot,{value:ge.id,children:[ge.first_name," ",ge.last_name]},ge.id))})]})]}),C&&(()=>{const ge=Xf.find(Ke=>Ke.value===C);let Le=C;return ge!=null&&ge.studentSpecific&&D&&(Le=`${C}_${D}`),u.find(Ke=>Ke.document_type===Le)?s.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-800",children:[s.jsx($g,{className:"w-4 h-4 mt-0.5 shrink-0"}),s.jsx("span",{children:"A document of this type already exists. Uploading will add an additional version."})]}):null})(),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"File *"}),s.jsx("input",{ref:W,type:"file",accept:EXe,onChange:ge=>{var nt;const Le=((nt=ge.target.files)==null?void 0:nt[0])||null;if(Le&&Le.size>R9){tn.error("File size must be under 10MB"),ge.target.value="",Z(null);return}Z(Le)},className:"block w-full text-sm border rounded-md p-2 file:mr-4 file:rounded file:border-0 file:bg-primary file:text-primary-foreground file:px-3 file:py-1 file:text-sm file:cursor-pointer"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"PDF, JPEG, PNG, WebP, HEIC, TIFF, or BMP. Max 50MB."})]}),s.jsx(we,{className:"w-full",disabled:!C||!q||H||((Pf=Xf.find(ge=>ge.value===C))==null?void 0:Pf.studentSpecific)===!0&&!D,onClick:Vt,children:H?"Uploading...":"Upload Document"})]})]})}),s.jsx(_a,{open:B,onOpenChange:G,children:s.jsxs(ha,{className:"max-w-5xl w-[95vw] h-[90vh] flex flex-col p-0 gap-0",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b bg-muted/30",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[s.jsx(En,{className:"w-4 h-4 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"font-medium text-sm truncate",children:Q}),s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["(",ie+1," of ",Mn().length,")"]})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(we,{variant:"outline",size:"sm",className:"h-8 w-8 p-0",onClick:Pe,disabled:Ne<=25||me,children:s.jsx(xoe,{className:"w-4 h-4"})}),s.jsxs("span",{className:"text-xs font-medium text-muted-foreground w-10 text-center",children:[Ne,"%"]}),s.jsx(we,{variant:"outline",size:"sm",className:"h-8 w-8 p-0",onClick:pe,disabled:Ne>=200||me,children:s.jsx(yoe,{className:"w-4 h-4"})}),s.jsx(we,{variant:"outline",size:"sm",className:"h-8 w-8 p-0",onClick:Ee,disabled:Ne===100||me,title:"Reset zoom",children:s.jsx(yO,{className:"w-3.5 h-3.5"})}),s.jsx("div",{className:"w-px h-6 bg-border mx-1"}),s.jsx(we,{variant:"outline",size:"sm",className:"h-8 w-8 p-0",onClick:()=>Ht("prev"),disabled:Mn().length<=1||me,children:s.jsx(Sb,{className:"w-4 h-4"})}),s.jsx(we,{variant:"outline",size:"sm",className:"h-8 w-8 p-0",onClick:()=>Ht("next"),disabled:Mn().length<=1||me,children:s.jsx(Ho,{className:"w-4 h-4"})}),s.jsx("div",{className:"w-px h-6 bg-border mx-1"}),s.jsx(we,{variant:"outline",size:"sm",className:"h-8 w-8 p-0",onClick:je,disabled:!te||me,title:"Download",children:s.jsx(Lg,{className:"w-4 h-4"})}),s.jsx(we,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 ml-2",onClick:()=>G(!1),children:s.jsx(yf,{className:"w-4 h-4"})})]})]}),s.jsx("div",{className:"flex-1 overflow-auto bg-muted/10",children:me?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading document..."})]})}):te?(()=>{const ge=ce==="application/pdf",Le=ce.startsWith("image/");if(ge){const nt=te+"#toolbar=1&view=FitH";return s.jsx("div",{className:"w-full h-full overflow-auto flex justify-center",children:s.jsx("div",{style:{transform:`scale(${Ne/100})`,transformOrigin:"top center",width:"100%",height:Ne>100?`${Ne}%`:"100%"},children:s.jsx("iframe",{src:nt,className:"w-full h-full border-0",title:Q,style:{minHeight:"100%"}})})})}return Le?s.jsx("div",{className:"w-full h-full overflow-auto flex justify-center p-4",children:s.jsx("img",{src:te,alt:Q,style:{transform:`scale(${Ne/100})`,transformOrigin:"top center",maxWidth:Ne<=100?"100%":"none",objectFit:"contain"}})}):s.jsx("div",{className:"flex items-center justify-center h-full p-6",children:s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-md",children:[s.jsx(En,{className:"w-12 h-12 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Preview not available for this file type."}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1 break-all",children:X})]}),s.jsxs(we,{onClick:je,variant:"default",size:"sm",children:[s.jsx(Lg,{className:"w-4 h-4 mr-2"}),"Download to view"]})]})})})():s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-muted-foreground",children:"Failed to load document"})})})]})})]})},TXe="[email protected]",Jf=({children:e,requiredRole:t})=>{var l;const{user:n,userRole:r,profile:a,loading:i}=bi();return i?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted",children:s.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})}):n?!(((l=n.email)==null?void 0:l.toLowerCase())===TXe)&&r==="family"&&a&&!a.email_verified?s.jsx(Bo,{to:"/portal/verify-email",replace:!0}):t&&r!==t?r==="admin"?s.jsx(Bo,{to:"/portal/admin",replace:!0}):s.jsx(Bo,{to:"/portal",replace:!0}):s.jsx(s.Fragment,{children:e}):s.jsx(Bo,{to:"/portal/auth",replace:!0})},dl=({children:e})=>{const{admin:t,loading:n}=bo();return n?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-muted",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),s.jsx("p",{className:"text-muted-foreground",children:"Verifying admin access..."})]})}):t?s.jsx(s.Fragment,{children:e}):s.jsx(Bo,{to:"/admin-login",replace:!0})},OXe=()=>{const{pathname:e}=Ko();return x.useEffect(()=>{window.scrollTo(0,0)},[e]),null},RXe=new Iue,IXe=()=>s.jsx(Fue,{client:RXe,children:s.jsx(ype,{children:s.jsx(xpe,{children:s.jsxs(i0,{children:[s.jsx(tle,{}),s.jsx(Rle,{}),s.jsxs(Yde,{children:[s.jsx(OXe,{}),s.jsxs(Bde,{children:[s.jsx(Rn,{path:"/",element:s.jsx(Pme,{})}),s.jsx(Rn,{path:"/about",element:s.jsx(Tme,{})}),s.jsx(Rn,{path:"/our-impact",element:s.jsx(AMe,{})}),s.jsx(Rn,{path:"/event-gallery",element:s.jsx(z$e,{})}),s.jsx(Rn,{path:"/meet-the-board",element:s.jsx(bDe,{})}),s.jsx(Rn,{path:"/apply",element:s.jsx(SDe,{})}),s.jsx(Rn,{path:"/testimonials",element:s.jsx(ADe,{})}),s.jsx(Rn,{path:"/faqs",element:s.jsx(VDe,{})}),s.jsx(Rn,{path:"/star-voices",element:s.jsx(ZDe,{})}),s.jsx(Rn,{path:"/write-a-letter",element:s.jsx(r8e,{})}),s.jsx(Rn,{path:"/contact",element:s.jsx(a8e,{})}),s.jsx(Rn,{path:"/donate",element:s.jsx(Bo,{to:"/",replace:!0})}),s.jsx(Rn,{path:"/admin-login",element:s.jsx(XZe,{})}),s.jsx(Rn,{path:"/portal/auth",element:s.jsx(ABe,{})}),s.jsx(Rn,{path:"/portal/verify-phone",element:s.jsx(WZe,{})}),s.jsx(Rn,{path:"/portal/verify-email",element:s.jsx(HZe,{})}),s.jsx(Rn,{path:"/portal/forgot-password",element:s.jsx(YZe,{})}),s.jsx(Rn,{path:"/portal/reset-password",element:s.jsx(ZZe,{})}),s.jsx(Rn,{path:"/portal",element:s.jsx(Jf,{children:s.jsx(kBe,{})})}),s.jsx(Rn,{path:"/portal/onboarding",element:s.jsx(Jf,{children:s.jsx(EBe,{})})}),s.jsx(Rn,{path:"/portal/referral",element:s.jsx(Jf,{children:s.jsx(c9e,{})})}),s.jsx(Rn,{path:"/portal/family",element:s.jsx(Jf,{children:s.jsx(Lqe,{})})}),s.jsx(Rn,{path:"/portal/application/:id",element:s.jsx(Jf,{children:s.jsx(AZe,{})})}),s.jsx(Rn,{path:"/portal/submission-success",element:s.jsx(Jf,{children:s.jsx(kZe,{})})}),s.jsx(Rn,{path:"/portal/devices",element:s.jsx(Jf,{children:s.jsx(UZe,{})})}),s.jsx(Rn,{path:"/portal/admin",element:s.jsx(dl,{children:s.jsx(QZe,{})})}),s.jsx(Rn,{path:"/portal/admin/referrals",element:s.jsx(dl,{children:s.jsx(eXe,{})})}),s.jsx(Rn,{path:"/portal/admin/documents",element:s.jsx(dl,{children:s.jsx(rXe,{})})}),s.jsx(Rn,{path:"/portal/admin/applications",element:s.jsx(dl,{children:s.jsx(dXe,{})})}),s.jsx(Rn,{path:"/portal/admin/interviews",element:s.jsx(dl,{children:s.jsx(vXe,{})})}),s.jsx(Rn,{path:"/portal/admin/notifications",element:s.jsx(dl,{children:s.jsx(yXe,{})})}),s.jsx(Rn,{path:"/portal/admin/families",element:s.jsx(dl,{children:s.jsx(wXe,{})})}),s.jsx(Rn,{path:"/portal/admin/students",element:s.jsx(dl,{children:s.jsx(SXe,{})})}),s.jsx(Rn,{path:"/portal/admin/applications/:id",element:s.jsx(dl,{children:s.jsx(PXe,{})})}),s.jsx(Rn,{path:"/portal/admin/settings",element:s.jsx(dl,{children:s.jsx(NXe,{})})}),s.jsx(Rn,{path:"/portal/admin/sms-consent",element:s.jsx(dl,{children:s.jsx(AXe,{})})}),s.jsx(Rn,{path:"*",element:s.jsx(i8e,{})})]})]})]})})})});cW(document.getElementById("root")).render(s.jsx(IXe,{}));export{ec as c,mr as g};

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.