PageSourceSearch

https://infinite-future-enterprise-manage-f5aef38d.base44.app/assets/index-BfxdGu5M.js

js infinite-future-enterprise-manage-f5aef38d.base44.app collected 2026-10-03 03:14:50 UTC 1,850,356 bytes, 1,618 lines download raw bytes

1var k2=e=>{throw TypeError(e)};var F0=(e,t,r)=>t.has(e)||k2("Cannot "+r);var le=(e,t,r)=>(F0(e,t,"read from private field"),r?r.call(e):t.get(e)),nt=(e,t,r)=>t.has(e)?k2("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ue=(e,t,r,n)=>(F0(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),_t=(e,t,r)=>(F0(e,t,"access private method"),r);var wm=(e,t,r,n)=>({set _(i){Ue(e,t,i,r)},get _(){return le(e,t,n)}});function uz(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var _m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}
vendor: 4,090 bytes, lines 1-9
1var O0={exports:{}},ad={},E0={exports:{}},St={};/**
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 C2;function dz(){if(C2)return St;C2=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.iterator;function m(L){return L===null||typeof L!="object"?null:(L=d&&L[d]||L["@@iterator"],typeof L=="function"?L:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function v(L,V,z){this.props=L,this.context=V,this.refs=y,this.updater=z||p}v.prototype.isReactComponent={},v.prototype.setState=function(L,V){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,V,"setState")},v.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function b(){}b.prototype=v.prototype;function w(L,V,z){this.props=L,this.context=V,this.refs=y,this.updater=z||p}var _=w.prototype=new b;_.constructor=w,x(_,v.prototype),_.isPureReactComponent=!0;var N=Array.isArray,S=Object.prototype.hasOwnProperty,k={current:null},C={key:!0,ref:!0,__self:!0,__source:!0};function O(L,V,z){var Z,re={},G=null,X=null;if(V!=null)for(Z in V.ref!==void 0&&(X=V.ref),V.key!==void 0&&(G=""+V.key),V)S.call(V,Z)&&!C.hasOwnProperty(Z)&&(re[Z]=V[Z]);var ie=arguments.length-2;if(ie===1)re.children=z;else if(1<ie){for(var J=Array(ie),ue=0;ue<ie;ue++)J[ue]=arguments[ue+2];re.children=J}if(L&&L.defaultProps)for(Z in ie=L.defaultProps,ie)re[Z]===void 0&&(re[Z]=ie[Z]);return{$$typeof:e,type:L,key:G,ref:X,props:re,_owner:k.current}}function R(L,V){return{$$typeof:e,type:L.type,key:V,ref:L.ref,props:L.props,_owner:L._owner}}function A(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function P(L){var V={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(z){return V[z]})}var E=/\/+/g;function T(L,V){return typeof L=="object"&&L!==null&&L.key!=null?P(""+L.key):V.toString(36)}function $(L,V,z,Z,re){var G=typeof L;(G==="undefined"||G==="boolean")&&(L=null);var X=!1;if(L===null)X=!0;else switch(G){case"string":case"number":X=!0;break;case"object":switch(L.$$typeof){case e:case t:X=!0}}if(X)return X=L,re=re(X),L=Z===""?"."+T(X,0):Z,N(re)?(z="",L!=null&&(z=L.replace(E,"$&/")+"/"),$(re,V,z,"",function(ue){return ue})):re!=null&&(A(re)&&(re=R(re,z+(!re.key||X&&X.key===re.key?"":(""+re.key).replace(E,"$&/")+"/")+L)),V.push(re)),1;if(X=0,Z=Z===""?".":Z+":",N(L))for(var ie=0;ie<L.length;ie++){G=L[ie];var J=Z+T(G,ie);X+=$(G,V,z,J,re)}else if(J=m(L),typeof J=="function")for(L=J.call(L),ie=0;!(G=L.next()).done;)G=G.value,J=Z+T(G,ie++),X+=$(G,V,z,J,re);else if(G==="object")throw V=String(L),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return X}function D(L,V,z){if(L==null)return L;var Z=[],re=0;return $(L,Z,"","",function(G){return V.call(z,G,re++)}),Z}function W(L){if(L._status===-1){var V=L._result;V=V(),V.then(function(z){(L._status===0||L._status===-1)&&(L._status=1,L._result=z)},function(z){(L._status===0||L._status===-1)&&(L._status=2,L._result=z)}),L._status===-1&&(L._status=0,L._result=V)}if(L._status===1)return L._result.default;throw L._result}var U={current:null},H={transition:null},K={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:H,ReactCurrentOwner:k};function q(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 1,503 bytes, line 9
9return St.Children={map:D,forEach:function(L,V,z){D(L,function(){V.apply(this,arguments)},z)},count:function(L){var V=0;return D(L,function(){V++}),V},toArray:function(L){return D(L,function(V){return V})||[]},only:function(L){if(!A(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},St.Component=v,St.Fragment=r,St.Profiler=i,St.PureComponent=w,St.StrictMode=n,St.Suspense=c,St.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K,St.act=q,St.cloneElement=function(L,V,z){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var Z=x({},L.props),re=L.key,G=L.ref,X=L._owner;if(V!=null){if(V.ref!==void 0&&(G=V.ref,X=k.current),V.key!==void 0&&(re=""+V.key),L.type&&L.type.defaultProps)var ie=L.type.defaultProps;for(J in V)S.call(V,J)&&!C.hasOwnProperty(J)&&(Z[J]=V[J]===void 0&&ie!==void 0?ie[J]:V[J])}var J=arguments.length-2;if(J===1)Z.children=z;else if(1<J){ie=Array(J);for(var ue=0;ue<J;ue++)ie[ue]=arguments[ue+2];Z.children=ie}return{$$typeof:e,type:L.type,key:re,ref:G,props:Z,_owner:X}},St.createContext=function(L){return L={$$typeof:o,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:s,_context:L},L.Consumer=L},St.createElement=O,St.createFactory=function(L){var V=O.bind(null,L);return V.type=L,V},St.createRef=function(){return{current:null}},St.forwardRef=function(L){return{$$typeof:l,render:L}}
vendor: 6,809 bytes, lines 9-33
9,St.isValidElement=A,St.lazy=function(L){return{$$typeof:h,_payload:{_status:-1,_result:L},_init:W}},St.memo=function(L,V){return{$$typeof:f,type:L,compare:V===void 0?null:V}},St.startTransition=function(L){var V=H.transition;H.transition={};try{L()}finally{H.transition=V}},St.unstable_act=q,St.useCallback=function(L,V){return U.current.useCallback(L,V)},St.useContext=function(L){return U.current.useContext(L)},St.useDebugValue=function(){},St.useDeferredValue=function(L){return U.current.useDeferredValue(L)},St.useEffect=function(L,V){return U.current.useEffect(L,V)},St.useId=function(){return U.current.useId()},St.useImperativeHandle=function(L,V,z){return U.current.useImperativeHandle(L,V,z)},St.useInsertionEffect=function(L,V){return U.current.useInsertionEffect(L,V)},St.useLayoutEffect=function(L,V){return U.current.useLayoutEffect(L,V)},St.useMemo=function(L,V){return U.current.useMemo(L,V)},St.useReducer=function(L,V,z){return U.current.useReducer(L,V,z)},St.useRef=function(L){return U.current.useRef(L)},St.useState=function(L){return U.current.useState(L)},St.useSyncExternalStore=function(L,V,z){return U.current.useSyncExternalStore(L,V,z)},St.useTransition=function(){return U.current.useTransition()},St.version="18.3.1",St}var F2;function Lg(){return F2||(F2=1,E0.exports=dz()),E0.exports}/**
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 O2;function fz(){if(O2)return ad;O2=1;var e=Lg(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(l,c,f){var h,d={},m=null,p=null;f!==void 0&&(m=""+f),c.key!==void 0&&(m=""+c.key),c.ref!==void 0&&(p=c.ref);for(h in c)n.call(c,h)&&!s.hasOwnProperty(h)&&(d[h]=c[h]);if(l&&l.defaultProps)for(h in c=l.defaultProps,c)d[h]===void 0&&(d[h]=c[h]);return{$$typeof:t,type:l,key:m,ref:p,props:d,_owner:i.current}}return ad.Fragment=r,ad.jsx=o,ad.jsxs=o,ad}var E2;function hz(){return E2||(E2=1,O0.exports=fz()),O0.exports}var a=hz(),I=Lg();const oe=Ft(I),HN=uz({__proto__:null,default:oe},[I]);var jm={},P0={exports:{}},Nn={},T0={exports:{}},A0={};/**
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 */var P2;function mz(){return P2||(P2=1,(function(e){function t(H,K){var q=H.length;H.push(K);e:for(;0<q;){var L=q-1>>>1,V=H[L];if(0<i(V,K))H[L]=K,H[q]=V,q=L;else break e}}function r(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var K=H[0],q=H.pop();if(q!==K){H[0]=q;e:for(var L=0,V=H.length,z=V>>>1;L<z;){var Z=2*(L+1)-1,re=H[Z],G=Z+1,X=H[G];if(0>i(re,q))G<V&&0>i(X,re)?(H[L]=X,H[G]=q,L=G):(H[L]=re,H[Z]=q,L=Z);else if(G<V&&0>i(X,q))H[L]=X,H[G]=q,L=G;else break e}}return K}function i(H,K){var q=H.sortIndex-K.sortIndex;return q!==0?q:H.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],f=[],h=1,d=null,m=3,p=!1,x=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(H){for(var K=r(f);K!==null;){if(K.callback===null)n(f);else if(K.startTime<=H)n(f),K.sortIndex=K.expirationTime,t(c,K);else break;K=r(f)}}function N(H){if(y=!1,_(H),!x)if(r(c)!==null)x=!0,W(S);else{var K=r(f);K!==null&&U(N,K.startTime-H)}}function S(H,K){x=!1,y&&(y=!1,b(O),O=-1),p=!0;var q=m;try{for(_(K),d=r(c);d!==null&&(!(d.expirationTime>K)||H&&!P());){var L=d.callback;if(typeof L=="function"){d.callback=null,m=d.priorityLevel;var V=L(d.expirationTime<=K);K=e.unstable_now(),typeof V=="function"?d.callback=V:d===r(c)&&n(c),_(K)}else n(c);d=r(c)}if(d!==null)var z=!0;else{var Z=r(f);Z!==null&&U(N,Z.startTime-K),z=!1}return z}finally{d=null,m=q,p=!1}}var k=!1,C=null,O=-1,R=5,A=-1;function P(){return!(e.unstable_now()-A<R)}function E(){if(C!==null){var H=e.unstable_now();A=H;var K=!0;try{K=C(!0,H)}finally{K?T():(k=!1,C=null)}}else k=!1}var T;if(typeof w=="function")T=function(){w(E)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,D=$.port2;$.port1.onmessage=E,T=function(){D.postMessage(null)}}else T=function(){v(E,0)};function W(H){C=H,k||(k=!0,T())}function U(H,K){O=v(function(){H(e.unstable_now())},K)}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(H){H.callback=null},e.unstable_continueExecution=function(){x||p||(x=!0,W(S))},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(H){switch(m){case 1:case 2:case 3:var K=3;break;default:K=m}var q=m;m=K;try{return H()}finally{m=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(H,K){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var q=m;m=H;try{return K()}finally{m=q}},e.unstable_scheduleCallback=function(H,K,q){var L=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?L+q:L):q=L,H){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=q+V,H={id:h++,callback:K,priorityLevel:H,startTime:q,expirationTime:V,sortIndex:-1},q>L?(H.sortIndex=q,t(f,H),r(c)===null&&H===r(f)&&(y?(b(O),O=-1):y=!0,U(N,q-L))):(H.sortIndex=V,t(c,H),x||p||(x=!0,W(S))),H},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(H){var K=m;return function(){var q=m;m=K;try{return H.apply(this,arguments)}finally{m=q}}}})(A0)),A0}var T2;function pz(){return T2||(T2=1,T0.exports=mz()),T0.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 A2;function gz(){if(A2)return Nn;A2=1;
vendor: 14,927 bytes, lines 33-37
33var e=Lg(),t=pz();function r(u){for(var g="https://reactjs.org/docs/error-decoder.html?invariant="+u,j=1;j<arguments.length;j++)g+="&args[]="+encodeURIComponent(arguments[j]);return"Minified React error #"+u+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function s(u,g){o(u,g),o(u+"Capture",g)}function o(u,g){for(i[u]=g,u=0;u<g.length;u++)n.add(g[u])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},d={};function m(u){return c.call(d,u)?!0:c.call(h,u)?!1:f.test(u)?d[u]=!0:(h[u]=!0,!1)}function p(u,g,j,F){if(j!==null&&j.type===0)return!1;switch(typeof g){case"function":case"symbol":return!0;case"boolean":return F?!1:j!==null?!j.acceptsBooleans:(u=u.toLowerCase().slice(0,5),u!=="data-"&&u!=="aria-");default:return!1}}function x(u,g,j,F){if(g===null||typeof g>"u"||p(u,g,j,F))return!0;if(F)return!1;if(j!==null)switch(j.type){case 3:return!g;case 4:return g===!1;case 5:return isNaN(g);case 6:return isNaN(g)||1>g}return!1}function y(u,g,j,F,M,B,Y){this.acceptsBooleans=g===2||g===3||g===4,this.attributeName=F,this.attributeNamespace=M,this.mustUseProperty=j,this.propertyName=u,this.type=g,this.sanitizeURL=B,this.removeEmptyString=Y}var v={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(u){v[u]=new y(u,0,!1,u,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(u){var g=u[0];v[g]=new y(g,1,!1,u[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(u){v[u]=new y(u,2,!1,u.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(u){v[u]=new y(u,2,!1,u,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(u){v[u]=new y(u,3,!1,u.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(u){v[u]=new y(u,3,!0,u,null,!1,!1)}),["capture","download"].forEach(function(u){v[u]=new y(u,4,!1,u,null,!1,!1)}),["cols","rows","size","span"].forEach(function(u){v[u]=new y(u,6,!1,u,null,!1,!1)}),["rowSpan","start"].forEach(function(u){v[u]=new y(u,5,!1,u.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function w(u){return u[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(u){var g=u.replace(b,w);v[g]=new y(g,1,!1,u,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(u){var g=u.replace(b,w);v[g]=new y(g,1,!1,u,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(u){var g=u.replace(b,w);v[g]=new y(g,1,!1,u,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(u){v[u]=new y(u,1,!1,u.toLowerCase(),null,!1,!1)}),v.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(u){v[u]=new y(u,1,!1,u.toLowerCase(),null,!0,!0)});function _(u,g,j,F){var M=v.hasOwnProperty(g)?v[g]:null;(M!==null?M.type!==0:F||!(2<g.length)||g[0]!=="o"&&g[0]!=="O"||g[1]!=="n"&&g[1]!=="N")&&(x(g,j,M,F)&&(j=null),F||M===null?m(g)&&(j===null?u.removeAttribute(g):u.setAttribute(g,""+j)):M.mustUseProperty?u[M.propertyName]=j===null?M.type===3?!1:"":j:(g=M.attributeName,F=M.attributeNamespace,j===null?u.removeAttribute(g):(M=M.type,j=M===3||M===4&&j===!0?"":""+j,F?u.setAttributeNS(F,g,j):u.setAttribute(g,j))))}var N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for("react.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),P=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),H=Symbol.iterator;function K(u){return u===null||typeof u!="object"?null:(u=H&&u[H]||u["@@iterator"],typeof u=="function"?u:null)}var q=Object.assign,L;function V(u){if(L===void 0)try{throw Error()}catch(j){var g=j.stack.trim().match(/\n( *(at )?)/);L=g&&g[1]||""}return`
34`+L+u}var z=!1;function Z(u,g){if(!u||z)return"";z=!0;var j=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(g)if(g=function(){throw Error()},Object.defineProperty(g.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(g,[])}catch(ve){var F=ve}Reflect.construct(u,[],g)}else{try{g.call()}catch(ve){F=ve}u.call(g.prototype)}else{try{throw Error()}catch(ve){F=ve}u()}}catch(ve){if(ve&&F&&typeof ve.stack=="string"){for(var M=ve.stack.split(`
35`),B=F.stack.split(`
36`),Y=M.length-1,ae=B.length-1;1<=Y&&0<=ae&&M[Y]!==B[ae];)ae--;for(;1<=Y&&0<=ae;Y--,ae--)if(M[Y]!==B[ae]){if(Y!==1||ae!==1)do if(Y--,ae--,0>ae||M[Y]!==B[ae]){var ce=`
37`+M[Y].replace(" at new "," at ");return u.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",u.displayName)),ce}while(1<=Y&&0<=ae);break}}}finally{z=!1,Error.prepareStackTrace=j}return(u=u?u.displayName||u.name:"")?V(u):""}function re(u){switch(u.tag){case 5:return V(u.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return u=Z(u.type,!1),u;case 11:return u=Z(u.type.render,!1),u;case 1:return u=Z(u.type,!0),u;default:return""}}function G(u){if(u==null)return null;if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case C:return"Fragment";case k:return"Portal";case R:return"Profiler";case O:return"StrictMode";case T:return"Suspense";case $:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case P:return(u.displayName||"Context")+".Consumer";case A:return(u._context.displayName||"Context")+".Provider";case E:var g=u.render;return u=u.displayName,u||(u=g.displayName||g.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case D:return g=u.displayName||null,g!==null?g:G(u.type)||"Memo";case W:g=u._payload,u=u._init;try{return G(u(g))}catch{}}return null}function X(u){var g=u.type;switch(u.tag){case 24:return"Cache";case 9:return(g.displayName||"Context")+".Consumer";case 10:return(g._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return u=g.render,u=u.displayName||u.name||"",g.displayName||(u!==""?"ForwardRef("+u+")":"ForwardRef");case 7:return"Fragment";case 5:return g;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return G(g);case 8:return g===O?"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 g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g}return null}function ie(u){switch(typeof u){case"boolean":case"number":case"string":case"undefined":return u;case"object":return u;default:return""}}function J(u){var g=u.type;return(u=u.nodeName)&&u.toLowerCase()==="input"&&(g==="checkbox"||g==="radio")}function ue(u){var g=J(u)?"checked":"value",j=Object.getOwnPropertyDescriptor(u.constructor.prototype,g),F=""+u[g];if(!u.hasOwnProperty(g)&&typeof j<"u"&&typeof j.get=="function"&&typeof j.set=="function"){var M=j.get,B=j.set;return Object.defineProperty(u,g,{configurable:!0,get:function(){return M.call(this)},set:function(Y){F=""+Y,B.call(this,Y)}}),Object.defineProperty(u,g,{enumerable:j.enumerable}),{getValue:function(){return F},setValue:function(Y){F=""+Y},stopTracking:function(){u._valueTracker=null,delete u[g]}}}}function ge(u){u._valueTracker||(u._valueTracker=ue(u))}function fe(u){if(!u)return!1;var g=u._valueTracker;if(!g)return!0;var j=g.getValue(),F="";return u&&(F=J(u)?u.checked?"true":"false":u.value),u=F,u!==j?(g.setValue(u),!0):!1}function Ee(u){if(u=u||(typeof document<"u"?document:void 0),typeof u>"u")return null;try{return u.activeElement||u.body}catch{return u.body}}function Oe(u,g){var j=g.checked;return q({},g,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:j??u._wrapperState.initialChecked})}function Ve(u,g){var j=g.defaultValue==null?"":g.defaultValue,F=g.checked!=null?g.checked:g.defaultChecked;j=ie(g.value!=null?g.value:j),u._wrapperState={initialChecked:F,initialValue:j,controlled:g.type==="checkbox"||g.type==="radio"?g.checked!=null:g.value!=null}}function Ae(u,g){g=g.checked,g!=null&&_(u,"checked",g,!1)}function tt(u,g){Ae(u,g);var j=ie(g.value),F=g.type;if(j!=null)F==="number"?(j===0&&u.value===""||u.value!=j)&&(u.value=""+j):u.value!==""+j&&(u.value=""+j);else if(F==="submit"||F==="reset"){u.removeAttribute("value");return}g.hasOwnProperty("value")?xe(u,g.type,j):g.hasOwnProperty("defaultValue")&&xe(u,g.type,ie(g.defaultValue)),g.checked==null&&g.defaultChecked!=null&&(u.defaultChecked=!!g.defaultChecked)}function ye(u,g,j){if(g.hasOwnProperty("value")||g.hasOwnProperty("defaultValue")){var F=g.type;if(!(F!=="submit"&&F!=="reset"||g.value!==void 0&&g.value!==null))return;g=""+u._wrapperState.initialValue,j||g===u.value||(u.value=g),u.defaultValue=g}j=u.name,j!==""&&(u.name=""),u.defaultChecked=!!u._wrapperState.initialChecked,j!==""&&(u.name=j)}function xe(u,g,j){(g!=="number"||Ee(u.ownerDocument)!==u)&&(j==null?u.defaultValue=""+u._wrapperState.initialValue:u.defaultValue!==""+j&&(u.defaultValue=""+j))}var Ce=Array.isArray;function Re(u,g,j,F){if(u=u.options,g){g={};for(var M=0;M<j.length;M++)g["$"+j[M]]=!0;for(j=0;j<u.length;j++)M=g.hasOwnProperty("$"+u[j].value),u[j].selected!==M&&(u[j].selected=M),M&&F&&(u[j].defaultSelected=!0)}else{for(j=""+ie(j),g=null,M=0;M<u.length;M++){if(u[M].value===j){u[M].selected=!0,F&&(u[M].defaultSelected=!0);return}g!==null||u[M].disabled||(g=u[M])}g!==null&&(g.selected=!0)}}function _e(u,g){if(g.dangerouslySetInnerHTML!=null)throw Error(r(91));return q({},g,{value:void 0,defaultValue:void 0,children:""+u._wrapperState.initialValue})}function dt(u,g){var j=g.value;if(j==null){if(j=g.children,g=g.defaultValue,j!=null){if(g!=null)throw Error(r(92));if(Ce(j)){if(1<j.length)throw Error(r(93));j=j[0]}g=j}g==null&&(g=""),j=g}u._wrapperState={initialValue:ie(j)}}function pt(u,g){var j=ie(g.value),F=ie(g.defaultValue);j!=null&&(j=""+j,j!==u.value&&(u.value=j),g.defaultValue==null&&u.defaultValue!==j&&(u.defaultValue=j)),F!=null&&(u.defaultValue=""+F)}function gt(u){var g=u.textContent;g===u._wrapperState.initialValue&&g!==""&&g!==null&&(u.value=g)}function be(u){switch(u){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 ke(u,g){return u==null||u==="http://www.w3.org/1999/xhtml"?be(g):u==="http://www.w3.org/2000/svg"&&g==="foreignObject"?"http://www.w3.org/1999/xhtml":u}var He,wt=(function(u){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(g,j,F,M){MSApp.execUnsafeLocalFunction(function(){return u(g,j,F,M)})}:u})(function(u,g){if(u.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in u)u.innerHTML=g;else{for(He=He||document.createElement("div"),He.innerHTML="<svg>"+g.valueOf().toString()+"</svg>",g=He.firstChild;u.firstChild;)u.removeChild(u.firstChild);for(;g.firstChild;)u.appendChild(g.firstChild)}});function it(u,g){if(g){var j=u.firstChild;if(j&&j===u.lastChild&&j.nodeType===3){j.nodeValue=g;return}}u.textContent=g}var Xt={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},xi=["Webkit","ms","Moz","O"];Object.keys(Xt).forEach(function(u){xi.forEach(function(g){g=g+u.charAt(0).toUpperCase()+u.substring(1),Xt[g]=Xt[u]})});function ea(u,g,j){return g==null||typeof g=="boolean"||g===""?"":j||typeof g!="number"||g===0||Xt.hasOwnProperty(u)&&Xt[u]?(""+g).trim():g+"px"}function ts(u,g){u=u.style;for(var j in g)if(g.hasOwnProperty(j)){var F=j.indexOf("--")===0,M=ea(j,g[j],F);j==="float"&&(j="cssFloat"),F?u.setProperty(j,M):u[j]=M}}var ro=q({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 Wr(u,g){if(g){if(ro[u]&&(g.children!=null||g.dangerouslySetInnerHTML!=null))throw Error(r(137,u));if(g.dangerouslySetInnerHTML!=null){if(g.children!=null)throw Error(r(60));if(typeof g.dangerouslySetInnerHTML!="object"||!("__html"in g.dangerouslySetInnerHTML))throw Error(r(61))}if(g.style!=null&&typeof g.style!="object")throw Error(r(62))}}function Ua(u,g){if(u.indexOf("-")===-1)return typeof g.is=="str
37ing";switch(u){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Rn=null;function Uy(u){return u=u.target||u.srcElement||window,u.correspondingUseElement&&(u=u.correspondingUseElement),u.nodeType===3?u.parentNode:u}var Hy=null,gl=null,yl=null;function Uk(u){if(u=Uu(u)){if(typeof Hy!="function")throw Error(r(280));var g=u.stateNode;g&&(g=Mh(g),Hy(u.stateNode,u.type,g))}}function Hk(u){gl?yl?yl.push(u):yl=[u]:gl=u}function Vk(){if(gl){var u=gl,g=yl;if(yl=gl=null,Uk(u),g)for(u=0;u<g.length;u++)Uk(g[u])}}function Wk(u,g){return u(g)}function Kk(){}var Vy=!1;function Gk(u,g,j){if(Vy)return u(g,j);Vy=!0;try{return Wk(u,g,j)}finally{Vy=!1,(gl!==null||yl!==null)&&(Kk(),Vk())}}function _u(u,g){var j=u.stateNode;if(j===null)return null;var F=Mh(j);if(F===null)return null;j=F[g];e:switch(g){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(F=!F.disabled)||(u=u.type,F=!(u==="button"||u==="input"||u==="select"||u==="textarea")),u=!F;break e;default:u=!1}if(u)return null;if(j&&typeof j!="function")throw Error(r(231,g,typeof j));return j}var Wy=!1;if(l)try{var ju={};Object.defineProperty(ju,"passive",{get:function(){Wy=!0}}),window.addEventListener("test",ju,ju),window.removeEventListener("test",ju,ju)}catch{Wy=!1}function gB(u,g,j,F,M,B,Y,ae,ce){var ve=Array.prototype.slice.call(arguments,3);try{g.apply(j,ve)}catch(Ne){this.onError(Ne)}}var Nu=!1,mh=null,ph=!1,Ky=null,yB={onError:function(u){Nu=!0,mh=u}};function vB(u,g,j,F,M,B,Y,ae,ce){Nu=!1,mh=null,gB.apply(yB,arguments)}function xB(u,g,j,F,M,B,Y,ae,ce){if(vB.apply(this,arguments),Nu){if(Nu){var ve=mh;Nu=!1,mh=null}else throw Error(r(198));ph||(ph=!0,Ky=ve)}}function no(u){var g=u,j=u;if(u.alternate)for(;g.return;)g=g.return;else{u=g;do g=u,(g.flags&4098)!==0&&(j=g.return),u=g.return;while(u)}return g.tag===3?j:null}function Yk(u){if(u.tag===13){var g=u.memoizedState;if(g===null&&(u=u.alternate,u!==null&&(g=u.memoizedState)),g!==null)return g.dehydrated}return null}function Qk(u){if(no(u)!==u)throw Error(r(188))}function bB(u){var g=u.alternate;if(!g){if(g=no(u),g===null)throw Error(r(188));return g!==u?null:u}for(var j=u,F=g;;){var M=j.return;if(M===null)break;var B=M.alternate;if(B===null){if(F=M.return,F!==null){j=F;continue}break}if(M.child===B.child){for(B=M.child;B;){if(B===j)return Qk(M),u;if(B===F)return Qk(M),g;B=B.sibling}throw Error(r(188))}if(j.return!==F.return)j=M,F=B;else{for(var Y=!1,ae=M.child;ae;){if(ae===j){Y=!0,j=M,F=B;break}if(ae===F){Y=!0,F=M,j=B;break}ae=ae.sibling}if(!Y){for(ae=B.child;ae;){if(ae===j){Y=!0,j=B,F=M;break}if(ae===F){Y=!0,F=B,j=M;break}ae=ae.sibling}if(!Y)throw Error(r(189))}}if(j.alternate!==F)throw Error(r(190))}if(j.tag!==3)throw Error(r(188));return j.stateNode.current===j?u:g}function Xk(u){return u=bB(u),u!==null?Zk(u):null}function Zk(u){if(u.tag===5||u.tag===6)return u;for(u=u.child;u!==null;){var g=Zk(u);if(g!==null)return g;u=u.sibling}return null}var Jk=t.unstable_scheduleCallback,eC=t.unstable_cancelCallback,wB=t.unstable_shouldYield,_B=t.unstable_requestPaint,yr=t.unstable_now,jB=t.unstable_getCurrentPriorityLevel,Gy=t.unstable_ImmediatePriority,tC=t.unstable_UserBlockingPriority,gh=t.unstable_NormalPriority,NB=t.unstable_LowPriority,rC=t.unstable_IdlePriority,yh=null,Ha=null;function SB(u){if(Ha&&typeof Ha.onCommitFiberRoot=="function")try{Ha.onCommitFiberRoot(yh,u,void 0,(u.current.flags&128)===128)}catch{}}var va=Math.clz32?Math.clz32:FB,kB=Math.log,CB=Math.LN2;function FB(u){return u>>>=0,u===0?32:31-(kB(u)/CB|0)|0}var vh=64,xh=4194304;function Su(u){switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function bh(u,g){var j=u.pendingLanes;if(j===0)return 0;var F=0,M=u.suspendedLanes,B=u.pingedLanes,Y=j&268435455;if(Y!==0){var ae=Y&~M;ae!==0?F=Su(ae):(B&=Y,B!==0&&(F=Su(B)))}else Y=j&~M,Y!==0?F=Su(Y):B!==0&&(F=Su(B));if(F===0)return 0;if(g!==0&&g!==F&&(g&M)===0&&(M=F&-F,B=g&-g,M>=B||M===16&&(B&4194240)!==0))return g;if((F&4)!==0&&(F|=j&16),g=u.entangledLanes,g!==0)for(u=u.entanglements,g&=F;0<g;)j=31-va(g),M=1<<j,F|=u[j],g&=~M;return F}function OB(u,g){switch(u){case 1:case 2:case 4:return g+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 g+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 EB(u,g){for(var j=u.suspendedLanes,F=u.pingedLanes,M=u.expirationTimes,B=u.pendingLanes;0<B;){var Y=31-va(B),ae=1<<Y,ce=M[Y];ce===-1?((ae&j)===0||(ae&F)!==0)&&(M[Y]=OB(ae,g)):ce<=g&&(u.expiredLanes|=ae),B&=~ae}}function Yy(u){return u=u.pendingLanes&-1073741825,u!==0?u:u&1073741824?1073741824:0}function nC(){var u=vh;return vh<<=1,(vh&4194240)===0&&(vh=64),u}function Qy(u){for(var g=[],j=0;31>j;j++)g.push(u);return g}function ku(u,g,j){u.pendingLanes|=g,g!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,g=31-va(g),u[g]=j}function PB(u,g){var j=u.pendingLanes&~g;u.pendingLanes=g,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=g,u.mutableReadLanes&=g,u.entangledLanes&=g,g=u.entanglements;var F=u.eventTimes;for(u=u.expirationTimes;0<j;){var M=31-va(j),B=1<<M;
vendor: 25,153 bytes, lines 37-38
37g[M]=0,F[M]=-1,u[M]=-1,j&=~B}}function Xy(u,g){var j=u.entangledLanes|=g;for(u=u.entanglements;j;){var F=31-va(j),M=1<<F;M&g|u[F]&g&&(u[F]|=g),j&=~M}}var Bt=0;function aC(u){return u&=-u,1<u?4<u?(u&268435455)!==0?16:536870912:4:1}var iC,Zy,sC,oC,lC,Jy=!1,wh=[],rs=null,ns=null,as=null,Cu=new Map,Fu=new Map,is=[],TB="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 cC(u,g){switch(u){case"focusin":case"focusout":rs=null;break;case"dragenter":case"dragleave":ns=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":Cu.delete(g.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fu.delete(g.pointerId)}}function Ou(u,g,j,F,M,B){return u===null||u.nativeEvent!==B?(u={blockedOn:g,domEventName:j,eventSystemFlags:F,nativeEvent:B,targetContainers:[M]},g!==null&&(g=Uu(g),g!==null&&Zy(g)),u):(u.eventSystemFlags|=F,g=u.targetContainers,M!==null&&g.indexOf(M)===-1&&g.push(M),u)}function AB(u,g,j,F,M){switch(g){case"focusin":return rs=Ou(rs,u,g,j,F,M),!0;case"dragenter":return ns=Ou(ns,u,g,j,F,M),!0;case"mouseover":return as=Ou(as,u,g,j,F,M),!0;case"pointerover":var B=M.pointerId;return Cu.set(B,Ou(Cu.get(B)||null,u,g,j,F,M)),!0;case"gotpointercapture":return B=M.pointerId,Fu.set(B,Ou(Fu.get(B)||null,u,g,j,F,M)),!0}return!1}function uC(u){var g=ao(u.target);if(g!==null){var j=no(g);if(j!==null){if(g=j.tag,g===13){if(g=Yk(j),g!==null){u.blockedOn=g,lC(u.priority,function(){sC(j)});return}}else if(g===3&&j.stateNode.current.memoizedState.isDehydrated){u.blockedOn=j.tag===3?j.stateNode.containerInfo:null;return}}}u.blockedOn=null}function _h(u){if(u.blockedOn!==null)return!1;for(var g=u.targetContainers;0<g.length;){var j=tv(u.domEventName,u.eventSystemFlags,g[0],u.nativeEvent);if(j===null){j=u.nativeEvent;var F=new j.constructor(j.type,j);Rn=F,j.target.dispatchEvent(F),Rn=null}else return g=Uu(j),g!==null&&Zy(g),u.blockedOn=j,!1;g.shift()}return!0}function dC(u,g,j){_h(u)&&j.delete(g)}function RB(){Jy=!1,rs!==null&&_h(rs)&&(rs=null),ns!==null&&_h(ns)&&(ns=null),as!==null&&_h(as)&&(as=null),Cu.forEach(dC),Fu.forEach(dC)}function Eu(u,g){u.blockedOn===g&&(u.blockedOn=null,Jy||(Jy=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,RB)))}function Pu(u){function g(M){return Eu(M,u)}if(0<wh.length){Eu(wh[0],u);for(var j=1;j<wh.length;j++){var F=wh[j];F.blockedOn===u&&(F.blockedOn=null)}}for(rs!==null&&Eu(rs,u),ns!==null&&Eu(ns,u),as!==null&&Eu(as,u),Cu.forEach(g),Fu.forEach(g),j=0;j<is.length;j++)F=is[j],F.blockedOn===u&&(F.blockedOn=null);for(;0<is.length&&(j=is[0],j.blockedOn===null);)uC(j),j.blockedOn===null&&is.shift()}var vl=N.ReactCurrentBatchConfig,jh=!0;function IB(u,g,j,F){var M=Bt,B=vl.transition;vl.transition=null;try{Bt=1,ev(u,g,j,F)}finally{Bt=M,vl.transition=B}}function MB(u,g,j,F){var M=Bt,B=vl.transition;vl.transition=null;try{Bt=4,ev(u,g,j,F)}finally{Bt=M,vl.transition=B}}function ev(u,g,j,F){if(jh){var M=tv(u,g,j,F);if(M===null)vv(u,g,F,Nh,j),cC(u,F);else if(AB(M,u,g,j,F))F.stopPropagation();else if(cC(u,F),g&4&&-1<TB.indexOf(u)){for(;M!==null;){var B=Uu(M);if(B!==null&&iC(B),B=tv(u,g,j,F),B===null&&vv(u,g,F,Nh,j),B===M)break;M=B}M!==null&&F.stopPropagation()}else vv(u,g,F,null,j)}}var Nh=null;function tv(u,g,j,F){if(Nh=null,u=Uy(F),u=ao(u),u!==null)if(g=no(u),g===null)u=null;else if(j=g.tag,j===13){if(u=Yk(g),u!==null)return u;u=null}else if(j===3){if(g.stateNode.current.memoizedState.isDehydrated)return g.tag===3?g.stateNode.containerInfo:null;u=null}else g!==u&&(u=null);return Nh=u,null}function fC(u){switch(u){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(jB()){case Gy:return 1;case tC:return 4;case gh:case NB:return 16;case rC:return 536870912;default:return 16}default:return 16}}var ss=null,rv=null,Sh=null;function hC(){if(Sh)return Sh;var u,g=rv,j=g.length,F,M="value"in ss?ss.value:ss.textContent,B=M.length;for(u=0;u<j&&g[u]===M[u];u++);var Y=j-u;for(F=1;F<=Y&&g[j-F]===M[B-F];F++);return Sh=M.slice(u,1<F?1-F:void 0)}function kh(u){var g=u.keyCode;return"charCode"in u?(u=u.charCode,u===0&&g===13&&(u=13)):u=g,u===10&&(u=13),32<=u||u===13?u:0}function Ch(){return!0}function mC(){return!1}function In(u){function g(j,F,M,B,Y){this._reactName=j,this._targetInst=M,this.type=F,this.nativeEvent=B,this.target=Y,this.currentTarget=null;for(var ae in u)u.hasOwnProperty(ae)&&(j=u[ae],this[ae]=j?j(B):B[ae]);return this.isDefaultPrevented=(B.defaultPrevented!=null?B.defaultPrevented:B.returnValue===!1)?Ch:mC,this.isPropagationStopped=mC,this}return q(g.prototype,{preventDefault:function(){this.defaultPrevented=!0;var j=this.nativeEvent;j&&(j.preventDefault?j.preventDefault():typeof j.returnValue!="unknown"&&(j.returnValue=!1),this.isDefaultPrevented=Ch)},stopPropagation:function(){var j=this.nativeEvent;j&&(j.stopPropagation?j.stopPropagation():typeof j.cancelBubble!="unknown"&&(j.cancelBubble=!0),this.isPropagationStopped=Ch)},persist:function(){},isPersistent:Ch}),g}var xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(u){return u.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nv=In(xl),Tu=q({},xl,{view:0,detail:0}),LB=In(Tu),av,iv,Au,Fh=q({},Tu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ov,button:0,buttons:0,relatedTarget:function(u){return u.relatedTarget===void 0?u.fromElement===u.srcElement?u.toElement:u.fromElement:u.relatedTarget},movementX:function(u){return"movementX"in u?u.movementX:(u!==Au&&(Au&&u.type==="mousemove"?(av=u.screenX-Au.screenX,iv=u.screenY-Au.screenY):iv=av=0,Au=u),av)},movementY:function(u){return"movementY"in u?u.movementY:iv}}),pC=In(Fh),DB=q({},Fh,{dataTransfer:0}),$B=In(DB),qB=q({},Tu,{relatedTarget:0}),sv=In(qB),BB=q({},xl,{animationName:0,elapsedTime:0,pseudoElement:0}),zB=In(BB),UB=q({},xl,{clipboardData:function(u){return"clipboardData"in u?u.clipboardData:window.clipboardData}}),HB=In(UB),VB=q({},xl,{data:0}),gC=In(VB),WB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},KB={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"},GB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YB(u){var g=this.nativeEvent;return g.getModifierState?g.getModifierState(u):(u=GB[u])?!!g[u]:!1}function ov(){return YB}var QB=q({},Tu,{key:function(u){if(u.key){var g=WB[u.key]||u.key;if(g!=="Unidentified")return g}return u.type==="keypress"?(u=kh(u),u===13?"Enter":String.fromCharCode(u)):u.type==="keydown"||u.type==="keyup"?KB[u.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ov,charCode:function(u){return u.type==="keypress"?kh(u):0},keyCode:function(u){return u.type==="keydown"||u.type==="keyup"?u.keyCode:0},which:function(u){return u.type==="keypress"?kh(u):u.type==="keydown"||u.type==="keyup"?u.keyCode:0}}),XB=In(QB),ZB=q({},Fh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yC=In(ZB),JB=q({},Tu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ov}),e7=In(JB),t7=q({},xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),r7=In(t7),n7=q({},Fh,{deltaX:function(u){return"deltaX"in u?u.deltaX:"wheelDeltaX"in u?-u.wheelDeltaX:0},deltaY:function(u){return"deltaY"in u?u.deltaY:"wheelDeltaY"in u?-u.wheelDeltaY:"wheelDelta"in u?-u.wheelDelta:0},deltaZ:0,deltaMode:0}),a7=In(n7),i7=[9,13,27,32],lv=l&&"CompositionEvent"in window,Ru=null;l&&"documentMode"in document&&(Ru=document.documentMode);var s7=l&&"TextEvent"in window&&!Ru,vC=l&&(!lv||Ru&&8<Ru&&11>=Ru),xC=" ",bC=!1;function wC(u,g){switch(u){case"keyup":return i7.indexOf(g.keyCode)!==-1;case"keydown":return g.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _C(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var bl=!1;function o7(u,g){switch(u){case"compositionend":return _C(g);case"keypress":return g.which!==32?null:(bC=!0,xC);case"textInput":return u=g.data,u===xC&&bC?null:u;default:return null}}function l7(u,g){if(bl)return u==="compositionend"||!lv&&wC(u,g)?(u=hC(),Sh=rv=ss=null,bl=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(g.ctrlKey||g.altKey||g.metaKey)||g.ctrlKey&&g.altKey){if(g.char&&1<g.char.length)return g.char;if(g.which)return String.fromCharCode(g.which)}return null;case"compositionend":return vC&&g.locale!=="ko"?null:g.data;default:return null}}var c7={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 jC(u){var g=u&&u.nodeName&&u.nodeName.toLowerCase();return g==="input"?!!c7[u.type]:g==="textarea"}function NC(u,g,j,F){Hk(F),g=Ah(g,"onChange"),0<g.length&&(j=new nv("onChange","change",null,j,F),u.push({event:j,listeners:g}))}var Iu=null,Mu=null;function u7(u){zC(u,0)}function Oh(u){var g=Sl(u);if(fe(g))return u}function d7(u,g){if(u==="change")return g}var SC=!1;if(l){var cv;if(l){var uv="oninput"in document;if(!uv){var kC=document.createElement("div");kC.setAttribute("oninput","return;"),uv=typeof kC.oninput=="function"}cv=uv}else cv=!1;SC=cv&&(!document.documentMode||9<document.documentMode)}function CC(){Iu&&(Iu.detachEvent("onpropertychange",FC),Mu=Iu=null)}function FC(u){if(u.propertyName==="value"&&Oh(Mu)){var g=[];NC(g,Mu,u,Uy(u)),Gk(u7,g)}}function f7(u,g,j){u==="focusin"?(CC(),Iu=g,Mu=j,Iu.attachEvent("onpropertychange",FC)):u==="focusout"&&CC()}function h7(u){if(u==="selectionchange"||u==="keyup"||u==="keydown")return Oh(Mu)}function m7(u,g){if(u==="click")return Oh(g)}function p7(u,g){if(u==="input"||u==="change")return Oh(g)}function g7(u,g){return u===g&&(u!==0||1/u===1/g)||u!==u&&g!==g}var xa=typeof Object.is=="function"?Object.is:g7;function Lu(u,g){if(xa(u,g))return!0;if(typeof u!="object"||u===null||typeof g!="object"||g===null)return!1;var j=Object.keys(u),F=Object.keys(g);if(j.length!==F.length)return!1;for(F=0;F<j.length;F++){var M=j[F];if(!c.call(g,M)||!xa(u[M],g[M]))return!1}return!0}function OC(u){for(;u&&u.firstChild;)u=u.firstChild;return u}function EC(u,g){var j=OC(u);u=0;for(var F;j;){if(j.nodeType===3){if(F=u+j.textContent.length,u<=g&&F>=g)return{node:j,offset:g-u};u=F}e:{for(;j;){if(j.nextSibling){j=j.nextSibling;break e}j=j.parentNode}j=void 0}j=OC(j)}}function PC(u,g){return u&&g?u===g?!0:u&&u.nodeType===3?!1:g&&g.nodeType===3?PC(u,g.parentNode):"contains"in u?u.contains(g):u.compareDocumentPosition?!!(u.compareDocumentPosition(g)&16):!1:!1}function TC(){for(var u=window,g=Ee();g instanceof u.HTMLIFrameElement;){try{var j=typeof g.contentWindow.location.href=="string"}catch{j=!1}if(j)u=g.contentWindow;else break;g=Ee(u.document)}return g}function dv(u){var g=u&&u.nodeName&&u.nodeName.toLowerCase();return g&&(g==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||g==="textarea"||u.contentEditable==="true")}function y7(u){var g=TC(),j=u.focusedElem,F=u.selectionRange;if(g!==j&&j&&j.ownerDocument&&PC(j.ownerDocument.documentElement,j)){if(F!==null&&dv(j)){if(g=F.start,u=F.end,u===void 0&&(u=g),"selectionStart"in j)j.selectionStart=g,j.selectionEnd=Math.min(u,j.value.length);else if(u=(g=j.ownerDocument||document)&&g.defaultView||window,u.getSelection){u=u.getSelection();var M=j.textContent.length,B=Math.min(F.start,M);F=F.end===void 0?B:Math.min(F.end,M),!u.extend&&B>F&&(M=F,F=B,B=M),M=EC(j,B);var Y=EC(j,F);M&&Y&&(u.rangeCount!==1||u.anchorNode!==M.node||u.anchorOffset!==M.offset||u.focusNode!==Y.node||u.focusOffset!==Y.offset)&&(g=g.createRange(),g.setStart(M.node,M.offset),u.removeAllRanges(),B>F?(u.addRange(g),u.extend(Y.node,Y.offset)):(g.setEnd(Y.node,Y.offset),u.addRange(g)))}}for(g=[],u=j;u=u.parentNode;)u.nodeType===1&&g.push({element:u,left:u.scrollLeft,top:u.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<g.length;j++)u=g[j],u.element.scrollLeft=u.left,u.element.scrollTop=u.top}}var v7=l&&"documentMode"in document&&11>=document.documentMode,wl=null,fv=null,Du=null,hv=!1;function AC(u,g,j){var F=j.window===j?j.document:j.nodeType===9?j:j.ownerDocument;hv||wl==null||wl!==Ee(F)||(F=wl,"selectionStart"in F&&dv(F)?F={start:F.selectionStart,end:F.selectionEnd}:(F=(F.ownerDocument&&F.ownerDocument.defaultView||window).getSelection(),F={anchorNode:F.anchorNode,anchorOffset:F.anchorOffset,focusNode:F.focusNode,focusOffset:F.focusOffset}),Du&&Lu(Du,F)||(Du=F,F=Ah(fv,"onSelect"),0<F.length&&(g=new nv("onSelect","select",null,g,j),u.push({event:g,listeners:F}),g.target=wl)))}function Eh(u,g){var j={};return j[u.toLowerCase()]=g.toLowerCase(),j["Webkit"+u]="webkit"+g,j["Moz"+u]="moz"+g,j}var _l={animationend:Eh("Animation","AnimationEnd"),animationiteration:Eh("Animation","AnimationIteration"),animationstart:Eh("Animation","AnimationStart"),transitionend:Eh("Transition","TransitionEnd")},mv={},RC={};l&&(RC=document.createElement("div").style,"AnimationEvent"in window||(delete _l.animationend.animation,delete _l.animationiteration.animation,delete _l.animationstart.animation),"TransitionEvent"in window||delete _l.transitionend.transition);function Ph(u){if(mv[u])return mv[u];if(!_l[u])return u;var g=_l[u],j;for(j in g)if(g.hasOwnProperty(j)&&j in RC)return mv[u]=g[j];return u}var IC=Ph("animationend"),MC=Ph("animationiteration"),LC=Ph("animationstart"),DC=Ph("transitionend"),$C=new Map,qC="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 os(u,g){$C.set(u,g),s(g,[u])}for(var pv=0;pv<qC.length;pv++){var gv=qC[pv],x7=gv.toLowerCase(),b7=gv[0].toUpperCase()+gv.slice(1);os(x7,"on"+b7)}os(IC,"onAnimationEnd"),os(MC,"onAnimationIteration"),os(LC,"onAnimationStart"),os("dblclick","onDoubleClick"),os("focusin","onFocus"),os("focusout","onBlur"),os(DC,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $u="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(" "),w7=new Set("cancel close invalid load scroll toggle".split(" ").concat($u));function BC(u,g,j){var F=u.type||"unknown-event";u.currentTarget=j,xB(F,g,void 0,u),u.currentTarget=null}function zC(u,g){g=(g&4)!==0;for(var j=0;j<u.length;j++){var F=u[j],M=F.event;F=F.listeners;e:{var B=void 0;if(g)for(var Y=F.length-1;0<=Y;Y--){var ae=F[Y],ce=ae.instance,ve=ae.currentTarget;if(ae=ae.listener,ce!==B&&M.isPropagationStopped())break e;BC(M,ae,ve),B=ce}else for(Y=0;Y<F.length;Y++){if(ae=F[Y],ce=ae.instance,ve=ae.currentTarget,ae=ae.listener,ce!==B&&M.isPropagationStopped())break e;BC(M,ae,ve),B=ce}}}if(ph)throw u=Ky,ph=!1,Ky=null,u}function ar(u,g){var j=g[Nv];j===void 0&&(j=g[Nv]=new Set);var F=u+"__bubble";j.has(F)||(UC(g,u,2,!1),j.add(F))}function yv(u,g,j){var F=0;g&&(F|=4),UC(j,u,F,g)}var Th="_reactListening"+Math.random().toString(36).slice(2);function qu(u){if(!u[Th]){u[Th]=!0,n.forEach(function(j){j!=="selectionchange"&&(w7.has(j)||yv(j,!1,u),yv(j,!0,u))});var g=u.nodeType===9?u:u.ownerDocument;g===null||g[Th]||(g[Th]=!0,yv("selectionchange",!1,g))}}function UC(u,g,j,F){switch(fC(g)){case 1:var M=IB;break;case 4:M=MB;break;default:M=ev}j=M.bind(null,g,j,u),M=void 0,!Wy||g!=="touchstart"&&g!=="touchmove"&&g!=="wheel"||(M=!0),F?M!==void 0?u.addEventListener(g,j,{capture:!0,passive:M}):u.addEventListener(g,j,!0):M!==void 0?u.addEventListener(g,j,{passive:M}):u.addEventListener(g,j,!1)}function vv(u,g,j,F,M){var B=F;if((g&1)===0&&(g&2)===0&&F!==null)e:for(;;){if(F===null)return;var Y=F.tag;if(Y===3||Y===4){var ae=F.stateNode.containerInfo;if(ae===M||ae.nodeType===8&&ae.parentNode===M)break;if(Y===4)for(Y=F.return;Y!==null;){var ce=Y.tag;if((ce===3||ce===4)&&(ce=Y.stateNode.containerInfo,ce===M||ce.nodeType===8&&ce.parentNode===M))return;Y=Y.return}for(;ae!==null;){if(Y=ao(ae),Y===null)return;if(ce=Y.tag,ce===5||ce===6){F=B=Y;continue e}ae=ae.parentNode}}F=F.return}Gk(function(){var ve=B,Ne=Uy(j),Se=[];e:{var je=$C.get(u);if(je!==void 0){var We=nv,Qe=u;switch(u){case"keypress":if(kh(j)===0)break e;case"keydown":case"keyup":We=XB;break;case"focusin":Qe="focus",We=sv;break;case"focusout":Qe="blur",We=sv;break;case"beforeblur":case"afterblur":We=sv;break;case"click":if(j.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":We=pC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":We=$B;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":We=e7;break;case IC:case MC:case LC:We=zB;break;case DC:We=r7;break;case"scroll":We=LB;break;case"wheel":We=a7;break;case"copy":case"cut":case"paste":We=HB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":We=yC}var et=(g&4)!==0,vr=!et&&u==="scroll",me=et?je!==null?je+"Capture":null:je;et=[];for(var de=ve,pe;de!==null;){pe=de;var Pe=pe.stateNode;if(pe.tag===5&&Pe!==null&&(pe=Pe,me!==null&&(Pe=_u(de,me),Pe!=null&&et.push(Bu(de,Pe,pe)))),vr)break;de=de.return}0<et.length&&(je=new We(je,Qe,null,j,Ne),Se.push({event:je,listeners:et}))}}if((g&7)===0){e:{if(je=u==="mouseover"||u==="pointerover",We=u==="mouseout"||u==="pointerout",je&&j!==Rn&&(Qe=j.relatedTarget||j.fromElement)&&(ao(Qe)||Qe[bi]))break e;if((We||je)&&(je=Ne.window===Ne?Ne:(je=Ne.ownerDocument)?je.defaultView||je.parentWindow:window,We?(Qe=j.relatedTarget||j.toElement,We=ve,Qe=Qe?ao(Qe):null,Qe!==null&&(vr=no(Qe),Qe!==vr||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(We=null,Qe=ve),We!==Qe)){if(et=pC,Pe="onMouseLeave",me="onMouseEnter",de="mouse",(u==="pointerout"||u==="pointerover")&&(et=yC,Pe="onPointerLeave",me="onPointerEnter",de="pointer"),vr=We==null?je:Sl(We),pe=Qe==null?je:Sl(Qe),je=new et(Pe,de+"leave",We,j,Ne),je.target=vr,je.relatedTarget=pe,Pe=null,ao(Ne)===ve&&(et=new et(me,de+"enter",Qe,j,Ne),et.target=pe,et.relatedTarget=vr,Pe=et),vr=Pe,We&&Qe)t:{for(et=We,me=Qe,de=0,pe=et;pe;pe=jl(pe))de++;for(pe=0,Pe=me;Pe;Pe=jl(Pe))pe++;for(;0<de-pe;)et=jl(et),de--;for(;0<pe-de;)me=jl(me),pe--;for(;de--;){if(et===me||me!==null&&et===me.alternate)break t;et=jl(et),me=jl(me)}et=null}else et=null;We!==null&&HC(Se,je,We,et,!1),Qe!==null&&vr!==null&&HC(Se,vr,Qe,et,!0)}}e:{if(je=ve?Sl(ve):window,We=je.nodeName&&je.nodeName.toLowerCase(),We==="select"||We==="input"&&je.type==="file")var rt=d7;else if(jC(je))if(SC)rt=p7;else{rt=h7;var st=f7}else(We=je.nodeName)&&We.toLowerCase()==="input"&&(je.type==="checkbox"||je.type==="radio")&&(rt=m7);if(rt&&(rt=rt(u,ve))){NC(Se,rt,j,Ne);break e}st&&st(u,je,ve),u==="focusout"&&(st=je._wrapperState)&&st.controlled&&je.type==="number"&&xe(je,"number",je.value)}switch(st=ve?Sl(ve):window,u){case"focusin":(jC(st)||st.contentEditable==="true")&&(wl=st,fv=ve,Du=null);break;case"focusout":Du=fv=wl=null;break;case"mousedown":hv=!0;break;case"contextmenu":case"mouseup":case"dragend":hv=!1,AC(Se,j,Ne);break;case"selectionchange":if(v7)break;case"keydown":case"keyup":AC(Se,j,Ne)}var ot;if(lv)e:{switch(u){case"compositionstart":var ft="onCompositionStart";break e;case"compositionend":ft="onCompositionEnd";break e;case"compositionupdate":ft="onCompositionUpdate";break e}ft=void 0}else bl?wC(u,j)&&(ft="onCompositionEnd"):u==="keydown"&&j.keyCode===229&&(ft="onCompositionStart");ft&&(vC&&j.locale!=="ko"&&(bl||ft!=="onCompositionStart"?ft==="onCompositionEnd"&&bl&&(ot=hC()):(ss=Ne,rv="value"in ss?ss.value:ss.textContent,bl=!0)),st=Ah(ve,ft),0<st.length&&(ft=new gC(ft,u,null,j,Ne),Se.push({event:ft,listeners:st}),ot?ft.data=ot:(ot=_C(j),ot!==null&&(ft.data=ot)))),(ot=s7?o7(u,j):l7(u,j))&&(ve=Ah(ve,"onBeforeInput"),0<ve.length&&(Ne=new gC("onBeforeInput","beforeinput",null,j,Ne),Se.push({event:Ne,listeners:ve}),Ne.data=ot))}zC(Se,g)})}function Bu(u,g,j){return{instance:u,listener:g,currentTarget:j}}function Ah(u,g){for(var j=g+"Capture",F=[];u!==null;){var M=u,B=M.stateNode;M.tag===5&&B!==null&&(M=B,B=_u(u,j),B!=null&&F.unshift(Bu(u,B,M)),B=_u(u,g),B!=null&&F.push(Bu(u,B,M))),u=u.return}return F}function jl(u){if(u===null)return null;do u=u.return;while(u&&u.tag!==5);return u||null}function HC(u,g,j,F,M){for(var B=g._reactName,Y=[];j!==null&&j!==F;){var ae=j,ce=ae.alternate,ve=ae.stateNode;if(ce!==null&&ce===F)break;ae.tag===5&&ve!==null&&(ae=ve,M?(ce=_u(j,B),ce!=null&&Y.unshift(Bu(j,ce,ae))):M||(ce=_u(j,B),ce!=null&&Y.push(Bu(j,ce,ae)))),j=j.return}Y.length!==0&&u.push({event:g,listeners:Y})}var _7=/\r\n?/g,j7=/\u0000|\uFFFD/g;function VC(u){return(typeof u=="string"?u:""+u).replace(_7,`
38`).replace(j7,"")}function Rh(u,g,j){if(g=VC(g),VC(u)!==g&&j)throw Error(r(425))}function Ih(){}var xv=null,bv=null;function wv(u,g){return u==="textarea"||u==="noscript"||typeof g.children=="string"||typeof g.children=="number"||typeof g.dangerouslySetInnerHTML=="object"&&g.dangerouslySetInnerHTML!==null&&g.dangerouslySetInnerHTML.__html!=null}var _v=typeof setTimeout=="function"?setTimeout:void 0,N7=typeof clearTimeout=="function"?clearTimeout:void 0,WC=typeof Promise=="function"?Promise:void 0,S7=typeof queueMicrotask=="function"?queueMicrotask:typeof WC<"u"?function(u){return WC.resolve(null).then(u).catch(k7)}:_v;function k7(u){setTimeout(function(){throw u})}function jv(u,g){var j=g,F=0;do{var M=j.nextSibling;if(u.removeChild(j),M&&M.nodeType===8)if(j=M.data,j==="/$"){if(F===0){u.removeChild(M),Pu(g);return}F--}else j!=="$"&&j!=="$?"&&j!=="$!"||F++;j=M}while(j);Pu(g)}function ls(u){for(;u!=null;u=u.nextSibling){var g=u.nodeType;if(g===1||g===3)break;if(g===8){if(g=u.data,g==="$"||g==="$!"||g==="$?")break;if(g==="/$")return null}}return u}function KC(u){u=u.previousSibling;for(var g=0;u;){if(u.nodeType===8){var j=u.data;if(j==="$"||j==="$!"||j==="$?"){if(g===0)return u;g--}else j==="/$"&&g++}u=u.previousSibling}return null}var Nl=Math.random().toString(36).slice(2),Va="__reactFiber$"+Nl,zu="__reactProps$"+Nl,bi="__reactContainer$"+Nl,Nv="__reactEvents$"+Nl,C7="__reactListeners$"+Nl,F7="__reactHandles$"+Nl;function ao(u){var g=u[Va];if(g)return g;for(var j=u.parentNode;j;
vendor: 5,873 bytes, line 38
38){if(g=j[bi]||j[Va]){if(j=g.alternate,g.child!==null||j!==null&&j.child!==null)for(u=KC(u);u!==null;){if(j=u[Va])return j;u=KC(u)}return g}u=j,j=u.parentNode}return null}function Uu(u){return u=u[Va]||u[bi],!u||u.tag!==5&&u.tag!==6&&u.tag!==13&&u.tag!==3?null:u}function Sl(u){if(u.tag===5||u.tag===6)return u.stateNode;throw Error(r(33))}function Mh(u){return u[zu]||null}var Sv=[],kl=-1;function cs(u){return{current:u}}function ir(u){0>kl||(u.current=Sv[kl],Sv[kl]=null,kl--)}function Zt(u,g){kl++,Sv[kl]=u.current,u.current=g}var us={},Jr=cs(us),xn=cs(!1),io=us;function Cl(u,g){var j=u.type.contextTypes;if(!j)return us;var F=u.stateNode;if(F&&F.__reactInternalMemoizedUnmaskedChildContext===g)return F.__reactInternalMemoizedMaskedChildContext;var M={},B;for(B in j)M[B]=g[B];return F&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=g,u.__reactInternalMemoizedMaskedChildContext=M),M}function bn(u){return u=u.childContextTypes,u!=null}function Lh(){ir(xn),ir(Jr)}function GC(u,g,j){if(Jr.current!==us)throw Error(r(168));Zt(Jr,g),Zt(xn,j)}function YC(u,g,j){var F=u.stateNode;if(g=g.childContextTypes,typeof F.getChildContext!="function")return j;F=F.getChildContext();for(var M in F)if(!(M in g))throw Error(r(108,X(u)||"Unknown",M));return q({},j,F)}function Dh(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||us,io=Jr.current,Zt(Jr,u),Zt(xn,xn.current),!0}function QC(u,g,j){var F=u.stateNode;if(!F)throw Error(r(169));j?(u=YC(u,g,io),F.__reactInternalMemoizedMergedChildContext=u,ir(xn),ir(Jr),Zt(Jr,u)):ir(xn),Zt(xn,j)}var wi=null,$h=!1,kv=!1;function XC(u){wi===null?wi=[u]:wi.push(u)}function O7(u){$h=!0,XC(u)}function ds(){if(!kv&&wi!==null){kv=!0;var u=0,g=Bt;try{var j=wi;for(Bt=1;u<j.length;u++){var F=j[u];do F=F(!0);while(F!==null)}wi=null,$h=!1}catch(M){throw wi!==null&&(wi=wi.slice(u+1)),Jk(Gy,ds),M}finally{Bt=g,kv=!1}}return null}var Fl=[],Ol=0,qh=null,Bh=0,ta=[],ra=0,so=null,_i=1,ji="";function oo(u,g){Fl[Ol++]=Bh,Fl[Ol++]=qh,qh=u,Bh=g}function ZC(u,g,j){ta[ra++]=_i,ta[ra++]=ji,ta[ra++]=so,so=u;var F=_i;u=ji;var M=32-va(F)-1;F&=~(1<<M),j+=1;var B=32-va(g)+M;if(30<B){var Y=M-M%5;B=(F&(1<<Y)-1).toString(32),F>>=Y,M-=Y,_i=1<<32-va(g)+M|j<<M|F,ji=B+u}else _i=1<<B|j<<M|F,ji=u}function Cv(u){u.return!==null&&(oo(u,1),ZC(u,1,0))}function Fv(u){for(;u===qh;)qh=Fl[--Ol],Fl[Ol]=null,Bh=Fl[--Ol],Fl[Ol]=null;for(;u===so;)so=ta[--ra],ta[ra]=null,ji=ta[--ra],ta[ra]=null,_i=ta[--ra],ta[ra]=null}var Mn=null,Ln=null,or=!1,ba=null;function JC(u,g){var j=sa(5,null,null,0);j.elementType="DELETED",j.stateNode=g,j.return=u,g=u.deletions,g===null?(u.deletions=[j],u.flags|=16):g.push(j)}function eF(u,g){switch(u.tag){case 5:var j=u.type;return g=g.nodeType!==1||j.toLowerCase()!==g.nodeName.toLowerCase()?null:g,g!==null?(u.stateNode=g,Mn=u,Ln=ls(g.firstChild),!0):!1;case 6:return g=u.pendingProps===""||g.nodeType!==3?null:g,g!==null?(u.stateNode=g,Mn=u,Ln=null,!0):!1;case 13:return g=g.nodeType!==8?null:g,g!==null?(j=so!==null?{id:_i,overflow:ji}:null,u.memoizedState={dehydrated:g,treeContext:j,retryLane:1073741824},j=sa(18,null,null,0),j.stateNode=g,j.return=u,u.child=j,Mn=u,Ln=null,!0):!1;default:return!1}}function Ov(u){return(u.mode&1)!==0&&(u.flags&128)===0}function Ev(u){if(or){var g=Ln;if(g){var j=g;if(!eF(u,g)){if(Ov(u))throw Error(r(418));g=ls(j.nextSibling);var F=Mn;g&&eF(u,g)?JC(F,j):(u.flags=u.flags&-4097|2,or=!1,Mn=u)}}else{if(Ov(u))throw Error(r(418));u.flags=u.flags&-4097|2,or=!1,Mn=u}}}function tF(u){for(u=u.return;u!==null&&u.tag!==5&&u.tag!==3&&u.tag!==13;)u=u.return;Mn=u}function zh(u){if(u!==Mn)return!1;if(!or)return tF(u),or=!0,!1;var g;if((g=u.tag!==3)&&!(g=u.tag!==5)&&(g=u.type,g=g!=="head"&&g!=="body"&&!wv(u.type,u.memoizedProps)),g&&(g=Ln)){if(Ov(u))throw rF(),Error(r(418));for(;g;)JC(u,g),g=ls(g.nextSibling)}if(tF(u),u.tag===13){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));e:{for(u=u.nextSibling,g=0;u;){if(u.nodeType===8){var j=u.data;if(j==="/$"){if(g===0){Ln=ls(u.nextSibling);break e}g--}else j!=="$"&&j!=="$!"&&j!=="$?"||g++}u=u.nextSibling}Ln=null}}else Ln=Mn?ls(u.stateNode.nextSibling):null;return!0}function rF(){for(var u=Ln;u;)u=ls(u.nextSibling)}function El(){Ln=Mn=null,or=!1}function Pv(u){ba===null?ba=[u]:ba.push(u)}var E7=N.ReactCurrentBatchConfig;function Hu(u,g,j){if(u=j.ref,u!==null&&typeof u!="function"&&typeof u!="object"){if(j._owner){if(j=j._owner,j){if(j.tag!==1)throw Error(r(309));var F=j.stateNode}if(!F)throw Error(r(147,u));var M=F,B=""+u;return g!==null&&g.ref!==null&&typeof g.ref=="function"&&g.ref._stringRef===B?g.ref:(g=function(Y){var ae=M.refs;Y===null?delete ae[B]:ae[B]=Y},g._stringRef=B,g)}if(typeof u!="string")throw Error(r(284));if(!j._owner)throw Error(r(290,u))}return u}function Uh(u,g){throw u=Object.prototype.toString.call(g),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":u))}function nF(u){var g=u._init;return g(u._payload)}function aF(u){function g(me,de){if(u){var pe=me.deletions;pe===null?(me.deletions=[de],me.flags|=16):pe.push(de)}}function j(me,de){if(!u)return null;for(;de!==null;)g(me,de),de=de.sibling;return null}function F(me,de){for(me=new Map;de!==null;)de.key!==null?me.set(de.key,de):me.set(de.index,de),de=de.sibling;return me}function M(me,de){return me=xs(me,de),me.index=0,me.sibling=null,me}function B(me,de,pe){return me.index=pe,u?(pe=me.alternate,pe!==null?(pe=pe.index,pe<de?(me.flags|=2,de):pe):(me.flags|=2,de)):(me.flags|=1048576,de)}function Y(me){return u&&me.alternate===null&&(me.flags|=2),me}function ae(me,de,pe,Pe){return de===null||de.tag!==6?(de=_0(pe,me.mode,Pe),de.return=me,de):(de=M(de,pe),de.return=me,de)}function ce(me,de,pe,Pe){var rt=pe.type;return rt===C?Ne(me,de,pe.props.children,Pe,pe.key):de!==null&&(de.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===W&&nF(rt)===de.type)?(Pe=
vendor: 4,711 bytes, line 38
38M(de,pe.props),Pe.ref=Hu(me,de,pe),Pe.return=me,Pe):(Pe=hm(pe.type,pe.key,pe.props,null,me.mode,Pe),Pe.ref=Hu(me,de,pe),Pe.return=me,Pe)}function ve(me,de,pe,Pe){return de===null||de.tag!==4||de.stateNode.containerInfo!==pe.containerInfo||de.stateNode.implementation!==pe.implementation?(de=j0(pe,me.mode,Pe),de.return=me,de):(de=M(de,pe.children||[]),de.return=me,de)}function Ne(me,de,pe,Pe,rt){return de===null||de.tag!==7?(de=go(pe,me.mode,Pe,rt),de.return=me,de):(de=M(de,pe),de.return=me,de)}function Se(me,de,pe){if(typeof de=="string"&&de!==""||typeof de=="number")return de=_0(""+de,me.mode,pe),de.return=me,de;if(typeof de=="object"&&de!==null){switch(de.$$typeof){case S:return pe=hm(de.type,de.key,de.props,null,me.mode,pe),pe.ref=Hu(me,null,de),pe.return=me,pe;case k:return de=j0(de,me.mode,pe),de.return=me,de;case W:var Pe=de._init;return Se(me,Pe(de._payload),pe)}if(Ce(de)||K(de))return de=go(de,me.mode,pe,null),de.return=me,de;Uh(me,de)}return null}function je(me,de,pe,Pe){var rt=de!==null?de.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number")return rt!==null?null:ae(me,de,""+pe,Pe);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case S:return pe.key===rt?ce(me,de,pe,Pe):null;case k:return pe.key===rt?ve(me,de,pe,Pe):null;case W:return rt=pe._init,je(me,de,rt(pe._payload),Pe)}if(Ce(pe)||K(pe))return rt!==null?null:Ne(me,de,pe,Pe,null);Uh(me,pe)}return null}function We(me,de,pe,Pe,rt){if(typeof Pe=="string"&&Pe!==""||typeof Pe=="number")return me=me.get(pe)||null,ae(de,me,""+Pe,rt);if(typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case S:return me=me.get(Pe.key===null?pe:Pe.key)||null,ce(de,me,Pe,rt);case k:return me=me.get(Pe.key===null?pe:Pe.key)||null,ve(de,me,Pe,rt);case W:var st=Pe._init;return We(me,de,pe,st(Pe._payload),rt)}if(Ce(Pe)||K(Pe))return me=me.get(pe)||null,Ne(de,me,Pe,rt,null);Uh(de,Pe)}return null}function Qe(me,de,pe,Pe){for(var rt=null,st=null,ot=de,ft=de=0,$r=null;ot!==null&&ft<pe.length;ft++){ot.index>ft?($r=ot,ot=null):$r=ot.sibling;var Tt=je(me,ot,pe[ft],Pe);if(Tt===null){ot===null&&(ot=$r);break}u&&ot&&Tt.alternate===null&&g(me,ot),de=B(Tt,de,ft),st===null?rt=Tt:st.sibling=Tt,st=Tt,ot=$r}if(ft===pe.length)return j(me,ot),or&&oo(me,ft),rt;if(ot===null){for(;ft<pe.length;ft++)ot=Se(me,pe[ft],Pe),ot!==null&&(de=B(ot,de,ft),st===null?rt=ot:st.sibling=ot,st=ot);return or&&oo(me,ft),rt}for(ot=F(me,ot);ft<pe.length;ft++)$r=We(ot,me,ft,pe[ft],Pe),$r!==null&&(u&&$r.alternate!==null&&ot.delete($r.key===null?ft:$r.key),de=B($r,de,ft),st===null?rt=$r:st.sibling=$r,st=$r);return u&&ot.forEach(function(bs){return g(me,bs)}),or&&oo(me,ft),rt}function et(me,de,pe,Pe){var rt=K(pe);if(typeof rt!="function")throw Error(r(150));if(pe=rt.call(pe),pe==null)throw Error(r(151));for(var st=rt=null,ot=de,ft=de=0,$r=null,Tt=pe.next();ot!==null&&!Tt.done;ft++,Tt=pe.next()){ot.index>ft?($r=ot,ot=null):$r=ot.sibling;var bs=je(me,ot,Tt.value,Pe);if(bs===null){ot===null&&(ot=$r);break}u&&ot&&bs.alternate===null&&g(me,ot),de=B(bs,de,ft),st===null?rt=bs:st.sibling=bs,st=bs,ot=$r}if(Tt.done)return j(me,ot),or&&oo(me,ft),rt;if(ot===null){for(;!Tt.done;ft++,Tt=pe.next())Tt=Se(me,Tt.value,Pe),Tt!==null&&(de=B(Tt,de,ft),st===null?rt=Tt:st.sibling=Tt,st=Tt);return or&&oo(me,ft),rt}for(ot=F(me,ot);!Tt.done;ft++,Tt=pe.next())Tt=We(ot,me,ft,Tt.value,Pe),Tt!==null&&(u&&Tt.alternate!==null&&ot.delete(Tt.key===null?ft:Tt.key),de=B(Tt,de,ft),st===null?rt=Tt:st.sibling=Tt,st=Tt);return u&&ot.forEach(function(cz){return g(me,cz)}),or&&oo(me,ft),rt}function vr(me,de,pe,Pe){if(typeof pe=="object"&&pe!==null&&pe.type===C&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case S:e:{for(var rt=pe.key,st=de;st!==null;){if(st.key===rt){if(rt=pe.type,rt===C){if(st.tag===7){j(me,st.sibling),de=M(st,pe.props.children),de.return=me,me=de;break e}}else if(st.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===W&&nF(rt)===st.type){j(me,st.sibling),de=M(st,pe.props),de.ref=Hu(me,st,pe),de.return=me,me=de;break e}j(me,st);break}else g(me,st);st=st.sibling}pe.type===C?(de=go(pe.props.children,me.mode,Pe,pe.key),de.return=me,me=de):(Pe=hm(pe.type,pe.key,pe.props,null,me.mode,Pe),Pe.ref=Hu(me,de,pe),Pe.return=me,me=Pe)}return Y(me);case k:e:{for(st=pe.key;de!==null;){if(de.key===st)if(de.tag===4&&de.stateNode.containerInfo===pe.containerInfo&&de.stateNode.implementation===pe.implementation){j(me,de.sibling),de=M(de,pe.children||[]),de.return=me,me=de;break e}else{j(me,de);break}else g(me,de);de=de.sibling}de=j0(pe,me.mode,Pe),de.return=me,me=de}return Y(me);case W:return st=pe._init,vr(me,de,st(pe._payload),Pe)}if(Ce(pe))return Qe(me,de,pe,Pe);if(K(pe))return et(me,de,pe,Pe);Uh(me,pe)}
vendor: 4,356 bytes, line 38
38return typeof pe=="string"&&pe!==""||typeof pe=="number"?(pe=""+pe,de!==null&&de.tag===6?(j(me,de.sibling),de=M(de,pe),de.return=me,me=de):(j(me,de),de=_0(pe,me.mode,Pe),de.return=me,me=de),Y(me)):j(me,de)}return vr}var Pl=aF(!0),iF=aF(!1),Hh=cs(null),Vh=null,Tl=null,Tv=null;function Av(){Tv=Tl=Vh=null}function Rv(u){var g=Hh.current;ir(Hh),u._currentValue=g}function Iv(u,g,j){for(;u!==null;){var F=u.alternate;if((u.childLanes&g)!==g?(u.childLanes|=g,F!==null&&(F.childLanes|=g)):F!==null&&(F.childLanes&g)!==g&&(F.childLanes|=g),u===j)break;u=u.return}}function Al(u,g){Vh=u,Tv=Tl=null,u=u.dependencies,u!==null&&u.firstContext!==null&&((u.lanes&g)!==0&&(wn=!0),u.firstContext=null)}function na(u){var g=u._currentValue;if(Tv!==u)if(u={context:u,memoizedValue:g,next:null},Tl===null){if(Vh===null)throw Error(r(308));Tl=u,Vh.dependencies={lanes:0,firstContext:u}}else Tl=Tl.next=u;return g}var lo=null;function Mv(u){lo===null?lo=[u]:lo.push(u)}function sF(u,g,j,F){var M=g.interleaved;return M===null?(j.next=j,Mv(g)):(j.next=M.next,M.next=j),g.interleaved=j,Ni(u,F)}function Ni(u,g){u.lanes|=g;var j=u.alternate;for(j!==null&&(j.lanes|=g),j=u,u=u.return;u!==null;)u.childLanes|=g,j=u.alternate,j!==null&&(j.childLanes|=g),j=u,u=u.return;return j.tag===3?j.stateNode:null}var fs=!1;function Lv(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oF(u,g){u=u.updateQueue,g.updateQueue===u&&(g.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,effects:u.effects})}function Si(u,g){return{eventTime:u,lane:g,tag:0,payload:null,callback:null,next:null}}function hs(u,g,j){var F=u.updateQueue;if(F===null)return null;if(F=F.shared,(Ot&2)!==0){var M=F.pending;return M===null?g.next=g:(g.next=M.next,M.next=g),F.pending=g,Ni(u,j)}return M=F.interleaved,M===null?(g.next=g,Mv(F)):(g.next=M.next,M.next=g),F.interleaved=g,Ni(u,j)}function Wh(u,g,j){if(g=g.updateQueue,g!==null&&(g=g.shared,(j&4194240)!==0)){var F=g.lanes;F&=u.pendingLanes,j|=F,g.lanes=j,Xy(u,j)}}function lF(u,g){var j=u.updateQueue,F=u.alternate;if(F!==null&&(F=F.updateQueue,j===F)){var M=null,B=null;if(j=j.firstBaseUpdate,j!==null){do{var Y={eventTime:j.eventTime,lane:j.lane,tag:j.tag,payload:j.payload,callback:j.callback,next:null};B===null?M=B=Y:B=B.next=Y,j=j.next}while(j!==null);B===null?M=B=g:B=B.next=g}else M=B=g;j={baseState:F.baseState,firstBaseUpdate:M,lastBaseUpdate:B,shared:F.shared,effects:F.effects},u.updateQueue=j;return}u=j.lastBaseUpdate,u===null?j.firstBaseUpdate=g:u.next=g,j.lastBaseUpdate=g}function Kh(u,g,j,F){var M=u.updateQueue;fs=!1;var B=M.firstBaseUpdate,Y=M.lastBaseUpdate,ae=M.shared.pending;if(ae!==null){M.shared.pending=null;var ce=ae,ve=ce.next;ce.next=null,Y===null?B=ve:Y.next=ve,Y=ce;var Ne=u.alternate;Ne!==null&&(Ne=Ne.updateQueue,ae=Ne.lastBaseUpdate,ae!==Y&&(ae===null?Ne.firstBaseUpdate=ve:ae.next=ve,Ne.lastBaseUpdate=ce))}if(B!==null){var Se=M.baseState;Y=0,Ne=ve=ce=null,ae=B;do{var je=ae.lane,We=ae.eventTime;if((F&je)===je){Ne!==null&&(Ne=Ne.next={eventTime:We,lane:0,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null});e:{var Qe=u,et=ae;switch(je=g,We=j,et.tag){case 1:if(Qe=et.payload,typeof Qe=="function"){Se=Qe.call(We,Se,je);break e}Se=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=et.payload,je=typeof Qe=="function"?Qe.call(We,Se,je):Qe,je==null)break e;Se=q({},Se,je);break e;case 2:fs=!0}}ae.callback!==null&&ae.lane!==0&&(u.flags|=64,je=M.effects,je===null?M.effects=[ae]:je.push(ae))}else We={eventTime:We,lane:je,tag:ae.tag,payload:ae.payload,callback:ae.callback,next:null},Ne===null?(ve=Ne=We,ce=Se):Ne=Ne.next=We,Y|=je;if(ae=ae.next,ae===null){if(ae=M.shared.pending,ae===null)break;je=ae,ae=je.next,je.next=null,M.lastBaseUpdate=je,M.shared.pending=null}}while(!0);if(Ne===null&&(ce=Se),M.baseState=ce,M.firstBaseUpdate=ve,M.lastBaseUpdate=Ne,g=M.shared.interleaved,g!==null){M=g;do Y|=M.lane,M=M.next;while(M!==g)}else B===null&&(M.shared.lanes=0);fo|=Y,u.lanes=Y,u.memoizedState=Se}}function cF(u,g,j){if(u=g.effects,g.effects=null,u!==null)for(g=0;g<u.length;g++){var F=u[g],M=F.callback;if(M!==null){if(F.callback=null,F=j,typeof M!="function")throw Error(r(191,M));M.call(F)}}}var Vu={},Wa=cs(Vu),Wu=cs(Vu),Ku=cs(Vu);
vendor: 4,513 bytes, line 38
38function co(u){if(u===Vu)throw Error(r(174));return u}function Dv(u,g){switch(Zt(Ku,g),Zt(Wu,u),Zt(Wa,Vu),u=g.nodeType,u){case 9:case 11:g=(g=g.documentElement)?g.namespaceURI:ke(null,"");break;default:u=u===8?g.parentNode:g,g=u.namespaceURI||null,u=u.tagName,g=ke(g,u)}ir(Wa),Zt(Wa,g)}function Rl(){ir(Wa),ir(Wu),ir(Ku)}function uF(u){co(Ku.current);var g=co(Wa.current),j=ke(g,u.type);g!==j&&(Zt(Wu,u),Zt(Wa,j))}function $v(u){Wu.current===u&&(ir(Wa),ir(Wu))}var ur=cs(0);function Gh(u){for(var g=u;g!==null;){if(g.tag===13){var j=g.memoizedState;if(j!==null&&(j=j.dehydrated,j===null||j.data==="$?"||j.data==="$!"))return g}else if(g.tag===19&&g.memoizedProps.revealOrder!==void 0){if((g.flags&128)!==0)return g}else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return null;g=g.return}g.sibling.return=g.return,g=g.sibling}return null}var qv=[];function Bv(){for(var u=0;u<qv.length;u++)qv[u]._workInProgressVersionPrimary=null;qv.length=0}var Yh=N.ReactCurrentDispatcher,zv=N.ReactCurrentBatchConfig,uo=0,dr=null,Cr=null,Lr=null,Qh=!1,Gu=!1,Yu=0,P7=0;function en(){throw Error(r(321))}function Uv(u,g){if(g===null)return!1;for(var j=0;j<g.length&&j<u.length;j++)if(!xa(u[j],g[j]))return!1;return!0}function Hv(u,g,j,F,M,B){if(uo=B,dr=g,g.memoizedState=null,g.updateQueue=null,g.lanes=0,Yh.current=u===null||u.memoizedState===null?I7:M7,u=j(F,M),Gu){B=0;do{if(Gu=!1,Yu=0,25<=B)throw Error(r(301));B+=1,Lr=Cr=null,g.updateQueue=null,Yh.current=L7,u=j(F,M)}while(Gu)}if(Yh.current=Jh,g=Cr!==null&&Cr.next!==null,uo=0,Lr=Cr=dr=null,Qh=!1,g)throw Error(r(300));return u}function Vv(){var u=Yu!==0;return Yu=0,u}function Ka(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lr===null?dr.memoizedState=Lr=u:Lr=Lr.next=u,Lr}function aa(){if(Cr===null){var u=dr.alternate;u=u!==null?u.memoizedState:null}else u=Cr.next;var g=Lr===null?dr.memoizedState:Lr.next;if(g!==null)Lr=g,Cr=u;else{if(u===null)throw Error(r(310));Cr=u,u={memoizedState:Cr.memoizedState,baseState:Cr.baseState,baseQueue:Cr.baseQueue,queue:Cr.queue,next:null},Lr===null?dr.memoizedState=Lr=u:Lr=Lr.next=u}return Lr}function Qu(u,g){return typeof g=="function"?g(u):g}function Wv(u){var g=aa(),j=g.queue;if(j===null)throw Error(r(311));j.lastRenderedReducer=u;var F=Cr,M=F.baseQueue,B=j.pending;if(B!==null){if(M!==null){var Y=M.next;M.next=B.next,B.next=Y}F.baseQueue=M=B,j.pending=null}if(M!==null){B=M.next,F=F.baseState;var ae=Y=null,ce=null,ve=B;do{var Ne=ve.lane;if((uo&Ne)===Ne)ce!==null&&(ce=ce.next={lane:0,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),F=ve.hasEagerState?ve.eagerState:u(F,ve.action);else{var Se={lane:Ne,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null};ce===null?(ae=ce=Se,Y=F):ce=ce.next=Se,dr.lanes|=Ne,fo|=Ne}ve=ve.next}while(ve!==null&&ve!==B);ce===null?Y=F:ce.next=ae,xa(F,g.memoizedState)||(wn=!0),g.memoizedState=F,g.baseState=Y,g.baseQueue=ce,j.lastRenderedState=F}if(u=j.interleaved,u!==null){M=u;do B=M.lane,dr.lanes|=B,fo|=B,M=M.next;while(M!==u)}else M===null&&(j.lanes=0);return[g.memoizedState,j.dispatch]}function Kv(u){var g=aa(),j=g.queue;if(j===null)throw Error(r(311));j.lastRenderedReducer=u;var F=j.dispatch,M=j.pending,B=g.memoizedState;if(M!==null){j.pending=null;var Y=M=M.next;do B=u(B,Y.action),Y=Y.next;while(Y!==M);xa(B,g.memoizedState)||(wn=!0),g.memoizedState=B,g.baseQueue===null&&(g.baseState=B),j.lastRenderedState=B}return[B,F]}function dF(){}function fF(u,g){var j=dr,F=aa(),M=g(),B=!xa(F.memoizedState,M);if(B&&(F.memoizedState=M,wn=!0),F=F.queue,Gv(pF.bind(null,j,F,u),[u]),F.getSnapshot!==g||B||Lr!==null&&Lr.memoizedState.tag&1){if(j.flags|=2048,Xu(9,mF.bind(null,j,F,M,g),void 0,null),Dr===null)throw Error(r(349));(uo&30)!==0||hF(j,g,M)}return M}function hF(u,g,j){u.flags|=16384,u={getSnapshot:g,value:j},g=dr.updateQueue,g===null?(g={lastEffect:null,stores:null},dr.updateQueue=g,g.stores=[u]):(j=g.stores,j===null?g.stores=[u]:j.push(u))}function mF(u,g,j,F){g.value=j,g.getSnapshot=F,gF(g)&&yF(u)}function pF(u,g,j){return j(function(){gF(g)&&yF(u)})}function gF(u){var g=u.getSnapshot;u=u.value;try{var j=g();return!xa(u,j)}catch{return!0}}function yF(u){var g=Ni(u,1);g!==null&&Na(g,u,1,-1)}function vF(u){var g=Ka();return typeof u=="function"&&(u=u()),g.memoizedState=g.baseState=u,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qu,lastRenderedState:u}
vendor: 8,216 bytes, lines 38-40
38,g.queue=u,u=u.dispatch=R7.bind(null,dr,u),[g.memoizedState,u]}function Xu(u,g,j,F){return u={tag:u,create:g,destroy:j,deps:F,next:null},g=dr.updateQueue,g===null?(g={lastEffect:null,stores:null},dr.updateQueue=g,g.lastEffect=u.next=u):(j=g.lastEffect,j===null?g.lastEffect=u.next=u:(F=j.next,j.next=u,u.next=F,g.lastEffect=u)),u}function xF(){return aa().memoizedState}function Xh(u,g,j,F){var M=Ka();dr.flags|=u,M.memoizedState=Xu(1|g,j,void 0,F===void 0?null:F)}function Zh(u,g,j,F){var M=aa();F=F===void 0?null:F;var B=void 0;if(Cr!==null){var Y=Cr.memoizedState;if(B=Y.destroy,F!==null&&Uv(F,Y.deps)){M.memoizedState=Xu(g,j,B,F);return}}dr.flags|=u,M.memoizedState=Xu(1|g,j,B,F)}function bF(u,g){return Xh(8390656,8,u,g)}function Gv(u,g){return Zh(2048,8,u,g)}function wF(u,g){return Zh(4,2,u,g)}function _F(u,g){return Zh(4,4,u,g)}function jF(u,g){if(typeof g=="function")return u=u(),g(u),function(){g(null)};if(g!=null)return u=u(),g.current=u,function(){g.current=null}}function NF(u,g,j){return j=j!=null?j.concat([u]):null,Zh(4,4,jF.bind(null,g,u),j)}function Yv(){}function SF(u,g){var j=aa();g=g===void 0?null:g;var F=j.memoizedState;return F!==null&&g!==null&&Uv(g,F[1])?F[0]:(j.memoizedState=[u,g],u)}function kF(u,g){var j=aa();g=g===void 0?null:g;var F=j.memoizedState;return F!==null&&g!==null&&Uv(g,F[1])?F[0]:(u=u(),j.memoizedState=[u,g],u)}function CF(u,g,j){return(uo&21)===0?(u.baseState&&(u.baseState=!1,wn=!0),u.memoizedState=j):(xa(j,g)||(j=nC(),dr.lanes|=j,fo|=j,u.baseState=!0),g)}function T7(u,g){var j=Bt;Bt=j!==0&&4>j?j:4,u(!0);var F=zv.transition;zv.transition={};try{u(!1),g()}finally{Bt=j,zv.transition=F}}function FF(){return aa().memoizedState}function A7(u,g,j){var F=ys(u);if(j={lane:F,action:j,hasEagerState:!1,eagerState:null,next:null},OF(u))EF(g,j);else if(j=sF(u,g,j,F),j!==null){var M=fn();Na(j,u,F,M),PF(j,g,F)}}function R7(u,g,j){var F=ys(u),M={lane:F,action:j,hasEagerState:!1,eagerState:null,next:null};if(OF(u))EF(g,M);else{var B=u.alternate;if(u.lanes===0&&(B===null||B.lanes===0)&&(B=g.lastRenderedReducer,B!==null))try{var Y=g.lastRenderedState,ae=B(Y,j);if(M.hasEagerState=!0,M.eagerState=ae,xa(ae,Y)){var ce=g.interleaved;ce===null?(M.next=M,Mv(g)):(M.next=ce.next,ce.next=M),g.interleaved=M;return}}catch{}finally{}j=sF(u,g,M,F),j!==null&&(M=fn(),Na(j,u,F,M),PF(j,g,F))}}function OF(u){var g=u.alternate;return u===dr||g!==null&&g===dr}function EF(u,g){Gu=Qh=!0;var j=u.pending;j===null?g.next=g:(g.next=j.next,j.next=g),u.pending=g}function PF(u,g,j){if((j&4194240)!==0){var F=g.lanes;F&=u.pendingLanes,j|=F,g.lanes=j,Xy(u,j)}}var Jh={readContext:na,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useInsertionEffect:en,useLayoutEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useMutableSource:en,useSyncExternalStore:en,useId:en,unstable_isNewReconciler:!1},I7={readContext:na,useCallback:function(u,g){return Ka().memoizedState=[u,g===void 0?null:g],u},useContext:na,useEffect:bF,useImperativeHandle:function(u,g,j){return j=j!=null?j.concat([u]):null,Xh(4194308,4,jF.bind(null,g,u),j)},useLayoutEffect:function(u,g){return Xh(4194308,4,u,g)},useInsertionEffect:function(u,g){return Xh(4,2,u,g)},useMemo:function(u,g){var j=Ka();return g=g===void 0?null:g,u=u(),j.memoizedState=[u,g],u},useReducer:function(u,g,j){var F=Ka();return g=j!==void 0?j(g):g,F.memoizedState=F.baseState=g,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:g},F.queue=u,u=u.dispatch=A7.bind(null,dr,u),[F.memoizedState,u]},useRef:function(u){var g=Ka();return u={current:u},g.memoizedState=u},useState:vF,useDebugValue:Yv,useDeferredValue:function(u){return Ka().memoizedState=u},useTransition:function(){var u=vF(!1),g=u[0];return u=T7.bind(null,u[1]),Ka().memoizedState=u,[g,u]},useMutableSource:function(){},useSyncExternalStore:function(u,g,j){var F=dr,M=Ka();if(or){if(j===void 0)throw Error(r(407));j=j()}else{if(j=g(),Dr===null)throw Error(r(349));(uo&30)!==0||hF(F,g,j)}M.memoizedState=j;var B={value:j,getSnapshot:g};return M.queue=B,bF(pF.bind(null,F,B,u),[u]),F.flags|=2048,Xu(9,mF.bind(null,F,B,j,g),void 0,null),j},useId:function(){var u=Ka(),g=Dr.identifierPrefix;if(or){var j=ji,F=_i;j=(F&~(1<<32-va(F)-1)).toString(32)+j,g=":"+g+"R"+j,j=Yu++,0<j&&(g+="H"+j.toString(32)),g+=":"}else j=P7++,g=":"+g+"r"+j.toString(32)+":";return u.memoizedState=g},unstable_isNewReconciler:!1},M7={readContext:na,useCallback:SF,useContext:na,useEffect:Gv,useImperativeHandle:NF,useInsertionEffect:wF,useLayoutEffect:_F,useMemo:kF,useReducer:Wv,useRef:xF,useState:function(){return Wv(Qu)},useDebugValue:Yv,useDeferredValue:function(u){var g=aa();return CF(g,Cr.memoizedState,u)},useTransition:function(){var u=Wv(Qu)[0],g=aa().memoizedState;return[u,g]},useMutableSource:dF,useSyncExternalStore:fF,useId:FF,unstable_isNewReconciler:!1},L7={readContext:na,useCallback:SF,useContext:na,useEffect:Gv,useImperativeHandle:NF,useInsertionEffect:wF,useLayoutEffect:_F,useMemo:kF,useReducer:Kv,useRef:xF,useState:function(){return Kv(Qu)},useDebugValue:Yv,useDeferredValue:function(u){var g=aa();return Cr===null?g.memoizedState=u:CF(g,Cr.memoizedState,u)},useTransition:function(){var u=Kv(Qu)[0],g=aa().memoizedState;return[u,g]},useMutableSource:dF,useSyncExternalStore:fF,useId:FF,unstable_isNewReconciler:!1};function wa(u,g){if(u&&u.defaultProps){g=q({},g),u=u.defaultProps;for(var j in u)g[j]===void 0&&(g[j]=u[j]);return g}return g}function Qv(u,g,j,F){g=u.memoizedState,j=j(F,g),j=j==null?g:q({},g,j),u.memoizedState=j,u.lanes===0&&(u.updateQueue.baseState=j)}var em={isMounted:function(u){return(u=u._reactInternals)?no(u)===u:!1},enqueueSetState:function(u,g,j){u=u._reactInternals;var F=fn(),M=ys(u),B=Si(F,M);B.payload=g,j!=null&&(B.callback=j),g=hs(u,B,M),g!==null&&(Na(g,u,M,F),Wh(g,u,M))},enqueueReplaceState:function(u,g,j){u=u._reactInternals;var F=fn(),M=ys(u),B=Si(F,M);B.tag=1,B.payload=g,j!=null&&(B.callback=j),g=hs(u,B,M),g!==null&&(Na(g,u,M,F),Wh(g,u,M))},enqueueForceUpdate:function(u,g){u=u._reactInternals;var j=fn(),F=ys(u),M=Si(j,F);M.tag=2,g!=null&&(M.callback=g),g=hs(u,M,F),g!==null&&(Na(g,u,F,j),Wh(g,u,F))}};function TF(u,g,j,F,M,B,Y){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(F,B,Y):g.prototype&&g.prototype.isPureReactComponent?!Lu(j,F)||!Lu(M,B):!0}function AF(u,g,j){var F=!1,M=us,B=g.contextType;return typeof B=="object"&&B!==null?B=na(B):(M=bn(g)?io:Jr.current,F=g.contextTypes,B=(F=F!=null)?Cl(u,M):us),g=new g(j,B),u.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=em,u.stateNode=g,g._reactInternals=u,F&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=M,u.__reactInternalMemoizedMaskedChildContext=B),g}function RF(u,g,j,F){u=g.state,typeof g.componentWillReceiveProps=="function"&&g.componentWillReceiveProps(j,F),typeof g.UNSAFE_componentWillReceiveProps=="function"&&g.UNSAFE_componentWillReceiveProps(j,F),g.state!==u&&em.enqueueReplaceState(g,g.state,null)}function Xv(u,g,j,F){var M=u.stateNode;M.props=j,M.state=u.memoizedState,M.refs={},Lv(u);var B=g.contextType;typeof B=="object"&&B!==null?M.context=na(B):(B=bn(g)?io:Jr.current,M.context=Cl(u,B)),M.state=u.memoizedState,B=g.getDerivedStateFromProps,typeof B=="function"&&(Qv(u,g,B,j),M.state=u.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof M.getSnapshotBeforeUpdate=="function"||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(g=M.state,typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount(),g!==M.state&&em.enqueueReplaceState(M,M.state,null),Kh(u,j,M,F),M.state=u.memoizedState),typeof M.componentDidMount=="function"&&(u.flags|=4194308)}function Il(u,g){try{var j="",F=g;do j+=re(F),F=F.return;while(F);var M=j}catch(B){M=`
39Error generating stack: `+B.message+`
40`+B.stack}return{value:u,source:g,stack:M,digest:null}}function Zv(u,g,j){return{value:u,source:null,stack:j??null,digest:g??null}}function Jv(u,g){try{console.error(g.value)}catch(j){setTimeout(function(){throw j})}}var D7=typeof WeakMap=="function"?WeakMap:Map;
vendor: 16,698 bytes, line 40
40function IF(u,g,j){j=Si(-1,j),j.tag=3,j.payload={element:null};var F=g.value;return j.callback=function(){om||(om=!0,m0=F),Jv(u,g)},j}function MF(u,g,j){j=Si(-1,j),j.tag=3;var F=u.type.getDerivedStateFromError;if(typeof F=="function"){var M=g.value;j.payload=function(){return F(M)},j.callback=function(){Jv(u,g)}}var B=u.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(j.callback=function(){Jv(u,g),typeof F!="function"&&(ps===null?ps=new Set([this]):ps.add(this));var Y=g.stack;this.componentDidCatch(g.value,{componentStack:Y!==null?Y:""})}),j}function LF(u,g,j){var F=u.pingCache;if(F===null){F=u.pingCache=new D7;var M=new Set;F.set(g,M)}else M=F.get(g),M===void 0&&(M=new Set,F.set(g,M));M.has(j)||(M.add(j),u=Z7.bind(null,u,g,j),g.then(u,u))}function DF(u){do{var g;if((g=u.tag===13)&&(g=u.memoizedState,g=g!==null?g.dehydrated!==null:!0),g)return u;u=u.return}while(u!==null);return null}function $F(u,g,j,F,M){return(u.mode&1)===0?(u===g?u.flags|=65536:(u.flags|=128,j.flags|=131072,j.flags&=-52805,j.tag===1&&(j.alternate===null?j.tag=17:(g=Si(-1,1),g.tag=2,hs(j,g,1))),j.lanes|=1),u):(u.flags|=65536,u.lanes=M,u)}var $7=N.ReactCurrentOwner,wn=!1;function dn(u,g,j,F){g.child=u===null?iF(g,null,j,F):Pl(g,u.child,j,F)}function qF(u,g,j,F,M){j=j.render;var B=g.ref;return Al(g,M),F=Hv(u,g,j,F,B,M),j=Vv(),u!==null&&!wn?(g.updateQueue=u.updateQueue,g.flags&=-2053,u.lanes&=~M,ki(u,g,M)):(or&&j&&Cv(g),g.flags|=1,dn(u,g,F,M),g.child)}function BF(u,g,j,F,M){if(u===null){var B=j.type;return typeof B=="function"&&!w0(B)&&B.defaultProps===void 0&&j.compare===null&&j.defaultProps===void 0?(g.tag=15,g.type=B,zF(u,g,B,F,M)):(u=hm(j.type,null,F,g,g.mode,M),u.ref=g.ref,u.return=g,g.child=u)}if(B=u.child,(u.lanes&M)===0){var Y=B.memoizedProps;if(j=j.compare,j=j!==null?j:Lu,j(Y,F)&&u.ref===g.ref)return ki(u,g,M)}return g.flags|=1,u=xs(B,F),u.ref=g.ref,u.return=g,g.child=u}function zF(u,g,j,F,M){if(u!==null){var B=u.memoizedProps;if(Lu(B,F)&&u.ref===g.ref)if(wn=!1,g.pendingProps=F=B,(u.lanes&M)!==0)(u.flags&131072)!==0&&(wn=!0);else return g.lanes=u.lanes,ki(u,g,M)}return e0(u,g,j,F,M)}function UF(u,g,j){var F=g.pendingProps,M=F.children,B=u!==null?u.memoizedState:null;if(F.mode==="hidden")if((g.mode&1)===0)g.memoizedState={baseLanes:0,cachePool:null,transitions:null},Zt(Ll,Dn),Dn|=j;else{if((j&1073741824)===0)return u=B!==null?B.baseLanes|j:j,g.lanes=g.childLanes=1073741824,g.memoizedState={baseLanes:u,cachePool:null,transitions:null},g.updateQueue=null,Zt(Ll,Dn),Dn|=u,null;g.memoizedState={baseLanes:0,cachePool:null,transitions:null},F=B!==null?B.baseLanes:j,Zt(Ll,Dn),Dn|=F}else B!==null?(F=B.baseLanes|j,g.memoizedState=null):F=j,Zt(Ll,Dn),Dn|=F;return dn(u,g,M,j),g.child}function HF(u,g){var j=g.ref;(u===null&&j!==null||u!==null&&u.ref!==j)&&(g.flags|=512,g.flags|=2097152)}function e0(u,g,j,F,M){var B=bn(j)?io:Jr.current;return B=Cl(g,B),Al(g,M),j=Hv(u,g,j,F,B,M),F=Vv(),u!==null&&!wn?(g.updateQueue=u.updateQueue,g.flags&=-2053,u.lanes&=~M,ki(u,g,M)):(or&&F&&Cv(g),g.flags|=1,dn(u,g,j,M),g.child)}function VF(u,g,j,F,M){if(bn(j)){var B=!0;Dh(g)}else B=!1;if(Al(g,M),g.stateNode===null)rm(u,g),AF(g,j,F),Xv(g,j,F,M),F=!0;else if(u===null){var Y=g.stateNode,ae=g.memoizedProps;Y.props=ae;var ce=Y.context,ve=j.contextType;typeof ve=="object"&&ve!==null?ve=na(ve):(ve=bn(j)?io:Jr.current,ve=Cl(g,ve));var Ne=j.getDerivedStateFromProps,Se=typeof Ne=="function"||typeof Y.getSnapshotBeforeUpdate=="function";Se||typeof Y.UNSAFE_componentWillReceiveProps!="function"&&typeof Y.componentWillReceiveProps!="function"||(ae!==F||ce!==ve)&&RF(g,Y,F,ve),fs=!1;var je=g.memoizedState;Y.state=je,Kh(g,F,Y,M),ce=g.memoizedState,ae!==F||je!==ce||xn.current||fs?(typeof Ne=="function"&&(Qv(g,j,Ne,F),ce=g.memoizedState),(ae=fs||TF(g,j,ae,F,je,ce,ve))?(Se||typeof Y.UNSAFE_componentWillMount!="function"&&typeof Y.componentWillMount!="function"||(typeof Y.componentWillMount=="function"&&Y.componentWillMount(),typeof Y.UNSAFE_componentWillMount=="function"&&Y.UNSAFE_componentWillMount()),typeof Y.componentDidMount=="function"&&(g.flags|=4194308)):(typeof Y.componentDidMount=="function"&&(g.flags|=4194308),g.memoizedProps=F,g.memoizedState=ce),Y.props=F,Y.state=ce,Y.context=ve,F=ae):(typeof Y.componentDidMount=="function"&&(g.flags|=4194308),F=!1)}else{Y=g.stateNode,oF(u,g),ae=g.memoizedProps,ve=g.type===g.elementType?ae:wa(g.type,ae),Y.props=ve,Se=g.pendingProps,je=Y.context,ce=j.contextType,typeof ce=="object"&&ce!==null?ce=na(ce):(ce=bn(j)?io:Jr.current,ce=Cl(g,ce));var We=j.getDerivedStateFromProps;(Ne=typeof We=="function"||typeof Y.getSnapshotBeforeUpdate=="function")||typeof Y.UNSAFE_componentWillReceiveProps!="function"&&typeof Y.componentWillReceiveProps!="function"||(ae!==Se||je!==ce)&&RF(g,Y,F,ce),fs=!1,je=g.memoizedState,Y.state=je,Kh(g,F,Y,M);var Qe=g.memoizedState;ae!==Se||je!==Qe||xn.current||fs?(typeof We=="function"&&(Qv(g,j,We,F),Qe=g.memoizedState),(ve=fs||TF(g,j,ve,F,je,Qe,ce)||!1)?(Ne||typeof Y.UNSAFE_componentWillUpdate!="function"&&typeof Y.componentWillUpdate!="function"||(typeof Y.componentWillUpdate=="function"&&Y.componentWillUpdate(F,Qe,ce),typeof Y.UNSAFE_componentWillUpdate=="function"&&Y.UNSAFE_componentWillUpdate(F,Qe,ce)),typeof Y.componentDidUpdate=="function"&&(g.flags|=4),typeof Y.getSnapshotBeforeUpdate=="function"&&(g.flags|=1024)):(typeof Y.componentDidUpdate!="function"||ae===u.memoizedProps&&je===u.memoizedState||(g.flags|=4),typeof Y.getSnapshotBeforeUpdate!="function"||ae===u.memoizedProps&&je===u.memoizedState||(g.flags|=1024),g.memoizedProps=F,g.memoizedState=Qe),Y.props=F,Y.state=Qe,Y.context=ce,F=ve):(typeof Y.componentDidUpdate!="function"||ae===u.memoizedProps&&je===u.memoizedState||(g.flags|=4),typeof Y.getSnapshotBeforeUpdate!="function"||ae===u.memoizedProps&&je===u.memoizedState||(g.flags|=1024),F=!1)}return t0(u,g,j,F,B,M)}function t0(u,g,j,F,M,B){HF(u,g);var Y=(g.flags&128)!==0;if(!F&&!Y)return M&&QC(g,j,!1),ki(u,g,B);F=g.stateNode,$7.current=g;var ae=Y&&typeof j.getDerivedStateFromError!="function"?null:F.render();return g.flags|=1,u!==null&&Y?(g.child=Pl(g,u.child,null,B),g.child=Pl(g,null,ae,B)):dn(u,g,ae,B),g.memoizedState=F.state,M&&QC(g,j,!0),g.child}function WF(u){var g=u.stateNode;g.pendingContext?GC(u,g.pendingContext,g.pendingContext!==g.context):g.context&&GC(u,g.context,!1),Dv(u,g.containerInfo)}function KF(u,g,j,F,M){return El(),Pv(M),g.flags|=256,dn(u,g,j,F),g.child}var r0={dehydrated:null,treeContext:null,retryLane:0};function n0(u){return{baseLanes:u,cachePool:null,transitions:null}}function GF(u,g,j){var F=g.pendingProps,M=ur.current,B=!1,Y=(g.flags&128)!==0,ae;if((ae=Y)||(ae=u!==null&&u.memoizedState===null?!1:(M&2)!==0),ae?(B=!0,g.flags&=-129):(u===null||u.memoizedState!==null)&&(M|=1),Zt(ur,M&1),u===null)return Ev(g),u=g.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?((g.mode&1)===0?g.lanes=1:u.data==="$!"?g.lanes=8:g.lanes=1073741824,null):(Y=F.children,u=F.fallback,B?(F=g.mode,B=g.child,Y={mode:"hidden",children:Y},(F&1)===0&&B!==null?(B.childLanes=0,B.pendingProps=Y):B=mm(Y,F,0,null),u=go(u,F,j,null),B.return=g,u.return=g,B.sibling=u,g.child=B,g.child.memoizedState=n0(j),g.memoizedState=r0,u):a0(g,Y));if(M=u.memoizedState,M!==null&&(ae=M.dehydrated,ae!==null))return q7(u,g,Y,F,ae,M,j);if(B){B=F.fallback,Y=g.mode,M=u.child,ae=M.sibling;var ce={mode:"hidden",children:F.children};return(Y&1)===0&&g.child!==M?(F=g.child,F.childLanes=0,F.pendingProps=ce,g.deletions=null):(F=xs(M,ce),F.subtreeFlags=M.subtreeFlags&14680064),ae!==null?B=xs(ae,B):(B=go(B,Y,j,null),B.flags|=2),B.return=g,F.return=g,F.sibling=B,g.child=F,F=B,B=g.child,Y=u.child.memoizedState,Y=Y===null?n0(j):{baseLanes:Y.baseLanes|j,cachePool:null,transitions:Y.transitions},B.memoizedState=Y,B.childLanes=u.childLanes&~j,g.memoizedState=r0,F}return B=u.child,u=B.sibling,F=xs(B,{mode:"visible",children:F.children}),(g.mode&1)===0&&(F.lanes=j),F.return=g,F.sibling=null,u!==null&&(j=g.deletions,j===null?(g.deletions=[u],g.flags|=16):j.push(u)),g.child=F,g.memoizedState=null,F}function a0(u,g){return g=mm({mode:"visible",children:g},u.mode,0,null),g.return=u,u.child=g}function tm(u,g,j,F){return F!==null&&Pv(F),Pl(g,u.child,null,j),u=a0(g,g.pendingProps.children),u.flags|=2,g.memoizedState=null,u}function q7(u,g,j,F,M,B,Y){if(j)return g.flags&256?(g.flags&=-257,F=Zv(Error(r(422))),tm(u,g,Y,F)):g.memoizedState!==null?(g.child=u.child,g.flags|=128,null):(B=F.fallback,M=g.mode,F=mm({mode:"visible",children:F.children},M,0,null),B=go(B,M,Y,null),B.flags|=2,F.return=g,B.return=g,F.sibling=B,g.child=F,(g.mode&1)!==0&&Pl(g,u.child,null,Y),g.child.memoizedState=n0(Y),g.memoizedState=r0,B);if((g.mode&1)===0)return tm(u,g,Y,null);if(M.data==="$!"){if(F=M.nextSibling&&M.nextSibling.dataset,F)var ae=F.dgst;return F=ae,B=Error(r(419)),F=Zv(B,F,void 0),tm(u,g,Y,F)}if(ae=(Y&u.childLanes)!==0,wn||ae){if(F=Dr,F!==null){switch(Y&-Y){case 4:M=2;break;case 16:M=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:M=32;break;case 536870912:M=268435456;break;default:M=0}M=(M&(F.suspendedLanes|Y))!==0?0:M,M!==0&&M!==B.retryLane&&(B.retryLane=M,Ni(u,M),Na(F,u,M,-1))}return b0(),F=Zv(Error(r(421))),tm(u,g,Y,F)}return M.data==="$?"?(g.flags|=128,g.child=u.child,g=J7.bind(null,u),M._reactRetry=g,null):(u=B.treeContext,Ln=ls(M.nextSibling),Mn=g,or=!0,ba=null,u!==null&&(ta[ra++]=_i,ta[ra++]=ji,ta[ra++]=so,_i=u.id,ji=u.overflow,so=g),g=a0(g,F.children),g.flags|=4096,g)}function YF(u,g,j){u.lanes|=g;var F=u.alternate;F!==null&&(F.lanes|=g),Iv(u.return,g,j)}function i0(u,g,j,F,M){var B=u.memoizedState;B===null?u.memoizedState={isBackwards:g,rendering:null,renderingStartTime:0,last:F,tail:j,tailMode:M}:(B.isBackwards=g,B.rendering=null,B.renderingStartTime=0,B.last=F,B.tail=j,B.tailMode=M)}function QF(u,g,j){var F=g.pendingProps,M=F.revealOrder,B=F.tail;if(dn(u,g,F.children,j),F=ur.current,(F&2)!==0)F=F&1|2,g.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=g.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&YF(u,j,g);else if(u.tag===19)YF(u,j,g);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===g)break e;for(;u.sibling===null;){if(u.return===null||u.return===g)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}F&=1}if(Zt(ur,F),(g.mode&1)===0)g.memoizedState=null;else switch(M){case"forwards":for(j=g.child,M=null;j!==null;)u=j.alternate,u!==null&&Gh(u)===null&&(M=j),j=j.sibling;j=M,j===null?(M=g.child,g.child=null):(M=j.sibling,j.sibling=null),i0(g,!1,M,j,B);break;case"backwards":for(j=null,M=g.child,g.child=null;M!==null;){if(u=M.alternate,u!==null&&Gh(u)===null){g.child=M;break}u=M.sibling,M.sibling=j,j=M,M=u}i0(g,!0,j,null,B);break;case"together":i0(g,!1,null,null,void 0);break;default:g.memoizedState=null}return g.child}function rm(u,g){(g.mode&1)===0&&u!==null&&(u.alternate=null,g.alternate=null,g.flags|=2)}function ki(u,g,j){if(u!==null&&(g.dependencies=u.dependencies),fo|=g.lanes,(j&g.childLanes)===0)return null;if(u!==null&&g.child!==u.child)throw Error(r(153));if(g.child!==null){for(u=g.child,j=xs(u,u.pendingProps),g.child=j,j.return=g;u.sibling!==null;)u=u.sibling,j=j.sibling=xs(u,u.pendingProps),j.return=g;j.sibling=null}return g.child}function B7(u,g,j){switch(g.tag){case 3:WF(g),El();break;case 5:uF(g);break;case 1:bn(g.type)&&Dh(g);break;case 4:Dv(g,g.stateNode.containerInfo);break;case 10:var F=g.type._context,M=g.memoizedProps.value;Zt(Hh,F._currentValue),F._currentValue=M;break;case 13:if(F=g.memoizedState,F!==null)return F.dehydrated!==null?(Zt(ur,ur.current&1),g.flags|=128,null):(j&g.child.childLanes)!==0?GF(u,g,j):(Zt(ur,ur.current&1),u=ki(u,g,j),u!==null?u.sibling:null);Zt(ur,ur.current&1);break;case 19:if(F=(j&g.childLanes)!==0,(u.flags&128)!==0){if(F)return QF(u,g,j);g.flags|=128}if(M=g.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),Zt(ur,ur.current),F)break;return null;case 22:case 23:return g.lanes=0,UF(u,g,j)}return ki(u,g,j)}var XF,s0,ZF,JF;XF=function(u,g){for(var j=g.child;j!==null;){if(j.tag===5||j.tag===6)u.appendChild(j.stateNode);else if(j.tag!==4&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===g)break;for(;j.sibling===null;){if(j.return===null||j.return===g)return;j=j.return}j.sibling.return=j.return,j=j.sibling}},s0=function(){},ZF=function(u,g,j,F){var M=u.memoizedProps;if(M!==F){u=g.stateNode,co(Wa.current);var B=null;switch(j){case"input":M=Oe(u,M),F=Oe(u,F),B=[];break;case"select":M=q({},M,{value:void 0}),F=q({},F,{value:void 0}),B=[];break;case"textarea":M=_e(u,M),F=_e(u,F),B=[];break;default:typeof M.onClick!="function"&&typeof F.onClick=="function"&&(u.onclick=Ih)}Wr(j,F);var Y;j=null;for(ve in M)if(!F.hasOwnProperty(ve)&&M.hasOwnProperty(ve)&&M[ve]!=null)if(ve==="style"){var ae=M[ve];for(Y in ae)ae.hasOwnProperty(Y)&&(j||(j={}),j[Y]="")}else ve!=="dangerouslySetInnerHTML"&&ve!=="children"&&ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&ve!=="autoFocus"&&(i.hasOwnProperty(ve)?B||(B=[]):(B=B||[]).push(ve,null));for(ve in F){var ce=F[ve];if(ae=M!=null?M[ve]:void 0,F.hasOwnProperty(ve)&&ce!==ae&&(ce!=null||ae!=null))if(ve==="style")if(ae){for(Y in ae)!ae.hasOwnProperty(Y)||ce&&ce.hasOwnProperty(Y)||(j||(j={}),j[Y]="");for(Y in ce)ce.hasOwnProperty(Y)&&ae[Y]!==ce[Y]&&(j||(j={}),j[Y]=ce[Y])}else j||(B||(B=[]),B.push(ve,j)),j=ce;else ve==="dangerouslySetInnerHTML"?(ce=ce?ce.__html:void 0,ae=ae?ae.__html:void 0,ce!=null&&ae!==ce&&(B=B||[]).push(ve,ce)):ve==="children"?typeof ce!="string"&&typeof ce!="number"||(B=B||[]).push(ve,""+ce):ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&(i.hasOwnProperty(ve)?(ce!=null&&ve==="onScroll"&&ar("scroll",u),B||ae===ce||(B=[])):(B=B||[]).push(ve,ce))}j&&(B=B||[]).push("style",j);var ve=B;(g.updateQueue=ve)&&(g.flags|=4)}},JF=function(u,g,j,F){j!==F&&(g.flags|=4)};function Zu(u,g){if(!or)switch(u.tailMode){case"hidden":g=u.tail;for(var j=null;g!==null;)g.alternate!==null&&(j=g),g=g.sibling;j===null?u.tail=null:j.sibling=null;break;case"collapsed":j=u.tail;for(var F=null;j!==null;)j.alternate!==null&&(F=j),j=j.sibling;F===null?g||u.tail===null?u.tail=null:u.tail.sibling=null:F.sibling=null}}function tn(u){var g=u.alternate!==null&&u.alternate.child===u.child,j=0,F=0;if(g)for(var M=u.child;M!==null;)j|=M.lanes|M.childLanes,F|=M.subtreeFlags&14680064,F|=M.flags&14680064,M.return=u,M=M.sibling;else for(M=u.child;M!==null;)j|=M.lanes|M.childLanes,F|=M.subtreeFlags,F|=M.flags,M.return=u,M=M.sibling;return u.subtreeFlags|=F,u.childLanes=j,g}function z7(u,g,j){var F=g.pendingProps;switch(Fv(g),g.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(g),null;case 1:return bn(g.type)&&Lh(),tn(g),null;case 3:return F=g.stateNode,Rl(),ir(xn),ir(Jr),Bv(),F.pendingContext&&(F.context=F.pendingContext,F.pendingContext=null),(u===null||u.child===null)&&(zh(g)?g.flags|=4:u===null||u.memoizedState.isDehydrated&&(g.flags&256)===0||(g.flags|=1024,ba!==null&&(y0(ba),ba=null))),s0(u,g),tn(g),null;case 5:$v(g);var M=co(Ku.current);if(j=g.type,u!==null&&g.stateNode!=null)ZF(u,g,j,F,M),u.ref!==g.ref&&(g.flags|=512,g.flags|=2097152);else{if(!F){if(g.stateNode===null)throw Error(r(166));return tn(g),null}if(u=co(Wa.current),zh(g)){F=g.stateNode,j=g.type;var B=g.memoizedProps;switch(F[Va]=g,F[zu]=B,u=(g.mode&1)!==0,j){case"dialog":ar("cancel",F),ar("close",F);break;case"iframe":case"object":case"embed":ar("load",F);break;case"video":case"audio":for(M=0;M<$u.length;M++)ar($u[M],F);break;case"source":ar("error",F);break;case"img":case"image":case"link":ar("error",F),ar("load",F);break;case"details":ar("toggle",F);break;case"input":Ve(F,B),ar("invalid",F);break;case"select":F._wrapperState={wasMultiple:!!B.multiple},ar("invalid",F);break;case"textarea":dt(F,B),ar("invalid",F)}Wr(j,B),M=null;for(var Y in B)if(B.hasOwnProperty(Y)){var ae=B[Y];Y==="children"?typeof ae=="string"?F.textContent!==ae&&(B.suppressHydrationWarning!==!0&&Rh(F.textContent,ae,u),M=["children",ae]):typeof ae=="number"&&F.textContent!==""+ae&&(B.suppressHydrationWarning!==!0&&Rh(F.textContent,ae,u),M=["children",""+ae]):i.hasOwnProperty(Y)&&ae!=null&&Y==="onScroll"&&ar("scroll",F)}switch(j){case"input":ge(F),ye(F,B,!0);break;case"textarea":ge(F),gt(F);break;case"select":case"option":break;default:typeof B.onClick=="function"&&(F.onclick=Ih)}F=M,g.updateQueue=F,F!==null&&(g.flags|=4)}else{Y=M.nodeType===9?M:M.ownerDocument,u==="http://www.w3.org/1999/xhtml"&&(u=be(j)),u==="http://www.w3.org/1999/xhtml"?j==="script"?(u=Y.createElement("div"),u.innerHTML="<script><\/script>
40",u=u.removeChild(u.firstChild)):typeof F.is=="string"?u=Y.createElement(j,{is:F.is}):(u=Y.createElement(j),j==="select"&&(Y=u,F.multiple?Y.multiple=!0:F.size&&(Y.size=F.size))):u=Y.createElementNS(u,j),u[Va]=g,u[zu]=F,XF(u,g,!1,!1),g.stateNode=u;e:{switch(Y=Ua(j,F),j){case"dialog":ar("cancel",u),ar("close",u),M=F;break;case"iframe":case"object":case"embed":ar("load",u),M=F;break;case"video":case"audio":for(M=0;M<$u.length;M++)ar($u[M],u);M=F;break;case"source":ar("error",u),M=F;break;case"img":case"image":case"link":ar("error",u),ar("load",u),M=F;break;case"details":ar("toggle",u),M=F;break;case"input":Ve(u,F),M=Oe(u,F),ar("invalid",u);break;case"option":M=F;break;case"select":u._wrapperState={wasMultiple:!!F.multiple},M=q({},F,{value:void 0}),ar("invalid",u);break;case"textarea":dt(u,F),M=_e(u,F),ar("invalid",u);break;default:M=F}Wr(j,M),ae=M;for(B in ae)if(ae.hasOwnProperty(B)){var ce=ae[B];B==="style"?ts(u,ce):B==="dangerouslySetInnerHTML"?(ce=ce?ce.__html:void 0,ce!=null&&wt(u,ce)):B==="children"?typeof ce=="string"?(j!=="textarea"||ce!=="")&&it(u,ce):typeof ce=="number"&&it(u,""+ce):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(i.hasOwnProperty(B)?ce!=null&&B==="onScroll"&&ar("scroll",u):ce!=null&&_(u,B,ce,Y))}switch(j){case"input":ge(u),ye(u,F,!1);break;case"textarea":ge(u),gt(u);break;case"option":F.value!=null&&u.setAttribute("value",""+ie(F.value));break;case"select":u.multiple=!!F.multiple,B=F.value,B!=null?Re(u,!!F.multiple,B,!1):F.defaultValue!=null&&Re(u,!!F.multiple,F.defaultValue,!0);break;default:typeof M.onClick=="function"&&(u.onclick=Ih)}switch(j){case"button":case"input":case"select":case"textarea":F=!!F.autoFocus;break e;case"img":F=!0;break e;default:F=!1}}F&&(g.flags|=4)}g.ref!==null&&(g.flags|=512,g.flags|=2097152)}return tn(g),null;case 6:if(u&&g.stateNode!=null)JF(u,g,u.memoizedProps,F);else{if(typeof F!="string"&&g.stateNode===null)throw Error(r(166));if(j=co(Ku.current),co(Wa.current),zh(g)){if(F=g.stateNode,j=g.memoizedProps,F[Va]=g,(B=F.nodeValue!==j)&&(u=Mn,u!==null))switch(u.tag){case 3:Rh(F.nodeValue,j,(u.mode&1)!==0);break;case 5:u.memoizedProps.suppressHydrationWarning!==!0&&Rh(F.nodeValue,j,(u.mode&1)!==0)}B&&(g.flags|=4)}else F=(j.nodeType===9?j:j.ownerDocument).createTextNode(F),F[Va]=g,g.stateNode=F}return tn(g),null;case 13:if(ir(ur),F=g.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(or&&Ln!==null&&(g.mode&1)!==0&&(g.flags&128)===0)rF(),El(),g.flags|=98560,B=!1;else if(B=zh(g),F!==null&&F.dehydrated!==null){if(u===null){if(!B)throw Error(r(318));if(B=g.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(r(317));B[Va]=g}else El(),(g.flags&128)===0&&(g.memoizedState=null),g.flags|=4;tn(g),B=!1}else ba!==null&&(y0(ba),ba=null),B=!0;if(!B)return g.flags&65536?g:null}return(g.flags&128)!==0?(g.lanes=j,g):(F=F!==null,F!==(u!==null&&u.memoizedState!==null)&&F&&(g.child.flags|=8192,(g.mode&1)!==0&&(u===null||(ur.current&1)!==0?Fr===0&&(Fr=3):b0())),g.updateQueue!==null&&(g.flags|=4),tn(g),null);case 4:return Rl(),s0(u,g),u===null&&qu(g.stateNode.containerInfo),tn(g),null;case 10:return Rv(g.type._context),tn(g),null;case 17:return bn(g.type)&&Lh(),tn(g),null;case 19:if(ir(ur),B=g.memoizedState,B===null)return tn(g),null;if(F=(g.flags&128)!==0,Y=B.rendering,Y===null)if(F)Zu(B,!1);else{if(Fr!==0||u!==null&&(u.flags&128)!==0)for(u=g.child;u!==null;){if(Y=Gh(u),Y!==null){for(g.flags|=128,Zu(B,!1),F=Y.updateQueue,F!==null&&(g.updateQueue=F,g.flags|=4),g.subtreeFlags=0,F=j,j=g.child;j!==null;)B=j,u=F,B.flags&=14680066,Y=B.alternate,Y===null?(B.childLanes=0,B.lanes=u,B.child=null,B.subtreeFlags=0,B.memoizedProps=null,B.memoizedState=null,B.updateQueue=null,B.dependencies=null,B.stateNode=null):(B.childLanes=Y.childLanes,B.lanes=Y.lanes,B.child=Y.child,B.subtreeFlags=0,B.deletions=null,B.memoizedProps=Y.memoizedProps,B.memoizedState=Y.memoizedState,B.updateQueue=Y.updateQueue,B.type=Y.type,u=Y.dependencies,B.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),j=j.sibling;return Zt(ur,ur.current&1|2),g.child}u=u.sibling}B.tail!==null&&yr()>Dl&&(g.flags|=128,F=!0,Zu(B,!1),g.lanes=4194304)}else{if(!F)if(u=Gh(Y),u!==null){if(g.flags|=128,F=!0,j=u.updateQueue,j!==null&&(g.updateQueue=j,g.flags|=4),Zu(B,!0),B.tail===null&&B.tailMode==="hidden"&&!Y.alternate&&!or)return tn(g),null}else 2*yr()-B.renderingStartTime>Dl&&j!==1073741824&&(g.flags|=128,F=!0,Zu(B,!1),g.lanes=4194304);B.isBackwards?(Y.sibling=g.child,g.child=Y):(j=B.last,j!==null?j.sibling=Y:g.child=Y,B.last=Y)}return B.tail!==null?(g=B.tail,B.rendering=g,B.tail=g.sibling,B.renderingStartTime=yr(),g.sibling=null,j=ur.current,Zt(ur,F?j&1|2:j&1),g):(tn(g),null);case 22:case 23:return x0(),F=g.memoizedState!==null,u!==null&&u.memoizedState!==null!==F&&(g.flags|=8192),F&&(g.mode&1)!==0?(Dn&1073741824)!==0&&(tn(g),g.subtreeFlags&6&&(g.flags|=8192)):tn(g),null;case 24:return null;case 25:return null}throw Error(r(156,g.tag))}function U7(u,g){switch(Fv(g),g.tag){case 1:return bn(g.type)&&Lh(),u=g.flags,u&65536?(g.flags=u&-65537|128,g):null;case 3:return Rl(),ir(xn),ir(Jr),Bv(),u=g.flags,(u&65536)!==0&&(u&128)===0?(g.flags=u&-65537|128,g):null;case 5:return $v(g),null;case 13:if(ir(ur),u=g.memoizedState,u!==null&&u.dehydrated!==null){if(g.alternate===null)throw Error(r(340));El()}return u=g.flags,u&65536?(g.flags=u&-65537|128,g):null;case 19:return ir(ur),null;case 4:return Rl(),null;case 10:return Rv(g.type._context),null;case 22:case 23:return x0(),null;case 24:return null;default:return null}}var nm=!1,rn=!1,H7=typeof WeakSet=="function"?WeakSet:Set,Ke=null;function Ml(u,g){var j=u.ref;if(j!==null)if(typeof j=="function")try{j(null)}catch(F){mr(u,g,F)}else j.current=null}function o0(u,g,j){try{j()}catch(F){mr(u,g,F)}}var e2=!1;function V7(u,g){if(xv=jh,u=TC(),dv(u)){if("selectionStart"in u)var j={start:u.selectionStart,end:u.selectionEnd};else e:{j=(j=u.ownerDocument)&&j.defaultView||window;var F=j.getSelection&&j.getSelection();if(F&&F.rangeCount!==0){j=F.anchorNode;var M=F.anchorOffset,B=F.focusNode;F=F.focusOffset;try{j.nodeType,B.nodeType}catch{j=null;break e}var Y=0,ae=-1,ce=-1,ve=0,Ne=0,Se=u,je=null;t:for(;;){for(var We;Se!==j||M!==0&&Se.nodeType!==3||(ae=Y+M),Se!==B||F!==0&&Se.nodeType!==3||(ce=Y+F),Se.nodeType===3&&(Y+=Se.nodeValue.length),(We=Se.firstChild)!==null;)je=Se,Se=We;for(;;){if(Se===u)break t;if(je===j&&++ve===M&&(ae=Y),je===B&&++Ne===F&&(ce=Y),(We=Se.nextSibling)!==null)break;Se=je,je=Se.parentNode}Se=We}j=ae===-1||ce===-1?null:{start:ae,end:ce}}else j=null}j=j||{start:0,end:0}}else j=null;for(bv={focusedElem:u,selectionRange:j},jh=!1,Ke=g;Ke!==null;)if(g=Ke,u=g.child,(g.subtreeFlags&1028)!==0&&u!==null)u.return=g,Ke=u;else for(;Ke!==null;){g=Ke;try{var Qe=g.alternate;if((g.flags&1024)!==0)switch(g.tag){case 0:case 11:case 15:break;case 1:if(Qe!==null){var et=Qe.memoizedProps,vr=Qe.memoizedState,me=g.stateNode,de=me.getSnapshotBeforeUpdate(g.elementType===g.type?et:wa(g.type,et),vr);me.__reactInternalSnapshotBeforeUpdate=de}break;case 3:var pe=g.stateNode.containerInfo;pe.nodeType===1?pe.textContent="":pe.nodeType===9&&pe.documentElement&&pe.removeChild(pe.documentElement);break;
vendor: 17,343 bytes, line 40
40case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Pe){mr(g,g.return,Pe)}if(u=g.sibling,u!==null){u.return=g.return,Ke=u;break}Ke=g.return}return Qe=e2,e2=!1,Qe}function Ju(u,g,j){var F=g.updateQueue;if(F=F!==null?F.lastEffect:null,F!==null){var M=F=F.next;do{if((M.tag&u)===u){var B=M.destroy;M.destroy=void 0,B!==void 0&&o0(g,j,B)}M=M.next}while(M!==F)}}function am(u,g){if(g=g.updateQueue,g=g!==null?g.lastEffect:null,g!==null){var j=g=g.next;do{if((j.tag&u)===u){var F=j.create;j.destroy=F()}j=j.next}while(j!==g)}}function l0(u){var g=u.ref;if(g!==null){var j=u.stateNode;switch(u.tag){case 5:u=j;break;default:u=j}typeof g=="function"?g(u):g.current=u}}function t2(u){var g=u.alternate;g!==null&&(u.alternate=null,t2(g)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(g=u.stateNode,g!==null&&(delete g[Va],delete g[zu],delete g[Nv],delete g[C7],delete g[F7])),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function r2(u){return u.tag===5||u.tag===3||u.tag===4}function n2(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||r2(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function c0(u,g,j){var F=u.tag;if(F===5||F===6)u=u.stateNode,g?j.nodeType===8?j.parentNode.insertBefore(u,g):j.insertBefore(u,g):(j.nodeType===8?(g=j.parentNode,g.insertBefore(u,j)):(g=j,g.appendChild(u)),j=j._reactRootContainer,j!=null||g.onclick!==null||(g.onclick=Ih));else if(F!==4&&(u=u.child,u!==null))for(c0(u,g,j),u=u.sibling;u!==null;)c0(u,g,j),u=u.sibling}function u0(u,g,j){var F=u.tag;if(F===5||F===6)u=u.stateNode,g?j.insertBefore(u,g):j.appendChild(u);else if(F!==4&&(u=u.child,u!==null))for(u0(u,g,j),u=u.sibling;u!==null;)u0(u,g,j),u=u.sibling}var Kr=null,_a=!1;function ms(u,g,j){for(j=j.child;j!==null;)a2(u,g,j),j=j.sibling}function a2(u,g,j){if(Ha&&typeof Ha.onCommitFiberUnmount=="function")try{Ha.onCommitFiberUnmount(yh,j)}catch{}switch(j.tag){case 5:rn||Ml(j,g);case 6:var F=Kr,M=_a;Kr=null,ms(u,g,j),Kr=F,_a=M,Kr!==null&&(_a?(u=Kr,j=j.stateNode,u.nodeType===8?u.parentNode.removeChild(j):u.removeChild(j)):Kr.removeChild(j.stateNode));break;case 18:Kr!==null&&(_a?(u=Kr,j=j.stateNode,u.nodeType===8?jv(u.parentNode,j):u.nodeType===1&&jv(u,j),Pu(u)):jv(Kr,j.stateNode));break;case 4:F=Kr,M=_a,Kr=j.stateNode.containerInfo,_a=!0,ms(u,g,j),Kr=F,_a=M;break;case 0:case 11:case 14:case 15:if(!rn&&(F=j.updateQueue,F!==null&&(F=F.lastEffect,F!==null))){M=F=F.next;do{var B=M,Y=B.destroy;B=B.tag,Y!==void 0&&((B&2)!==0||(B&4)!==0)&&o0(j,g,Y),M=M.next}while(M!==F)}ms(u,g,j);break;case 1:if(!rn&&(Ml(j,g),F=j.stateNode,typeof F.componentWillUnmount=="function"))try{F.props=j.memoizedProps,F.state=j.memoizedState,F.componentWillUnmount()}catch(ae){mr(j,g,ae)}ms(u,g,j);break;case 21:ms(u,g,j);break;case 22:j.mode&1?(rn=(F=rn)||j.memoizedState!==null,ms(u,g,j),rn=F):ms(u,g,j);break;default:ms(u,g,j)}}function i2(u){var g=u.updateQueue;if(g!==null){u.updateQueue=null;var j=u.stateNode;j===null&&(j=u.stateNode=new H7),g.forEach(function(F){var M=ez.bind(null,u,F);j.has(F)||(j.add(F),F.then(M,M))})}}function ja(u,g){var j=g.deletions;if(j!==null)for(var F=0;F<j.length;F++){var M=j[F];try{var B=u,Y=g,ae=Y;e:for(;ae!==null;){switch(ae.tag){case 5:Kr=ae.stateNode,_a=!1;break e;case 3:Kr=ae.stateNode.containerInfo,_a=!0;break e;case 4:Kr=ae.stateNode.containerInfo,_a=!0;break e}ae=ae.return}if(Kr===null)throw Error(r(160));a2(B,Y,M),Kr=null,_a=!1;var ce=M.alternate;ce!==null&&(ce.return=null),M.return=null}catch(ve){mr(M,g,ve)}}if(g.subtreeFlags&12854)for(g=g.child;g!==null;)s2(g,u),g=g.sibling}function s2(u,g){var j=u.alternate,F=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:if(ja(g,u),Ga(u),F&4){try{Ju(3,u,u.return),am(3,u)}catch(et){mr(u,u.return,et)}try{Ju(5,u,u.return)}catch(et){mr(u,u.return,et)}}break;case 1:ja(g,u),Ga(u),F&512&&j!==null&&Ml(j,j.return);break;case 5:if(ja(g,u),Ga(u),F&512&&j!==null&&Ml(j,j.return),u.flags&32){var M=u.stateNode;try{it(M,"")}catch(et){mr(u,u.return,et)}}if(F&4&&(M=u.stateNode,M!=null)){var B=u.memoizedProps,Y=j!==null?j.memoizedProps:B,ae=u.type,ce=u.updateQueue;if(u.updateQueue=null,ce!==null)try{ae==="input"&&B.type==="radio"&&B.name!=null&&Ae(M,B),Ua(ae,Y);var ve=Ua(ae,B);for(Y=0;Y<ce.length;Y+=2){var Ne=ce[Y],Se=ce[Y+1];Ne==="style"?ts(M,Se):Ne==="dangerouslySetInnerHTML"?wt(M,Se):Ne==="children"?it(M,Se):_(M,Ne,Se,ve)}switch(ae){case"input":tt(M,B);break;case"textarea":pt(M,B);break;case"select":var je=M._wrapperState.wasMultiple;M._wrapperState.wasMultiple=!!B.multiple;var We=B.value;We!=null?Re(M,!!B.multiple,We,!1):je!==!!B.multiple&&(B.defaultValue!=null?Re(M,!!B.multiple,B.defaultValue,!0):Re(M,!!B.multiple,B.multiple?[]:"",!1))}M[zu]=B}catch(et){mr(u,u.return,et)}}break;case 6:if(ja(g,u),Ga(u),F&4){if(u.stateNode===null)throw Error(r(162));M=u.stateNode,B=u.memoizedProps;try{M.nodeValue=B}catch(et){mr(u,u.return,et)}}break;case 3:if(ja(g,u),Ga(u),F&4&&j!==null&&j.memoizedState.isDehydrated)try{Pu(g.containerInfo)}catch(et){mr(u,u.return,et)}break;case 4:ja(g,u),Ga(u);break;case 13:ja(g,u),Ga(u),M=u.child,M.flags&8192&&(B=M.memoizedState!==null,M.stateNode.isHidden=B,!B||M.alternate!==null&&M.alternate.memoizedState!==null||(h0=yr())),F&4&&i2(u);break;case 22:if(Ne=j!==null&&j.memoizedState!==null,u.mode&1?(rn=(ve=rn)||Ne,ja(g,u),rn=ve):ja(g,u),Ga(u),F&8192){if(ve=u.memoizedState!==null,(u.stateNode.isHidden=ve)&&!Ne&&(u.mode&1)!==0)for(Ke=u,Ne=u.child;Ne!==null;){for(Se=Ke=Ne;Ke!==null;){switch(je=Ke,We=je.child,je.tag){case 0:case 11:case 14:case 15:Ju(4,je,je.return);break;case 1:Ml(je,je.return);var Qe=je.stateNode;if(typeof Qe.componentWillUnmount=="function"){F=je,j=je.return;try{g=F,Qe.props=g.memoizedProps,Qe.state=g.memoizedState,Qe.componentWillUnmount()}catch(et){mr(F,j,et)}}break;case 5:Ml(je,je.return);break;case 22:if(je.memoizedState!==null){c2(Se);continue}}We!==null?(We.return=je,Ke=We):c2(Se)}Ne=Ne.sibling}e:for(Ne=null,Se=u;;){if(Se.tag===5){if(Ne===null){Ne=Se;try{M=Se.stateNode,ve?(B=M.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none"):(ae=Se.stateNode,ce=Se.memoizedProps.style,Y=ce!=null&&ce.hasOwnProperty("display")?ce.display:null,ae.style.display=ea("display",Y))}catch(et){mr(u,u.return,et)}}}else if(Se.tag===6){if(Ne===null)try{Se.stateNode.nodeValue=ve?"":Se.memoizedProps}catch(et){mr(u,u.return,et)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===u)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===u)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===u)break e;Ne===Se&&(Ne=null),Se=Se.return}Ne===Se&&(Ne=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:ja(g,u),Ga(u),F&4&&i2(u);break;case 21:break;default:ja(g,u),Ga(u)}}function Ga(u){var g=u.flags;if(g&2){try{e:{for(var j=u.return;j!==null;){if(r2(j)){var F=j;break e}j=j.return}throw Error(r(160))}switch(F.tag){case 5:var M=F.stateNode;F.flags&32&&(it(M,""),F.flags&=-33);var B=n2(u);u0(u,B,M);break;case 3:case 4:var Y=F.stateNode.containerInfo,ae=n2(u);c0(u,ae,Y);break;default:throw Error(r(161))}}catch(ce){mr(u,u.return,ce)}u.flags&=-3}g&4096&&(u.flags&=-4097)}function W7(u,g,j){Ke=u,o2(u)}function o2(u,g,j){for(var F=(u.mode&1)!==0;Ke!==null;){var M=Ke,B=M.child;if(M.tag===22&&F){var Y=M.memoizedState!==null||nm;if(!Y){var ae=M.alternate,ce=ae!==null&&ae.memoizedState!==null||rn;ae=nm;var ve=rn;if(nm=Y,(rn=ce)&&!ve)for(Ke=M;Ke!==null;)Y=Ke,ce=Y.child,Y.tag===22&&Y.memoizedState!==null?u2(M):ce!==null?(ce.return=Y,Ke=ce):u2(M);for(;B!==null;)Ke=B,o2(B),B=B.sibling;Ke=M,nm=ae,rn=ve}l2(u)}else(M.subtreeFlags&8772)!==0&&B!==null?(B.return=M,Ke=B):l2(u)}}function l2(u){for(;Ke!==null;){var g=Ke;if((g.flags&8772)!==0){var j=g.alternate;try{if((g.flags&8772)!==0)switch(g.tag){case 0:case 11:case 15:rn||am(5,g);break;case 1:var F=g.stateNode;if(g.flags&4&&!rn)if(j===null)F.componentDidMount();else{var M=g.elementType===g.type?j.memoizedProps:wa(g.type,j.memoizedProps);F.componentDidUpdate(M,j.memoizedState,F.__reactInternalSnapshotBeforeUpdate)}var B=g.updateQueue;B!==null&&cF(g,B,F);break;case 3:var Y=g.updateQueue;if(Y!==null){if(j=null,g.child!==null)switch(g.child.tag){case 5:j=g.child.stateNode;break;case 1:j=g.child.stateNode}cF(g,Y,j)}break;case 5:var ae=g.stateNode;if(j===null&&g.flags&4){j=ae;var ce=g.memoizedProps;switch(g.type){case"button":case"input":case"select":case"textarea":ce.autoFocus&&j.focus();break;case"img":ce.src&&(j.src=ce.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(g.memoizedState===null){var ve=g.alternate;if(ve!==null){var Ne=ve.memoizedState;if(Ne!==null){var Se=Ne.dehydrated;Se!==null&&Pu(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}rn||g.flags&512&&l0(g)}catch(je){mr(g,g.return,je)}}if(g===u){Ke=null;break}if(j=g.sibling,j!==null){j.return=g.return,Ke=j;break}Ke=g.return}}function c2(u){for(;Ke!==null;){var g=Ke;if(g===u){Ke=null;break}var j=g.sibling;if(j!==null){j.return=g.return,Ke=j;break}Ke=g.return}}function u2(u){for(;Ke!==null;){var g=Ke;try{switch(g.tag){case 0:case 11:case 15:var j=g.return;try{am(4,g)}catch(ce){mr(g,j,ce)}break;case 1:var F=g.stateNode;if(typeof F.componentDidMount=="function"){var M=g.return;try{F.componentDidMount()}catch(ce){mr(g,M,ce)}}var B=g.return;try{l0(g)}catch(ce){mr(g,B,ce)}break;case 5:var Y=g.return;try{l0(g)}catch(ce){mr(g,Y,ce)}}}catch(ce){mr(g,g.return,ce)}if(g===u){Ke=null;break}var ae=g.sibling;if(ae!==null){ae.return=g.return,Ke=ae;break}Ke=g.return}}var K7=Math.ceil,im=N.ReactCurrentDispatcher,d0=N.ReactCurrentOwner,ia=N.ReactCurrentBatchConfig,Ot=0,Dr=null,wr=null,Gr=0,Dn=0,Ll=cs(0),Fr=0,ed=null,fo=0,sm=0,f0=0,td=null,_n=null,h0=0,Dl=1/0,Ci=null,om=!1,m0=null,ps=null,lm=!1,gs=null,cm=0,rd=0,p0=null,um=-1,dm=0;function fn(){return(Ot&6)!==0?yr():um!==-1?um:um=yr()}function ys(u){return(u.mode&1)===0?1:(Ot&2)!==0&&Gr!==0?Gr&-Gr:E7.transition!==null?(dm===0&&(dm=nC()),dm):(u=Bt,u!==0||(u=window.event,u=u===void 0?16:fC(u.type)),u)}function Na(u,g,j,F){if(50<rd)throw rd=0,p0=null,Error(r(185));ku(u,j,F),((Ot&2)===0||u!==Dr)&&(u===Dr&&((Ot&2)===0&&(sm|=j),Fr===4&&vs(u,Gr)),jn(u,F),j===1&&Ot===0&&(g.mode&1)===0&&(Dl=yr()+500,$h&&ds()))}function jn(u,g){var j=u.callbackNode;EB(u,g);var F=bh(u,u===Dr?Gr:0);if(F===0)j!==null&&eC(j),u.callbackNode=null,u.callbackPriority=0;else if(g=F&-F,u.callbackPriority!==g){if(j!=null&&eC(j),g===1)u.tag===0?O7(f2.bind(null,u)):XC(f2.bind(null,u)),S7(function(){(Ot&6)===0&&ds()}),j=null;else{switch(aC(F)){case 1:j=Gy;break;case 4:j=tC;break;case 16:j=gh;break;case 536870912:j=rC;break;default:j=gh}j=b2(j,d2.bind(null,u))}u.callbackPriority=g,u.callbackNode=j}}function d2(u,g){if(um=-1,dm=0,(Ot&6)!==0)throw Error(r(327));var j=u.callbackNode;if($l()&&u.callbackNode!==j)return null;var F=bh(u,u===Dr?Gr:0);if(F===0)return null;if((F&30)!==0||(F&u.expiredLanes)!==0||g)g=fm(u,F);else{g=F;var M=Ot;Ot|=2;var B=m2();(Dr!==u||Gr!==g)&&(Ci=null,Dl=yr()+500,mo(u,g));do try{Q7();break}catch(ae){h2(u,ae)}while(!0);Av(),im.current=B,Ot=M,wr!==null?g=0:(Dr=null,Gr=0,g=Fr)}if(g!==0){if(g===2&&(M=Yy(u),M!==0&&(F=M,g=g0(u,M))),g===1)throw j=ed,mo(u,0),vs(u,F),jn(u,yr()),j;if(g===6)vs(u,F);else{if(M=u.current.alternate,(F&30)===0&&!G7(M)&&(g=fm(u,F),g===2&&(B=Yy(u),B!==0&&(F=B,g=g0(u,B))),g===1))throw j=ed,mo(u,0),vs(u,F),jn(u,yr()),j;switch(u.finishedWork=M,u.finishedLanes=F,g){case 0:case 1:throw Error(r(345));case 2:po(u,_n,Ci);break;case 3:if(vs(u,F),(F&130023424)===F&&(g=h0+500-yr(),10<g)){if(bh(u,0)!==0)break;if(M=u.suspendedLanes,(M&F)!==F){fn(),u.pingedLanes|=u.suspendedLanes&M;break}u.timeoutHandle=_v(po.bind(null,u,_n,Ci),g);break}po(u,_n,Ci);break;case 4:if(vs(u,F),(F&4194240)===F)break;for(g=u.eventTimes,M=-1;0<F;){var Y=31-va(F);B=1<<Y,Y=g[Y],Y>M&&(M=Y),F&=~B}if(F=M,F=yr()-F,F=(120>F?120:480>F?480:1080>F?1080:1920>F?1920:3e3>F?3e3:4320>F?4320:1960*K7(F/1960))-F,10<F){u.timeoutHandle=_v(po.bind(null,u,_n,Ci),F);break}po(u,_n,Ci);break;case 5:po(u,_n,Ci);break;default:throw Error(r(329))}}}return jn(u,yr()),u.callbackNode===j?d2.bind(null,u):null}function g0(u,g){var j=td;return u.current.memoizedState.isDehydrated&&(mo(u,g).flags|=256),u=fm(u,g),u!==2&&(g=_n,_n=j,g!==null&&y0(g)),u}function y0(u){_n===null?_n=u:_n.push.apply(_n,u)}function G7(u){for(var g=u;;){if(g.flags&16384){var j=g.updateQueue;if(j!==null&&(j=j.stores,j!==null))for(var F=0;F<j.length;F++){var M=j[F],B=M.getSnapshot;M=M.value;try{if(!xa(B(),M))return!1}catch{return!1}}}if(j=g.child,g.subtreeFlags&16384&&j!==null)j.return=g,g=j;else{if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return!0;g=g.return}g.sibling.return=g.return,g=g.sibling}}return!0}function vs(u,g){for(g&=~f0,g&=~sm,u.suspendedLanes|=g,u.pingedLanes&=~g,u=u.expirationTimes;0<g;){var j=31-va(g),F=1<<j;u[j]=-1,g&=~F}}function f2(u){if((Ot&6)!==0)throw Error(r(327));$l();var g=bh(u,0);if((g&1)===0)return jn(u,yr()),null;var j=fm(u,g);if(u.tag!==0&&j===2){var F=Yy(u);F!==0&&(g=F,j=g0(u,F))}if(j===1)throw j=ed,mo(u,0),vs(u,g),jn(u,yr()),j;if(j===6)throw Error(r(345));return u.finishedWork=u.current.alternate,u.finishedLanes=g,po(u,_n,Ci),jn(u,yr()),null}function v0(u,g){var j=Ot;Ot|=1;try{return u(g)}finally{Ot=j,Ot===0&&(Dl=yr()+500,$h&&ds())}}function ho(u){gs!==null&&gs.tag===0&&(Ot&6)===0&&$l();var g=Ot;Ot|=1;var j=ia.transition,F=Bt;try{if(ia.transition=null,Bt=1,u)return u()}finally{Bt=F,ia.transition=j,Ot=g,(Ot&6)===0&&ds()}}function x0(){Dn=Ll.current,ir(Ll)}function mo(u,g){u.finishedWork=null,u.finishedLanes=0;var j=u.timeoutHandle;if(j!==-1&&(u.timeoutHandle=-1,N7(j)),wr!==null)for(j=wr.return;j!==null;){var F=j;switch(Fv(F),F.tag){case 1:F=F.type.childContextTypes,F!=null&&Lh();break;case 3:Rl(),ir(xn),ir(Jr),Bv();break;case 5:$v(F);break;case 4:Rl();break;case 13:ir(ur);break;case 19:ir(ur);break;case 10:Rv(F.type._context);break;case 22:case 23:x0()}j=j.return}if(Dr=u,wr=u=xs(u.current,null),Gr=Dn=g,Fr=0,ed=null,f0=sm=fo=0,_n=td=null,lo!==null){for(g=0;g<lo.length;g++)if(j=lo[g],F=j.interleaved,F!==null){j.interleaved=null;var M=F.next,B=j.pending;if(B!==null){var Y=B.next;B.next=M,F.next=Y}j.pending=F}lo=null}return u}function h2(u,g){do{var j=wr;try{if(Av(),Yh.current=Jh,Qh){for(var F=dr.memoizedState;F!==null;){var M=F.queue;M!==null&&(M.pending=null),F=F.next}Qh=!1}if(uo=0,Lr=Cr=dr=null,Gu=!1,Yu=0,d0.current=null,j===null||j.return===null){Fr=1,ed=g,wr=null;break}e:{var B=u,Y=j.return,ae=j,ce=g;if(g=Gr,ae.flags|=32768,ce!==null&&typeof ce=="object"&&typeof ce.then=="function"){var ve=ce,Ne=ae,Se=Ne.tag;if((Ne.mode&1)===0&&(Se===0||Se===11||Se===15)){var je=Ne.alternate;je?(Ne.updateQueue=je.updateQueue,Ne.memoizedState=je.memoizedState,Ne.lanes=je.lanes):(Ne.updateQueue=null,Ne.memoizedState=null)}var We=DF(Y);if(We!==null){We.flags&=-257,$F(We,Y,ae,B,g),We.mode&1&&LF(B,ve,g),g=We,ce=ve;var Qe=g.updateQueue;if(Qe===null){var et=new Set;et.add(ce),g.updateQueue=et}else Qe.add(ce);break e}else{if((g&1)===0){LF(B,ve,g),b0();break e}ce=Error(r(426))}}else if(or&&ae.mode&1){var vr=DF(Y);if(vr!==null){(vr.flags&65536)===0&&(vr.flags|=256),$F(vr,Y,ae,B,g),Pv(Il(ce,ae));break e}}B=ce=Il(ce,ae),Fr!==4&&(Fr=2),td===null?td=[B]:td.push(B),B=Y;do{switch(B.tag){case 3:B.flags|=65536,g&=-g,B.lanes|=g;var me=IF(B,ce,g);lF(B,me);break e;case 1:ae=ce;var de=B.type,pe=B.stateNode;if((B.flags&128)===0&&(typeof de.getDerivedStateFromError=="function"||pe!==null&&typeof pe.componentDidCatch=="function"&&(ps===null||!ps.has(pe)))){B.flags|=65536,g&=-g,B.lanes|=g;var Pe=MF(B,ae,g);lF(B,Pe);break e}}B=B.return}while(B!==null)}g2(j)}catch(rt){g=rt,wr===j&&j!==null&&(wr=j=j.return);continue}break}while(!0)}function m2(){var u=im.current;return im.current=Jh,u===null?Jh:u}function b0(){(Fr===0||Fr===3||Fr===2)&&(Fr=4),Dr===null||(fo&268435455)===0&&(sm&268435455)===0||vs(Dr,Gr)}function fm(u,g){var j=Ot;Ot|=2;var F=m2();(Dr!==u||Gr!==g)&&(Ci=null,mo(u,g));do try{Y7();break}catch(M){h2(u,M)}while(!0);if(Av(),Ot=j,im.current=F,wr!==null)throw Error(r(261));return Dr=null,Gr=0,Fr}function Y7(){for(;wr!==null;)p2(wr)}function Q7(){for(;wr!==null&&!wB();)p2(wr)}function p2(u){var g=x2(u.alternate,u,Dn);u.memoizedProps=u.pendingProps,g===null?g2(u):wr=g,d0.current=null}function g2(u){var g=u;do{var j=g.alternate;if(u=g.return,(g.flags&32768)===0){if(j=z7(j,g,Dn),j!==null){wr=j;return}}else{if(j=U7(j,g),j!==null){j.flags&=32767,wr=j;return}if(u!==null)u.flags|=32768,u.subtreeFlags=0,u.deletions=null;else{Fr=6,wr=null;return}}if(g=g.sibling,g!==null){wr=g;return}wr=g=u}while(g!==null);Fr===0&&(Fr=5)}function po(u,g,j){var F=Bt,M=ia.transition;try{ia.transition=null,Bt=1,X7(u,g,j,F)}finally{ia.transition=M,Bt=F}return null}function X7(u,g,j,F){do $l();while(gs!==null);if((Ot&6)!==0)throw Error(r(327));j=u.finishedWork;var M=u.finishedLanes;if(j===null)return null;if(u.finishedWork=null,u.finishedLanes=0,j===u.current)throw Error(r(177));u.callbackNode=null,u.callbackPriority=0;var B=j.lanes|j.childLanes;if(PB(u,B),u===Dr&&(wr=Dr=null,Gr=0),(j.subtreeFlags&2064)===0&&(j.flags&2064)===0||lm||(lm=!0,b2(gh,function(){return $l
vendor: 4,464 bytes, line 40
40(),null})),B=(j.flags&15990)!==0,(j.subtreeFlags&15990)!==0||B){B=ia.transition,ia.transition=null;var Y=Bt;Bt=1;var ae=Ot;Ot|=4,d0.current=null,V7(u,j),s2(j,u),y7(bv),jh=!!xv,bv=xv=null,u.current=j,W7(j),_B(),Ot=ae,Bt=Y,ia.transition=B}else u.current=j;if(lm&&(lm=!1,gs=u,cm=M),B=u.pendingLanes,B===0&&(ps=null),SB(j.stateNode),jn(u,yr()),g!==null)for(F=u.onRecoverableError,j=0;j<g.length;j++)M=g[j],F(M.value,{componentStack:M.stack,digest:M.digest});if(om)throw om=!1,u=m0,m0=null,u;return(cm&1)!==0&&u.tag!==0&&$l(),B=u.pendingLanes,(B&1)!==0?u===p0?rd++:(rd=0,p0=u):rd=0,ds(),null}function $l(){if(gs!==null){var u=aC(cm),g=ia.transition,j=Bt;try{if(ia.transition=null,Bt=16>u?16:u,gs===null)var F=!1;else{if(u=gs,gs=null,cm=0,(Ot&6)!==0)throw Error(r(331));var M=Ot;for(Ot|=4,Ke=u.current;Ke!==null;){var B=Ke,Y=B.child;if((Ke.flags&16)!==0){var ae=B.deletions;if(ae!==null){for(var ce=0;ce<ae.length;ce++){var ve=ae[ce];for(Ke=ve;Ke!==null;){var Ne=Ke;switch(Ne.tag){case 0:case 11:case 15:Ju(8,Ne,B)}var Se=Ne.child;if(Se!==null)Se.return=Ne,Ke=Se;else for(;Ke!==null;){Ne=Ke;var je=Ne.sibling,We=Ne.return;if(t2(Ne),Ne===ve){Ke=null;break}if(je!==null){je.return=We,Ke=je;break}Ke=We}}}var Qe=B.alternate;if(Qe!==null){var et=Qe.child;if(et!==null){Qe.child=null;do{var vr=et.sibling;et.sibling=null,et=vr}while(et!==null)}}Ke=B}}if((B.subtreeFlags&2064)!==0&&Y!==null)Y.return=B,Ke=Y;else e:for(;Ke!==null;){if(B=Ke,(B.flags&2048)!==0)switch(B.tag){case 0:case 11:case 15:Ju(9,B,B.return)}var me=B.sibling;if(me!==null){me.return=B.return,Ke=me;break e}Ke=B.return}}var de=u.current;for(Ke=de;Ke!==null;){Y=Ke;var pe=Y.child;if((Y.subtreeFlags&2064)!==0&&pe!==null)pe.return=Y,Ke=pe;else e:for(Y=de;Ke!==null;){if(ae=Ke,(ae.flags&2048)!==0)try{switch(ae.tag){case 0:case 11:case 15:am(9,ae)}}catch(rt){mr(ae,ae.return,rt)}if(ae===Y){Ke=null;break e}var Pe=ae.sibling;if(Pe!==null){Pe.return=ae.return,Ke=Pe;break e}Ke=ae.return}}if(Ot=M,ds(),Ha&&typeof Ha.onPostCommitFiberRoot=="function")try{Ha.onPostCommitFiberRoot(yh,u)}catch{}F=!0}return F}finally{Bt=j,ia.transition=g}}return!1}function y2(u,g,j){g=Il(j,g),g=IF(u,g,1),u=hs(u,g,1),g=fn(),u!==null&&(ku(u,1,g),jn(u,g))}function mr(u,g,j){if(u.tag===3)y2(u,u,j);else for(;g!==null;){if(g.tag===3){y2(g,u,j);break}else if(g.tag===1){var F=g.stateNode;if(typeof g.type.getDerivedStateFromError=="function"||typeof F.componentDidCatch=="function"&&(ps===null||!ps.has(F))){u=Il(j,u),u=MF(g,u,1),g=hs(g,u,1),u=fn(),g!==null&&(ku(g,1,u),jn(g,u));break}}g=g.return}}function Z7(u,g,j){var F=u.pingCache;F!==null&&F.delete(g),g=fn(),u.pingedLanes|=u.suspendedLanes&j,Dr===u&&(Gr&j)===j&&(Fr===4||Fr===3&&(Gr&130023424)===Gr&&500>yr()-h0?mo(u,0):f0|=j),jn(u,g)}function v2(u,g){g===0&&((u.mode&1)===0?g=1:(g=xh,xh<<=1,(xh&130023424)===0&&(xh=4194304)));var j=fn();u=Ni(u,g),u!==null&&(ku(u,g,j),jn(u,j))}function J7(u){var g=u.memoizedState,j=0;g!==null&&(j=g.retryLane),v2(u,j)}function ez(u,g){var j=0;switch(u.tag){case 13:var F=u.stateNode,M=u.memoizedState;M!==null&&(j=M.retryLane);break;case 19:F=u.stateNode;break;default:throw Error(r(314))}F!==null&&F.delete(g),v2(u,j)}var x2;x2=function(u,g,j){if(u!==null)if(u.memoizedProps!==g.pendingProps||xn.current)wn=!0;else{if((u.lanes&j)===0&&(g.flags&128)===0)return wn=!1,B7(u,g,j);wn=(u.flags&131072)!==0}else wn=!1,or&&(g.flags&1048576)!==0&&ZC(g,Bh,g.index);switch(g.lanes=0,g.tag){case 2:var F=g.type;rm(u,g),u=g.pendingProps;var M=Cl(g,Jr.current);Al(g,j),M=Hv(null,g,F,u,M,j);var B=Vv();return g.flags|=1,typeof M=="object"&&M!==null&&typeof M.render=="function"&&M.$$typeof===void 0?(g.tag=1,g.memoizedState=null,g.updateQueue=null,bn(F)?(B=!0,Dh(g)):B=!1,g.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,Lv(g),M.updater=em,g.stateNode=M,M._reactInternals=g,Xv(g,F,u,j),g=t0(null,g,F,!0,B,j)):(g.tag=0,or&&B&&Cv(g),dn(null,g,M,j),g=g.child),g;case 16:F=g.elementType;e:{switch(rm(u,g),u=g.pendingProps,M=F._init,F=M(F._payload),g.type=F,M=g.tag=rz(F),u=wa(F,u),M){case 0:g=e0(null,g,F,u,j);break e;case 1:g=VF(null,g,F,u,j);break e;case 11:g=qF(null,g,F,u,j);break e;case 14:g=BF(null,g,F,wa(F.type,u),j);break e}throw Error(r(306,F,""))}return g;case 0:return F=g.type,M=g.pendingProps,M=g.elementType===F?M:wa(F,M),e0(u,g,F,M,j);case 1:return F=g.type,M=g.pendingProps,M=g.elementType===F?M:wa(F,M),VF(u,g,F,M,j);case 3:e:{if(WF(g),u===null)throw Error(r(387));F=g.pendingProps,B=g.memoizedState,M=B.element,oF(u,g),Kh(g,F,null,
vendor: 10,338 bytes, line 40
40j);var Y=g.memoizedState;if(F=Y.element,B.isDehydrated)if(B={element:F,isDehydrated:!1,cache:Y.cache,pendingSuspenseBoundaries:Y.pendingSuspenseBoundaries,transitions:Y.transitions},g.updateQueue.baseState=B,g.memoizedState=B,g.flags&256){M=Il(Error(r(423)),g),g=KF(u,g,F,j,M);break e}else if(F!==M){M=Il(Error(r(424)),g),g=KF(u,g,F,j,M);break e}else for(Ln=ls(g.stateNode.containerInfo.firstChild),Mn=g,or=!0,ba=null,j=iF(g,null,F,j),g.child=j;j;)j.flags=j.flags&-3|4096,j=j.sibling;else{if(El(),F===M){g=ki(u,g,j);break e}dn(u,g,F,j)}g=g.child}return g;case 5:return uF(g),u===null&&Ev(g),F=g.type,M=g.pendingProps,B=u!==null?u.memoizedProps:null,Y=M.children,wv(F,M)?Y=null:B!==null&&wv(F,B)&&(g.flags|=32),HF(u,g),dn(u,g,Y,j),g.child;case 6:return u===null&&Ev(g),null;case 13:return GF(u,g,j);case 4:return Dv(g,g.stateNode.containerInfo),F=g.pendingProps,u===null?g.child=Pl(g,null,F,j):dn(u,g,F,j),g.child;case 11:return F=g.type,M=g.pendingProps,M=g.elementType===F?M:wa(F,M),qF(u,g,F,M,j);case 7:return dn(u,g,g.pendingProps,j),g.child;case 8:return dn(u,g,g.pendingProps.children,j),g.child;case 12:return dn(u,g,g.pendingProps.children,j),g.child;case 10:e:{if(F=g.type._context,M=g.pendingProps,B=g.memoizedProps,Y=M.value,Zt(Hh,F._currentValue),F._currentValue=Y,B!==null)if(xa(B.value,Y)){if(B.children===M.children&&!xn.current){g=ki(u,g,j);break e}}else for(B=g.child,B!==null&&(B.return=g);B!==null;){var ae=B.dependencies;if(ae!==null){Y=B.child;for(var ce=ae.firstContext;ce!==null;){if(ce.context===F){if(B.tag===1){ce=Si(-1,j&-j),ce.tag=2;var ve=B.updateQueue;if(ve!==null){ve=ve.shared;var Ne=ve.pending;Ne===null?ce.next=ce:(ce.next=Ne.next,Ne.next=ce),ve.pending=ce}}B.lanes|=j,ce=B.alternate,ce!==null&&(ce.lanes|=j),Iv(B.return,j,g),ae.lanes|=j;break}ce=ce.next}}else if(B.tag===10)Y=B.type===g.type?null:B.child;else if(B.tag===18){if(Y=B.return,Y===null)throw Error(r(341));Y.lanes|=j,ae=Y.alternate,ae!==null&&(ae.lanes|=j),Iv(Y,j,g),Y=B.sibling}else Y=B.child;if(Y!==null)Y.return=B;else for(Y=B;Y!==null;){if(Y===g){Y=null;break}if(B=Y.sibling,B!==null){B.return=Y.return,Y=B;break}Y=Y.return}B=Y}dn(u,g,M.children,j),g=g.child}return g;case 9:return M=g.type,F=g.pendingProps.children,Al(g,j),M=na(M),F=F(M),g.flags|=1,dn(u,g,F,j),g.child;case 14:return F=g.type,M=wa(F,g.pendingProps),M=wa(F.type,M),BF(u,g,F,M,j);case 15:return zF(u,g,g.type,g.pendingProps,j);case 17:return F=g.type,M=g.pendingProps,M=g.elementType===F?M:wa(F,M),rm(u,g),g.tag=1,bn(F)?(u=!0,Dh(g)):u=!1,Al(g,j),AF(g,F,M),Xv(g,F,M,j),t0(null,g,F,!0,u,j);case 19:return QF(u,g,j);case 22:return UF(u,g,j)}throw Error(r(156,g.tag))};function b2(u,g){return Jk(u,g)}function tz(u,g,j,F){this.tag=u,this.key=j,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=g,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=F,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sa(u,g,j,F){return new tz(u,g,j,F)}function w0(u){return u=u.prototype,!(!u||!u.isReactComponent)}function rz(u){if(typeof u=="function")return w0(u)?1:0;if(u!=null){if(u=u.$$typeof,u===E)return 11;if(u===D)return 14}return 2}function xs(u,g){var j=u.alternate;return j===null?(j=sa(u.tag,g,u.key,u.mode),j.elementType=u.elementType,j.type=u.type,j.stateNode=u.stateNode,j.alternate=u,u.alternate=j):(j.pendingProps=g,j.type=u.type,j.flags=0,j.subtreeFlags=0,j.deletions=null),j.flags=u.flags&14680064,j.childLanes=u.childLanes,j.lanes=u.lanes,j.child=u.child,j.memoizedProps=u.memoizedProps,j.memoizedState=u.memoizedState,j.updateQueue=u.updateQueue,g=u.dependencies,j.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext},j.sibling=u.sibling,j.index=u.index,j.ref=u.ref,j}function hm(u,g,j,F,M,B){var Y=2;if(F=u,typeof u=="function")w0(u)&&(Y=1);else if(typeof u=="string")Y=5;else e:switch(u){case C:return go(j.children,M,B,g);case O:Y=8,M|=8;break;case R:return u=sa(12,j,g,M|2),u.elementType=R,u.lanes=B,u;case T:return u=sa(13,j,g,M),u.elementType=T,u.lanes=B,u;case $:return u=sa(19,j,g,M),u.elementType=$,u.lanes=B,u;case U:return mm(j,M,B,g);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case A:Y=10;break e;case P:Y=9;break e;case E:Y=11;break e;case D:Y=14;break e;case W:Y=16,F=null;break e}throw Error(r(130,u==null?u:typeof u,""))}return g=sa(Y,j,g,M),g.elementType=u,g.type=F,g.lanes=B,g}function go(u,g,j,F){return u=sa(7,u,F,g),u.lanes=j,u}function mm(u,g,j,F){return u=sa(22,u,F,g),u.elementType=U,u.lanes=j,u.stateNode={isHidden:!1},u}function _0(u,g,j){return u=sa(6,u,null,g),u.lanes=j,u}function j0(u,g,j){return g=sa(4,u.children!==null?u.children:[],u.key,g),g.lanes=j,g.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},g}function nz(u,g,j,F,M){this.tag=g,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qy(0),this.expirationTimes=Qy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qy(0),this.identifierPrefix=F,this.onRecoverableError=M,this.mutableSourceEagerHydrationData=null}function N0(u,g,j,F,M,B,Y,ae,ce){return u=new nz(u,g,j,ae,ce),g===1?(g=1,B===!0&&(g|=8)):g=0,B=sa(3,null,null,g),u.current=B,B.stateNode=u,B.memoizedState={element:F,isDehydrated:j,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lv(B),u}function az(u,g,j){var F=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:F==null?null:""+F,children:u,containerInfo:g,implementation:j}}function w2(u){if(!u)return us;u=u._reactInternals;e:{if(no(u)!==u||u.tag!==1)throw Error(r(170));var g=u;do{switch(g.tag){case 3:g=g.stateNode.context;break e;case 1:if(bn(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break e}}g=g.return}while(g!==null);throw Error(r(171))}if(u.tag===1){var j=u.type;if(bn(j))return YC(u,j,g)}return g}function _2(u,g,j,F,M,B,Y,ae,ce){return u=N0(j,F,!0,u,M,B,Y,ae,ce),u.context=w2(null),j=u.current,F=fn(),M=ys(j),B=Si(F,M),B.callback=g??null,hs(j,B,M),u.current.lanes=M,ku(u,M,F),jn(u,F),u}function pm(u,g,j,F){var M=g.current,B=fn(),Y=ys(M);return j=w2(j),g.context===null?g.context=j:g.pendingContext=j,g=Si(B,Y),g.payload={element:u},F=F===void 0?null:F,F!==null&&(g.callback=F),u=hs(M,g,Y),u!==null&&(Na(u,M,Y,B),Wh(u,M,Y)),Y}function gm(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return u.child.stateNode;default:return u.child.stateNode}}function j2(u,g){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var j=u.retryLane;u.retryLane=j!==0&&j<g?j:g}}function S0(u,g){j2(u,g),(u=u.alternate)&&j2(u,g)}function iz(){return null}var N2=typeof reportError=="function"?reportError:function(u){console.error(u)};function k0(u){this._internalRoot=u}ym.prototype.render=k0.prototype.render=function(u){var g=this._internalRoot;if(g===null)throw Error(r(409));pm(u,g,null,null)},ym.prototype.unmount=k0.prototype.unmount=function(){var u=this._internalRoot;if(u!==null){this._internalRoot=null;var g=u.containerInfo;ho(function(){pm(null,u,null,null)}),g[bi]=null}};function ym(u){this._internalRoot=u}ym.prototype.unstable_scheduleHydration=function(u){if(u){var g=oC();u={blockedOn:null,target:u,priority:g};for(var j=0;j<is.length&&g!==0&&g<is[j].priority;j++);is.splice(j,0,u),j===0&&uC(u)}};function C0(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function vm(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11&&(u.nodeType!==8||u.nodeValue!==" react-mount-point-unstable "))}function S2(){}function sz(u,g,j,F,M){if(M){if(typeof F=="function"){var B=F;F=function(){var ve=gm(Y);B.call(ve)}}var Y=_2(g,F,u,0,null,!1,!1,"",S2);return u._reactRootContainer=Y,u[bi]=Y.current,qu(u.nodeType===8?u.parentNode:u),ho(),Y}for(;M=u.lastChild;)u.removeChild(M);if(typeof F=="function"){var ae=F;F=function(){var ve=gm(ce);ae.call(ve)}}var ce=N0(u,0,!1,null,null,!1,!1,"",S2);return u._reactRootContainer=ce,u[bi]=ce.current,qu(u.nodeType===8?u.parentNode:u),ho(function(){pm(g,ce,j,F)}),ce}function xm(u,g,j,F,M){var B=j._reactRootContainer;if(B){var Y=B;if(typeof M=="function"){var ae=M;M=function(){var ce=gm(Y);ae.call(ce)}}pm(g,Y,u,M)}else Y=sz(j,g,u,M,F);return gm(Y)}iC=function(u){switch(u.tag){case 3:var g=u.stateNode;if(g.current.memoizedState.isDehydrated){var j=Su(g.pendingLanes);j!==0&&(Xy(g,j|1),jn(g,yr()),(Ot&6)===0&&(Dl=yr()+500,ds()))}break;case 13:ho(function(){var F=Ni(u,1);if(F!==null){var M=fn();Na(F,u,1,M)}}),S0(u,1)}},Zy=function(u){if(u.tag===13){var g=Ni(u,134217728);if(g!==null){var j=fn();Na(g,u,134217728,j)}S0(u,134217728)}},sC=function(u){if(u.tag===13){var g=ys(u),j=Ni(u,g);if(j!==null){var F=fn();Na(j,u,g,F)}S0(u,g)}},oC=function(){return Bt},lC=function(u,g){var j=Bt;try{return Bt=u,g()}finally{Bt=j}},Hy=function(u,g,j){switch(g){case"input":if(tt(u,j),g=j.name,j.type==="radio"&&g!=null){for(j=u;j.parentNode;)j=j.parentNode;for(j=j.querySelectorAll("input[name="+JSON.stringify(""+g)+'][type="radio"]'),g=0;g<j.length;g++){var F=j[g];if(F!==u&&F.form===u.form){var M=Mh(F);if(!M)throw Error(r(90));fe(F),tt(F,M)}}}break;case"textarea":pt(u,j);break;case"select":g=j.value,g!=null&&Re(u,!!j.multiple,g,!1)}},Wk=v0,Kk=ho;var oz={usingClientEntryPoint:!1,Events:[Uu,Sl,Mh,Hk,Vk,v0]},nd={findFiberByHostInstance:ao,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lz={bundleType:nd.bundleType,version:nd.version,rendererPackageName:nd.rendererPackageName,rendererConfig:nd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(u){return u=Xk(u),u===null?null:u.stateNode},findFiberByHostInstance:nd.findFiberByHostInstance||iz,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bm.isDisabled&&bm.supportsFiber)try{yh=bm.inject(lz),Ha=bm}catch{}}return Nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oz,Nn.createPortal=function(u,g){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!C0(g))throw Error(r(200));return az(u,g,null,j)},Nn.createRoot=function(u,g){if(!C0(u))throw Error(r(299));var j=!1,F="",M=N2;return g!=null&&(g.unstable_strictMode===!0&&(j=!0),g.identifierPrefix!==void 0&&(F=g.identifierPrefix),g.onRecoverableError!==void 0&&(M=g.onRecoverableError)),g=N0(u,1,!1,null,null,j,!1,F,M),u[bi]=g.current,qu(u.nodeType===8?u.parentNode:u),new k0(g)},Nn.findDOMNode=function(u){if(u==null)return null;if(u.nodeType===1)return u;var g=u._reactInternals;if(g===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=Xk(g),u=u===null?null:u.stateNode,u},Nn.flushSync=function(u){return ho(u)},Nn.hydrate=function(u,g,j){if(!vm(g))throw Error(r(200));return xm(null,u,g,!0,j)},Nn.hydrateRoot=function(u,g,j){if(!C0(u))throw Error(r(405));var F=j!=null&&j.hydratedSources||null,M=!1,B="",Y=N2;if(j!=null&&(j.unstable_strictMode===!0&&(M=!0),j.identifierPrefix!==void 0&&(B=j.identifierPrefix),j.onRecoverableError!==void 0&&(Y=j.onRecoverableError)),g=_2(g,null,u,1,j??null,M,!1,B,Y),u[bi]=g.current,qu(u),F)for(u=0;u<F.length;u++)j=F[u],M=j._getVersion,M=M(j._source),g.mutableSourceEagerHydrationData==null?g.mutableSourceEagerHydrationData=[j,M]:g.mutableSourceEagerHydrationData.push(j,M);return new ym(g)},Nn.render=function(u,g,j){if(!vm(g))throw Error(r(200));return xm(null,u,g,!1,j)},Nn.unmountComponentAtNode=function(u){if(!vm(u))throw Error(r(40));return u._reactRootContainer?(ho(function(){xm(null,null,u,!1,function(){u._reactRootContainer=null,u[bi]=null})}),!0):!1},Nn.unstable_batchedUpdates=v0,Nn.unstable_renderSubtreeIntoContainer=function(u,g,j,F){if(!vm(j))throw Error(r(200));if(u==null||u._reactInternals===void 0)throw Error(r(38));return xm(u,g,j,!1,F)},Nn.version="18.3.1-next-f1338f8080-20240426",Nn}var R2;function VN(){if(R2)return P0.exports;R2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),P0.exports=gz(),P0.exports}var I2;function yz(){if(I2)return jm;I2=1;var e=VN();return jm.createRoot=e.createRoot,jm.hydrateRoot=e.hydrateRoot,jm}var vz=yz();const xz=Ft(vz),bz=20,wz=1e6,Mi={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let R0=0;function _z(){return R0=(R0+1)%Number.MAX_VALUE,R0.toString()}const I0=new Map,M2=e=>{if(I0.has(e))return;const t=setTimeout(()=>{I0.delete(e),Ad({type:Mi.REMOVE_TOAST,toastId:e})},wz);I0.set(e,t)},jz=(e,t)=>{switch(t.type){case Mi.ADD_TOAST:return{...e,toasts:[t.toast,...e.toasts].slice(0,bz)};case Mi.UPDATE_TOAST:return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case Mi.DISMISS_TOAST:{const{toastId:r}=t;return r?M2(r):e.toasts.forEach(n=>{M2(n.id)}),{...e,toasts:e.toasts.map(n=>
40n.id===r||r===void 0?{...n,open:!1}:n)}}case Mi.REMOVE_TOAST:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},ep=[];let tp={toasts:[]};function Ad(e){tp=jz(tp,e),ep.forEach(t=>{t(tp)})}function Nz({...e}){const t=_z(),r=i=>Ad({type:Mi.UPDATE_TOAST,toast:{...i,id:t}}),n=()=>Ad({type:Mi.DISMISS_TOAST,toastId:t});return Ad({type:Mi.ADD_TOAST,toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function Sz(){const[e,t]=I.useState(tp);return I.useEffect(()=>(ep.push(t),()=>{const r=ep.indexOf(t);r>-1&&ep.splice(r,1)}),[e]),{...e,toast:Nz,dismiss:r=>Ad({type:Mi.DISMISS_TOAST,toastId:r})}}function jL(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=jL(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function xt(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=jL(e))&&(n&&(n+=" "),n+=t);return n}const L2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,D2=xt,Dg=(e,t)=>
vendor: 4,185 bytes, lines 40-85
40r=>{var n;if((t==null?void 0:t.variants)==null)return D2(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(f=>{const h=r==null?void 0:r[f],d=s==null?void 0:s[f];if(h===null)return null;const m=L2(h)||L2(d);return i[f][m]}),l=r&&Object.entries(r).reduce((f,h)=>{let[d,m]=h;return m===void 0||(f[d]=m),f},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((f,h)=>{let{class:d,className:m,...p}=h;return Object.entries(p).every(x=>{let[y,v]=x;return Array.isArray(v)?v.includes({...s,...l}[y]):{...s,...l}[y]===v})?[...f,d,m]:f},[]);return D2(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
41 * @license lucide-react v0.475.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 kz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),NL=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
46 * @license lucide-react v0.475.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 Cz={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.475.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 Fz=I.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:o,...l},c)=>I.createElement("svg",{ref:c,...Cz,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:NL("lucide",i),...l},[...o.map(([f,h])=>I.createElement(f,h)),...Array.isArray(s)?s:[s]]));/**
56 * @license lucide-react v0.475.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 Je=(e,t)=>{const r=I.forwardRef(({className:n,...i},s)=>I.createElement(Fz,{ref:s,iconNode:t,className:NL(`lucide-${kz(e)}`,n),...i}));return r.displayName=`${e}`,r};/**
61 * @license lucide-react v0.475.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 Oz=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],zf=Je("ArrowLeft",Oz);/**
66 * @license lucide-react v0.475.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 Ez=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],vp=Je("Bell",Ez);/**
71 * @license lucide-react v0.475.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 Pz=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],$2=Je("Briefcase",Pz);/**
76 * @license lucide-react v0.475.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 Tz=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],Az=Je("Building2",Tz);/**
81 * @license lucide-react v0.475.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 Rz=[["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"}]],Vs=Je("Calendar",Rz);
85/**
86 * @license lucide-react v0.475.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 Iz=[["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"}]],Mz=Je("Camera",Iz);/**
91 * @license lucide-react v0.475.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 Lz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xp=Je("Check",Lz);/**
96 * @license lucide-react v0.475.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 Dz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],bp=Je("ChevronDown",Dz);/**
101 * @license lucide-react v0.475.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 $z=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],qz=Je("ChevronLeft",$z);/**
106 * @license lucide-react v0.475.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 Bz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],zz=Je("ChevronRight",Bz);/**
111 * @license lucide-react v0.475.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 Uz=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Hz=Je("ChevronUp",Uz);/**
116 * @license lucide-react v0.475.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 Vz=[["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"}]],oi=Je("CircleAlert",Vz);/**
121 * @license lucide-react v0.475.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 Wz=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],xr=Je("CircleCheckBig",Wz);/**
126 * @license lucide-react v0.475.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 Kz=[["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"}]],$s=Je("CircleX",Kz);/**
131 * @license lucide-react v0.475.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 Gz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Ra=Je("Clock",Gz);/**
136 * @license lucide-react v0.475.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 Yz=[["path",{d:"M16 2v2",key:"scm5qe"}],["path",{d:"M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2",key:"1waht3"}],["path",{d:"M8 2v2",key:"pbkmx"}],["circle",{cx:"12",cy:"11",r:"3",key:"itu57m"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]],SL=Je("Contact",Yz);/**
141 * @license lucide-react v0.475.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 Qz=[["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"}]],ut=Je("DollarSign",Qz);/**
146 * @license lucide-react v0.475.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 Xz=[["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"}]],li=Je("Download",Xz);/**
151 * @license lucide-react v0.475.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 Zz=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],il=Je("ExternalLink",Zz);/**
156 * @license lucide-react v0.475.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 Jz=[["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"}]],cr=Je("Eye",Jz);/**
161 * @license lucide-react v0.475.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 eU=[["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"}]],kL=Je("FileCheck",eU);/**
166 * @license lucide-react v0.475.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 tU=[["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"}]],Et=Je("FileText",tU);/**
171 * @license lucide-react v0.475.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 rU=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],jj=Je("Filter",rU);/**
176 * @license lucide-react v0.475.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 nU=[["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"}]],rp=Je("GraduationCap",nU);/**
181 * @license lucide-react v0.475.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 aU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],M0=Je("Image",aU);/**
186 * @license lucide-react v0.475.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 iU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],sU=Je("Info",iU);/**
191 * @license lucide-react v0.475.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 oU=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Nm=Je("LayoutDashboard",oU);/**
196 * @license lucide-react v0.475.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 lU=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ht=Je("LoaderCircle",lU);/**
201 * @license lucide-react v0.475.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 cU=[["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"}]],uU=Je("LogOut",cU);/**
206 * @license lucide-react v0.475.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 dU=[["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"}]],sc=Je("Mail",dU);/**
211 * @license lucide-react v0.475.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 fU=[["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"}]],Uo=Je("MapPin",fU);/**
216 * @license lucide-react v0.475.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 hU=[["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"}]],q2=Je("Menu",hU);/**
221 * @license lucide-react v0.475.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 mU=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],B2=Je("MessageCircle",mU);/**
226 * @license lucide-react v0.475.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 pU=[["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"}]],gU=Je("MessageSquare",pU);/**
231 * @license lucide-react v0.475.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 yU=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],vU=Je("Minimize2",yU);/**
236 * @license lucide-react v0.475.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 xU=[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]],CL=Je("MonitorPlay",xU);/**
241 * @license lucide-react v0.475.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 bU=[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]],wU=Je("PenTool",bU);/**
246 * @license lucide-react v0.475.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 _U=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ct=Je("Plus",_U);/**
251 * @license lucide-react v0.475.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 jU=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],$g=Je("Printer",jU);/**
256 * @license lucide-react v0.475.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 NU=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],SU=Je("RefreshCcw",NU);/**
261 * @license lucide-react v0.475.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 kU=[["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"}]],Vd=Je("Save",kU);/**
266 * @license lucide-react v0.475.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 CU=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],hr=Je("Search",CU);/**
271 * @license lucide-react v0.475.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 FU=[["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"}]],Wi=Je("Send",FU);/**
276 * @license lucide-react v0.475.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 OU=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],FL=Je("Settings",OU);/**
281 * @license lucide-react v0.475.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 EU=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}
285]],PU=Je("Share2",EU);/**
286 * @license lucide-react v0.475.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 TU=[["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"}]],AU=Je("ShieldAlert",TU);/**
291 * @license lucide-react v0.475.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 RU=[["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"}]],OL=Je("Shield",RU);/**
296 * @license lucide-react v0.475.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 IU=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],MU=Je("ShoppingCart",IU);/**
301 * @license lucide-react v0.475.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 LU=[["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"}]],qt=Je("SquarePen",LU);/**
306 * @license lucide-react v0.475.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 DU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],z2=Je("Target",DU);/**
311 * @license lucide-react v0.475.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 $U=[["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"}]],Qt=Je("Trash2",$U);/**
316 * @license lucide-react v0.475.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 qU=[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]],EL=Je("TrendingDown",qU);/**
321 * @license lucide-react v0.475.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 BU=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],sl=Je("TrendingUp",BU);/**
326 * @license lucide-react v0.475.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 zU=[["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"}]],WN=Je("TriangleAlert",zU);/**
331 * @license lucide-react v0.475.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 UU=[["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"}]],Hr=Je("Upload",UU);/**
336 * @license lucide-react v0.475.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 HU=[["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"}]],Uf=Je("User",HU);/**
341 * @license lucide-react v0.475.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 VU=[["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"}]],Xr=Je("Users",VU);/**
346 * @license lucide-react v0.475.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 WU=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],wp=Je("Video",WU);/**
351 * @license lucide-react v0.475.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 KU=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Rd=Je("Wallet",KU);/**
356 * @license lucide-react v0.475.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 GU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 6,036 bytes, lines 360-375
360],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vt=Je("X",GU);/**
361 * @license lucide-react v0.475.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 YU=[["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"}]],QU=Je("Zap",YU);/**
366 * @license lucide-react v0.475.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 XU=[["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"}]],ZU=Je("ZoomIn",XU);/**
371 * @license lucide-react v0.475.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 JU=[["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"}]],e9=Je("ZoomOut",JU),KN="-",t9=e=>{const t=n9(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(KN);return l[0]===""&&l.length!==1&&l.shift(),PL(l,t)||r9(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},PL=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?PL(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(KN);return(o=t.validators.find(({validator:l})=>l(s)))==null?void 0:o.classGroupId},U2=/^\[(.+)\]$/,r9=e=>{if(U2.test(e)){const t=U2.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},n9=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const i in r)Nj(r[i],n,i,t);return n},Nj=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:H2(t,i);s.classGroupId=r;return}if(typeof i=="function"){if(a9(i)){Nj(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,o])=>{Nj(o,H2(t,s),r,n)})})},H2=(e,t)=>{let r=e;return t.split(KN).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},a9=e=>e.isThemeGetter,i9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(s,o)=>{r.set(s,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let o=r.get(s);if(o!==void 0)return o;if((o=n.get(s))!==void 0)return i(s,o),o},set(s,o){r.has(s)?r.set(s,o):i(s,o)}}},Sj="!",kj=":",s9=kj.length,o9=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const s=[];let o=0,l=0,c=0,f;for(let x=0;x<i.length;x++){let y=i[x];if(o===0&&l===0){if(y===kj){s.push(i.slice(c,x)),c=x+s9;continue}if(y==="/"){f=x;continue}}y==="["?o++:y==="]"?o--:y==="("?l++:y===")"&&l--}const h=s.length===0?i:i.substring(c),d=l9(h),m=d!==h,p=f&&f>c?f-c:void 0;return{modifiers:s,hasImportantModifier:m,baseClassName:d,maybePostfixModifierPosition:p}};if(t){const i=t+kj,s=n;n=o=>o.startsWith(i)?s(o.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(r){const i=n;n=s=>r({className:s,parseClassName:i})}return n},l9=e=>e.endsWith(Sj)?e.substring(0,e.length-1):e.startsWith(Sj)?e.substring(1):e,c9=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const i=[];let s=[];return n.forEach(o=>{o[0]==="["||t[o]?(i.push(...s.sort(),o),s=[]):s.push(o)}),i.push(...s.sort()),i}},u9=e=>({cache:i9(e.cacheSize),parseClassName:o9(e),sortModifiers:c9(e),...t9(e)}),d9=/\s+/,f9=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s}=t,o=[],l=e.trim().split(d9);let c="";for(let f=l.length-1;f>=0;f-=1){const h=l[f],{isExternal:d,modifiers:m,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:y}=r(h);if(d){c=h+(c.length>0?" "+c:c);continue}let v=!!y,b=n(v?x.substring(0,y):x);if(!b){if(!v){c=h+(c.length>0?" "+c:c);continue}if(b=n(x),!b){c=h+(c.length>0?" "+c:c);continue}v=!1}const w=s(m).join(":"),_=p?w+Sj:w,N=_+b;if(o.includes(N))continue;o.push(N);const S=i(b,v);for(let k=0;k<S.length;++k){const C=S[k];o.push(_+C)}c=h+(c.length>0?" "+c:c)}return c};function h9(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=TL(t))&&(n&&(n+=" "),n+=r);return n}const TL=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=TL(e[n]))&&(r&&(r+=" "),r+=t);return r};function m9(e,...t){let r,n,i,s=o;function o(c){const f=t.reduce((h,d)=>d(h),e());return r=u9(f),n=r.cache.get,i=r.cache.set,s=l,l(c)}function l(c){const f=n(c);if(f)return f;const h=f9(c,r);return i(c,h),h}return function(){return s(h9.apply(null,arguments))}}const Or=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},AL=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,RL=/^\((?:(\w[\w-]*):)?(.+)\)$/i,p9=/^\d+\/\d+$/,g9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,y9=/\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$/,v9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,x9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,b9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ql=e=>p9.test(e),Nt=e=>!!e&&!Number.isNaN(Number(e)),ws=e=>!!e&&Number.isInteger(Number(e)),L0=e=>e.endsWith("%")&&Nt(e.slice(0,-1)),Fi=e=>g9.test(e),w9=()=>!0,_9=e=>y9.test(e)&&!v9.test(e),IL=()=>!1,j9=e=>x9.test(e),N9=e=>b9.test(e),S9=e=>!Xe(e)&&!Ze(e),k9=e=>ru(e,DL,IL),Xe=e=>AL.test(e),yo=e=>ru(e,$L,_9),D0=e=>ru(e,P9,Nt),V2=e=>ru(e,ML,IL),C9=e=>ru(e,LL,N9),Sm=e=>ru(e,qL,j9),Ze=e=>RL.test(e),id=e=>nu(e,$L),F9=e=>nu(e,T9),W2=e=>nu(e,ML),O9=e=>nu(e,DL),E9=e=>nu(e,LL),km=e=>nu(e,qL,!0),ru=(e,t,r)=>{const n=AL.exec(e);
vendor: 4,468 bytes, line 375
375return n?n[1]?t(n[1]):r(n[2]):!1},nu=(e,t,r=!1)=>{const n=RL.exec(e);return n?n[1]?t(n[1]):r:!1},ML=e=>e==="position"||e==="percentage",LL=e=>e==="image"||e==="url",DL=e=>e==="length"||e==="size"||e==="bg-size",$L=e=>e==="length",P9=e=>e==="number",T9=e=>e==="family-name",qL=e=>e==="shadow",A9=()=>{const e=Or("color"),t=Or("font"),r=Or("text"),n=Or("font-weight"),i=Or("tracking"),s=Or("leading"),o=Or("breakpoint"),l=Or("container"),c=Or("spacing"),f=Or("radius"),h=Or("shadow"),d=Or("inset-shadow"),m=Or("text-shadow"),p=Or("drop-shadow"),x=Or("blur"),y=Or("perspective"),v=Or("aspect"),b=Or("ease"),w=Or("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...N(),Ze,Xe],k=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],O=()=>[Ze,Xe,c],R=()=>[ql,"full","auto",...O()],A=()=>[ws,"none","subgrid",Ze,Xe],P=()=>["auto",{span:["full",ws,Ze,Xe]},ws,Ze,Xe],E=()=>[ws,"auto",Ze,Xe],T=()=>["auto","min","max","fr",Ze,Xe],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],W=()=>["auto",...O()],U=()=>[ql,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],H=()=>[e,Ze,Xe],K=()=>[...N(),W2,V2,{position:[Ze,Xe]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",O9,k9,{size:[Ze,Xe]}],V=()=>[L0,id,yo],z=()=>["","none","full",f,Ze,Xe],Z=()=>["",Nt,id,yo],re=()=>["solid","dashed","dotted","double"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[Nt,L0,W2,V2],ie=()=>["","none",x,Ze,Xe],J=()=>["none",Nt,Ze,Xe],ue=()=>["none",Nt,Ze,Xe],ge=()=>[Nt,Ze,Xe],fe=()=>[ql,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fi],breakpoint:[Fi],color:[w9],container:[Fi],"drop-shadow":[Fi],ease:["in","out","in-out"],font:[S9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fi],shadow:[Fi],spacing:["px",Nt],text:[Fi],"text-shadow":[Fi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ql,Xe,Ze,v]}],container:["container"],columns:[{columns:[Nt,Xe,Ze,l]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[ws,"auto",Ze,Xe]}],basis:[{basis:[ql,"full","auto",l,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Nt,ql,"auto","initial","none",Xe]}],grow:[{grow:["",Nt,Ze,Xe]}],shrink:[{shrink:["",Nt,Ze,Xe]}],order:[{order:[ws,"first","last","none",Ze,Xe]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":E()}
vendor: 10,743 bytes, line 375
375],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:W()}],mx:[{mx:W()}],my:[{my:W()}],ms:[{ms:W()}],me:[{me:W()}],mt:[{mt:W()}],mr:[{mr:W()}],mb:[{mb:W()}],ml:[{ml:W()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[l,"screen",...U()]}],"min-w":[{"min-w":[l,"screen","none",...U()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",r,id,yo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Ze,D0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",L0,Xe]}],"font-family":[{font:[F9,Xe,t]}],"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:[i,Ze,Xe]}],"line-clamp":[{"line-clamp":[Nt,"none",Ze,D0]}],leading:[{leading:[s,...O()]}],"list-image":[{"list-image":["none",Ze,Xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Nt,"from-font","auto",Ze,yo]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Nt,"auto",Ze,Xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze,Xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze,Xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ws,Ze,Xe],radial:["",Ze,Xe],conic:[ws,Ze,Xe]},E9,C9]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Nt,Ze,Xe]}],"outline-w":[{outline:["",Nt,id,yo]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,km,Sm]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",d,km,Sm]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Nt,yo]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",m,km,Sm]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Nt,Ze,Xe]}],"mix-blend":[{"mix-blend":[...G(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":G()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Nt]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Ze,Xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[Nt]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Xe]}],filter:[{filter:["","none",Ze,Xe]}],blur:[{blur:ie()}],brightness:[{brightness:[Nt,Ze,Xe]}],contrast:[{contrast:[Nt,Ze,Xe]}],"drop-shadow":[{"drop-shadow":["","none",p,km,Sm]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Nt,Ze,Xe]}],"hue-rotate":[{"hue-rotate":[Nt,Ze,Xe]}],invert:[{invert:["",Nt,Ze,Xe]}],saturate:[{saturate:[Nt,Ze,Xe]}],sepia:[{sepia:["",Nt,Ze,Xe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Xe]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Nt,Ze,Xe]}],"backdrop-contrast":[{"backdrop-contrast":[Nt,Ze,Xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Nt,Ze,Xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Nt,Ze,Xe]}],"backdrop-invert":[{"backdrop-invert":["",Nt,Ze,Xe]}],"backdrop-opacity":[{"backdrop-opacity":[Nt,Ze,Xe]}],"backdrop-saturate":[{"backdrop-saturate":[Nt,Ze,Xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Nt,Ze,Xe]}],"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:["","all","colors","opacity","shadow","transform","none",Ze,Xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Nt,"initial",Ze,Xe]}],ease:[{ease:["linear","initial",b,Ze,Xe]}],delay:[{delay:[Nt,Ze,Xe]}],animate:[{animate:["none",w,Ze,Xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Ze,Xe]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:J()}],"rotate-x":[{"rotate-x":J()}],"rotate-y":[{"rotate-y":J()}],"rotate-z":[{"rotate-z":J()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Ze,Xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}
vendor: 6,073 bytes, line 375
375],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze,Xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",Ze,Xe]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Nt,id,yo,D0]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},BL=m9(A9);function Vt(...e){return BL(xt(e))}const zL=I.forwardRef(({...e},t)=>a.jsx("div",{ref:t,className:"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}));zL.displayName="ToastProvider";const UL=I.forwardRef(({...e},t)=>a.jsx("div",{ref:t,className:"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}));UL.displayName="ToastViewport";const R9=Dg("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"}}),HL=I.forwardRef(({className:e,variant:t,...r},n)=>
375a.jsx("div",{ref:n,className:Vt(R9({variant:t}),e),...r}));HL.displayName="Toast";const I9=I.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Vt("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));I9.displayName="ToastAction";const VL=I.forwardRef(({className:e,...t},r)=>a.jsx("button",{ref:r,className:Vt("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:a.jsx(vt,{className:"h-4 w-4"})}));VL.displayName="ToastClose";const WL=I.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Vt("text-sm font-semibold",e),...t}));WL.displayName="ToastTitle";const KL=I.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:Vt("text-sm opacity-90",e),...t}));KL.displayName="ToastDescription";function M9(){const{toasts:e}=Sz();return a.jsxs(zL,{children:[e.map(function({id:t,title:r,description:n,action:i,...s}){return a.jsxs(HL,{...s,children:[a.jsxs("div",{className:"grid gap-1",children:[r&&a.jsx(WL,{children:r}),n&&a.jsx(KL,{children:n})]}),i,a.jsx(VL,{})]},t)}),a.jsx(UL,{})]})}var au=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(){}},L9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Fs,UN,fL,D9=(fL=class{constructor(){nt(this,Fs,L9);nt(this,UN,!1)}setTimeoutProvider(e){Ue(this,Fs,e)}setTimeout(e,t){return le(this,Fs).setTimeout(e,t)}clearTimeout(e){le(this,Fs).clearTimeout(e)}setInterval(e,t){return le(this,Fs).setInterval(e,t)}clearInterval(e){le(this,Fs).clearInterval(e)}},Fs=new WeakMap,UN=new WeakMap,fL),So=new D9;function $9(e){setTimeout(e,0)}var Ho=typeof window>"u"||"Deno"in globalThis;function pn(){}function q9(e,t){return typeof e=="function"?e(t):e}function Cj(e){return typeof e=="number"&&e>=0&&e!==1/0}function GL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qs(e,t){return typeof e=="function"?e(t):e}function da(e,t){return typeof e=="function"?e(t):e}function K2(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==GN(o,t.options))return!1}else if(!Wd(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||s&&!s(t))}function G2(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(Vo(t.options.mutationKey)!==Vo(s))return!1}else if(!Wd(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function GN(e,t){return((t==null?void 0:t.queryKeyHashFn)||Vo)(e)}function Vo(e){return JSON.stringify(e,(t,r)=>Fj(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Wd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Wd(e[r],t[r])):!1}var B9=Object.prototype.hasOwnProperty;function YL(e,t){if(e===t)return e;const r=Y2(e)&&Y2(t);if(!r&&!(Fj(e)&&Fj(t)))return t;const i=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),o=s.length,l=r?new Array(o):{};let c=0;for(let f=0;f<o;f++){const h=r?f:s[f],d=e[h],m=t[h];if(d===m){l[h]=d,(r?f<i:B9.call(e,h))&&c++;continue}if(d===null||m===null||typeof d!="object"||typeof m!="object"){l[h]=m;continue}const p=YL(d,m);l[h]=p,p===d&&c++}return i===o&&c===i?e:l}function _p(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function Y2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fj(e){if(!Q2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;
vendor: 6,490 bytes, line 375
375return!(!Q2(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Q2(e){return Object.prototype.toString.call(e)==="[object Object]"}function z9(e){return new Promise(t=>{So.setTimeout(t,e)})}function Oj(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?YL(e,t):t}function U9(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function H9(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var YN=Symbol();function QL(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===YN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function XL(e,t){return typeof e=="function"?e(...t):!!e}var Po,Os,pc,hL,V9=(hL=class extends au{constructor(){super();nt(this,Po);nt(this,Os);nt(this,pc);Ue(this,pc,t=>{if(!Ho&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){le(this,Os)||this.setEventListener(le(this,pc))}onUnsubscribe(){var t;this.hasListeners()||((t=le(this,Os))==null||t.call(this),Ue(this,Os,void 0))}setEventListener(t){var r;Ue(this,pc,t),(r=le(this,Os))==null||r.call(this),Ue(this,Os,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){le(this,Po)!==t&&(Ue(this,Po,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof le(this,Po)=="boolean"?le(this,Po):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Po=new WeakMap,Os=new WeakMap,pc=new WeakMap,hL),QN=new V9;function Ej(){let e,t;const r=new Promise((i,s)=>{e=i,t=s});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var W9=$9;function K9(){let e=[],t=0,r=l=>{l()},n=l=>{l()},i=W9;const s=l=>{t?e.push(l):i(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{s(()=>{l(...c)})},schedule:s,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{i=l}}}var Tr=K9(),gc,Es,yc,mL,G9=(mL=class extends au{constructor(){super();nt(this,gc,!0);nt(this,Es);nt(this,yc);Ue(this,yc,t=>{if(!Ho&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){le(this,Es)||this.setEventListener(le(this,yc))}onUnsubscribe(){var t;this.hasListeners()||((t=le(this,Es))==null||t.call(this),Ue(this,Es,void 0))}setEventListener(t){var r;Ue(this,yc,t),(r=le(this,Es))==null||r.call(this),Ue(this,Es,t(this.setOnline.bind(this)))}setOnline(t){le(this,gc)!==t&&(Ue(this,gc,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return le(this,gc)}},gc=new WeakMap,Es=new WeakMap,yc=new WeakMap,mL),jp=new G9;function Y9(e){return Math.min(1e3*2**e,3e4)}function ZL(e){return(e??"online")==="online"?jp.isOnline():!0}var Pj=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function JL(e){let t=!1,r=0,n;const i=Ej(),s=()=>i.status!=="pending",o=y=>{var v;if(!s()){const b=new Pj(y);m(b),(v=e.onCancel)==null||v.call(e,b)}},l=()=>{t=!0},c=()=>{t=!1},f=()=>QN.isFocused()&&(e.networkMode==="always"||jp.isOnline())&&e.canRun(),h=()=>ZL(e.networkMode)&&e.canRun(),d=y=>{s()||(n==null||n(),i.resolve(y))},m=y=>{s()||(n==null||n(),i.reject(y))},p=()=>new Promise(y=>{var v;n=b=>{(s()||f())&&y(b)},(v=e.onPause)==null||v.call(e)}).then(()=>{var y;n=void 0,s()||(y=e.onContinue)==null||y.call(e)}),x=()=>{if(s())return;let y;const v=r===0?e.initialPromise:void 0;try{y=v??e.fn()}catch(b){y=Promise.reject(b)}Promise.resolve(y).then(d).catch(b=>{var k;if(s())return;const w=e.retry??(Ho?0:3),_=e.retryDelay??Y9,N=typeof _=="function"?_(r,b):_,S=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,b);if(t||!S){m(b);return}r++,(k=e.onFail)==null||k.call(e,r,b),z9(N).then(()=>f()?void 0:p()).then(()=>{t?m(b):x()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n==null||n(),i),cancelRetry:l,continueRetry:c,canStart:h,start:()=>(h()?x():p().then(x),i)}}var To,pL,eD=(pL=class{constructor(){nt(this,To)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cj(this.gcTime)&&Ue(this,To,So.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ho?1/0:300*1e3))}clearGcTimeout(){le(this,To)&&(So.clearTimeout(le(this,To)),Ue(this,To,void 0))}},To=new WeakMap,pL),Ao,vc,ua,Ro,qr,Lf,Io,Fa,Ei,gL,Q9=(gL=class extends eD{constructor(t){super();nt(this,Fa);nt(this,Ao);nt(this,vc);nt(this,ua);nt(this,Ro);nt(this,qr);nt(this,Lf);nt(this,Io);Ue(this,Io,!1),Ue(this,Lf,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ue(this,Ro,t.client),Ue(this,ua,le(this,Ro).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ue(this,Ao,X2(this.options)),this.state=t.state??le(this,Ao),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=le(this,qr))==null?void 0:t.promise}setOptions(t){if(this.options={...le(this,Lf),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=X2(this.options);r.data!==void 0&&(this.setData(r.data,{updatedAt:r.dataUpdatedAt,manual:!0}),Ue(this,Ao,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&le(this,ua).remove(this)}setData(t,r){const n=Oj(this.state.data,t,this.options);return _t(this,Fa,Ei).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){_t(this,Fa,Ei).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=le(this,qr))==null?void 0:n.promise;return(i=le(this,qr))==null||i.cancel(t),r?r.then(pn).catch(pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(le(this,Ao))}isActive(){return this.observers.some(t=>da(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===YN||this.state.dataUpdateCount+this.state.errorUpdate
375Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>qs(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:!GL(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=le(this,qr))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=le(this,qr))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),le(this,ua).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(le(this,qr)&&(le(this,Io)?le(this,qr).cancel({revert:!0}):le(this,qr).cancelRetry()),this.scheduleGc()),le(this,ua).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_t(this,Fa,Ei).call(this,{type:"invalidate"})}async fetch(t,r){var c,f,h,d,m,p,x,y,v,b,w,_;if(this.state.fetchStatus!=="idle"&&((c=le(this,qr))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(le(this,qr))return le(this,qr).continueRetry(),le(this,qr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const N=this.observers.find(S=>S.options.queryFn);N&&this.setOptions(N.options)}const n=new AbortController,i=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(Ue(this,Io,!0),n.signal)})},s=()=>{const N=QL(this.options,r),k=(()=>{const C={client:le(this,Ro),queryKey:this.queryKey,meta:this.meta};return i(C),C})();return Ue(this,Io,!1),this.options.persister?this.options.persister(N,k,this):N(k)},l=(()=>{const N={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:le(this,Ro),state:this.state,fetchFn:s};return i(N),N})();(f=this.options.behavior)==null||f.onFetch(l,this),Ue(this,vc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&_t(this,Fa,Ei).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),Ue(this,qr,JL({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:N=>{N instanceof Pj&&N.revert&&this.setState({...le(this,vc),fetchStatus:"idle"}),n.abort()},onFail:(N,S)=>{_t(this,Fa,Ei).call(this,{type:"failed",failureCount:N,error:S})},onPause:()=>{_t(this,Fa,Ei).call(this,{type:"pause"})},onContinue:()=>{_t(this,Fa,Ei).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const N=await le(this,qr).start();if(N===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(N),(p=(m=le(this,ua).config).onSuccess)==null||p.call(m,N,this),(y=(x=le(this,ua).config).onSettled)==null||y.call(x,N,this.state.error,this),N}catch(N){if(N instanceof Pj){if(N.silent)return le(this,qr).promise;if(N.revert){if(this.state.data===void 0)throw N;return this.state.data}}throw _t(this,Fa,Ei).call(this,{type:"error",error:N}),(b=(v=le(this,ua).config).onError)==null||b.call(v,N,this),(_=(w=le(this,ua).config).onSettled)==null||_.call(w,this.state.data,N,this),N}finally{this.scheduleGc()}}},Ao=new WeakMap,vc=new WeakMap,ua=new WeakMap,Ro=new WeakMap,qr=new WeakMap,Lf=new WeakMap,Io=new WeakMap,Fa=new WeakSet,Ei=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...tD(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ue(this,vc,t.manual?i:void 0),i;case"error":const s=t.error;
vendor: 14,316 bytes, line 375
375return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Tr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),le(this,ua).notify({query:this,type:"updated",action:t})})},gL);function tD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function X2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var kn,kt,Df,hn,Mo,xc,Ti,Ps,$f,bc,wc,Lo,Do,Ts,_c,$t,kd,Tj,Aj,Rj,Ij,Mj,Lj,Dj,rD,yL,X9=(yL=class extends au{constructor(t,r){super();nt(this,$t);nt(this,kn);nt(this,kt);nt(this,Df);nt(this,hn);nt(this,Mo);nt(this,xc);nt(this,Ti);nt(this,Ps);nt(this,$f);nt(this,bc);nt(this,wc);nt(this,Lo);nt(this,Do);nt(this,Ts);nt(this,_c,new Set);this.options=r,Ue(this,kn,t),Ue(this,Ps,null),Ue(this,Ti,Ej()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(le(this,kt).addObserver(this),Z2(le(this,kt),this.options)?_t(this,$t,kd).call(this):this.updateResult(),_t(this,$t,Ij).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $j(le(this,kt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $j(le(this,kt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_t(this,$t,Mj).call(this),_t(this,$t,Lj).call(this),le(this,kt).removeObserver(this)}setOptions(t){const r=this.options,n=le(this,kt);if(this.options=le(this,kn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof da(this.options.enabled,le(this,kt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");_t(this,$t,Dj).call(this),le(this,kt).setOptions(this.options),r._defaulted&&!_p(this.options,r)&&le(this,kn).getQueryCache().notify({type:"observerOptionsUpdated",query:le(this,kt),observer:this});const i=this.hasListeners();i&&J2(le(this,kt),n,this.options,r)&&_t(this,$t,kd).call(this),this.updateResult(),i&&(le(this,kt)!==n||da(this.options.enabled,le(this,kt))!==da(r.enabled,le(this,kt))||qs(this.options.staleTime,le(this,kt))!==qs(r.staleTime,le(this,kt)))&&_t(this,$t,Tj).call(this);const s=_t(this,$t,Aj).call(this);i&&(le(this,kt)!==n||da(this.options.enabled,le(this,kt))!==da(r.enabled,le(this,kt))||s!==le(this,Ts))&&_t(this,$t,Rj).call(this,s)}getOptimisticResult(t){const r=le(this,kn).getQueryCache().build(le(this,kn),t),n=this.createResult(r,t);return J9(this,n)&&(Ue(this,hn,n),Ue(this,xc,this.options),Ue(this,Mo,le(this,kt).state)),n}getCurrentResult(){return le(this,hn)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&!this.options.experimental_prefetchInRender&&le(this,Ti).status==="pending"&&le(this,Ti).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,i))})}trackProp(t){le(this,_c).add(t)}getCurrentQuery(){return le(this,kt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=le(this,kn).defaultQueryOptions(t),n=le(this,kn).getQueryCache().build(le(this,kn),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return _t(this,$t,kd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),le(this,hn)))}createResult(t,r){var R;const n=le(this,kt),i=this.options,s=le(this,hn),o=le(this,Mo),l=le(this,xc),f=t!==n?t.state:le(this,Df),{state:h}=t;let d={...h},m=!1,p;if(r._optimisticResults){const A=this.hasListeners(),P=!A&&Z2(t,r),E=A&&J2(t,n,r,i);(P||E)&&(d={...d,...tD(h.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:x,errorUpdatedAt:y,status:v}=d;p=d.data;let b=!1;if(r.placeholderData!==void 0&&p===void 0&&v==="pending"){let A;s!=null&&s.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(A=s.data,b=!0):A=typeof r.placeholderData=="function"?r.placeholderData((R=le(this,wc))==null?void 0:R.state.data,le(this,wc)):r.placeholderData,A!==void 0&&(v="success",p=Oj(s==null?void 0:s.data,A,r),m=!0)}if(r.select&&p!==void 0&&!b)if(s&&p===(o==null?void 0:o.data)&&r.select===le(this,$f))p=le(this,bc);else try{Ue(this,$f,r.select),p=r.select(p),p=Oj(s==null?void 0:s.data,p,r),Ue(this,bc,p),Ue(this,Ps,null)}catch(A){Ue(this,Ps,A)}le(this,Ps)&&(x=le(this,Ps),p=le(this,bc),y=Date.now(),v="error");const w=d.fetchStatus==="fetching",_=v==="pending",N=v==="error",S=_&&w,k=p!==void 0,O={status:v,fetchStatus:d.fetchStatus,isPending:_,isSuccess:v==="success",isError:N,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:d.dataUpdatedAt,error:x,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>f.dataUpdateCount||d.errorUpdateCount>f.errorUpdateCount,isFetching:w,isRefetching:w&&!_,isLoadingError:N&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:N&&k,isStale:XN(t,r),refetch:this.refetch,promise:le(this,Ti),isEnabled:da(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const A=T=>{O.status==="error"?T.reject(O.error):O.data!==void 0&&T.resolve(O.data)},P=()=>{const T=Ue(this,Ti,O.promise=Ej());A(T)},E=le(this,Ti);switch(E.status){case"pending":t.queryHash===n.queryHash&&A(E);break;case"fulfilled":(O.status==="error"||O.data!==E.value)&&P();break;case"rejected":(O.status!=="error"||O.error!==E.reason)&&P();break}}return O}updateResult(){const t=le(this,hn),r=this.createResult(le(this,kt),this.options);if(Ue(this,Mo,le(this,kt).state),Ue(this,xc,this.options),le(this,Mo).data!==void 0&&Ue(this,wc,le(this,kt)),_p(r,t))return;Ue(this,hn,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!le(this,_c).size)return!0;const o=new Set(s??le(this,_c));return this.options.throwOnError&&o.add("error"),Object.keys(le(this,hn)).some(l=>{const c=l;return le(this,hn)[c]!==t[c]&&o.has(c)})};_t(this,$t,rD).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_t(this,$t,Ij).call(this)}},kn=new WeakMap,kt=new WeakMap,Df=new WeakMap,hn=new WeakMap,Mo=new WeakMap,xc=new WeakMap,Ti=new WeakMap,Ps=new WeakMap,$f=new WeakMap,bc=new WeakMap,wc=new WeakMap,Lo=new WeakMap,Do=new WeakMap,Ts=new WeakMap,_c=new WeakMap,$t=new WeakSet,kd=function(t){_t(this,$t,Dj).call(this);let r=le(this,kt).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(pn)),r},Tj=function(){_t(this,$t,Mj).call(this);const t=qs(this.options.staleTime,le(this,kt));if(Ho||le(this,hn).isStale||!Cj(t))return;const n=GL(le(this,hn).dataUpdatedAt,t)+1;Ue(this,Lo,So.setTimeout(()=>{le(this,hn).isStale||this.updateResult()},n))},Aj=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(le(this,kt)):this.options.refetchInterval)??!1},Rj=function(t){_t(this,$t,Lj).call(this),Ue(this,Ts,t),!(Ho||da(this.options.enabled,le(this,kt))===!1||!Cj(le(this,Ts))||le(this,Ts)===0)&&Ue(this,Do,So.setInterval(()=>{(this.options.refetchIntervalInBackground||QN.isFocused())&&_t(this,$t,kd).call(this)},le(this,Ts)))},Ij=function(){_t(this,$t,Tj).call(this),_t(this,$t,Rj).call(this,_t(this,$t,Aj).call(this))},Mj=function(){le(this,Lo)&&(So.clearTimeout(le(this,Lo)),Ue(this,Lo,void 0))},Lj=function(){le(this,Do)&&(So.clearInterval(le(this,Do)),Ue(this,Do,void 0))},Dj=function(){const t=le(this,kn).getQueryCache().build(le(this,kn),this.options);if(t===le(this,kt))return;const r=le(this,kt);Ue(this,kt,t),Ue(this,Df,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},rD=function(t){Tr.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(le(this,hn))}),le(this,kn).getQueryCache().notify({query:le(this,kt),type:"observerResultsUpdated"})})},yL);function Z9(e,t){return da(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Z2(e,t){return Z9(e,t)||e.state.data!==void 0&&$j(e,t,t.refetchOnMount)}function $j(e,t,r){if(da(t.enabled,e)!==!1&&qs(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&XN(e,t)}return!1}function J2(e,t,r,n){return(e!==t||da(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&XN(e,r)}function XN(e,t){return da(t.enabled,e)!==!1&&e.isStaleByTime(qs(t.staleTime,e))}function J9(e,t){return!_p(e.getCurrentResult(),t)}function eO(e){return{onFetch:(t,r)=>{var h,d,m,p,x;const n=t.options,i=(m=(d=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:d.fetchMore)==null?void 0:m.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],o=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const f=async()=>{let y=!1;const v=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},b=QL(t.options,t.fetchOptions),w=async(_,N,S)=>{if(y)return Promise.reject();if(N==null&&_.pages.length)return Promise.resolve(_);const C=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:N,direction:S?"backward":"forward",meta:t.options.meta};return v(P),P})(),O=await b(C),{maxPages:R}=t.options,A=S?H9:U9;return{pages:A(_.pages,O,R),pageParams:A(_.pageParams,N,R)}};if(i&&s.length){const _=i==="backward",N=_?eH:tO,S={pages:s,pageParams:o},k=N(n,S);l=await w(S,k,_)}else{const _=e??s.length;do{const N=c===0?o[0]??n.initialPageParam:tO(n,l);if(c>0&&N==null)break;l=await w(l,N),c++}while(c<_)}return l};t.options.persister?t.fetchFn=()=>{var y,v;return(v=(y=t.options).persister)==null?void 0:v.call(y,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=f}}}function tO(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function eH(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var qf,Qa,mn,$o,Xa,Ns,vL,tH=(vL=class extends eD{constructor(t){super();nt(this,Xa);nt(this,qf);nt(this,Qa);nt(this,mn);nt(this,$o);Ue(this,qf,t.client),this.mutationId=t.mutationId,Ue(this,mn,t.mutationCache),Ue(this,Qa,[]),this.state=t.state||nD(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){le(this,Qa).includes(t)||(le(this,Qa).push(t),this.clearGcTimeout(),le(this,mn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ue(this,Qa,le(this,Qa).filter(r=>r!==t)),this.scheduleGc(),le(this,mn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){le(this,Qa).length||(this.state.status==="pending"?this.scheduleGc():le(this,mn).remove(this))}continue(){var t;return((t=le(this,$o))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,c,f,h,d,m,p,x,y,v,b,w,_,N,S,k,C,O,R;const r=()=>{_t(this,Xa,Ns).call(this,{type:"continue"})},n={client:le(this,qf),meta:this.options.meta,mutationKey:this.options.mutationKey};Ue(this,$o,JL({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(A,P)=>{_t(this,Xa,Ns).call(this,{type:"failed",failureCount:A,error:P})},onPause:()=>{_t(this,Xa,Ns).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>le(this,mn).canRun(this)}));const i=this.state.status==="pending",s=!le(this,$o).canStart();try{if(i)r();else{_t(this,Xa,Ns).call(this,{type:"pending",variables:t,isPaused:s}),await((l=(o=le(this,mn).config).onMutate)==null?void 0:l.call(o,t,this,n));const P=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,n));P!==this.state.context&&_t(this,Xa,Ns).call(this,{type:"pending",context:P,variables:t,isPaused:s})}const A=await le(this,$o).start();return await((d=(h=le(this,mn).config).onSuccess)==null?void 0:d.call(h,A,t,this.state.context,this,n)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,A,t,this.state.context,n)),await((y=(x=le(this,mn).config).onSettled)==null?void 0:y.call(x,A,null,this.state.variables,this.state.context,this,n)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,A,null,t,this.state.context,n)),_t(this,Xa,Ns).call(this,{type:"success",data:A}),A}catch(A){try{throw await((_=(w=le(this,mn).config).onError)==null?void 0:_.call(w,A,t,this.state.context,this,n)),await((S=(N=this.options).onError)==null?void 0:S.call(N,A,t,this.state.context,n)),await((C=(k=le(this,mn).config).onSettled)==null?void 0:C.call(k,void 0,A,this.state.variables,this.state.context,this,n)),await((R=(O=this.options).onSettled)==null?void 0:R.call(O,void 0,A,t,this.state.context,n)),A}finally{_t(this,Xa,Ns).call(this,{type:"error",error:A})}}finally{le(this,mn).runNext(this)}}},qf=new WeakMap,Qa=new WeakMap,mn=new WeakMap,$o=new WeakMap,Xa=new WeakSet,Ns=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Tr.batch(()=>
375{le(this,Qa).forEach(n=>{n.onMutationUpdate(t)}),le(this,mn).notify({mutation:this,type:"updated",action:t})})},vL);function nD(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ai,Oa,Bf,xL,rH=(xL=class extends au{constructor(t={}){super();nt(this,Ai);nt(this,Oa);nt(this,Bf);this.config=t,Ue(this,Ai,new Set),Ue(this,Oa,new Map),Ue(this,Bf,0)}build(t,r,n){const i=new tH({client:t,mutationCache:this,mutationId:++wm(this,Bf)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){le(this,Ai).add(t);const r=Cm(t);if(typeof r=="string"){const n=le(this,Oa).get(r);n?n.push(t):le(this,Oa).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(le(this,Ai).delete(t)){const r=Cm(t);if(typeof r=="string"){const n=le(this,Oa).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&le(this,Oa).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Cm(t);if(typeof r=="string"){const n=le(this,Oa).get(r),i=n==null?void 0:n.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=Cm(t);if(typeof r=="string"){const i=(n=le(this,Oa).get(r))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Tr.batch(()=>{le(this,Ai).forEach(t=>{this.notify({type:"removed",mutation:t})}),le(this,Ai).clear(),le(this,Oa).clear()})}getAll(){return Array.from(le(this,Ai))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>G2(r,n))}findAll(t={}){return this.getAll().filter(r=>G2(t,r))}notify(t){Tr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>
vendor: 5,029 bytes, line 375
375r.state.isPaused);return Tr.batch(()=>Promise.all(t.map(r=>r.continue().catch(pn))))}},Ai=new WeakMap,Oa=new WeakMap,Bf=new WeakMap,xL);function Cm(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ri,As,Cn,Ii,Vi,np,qj,bL,nH=(bL=class extends au{constructor(r,n){super();nt(this,Vi);nt(this,Ri);nt(this,As);nt(this,Cn);nt(this,Ii);Ue(this,Ri,r),this.setOptions(n),this.bindMethods(),_t(this,Vi,np).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=le(this,Ri).defaultMutationOptions(r),_p(this.options,n)||le(this,Ri).getMutationCache().notify({type:"observerOptionsUpdated",mutation:le(this,Cn),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Vo(n.mutationKey)!==Vo(this.options.mutationKey)?this.reset():((i=le(this,Cn))==null?void 0:i.state.status)==="pending"&&le(this,Cn).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=le(this,Cn))==null||r.removeObserver(this)}onMutationUpdate(r){_t(this,Vi,np).call(this),_t(this,Vi,qj).call(this,r)}getCurrentResult(){return le(this,As)}reset(){var r;(r=le(this,Cn))==null||r.removeObserver(this),Ue(this,Cn,void 0),_t(this,Vi,np).call(this),_t(this,Vi,qj).call(this)}mutate(r,n){var i;return Ue(this,Ii,n),(i=le(this,Cn))==null||i.removeObserver(this),Ue(this,Cn,le(this,Ri).getMutationCache().build(le(this,Ri),this.options)),le(this,Cn).addObserver(this),le(this,Cn).execute(r)}},Ri=new WeakMap,As=new WeakMap,Cn=new WeakMap,Ii=new WeakMap,Vi=new WeakSet,np=function(){var n;const r=((n=le(this,Cn))==null?void 0:n.state)??nD();Ue(this,As,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},qj=function(r){Tr.batch(()=>{var n,i,s,o,l,c,f,h;if(le(this,Ii)&&this.hasListeners()){const d=le(this,As).variables,m=le(this,As).context,p={client:le(this,Ri),meta:this.options.meta,mutationKey:this.options.mutationKey};(r==null?void 0:r.type)==="success"?((i=(n=le(this,Ii)).onSuccess)==null||i.call(n,r.data,d,m,p),(o=(s=le(this,Ii)).onSettled)==null||o.call(s,r.data,null,d,m,p)):(r==null?void 0:r.type)==="error"&&((c=(l=le(this,Ii)).onError)==null||c.call(l,r.error,d,m,p),(h=(f=le(this,Ii)).onSettled)==null||h.call(f,void 0,r.error,d,m,p))}this.listeners.forEach(d=>{d(le(this,As))})})},bL),Za,wL,aH=(wL=class extends au{constructor(t={}){super();nt(this,Za);this.config=t,Ue(this,Za,new Map)}build(t,r,n){const i=r.queryKey,s=r.queryHash??GN(i,r);let o=this.get(s);return o||(o=new Q9({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){le(this,Za).has(t.queryHash)||(le(this,Za).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=le(this,Za).get(t.queryHash);r&&(t.destroy(),r===t&&le(this,Za).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Tr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return le(this,Za).get(t)}getAll(){return[...le(this,Za).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>K2(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>K2(t,n)):r}notify(t){Tr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Tr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Tr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Za=new WeakMap,wL),pr,Rs,Is,jc,Nc,Ms,Sc,kc,_L,iH=(_L=class{constructor(e={}){nt(this,pr);nt(this,Rs);nt(this,Is);nt(this,jc);nt(this,Nc);nt(this,Ms);nt(this,Sc);nt(this,kc);Ue(this,pr,e.queryCache||new aH),Ue(this,Rs,e.mutationCache||new rH),Ue(this,Is,e.defaultOptions||{}),Ue(this,jc,new Map),Ue(this,Nc,new Map),Ue(this,Ms,0)}mount(){wm(this,Ms)._++,le(this,Ms)===1&&(Ue(this,Sc,QN.subscribe(async e=>{e&&(await this.resumePausedMutations(),le(this,pr).onFocus())})),Ue(this,kc,jp.subscribe(async e=>{e&&(await this.resumePausedMutations(),le(this,pr).onOnline())})))}unmount(){var e,t;wm(this,Ms)._--,le(this,Ms)===0&&((e=le(this,Sc))==null||e.call(this),Ue(this,Sc,void 0),(t=le(this,kc))==null||t.call(this),Ue(this,kc,void 0))}isFetching(e){return le(this,pr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return le(this,Rs).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=le(this,pr).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=le(this,pr).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(qs(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return le(this,pr).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=le(this,pr).get(n.queryHash),s=i==null?void 0:i.state.data,o=q9(t,s);if(o!==void 0)return le(this,pr).build(this,n).setData(o,{...r,manual:!0})}
375setQueriesData(e,t,r){return Tr.batch(()=>le(this,pr).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=le(this,pr).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=le(this,pr);Tr.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=le(this,pr);return Tr.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Tr.batch(()=>le(this,pr).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(pn).catch(pn)}invalidateQueries(e,t={}){return Tr.batch(()=>(le(this,pr).findAll(e).forEach(r=>{r.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 r={...t,cancelRefetch:t.cancelRefetch??!0},n=Tr.batch(()=>le(this,pr).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(pn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(pn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=le(this,pr).build(this,t);return r.isStaleByTime(qs(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pn).catch(pn)}fetchInfiniteQuery(e){return e.behavior=eO(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pn).catch(pn)}ensureInfiniteQueryData(e){return e.behavior=eO(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return jp.isOnline()?le(this,Rs).resumePausedMutations():Promise.resolve()}getQueryCache(){return le(this,pr)}getMutationCache(){return le(this,Rs)}getDefaultOptions(){return le(this,Is)}setDefaultOptions(e){Ue(this,Is,e)}setQueryDefaults(e,t){le(this,jc).set(Vo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...le(this,jc).values()],r={};return t.forEach(n=>{Wd(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){le(this,Nc).set(Vo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...le(this,Nc).values()],r={};return t.forEach(n=>{Wd(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...le(this,Is).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=GN(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===YN&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...le(this,Is).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){le(this,pr).clear(),le(this,Rs).clear()}},pr=new WeakMap,Rs=new WeakMap,Is=new WeakMap,jc=new WeakMap,Nc=new WeakMap,Ms=new WeakMap,Sc=new WeakMap,kc=new WeakMap,_L),aD=I.createContext(void 0),at=e=>{const t=I.useContext(aD);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sH=({client:e,children:t})=>(I.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(aD.Provider,{value:e,children:t})),iD=I.createContext(!1),oH=()=>I.useContext(iD);iD.Provider;function lH(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var cH=I.createContext(lH()),uH=()=>I.useContext(cH),dH=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},fH=e=>{I.useEffect(()=>{e.clearReset()},[e])},hH=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||XL(r,[e.error,n])),mH=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},pH=(e,t)=>e.isLoading&&e.isFetching&&!t,gH=(e,t)=>
375(e==null?void 0:e.suspense)&&t.isPending,rO=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function yH(e,t,r){var d,m,p,x,y;const n=oH(),i=uH(),s=at(),o=s.defaultQueryOptions(e);(m=(d=s.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||m.call(d,o),o._optimisticResults=n?"isRestoring":"optimistic",mH(o),dH(o,i),fH(i);const l=!s.getQueryCache().get(o.queryHash),[c]=I.useState(()=>new t(s,o)),f=c.getOptimisticResult(o),h=!n&&e.subscribed!==!1;if(I.useSyncExternalStore(I.useCallback(v=>{const b=h?c.subscribe(Tr.batchCalls(v)):pn;return c.updateResult(),b},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),I.useEffect(()=>{c.setOptions(o)},[o,c]),gH(o,f))throw rO(o,c,i);if(hH({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw f.error;if((x=(p=s.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||x.call(p,o,f),o.experimental_prefetchInRender&&!Ho&&pH(f,n)){const v=l?rO(o,c,i):(y=s.getQueryCache().get(o.queryHash))==null?void 0:y.promise;v==null||v.catch(pn).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?f:c.trackResult(f)}function Te(e,t){return yH(e,X9)}function Ye(e,t){const r=at(),[n]=I.useState(()=>new nH(r,e));I.useEffect(()=>{n.setOptions(e)},[n,e]);const i=I.useSyncExternalStore(I.useCallback(o=>n.subscribe(Tr.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=I.useCallback((o,l)=>{n.mutate(o,l).catch(pn)},[n]);if(i.error&&XL(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const vH=new iH({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});function xH(){const[e,t]=I.useState(!1),r=I.useRef(!1),[n,i]=I.useState(!1),s=I.useRef(!1),[o,l]=I.useState(!1),c=I.useRef(!1),f=I.useRef([]),h=I.useRef([]),d=I.useRef([]),m=I.useRef(null),p=(O=!1)=>{const R=document.createElement("div");return R.style.position="absolute",R.style.pointerEvents="none",R.style.transition="all 0.1s ease-in-out",R.style.zIndex="9999",O?R.style.border="2px solid #2563EB":(R.style.border="2px solid #95a5fc",R.style.backgroundColor="rgba(99, 102, 241, 0.05)"),R},x=(O,R,A=!1)=>{if(!R||!r.current)return;R.offsetWidth;const P=R.getBoundingClientRect();O.style.top=`${P.top+window.scrollY}px`,O.style.left=`${P.left+window.scrollX}px`,O.style.width=`${P.width}px`,O.style.height=`${P.height}px`;let E=O.querySelector("div");E||(E=document.createElement("div"),E.textContent=R.tagName.toLowerCase(),E.style.position="absolute",E.style.top="-27px",E.style.left="-2px",E.style.padding="2px 8px",E.style.fontSize="11px",E.style.fontWeight=A?"500":"400",E.style.color=A?"#ffffff":"#526cff",E.style.backgroundColor=A?"#526cff":"#DBEAFE",E.style.borderRadius="3px",E.style.boxShadow="none",E.style.minWidth="24px",E.style.textAlign="center",O.appendChild(E))},y=O=>{if(!O)return[];const R=[...document.querySelectorAll(`[data-source-location="${O}"]`)];return R.length>0?R:[...document.querySelectorAll(`[data-visual-selector-id="${O}"]`)]},v=()=>{f.current.forEach(O=>{O&&O.parentNode&&O.remove()}),f.current=[],d.current=[]},b=O=>{if(!r.current||s.current)return;if(c.current){v();return}if(O.target.tagName.toLowerCase()==="path"){v();return}const R=O.target.closest("[data-source-location], [data-visual-selector-id]");if(!R){v();return}const A=R.dataset.sourceLocation||R.dataset.visualSelectorId;if(R.dataset.sourceLocation,m.current===A){v();return}const P=y(A);v(),P.forEach(E=>{const T=p(!1);document.body.appendChild(T),f.current.push(T),x(T,E)}),d.current=P},w=()=>{s.current||v()},_=O=>{var D;if(!r.current)return;if(c.current){O.preventDefault(),O.stopPropagation(),O.stopImmediatePropagation(),window.parent.postMessage({type:"close-dropdowns"},"*");return}if(O.target.tagName.toLowerCase()==="path")return;O.preventDefault(),O.stopPropagation(),O.stopImmediatePropagation();const R=O.target.closest("[data-source-location], [data-visual-selector-id]");if(!R)return;const A=R.dataset.sourceLocation||R.dataset.visualSelectorId;R.dataset.sourceLocation,h.current.forEach(W=>{W&&W.parentNode&&W.remove()}),h.current=[],y(A).forEach(W=>{const U=p(!0);document.body.appendChild(U),h.current.push(U),x(U,W,!0)}),m.current=A,v();
375const E=R.getBoundingClientRect(),T={top:E.top,left:E.left,right:E.right,bottom:E.bottom,width:E.width,height:E.height,centerX:E.left+E.width/2,centerY:E.top+E.height/2},$={type:"element-selected",tagName:R.tagName,classes:((D=R.className)==null?void 0:D.baseVal)||R.className||"",visualSelectorId:A,content:R.innerText,dataSourceLocation:R.dataset.sourceLocation,isDynamicContent:R.dataset.dynamicContent==="true",linenumber:R.dataset.linenumber,filename:R.dataset.filename,position:T};window.parent.postMessage($,"*")},N=()=>{h.current.forEach(O=>{O&&O.parentNode&&O.remove()}),h.current=[],m.current=null},S=(O,R,A=!1)=>{const P=y(O);P.length!==0&&(P.forEach(E=>{var T;if(A)E.className=R;else{const $=((T=E.className)==null?void 0:T.baseVal)||E.className||"";E.className=BL($,R)}}),setTimeout(()=>{var E,T;m.current===O&&h.current.forEach(($,D)=>{D<P.length&&x($,P[D])}),d.current.length>0&&((T=(E=d.current[0])==null?void 0:E.dataset)==null?void 0:T.visualSelectorId)===O&&f.current.forEach((D,W)=>{W<d.current.length&&x(D,d.current[W])})},50))},k=(O,R)=>{const A=y(O);A.length!==0&&(A.forEach(P=>{P.innerText=R}),setTimeout(()=>{m.current===O&&h.current.forEach((P,E)=>{E<A.length&&x(P,A[E])})},50))},C=O=>{t(O),r.current=O,O?(document.body.style.cursor="crosshair",document.addEventListener("mouseover",b),document.addEventListener("mouseout",w),document.addEventListener("click",_,!0)):(v(),h.current.forEach(R=>{R&&R.parentNode&&R.remove()}),h.current=[],d.current=[],m.current=null,document.body.style.cursor="default",document.removeEventListener("mouseover",b),document.removeEventListener("mouseout",w),document.removeEventListener("click",_,!0))};return I.useEffect(()=>{document.querySelectorAll("[data-linenumber]:not([data-visual-selector-id])").forEach((P,E)=>{const T=`visual-id-${P.dataset.filename}-${P.dataset.linenumber}-${E}`;P.dataset.visualSelectorId=T});const R=()=>{if(m.current){const P=y(m.current);if(P.length>0){const T=P[0].getBoundingClientRect(),$=window.innerHeight,D=window.innerWidth,W=T.top<$&&T.bottom>0&&T.left<D&&T.right>0,U={top:T.top,left:T.left,right:T.right,bottom:T.bottom,width:T.width,height:T.height,centerX:T.left+T.width/2,centerY:T.top+T.height/2};window.parent.postMessage({type:"element-position-update",position:U,isInViewport:W,visualSelectorId:m.current},"*")}}},A=P=>{const E=P.data;switch(E.type){case"toggle-visual-edit-mode":C(E.data.enabled);break;case"update-classes":E.data&&E.data.classes!==void 0?S(E.data.visualSelectorId,E.data.classes,E.data.replace||!1):console.warn("[Agent] Invalid update-classes message:",E);break;case"unselect-element":N();break;case"refresh-page":window.location.reload();break;case"update-content":E.data&&E.data.content!==void 0?k(E.data.visualSelectorId,E.data.content):console.warn("[Agent] Invalid update-content message:",E);break;case"request-element-position":if(m.current){const T=y(m.current);if(T.length>0){const D=T[0].getBoundingClientRect(),W=window.innerHeight,U=window.innerWidth,H=D.top<W&&D.bottom>0&&D.left<U&&D.right>0,K={top:D.top,left:D.left,right:D.right,bottom:D.bottom,width:D.width,height:D.height,centerX:D.left+D.width/2,centerY:D.top+D.height/2};window.parent.postMessage({type:"element-position-update",position:K,isInViewport:H,visualSelectorId:m.current},"*")}}break;case"popover-drag-state":E.data&&E.data.isDragging!==void 0&&(i(E.data.isDragging),s.current=E.data.isDragging,E.data.isDragging&&v());break;case"dropdown-state":E.data&&E.data.isOpen!==void 0&&(l(E.data.isOpen),c.current=E.data.isOpen,E.data.isOpen&&v());break}};return window.addEventListener("message",A),window.addEventListener("scroll",R,!0),document.addEventListener("scroll",R,!0),window.parent.postMessage({type:"visual-edit-agent-ready"},"*"),()=>{window.removeEventListener("message",A),window.removeEventListener("scroll",R,!0),document.removeEventListener("scroll",R,!0),document.removeEventListener("mouseover",b),document.removeEventListener("mouseout",w),document.removeEventListener("click",_,!0),v(),h.current.forEach(P=>{P&&P.parentNode&&P.remove()})}},[]),I.useEffect(()=>{r.current=e},[e]),I.useEffect(()=>{s.current=n},[n]),I.useEffect(()=>{c.current=o},[o]),I.useEffect(()=>{const O=()=>{if(m.current){const A=y(m.current);h.current.forEach((P,E)=>{E<A.length&&x(P,A[E])})}d.current.length>0&&f.current.forEach((A,P)=>{P<d.current.length&&x(A,d.current[P])})},R=new MutationObserver(A=>{A.some(E=>{const T=D=>{if(D.nodeType===Node.ELEMENT_NODE){if(D.dataset&&D.dataset.visualSelectorId)return!0;for(let W=0;W<D.children.length;W++)if(T(D.children[W]))return!0}return!1};return E.type==="attributes"&&(E.attributeName==="style"||E.attributeName==="class"||E.attributeName==="width"||E.attributeName==="height")&&T(E.target)})&&setTimeout(O,50)});return R.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["style","class","width","height"]}),window.addEventListener("resize",O),window.addEventListener("scroll",O),()=>{window.removeEventListener("resize",O),window.removeEventListener("scroll",O),R.disconnect()}},[]),null}var Hf=VN();const bH=Ft(Hf);/**
376 * @remix-run/router v1.23.0
377 *
378 * Copyright (c) Remix Software Inc.
379 *
380 * This source code is licensed under the MIT license found in the
381 * LICENSE.md file in the root directory of this source tree.
382 *
383 * @license MIT
384 */function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 4,916 bytes, line 384
384for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kd.apply(this,arguments)}var Ls;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ls||(Ls={}));const nO="popstate";function wH(e){e===void 0&&(e={});function t(n,i){let{pathname:s,search:o,hash:l}=n.location;return Bj("",{pathname:s,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:Np(i)}return jH(t,r,null,e)}function Sr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function sD(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _H(){return Math.random().toString(36).substr(2,8)}function aO(e,t){return{usr:e.state,key:e.key,idx:t}}function Bj(e,t,r,n){return r===void 0&&(r=null),Kd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?iu(t):t,{state:r,key:t&&t.key||n||_H()})}function Np(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function iu(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function jH(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,l=Ls.Pop,c=null,f=h();f==null&&(f=0,o.replaceState(Kd({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function d(){l=Ls.Pop;let v=h(),b=v==null?null:v-f;f=v,c&&c({action:l,location:y.location,delta:b})}function m(v,b){l=Ls.Push;let w=Bj(y.location,v,b);f=h()+1;let _=aO(w,f),N=y.createHref(w);try{o.pushState(_,"",N)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(N)}s&&c&&c({action:l,location:y.location,delta:1})}function p(v,b){l=Ls.Replace;let w=Bj(y.location,v,b);f=h();let _=aO(w,f),N=y.createHref(w);o.replaceState(_,"",N),s&&c&&c({action:l,location:y.location,delta:0})}function x(v){let b=i.location.origin!=="null"?i.location.origin:i.location.href,w=typeof v=="string"?v:Np(v);return w=w.replace(/ $/,"%20"),Sr(b,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,b)}let y={get action(){return l},get location(){return e(i,o)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(nO,d),c=v,()=>{i.removeEventListener(nO,d),c=null}},createHref(v){return t(i,v)},createURL:x,encodeLocation(v){let b=x(v);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:m,replace:p,go(v){return o.go(v)}};return y}var iO;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(iO||(iO={}));function NH(e,t,r){return r===void 0&&(r="/"),SH(e,t,r)}function SH(e,t,r,n){let i=typeof t=="string"?iu(t):t,s=ZN(i.pathname||"/",r);if(s==null)return null;let o=oD(e);kH(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let f=DH(s);l=IH(o[c],f)}return l}function oD(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let i=(s,o,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(Sr(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let f=Bs([n,c.relativePath]),h=r.concat(c);s.children&&s.children.length>0&&(Sr(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),oD(s.children,t,h,f)),!(s.path==null&&!s.index)&&t.push({path:f,score:AH(f,s.index),routesMeta:h})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,o);else for(let c of lD(s.path))i(s,o,c)}),t}function lD(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=lD(n.join("/")),l=[];return l.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function kH(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:RH(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const CH=/^:[\w-]+$/,FH=3,OH=2,EH=1,PH=10,TH=-2,sO=e=>e==="*";function AH(e,t){let r=e.split("/"),n=r.length;return r.some(sO)&&(n+=TH),t&&(n+=OH),r.filter(i=>!sO(i)).reduce((i,s)=>i+(CH.test(s)?FH:s===""?EH:PH),n)}function RH(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function IH(e,t,r){let{routesMeta:n}=e,i={},s="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],f=l===n.length-1,h=s==="/"?t:t.slice(s.length)||"/",d=MH({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},h),m=c.route;if(!d)return null;
vendor: 9,201 bytes, lines 384-393
384Object.assign(i,d.params),o.push({params:i,pathname:Bs([s,d.pathname]),pathnameBase:zH(Bs([s,d.pathnameBase])),route:m}),d.pathnameBase!=="/"&&(s=Bs([s,d.pathnameBase]))}return o}function MH(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=LH(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:n.reduce((f,h,d)=>{let{paramName:m,isOptional:p}=h;if(m==="*"){let y=l[d]||"";o=s.slice(0,s.length-y.length).replace(/(.)\/+$/,"$1")}const x=l[d];return p&&!x?f[m]=void 0:f[m]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:o,pattern:e}}function LH(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),sD(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function DH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return sD(!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 ZN(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function $H(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?iu(e):e;return{pathname:r?r.startsWith("/")?r:qH(r,t):t,search:UH(n),hash:HH(i)}}function qH(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function $0(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function BH(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function cD(e,t){let r=BH(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function uD(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=iu(e):(i=Kd({},e),Sr(!i.pathname||!i.pathname.includes("?"),$0("?","pathname","search",i)),Sr(!i.pathname||!i.pathname.includes("#"),$0("#","pathname","hash",i)),Sr(!i.search||!i.search.includes("#"),$0("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,l;if(o==null)l=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),d-=1;i.pathname=m.join("/")}l=d>=0?t[d]:"/"}let c=$H(i,l),f=o&&o!=="/"&&o.endsWith("/"),h=(s||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(f||h)&&(c.pathname+="/"),c}const Bs=e=>e.join("/").replace(/\/\/+/g,"/"),zH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),UH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,HH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function VH(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const dD=["post","put","patch","delete"];new Set(dD);const WH=["get",...dD];new Set(WH);/**
385 * React Router v6.30.1
386 *
387 * Copyright (c) Remix Software Inc.
388 *
389 * This source code is licensed under the MIT license found in the
390 * LICENSE.md file in the root directory of this source tree.
391 *
392 * @license MIT
393 */function Gd(){return Gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gd.apply(this,arguments)}const JN=I.createContext(null),KH=I.createContext(null),ol=I.createContext(null),qg=I.createContext(null),ll=I.createContext({outlet:null,matches:[],isDataRoute:!1}),fD=I.createContext(null);function GH(e,t){let{relative:r}=t===void 0?{}:t;Vf()||Sr(!1);let{basename:n,navigator:i}=I.useContext(ol),{hash:s,pathname:o,search:l}=mD(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Bs([n,o])),i.createHref({pathname:c,search:l,hash:s})}function Vf(){return I.useContext(qg)!=null}function cl(){return Vf()||Sr(!1),I.useContext(qg).location}function hD(e){I.useContext(ol).static||I.useLayoutEffect(e)}function Wf(){let{isDataRoute:e}=I.useContext(ll);return e?oV():YH()}function YH(){Vf()||Sr(!1);let e=I.useContext(JN),{basename:t,future:r,navigator:n}=I.useContext(ol),{matches:i}=I.useContext(ll),{pathname:s}=cl(),o=JSON.stringify(cD(i,r.v7_relativeSplatPath)),l=I.useRef(!1);return hD(()=>{l.current=!0}),I.useCallback(function(f,h){if(h===void 0&&(h={}),!l.current)return;if(typeof f=="number"){n.go(f);return}let d=uD(f,JSON.parse(o),s,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Bs([t,d.pathname])),(h.replace?n.replace:n.push)(d,h.state,h)},[t,n,o,s,e])}function mD(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=I.useContext(ol),{matches:i}=I.useContext(ll),{pathname:s}=cl(),o=JSON.stringify(cD(i,n.v7_relativeSplatPath));return I.useMemo(()=>uD(e,JSON.parse(o),s,r==="path"),[e,o,s,r])}function QH(e,t){return XH(e,t)}function XH(e,t,r,n){Vf()||Sr(!1);let{navigator:i}=I.useContext(ol),{matches:s}=I.useContext(ll),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let f=cl(),h;if(t){var d;let v=typeof t=="string"?iu(t):t;c==="/"||(d=v.pathname)!=null&&d.startsWith(c)||Sr(!1),h=v}else h=f;let m=h.pathname||"/",p=m;if(c!=="/"){let v=c.replace(/^\//,"").split("/");p="/"+m.replace(/^\//,"").split("/").slice(v.length).join("/")}let x=NH(e,{pathname:p}),y=rV(x&&x.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:Bs([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:Bs([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),s,r,n);return t&&y?I.createElement(qg.Provider,{value:{location:Gd({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Ls.Pop}},y):y}function ZH(){let e=sV(),t=VH(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return I.createElement(I.Fragment,null,I.createElement("h2",null,"Unexpected Application Error!"),I.createElement("h3",{style:{fontStyle:"italic"}},t),r?I.createElement("pre",{style:i},r):null,null)}const JH=I.createElement(ZH,null);class eV extends I.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?I.createElement(ll.Provider,{value:this.props.routeContext},I.createElement(fD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tV(e){let{routeContext:t,match:r,children:n}=e,i=I.useContext(JN);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),I.createElement(ll.Provider,{value:t},n)}function rV(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var s;if(!r)return null;if(r.errors)e=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(i=r)==null?void 0:i.errors;if(l!=null){let h=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);h>=0||Sr(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,f=-1;if(r&&n&&n.v7_partialHydration)for(let h=0;h<o.length;h++){let d=o[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(f=h),d.route.id){let{loaderData:m,errors:p}=r,x=d.route.loader&&m[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||x){c=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,d,m)=>{let p,x=!1,y=null,v=null;r&&(p=l&&d.route.id?l[d.route.id]:void 0,y=d.route.errorElement||JH,c&&(f<0&&m===0?(lV("route-fallback"),x=!0,v=null):f===m&&(x=!0,v=d.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,m+1)),w=()=>{let _;return p?_=y:x?_=v:d.route.Component?_=I.createElement(d.route.Component,null):d.route.element?_=d.route.element:_=h,I.createElement(tV,{match:d,routeC
393ontext:{outlet:h,matches:b,isDataRoute:r!=null},children:_})};return r&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?I.createElement(eV,{location:r.location,revalidation:r.revalidation,component:y,error:p,children:w(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):w()},null)}var pD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(pD||{}),gD=(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})(gD||{});function nV(e){let t=I.useContext(JN);return t||Sr(!1),t}function aV(e){let t=I.useContext(KH);return t||Sr(!1),t}function iV(e){let t=I.useContext(ll);return t||Sr(!1),t}function yD(e){let t=iV(),r=t.matches[t.matches.length-1];return r.route.id||Sr(!1),r.route.id}function sV(){var e;let t=I.useContext(fD),r=aV(),n=yD();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function oV(){let{router:e}=nV(pD.UseNavigateStable),t=yD(gD.UseNavigateStable),r=I.useRef(!1);return hD(()=>{r.current=!0}),I.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Gd({fromRouteId:t},s)))},[e,t])}const oO={};function lV(e,t,r){oO[e]||(oO[e]=!0)}function cV(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function ap(e){Sr(!1)}function uV(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Ls.Pop,navigator:s,static:o=!1,future:l}=e;Vf()&&Sr(!1);let c=t.replace(/^\/*/,"/"),f=I.useMemo(()=>({basename:c,navigator:s,static:o,future:Gd({v7_relativeSplatPath:!1},l)}),[c,l,s,o]);typeof n=="string"&&(n=iu(n));let{pathname:h="/",search:d="",hash:m="",state:p=null,key:x="default"}=n,y=I.useMemo(()=>{let v=ZN(h,c);return v==null?null:{location:{pathname:v,search:d,hash:m,state:p,key:x},navigationType:i}},[c,h,d,m,p,x,i]);return y==null?null:I.createElement(ol.Provider,{value:f},I.createElement(qg.Provider,{children:r,value:y}))}function dV(e){let{children:t,location:r}=e;return QH(zj(t),r)}new Promise(()=>{});function zj(e,t){t===void 0&&(t=[]);let r=[];return I.Children.forEach(e,(n,i)=>{if(!I.isValidElement(n))return;let s=[...t,i];if(n.type===I.Fragment){r.push.apply(r,zj(n.props.children,s));return}n.type!==ap&&Sr(!1),!n.props.index||!n.props.children||Sr(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=zj(n.props.children,s)),r.push(o)}),r}/**
394 * React Router DOM v6.30.1
395 *
396 * Copyright (c) Remix Software Inc.
397 *
398 * This source code is licensed under the MIT license found in the
399 * LICENSE.md file in the root directory of this source tree.
400 *
401 * @license MIT
402 */function Uj(){return Uj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uj.apply(this,arguments)}function fV(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function hV(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mV(e,t){return e.button===0&&(!t||t==="_self")&&!hV(e)}function Hj(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function pV(e,t){let r=Hj(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(s=>{r.append(i,s)})}),r}const gV=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],yV="6";try{window.__reactRouterVersion=yV}catch{}const vV="startTransition",lO=HN[vV];function xV(e){let{basename:t,children:r,future:n,window:i}=e,s=I.useRef();s.current==null&&(s.current=wH({window:i,v5Compat:!0}));let o=s.current,[l,c]=I.useState({action:o.action,location:o.location}),{v7_startTransition:f}=n||{},h=I.useCallback(d=>{f&&lO?lO(()=>c(d)):c(d)},[c,f]);return I.useLayoutEffect(()=>o.listen(h),[o,h]),I.useEffect(()=>cV(n),[n]),I.createElement(uV,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const bV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qi=I.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:s,replace:o,state:l,target:c,to:f,preventScrollReset:h,viewTransition:d}=t,m=fV(t,gV),{basename:p}=I.useContext(ol),x,y=!1;if(typeof f=="string"&&wV.test(f)&&(x=f,bV))try{let _=new URL(window.location.href),N=f.startsWith("//")?new URL(_.protocol+f):new URL(f),S=ZN(N.pathname,p);N.origin===_.origin&&S!=null?f=S+N.search+N.hash:y=!0}catch{}let v=GH(f,{relative:i}),b=_V(f,{replace:o,state:l,target:c,preventScrollReset:h,relative:i,viewTransition:d});function w(_){n&&n(_),_.defaultPrevented||b(_)}return I.createElement("a",Uj({},m,{href:x||v,onClick:y||s?n:w,ref:r,target:c}))});var cO;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(cO||(cO={}));var uO;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(uO||(uO={}));function _V(e,t){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,viewTransition:l}=t===void 0?{}:t,c=Wf(),f=cl(),h=mD(e,{relative:o});return I.useCallback(d=>
vendor: 4,207 bytes, line 402
402{if(mV(d,r)){d.preventDefault();let m=n!==void 0?n:Np(f)===Np(h);c(e,{replace:m,state:i,preventScrollReset:s,relative:o,viewTransition:l})}},[f,c,h,n,i,r,e,s,o,l])}function Bg(e){let t=I.useRef(Hj(e)),r=I.useRef(!1),n=cl(),i=I.useMemo(()=>pV(n.search,r.current?null:t.current),[n.search]),s=Wf(),o=I.useCallback((l,c)=>{const f=Hj(typeof l=="function"?l(i):l);r.current=!0,s("?"+f,c)},[s,i]);return[i,o]}function vD(e,t){return function(){return e.apply(t,arguments)}}const{toString:jV}=Object.prototype,{getPrototypeOf:Cc}=Object,{iterator:Kf,toStringTag:xD}=Symbol,Sp=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Yd=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Sp(r,t))return!0;r=Cc(r)}return!1},NV=(e,t)=>e!=null&&Yd(e,t)?e[t]:void 0,eS=(e=>t=>{const r=jV.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),qa=e=>(e=e.toLowerCase(),t=>eS(t)===e),zg=e=>t=>typeof t===e,{isArray:Wo}=Array,Fc=zg("undefined");function su(e){return e!==null&&!Fc(e)&&e.constructor!==null&&!Fc(e.constructor)&&On(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const bD=qa("ArrayBuffer");function SV(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&bD(e.buffer),t}const kV=zg("string"),On=zg("function"),wD=zg("number"),ou=e=>e!==null&&typeof e=="object",CV=e=>e===!0||e===!1,ip=e=>{if(!ou(e))return!1;const t=Cc(e);return(t===null||t===Object.prototype||Cc(t)===null)&&!Yd(e,xD)&&!Yd(e,Kf)},FV=e=>{if(!ou(e)||su(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},OV=qa("Date"),EV=qa("File"),PV=e=>!!(e&&typeof e.uri<"u"),TV=e=>e&&typeof e.getParts<"u",AV=qa("Blob"),RV=qa("FileList"),IV=e=>ou(e)&&On(e.pipe);function MV(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const dO=MV(),fO=typeof dO.FormData<"u"?dO.FormData:void 0,LV=e=>{if(!e)return!1;if(fO&&e instanceof fO)return!0;const t=Cc(e);if(!t||t===Object.prototype||!On(e.append))return!1;const r=eS(e);return r==="formdata"||r==="object"&&On(e.toString)&&e.toString()==="[object FormData]"},DV=qa("URLSearchParams"),[$V,qV,BV,zV]=["ReadableStream","Request","Response","Headers"].map(qa),UV=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Gf(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Wo(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(su(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let l;for(n=0;n<o;n++)l=s[n],t.call(null,e[l],l,e)}}function _D(e,t){if(su(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const ko=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,jD=e=>!Fc(e)&&e!==ko;function Vj(...e){const{caseless:t,skipUndefined:r}=jD(this)&&this||{},n={},i=(s,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const l=t&&typeof o=="string"&&_D(n,o)||o,c=Sp(n,l)?n[l]:void 0;ip(c)&&ip(s)?n[l]=Vj(c,s):ip(s)?n[l]=Vj({},s):Wo(s)?n[l]=s.slice():(!r||!Fc(s))&&(n[l]=s)};for(let s=0,o=e.length;s<o;s++){const l=e[s];if(!l||su(l)||(Gf(l,i),typeof l!="object"||Wo(l)))continue;const c=Object.getOwnPropertySymbols(l);for(let f=0;f<c.length;f++){const h=c[f];tW.call(l,h)&&i(l[h],h)}}return n}const HV=(e,t,r,{allOwnKeys:n}={})=>(Gf(t,(i,s)=>{r&&On(i)?Object.defineProperty(e,s,{__proto__:null,value:vD(i,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),VV=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),WV=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},KV=(e,t,r,n)=>{let i,s,o;const l={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;
vendor: 4,288 bytes, lines 402-403
402)o=i[s],(!n||n(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=r!==!1&&Cc(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},GV=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},YV=e=>{if(!e)return null;if(Wo(e))return e;let t=e.length;if(!wD(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},QV=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Cc(Uint8Array)),XV=(e,t)=>{const n=(e&&e[Kf]).call(e);let i;for(;(i=n.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},ZV=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},JV=qa("HTMLFormElement"),eW=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),{propertyIsEnumerable:tW}=Object.prototype,rW=qa("RegExp"),ND=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Gf(r,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(n[s]=o||i)}),Object.defineProperties(e,n)},nW=e=>{ND(e,(t,r)=>{if(On(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(On(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},aW=(e,t)=>{const r={},n=i=>{i.forEach(s=>{r[s]=!0})};return Wo(e)?n(e):n(String(e).split(t)),r},iW=()=>{},sW=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function oW(e){return!!(e&&On(e.append)&&e[xD]==="FormData"&&e[Kf])}const lW=e=>{const t=new WeakSet,r=n=>{if(ou(n)){if(t.has(n))return;if(su(n))return n;if(!("toJSON"in n)){t.add(n);const i=Wo(n)?[]:{};return Gf(n,(s,o)=>{const l=r(s);!Fc(l)&&(i[o]=l)}),t.delete(n),i}}return n};return r(e)},cW=qa("AsyncFunction"),uW=e=>e&&(ou(e)||On(e))&&On(e.then)&&On(e.catch),SD=((e,t)=>e?setImmediate:t?((r,n)=>(ko.addEventListener("message",({source:i,data:s})=>{i===ko&&s===r&&n.length&&n.shift()()},!1),i=>{n.push(i),ko.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",On(ko.postMessage)),dW=typeof queueMicrotask<"u"?queueMicrotask.bind(ko):typeof process<"u"&&process.nextTick||SD,kD=e=>e!=null&&On(e[Kf]),fW=e=>e!=null&&Yd(e,Kf)&&kD(e),he={isArray:Wo,isArrayBuffer:bD,isBuffer:su,isFormData:LV,isArrayBufferView:SV,isString:kV,isNumber:wD,isBoolean:CV,isObject:ou,isPlainObject:ip,isEmptyObject:FV,isReadableStream:$V,isRequest:qV,isResponse:BV,isHeaders:zV,isUndefined:Fc,isDate:OV,isFile:EV,isReactNativeBlob:PV,isReactNative:TV,isBlob:AV,isRegExp:rW,isFunction:On,isStream:IV,isURLSearchParams:DV,isTypedArray:QV,isFileList:RV,forEach:Gf,merge:Vj,extend:HV,trim:UV,stripBOM:VV,inherits:WV,toFlatObject:KV,kindOf:eS,kindOfTest:qa,endsWith:GV,toArray:YV,forEachEntry:XV,matchAll:ZV,isHTMLForm:JV,hasOwnProperty:Sp,hasOwnProp:Sp,hasOwnInPrototypeChain:Yd,getSafeProp:NV,reduceDescriptors:ND,freezeMethods:nW,toObjectSet:aW,toCamelCase:eW,noop:iW,toFiniteNumber:sW,findKey:_D,global:ko,isContextDefined:jD,isSpecCompliantForm:oW,toJSONObject:lW,isAsyncFn:cW,isThenable:uW,setImmediate:SD,asap:dW,isIterable:kD,isSafeIterable:fW},hW=he.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),mW=e=>{const t={};let r,n,i;return e&&e.split(`
403`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&hW[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function pW(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const gW=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),yW=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function tS(e,t){return he.isArray(e)?e.map(r=>tS(r,t)):pW(String(e).replace(t,""))}const vW=e=>tS(e,gW),xW=e=>tS(e,yW);function CD(e){const t=Object.create(null);return he.forEach(e.toJSON(),(r,n)=>{t[n]=xW(r)}),t}const hO=Symbol("internals");function sd(e){return e&&String(e).trim().toLowerCase()}function sp(e){return e===!1||e==null?e:he.isArray(e)?e.map(sp):vW(String(e))}function bW(e){const t=Object.create(null),r=/([^\s,;
403=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const wW=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function q0(e,t,r,n,i){if(he.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!he.isString(t)){if(he.isString(n))return t.indexOf(n)!==-1;if(he.isRegExp(n))return n.test(t)}}function _W(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function jW(e,t){const r=he.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(i,s,o){return this[n].call(this,t,i,s,o)},configurable:!0})})}let on=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function s(l,c,f){const h=sd(c);if(!h)return;const d=he.findKey(i,h);(!d||i[d]===void 0||f===!0||f===void 0&&i[d]!==!1)&&(i[d||c]=sp(l))}const o=(l,c)=>he.forEach(l,(f,h)=>s(f,h,c));if(he.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(he.isString(t)&&(t=t.trim())&&!wW(t))o(mW(t),r);else if(he.isObject(t)&&he.isSafeIterable(t)){let l=Object.create(null),c,f;for(const h of t){if(!he.isArray(h))throw new TypeError("Object iterator must return a key-value pair");f=h[0],he.hasOwnProp(l,f)?(c=l[f],l[f]=he.isArray(c)?[...c,h[1]]:[c,h[1]]):l[f]=h[1]}o(l,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=sd(t),t){const n=he.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return bW(i);if(he.isFunction(r))return r.call(this,i,n);if(he.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=sd(t),t){const n=he.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||q0(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function s(o){if(o=sd(o),o){const l=he.findKey(n,o);l&&(!r||q0(n,n[l],l,r))&&(delete n[l],i=!0)}}return he.isArray(t)?t.forEach(s):s(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const s=r[n];(!t||q0(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const r=this,n={};return he.forEach(this,(i,s)=>{const o=he.findKey(n,s);if(o){r[o]=sp(i),delete r[s];return}const l=t?_W(s):String(s).trim();l!==s&&delete r[s],r[l]=sp(i),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return he.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&he.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
404`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[hO]=this[hO]={accessors:{}}).accessors,i=this.prototype;function s(o){const l=sd(o);n[l]||(jW(i,o),n[l]=!0)}return he.isArray(t)?t.forEach(s):s(t),this}};on.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);he.reduceDescriptors(on.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});he.freezeMethods(on);const NW="[REDACTED ****]";function SW(e){if(he.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(he.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function kW(e,t){const r=new Set(t.map(s=>String(s).toLowerCase())),n=[],i=s=>{if(s===null||typeof s!="object"||he.isBuffer(s))return s;if(n.indexOf(s)!==-1)return;s instanceof on&&(s=s.toJSON()),n.push(s);let o;if(he.isArray(s))o=[],s.forEach((l,c)=>{const f=i(l);he.isUndefined(f)||(o[c]=f)});else{if(!he.isPlainObject(s)&&SW(s))return n.pop(),s;o=Object.create(null);for(const[l,c]of Object.entries(s)){const f=r.has(l.toLowerCase())?NW:i(c);he.isUndefined(f)||(o[l]=f)}}return n.pop(),o};return i(e)}let ze=class FD extends Error{static from(t,r,n,i,s,o){const l=new FD(t.message,r||t.code,n,i,s);return Object.defineProperty(l,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),o&&Object.assign(l,o),l}constructor(t,r,n,i,s){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){const t=this.config,r=t&&he.hasOwnProp(t,"redact")?t.redact:void 0,n=he.isArray(r)&&r.length>0?kW(t,r):he.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};ze.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ze.ERR_BAD_OPTION="ERR_BAD_OPTION";ze.ECONNABORTED="ECONNABORTED";ze.ETIMEDOUT="ETIMEDOUT";ze.ECONNREFUSED="ECONNREFUSED";ze.ERR_NETWORK="ERR_NETWORK";ze.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ze.ERR_DEPRECATED="ERR_DEPRECATED";ze.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ze.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ze.ERR_CANCELED="ERR_CANCELED";ze.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ze.ERR_INVALID_URL="ERR_INVALID_URL";
vendor: 4,672 bytes, line 404
404ze.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const CW=null,OD=100;function Wj(e){return he.isPlainObject(e)||he.isArray(e)}function ED(e){return he.endsWith(e,"[]")?e.slice(0,-2):e}function B0(e,t,r){return e?e.concat(t).map(function(i,s){return i=ED(i),!r&&s?"["+i+"]":i}).join(r?".":""):t}function FW(e){return he.isArray(e)&&!e.some(Wj)}const OW=he.toFlatObject(he,{},null,function(t){return/^is[A-Z]/.test(t)});function Ug(e,t,r){if(!he.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=he.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,_){return!he.isUndefined(_[w])});const n=r.metaTokens,i=r.visitor||x,s=r.dots,o=r.indexes,l=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?OD:r.maxDepth,f=l&&he.isSpecCompliantForm(t),h=[];if(!he.isFunction(i))throw new TypeError("visitor must be a function");function d(b){if(b===null)return"";if(he.isDate(b))return b.toISOString();if(he.isBoolean(b))return b.toString();if(!f&&he.isBlob(b))throw new ze("Blob is not supported. Use a Buffer instead.");if(he.isArrayBuffer(b)||he.isTypedArray(b)){if(f&&typeof l=="function")return new l([b]);if(typeof Buffer<"u")return Buffer.from(b);throw new ze("Blob is not supported. Use a Buffer instead.",ze.ERR_NOT_SUPPORT)}return b}function m(b){if(b>c)throw new ze("Object is too deeply nested ("+b+" levels). Max depth: "+c,ze.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(b,w){if(c===1/0)return JSON.stringify(b);const _=[];return JSON.stringify(b,function(S,k){if(!he.isObject(k))return k;for(;_.length&&_[_.length-1]!==this;)_.pop();return _.push(k),m(w+_.length-1),k})}function x(b,w,_){let N=b;if(he.isReactNative(t)&&he.isReactNativeBlob(b))return t.append(B0(_,w,s),d(b)),!1;if(b&&!_&&typeof b=="object"){if(he.endsWith(w,"{}"))w=n?w:w.slice(0,-2),b=p(b,1);else if(he.isArray(b)&&FW(b)||(he.isFileList(b)||he.endsWith(w,"[]"))&&(N=he.toArray(b)))return w=ED(w),N.forEach(function(k,C){!(he.isUndefined(k)||k===null)&&t.append(o===!0?B0([w],C,s):o===null?w:w+"[]",d(k))}),!1}return Wj(b)?!0:(t.append(B0(_,w,s),d(b)),!1)}const y=Object.assign(OW,{defaultVisitor:x,convertValue:d,isVisitable:Wj});function v(b,w,_=0){if(!he.isUndefined(b)){if(m(_),h.indexOf(b)!==-1)throw new Error("Circular reference detected in "+w.join("."));h.push(b),he.forEach(b,function(S,k){(!(he.isUndefined(S)||S===null)&&i.call(t,S,he.isString(k)?k.trim():k,w,y))===!0&&v(S,w?w.concat(k):[k],_+1)}),h.pop()}}if(!he.isObject(e))throw new TypeError("data must be an object");return v(e),t}function mO(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function rS(e,t){this._pairs=[],e&&Ug(e,this,t)}const PD=rS.prototype;PD.append=function(t,r){this._pairs.push([t,r])};PD.toString=function(t){const r=t?n=>t.call(this,n,mO):mO;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function EW(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function TD(e,t,r){if(!t)return e;e=e||"";const n=he.isFunction(r)?{serialize:r}:r,i=he.getSafeProp(n,"encode")||EW,s=he.getSafeProp(n,"serialize");let o;if(s?o=s(t,n):o=he.isURLSearchParams(t)?t.toString():new rS(t,n).toString(i),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class pO{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){he.forEach(this.handlers,function(n){n!==null&&t(n)})}}const nS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},PW=typeof URLSearchParams<"u"?URLSearchParams:rS,TW=typeof FormData<"u"?FormData:null,AW=typeof Blob<"u"?Blob:null,RW={isBrowser:!0,classes:{URLSearchParams:PW,FormData:TW,Blob:AW},protocols:["http","https","file","blob","url","data"]},aS=typeof window<"u"&&typeof document<"u",Kj=typeof navigator=="object"&&navigator||void 0,IW=aS&&(!Kj||["ReactNative","NativeScript","NS"].indexOf(Kj.product)<0),MW=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",LW=aS&&window.location.href||"http://localhost",DW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:aS,hasStandardBrowserEnv:IW,hasStandardBrowserWebWorkerEnv:MW,navigator:Kj,origin:LW},Symbol.toStringTag,{value:"Module"})),Zr={...DW,...RW};
vendor: 1,829 bytes, line 404
404function $W(e,t){return Ug(e,new Zr.classes.URLSearchParams,{visitor:function(r,n,i,s){return Zr.isNode&&he.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}const gO=OD;function AD(e){if(e>gO)throw new ze("FormData field is too deeply nested ("+e+" levels). Max depth: "+gO,ze.ERR_FORM_DATA_DEPTH_EXCEEDED)}function qW(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)AD(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function BW(e){const t={},r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],t[s]=e[s];return t}function RD(e){function t(r,n,i,s){AD(s);let o=r[s++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),c=s>=r.length;return o=!o&&he.isArray(i)?i.length:o,c?(he.hasOwnProp(i,o)?i[o]=he.isArray(i[o])?i[o].concat(n):[i[o],n]:i[o]=n,!l):((!he.hasOwnProp(i,o)||!he.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],s)&&he.isArray(i[o])&&(i[o]=BW(i[o])),!l)}if(he.isFormData(e)&&he.isFunction(e.entries)){const r={};return he.forEachEntry(e,(n,i)=>{t(qW(n),i,r,0)}),r}return null}const Bl=(e,t)=>e!=null&&he.hasOwnProp(e,t)?e[t]:void 0;function zW(e,t,r){if(he.isString(e))try{return(t||JSON.parse)(e),he.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Yf={transitional:nS,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=he.isObject(t);if(s&&he.isHTMLForm(t)&&(t=new FormData(t)),he.isFormData(t))return i?JSON.stringify(RD(t)):t;if(he.isArrayBuffer(t)||he.isBuffer(t)||he.isStream(t)||he.isFile(t)||he.isBlob(t)||he.isReadableStream(t))return t;if(he.isArrayBufferView(t))return t.buffer;if(he.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;
vendor: 21,460 bytes, lines 404-410
404if(s){const c=Bl(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return $W(t,c).toString();if((l=he.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=Bl(this,"env"),h=f&&f.FormData;return Ug(l?{"files[]":t}:t,h&&new h,c)}}return s||i?(r.setContentType("application/json",!1),zW(t)):t}],transformResponse:[function(t){const r=Bl(this,"transitional")||Yf.transitional,n=r&&r.forcedJSONParsing,i=Bl(this,"responseType"),s=i==="json";if(he.isResponse(t)||he.isReadableStream(t))return t;if(t&&he.isString(t)&&(n&&!i||s)){const l=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,Bl(this,"parseReviver"))}catch(c){if(l)throw c.name==="SyntaxError"?ze.from(c,ze.ERR_BAD_RESPONSE,this,null,Bl(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Zr.classes.FormData,Blob:Zr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};he.forEach(["delete","get","head","post","put","patch","query"],e=>{Yf.headers[e]={}});function z0(e,t){const r=this||Yf,n=t||r,i=on.from(n.headers);let s=n.data;return he.forEach(e,function(l){s=l.call(r,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function ID(e){return!!(e&&e.__CANCEL__)}let Qf=class extends ze{constructor(t,r,n){super(t??"canceled",ze.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function MD(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ze("Request failed with status code "+r.status,r.status>=400&&r.status<500?ze.ERR_BAD_REQUEST:ze.ERR_BAD_RESPONSE,r.config,r.request,r))}function UW(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function HW(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(c){const f=Date.now(),h=n[s];o||(o=f),r[i]=c,n[i]=f;let d=s,m=0;for(;d!==i;)m+=r[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),f-o<t)return;const p=h&&f-h;return p?Math.round(m*1e3/p):void 0}}function VW(e,t){let r=0,n=1e3/t,i,s;const o=(f,h=Date.now())=>{r=h,i=null,s&&(clearTimeout(s),s=null),e(...f)};return[(...f)=>{const h=Date.now(),d=h-r;d>=n?o(f,h):(i=f,s||(s=setTimeout(()=>{s=null,o(i)},n-d)))},()=>i&&o(i)]}const kp=(e,t,r=3)=>{let n=0;const i=HW(50,250);return VW(s=>{if(!s||typeof s.loaded!="number")return;const o=s.loaded,l=s.lengthComputable?s.total:void 0,c=l!=null?Math.min(o,l):o,f=Math.max(0,c-n),h=i(f);n=Math.max(n,c);const d={loaded:c,total:l,progress:l?c/l:void 0,bytes:f,rate:h||void 0,estimated:h&&l?(l-c)/h:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},r)},yO=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},vO=e=>(...t)=>he.asap(()=>e(...t)),WW=Zr.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Zr.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Zr.origin),Zr.navigator&&/(msie|trident)/i.test(Zr.navigator.userAgent)):()=>!0,KW=Zr.hasStandardBrowserEnv?{write(e,t,r,n,i,s,o){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];he.isNumber(r)&&l.push(`expires=${new Date(r).toUTCString()}`),he.isString(n)&&l.push(`path=${n}`),he.isString(i)&&l.push(`domain=${i}`),s===!0&&l.push("secure"),he.isString(o)&&l.push(`SameSite=${o}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),i=n.indexOf("=");if(i!==-1&&n.slice(0,i)===e)try{return decodeURIComponent(n.slice(i+1))}catch{return n.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function GW(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function YW(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const QW=/^https?:(?!\/\/)/i,XW=/[\t\n\r]/g;function ZW(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function JW(e){return ZW(e).replace(XW,"")}function xO(e,t){if(typeof e=="string"&&QW.test(JW(e)))throw new ze('Invalid URL: missing "//" after protocol',ze.ERR_INVALID_URL,t)}function LD(e,t,r,n){xO(t,n);let i=!GW(t);return e&&(i||r===!1)?(xO(e,n),YW(e,t)):t}const bO=e=>e instanceof on?{...e}:e;function Ko(e,t){e=e||{},t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(h,d,m,p){return he.isPlainObject(h)&&he.isPlainObject(d)?he.merge.call({caseless:p},h,d):he.isPlainObject(d)?he.merge({},d):he.isArray(d)?d.slice():d}function i(h,d,m,p){if(he.isUndefined(d)){if(!he.isUndefined(h))return n(void 0,h,m,p)}else return n(h,d,m,p)}function s(h,d){if(!he.isUndefined(d))return n(void 0,d)}function o(h,d){if(he.isUndefined(d)){if(!he.isUndefined(h))return n(void 0,h)}else return n(void 0,d)}function l(h){const d=he.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!he.isUndefined(d))if(he.isPlainObject(d)){if(he.hasOwnProp(d,h))return d[h]}else return;const m=he.hasOwnProp(e,"transitional")?e.transitional:void 0;if(he.isPlainObject(m)&&he.hasOwnProp(m,h))return m[h]}function c(h,d,m){if(he.hasOwnProp(t,m))return n(h,d);if(he.hasOwnProp(e,m))return n(void 0,h)}const f={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(h,d,m)=>i(bO(h),bO(d),m,!0)};return he.forEach(Object.keys({...e,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const m=he.hasOwnProp(f,d)?f[d]:i,p=he.hasOwnProp(e,d)?e[d]:void 0,x=he.hasOwnProp(t,d)?t[d]:void 0,y=m(p,x,d);he.isUndefined(y)&&m!==c||(r[d]=y)}),he.hasOwnProp(t,"validateStatus")&&he.isUndefined(t.validateStatus)&&l("validateStatusUndefinedResolves")===!1&&(he.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const eK=["content-type","content-length"];function tK(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([n,i])=>{eK.includes(n.toLowerCase())&&e.set(n,i)})}const rK=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function DD(e){const t=Ko({},e),r=m=>he.hasOwnProp(t,m)?t[m]:void 0,n=r("data");let i=r("withXSRFToken");const s=r("xsrfHeaderName"),o=r("xsrfCookieName");let l=r("headers");const c=r("auth"),f=r("baseURL"),h=r("allowAbsoluteUrls"),d=r("url");if(t.headers=l=on.from(l),t.url=TD(LD(f,d,h,t),r("params"),r("paramsSerializer")),c){const m=he.getSafeProp(c,"username")||"",p=he.getSafeProp(c,"password")||"";try{l.set("Authorization","Basic "+btoa(m+":"+(p?rK(p):"")))}catch(x){throw ze.from(x,ze.ERR_BAD_OPTION_VALUE,e)}}if(he.isFormData(n)&&(Zr.hasStandardBrowserEnv||Zr.hasStandardBrowserWebWorkerEnv||he.isReactNative(n)?l.setContentType(void 0):he.isFunction(n.getHeaders)&&tK(l,n.getHeaders(),r("formDataHeaderPolicy"))),Zr.hasStandardBrowserEnv&&(he.isFunction(i)&&(i=i(t)),i===!0||i==null&&WW(t.url))){const p=s&&o&&KW.read(o);p&&l.set(s,p)}return t}const nK=typeof XMLHttpRequest<"u",aK=nK&&function(e){return new Promise(function(r,n){const i=DD(e);let s=i.data;const o=on.from(i.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:f}=i,h,d,m,p,x;function y(){p&&p(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function b(){if(!v)return;const _=on.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),S={data:!l||l==="text"||l==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:_,config:e,request:v};MD(function(C){r(C),y()},function(C){n(C),y()},S),v=null}"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.startsWith("file:"))||setTimeout(b)},v.onabort=function(){v&&(n(new ze("Request aborted",ze.ECONNABORTED,e,v)),y(),v=null)},v.onerror=function(N){const S=N&&N.message?N.message:"Network Error",k=new ze(S,ze.ERR_NETWORK,e,v);k.event=N||null,n(k),y(),v=null},v.ontimeout=function(){let N=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const S=i.transitional||nS;i.timeoutErrorMessage&&(N=i.timeoutErrorMessage),n(new ze(N,S.clarifyTimeoutError?ze.ETIMEDOUT:ze.ECONNABORTED,e,v)),y(),v=null},s===void 0&&o.setContentType(null),"setRequestHeader"in v&&he.forEach(CD(o),function(N,S){v.setRequestHeader(S,N)}),he.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),l&&l!=="json"&&(v.responseType=i.responseType),f&&([m,x]=kp(f,!0),v.addEventListener("progress",m)),c&&v.upload&&([d,p]=kp(c),v.upload.addEventListener("progress",d),v.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(h=_=>{v&&(n(!_||_.type?new Qf(null,e,v):_),v.abort(),y(),v=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const w=UW(i.url);if(w&&!Zr.protocols.includes(w)){n(new ze("Unsupported protocol "+w+":",ze.ERR_BAD_REQUEST,e)),y();return}v.send(s||null)})},iK=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const i=function(c){if(!n){n=!0,o();const f=c instanceof Error?c:this.reason;r.abort(f instanceof ze?f:new Qf(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,i(new ze(`timeout of ${t}ms exceeded`,ze.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i,{once:!0}));const{signal:l}=r;return l.unsubscribe=()=>he.asap(o),l},sK=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},oK=async function*(e,t){for await(const r of lK(e))yield*sK(r,t)},lK=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},wO=(e,t,r,n)=>{const i=oK(e,t);let s=0,o,l=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:f,value:h}=await i.next();if(f){l(),c.close();return}let d=h.byteLength;if(r){let m=s+=d;r(m)}c.enqueue(new Uint8Array(h))}catch(f){throw l(f),f}},cancel(c){return l(c),i.return()}},{highWaterMark:2})},Cp=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,cK=(e,t,r)=>t+2<r&&Cp(e.charCodeAt(t+1))&&Cp(e.charCodeAt(t+2));function uK(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let o=n.length;const l=n.length;for(let p=0;p<l;p++)if(n.charCodeAt(p)===37&&p+2<l){const x=n.charCodeAt(p+1),y=n.charCodeAt(p+2);Cp(x)&&Cp(y)&&(o-=2,p+=2)}let c=0,f=l-1;const h=p=>p>=2&&n.charCodeAt(p-2)===37&&n.charCodeAt(p-1)===51&&(n.charCodeAt(p)===68||n.charCodeAt(p)===100);f>=0&&(n.charCodeAt(f)===61?(c++,f--):h(f)&&(c++,f-=3)),c===1&&f>=0&&(n.charCodeAt(f)===61||h(f))&&c++;const m=Math.floor(o/4)*3-(c||0);return m>0?m:0}let s=0;for(let o=0,l=n.length;o<l;o++){const c=n.charCodeAt(o);if(c===37&&cK(n,o,l))s+=1,o+=2;else if(c<128)s+=1;else if(c<2048)s+=2;else if(c>=55296&&c<=56319&&o+1<l){const f=n.charCodeAt(o+1);f>=56320&&f<=57343?(s+=4,o++):s+=3}else s+=3}return s}const iS="1.18.1",_O=64*1024,{isFunction:Fm}=he,dK=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),jO=e=>{if(!he.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},NO=(e,...t)=>{try{return!!e(...t)}catch{return!1}},fK=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},hK=e=>{const t=he.global!==void 0&&he.global!==null?he.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=he.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:s,Response:o}=e,l=i?Fm(i):typeof fetch=="function",c=Fm(s),f=Fm(o);if(!l)return!1;const h=l&&Fm(r),d=l&&(typeof n=="function"?(b=>w=>b.encode(w))(new n):async b=>new Uint8Array(await new s(b).arrayBuffer())),m=c&&h&&NO(()=>{let b=!1;const w=new s(Zr.origin,{body:new r,method:"POST",get duplex(){return b=!0,"half"}}),_=w.headers.has("Content-Type");return w.body!=null&&w.body.cancel(),b&&!_}),p=f&&h&&NO(()=>he.isReadableStream(new o("").body)),x={stream:p&&(b=>b.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!x[b]&&(x[b]=(w,_)=>{let N=w&&w[b];if(N)return N.call(w);throw new ze(`Response type '${b}' is not supported`,ze.ERR_NOT_SUPPORT,_)})});const y=async b=>{if(b==null)return 0;if(he.isBlob(b))return b.size;if(he.isSpecCompliantForm(b))return(await new s(Zr.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(he.isArrayBufferView(b)||he.isArrayBuffer(b))return b.byteLength;if(he.isURLSearchParams(b)&&(b=b+""),he.isString(b))return(await d(b)).byteLength},v=async(b,w)=>{const _=he.toFiniteNumber(b.getContentLength());return _??y(w)};return async b=>{let{url:w,method:_,data:N,signal:S,cancelToken:k,timeout:C,onDownloadProgress:O,onUploadProgress:R,responseType:A,headers:P,withCredentials:E="same-origin",fetchOptions:T,maxContentLength:$,maxBodyLength:D}=DD(b);const W=he.isNumber($)&&$>-1,U=he.isNumber(D)&&D>-1,H=G=>he.hasOwnProp(b,G)?b[G]:void 0;let K=i||fetch;A=A?(A+"").toLowerCase():"text";let q=iK([S,k&&k.toAbortSignal()],C),L=null;const V=q&&q.unsubscribe&&(()=>{q.unsubscribe()});let z,Z=null;const re=()=>new ze("Request body larger than maxBodyLength limit",ze.ERR_BAD_REQUEST,b,L);try{let G;const X=H("auth");if(X){const Ae=he.getSafeProp(X,"username")||"",tt=he.getSafeProp(X,"password")||"";G={username:Ae,password:tt}}if(fK(w)){const Ae=new URL(w,Zr.origin);if(!G&&(Ae.username||Ae.password)){const tt=jO(Ae.username),ye=jO(Ae.password);G={username:tt,password:ye}}(Ae.username||Ae.password)&&(Ae.username="",Ae.password="",w=Ae.href)}if(G&&(P.delete("authorization"),P.set("Authorization","Basic "+btoa(dK((G.username||"")+":"+(G.password||""))))),W&&typeof w=="string"&&w.startsWith("data:")&&uK(w)>$)throw new ze("maxContentLength size of "+$+" exceeded",ze.ERR_BAD_RESPONSE,b,L);if(U&&_!=="get"&&_!=="head"){const Ae=await y(N);if(typeof Ae=="number"&&isFinite(Ae)&&(z=Ae,Ae>D))throw re()}const ie=U&&(he.isReadableStream(N)||he.isStream(N)),J=(Ae,tt,ye)=>wO(Ae,_O,xe=>{if(U&&xe>D)throw Z=re();tt&&tt(xe)},ye);if(m&&_!=="get"&&_!=="head"&&(R||ie)){if(z=z??await v(P,N),z!==0||ie){let Ae=new s(w,{method:"POST",body:N,duplex:"half"}),tt;if(he.isFormData(N)&&(tt=Ae.headers.get("content-type"))&&P.setContentType(tt),Ae.body){const[ye,xe]=R&&yO(z,kp(vO(R)))||[];N=J(Ae.body,ye,xe)}}}else if(ie&&!c&&h&&_!=="get"&&_!=="head")N=J(N);else if(ie&&c&&!m&&_!=="get"&&_!=="head")throw new ze("Stream request bodies are not supported by the current fetch implementation",ze.ERR_NOT_SUPPORT,b,L);he.isString(E)||(E=E?"include":"omit");const ue=c&&"credentials"in s.prototype;if(he.isFormData(N)){const Ae=P.getContentType();Ae&&/^multipart\/form-data/i.test(Ae)&&!/boundary=/i.test(Ae)&&P.delete("content-type")}P.set("User-Agent","axios/"+iS,!1);const ge={...T,signal:q,method:_.toUpperCase(),headers:CD(P.normalize()),body:N,duplex:"half",credentials:ue?E:void 0};L=c&&new s(w,ge);let fe=await(c?K(L,T):K(w,ge));const Ee=on.from(fe.headers);if(W){const Ae=he.toFiniteNumber(Ee.getContentLength());if(Ae!=null&&Ae>$)throw new ze("maxContentLength size of "+$+" exceeded",ze.ERR_BAD_RESPONSE,b,L)}const Oe=p&&(A==="stream"||A==="response");if(p&&fe.body&&(O||W||Oe&&V)){const Ae={};["status","statusText","headers"].forEach(_e=>{Ae[_e]=fe[_e]});const tt=he.toFiniteNumber(Ee.getContentLength()),[ye,xe]=O&&yO(tt,kp(vO(O),!0))||[];let Ce=0;const Re=_e=>{if(W&&(Ce=_e,Ce>$))throw new ze("maxContentLength size of "+$+" exceeded",ze.ERR_BAD_RESPONSE,b,L);ye&&ye(_e)};fe=new o(wO(fe.body,_O,Re,()=>{xe&&xe(),V&&V()}),Ae)}A=A||"text";let Ve=await x[he.findKey(x,A)||"text"](fe,b);if(W&&!p&&!Oe){let Ae;if(Ve!=null&&(typeof Ve.byteLength=="number"?Ae=Ve.byteLength:typeof Ve.size=="number"?Ae=Ve.size:typeof Ve=="string"&&(Ae=typeof n=="function"?new n().encode(Ve).byteLength:Ve.length)),typeof Ae=="number"&&Ae>$)throw new ze("maxContentLength size of "+$+" exceeded",ze.ERR_BAD_RESPONSE,b,L)}return!Oe&&V&&V(),await new Promise((Ae,tt)=>{MD(Ae,tt,{data:Ve,headers:on.from(fe.headers),status:fe.status,statusText:fe.statusText,config:b,request:L})})}catch(G){if(V&&V(),q&&q.aborted&&q.reason instanceof ze){const X=q.reason;throw X.config=b,L&&(X.request=L),G!==X&&Object.defineProperty(X,"cause",{__proto__:null,value:G,writable:!0,enumerable:!1,configurable:!0}),X}if(Z)throw L&&!Z.request&&(Z.request=L),Z;if(G instanceof ze)throw L&&!G.request&&(G.request=L),G;if(G&&G.name==="TypeError"&&/Load failed|fetch/i.test(G.message)){const X=new ze("Network Error",ze.ERR_NETWORK,b,L,G&&G.response);throw Object.defineProperty(X,"cause",{__proto__:null,value:G.cause||G,writable:!0,enumerable:!1,configurable:!0}),X}throw ze.from(G,G&&G.code,b,L,G&&G.response)}}},mK=new Map,$D=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:i}=t,s=[n,i,r];let o=s.length,l=o,c,f,h=mK;for(;l--;)c=s[l],f=h.get(c),f===void 0&&h.set(c,f=l?new Map:hK(t)),h=f;return f};$D();const sS={http:CW,xhr:aK,fetch:{get:$D}};he.forEach(sS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const SO=e=>`- ${e}`,pK=e=>he.isFunction(e)||e===null||e===!1;function gK(e,t){e=he.isArray(e)?e:[e];const{length:r}=e;let n,i;const s={};for(let o=0;o<r;o++){n=e[o];let l;if(i=n,!pK(n)&&(i=sS[(l=String(n)).toLowerCase()],i===void 0))throw new ze(`Unknown adapter '${l}'`);if(i&&(he.isFunction(i)||(i=i.get(t))))break;s[l||"#"+o]=i}if(!i){const o=Object.entries(s).map(([c,f])=>`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=r?o.length>1?`since :
405`+o.map(SO).join(`
406`):" "+SO(o[0]):"as no adapter specified";throw new ze("There is no suitable adapter to dispatch the request "+l,ze.ERR_NOT_SUPPORT)}return i}const qD={getAdapter:gK,adapters:sS};function U0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qf(null,e)}function kO(e){return U0(e),e.headers=on.from(e.headers),e.data=z0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),qD.getAdapter(e.adapter||Yf.adapter,e)(e).then(function(n){U0(e),e.response=n;try{n.data=z0.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=on.from(n.headers),n},function(n){if(!ID(n)&&(U0(e),n&&n.response)){e.response=n.response;try{n.response.data=z0.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=on.from(n.response.headers)}return Promise.reject(n)})}const Hg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Hg[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const CO={};Hg.transitional=function(t,r,n){function i(s,o){return"[Axios v"+iS+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,l)=>{if(t===!1)throw new ze(i(o," has been removed"+(r?" in "+r:"")),ze.ERR_DEPRECATED);return r&&!CO[o]&&(CO[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,o,l):!0}};Hg.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function yK(e,t,r){if(typeof e!="object"||e===null)throw new ze("options must be an object",ze.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const s=n[i],o=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(o){const l=e[s],c=l===void 0||o(l,s,e);if(c!==!0)throw new ze("option "+s+" must be "+c,ze.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ze("Unknown option "+s,ze.ERR_BAD_OPTION)}}const op={assertOptions:yK,validators:Hg},nn=op.validators;let qo=class{constructor(t){this.defaults=t||{},this.interceptors={request:new pO,response:new pO}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=(()=>{if(!i.stack)return"";const o=i.stack.indexOf(`
407`);return o===-1?"":i.stack.slice(o+1)})();try{if(!n.stack)n.stack=s;else if(s){const o=s.indexOf(`
408`),l=o===-1?-1:s.indexOf(`
409`,o+1),c=l===-1?"":s.slice(l+1);String(n.stack).endsWith(c)||(n.stack+=`
410`+s)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ko(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&op.assertOptions(n,{silentJSONParsing:nn.transitional(nn.boolean),forcedJSONParsing:nn.transitional(nn.boolean),clarifyTimeoutError:nn.transitional(nn.boolean),legacyInterceptorReqResOrdering:nn.transitional(nn.boolean),advertiseZstdAcceptEncoding:nn.transitional(nn.boolean),validateStatusUndefinedResolves:nn.transitional(nn.boolean)}
vendor: 3,172 bytes, line 410
410,!1),i!=null&&(he.isFunction(i)?r.paramsSerializer={serialize:i}:op.assertOptions(i,{encode:nn.function,serialize:nn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),op.assertOptions(r,{baseUrl:nn.spelling("baseURL"),withXsrfToken:nn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&he.merge(s.common,s[r.method]);s&&he.forEach(["delete","get","head","post","put","patch","query","common"],x=>{delete s[x]}),r.headers=on.concat(o,s);const l=[];let c=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(r)===!1)return;c=c&&y.synchronous;const v=r.transitional||nS;v&&v.legacyInterceptorReqResOrdering?l.unshift(y.fulfilled,y.rejected):l.push(y.fulfilled,y.rejected)});const f=[];this.interceptors.response.forEach(function(y){f.push(y.fulfilled,y.rejected)});let h,d=0,m;if(!c){const x=[kO.bind(this),void 0];for(x.unshift(...l),x.push(...f),m=x.length,h=Promise.resolve(r);d<m;)h=h.then(x[d++],x[d++]);return h}m=l.length;let p=r;for(;d<m;){const x=l[d++],y=l[d++];try{p=x(p)}catch(v){y.call(this,v);break}}try{h=kO.call(this,p)}catch(x){return Promise.reject(x)}for(d=0,m=f.length;d<m;)h=h.then(f[d++],f[d++]);return h}getUri(t){t=Ko(this.defaults,t);const r=LD(t.baseURL,t.url,t.allowAbsoluteUrls,t);return TD(r,t.params,t.paramsSerializer)}};he.forEach(["delete","get","head","options"],function(t){qo.prototype[t]=function(r,n){return this.request(Ko(n||{},{method:t,url:r,data:n&&he.hasOwnProp(n,"data")?n.data:void 0}))}});he.forEach(["post","put","patch","query"],function(t){function r(n){return function(s,o,l){return this.request(Ko(l||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}qo.prototype[t]=r(),t!=="query"&&(qo.prototype[t+"Form"]=r(!0))});let vK=class BD{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(l=>{n.subscribe(l),s=l}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},t(function(s,o,l){n.reason||(n.reason=new Qf(s,o,l),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new BD(function(i){t=i}),cancel:t}}};function xK(e){return function(r){return e.apply(null,r)}}function bK(e){return he.isObject(e)&&e.isAxiosError===!0}const Gj={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
410alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Gj).forEach(([e,t])=>{Gj[t]=e});function zD(e){const t=new qo(e),r=vD(qo.prototype.request,t);return he.extend(r,qo.prototype,t,{allOwnKeys:!0}),he.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return zD(Ko(e,i))},r}const br=zD(Yf);br.Axios=qo;br.CanceledError=Qf;br.CancelToken=vK;br.isCancel=ID;br.VERSION=iS;br.toFormData=Ug;br.AxiosError=ze;br.Cancel=br.CanceledError;br.all=function(t){return Promise.all(t)};br.spread=xK;br.isAxiosError=bK;br.mergeConfig=Ko;br.AxiosHeaders=on;br.formToJSON=e=>RD(he.isHTMLForm(e)?new FormData(e):e);br.getAdapter=qD.getAdapter;br.HttpStatusCode=Gj;br.default=br;const{Axios:oje,AxiosError:lje,CanceledError:cje,isCancel:uje,CancelToken:dje,VERSION:fje,all:hje,Cancel:mje,isAxiosError:pje,spread:gje,toFormData:yje,AxiosHeaders:vje,HttpStatusCode:xje,formToJSON:bje,getAdapter:wje,mergeConfig:_je,create:jje}=br,UD=typeof window>"u",FO=!UD&&window.self!==window.top,wK=!UD&&typeof document>"u",H0=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),Yr=[];for(let e=0;e<256;++e)Yr.push((e+256).toString(16).slice(1));function _K(e,t=0){return(Yr[e[t+0]]+Yr[e[t+1]]+Yr[e[t+2]]+Yr[e[t+3]]+"-"+Yr[e[t+4]]+Yr[e[t+5]]+"-"+Yr[e[t+6]]+Yr[e[t+7]]+"-"+Yr[e[t+8]]+Yr[e[t+9]]+"-"+Yr[e[t+10]]+Yr[e[t+11]]+Yr[e[t+12]]+Yr[e[t+13]]+Yr[e[t+14]]+Yr[e[t+15]]).toLowerCase()}let V0;const jK=new Uint8Array(16);function NK(){if(!V0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");V0=crypto.getRandomValues.bind(crypto)}return V0(jK)}const SK=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),OO={randomUUID:SK};function kK(e,t,r){var i;e=e||{};const n=e.random??((i=e.rng)==null?void 0:i.call(e))??NK();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,_K(n)}function CK(e,t,r){return OO.randomUUID&&!e?OO.randomUUID():kK(e)}const od=typeof window<"u"?window:{base44SharedInstances:{}};function FK(e,t){return od.base44SharedInstances||(od.base44SharedInstances={}),od.base44SharedInstances[e]||(od.base44SharedInstances[e]={instance:t()}),od.base44SharedInstances[e].instance}const OK="__user_heartbeat_event__",EK="__initialization_event__",PK="__session_duration_event__",EO="analytics-enable",PO="base44_analytics_session_id",TK={enabled:!0,maxQueueSize:1e3,throttleTime:1e3,batchSize:30,heartBeatInterval:60*1e3},AK="analytics",Gt=FK(AK,()=>({requestsQueue:[],isProcessing:!1,isHeartBeatProcessing:!1,wasInitializationTracked:!1,sessionContext:null,sessionStartTime:null,config:{...TK,...BK()}})),RK=({axiosClient:e,serverUrl:t,appId:r,userAuthModule:n})=>{var i;const{maxQueueSize:s,throttleTime:o,batchSize:l}=Gt.config;if(!(!((i=Gt.config)===null||i===void 0)&&i.enabled)||wK)return{track:()=>{},cleanup:()=>{}};let c;const f=`${t}/api/apps/${r}/analytics/track/batch`,h=async _=>{await e.request({method:"POST",url:`/apps/${r}/analytics/track/batch`,data:{events:_}})},d=_=>{try{const N=JSON.stringify({events:_}),S=new Blob([N],{type:"application/json"});return typeof navigator>"u"||N.length>6e4||!navigator.sendBeacon(f,S)}catch{return!1}},m=async(_,N={})=>
410{if(_.length===0)return;const S=await qK(n),k=_.map($K(S));try{(!N.isBeacon||!d(k))&&await h(k)}catch{}},p=()=>{AO(m,{throttleTime:o,batchSize:l})},x=_=>{if(Gt.requestsQueue.length>=s)return;const N=DK();Gt.requestsQueue.push({..._,...N}),p()},y=()=>{AO(m,{throttleTime:o,batchSize:l}),c=RO(x),MK()},v=()=>{TO(),c==null||c(),LK(x);const _=Gt.requestsQueue.splice(0);m(_,{isBeacon:!0})},b=()=>{typeof window>"u"||(document.visibilityState==="hidden"?v():document.visibilityState==="visible"&&y())},w=()=>{TO(),c==null||c(),typeof window<"u"&&window.removeEventListener("visibilitychange",b)};return p(),c=RO(x),IK(x),typeof window<"u"&&window.addEventListener("visibilitychange",b),{track:x,cleanup:w}};function TO(){Gt.isProcessing=!1}async function AO(e,t){if(Gt.isProcessing)return;Gt.isProcessing=!0;const{throttleTime:r=1e3,batchSize:n=30}=t??{};for(;Gt.isProcessing&&Gt.requestsQueue.length>0;){const i=Gt.requestsQueue.splice(0,n);i.length&&await e(i),await new Promise(s=>setTimeout(s,r))}Gt.isProcessing=!1}function RO(e){var t;if(Gt.isHeartBeatProcessing||((t=Gt.config.heartBeatInterval)!==null&&t!==void 0?t:0)<10)return()=>{};Gt.isHeartBeatProcessing=!0;const r=setInterval(()=>{e({eventName:OK})},Gt.config.heartBeatInterval);return()=>{clearInterval(r),Gt.isHeartBeatProcessing=!1}}function IK(e){typeof window>"u"||Gt.wasInitializationTracked||(Gt.wasInitializationTracked=!0,e({eventName:EK,properties:{referrer:document==null?void 0:document.referrer}}))}function MK(){typeof window>"u"||Gt.sessionStartTime!==null||(Gt.sessionStartTime=new Date().toISOString())}function LK(e){if(typeof window>"u"||Gt.sessionStartTime===null)return;const t=new Date().getTime()-new Date(Gt.sessionStartTime).getTime();Gt.sessionStartTime=null,e({eventName:PK,properties:{sessionDuration:t}})}function DK(){return{timestamp:new Date().toISOString(),pageUrl:typeof window<"u"?window.location.pathname:null}}function $K(e){return t=>({event_name:t.eventName,properties:t.properties,timestamp:t.timestamp,page_url:t.pageUrl,...e})}let W0=null;async function qK(e){if(!Gt.sessionContext){if(!W0){const t=oS();W0=e.me().then(r=>({user_id:r.id,session_id:t})).catch(()=>({user_id:null,session_id:t}))}Gt.sessionContext=await W0}return Gt.sessionContext}function BK(){if(typeof window>"u"||!window.location)return;const t=new URLSearchParams(window.location.search).get(EO);if(t==null||!t.length)return;const r=new URLSearchParams(window.location.search);r.delete(EO);const n=window.location.pathname+(r.toString()?"?"+r.toString():"");return window.history.replaceState({},"",n),{enabled:t==="true"}}function oS(){if(typeof window>"u")return H0();try{const e=localStorage.getItem(PO);if(!e){const t=H0();return localStorage.setItem(PO,t),t}return e}catch{return H0()}}class zK extends Error{constructor(t,r,n,i,s){super(t),this.name="Base44Error",this.status=r,this.code=n,this.data=i,this.originalError=s}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code,data:this.data}}}function Cd({baseURL:e,headers:t={},token:r,interceptResponses:n=!0,onError:i}){const s=br.create({baseURL:e,headers:{"Content-Type":"application/json",Accept:"application/json",...t}});return r&&(s.defaults.headers.common.Authorization=`Bearer ${r}`),s.interceptors.request.use(o=>{typeof window<"u"&&window.location&&(o.headers.set("X-Origin-URL",window.location.href),o.headers.get("Authorization")||o.headers.set("X-Base44-Anonymous-Id",oS()));const l=CK();if(o.requestId=l,FO)try{window.parent.postMessage({type:"api-request-start",requestId:l,data:{url:e+o.url,method:o.method,body:o.data instanceof FormData?"[FormData object]":o.data}},"*")}catch{}return o}),n&&s.interceptors.response.use(o=>{var l;const c=(l=o.config)===null||l===void 0?void 0:l.requestId;try{FO&&c&&window.parent.postMessage({type:"api-request-end",requestId:c,data:{statusCode:o.status,response:o.data}},"*")}catch{}return o.data},o=>{var l,c,f,h,d,m,p,x;const y=((c=(l=o.response)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.message)||((h=(f=o.response)===null||f===void 0?void 0:f.data)===null||h===void 0?void 0:h.detail)||o.message,v=new zK(y,(d=o.response)===null||d===void 0?void 0:d.status,(p=(m=o.response)===null||m===void 0?void 0:m.data)===null||p===void 0?void 0:p.code,(x=o.response)===null||x===void 0?void 0:x.data,o);return i==null||i(v),Promise.reject(v)}),s}function IO(e){const{axios:t,appId:r,getSocket:n}=e;return new Proxy({}
410,{get(i,s){if(!(typeof s!="string"||s==="then"||s.startsWith("_")))return HK(t,r,s,n)}})}function UK(e){var t;try{const r=JSON.parse(e);return{type:r.type,data:r.data,id:r.id||((t=r.data)===null||t===void 0?void 0:t.id),timestamp:r.timestamp||new Date().toISOString()}}catch(r){return console.warn("[Base44 SDK] Failed to parse realtime message:",r),null}}function HK(e,t,r,n){const i=`/apps/${t}/entities/${r}`;return{async list(s,o,l,c){const f={};return s&&(f.sort=s),o&&(f.limit=o),l&&(f.skip=l),c&&(f.fields=Array.isArray(c)?c.join(","):c),e.get(i,{params:f})},async filter(s,o,l,c,f){const h={q:JSON.stringify(s)};return o&&(h.sort=o),l&&(h.limit=l),c&&(h.skip=c),f&&(h.fields=Array.isArray(f)?f.join(","):f),e.get(i,{params:h})},async get(s){return e.get(`${i}/${s}`)},async create(s){return e.post(i,s)},async update(s,o){return e.put(`${i}/${s}`,o)},async delete(s){return e.delete(`${i}/${s}`)},async deleteMany(s){return e.delete(i,{data:s})},async bulkCreate(s){return e.post(`${i}/bulk`,s)},async updateMany(s,o){return e.patch(`${i}/update-many`,{query:s,data:o})},async bulkUpdate(s){return e.put(`${i}/bulk`,s)},async importEntities(s){const o=new FormData;return o.append("file",s,s.name),e.post(`${i}/import`,o,{headers:{"Content-Type":"multipart/form-data"}})},subscribe(s){const o=`entities:${t}:${r}`;return n().subscribeToRoom(o,{update_model:f=>{var h;const d=UK(f.data);if(d){d.type!=="delete"&&(!((h=d.data)===null||h===void 0)&&h._oversize)&&console.error(`[Base44 SDK] Realtime broadcast for ${r}#${d.id} was oversize and got slimmed for transport. Fields >10 KB are empty and the rest of the record may be a stub. Call \`entities.${r}.get("${d.id}")\` to fetch the full record.`);try{s(d)}catch(m){console.error("[Base44 SDK] Subscription callback error:",m)}}}})}}}function VK(e,t){return{async call(r,n,i){if(!(r!=null&&r.trim()))throw new Error("Integration slug is required and cannot be empty");if(!(n!=null&&n.trim()))throw new Error("Operation ID is required and cannot be empty");const{pathParams:s,queryParams:o,...l}=i??{},c={...l,...s&&{path_params:s},...o&&{query_params:o}};return await e.post(`/apps/${t}/integrations/custom/${r}/${n}`,c)}}}function MO(e,t){const r=VK(e,t);return new Proxy({},{get(n,i){if(!(typeof i!="string"||i==="then"||i.startsWith("_")))return i==="custom"?r:new Proxy({},{get(s,o){if(!(typeof o!="string"||o==="then"||o.startsWith("_")))return async l=>{if(typeof l=="string")throw new Error(`Integration ${o} must receive an object with named parameters, received: ${l}`);let c,f;return l instanceof FormData||l&&Object.values(l).some(h=>h instanceof File)?(c=new FormData,Object.keys(l).forEach(h=>{l[h]instanceof File?c.append(h,l[h],l[h].name):typeof l[h]=="object"&&l[h]!==null?c.append(h,JSON.stringify(l[h])):c.append(h,l[h])}),f="multipart/form-data"):(c=l,f="application/json"),i==="Core"?e.post(`/apps/${t}/integration-endpoints/Core/${o}`,c||l,{headers:{"Content-Type":f}}):e.post(`/apps/${t}/integration-endpoints/installable/${i}/integration-endpoints/${o}`,c||l,{headers:{"Content-Type":f}})}}})}})}function WK(){return typeof window>"u"?!1:window!==window.parent}function KK(e,t,r){const s=Math.round(window.screenX+(window.outerWidth-500)/2),o=Math.round(window.screenY+(window.outerHeight-600)/2),l=window.open(e,"base44_auth",`width=500,height=600,left=${s},top=${o},resizable=yes,scrollbars=yes`);if(!l)return;const c=()=>{window.removeEventListener("message",f),clearInterval(h),l.closed||l.close()},f=d=>{var m;if(d.origin!==r||d.source!==l||!(!((m=d.data)===null||m===void 0)&&m.access_token))return;c();const p=new URL(t),{access_token:x,is_new_user:y}=d.data;p.searchParams.set("access_token",x),y!=null&&p.searchParams.set("is_new_user",String(y)),window.location.href=p.toString()},h=setInterval(()=>{l.closed&&c()},500);window.addEventListener("message",f)}function GK(e,t,r,n){return{async me(){return e.get(`/apps/${r}/entities/User/me`)},async updateMe(i){return e.put(`/apps/${r}/entities/User/me`,i)},redirectToLogin(i){if(typeof window>"u")throw new Error("Login method can only be used in a browser environment");const s=i?new URL(i,window.location.origin).toString():window.location.href,o=`${n.appBaseUrl}/login?from_url=${encodeURIComponent(s)}`;window.location.href=o},loginWithProvider(i,s="/"){const o=new URL(s,window.location.origin).toString(),l=`app_id=${r}&from_url=${encodeURIComponent(o)}`;let c;i==="sso"?c=`/apps/${r}/auth/sso/login`:c=`/apps/auth${i==="google"?"":`/${i}`}/login`;const f=`${n.appBaseUrl}/api${c}?${l}`;if(WK()){const h=`${f}&popup_origin=${encodeURIComponent(window.location.origin)}`;return KK(h,o,window.location.origin)}window.location.href=f}
410,logout(i){if(delete e.defaults.headers.common.Authorization,typeof window<"u"){if(window.localStorage)try{window.localStorage.removeItem("base44_access_token"),window.localStorage.removeItem("token")}catch(l){console.error("Failed to remove token from localStorage:",l)}const s=i||window.location.href,o=`${n.appBaseUrl}/api/apps/auth/logout?from_url=${encodeURIComponent(s)}`;window.location.href=o}},setToken(i,s=!0){if(i&&(e.defaults.headers.common.Authorization=`Bearer ${i}`,t.defaults.headers.common.Authorization=`Bearer ${i}`,s&&typeof window<"u"&&window.localStorage))try{window.localStorage.setItem("base44_access_token",i),window.localStorage.setItem("token",i)}catch(o){console.error("Failed to save token to localStorage:",o)}},async loginViaEmailPassword(i,s,o){var l;try{const c=await e.post(`/apps/${r}/auth/login`,{email:i,password:s,...o&&{turnstile_token:o}}),{access_token:f,user:h}=c;return f&&this.setToken(f),{access_token:f,user:h}}catch(c){throw((l=c.response)===null||l===void 0?void 0:l.status)===401&&await this.logout(),c}},async isAuthenticated(){try{return await this.me(),!0}catch{return!1}},inviteUser(i,s){return e.post(`/apps/${r}/users/invite-user`,{user_email:i,role:s})},register(i){return e.post(`/apps/${r}/auth/register`,i)},verifyOtp({email:i,otpCode:s}){return e.post(`/apps/${r}/auth/verify-otp`,{email:i,otp_code:s})},resendOtp(i){return e.post(`/apps/${r}/auth/resend-otp`,{email:i})},resetPasswordRequest(i){return e.post(`/apps/${r}/auth/reset-password-request`,{email:i})},resetPassword({resetToken:i,newPassword:s}){return e.post(`/apps/${r}/auth/reset-password`,{reset_token:i,new_password:s})},changePassword({userId:i,currentPassword:s,newPassword:o}){return e.post(`/apps/${r}/auth/change-password`,{user_id:i,current_password:s,new_password:o})}}}function YK(e,t){return{async getAccessToken(r){const n=`/apps/${t}/auth/sso/accesstoken/${r}`;return e.get(n)},async getIdToken(r){const n=`/apps/${t}/auth/sso/idtoken/${r}`;return e.get(n)}}}function QK(e,t){return{async getAccessToken(r){if(!r||typeof r!="string")throw new Error("Integration type is required and must be a string");return(await e.get(`/apps/${t}/external-auth/tokens/${r}`)).access_token},async getConnection(r){var n;if(!r||typeof r!="string")throw new Error("Integration type is required and must be a string");const s=await e.get(`/apps/${t}/external-auth/tokens/${r}`);return{accessToken:s.access_token,connectionConfig:(n=s.connection_config)!==null&&n!==void 0?n:null}},async getWorkspaceConnection(r){var n;if(!r||typeof r!="string")throw new Error("Connector ID is required and must be a string");const s=await e.get(`/apps/${t}/external-auth/tokens/connectors/${r}`);return{accessToken:s.access_token,connectionConfig:(n=s.connection_config)!==null&&n!==void 0?n:null}},async getCurrentAppUserAccessToken(r){if(!r||typeof r!="string")throw new Error("Connector ID is required and must be a string");return(await e.get(`/apps/${t}/app-user-auth/connectors/${r}/token`)).access_token},async getCurrentAppUserConnection(r){var n;if(!r||typeof r!="string")throw new Error("Connector ID is required and must be a string");const s=await e.get(`/apps/${t}/app-user-auth/connectors/${r}/token`);return{accessToken:s.access_token,connectionConfig:(n=s.connection_config)!==null&&n!==void 0?n:null}}}}function XK(e,t){return{async connectAppUser(r){if(!r||typeof r!="string")throw new Error("Connector ID is required and must be a string");return(await e.post(`/apps/${t}/app-user-auth/connectors/${r}/initiate`)).redirect_url},async disconnectAppUser(r){if(!r||typeof r!="string")throw new Error("Connector ID is required and must be a string");await e.delete(`/apps/${t}/app-user-auth/connectors/${r}`)}}}function Oc(e={}){const{storageKey:t="base44_access_token",paramName:r="access_token",saveToStorage:n=!0,removeFromUrl:i=!0}=e;let s=null;if(typeof window<"u"&&window.location)try{const o=new URLSearchParams(window.location.search);if(s=o.get(r),s){if(n&&ZK(s,{storageKey:t}),i){o.delete(r);const l=`${window.location.pathname}${o.toString()?`?${o.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,l)}return s}}catch(o){console.error("Error retrieving token from URL:",o)}if(typeof window<"u"&&window.localStorage)try{return s=window.localStorage.getItem(t),s}catch(o){console.error("Error retrieving token from local storage:",o)}return null}function ZK(e,t){const{storageKey:r="base44_access_token"}=t;if(typeof window>"u"||!window.localStorage||!e)return!1;try{return window.localStorage.setItem(r,e),window.localStorage.setItem("token",e),!0}catch(n){return console.error("Error saving token to local storage:",n),!1}}function LO(e,t,r){const n=(s,o)=>s?`${String(s).replace(/\/$/,"")}${o}`:o,i=s=>{const o=new Headers;if(r!=null&&r.getAuthHeaders){const l=r.getAuthHeaders();Object.entries(l).forEach(([c,f])=>{f!=null&&o.set(c,String(f))})}
410return s&&new Headers(s).forEach((l,c)=>{o.set(c,l)}),o};return{async invoke(s,o){if(typeof o=="string")throw new Error(`Function ${s} must receive an object with named parameters, received: ${o}`);let l,c;return o instanceof FormData||o&&Object.values(o).some(f=>f instanceof File)?(l=new FormData,Object.keys(o).forEach(f=>{o[f]instanceof File?l.append(f,o[f],o[f].name):typeof o[f]=="object"&&o[f]!==null?l.append(f,JSON.stringify(o[f])):l.append(f,o[f])}),c="multipart/form-data"):(l=o,c="application/json"),e.post(`/apps/${t}/functions/${s}`,l||o,{headers:{"Content-Type":c}})},async fetch(s,o={}){const c=`/functions${s.startsWith("/")?s:`/${s}`}`,f=i(o.headers),h={...o,headers:f};return await fetch(n(r==null?void 0:r.baseURL,c),h)}}}function DO({axios:e,getSocket:t,appId:r,serverUrl:n,token:i}){const s=`/apps/${r}/agents`,o={},l=()=>e.get(`${s}/conversations`),c=y=>e.get(`${s}/conversations/${y}`);return{getConversations:l,getConversation:c,listConversations:y=>e.get(`${s}/conversations`,{params:y}),createConversation:y=>e.post(`${s}/conversations`,y),addMessage:async(y,v)=>e.post(`${s}/conversations/v2/${y.id}/messages`,v),subscribeToConversation:(y,v)=>{const b=`/agent-conversations/${y}`,w=t(),_=c(y).then(N=>(o[y]=N,N));return w.subscribeToRoom(b,{connect:()=>{},update_model:async({data:N})=>{const S=JSON.parse(N);if(S._message){await _;const k=S._message,C=o[y];if(C){const O=C.messages||[],R=O.findIndex(P=>P.id===k.id),A=R!==-1?O.map((P,E)=>E===R?k:P):[...O,k];o[y]={...C,messages:A},v==null||v(o[y])}}}})},getWhatsAppConnectURL:y=>{const v=`${n}/api/apps/${r}/agents/${encodeURIComponent(y)}/whatsapp`,b=i??Oc();return b?`${v}?token=${b}`:v},getTelegramConnectURL:y=>{const v=`${n}/api/apps/${r}/agents/${encodeURIComponent(y)}/telegram`,b=i??Oc();return b?`${v}?token=${b}`:v}}}function $O({serverUrl:e,token:t,appId:r}){return{connection:()=>{var i;return{baseURL:`${e}/api/apps/${r}/ai/openai/v1`,token:(i=t??Oc())!==null&&i!==void 0?i:""}}}}function qO(e,t){const r=`/app-logs/${t}`;return{async logUserInApp(n){await e.post(`${r}/log-user-in-app/${n}`)},async fetchLogs(n={}){return await e.get(r,{params:n})},async getStats(n={}){return await e.get(`${r}/stats`,{params:n})}}}function JK(e,t){return{async inviteUser(r,n){if(n!=="user"&&n!=="admin")throw new Error(`Invalid role: "${n}". Role must be either "user" or "admin".`);return await e.post(`/apps/${t}/runtime/users/invite-user`,{user_email:r,role:n})}}}const ci=Object.create(null);ci.open="0";ci.close="1";ci.ping="2";ci.pong="3";ci.message="4";ci.upgrade="5";ci.noop="6";const lp=Object.create(null);
vendor: 5,237 bytes, line 410
410Object.keys(ci).forEach(e=>{lp[ci[e]]=e});const Yj={type:"error",data:"parser error"},HD=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",VD=typeof ArrayBuffer=="function",WD=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,lS=({type:e,data:t},r,n)=>HD&&t instanceof Blob?r?n(t):BO(t,n):VD&&(t instanceof ArrayBuffer||WD(t))?r?n(t):BO(new Blob([t]),n):n(ci[e]+(t||"")),BO=(e,t)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];t("b"+(n||""))},r.readAsDataURL(e)};function zO(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let K0;function eG(e,t){if(HD&&e.data instanceof Blob)return e.data.arrayBuffer().then(zO).then(t);if(VD&&(e.data instanceof ArrayBuffer||WD(e.data)))return t(zO(e.data));lS(e,!1,r=>{K0||(K0=new TextEncoder),t(K0.encode(r))})}const UO="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<UO.length;e++)Fd[UO.charCodeAt(e)]=e;const tG=e=>{let t=e.length*.75,r=e.length,n,i=0,s,o,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),h=new Uint8Array(f);for(n=0;n<r;n+=4)s=Fd[e.charCodeAt(n)],o=Fd[e.charCodeAt(n+1)],l=Fd[e.charCodeAt(n+2)],c=Fd[e.charCodeAt(n+3)],h[i++]=s<<2|o>>4,h[i++]=(o&15)<<4|l>>2,h[i++]=(l&3)<<6|c&63;return f},rG=typeof ArrayBuffer=="function",cS=(e,t)=>{if(typeof e!="string")return{type:"message",data:KD(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:nG(e.substring(1),t)}:lp[r]?e.length>1?{type:lp[r],data:e.substring(1)}:{type:lp[r]}:Yj},nG=(e,t)=>{if(rG){const r=tG(e);return KD(r,t)}else return{base64:!0,data:e}},KD=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},GD="�",aG=(e,t)=>{const r=e.length,n=new Array(r);let i=0;e.forEach((s,o)=>{lS(s,!1,l=>{n[o]=l,++i===r&&t(n.join(GD))})})},iG=(e,t)=>{const r=e.split(GD),n=[];for(let i=0;i<r.length;i++){const s=cS(r[i],t);if(n.push(s),s.type==="error")break}return n};function sG(){return new TransformStream({transform(e,t){eG(e,r=>{const n=r.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(r)})}})}let G0;function Om(e){return e.reduce((t,r)=>t+r.length,0)}function Em(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let i=0;i<t;i++)r[i]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function oG(e,t){G0||(G0=new TextDecoder);const r=[];let n=0,i=-1,s=!1;return new TransformStream({transform(o,l){for(r.push(o);;){if(n===0){if(Om(r)<1)break;const c=Em(r,1);s=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(Om(r)<2)break;const c=Em(r,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(Om(r)<8)break;const c=Em(r,8),f=new DataView(c.buffer,c.byteOffset,c.length),h=f.getUint32(0);if(h>Math.pow(2,21)-1){l.enqueue(Yj);break}i=h*Math.pow(2,32)+f.getUint32(4),n=3}else{if(Om(r)<i)break;const c=Em(r,i);l.enqueue(cS(s?c:G0.decode(c),t)),n=0}if(i===0||i>e){l.enqueue(Yj);break}}}})}const YD=4;function Nr(e){if(e)return lG(e)}function lG(e){for(var t in Nr.prototype)e[t]=Nr.prototype[t];return e}Nr.prototype.on=Nr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Nr.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};Nr.prototype.off=Nr.prototype.removeListener=Nr.prototype.removeAllListeners=Nr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var n,i=0;i<r.length;i++)if(n=r[i],n===t||n.fn===t){r.splice(i,1);break}return r.length===0&&delete this._callbacks["$"+e],this};Nr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,i=r.length;n<i;++n)r[n].apply(this,t)}return this};Nr.prototype.emitReserved=Nr.prototype.emit;Nr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Nr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Vg=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,r)=>r(t,0),fa=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),cG="arraybuffer";function QD(e,...t){return t.reduce((r,n)=>(e.hasOwnProperty(n)&&(r[n]=e[n]),r),{})}const uG=fa.setTimeout,dG=fa.clearTimeout;
vendor: 4,677 bytes, line 410
410function Wg(e,t){t.useNativeTimers?(e.setTimeoutFn=uG.bind(fa),e.clearTimeoutFn=dG.bind(fa)):(e.setTimeoutFn=fa.setTimeout.bind(fa),e.clearTimeoutFn=fa.clearTimeout.bind(fa))}const fG=1.33;function hG(e){return typeof e=="string"?mG(e):Math.ceil((e.byteLength||e.size)*fG)}function mG(e){let t=0,r=0;for(let n=0,i=e.length;n<i;n++)t=e.charCodeAt(n),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}function XD(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function pG(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function gG(e){let t={},r=e.split("&");for(let n=0,i=r.length;n<i;n++){let s=r[n].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class yG extends Error{constructor(t,r,n){super(t),this.description=r,this.context=n,this.type="TransportError"}}class uS extends Nr{constructor(t){super(),this.writable=!1,Wg(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,r,n){return super.emitReserved("error",new yG(t,r,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const r=cS(t,this.socket.binaryType);this.onPacket(r)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,r={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const r=pG(t);return r.length?"?"+r:""}}class vG extends uS{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const r=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};iG(t,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,aG(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=XD()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let ZD=!1;try{ZD=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const xG=ZD;function bG(){}class wG extends vG{constructor(t){if(super(t),typeof location<"u"){const r=location.protocol==="https:";let n=location.port;n||(n=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||n!==t.port}}doWrite(t,r){const n=this.request({method:"POST",data:t});n.on("success",r),n.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=t}}class ni extends Nr{constructor(t,r,n){super(),this.createRequest=t,Wg(this,n),this._opts=n,this._method=n.method||"GET",this._uri=r,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var t;const r=QD(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(r);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(n),"withCredentials"in n&&
vendor: 12,660 bytes, line 410
410(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=ni.requestsCount++,ni.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=bG,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ni.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ni.requestsCount=0;ni.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",HO);else if(typeof addEventListener=="function"){const e="onpagehide"in fa?"pagehide":"unload";addEventListener(e,HO,!1)}}function HO(){for(let e in ni.requests)ni.requests.hasOwnProperty(e)&&ni.requests[e].abort()}const _G=(function(){const e=JD({xdomain:!1});return e&&e.responseType!==null})();class jG extends wG{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=_G&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ni(JD,this.uri(),t)}}function JD(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||xG))return new XMLHttpRequest}catch{}if(!t)try{return new fa[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const e3=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class NG extends uS{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,n=e3?{}:QD(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,r,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let r=0;r<t.length;r++){const n=t[r],i=r===t.length-1;lS(n,this.supportsBinary,s=>{try{this.doWrite(n,s)}catch{}i&&Vg(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=XD()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const Y0=fa.WebSocket||fa.MozWebSocket;class SG extends NG{createSocket(t,r,n){return e3?new Y0(t,r,n):r?new Y0(t,r):new Y0(t)}doWrite(t,r){this.ws.send(r)}}class kG extends uS{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const r=oG(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(r).getReader(),i=sG();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{n.read().then(({done:l,value:c})=>{l||(this.onPacket(c),s())}).catch(l=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let r=0;r<t.length;r++){const n=t[r],i=r===t.length-1;this._writer.write(n).then(()=>{i&&Vg(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const CG={websocket:SG,webtransport:kG,polling:jG},FG=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,OG=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Qj(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");r!=-1&&n!=-1&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let i=FG.exec(e||""),s={},o=14;for(;o--;)s[OG[o]]=i[o]||"";return r!=-1&&n!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=EG(s,s.path),s.queryKey=PG(s,s.query),s}function EG(e,t){const r=/\/{2,9}/g,n=t.replace(r,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&n.splice(0,1),t.slice(-1)=="/"&&n.splice(n.length-1,1),n}function PG(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,s){i&&(r[i]=s)}),r}const Xj=typeof addEventListener=="function"&&typeof removeEventListener=="function",cp=[];Xj&&addEventListener("offline",()=>{cp.forEach(e=>e())},!1);class zs extends Nr{constructor(t,r){if(super(),this.binaryType=cG,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const n=Qj(t);r.hostname=n.host,r.secure=n.protocol==="https"||n.protocol==="wss",r.port=n.port,n.query&&(r.query=n.query)}else r.host&&(r.hostname=Qj(r.host).host);Wg(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=gG(this.opts.query)),Xj&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},cp.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=YD,r.transport=t,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&zs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",zs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n<this.writeBuffer.length;n++){const i=this.writeBuffer[n].data;if(i&&(r+=hG(i)),n>0&&r>this._maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Vg(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,n){return this._sendPacket("message",t,r,n),this}send(t,r,n){return this._sendPacket("message",t,r,n),this}_sendPacket(t,r,n,i){if(typeof r=="function"&&(i=r,r=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const s={type:t,data:r,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():t()}):this.upgrading?n():t()),this}_onError(t){if(zs.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Xj&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=cp.indexOf(this._offlineEventListener);n!==-1&&cp.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}zs.protocol=YD;class TG extends zs{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let r=this.createTransport(t),n=!1;zs.priorWebsocketSuccess=!1;const i=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",d=>{if(!n)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;zs.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(h(),this.setTransport(r),r.send([{type:"upgrade"}
vendor: 14,402 bytes, line 410
410]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=r.name,this.emitReserved("upgradeError",m)}}))};function s(){n||(n=!0,h(),r.close(),r=null)}const o=d=>{const m=new Error("probe error: "+d);m.transport=r.name,s(),this.emitReserved("upgradeError",m)};function l(){o("transport closed")}function c(){o("socket closed")}function f(d){r&&d.name!==r.name&&s()}const h=()=>{r.removeListener("open",i),r.removeListener("error",o),r.removeListener("close",l),this.off("close",c),this.off("upgrading",f)};r.once("open",i),r.once("error",o),r.once("close",l),this.once("close",c),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const r=[];for(let n=0;n<t.length;n++)~this.transports.indexOf(t[n])&&r.push(t[n]);return r}}let AG=class extends TG{constructor(t,r={}){const n=typeof t=="object"?t:r;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(i=>CG[i]).filter(i=>!!i)),super(t,n)}};function RG(e,t="",r){let n=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),n=Qj(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const s=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+t,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}const IG=typeof ArrayBuffer=="function",MG=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,t3=Object.prototype.toString,LG=typeof Blob=="function"||typeof Blob<"u"&&t3.call(Blob)==="[object BlobConstructor]",DG=typeof File=="function"||typeof File<"u"&&t3.call(File)==="[object FileConstructor]";function dS(e){return IG&&(e instanceof ArrayBuffer||MG(e))||LG&&e instanceof Blob||DG&&e instanceof File}function up(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,n=e.length;r<n;r++)if(up(e[r]))return!0;return!1}if(dS(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return up(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&up(e[r]))return!0;return!1}function $G(e){const t=[],r=e.data,n=e;return n.data=Zj(r,t),n.attachments=t.length,{packet:n,buffers:t}}function Zj(e,t){if(!e)return e;if(dS(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=Zj(e[n],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=Zj(e[n],t));return r}return e}function qG(e,t){return e.data=Jj(e.data,t),delete e.attachments,e}function Jj(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=Jj(e[r],t);else if(typeof e=="object")for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=Jj(e[r],t));return e}const r3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],BG=5;var jt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(jt||(jt={}));class zG{constructor(t){this.replacer=t}encode(t){return(t.type===jt.EVENT||t.type===jt.ACK)&&up(t)?this.encodeAsBinary({type:t.type===jt.EVENT?jt.BINARY_EVENT:jt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let r=""+t.type;return(t.type===jt.BINARY_EVENT||t.type===jt.BINARY_ACK)&&(r+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(r+=t.nsp+","),t.id!=null&&(r+=t.id),t.data!=null&&(r+=JSON.stringify(t.data,this.replacer)),r}encodeAsBinary(t){const r=$G(t),n=this.encodeAsString(r.packet),i=r.buffers;return i.unshift(n),i}}class fS extends Nr{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let r;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(t);const n=r.type===jt.BINARY_EVENT;n||r.type===jt.BINARY_ACK?(r.type=n?jt.EVENT:jt.ACK,this.reconstructor=new UG(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(dS(t)||t.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(t),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let r=0;const n={type:Number(t.charAt(0))};if(jt[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===jt.BINARY_EVENT||n.type===jt.BINARY_ACK){const s=r+1;for(;t.charAt(++r)!=="-"&&r!=t.length;);const o=t.substring(s,r);if(o!=Number(o)||t.charAt(r)!=="-")throw new Error("Illegal attachments");const l=Number(o);if(!n3(l)||l<0)throw new Error("Illegal attachments");if(l>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=l}if(t.charAt(r+1)==="/"){const s=r+1;for(;++r&&!(t.charAt(r)===","||r===t.length););n.nsp=t.substring(s,r)}else n.nsp="/";const i=t.charAt(r+1);if(i!==""&&Number(i)==i){const s=r+1;for(;++r;){const o=t.charAt(r);if(o==null||Number(o)!=o){--r;break}if(r===t.length)break}n.id=Number(t.substring(s,r+1))}if(t.charAt(++r)){const s=this.tryParse(t.substr(r));if(fS.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return n}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,r){switch(t){case jt.CONNECT:return Fp(r);case jt.DISCONNECT:return r===void 0;case jt.CONNECT_ERROR:return typeof r=="string"||Fp(r);case jt.EVENT:case jt.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&r3.indexOf(r[0])===-1);case jt.ACK:case jt.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class UG{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const r=qG(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function HG(e){return typeof e=="string"}const n3=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function VG(e){return e===void 0||n3(e)}function Fp(e){return Object.prototype.toString.call(e)==="[object Object]"}function WG(e,t){switch(e){case jt.CONNECT:return t===void 0||Fp(t);case jt.DISCONNECT:return t===void 0;case jt.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&r3.indexOf(t[0])===-1);case jt.ACK:return Array.isArray(t);case jt.CONNECT_ERROR:return typeof t=="string"||Fp(t);default:return!1}}function KG(e){return HG(e.nsp)&&VG(e.id)&&WG(e.type,e.data)}const GG=Object.freeze(Object.defineProperty({__proto__:null,Decoder:fS,Encoder:zG,get PacketType(){return jt},isPacketValid:KG,protocol:BG},Symbol.toStringTag,{value:"Module"}));function Ea(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const YG=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class a3 extends Nr{constructor(t,r,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=r,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ea(t,"open",this.onopen.bind(this)),Ea(t,"packet",this.onpacket.bind(this)),Ea(t,"error",this.onerror.bind(this)),Ea(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...r){var n,i,s;if(YG.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(r.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const o={type:jt.EVENT,data:r};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const h=this.ids++,d=r.pop();this._registerAckCallback(h,d),o.id=h}const l=(i=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!l||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,r){var n;const i=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(i===void 0){this.acks[t]=r;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);r.call(this,new Error("operation has timed out"))},i),o=(...l)=>{this.io.clearTimeoutFn(s),r.apply(this,l)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...r){return new Promise((n,i)=>{const s=(o,l)=>o?i(o):n(l);s.withError=!0,r.push(s),this.emit(t,...r)})}_addToQueue(t){let r;typeof t[t.length-1]=="function"&&(r=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>(this._queue[0],i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(i)):(this._queue.shift(),r&&r(null,...s)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!t||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:jt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(n=>String(n.id)===t)){const n=this.acks[t];delete this.acks[t],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case jt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case jt.EVENT:case jt.BINARY_EVENT:this.onevent(t);break;case jt.ACK:case jt.BINARY_ACK:this.onack(t);break;case jt.DISCONNECT:this.ondisconnect();break;case jt.CONNECT_ERROR:this.destroy();const n=new Error(t.data.message);n.data=t.data.data,this.emitReserved("connect_error",n);break}}onevent(t){const r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const r=this;let n=!1;return function(...i){n||(n=!0,r.packet({type:jt.ACK,id:t,data:i}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(delete this.acks[t.id],r.withError&&t.data.unshift(null),r.apply(this,t.data))}onconnect(t,r){this.id=t,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:jt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const r=this._anyListeners;for(let n=0;n<r.length;n++)if(t===r[n])return r.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const r=this._anyOutgoingListeners;for(let n=0;n<r.length;n++)if(t===r[n])return r.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const n of r)n.apply(this,t.data)}}}function lu(e){e=e||{}
vendor: 4,379 bytes, line 410
410,this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}lu.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};lu.prototype.reset=function(){this.attempts=0};lu.prototype.setMin=function(e){this.ms=e};lu.prototype.setMax=function(e){this.max=e};lu.prototype.setJitter=function(e){this.jitter=e};class e1 extends Nr{constructor(t,r){var n;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,Wg(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new lu({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const i=r.parser||GG;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new AG(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=Ea(r,"open",function(){n.onopen(),t&&t()}),s=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},o=Ea(r,"error",s);if(this._timeout!==!1){const l=this._timeout,c=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),r.close()},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ea(t,"ping",this.onping.bind(this)),Ea(t,"data",this.ondata.bind(this)),Ea(t,"error",this.onerror.bind(this)),Ea(t,"close",this.onclose.bind(this)),Ea(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(r){this.onclose("parse error",r)}}ondecoded(t){Vg(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,r){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new a3(this,t,r),this.nsps[t]=n),n}_destroy(t){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(t){const r=this.encoder.encode(t);for(let n=0;n<r.length;n++)this.engine.write(r[n],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,r){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>
410{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const ld={};function dp(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=RG(e,t.path||"/socket.io"),n=r.source,i=r.id,s=r.path,o=ld[i]&&s in ld[i].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return l?c=new e1(n,t):(ld[i]||(ld[i]=new e1(n,t)),c=ld[i]),r.query&&!t.query&&(t.query=r.queryKey),c.socket(r.path,t)}Object.assign(dp,{Manager:e1,Socket:a3,io:dp,connect:dp});const QG=250;function VO(e,t){var r;const n=(r=e.token)!==null&&r!==void 0?r:Oc(),i={app_id:e.appId,token:n};n||(i.anonymous_id=oS());const s=dp(e.serverUrl,{path:e.mountPath,transports:e.transports,query:i});return s.on("connect",async()=>{var o;return console.log("connect",s.id),(o=t.connect)===null||o===void 0?void 0:o.call(t)}),s.on("update_model",async o=>{var l;return(l=t.update_model)===null||l===void 0?void 0:l.call(t,o)}),s.on("error",async o=>{var l;return(l=t.error)===null||l===void 0?void 0:l.call(t,o)}),s.on("connect_error",async o=>{var l;return console.error("connect_error",o),(l=t.error)===null||l===void 0?void 0:l.call(t,o)}),s}function XG({config:e}){let t={...e};const r={},n={},i={connect:async()=>{const b=[];Object.keys(r).forEach(w=>{const _=m(w);_.length!==0&&(f(w),_.forEach(({connect:N})=>{const S=async()=>N==null?void 0:N();b.push(S())}))}),await Promise.all(b)},update_model:async b=>{const _=m(b.room).map(N=>{var S;return(S=N.update_model)===null||S===void 0?void 0:S.call(N,b)});await Promise.all(_)},error:async b=>{console.error("error",b);const w=Object.values(r).flat().map(_=>{var N;return(N=_.error)===null||N===void 0?void 0:N.call(_,b)});await Promise.all(w)}};let s=VO(e,i);function o(){l()}function l(){x(),s&&s.disconnect()}function c(b){o(),t={...t,...b},s=VO(t,i)}function f(b){s.emit("join",b)}function h(b){s.emit("leave",b)}async function d(b,w){var _;const N=JSON.stringify(w);return(_=i.update_model)===null||_===void 0?void 0:_.call(i,{room:b,data:N})}function m(b){var w;return(w=r[b])!==null&&w!==void 0?w:[]}function p(b){const w=n[b];w&&(clearTimeout(w),delete n[b])}function x(){Object.keys(n).forEach(b=>{var w,_;clearTimeout(n[b]),delete n[b],((_=(w=r[b])===null||w===void 0?void 0:w.length)!==null&&_!==void 0?_:0)===0&&delete r[b]})}function y(b){p(b),n[b]=setTimeout(()=>{var w,_;delete n[b],!(((_=(w=r[b])===null||w===void 0?void 0:w.length)!==null&&_!==void 0?_:0)>0)&&(h(b),delete r[b])},QG)}return{socket:s,subscribeToRoom:(b,w)=>{r[b]?p(b):(f(b),r[b]=[]),r[b].push(w);let _=!1;return()=>{var N,S;_||(_=!0,r[b]=(S=(N=r[b])===null||N===void 0?void 0:N.filter(k=>k!==w))!==null&&S!==void 0?S:[],r[b].length===0&&y(b))}},updateConfig:c,updateModel:d,disconnect:l}}function ZG(e){var t,r;const{serverUrl:n="https://base44.app",appId:i,token:s,serviceToken:o,requiresAuth:l=!1,appBaseUrl:c,options:f,functionsVersion:h,headers:d}=e,m=typeof c=="string"?c:"",p={serverUrl:n,mountPath:"/ws-user-apps/socket.io/",transports:["websocket"],appId:i,token:s};let x=null;const y=()=>(x||(x=XG({config:p})),x),v={...d,"X-App-Id":String(i)},b=h?{...v,"Base44-Functions-Version":h}:v,w=Cd({baseURL:`${n}/api`,headers:v,token:s,onError:f==null?void 0:f.onError}),_=Cd({baseURL:`${n}/api`,headers:b,token:s,interceptResponses:!1,onError:f==null?void 0:f.onError}),N={...v,...s?{"on-behalf-of":`Bearer ${s}`}:{}},S=Cd({baseURL:`${n}/api`,headers:N,token:o,onError:f==null?void 0:f.onError}),k=Cd({baseURL:`${n}/api`,headers:b,token:o,interceptResponses:!1}),C=GK(w,_,i,{appBaseUrl:m});if(typeof window<"u"){const P=s||Oc();P&&C.setToken(P)}const O={entities:IO({axios:w,appId:i,getSocket:y}),integrations:MO(w,i),connectors:XK(w,i),auth:C,functions:LO(_,i,{getAuthHeaders:()=>{const P={},E=s||Oc();return E&&(P.Authorization=`Bearer ${E}`),P},baseURL:(t=_.defaults)===null||t===void 0?void 0:t.baseURL}),agents:DO({axios:w,getSocket:y,appId:i,serverUrl:n,token:s}
410),aiGateway:$O({serverUrl:n,token:s,appId:i}),appLogs:qO(w,i),users:JK(w,i),analytics:RK({axiosClient:w,serverUrl:n,appId:i,userAuthModule:C}),cleanup:()=>{O.analytics.cleanup(),x&&x.disconnect()}},R={entities:IO({axios:S,appId:i,getSocket:y}),integrations:MO(S,i),sso:YK(S,i),connectors:QK(S,i),functions:LO(k,i,{getAuthHeaders:()=>{const P={};return o&&(P.Authorization=`Bearer ${o}`),P},baseURL:(r=k.defaults)===null||r===void 0?void 0:r.baseURL}),agents:DO({axios:S,getSocket:y,appId:i,serverUrl:n,token:s}),aiGateway:$O({serverUrl:n,token:o,appId:i}),appLogs:qO(S,i),cleanup:()=>{x&&x.disconnect()}};return l&&typeof window<"u"&&setTimeout(async()=>{try{await O.auth.isAuthenticated()||O.auth.redirectToLogin(window.location.href)}catch(P){console.error("Authentication check failed:",P),O.auth.redirectToLogin(window.location.href)}},0),{...O,setToken(P){O.auth.setToken(P),x&&x.updateConfig({token:P}),p.token=P},getConfig(){return{serverUrl:n,appId:i,requiresAuth:l}},get asServiceRole(){if(!o)throw new Error("Service token is required to use asServiceRole. Please provide a serviceToken when creating the client.");return R}}}const i3=typeof window>"u",JG=i3?{localStorage:new Map}:window,Q0=JG.localStorage,eY=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase(),cd=(e,{defaultValue:t=void 0,removeFromUrl:r=!1}={})=>{if(i3)return t;const n=`base44_${eY(e)}`,i=new URLSearchParams(window.location.search),s=i.get(e);if(r){i.delete(e);const l=`${window.location.pathname}${i.toString()?`?${i.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,l)}if(s)return Q0.setItem(n,s),s;if(t)return Q0.setItem(n,t),t;const o=Q0.getItem(n);return o||null},tY=()=>({appId:cd("app_id",{defaultValue:"69217c6ce83860adf5aef38d"}),serverUrl:cd("server_url",{defaultValue:"https://base44.app"}),token:cd("access_token",{removeFromUrl:!0}),fromUrl:cd("from_url",{defaultValue:window.location.href}),functionsVersion:cd("functions_version")}),ec={...tY()},{appId:rY,serverUrl:nY,token:aY,functionsVersion:iY}=ec,ee=ZG({appId:rY,serverUrl:nY,token:aY,functionsVersion:iY,requiresAuth:!1}),s3=I.createContext(),sY=({children:e})=>{const[t,r]=I.useState(null),[n,i]=I.useState(!1),[s,o]=I.useState(!0),[l,c]=I.useState(!0),[f,h]=I.useState(null),[d,m]=I.useState(null);I.useEffect(()=>{p()},[]);const p=async()=>{var b,w;try{c(!0),h(null);const _=Cd({baseURL:`${ec.serverUrl}/api/apps/public`,headers:{"X-App-Id":ec.appId},token:ec.token,interceptResponses:!0});try{const N=await _.get(`/prod/public-settings/by-id/${ec.appId}`);m(N),ec.token?await x():(o(!1),i(!1)),c(!1)}catch(N){if(console.error("App state check failed:",N),N.status===403&&((w=(b=N.data)==null?void 0:b.extra_data)!=null&&w.reason)){const S=N.data.extra_data.reason;h(S==="auth_required"?{type:"auth_required",message:"Authentication required"}:S==="user_not_registered"?{type:"user_not_registered",message:"User not registered for this app"}:{type:S,message:N.message})}else h({type:"unknown",message:N.message||"Failed to load app"});c(!1),o(!1)}}catch(_){console.error("Unexpected error:",_),h({type:"unknown",message:_.message||"An unexpected error occurred"}),c(!1),o(!1)}},x=async()=>{try{o(!0);const b=await ee.auth.me();r(b),i(!0),o(!1)}catch(b){console.error("User auth check failed:",b),o(!1),i(!1),(b.status===401||b.status===403)&&h({type:"auth_required",message:"Authentication required"})}},y=(b=!0)=>{r(null),i(!1),b?ee.auth.logout(window.location.href):ee.auth.logout()},v=()=>{ee.auth.redirectToLogin(window.location.href)};return a.jsx(s3.Provider,{value:{user:t,isAuthenticated:n,isLoadingAuth:s,isLoadingPublicSettings:l,authError:f,appPublicSettings:d,logout:y,navigateToLogin:v,checkAppState:p},children:e})},o3=()=>{const e=I.useContext(s3);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},ne=I.forwardRef(({className:e,type:t,...r},n)=>a.jsx("input",{type:t,className:Vt("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors 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-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));
410ne.displayName="Input";function WO(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function l3(...e){return t=>{let r=!1;const n=e.map(i=>{const s=WO(i,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){const s=n[i];typeof s=="function"?s():WO(e[i],null)}}}}function Ir(...e){return I.useCallback(l3(...e),e)}function Qd(e){const t=lY(e),r=I.forwardRef((n,i)=>{const{children:s,...o}=n,l=I.Children.toArray(s),c=l.find(uY);if(c){const f=c.props.children,h=l.map(d=>d===c?I.Children.count(f)>1?I.Children.only(null):I.isValidElement(f)?f.props.children:null:d);return a.jsx(t,{...o,ref:i,children:I.isValidElement(f)?I.cloneElement(f,void 0,h):null})}return a.jsx(t,{...o,ref:i,children:s})});return r.displayName=`${e}.Slot`,r}var oY=Qd("Slot");function lY(e){const t=I.forwardRef((r,n)=>{const{children:i,...s}=r;if(I.isValidElement(i)){const o=fY(i),l=dY(s,i.props);return i.type!==I.Fragment&&(l.ref=n?l3(n,o):o),I.cloneElement(i,l)}return I.Children.count(i)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cY=Symbol("radix.slottable");function uY(e){return I.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cY}function dY(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...l)=>{const c=s(...l);return i(...l),c}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function fY(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const hY=Dg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring 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 shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),te=I.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},s)=>{const o=n?oY:"button";return a.jsx(o,{className:Vt(hY({variant:t,size:r,className:e})),ref:s,...i})});te.displayName="Button";function Ur(e){return"/"+e.toLowerCase().replace(/ /g,"-")}function Kg({children:e,requiredRole:t="admin"}){const[r,n]=I.useState(null),[i,s]=I.useState(!0),[o,l]=I.useState(!1);I.useEffect(()=>{c()},[]);const c=async()=>{try{const f=await ee.auth.me();n(f);const h=f.system_role||f.role;l(t==="admin"?h==="admin":!0),h!=="admin"&&t==="admin"&&setTimeout(()=>{window.location.href=Ur("PublicRegistration")},3e3)}catch(f){console.error("權限檢查失敗:",f),l(!1),setTimeout(()=>{ee.auth.redirectToLogin()},2e3)}finally{s(!1)}};return i?a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-black",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"w-16 h-16 border-4 border-[#00FFFF] border-t-transparent rounded-full animate-spin mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400",children:"驗證權限中..."})]})}):o?a.jsx(a.Fragment,{children:e}):a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-black",children:a.jsxs("div",{className:"max-w-md w-full cyber-bg cyber-border rounded-lg p-8 text-center",children:[a.jsx(AU,{className:"w-20 h-20 text-red-500 mx-auto mb-4"}),a.jsx("h1",{className:"text-3xl font-bold text-red-500 mb-4",children:"403 - 存取被拒"}),a.jsx("p",{className:"text-gray-300 mb-2",children:"您沒有權限存取此頁面"}),a.jsx("p",{className:"text-sm text-gray-500 mb-6",children:"此功能僅限系統管理者使用"}),a.jsxs("div",{className:"flex items-center justify-center gap-2 text-[#00FFFF] mb-4",children:[a.jsx(oi,{className:"w-5 h-5"}),a.jsx("span",{children:"3 秒後自動返回..."})]}),r&&a.jsxs("div",{className:"text-xs text-gray-600 mt-4 p-3 bg-gray-900 rounded border border-gray-800",children:[a.jsxs("p",{children:["當前用戶:",r.full_name]}),a.jsxs("p",{children:["權限等級:",r.system_role||r.role||"一般使用者"]})]})]})})}var X0,KO;function Tn(){if(KO)return X0;KO=1;var e=Array.isArray;return X0=e,X0}var Z0,GO;
vendor: 4,532 bytes, line 410
410function c3(){if(GO)return Z0;GO=1;var e=typeof _m=="object"&&_m&&_m.Object===Object&&_m;return Z0=e,Z0}var J0,YO;function gi(){if(YO)return J0;YO=1;var e=c3(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return J0=r,J0}var ex,QO;function Xf(){if(QO)return ex;QO=1;var e=gi(),t=e.Symbol;return ex=t,ex}var tx,XO;function mY(){if(XO)return tx;XO=1;var e=Xf(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function s(o){var l=r.call(o,i),c=o[i];try{o[i]=void 0;var f=!0}catch{}var h=n.call(o);return f&&(l?o[i]=c:delete o[i]),h}return tx=s,tx}var rx,ZO;function pY(){if(ZO)return rx;ZO=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return rx=r,rx}var nx,JO;function Zi(){if(JO)return nx;JO=1;var e=Xf(),t=mY(),r=pY(),n="[object Null]",i="[object Undefined]",s=e?e.toStringTag:void 0;function o(l){return l==null?l===void 0?i:n:s&&s in Object(l)?t(l):r(l)}return nx=o,nx}var ax,eE;function Ji(){if(eE)return ax;eE=1;function e(t){return t!=null&&typeof t=="object"}return ax=e,ax}var ix,tE;function cu(){if(tE)return ix;tE=1;var e=Zi(),t=Ji(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return ix=n,ix}var sx,rE;function hS(){if(rE)return sx;rE=1;var e=Tn(),t=cu(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(s,o){if(e(s))return!1;var l=typeof s;return l=="number"||l=="symbol"||l=="boolean"||s==null||t(s)?!0:n.test(s)||!r.test(s)||o!=null&&s in Object(o)}return sx=i,sx}var ox,nE;function Ys(){if(nE)return ox;nE=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return ox=e,ox}var lx,aE;function mS(){if(aE)return lx;aE=1;var e=Zi(),t=Ys(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function o(l){if(!t(l))return!1;var c=e(l);return c==n||c==i||c==r||c==s}return lx=o,lx}var cx,iE;function gY(){if(iE)return cx;iE=1;var e=gi(),t=e["__core-js_shared__"];return cx=t,cx}var ux,sE;function yY(){if(sE)return ux;sE=1;var e=gY(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return ux=r,ux}var dx,oE;function u3(){if(oE)return dx;oE=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return dx=r,dx}var fx,lE;function vY(){if(lE)return fx;lE=1;var e=mS(),t=yY(),r=Ys(),n=u3(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,c=o.toString,f=l.hasOwnProperty,h=RegExp("^"+c.call(f).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(m){if(!r(m)||t(m))return!1;var p=e(m)?h:s;return p.test(n(m))}return fx=d,fx}var hx,cE;function xY(){if(cE)return hx;cE=1;function e(t,r){return t==null?void 0:t[r]}return hx=e,hx}var mx,uE;function ul(){if(uE)return mx;uE=1;var e=vY(),t=xY();function r(n,i){var s=t(n,i);return e(s)?s:void 0}return mx=r,mx}var px,dE;function Gg(){if(dE)return px;dE=1;var e=ul(),t=e(Object,"create");return px=t,px}var gx,fE;function bY(){if(fE)return gx;fE=1;var e=Gg();function t(){this.__data__=e?e(null):{},this.size=0}return gx=t,gx}var yx,hE;function wY(){if(hE)return yx;hE=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return yx=e,yx}var vx,mE;function _Y(){if(mE)return vx;mE=1;var e=Gg(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(s){var o=this.__data__;if(e){var l=o[s];return l===t?void 0:l}return n.call(o,s)?o[s]:void 0}return vx=i,vx}var xx,pE;function jY(){if(pE)return xx;pE=1;var e=Gg(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var s=this.__data__;return e?s[i]!==void 0:r.call(s,i)}return xx=n,xx}var bx,gE;function NY(){if(gE)return bx;gE=1;var e=Gg(),t="__lodash_hash_undefined__";function r(n,i){var s=this.__data__;return this.size+=this.has(n)?0:1,s[n]=e&&i===void 0?t:i,this}return bx=r,bx}var wx,yE;function SY(){if(yE)return wx;yE=1;var e=bY(),t=wY(),r=_Y(),n=jY(),i=NY();function s(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var f=o[l];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,wx=s,wx}var _x,vE;function kY(){if(vE)return _x;vE=1;function e(){this.__data__=[],this.size=0}return _x=e,_x}var jx,xE;function pS(){if(xE)return jx;xE=1;function e(t,r){return t===r||t!==t&&r!==r}return jx=e,jx}var Nx,bE;
vendor: 10,372 bytes, lines 410-418
410function Yg(){if(bE)return Nx;bE=1;var e=pS();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return Nx=t,Nx}var Sx,wE;function CY(){if(wE)return Sx;wE=1;var e=Yg(),t=Array.prototype,r=t.splice;function n(i){var s=this.__data__,o=e(s,i);if(o<0)return!1;var l=s.length-1;return o==l?s.pop():r.call(s,o,1),--this.size,!0}return Sx=n,Sx}var kx,_E;function FY(){if(_E)return kx;_E=1;var e=Yg();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return kx=t,kx}var Cx,jE;function OY(){if(jE)return Cx;jE=1;var e=Yg();function t(r){return e(this.__data__,r)>-1}return Cx=t,Cx}var Fx,NE;function EY(){if(NE)return Fx;NE=1;var e=Yg();function t(r,n){var i=this.__data__,s=e(i,r);return s<0?(++this.size,i.push([r,n])):i[s][1]=n,this}return Fx=t,Fx}var Ox,SE;function Qg(){if(SE)return Ox;SE=1;var e=kY(),t=CY(),r=FY(),n=OY(),i=EY();function s(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var f=o[l];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,Ox=s,Ox}var Ex,kE;function gS(){if(kE)return Ex;kE=1;var e=ul(),t=gi(),r=e(t,"Map");return Ex=r,Ex}var Px,CE;function PY(){if(CE)return Px;CE=1;var e=SY(),t=Qg(),r=gS();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Px=n,Px}var Tx,FE;function TY(){if(FE)return Tx;FE=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Tx=e,Tx}var Ax,OE;function Xg(){if(OE)return Ax;OE=1;var e=TY();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Ax=t,Ax}var Rx,EE;function AY(){if(EE)return Rx;EE=1;var e=Xg();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return Rx=t,Rx}var Ix,PE;function RY(){if(PE)return Ix;PE=1;var e=Xg();function t(r){return e(this,r).get(r)}return Ix=t,Ix}var Mx,TE;function IY(){if(TE)return Mx;TE=1;var e=Xg();function t(r){return e(this,r).has(r)}return Mx=t,Mx}var Lx,AE;function MY(){if(AE)return Lx;AE=1;var e=Xg();function t(r,n){var i=e(this,r),s=i.size;return i.set(r,n),this.size+=i.size==s?0:1,this}return Lx=t,Lx}var Dx,RE;function yS(){if(RE)return Dx;RE=1;var e=PY(),t=AY(),r=RY(),n=IY(),i=MY();function s(o){var l=-1,c=o==null?0:o.length;for(this.clear();++l<c;){var f=o[l];this.set(f[0],f[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,Dx=s,Dx}var $x,IE;function d3(){if(IE)return $x;IE=1;var e=yS(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var s=function(){var o=arguments,l=i?i.apply(this,o):o[0],c=s.cache;if(c.has(l))return c.get(l);var f=n.apply(this,o);return s.cache=c.set(l,f)||c,f};return s.cache=new(r.Cache||e),s}return r.Cache=e,$x=r,$x}var qx,ME;function LY(){if(ME)return qx;ME=1;var e=d3(),t=500;function r(n){var i=e(n,function(o){return s.size===t&&s.clear(),o}),s=i.cache;return i}return qx=r,qx}var Bx,LE;function DY(){if(LE)return Bx;LE=1;var e=LY(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(t,function(o,l,c,f){s.push(c?f.replace(r,"$1"):l||o)}),s});return Bx=n,Bx}var zx,DE;function vS(){if(DE)return zx;DE=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,s=Array(i);++n<i;)s[n]=r(t[n],n,t);return s}return zx=e,zx}var Ux,$E;function $Y(){if($E)return Ux;$E=1;var e=Xf(),t=vS(),r=Tn(),n=cu(),i=e?e.prototype:void 0,s=i?i.toString:void 0;function o(l){if(typeof l=="string")return l;if(r(l))return t(l,o)+"";if(n(l))return s?s.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return Ux=o,Ux}var Hx,qE;function f3(){if(qE)return Hx;qE=1;var e=$Y();function t(r){return r==null?"":e(r)}return Hx=t,Hx}var Vx,BE;function h3(){if(BE)return Vx;BE=1;var e=Tn(),t=hS(),r=DY(),n=f3();function i(s,o){return e(s)?s:t(s,o)?[s]:r(n(s))}return Vx=i,Vx}var Wx,zE;function Zg(){if(zE)return Wx;zE=1;var e=cu();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Wx=t,Wx}var Kx,UE;function xS(){if(UE)return Kx;UE=1;var e=h3(),t=Zg();function r(n,i){i=e(i,n);for(var s=0,o=i.length;n!=null&&s<o;)n=n[t(i[s++])];return s&&s==o?n:void 0}return Kx=r,Kx}var Gx,HE;function m3(){if(HE)return Gx;HE=1;var e=xS();function t(r,n,i){var s=r==null?void 0:e(r,n);return s===void 0?i:s}return Gx=t,Gx}var qY=m3();const Kn=Ft(qY);var Yx,VE;function BY(){if(VE)return Yx;VE=1;function e(t){return t==null}return Yx=e,Yx}var zY=BY();const yt=Ft(zY);var Qx,WE;function UY(){if(WE)return Qx;WE=1;var e=Zi(),t=Tn(),r=Ji(),n="[object String]";function i(s){return typeof s=="string"||!t(s)&&r(s)&&e(s)==n}return Qx=i,Qx}var HY=UY();const Go=Ft(HY);var VY=mS();const ht=Ft(VY);var WY=Ys();const uu=Ft(WY);var Xx={exports:{}},Mt={};/**
411 * @license React
412 * react-is.production.min.js
413 *
414 * Copyright (c) Facebook, Inc. and its affiliates.
415 *
416 * This source code is licensed under the MIT license found in the
417 * LICENSE file in the root directory of this source tree.
418 */var KE;function KY(){if(KE)return Mt;KE=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),x;x=Symbol.for("react.module.reference");function y(v){if(typeof v=="object"&&v!==null){var b=v.$$typeof;switch(b){case e:switch(v=v.type,v){case r:case i:case n:case f:case h:return v;default:switch(v=v&&v.$$typeof,v){case l:case o:case c:case m:case d:case s:return v;default:return b}}case t:return b}}}return Mt.ContextConsumer=o,Mt.ContextProvider=s,Mt.Element=e,Mt.ForwardRef=c,Mt.Fragment=r,Mt.Lazy=m,Mt.Memo=d,Mt.Portal=t,Mt.Profiler=i,Mt.StrictMode=n,Mt.Suspense=f,Mt.SuspenseList=h,Mt.isAsyncMode=function(){return!1},Mt.isConcurrentMode=function(){return!1},Mt.isContextConsumer=function(v){return y(v)===o},Mt.isContextProvider=function(v){return y(v)===s},Mt.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Mt.isForwardRef=function(v){return y(v)===c},Mt.isFragment=function(v){return y(v)===r},Mt.isLazy=function(v){return y(v)===m},Mt.isMemo=function(v){return y(v)===d},Mt.isPortal=function(v){return y(v)===t},Mt.isProfiler=function(v){return y(v)===i},Mt.isStrictMode=function(v){return y(v)===n},Mt.isSuspense=function(v){return y(v)===f},Mt.isSuspenseList=function(v){return y(v)===h},Mt.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===r||v===i||v===n||v===f||v===h||v===p||typeof v=="object"&&v!==null&&(v.$$typeof===m||v.$$typeof===d||v.$$typeof===s||v.$$typeof===o||v.$$typeof===c||v.$$typeof===x||v.getModuleId!==void 0)},Mt.typeOf=y,Mt}var GE;function GY(){return GE||(GE=1,Xx.exports=KY()),Xx.exports}var YY=GY(),Zx,YE;function p3(){if(YE)return Zx;YE=1;var e=Zi(),t=Ji(),r="[object Number]";function n(i){return typeof i=="number"||t(i)&&e(i)==r}return Zx=n,Zx}var Jx,QE;function QY(){if(QE)return Jx;QE=1;var e=p3();function t(r){return e(r)&&r!=+r}return Jx=t,Jx}var XY=QY();const Zf=Ft(XY);var ZY=p3();const JY=Ft(ZY);var gn=function(t){return t===0?0:t>0?1:-1},Co=function(t){return Go(t)&&t.indexOf("%")===t.length-1},Ie=function(t){return JY(t)&&!Zf(t)},eQ=function(t){return yt(t)},Rr=function(t){return Ie(t)||Go(t)},tQ=0,du=function(t){var r=++tQ;return"".concat(t||"").concat(r)},yn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ie(t)&&!Go(t))return n;var s;if(Co(t)){var o=t.indexOf("%");s=r*parseFloat(t.slice(0,o))/100}else s=+t;return Zf(s)&&(s=n),i&&s>r&&(s=r),s},Cs=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},rQ=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i<r;i++)if(!n[t[i]])n[t[i]]=!0;else return!0;return!1},Un=function(t,r){return Ie(t)&&Ie(r)?function(n){return t+n*(r-t)}:function(){return r}};function Op(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Kn(n,t))===r})}var nQ=function(t,r){return Ie(t)&&Ie(r)?t-r:Go(t)&&Go(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function oc(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function t1(e){"@babel/helpers - typeof";return t1=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},t1(e)}var aQ=["viewBox","children"],iQ=["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","colorRen
418dering","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"],XE=["points","pathLength"],eb={svg:aQ,polygon:XE,polyline:XE},bS=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","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","onDrag
418Capture","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"],Ep=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(I.isValidElement(t)&&(n=t.props),!uu(n))return null;var i={};return Object.keys(n).forEach(function(s){bS.includes(s)&&(i[s]=r||function(o){return n[s](n,o)})}),i},sQ=function(t,r,n){return function(i){return t(r,n,i),null}},Yo=function(t,r,n){if(!uu(t)||t1(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(s){var o=t[s];bS.includes(s)&&typeof o=="function"&&(i||(i={}),i[s]=sQ(o,r,n))}),i},oQ=["children"],lQ=["children"];function ZE(e,t){if(e==null)return{};var r=cQ(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function r1(e){"@babel/helpers - typeof";return r1=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},r1(e)}var JE={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"},Bi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},eP=null,tb=null,wS=function e(t){if(t===eP&&Array.isArray(tb))return tb;var r=[];return I.Children.forEach(t,function(n){yt(n)||(YY.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),tb=r,eP=t,r};function Gn(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Bi(i)}):n=[Bi(t)],wS(e).forEach(function(i){var s=Kn(i,"type.displayName")||Kn(i,"type.name");n.indexOf(s)!==-1&&r.push(i)}),r}function zn(e,t){var r=Gn(e,t);return r&&r[0]}var tP=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!Ie(n)||n<=0||!Ie(i)||i<=0)},uQ=["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"],dQ=function(t){return t&&t.type&&Go(t.type)&&uQ.indexOf(t.type)>=0},fQ=function(t){return t&&r1(t)==="object"&&"clipDot"in t},hQ=function(t,r,n,i){var s,o=(s=eb==null?void 0:eb[i])!==null&&s!==void 0?s:[];return r.startsWith("data-")||!ht(t)&&(i&&o.includes(r)||iQ.includes(r))||n&&bS.includes(r)},lt=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(I.isValidElement(t)&&(i=t.props),!uu(i))return null;var s={};
vendor: 4,448 bytes, line 418
418return Object.keys(i).forEach(function(o){var l;hQ((l=i)===null||l===void 0?void 0:l[o],o,r,n)&&(s[o]=i[o])}),s},n1=function e(t,r){if(t===r)return!0;var n=I.Children.count(t);if(n!==I.Children.count(r))return!1;if(n===0)return!0;if(n===1)return rP(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var s=t[i],o=r[i];if(Array.isArray(s)||Array.isArray(o)){if(!e(s,o))return!1}else if(!rP(s,o))return!1}return!0},rP=function(t,r){if(yt(t)&&yt(r))return!0;if(!yt(t)&&!yt(r)){var n=t.props||{},i=n.children,s=ZE(n,oQ),o=r.props||{},l=o.children,c=ZE(o,lQ);return i&&l?oc(s,c)&&n1(i,l):!i&&!l?oc(s,c):!1}return!1},nP=function(t,r){var n=[],i={};return wS(t).forEach(function(s,o){if(dQ(s))n.push(s);else if(s){var l=Bi(s.type),c=r[l]||{},f=c.handler,h=c.once;if(f&&(!h||!i[l])){var d=f(s,l,o);n.push(d),i[l]=!0}}}),n},mQ=function(t){var r=t&&t.type;return r&&JE[r]?JE[r]:null},pQ=function(t,r){return wS(r).indexOf(t)},gQ=["children","width","height","viewBox","className","style","title","desc"];function a1(){return a1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a1.apply(this,arguments)}function yQ(e,t){if(e==null)return{};var r=vQ(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function i1(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,s=e.className,o=e.style,l=e.title,c=e.desc,f=yQ(e,gQ),h=i||{width:r,height:n,x:0,y:0},d=xt("recharts-surface",s);return oe.createElement("svg",a1({},lt(f,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),oe.createElement("title",null,l),oe.createElement("desc",null,c),t)}var xQ=["children","className"];function s1(){return s1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s1.apply(this,arguments)}function bQ(e,t){if(e==null)return{};var r=wQ(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var At=oe.forwardRef(function(e,t){var r=e.children,n=e.className,i=bQ(e,xQ),s=xt("recharts-layer",n);return oe.createElement("g",s1({className:s},lt(i,!0),{ref:t}),r)}),Ia=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s]},rb,aP;function _Q(){if(aP)return rb;aP=1;function e(t,r,n){var i=-1,s=t.length;r<0&&(r=-r>s?0:s+r),n=n>s?s:n,n<0&&(n+=s),s=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(s);++i<s;)o[i]=t[i+r];return o}return rb=e,rb}var nb,iP;function jQ(){if(iP)return nb;iP=1;var e=_Q();function t(r,n,i){var s=r.length;return i=i===void 0?s:i,!n&&i>=s?r:e(r,n,i)}return nb=t,nb}var ab,sP;function g3(){if(sP)return ab;sP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,s="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+e+i+s+"]");function c(f){return l.test(f)}return ab=c,ab}var ib,oP;function NQ(){if(oP)return ib;oP=1;function e(t){return t.split("")}return ib=e,ib}var sb,lP;function SQ(){if(lP)return sb;lP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,s="\\ufe0e\\ufe0f",o="["+e+"]",l="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",f="(?:"+l+"|"+c+")",h="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",x=f+"?",y="["+s+"]?",v="(?:"+p+"(?:"+[h,d,m].join("|")+")"+y+x+")*",b=y+x+v,w="(?:"+[h+l+"?",l,d,m,o].join("|")+")",_=RegExp(c+"(?="+c+")|"+w+b,"g");function N(S){return S.match(_)||[]}return sb=N,sb}var ob,cP;function kQ(){if(cP)return ob;cP=1;var e=NQ(),t=g3(),r=SQ();function n(i){return t(i)?r(i):e(i)}return ob=n,ob}var lb,uP;function CQ(){if(uP)return lb;uP=1;var e=jQ(),t=g3(),r=kQ(),n=f3();function i(s){return function(o){o=n(o);
418var l=t(o)?r(o):void 0,c=l?l[0]:o.charAt(0),f=l?e(l,1).join(""):o.slice(1);return c[s]()+f}}return lb=i,lb}var cb,dP;function FQ(){if(dP)return cb;dP=1;var e=CQ(),t=e("toUpperCase");return cb=t,cb}var OQ=FQ();const Jg=Ft(OQ);function tr(e){return function(){return e}}const y3=Math.cos,Pp=Math.sin,Ba=Math.sqrt,Tp=Math.PI,ey=2*Tp,o1=Math.PI,l1=2*o1,wo=1e-6,EQ=l1-wo;function v3(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function PQ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return v3;const r=10**t;return function(n){this._+=n[0];for(let i=1,s=n.length;i<s;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class TQ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?v3:PQ(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,s,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+s},${this._y1=+o}`}arcTo(t,r,n,i,s){if(t=+t,r=+r,n=+n,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,l=this._y1,c=n-t,f=i-r,h=o-t,d=l-r,m=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>wo)if(!(Math.abs(d*c-f*h)>wo)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,x=i-l,y=c*c+f*f,v=p*p+x*x,b=Math.sqrt(y),w=Math.sqrt(m),_=s*Math.tan((o1-Math.acos((y+m-v)/(2*b*w)))/2),N=_/w,S=_/b;Math.abs(N-1)>wo&&this._append`L${t+N*h},${r+N*d}`,this._append`A${s},${s},0,0,${+(d*p>h*x)},${this._x1=t+S*c},${this._y1=r+S*f}`}}arc(t,r,n,i,s,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),f=t+l,h=r+c,d=1^o,m=o?i-s:s-i;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>wo||Math.abs(this._y1-h)>wo)&&this._append`L${f},${h}`,n&&(m<0&&(m=m%l1+l1),m>EQ?this._append`A${n},${n},0,1,${d},${t-l},${r-c}A${n},${n},0,1,${d},${this._x1=f},${this._y1=h}`:m>wo&&this._append`A${n},${n},0,${+(m>=o1)},${d},${this._x1=t+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function _S(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new TQ(t)}function jS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function x3(e){this._context=e}x3.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 ty(e){return new x3(e)}function b3(e){return e[0]}function w3(e){return e[1]}function _3(e,t){var r=tr(!0),n=null,i=ty,s=null,o=_S(l);e=typeof e=="function"?e:e===void 0?b3:tr(e),t=typeof t=="function"?t:t===void 0?w3:tr(t);function l(c){var f,h=(c=jS(c)).length,d,m=!1,p;for(n==null&&(s=i(p=o())),f=0;f<=h;++f)!(f<h&&r(d=c[f],f,c))===m&&((m=!m)?s.lineStart():s.lineEnd()),m&&s.point(+e(d,f,c),+t(d,f,c));if(p)return s=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:tr(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:tr(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:tr(!!c),l):r},l.curve=function(c){return arguments.length?(i=c,n!=null&&(s=i(n)),l):i},l.context=function(c){return arguments.length?(c==null?n=s=null:s=i(n=c),l):n},l}function Pm(e,t,r){var n=null,i=tr(!0),s=null,o=ty,l=null,c=_S(f);e=typeof e=="function"?e:e===void 0?b3:tr(+e),t=typeof t=="function"?t:tr(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?w3:tr(+r);function f(d){var m,p,x,y=(d=jS(d)).length,v,b=!1,w,_=new Array(y),N=new Array(y);for(s==null&&(l=o(w=c())),m=0;m<=y;++m){if(!(m<y&&i(v=d[m],m,d))===b)if(b=!b)p=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=m-1;x>=p;--x)l.point(_[x],N[x]);l.lineEnd(),l.areaEnd()}b&&(_[m]=+e(v,m,d),N[m]=+t(v,m,d),l.point(n?+n(v,m,d):_[m],r?+r(v,m,d):N[m]))}if(w)return l=null,w+""||null}function h(){return _3().defined(i).curve(o).context(s)}return f.x=function(d){return arguments.length?(e=typeof d=="function"?d:tr(+d),n=null,f):e},f.x0=function(d){return arguments.length?(e=typeof d=="function"?d:tr(+d),f):e},f.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:tr(+d),f):n},f.y=function(d){return arguments.length?(t=typeof d=="function"?d:tr(+d),r=null,f):t},f.y0=function(d){return arguments.length?(t=typeof d=="function"?d:tr(+d),f):t},f.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:tr(+d),f):r},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(r)},f.lineX1=function(){return h().x(n).y(t)},f.defined=function(d){return arguments.length?(i=typeof d=="function"?d:tr(!!d),f):i},f.curve=function(d){return arguments.length?(o=d,s!=null&&(l=o(s)),f):o},f.context=function(d){return arguments.length?(d==null?s=l=null:l=o(s=d),f):s},f}class j3{constructor(t,r){this._context=t,this._x=r}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}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function AQ(e){return new j3(e,!0)}function RQ(e){return new j3(e,!1)}const NS={draw(e,t){const r=Ba(t/Tp);e.moveTo(r,0),e.arc(0,0,r,0,ey)}},IQ={draw(e,t){const r=Ba(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},N3=Ba(1/3),MQ=N3*2,LQ={draw(e,t){const r=Ba(t/MQ),n=r*N3;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},DQ={draw(e,t){const r=Ba(t),n=-r/2;e.rect(n,n,r,r)}},$Q=.8908130915292852,S3=Pp(Tp/10)/Pp(7*Tp/10),qQ=Pp(ey/10)*S3,BQ=-y3(e
vendor: 7,424 bytes, line 418
418y/10)*S3,zQ={draw(e,t){const r=Ba(t*$Q),n=qQ*r,i=BQ*r;e.moveTo(0,-r),e.lineTo(n,i);for(let s=1;s<5;++s){const o=ey*s/5,l=y3(o),c=Pp(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},ub=Ba(3),UQ={draw(e,t){const r=-Ba(t/(ub*3));e.moveTo(0,r*2),e.lineTo(-ub*r,-r),e.lineTo(ub*r,-r),e.closePath()}},oa=-.5,la=Ba(3)/2,c1=1/Ba(12),HQ=(c1/2+1)*3,VQ={draw(e,t){const r=Ba(t/HQ),n=r/2,i=r*c1,s=n,o=r*c1+r,l=-s,c=o;e.moveTo(n,i),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(oa*n-la*i,la*n+oa*i),e.lineTo(oa*s-la*o,la*s+oa*o),e.lineTo(oa*l-la*c,la*l+oa*c),e.lineTo(oa*n+la*i,oa*i-la*n),e.lineTo(oa*s+la*o,oa*o-la*s),e.lineTo(oa*l+la*c,oa*c-la*l),e.closePath()}};function WQ(e,t){let r=null,n=_S(i);e=typeof e=="function"?e:tr(e||NS),t=typeof t=="function"?t:tr(t===void 0?64:+t);function i(){let s;if(r||(r=s=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:tr(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:tr(+s),i):t},i.context=function(s){return arguments.length?(r=s??null,i):r},i}function Ap(){}function Rp(e,t,r){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+r)/6)}function k3(e){this._context=e}k3.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:Rp(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:Rp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function KQ(e){return new k3(e)}function C3(e){this._context=e}C3.prototype={areaStart:Ap,areaEnd:Ap,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:Rp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function GQ(e){return new C3(e)}function F3(e){this._context=e}F3.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Rp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YQ(e){return new F3(e)}function O3(e){this._context=e}O3.prototype={areaStart:Ap,areaEnd:Ap,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 QQ(e){return new O3(e)}function fP(e){return e<0?-1:1}function hP(e,t,r){var n=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(s*i+o*n)/(n+i);return(fP(s)+fP(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function mP(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function db(e,t,r){var n=e._x0,i=e._y0,s=e._x1,o=e._y1,l=(s-n)/3;e._context.bezierCurveTo(n+l,i+l*t,s-l,o-l*r,s,o)}function Ip(e){this._context=e}Ip.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:db(this,this._t0,mP(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 r=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,db(this,mP(this,r=hP(this,e,t)),r);break;default:db(this,this._t0,r=hP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function E3(e){this._context=new P3(e)}(E3.prototype=Object.create(Ip.prototype)).point=function(e,t){Ip.prototype.point.call(this,t,e)};function P3(e){this._context=e}P3.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,r,n,i,s){this._context.bezierCurveTo(t,e,n,r,s,i)}};function XQ(e){return new Ip(e)}function ZQ(e){return new E3(e)}function T3(e){this._context=e}T3.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=pP(e),i=pP(t),s=0,o=1;o<r;++s,++o)this._context.bezierCurveTo(n[0][s],i[0][s],n[1][s],i[1][s],e[o],t[o]);(this._line||this._line!==0&&r===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 pP(e){var t,r=e.length-1,n,i=new Array(r),s=new Array(r),o=new Array(r);for(i[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,s[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/s[t-1],s[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/s[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/s[t];for(s[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function JQ(e){return new T3(e)}function ry(e,t){this._context=e,this._t=t}ry.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;
vendor: 17,829 bytes, lines 418-421
418default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function eX(e){return new ry(e,.5)}function tX(e){return new ry(e,0)}function rX(e){return new ry(e,1)}function Ec(e,t){if((o=e.length)>1)for(var r=1,n,i,s=e[t[0]],o,l=s.length;r<o;++r)for(i=s,s=e[t[r]],n=0;n<l;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function u1(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function nX(e,t){return e[t]}function aX(e){const t=[];return t.key=e,t}function iX(){var e=tr([]),t=u1,r=Ec,n=nX;function i(s){var o=Array.from(e.apply(this,arguments),aX),l,c=o.length,f=-1,h;for(const d of s)for(l=0,++f;l<c;++l)(o[l][f]=[0,+n(d,o[l].key,f,s)]).data=d;for(l=0,h=jS(t(o));l<c;++l)o[h[l]].index=l;return r(o,h),o}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:tr(Array.from(s)),i):e},i.value=function(s){return arguments.length?(n=typeof s=="function"?s:tr(+s),i):n},i.order=function(s){return arguments.length?(t=s==null?u1:typeof s=="function"?s:tr(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(r=s??Ec,i):r},i}function sX(e,t){if((n=e.length)>0){for(var r,n,i=0,s=e[0].length,o;i<s;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}Ec(e,t)}}function oX(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,s=n.length;r<s;++r){for(var o=0,l=0;o<i;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}Ec(e,t)}}function lX(e,t){if(!(!((o=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,s,o;n<s;++n){for(var l=0,c=0,f=0;l<o;++l){for(var h=e[t[l]],d=h[n][1]||0,m=h[n-1][1]||0,p=(d-m)/2,x=0;x<l;++x){var y=e[t[x]],v=y[n][1]||0,b=y[n-1][1]||0;p+=v-b}c+=d,f+=p*d}i[n-1][1]+=i[n-1][0]=r,c&&(r-=f/c)}i[n-1][1]+=i[n-1][0]=r,Ec(e,t)}}function Xd(e){"@babel/helpers - typeof";return Xd=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},Xd(e)}var cX=["type","size","sizeType"];function d1(){return d1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d1.apply(this,arguments)}function gP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gP(Object(r),!0).forEach(function(n){uX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uX(e,t,r){return t=dX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dX(e){var t=fX(e,"string");return Xd(t)=="symbol"?t:t+""}function fX(e,t){if(Xd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hX(e,t){if(e==null)return{};var r=mX(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var A3={symbolCircle:NS,symbolCross:IQ,symbolDiamond:LQ,symbolSquare:DQ,symbolStar:zQ,symbolTriangle:UQ,symbolWye:VQ},pX=Math.PI/180,gX=function(t){var r="symbol".concat(Jg(t));return A3[r]||NS},yX=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*pX;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),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}},vX=function(t,r){A3["symbol".concat(Jg(t))]=r},SS=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,s=i===void 0?64:i,o=t.sizeType,l=o===void 0?"area":o,c=hX(t,cX),f=yP(yP({},c),{},{type:n,size:s,sizeType:l}),h=function(){var v=gX(n),b=WQ().type(v).size(yX(s,l,n));return b()},d=f.className,m=f.cx,p=f.cy,x=lt(f,!0);return m===+m&&p===+p&&s===+s?oe.createElement("path",d1({},x,{className:xt("recharts-symbols",d),transform:"translate(".concat(m,", ").concat(p,")"),d:h()})):null};SS.registerSymbol=vX;function Pc(e){"@babel/helpers - typeof";return Pc=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},Pc(e)}function f1(){return f1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f1.apply(this,arguments)}function vP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xX(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vP(Object(r),!0).forEach(function(n){Zd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,I3(n.key),n)}}function _X(e,t,r){return t&&wX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jX(e,t,r){return t=Mp(t),NX(e,R3()?Reflect.construct(t,r||[],Mp(e).constructor):t.apply(e,r))}function NX(e,t){if(t&&(Pc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SX(e)}function SX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R3=function(){return!!e})()}function Mp(e){return Mp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mp(e)}function kX(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&&h1(e,t)}function h1(e,t){return h1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},h1(e,t)}function Zd(e,t,r){return t=I3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I3(e){var t=CX(e,"string");return Pc(t)=="symbol"?t:t+""}function CX(e,t){if(Pc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ca=32,kS=(function(e){function t(){return bX(this,t),jX(this,t,arguments)}return kX(t,e),_X(t,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,s=ca/2,o=ca/6,l=ca/3,c=n.inactive?i:n.color;if(n.type==="plainline")return oe.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:s,x2:ca,y2:s,className:"recharts-legend-icon"});if(n.type==="line")return oe.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(l,`
419            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(s,`
420            H`).concat(ca,"M").concat(2*l,",").concat(s,`
421            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(s),className:"recharts-legend-icon"});if(n.type==="rect")return oe.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(ca/8,"h").concat(ca,"v").concat(ca*3/4,"h").concat(-ca,"z"),className:"recharts-legend-icon"});if(oe.isValidElement(n.legendIcon)){var f=xX({},n);return delete f.legendIcon,oe.cloneElement(n.legendIcon,f)}return oe.createElement(SS,{fill:c,cx:s,cy:s,size:ca,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,s=i.payload,o=i.iconSize,l=i.layout,c=i.formatter,f=i.inactiveColor,h={x:0,y:0,width:ca,height:ca},d={display:l==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(p,x){var y=p.formatter||c,v=xt(Zd(Zd({"recharts-legend-item":!0},"legend-item-".concat(x),!0),"inactive",p.inactive));if(p.type==="none")return null;var b=ht(p.value)?null:p.value;Ia(!ht(p.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 w=p.inactive?f:p.color;return oe.createElement("li",f1({className:v,style:d,key:"legend-item-".concat(x)},Yo(n.props,p,x)),oe.createElement(i1,{width:o,height:o,viewBox:h,style:m},n.renderIcon(p)),oe.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},y?y(b,p,x):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,s=n.layout,o=n.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:s==="horizontal"?o:"left"};return oe.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])})(I.PureComponent);Zd(kS,"displayName","Legend");Zd(kS,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var fb,xP;function FX(){if(xP)return fb;xP=1;var e=Qg();function t(){this.__data__=new e,this.size=0}return fb=t,fb}var hb,bP;function OX(){if(bP)return hb;bP=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return hb=e,hb}var mb,wP;function EX(){if(wP)return mb;wP=1;function e(t){return this.__data__.get(t)}return mb=e,mb}var pb,_P;function PX(){if(_P)return pb;_P=1;function e(t){return this.__data__.has(t)}return pb=e,pb}var gb,jP;function TX(){if(jP)return gb;jP=1;var e=Qg(),t=gS(),r=yS(),n=200;function i(s,o){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<n-1)return c.push([s,o]),this.size=++l.size,this;l=this.__data__=new r(c)}return l.set(s,o),this.size=l.size,this}return gb=i,gb}var yb,NP;function M3(){if(NP)return yb;NP=1;var e=Qg(),t=FX(),r=OX(),n=EX(),i=PX(),s=TX();function o(l){var c=this.__data__=new e(l);this.size=c.size}return o.prototype.clear=t,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=i,o.prototype.set=s,yb=o,yb}var vb,SP;function AX(){if(SP)return vb;SP=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return vb=t,vb}var xb,kP;function RX(){if(kP)return xb;kP=1;function e(t){return this.__data__.has(t)}return xb=e,xb}var bb,CP;function L3(){if(CP)return bb;CP=1;var e=yS(),t=AX(),r=RX();function n(i){var s=-1,o=i==null?0:i.length;for(this.__data__=new e;++s<o;)this.add(i[s])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,bb=n,bb}var wb,FP;function D3(){if(FP)return wb;FP=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(t[n],n,t))return!0;return!1}return wb=e,wb}var _b,OP;function $3(){if(OP)return _b;OP=1;function e(t,r){return t.has(r)}return _b=e,_b}var jb,EP;function q3(){if(EP)return jb;EP=1;var e=L3(),t=D3(),r=$3(),n=1,i=2;function s(o,l,c,f,h,d){var m=c&n,p=o.length,x=l.length;if(p!=x&&!(m&&x>p))return!1;var y=d.get(o),v=d.get(l);if(y&&v)return y==l&&v==o;var b=-1,w=!0,_=c&i?new e:void 0;for(d.set(o,l),d.set(l,o);++b<p;){var N=o[b],S=l[b];if(f)var k=m?f(S,N,b,l,o,d):f(N,S,b,o,l,d);if(k!==void 0){if(k)continue;w=!1;break}if(_){if(!t(l,function(C,O){if(!r(_,O)&&(N===C||h(N,C,c,f,d)))return _.push(O)})){w=!1;break}}else if(!(N===S||h(N,S,c,f,d))){w=!1;break}}return d.delete(o),d.delete(l),w}return jb=s,jb}var Nb,PP;function IX(){if(PP)return Nb;PP=1;var e=gi(),t=e.Uint8Array;return Nb=t,Nb}var Sb,TP;function MX(){if(TP)return Sb;TP=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i,s){n[++r]=[s,i]}),n}return Sb=e,Sb}var kb,AP;function CS(){if(AP)return kb;AP=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i){n[++r]=i}),n}return kb=e,kb}var Cb,RP;function LX(){if(RP)return Cb;RP=1;var e=Xf(),t=IX(),r=pS(),n=q3(),i=MX(),s=CS(),o=1,l=2,c="[object Boolean]",f="[object Date]",h="[object Error]",d="[object Map]",m="[object Number]",p="[object RegExp]",x="[object Set]",y="[object String]",v="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",_=e?e.prototype:void 0,N=_?_.valueOf:void 0;function S(k,C,O,R,A,P,E){switch(O){case w:if(k.byteLength!=C.byteLength||k.byteOffset!=C.byteOffset)return!1;k=k.buffer,C=C.buffer;case b:return!(k.byteLength!=C.byteLength||!P(new t(k),new t(C)));case c:case f:case m:return r(+k,+C);case h:return k.name==C.name&&k.message==C.message;case p:case y:return k==C+"";case d:var T=i;case x:var $=R&o;if(T||(T=s),k.size!=C.size&&!$)return!1;var D=E.get(k);if(D)return D==C;R|=l,E.set(k,C);var W=n(T(k),T(C),R,A,P,E);return E.delete(k),W;case v:if(N)return N.call(k)==N.call(C)}return!1}return Cb=S,Cb}var Fb,IP;function B3(){if(IP)return Fb;IP=1;function e(t,r){for(var n=-1,i=r.length,s=t.length;++n<i;)t[s+n]=r[n];return t}return Fb=e,Fb}var Ob,MP;function DX(){if(MP)return Ob;MP=1;var e=B3(),t=Tn();function r(n,i,s){var o=i(n);return t(n)?o:e(o,s(n))}return Ob=r,Ob}var Eb,LP;function $X(){if(LP)return Eb;LP=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,s=0,o=[];++n<i;){var l=t[n];r(l,n,t)&&(o[s++]=l)}return o}return Eb=e,Eb}var Pb,DP;function qX(){if(DP)return Pb;DP=1;function e(){return[]}return Pb=e,Pb}var Tb,$P;function BX(){if($P)return Tb;$P=1;var e=$X(),t=qX(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(o){return o==null?[]:(o=Object(o),e(i(o),function(l){return n.call(o,l)}))}:t;return Tb=s,Tb}var Ab,qP;function zX(){if(qP)return Ab;qP=1;function e(t,r){for(var n=-1,i=Array(t);++n<t;)i[n]=r(n);return i}return Ab=e,Ab}var Rb,BP;function UX(){if(BP)return Rb;BP=1;var e=Zi(),t=Ji(),r="[object Arguments]";function n(i){return t(i)&&e(i)==r}return Rb=n,Rb}var Ib,zP;function FS(){if(zP)return Ib;zP=1;var e=UX(),t=Ji(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,s=e((function(){return arguments})())?e:function(o){return t(o)&&n.call(o,"callee")&&!i.call(o,"callee")};return Ib=s,Ib}var Od={exports:{}},Mb,UP;function HX(){if(UP)return Mb;UP=1;function e(){return!1}return Mb=e,Mb}Od.exports;var HP;function z3(){return HP||(HP=1,(function(e,t){var r=gi(),n=HX(),i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===i,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,f=c||n;e.exports=f})(Od,Od.exports)),Od.exports}var Lb,VP;function OS(){if(VP)return Lb;VP=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,i){var s=typeof n;return i=i??e,!!i&&(s=="number"||s!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<i}return Lb=r,Lb}var Db,WP;function ES(){if(WP)return Db;WP=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Db=t,Db}var $b,KP;function VX(){if(KP)return $b;KP=1;var e=Zi(),t=ES(),r=Ji(),n="[object Arguments]",i="[object Array]",s="[object Boolean]",o="[object Date]",l="[object Error]",c="[object Function]",f="[object Map]",h="[object Number]",d="[object Object]",m="[object RegExp]",p="[object Set]",x="[object String]",y="[object WeakMap]",v="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",_="[object Float64Array]",N="[object Int8Array]",S="[object Int16Array]",k="[object Int32Array]",C="[object Uint8Array]",O="[object Uint8ClampedArray]",R="[object Uint16Array]",A="[object Uint32Array]",P={};P[w]=P[_]=P[N]=P[S]=P[k]=P[C]=P[O]=P[R]=P[A]=!0,P[n]=P[i]=P[v]=P[s]=P[b]=P[o]=P[l]=P[c]=P[f]=P[h]=P[d]=P[m]=P[p]=P[x]=P[y]=!1;function E(T){return r(T)&&t(T.length)&&!!P[e(T)]}return $b=E,$b}var qb,GP;function U3(){if(GP)return qb;GP=1;function e(t){return function(r){return t(r)}}return qb=e,qb}var Ed={exports:{}};Ed.exports;var YP;function WX(){return YP||(YP=1,(function(e,t){var r=c3(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===n,o=s&&r.process,l=(function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();e.exports=l})(Ed,Ed.exports)),Ed.exports}var Bb,QP;function H3(){if(QP)return Bb;QP=1;var e=VX(),t=U3(),r=WX(),n=r&&r.isTypedArray,i=n?t(n):e;return Bb=i,Bb}var zb,XP;function KX(){if(XP)return zb;XP=1;var e=zX(),t=FS(),r=Tn(),n=z3(),i=OS(),s=H3(),o=Object.prototype,l=o.hasOwnProperty;function c(f,h){var d=r(f),m=!d&&t(f),p=!d&&!m&&n(f),x=!d&&!m&&!p&&s(f),y=d||m||p||x,v=y?e(f.length,String):[],b=v.length;for(var w in f)(h||l.call(f,w))&&!(y&&(w=="length"||p&&(w=="offset"||w=="parent")||x&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||i(w,b)))&&v.push(w);return v}return zb=c,zb}var Ub,ZP;function GX(){if(ZP)return Ub;ZP=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return Ub=t,Ub}var Hb,JP;
vendor: 4,300 bytes, line 421
421function V3(){if(JP)return Hb;JP=1;function e(t,r){return function(n){return t(r(n))}}return Hb=e,Hb}var Vb,eT;function YX(){if(eT)return Vb;eT=1;var e=V3(),t=e(Object.keys,Object);return Vb=t,Vb}var Wb,tT;function QX(){if(tT)return Wb;tT=1;var e=GX(),t=YX(),r=Object.prototype,n=r.hasOwnProperty;function i(s){if(!e(s))return t(s);var o=[];for(var l in Object(s))n.call(s,l)&&l!="constructor"&&o.push(l);return o}return Wb=i,Wb}var Kb,rT;function Jf(){if(rT)return Kb;rT=1;var e=mS(),t=ES();function r(n){return n!=null&&t(n.length)&&!e(n)}return Kb=r,Kb}var Gb,nT;function ny(){if(nT)return Gb;nT=1;var e=KX(),t=QX(),r=Jf();function n(i){return r(i)?e(i):t(i)}return Gb=n,Gb}var Yb,aT;function XX(){if(aT)return Yb;aT=1;var e=DX(),t=BX(),r=ny();function n(i){return e(i,r,t)}return Yb=n,Yb}var Qb,iT;function ZX(){if(iT)return Qb;iT=1;var e=XX(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(s,o,l,c,f,h){var d=l&t,m=e(s),p=m.length,x=e(o),y=x.length;if(p!=y&&!d)return!1;for(var v=p;v--;){var b=m[v];if(!(d?b in o:n.call(o,b)))return!1}var w=h.get(s),_=h.get(o);if(w&&_)return w==o&&_==s;var N=!0;h.set(s,o),h.set(o,s);for(var S=d;++v<p;){b=m[v];var k=s[b],C=o[b];if(c)var O=d?c(C,k,b,o,s,h):c(k,C,b,s,o,h);if(!(O===void 0?k===C||f(k,C,l,c,h):O)){N=!1;break}S||(S=b=="constructor")}if(N&&!S){var R=s.constructor,A=o.constructor;R!=A&&"constructor"in s&&"constructor"in o&&!(typeof R=="function"&&R instanceof R&&typeof A=="function"&&A instanceof A)&&(N=!1)}return h.delete(s),h.delete(o),N}return Qb=i,Qb}var Xb,sT;function JX(){if(sT)return Xb;sT=1;var e=ul(),t=gi(),r=e(t,"DataView");return Xb=r,Xb}var Zb,oT;function eZ(){if(oT)return Zb;oT=1;var e=ul(),t=gi(),r=e(t,"Promise");return Zb=r,Zb}var Jb,lT;function W3(){if(lT)return Jb;lT=1;var e=ul(),t=gi(),r=e(t,"Set");return Jb=r,Jb}var ew,cT;function tZ(){if(cT)return ew;cT=1;var e=ul(),t=gi(),r=e(t,"WeakMap");return ew=r,ew}var tw,uT;function rZ(){if(uT)return tw;uT=1;var e=JX(),t=gS(),r=eZ(),n=W3(),i=tZ(),s=Zi(),o=u3(),l="[object Map]",c="[object Object]",f="[object Promise]",h="[object Set]",d="[object WeakMap]",m="[object DataView]",p=o(e),x=o(t),y=o(r),v=o(n),b=o(i),w=s;return(e&&w(new e(new ArrayBuffer(1)))!=m||t&&w(new t)!=l||r&&w(r.resolve())!=f||n&&w(new n)!=h||i&&w(new i)!=d)&&(w=function(_){var N=s(_),S=N==c?_.constructor:void 0,k=S?o(S):"";if(k)switch(k){case p:return m;case x:return l;case y:return f;case v:return h;case b:return d}return N}),tw=w,tw}var rw,dT;function nZ(){if(dT)return rw;dT=1;var e=M3(),t=q3(),r=LX(),n=ZX(),i=rZ(),s=Tn(),o=z3(),l=H3(),c=1,f="[object Arguments]",h="[object Array]",d="[object Object]",m=Object.prototype,p=m.hasOwnProperty;function x(y,v,b,w,_,N){var S=s(y),k=s(v),C=S?h:i(y),O=k?h:i(v);C=C==f?d:C,O=O==f?d:O;var R=C==d,A=O==d,P=C==O;if(P&&o(y)){if(!o(v))return!1;S=!0,R=!1}if(P&&!R)return N||(N=new e),S||l(y)?t(y,v,b,w,_,N):r(y,v,C,b,w,_,N);if(!(b&c)){var E=R&&p.call(y,"__wrapped__"),T=A&&p.call(v,"__wrapped__");if(E||T){var $=E?y.value():y,D=T?v.value():v;return N||(N=new e),_($,D,b,w,N)}}return P?(N||(N=new e),n(y,v,b,w,_,N)):!1}return rw=x,rw}var nw,fT;function PS(){if(fT)return nw;fT=1;var e=nZ(),t=Ji();function r(n,i,s,o,l){return n===i?!0:n==null||i==null||!t(n)&&!t(i)?n!==n&&i!==i:e(n,i,s,o,r,l)}return nw=r,nw}var aw,hT;function aZ(){if(hT)return aw;hT=1;var e=M3(),t=PS(),r=1,n=2;function i(s,o,l,c){var f=l.length,h=f,d=!c;if(s==null)return!h;for(s=Object(s);f--;){var m=l[f];if(d&&m[2]?m[1]!==s[m[0]]:!(m[0]in s))return!1}for(;++f<h;){m=l[f];var p=m[0],x=s[p],y=m[1];if(d&&m[2]){if(x===void 0&&!(p in s))return!1}else{var v=new e;if(c)var b=c(x,y,p,s,o,v);if(!(b===void 0?t(y,x,r|n,c,v):b))return!1}}return!0}return aw=i,aw}var iw,mT;function K3(){if(mT)return iw;mT=1;var e=Ys();function t(r){return r===r&&!e(r)}return iw=t,iw}var sw,pT;function iZ(){if(pT)return sw;pT=1;var e=K3(),t=ny();function r(n){for(var i=t(n),s=i.length;s--;){var o=i[s],l=n[o];i[s]=[o,l,e(l)]}return i}return sw=r,sw}var ow,gT;function G3(){if(gT)return ow;gT=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return ow=e,ow}var lw,yT;function sZ(){if(yT)return lw;yT=1;var e=aZ(),t=iZ(),r=G3();function n(i){var s=t(i);return s.length==1&&s[0][2]?r(s[0][0],s[0][1]):function(o){return o===i||e(o,i,s)}}return lw=n,lw}var cw,vT;
vendor: 42,689 bytes, lines 421-428
421function oZ(){if(vT)return cw;vT=1;function e(t,r){return t!=null&&r in Object(t)}return cw=e,cw}var uw,xT;function lZ(){if(xT)return uw;xT=1;var e=h3(),t=FS(),r=Tn(),n=OS(),i=ES(),s=Zg();function o(l,c,f){c=e(c,l);for(var h=-1,d=c.length,m=!1;++h<d;){var p=s(c[h]);if(!(m=l!=null&&f(l,p)))break;l=l[p]}return m||++h!=d?m:(d=l==null?0:l.length,!!d&&i(d)&&n(p,d)&&(r(l)||t(l)))}return uw=o,uw}var dw,bT;function cZ(){if(bT)return dw;bT=1;var e=oZ(),t=lZ();function r(n,i){return n!=null&&t(n,i,e)}return dw=r,dw}var fw,wT;function uZ(){if(wT)return fw;wT=1;var e=PS(),t=m3(),r=cZ(),n=hS(),i=K3(),s=G3(),o=Zg(),l=1,c=2;function f(h,d){return n(h)&&i(d)?s(o(h),d):function(m){var p=t(m,h);return p===void 0&&p===d?r(m,h):e(d,p,l|c)}}return fw=f,fw}var hw,_T;function fu(){if(_T)return hw;_T=1;function e(t){return t}return hw=e,hw}var mw,jT;function dZ(){if(jT)return mw;jT=1;function e(t){return function(r){return r==null?void 0:r[t]}}return mw=e,mw}var pw,NT;function fZ(){if(NT)return pw;NT=1;var e=xS();function t(r){return function(n){return e(n,r)}}return pw=t,pw}var gw,ST;function hZ(){if(ST)return gw;ST=1;var e=dZ(),t=fZ(),r=hS(),n=Zg();function i(s){return r(s)?e(n(s)):t(s)}return gw=i,gw}var yw,kT;function yi(){if(kT)return yw;kT=1;var e=sZ(),t=uZ(),r=fu(),n=Tn(),i=hZ();function s(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?t(o[0],o[1]):e(o):i(o)}return yw=s,yw}var vw,CT;function Y3(){if(CT)return vw;CT=1;function e(t,r,n,i){for(var s=t.length,o=n+(i?1:-1);i?o--:++o<s;)if(r(t[o],o,t))return o;return-1}return vw=e,vw}var xw,FT;function mZ(){if(FT)return xw;FT=1;function e(t){return t!==t}return xw=e,xw}var bw,OT;function pZ(){if(OT)return bw;OT=1;function e(t,r,n){for(var i=n-1,s=t.length;++i<s;)if(t[i]===r)return i;return-1}return bw=e,bw}var ww,ET;function gZ(){if(ET)return ww;ET=1;var e=Y3(),t=mZ(),r=pZ();function n(i,s,o){return s===s?r(i,s,o):e(i,t,o)}return ww=n,ww}var _w,PT;function yZ(){if(PT)return _w;PT=1;var e=gZ();function t(r,n){var i=r==null?0:r.length;return!!i&&e(r,n,0)>-1}return _w=t,_w}var jw,TT;function vZ(){if(TT)return jw;TT=1;function e(t,r,n){for(var i=-1,s=t==null?0:t.length;++i<s;)if(n(r,t[i]))return!0;return!1}return jw=e,jw}var Nw,AT;function xZ(){if(AT)return Nw;AT=1;function e(){}return Nw=e,Nw}var Sw,RT;function bZ(){if(RT)return Sw;RT=1;var e=W3(),t=xZ(),r=CS(),n=1/0,i=e&&1/r(new e([,-0]))[1]==n?function(s){return new e(s)}:t;return Sw=i,Sw}var kw,IT;function wZ(){if(IT)return kw;IT=1;var e=L3(),t=yZ(),r=vZ(),n=$3(),i=bZ(),s=CS(),o=200;function l(c,f,h){var d=-1,m=t,p=c.length,x=!0,y=[],v=y;if(h)x=!1,m=r;else if(p>=o){var b=f?null:i(c);if(b)return s(b);x=!1,m=n,v=new e}else v=f?[]:y;e:for(;++d<p;){var w=c[d],_=f?f(w):w;if(w=h||w!==0?w:0,x&&_===_){for(var N=v.length;N--;)if(v[N]===_)continue e;f&&v.push(_),y.push(w)}else m(v,_,h)||(v!==y&&v.push(_),y.push(w))}return y}return kw=l,kw}var Cw,MT;function _Z(){if(MT)return Cw;MT=1;var e=yi(),t=wZ();function r(n,i){return n&&n.length?t(n,e(i,2)):[]}return Cw=r,Cw}var jZ=_Z();const LT=Ft(jZ);function Q3(e,t,r){return t===!0?LT(e,r):ht(t)?LT(e,t):e}function Tc(e){"@babel/helpers - typeof";return Tc=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},Tc(e)}var NZ=["ref"];function DT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DT(Object(r),!0).forEach(function(n){ay(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Z3(n.key),n)}}function kZ(e,t,r){return t&&$T(e.prototype,t),r&&$T(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function CZ(e,t,r){return t=Lp(t),FZ(e,X3()?Reflect.construct(t,r||[],Lp(e).constructor):t.apply(e,r))}function FZ(e,t){if(t&&(Tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return OZ(e)}function OZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X3=function(){return!!e})()}function Lp(e){return Lp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lp(e)}function EZ(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&&m1(e,t)}function m1(e,t){return m1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},m1(e,t)}function ay(e,t,r){return t=Z3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z3(e){var t=PZ(e,"string");return Tc(t)=="symbol"?t:t+""}function PZ(e,t){if(Tc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Tc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function TZ(e,t){if(e==null)return{};var r=AZ(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function AZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function RZ(e){return e.value}function IZ(e,t){if(oe.isValidElement(e))return oe.cloneElement(e,t);if(typeof e=="function")return oe.createElement(e,t);t.ref;var r=TZ(t,NZ);return oe.createElement(kS,r)}var qT=1,zi=(function(e){function t(){var r;SZ(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=CZ(this,t,[].concat(i)),ay(r,"lastBoundingBox",{width:-1,height:-1}),r}return EZ(t,e),kZ(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>qT||Math.abs(i.height-this.lastBoundingBox.height)>qT)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Oi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,s=i.layout,o=i.align,l=i.verticalAlign,c=i.margin,f=i.chartWidth,h=i.chartHeight,d,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&s==="vertical"){var p=this.getBBoxSnapshot();d={left:((f||0)-p.width)/2}}else d=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var x=this.getBBoxSnapshot();m={top:((h||0)-x.height)/2}}else m=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Oi(Oi({},d),m)}},{key:"render",value:function(){var n=this,i=this.props,s=i.content,o=i.width,l=i.height,c=i.wrapperStyle,f=i.payloadUniqBy,h=i.payload,d=Oi(Oi({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return oe.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){n.wrapperNode=p}},IZ(s,Oi(Oi({},this.props),{},{payload:Q3(h,f,RZ)})))}}],[{key:"getWithHeight",value:function(n,i){var s=Oi(Oi({},this.defaultProps),n.props),o=s.layout;return o==="vertical"&&Ie(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(I.PureComponent);ay(zi,"displayName","Legend");ay(zi,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Fw,BT;function MZ(){if(BT)return Fw;BT=1;var e=Xf(),t=FS(),r=Tn(),n=e?e.isConcatSpreadable:void 0;function i(s){return r(s)||t(s)||!!(n&&s&&s[n])}return Fw=i,Fw}var Ow,zT;function J3(){if(zT)return Ow;zT=1;var e=B3(),t=MZ();function r(n,i,s,o,l){var c=-1,f=n.length;for(s||(s=t),l||(l=[]);++c<f;){var h=n[c];i>0&&s(h)?i>1?r(h,i-1,s,o,l):e(l,h):o||(l[l.length]=h)}return l}return Ow=r,Ow}var Ew,UT;function LZ(){if(UT)return Ew;UT=1;function e(t){return function(r,n,i){for(var s=-1,o=Object(r),l=i(r),c=l.length;c--;){var f=l[t?c:++s];if(n(o[f],f,o)===!1)break}return r}}return Ew=e,Ew}var Pw,HT;function DZ(){if(HT)return Pw;HT=1;var e=LZ(),t=e();return Pw=t,Pw}var Tw,VT;function e$(){if(VT)return Tw;VT=1;var e=DZ(),t=ny();function r(n,i){return n&&e(n,i,t)}return Tw=r,Tw}var Aw,WT;function $Z(){if(WT)return Aw;WT=1;var e=Jf();function t(r,n){return function(i,s){if(i==null)return i;if(!e(i))return r(i,s);for(var o=i.length,l=n?o:-1,c=Object(i);(n?l--:++l<o)&&s(c[l],l,c)!==!1;);return i}}return Aw=t,Aw}var Rw,KT;function TS(){if(KT)return Rw;KT=1;var e=e$(),t=$Z(),r=t(e);return Rw=r,Rw}var Iw,GT;function t$(){if(GT)return Iw;GT=1;var e=TS(),t=Jf();function r(n,i){var s=-1,o=t(n)?Array(n.length):[];return e(n,function(l,c,f){o[++s]=i(l,c,f)}),o}return Iw=r,Iw}var Mw,YT;function qZ(){if(YT)return Mw;YT=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return Mw=e,Mw}var Lw,QT;function BZ(){if(QT)return Lw;QT=1;var e=cu();function t(r,n){if(r!==n){var i=r!==void 0,s=r===null,o=r===r,l=e(r),c=n!==void 0,f=n===null,h=n===n,d=e(n);if(!f&&!d&&!l&&r>n||l&&c&&h&&!f&&!d||s&&c&&h||!i&&h||!o)return 1;if(!s&&!l&&!d&&r<n||d&&i&&o&&!s&&!l||f&&i&&o||!c&&o||!h)return-1}return 0}return Lw=t,Lw}var Dw,XT;function zZ(){if(XT)return Dw;XT=1;var e=BZ();function t(r,n,i){for(var s=-1,o=r.criteria,l=n.criteria,c=o.length,f=i.length;++s<c;){var h=e(o[s],l[s]);if(h){if(s>=f)return h;var d=i[s];return h*(d=="desc"?-1:1)}}return r.index-n.index}return Dw=t,Dw}var $w,ZT;function UZ(){if(ZT)return $w;ZT=1;var e=vS(),t=xS(),r=yi(),n=t$(),i=qZ(),s=U3(),o=zZ(),l=fu(),c=Tn();function f(h,d,m){d.length?d=e(d,function(y){return c(y)?function(v){return t(v,y.length===1?y[0]:y)}:y}):d=[l];var p=-1;d=e(d,s(r));var x=n(h,function(y,v,b){var w=e(d,function(_){return _(y)});return{criteria:w,index:++p,value:y}});return i(x,function(y,v){return o(y,v,m)})}return $w=f,$w}var qw,JT;function HZ(){if(JT)return qw;JT=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return qw=e,qw}var Bw,eA;function VZ(){if(eA)return Bw;eA=1;var e=HZ(),t=Math.max;function r(n,i,s){return i=t(i===void 0?n.length-1:i,0),function(){for(var o=arguments,l=-1,c=t(o.length-i,0),f=Array(c);++l<c;)f[l]=o[i+l];l=-1;for(var h=Array(i+1);++l<i;)h[l]=o[l];return h[i]=s(f),e(n,this,h)}}return Bw=r,Bw}var zw,tA;function WZ(){if(tA)return zw;tA=1;function e(t){return function(){return t}}return zw=e,zw}var Uw,rA;function r$(){if(rA)return Uw;rA=1;var e=ul(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Uw=t,Uw}var Hw,nA;function KZ(){if(nA)return Hw;nA=1;var e=WZ(),t=r$(),r=fu(),n=t?function(i,s){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(s),writable:!0})}:r;return Hw=n,Hw}var Vw,aA;function GZ(){if(aA)return Vw;aA=1;var e=800,t=16,r=Date.now;function n(i){var s=0,o=0;return function(){var l=r(),c=t-(l-o);if(o=l,c>0){if(++s>=e)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return Vw=n,Vw}var Ww,iA;function YZ(){if(iA)return Ww;iA=1;var e=KZ(),t=GZ(),r=t(e);return Ww=r,Ww}var Kw,sA;function QZ(){if(sA)return Kw;sA=1;var e=fu(),t=VZ(),r=YZ();function n(i,s){return r(t(i,s,e),i+"")}return Kw=n,Kw}var Gw,oA;function iy(){if(oA)return Gw;oA=1;var e=pS(),t=Jf(),r=OS(),n=Ys();function i(s,o,l){if(!n(l))return!1;var c=typeof o;return(c=="number"?t(l)&&r(o,l.length):c=="string"&&o in l)?e(l[o],s):!1}return Gw=i,Gw}var Yw,lA;function XZ(){if(lA)return Yw;lA=1;var e=J3(),t=UZ(),r=QZ(),n=iy(),i=r(function(s,o){if(s==null)return[];var l=o.length;return l>1&&n(s,o[0],o[1])?o=[]:l>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(s,e(o,1),[])});return Yw=i,Yw}var ZZ=XZ();const AS=Ft(ZZ);function Jd(e){"@babel/helpers - typeof";return Jd=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},Jd(e)}function p1(){return p1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p1.apply(this,arguments)}function JZ(e,t){return nJ(e)||rJ(e,t)||tJ(e,t)||eJ()}function eJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
422In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tJ(e,t){if(e){if(typeof e=="string")return cA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cA(e,t)}}function cA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rJ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function nJ(e){if(Array.isArray(e))return e}function uA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uA(Object(r),!0).forEach(function(n){aJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aJ(e,t,r){return t=iJ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iJ(e){var t=sJ(e,"string");return Jd(t)=="symbol"?t:t+""}function sJ(e,t){if(Jd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oJ(e){return Array.isArray(e)&&Rr(e[0])&&Rr(e[1])?e.join(" ~ "):e}var lJ=function(t){var r=t.separator,n=r===void 0?" : ":r,i=t.contentStyle,s=i===void 0?{}:i,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,f=c===void 0?{}:c,h=t.payload,d=t.formatter,m=t.itemSorter,p=t.wrapperClassName,x=t.labelClassName,y=t.label,v=t.labelFormatter,b=t.accessibilityLayer,w=b===void 0?!1:b,_=function(){if(h&&h.length){var E={padding:0,margin:0},T=(m?AS(h,m):h).map(function($,D){if($.type==="none")return null;var W=Qw({display:"block",paddingTop:4,paddingBottom:4,color:$.color||"#000"},l),U=$.formatter||d||oJ,H=$.value,K=$.name,q=H,L=K;if(U&&q!=null&&L!=null){var V=U(H,K,$,D,h);if(Array.isArray(V)){var z=JZ(V,2);q=z[0],L=z[1]}else q=V}return oe.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:W},Rr(L)?oe.createElement("span",{className:"recharts-tooltip-item-name"},L):null,Rr(L)?oe.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,oe.createElement("span",{className:"recharts-tooltip-item-value"},q),oe.createElement("span",{className:"recharts-tooltip-item-unit"},$.unit||""))});return oe.createElement("ul",{className:"recharts-tooltip-item-list",style:E},T)}return null},N=Qw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),S=Qw({margin:0},f),k=!yt(y),C=k?y:"",O=xt("recharts-default-tooltip",p),R=xt("recharts-tooltip-label",x);k&&v&&h!==void 0&&h!==null&&(C=v(y,h));var A=w?{role:"status","aria-live":"assertive"}:{};return oe.createElement("div",p1({className:O,style:N},A),oe.createElement("p",{className:R,style:S},oe.isValidElement(C)?C:"".concat(C)),_())};function ef(e){"@babel/helpers - typeof";return ef=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},ef(e)}function Tm(e,t,r){return t=cJ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cJ(e){var t=uJ(e,"string");return ef(t)=="symbol"?t:t+""}function uJ(e,t){if(ef(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ef(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ud="recharts-tooltip-wrapper",dJ={visibility:"hidden"};function fJ(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return xt(ud,Tm(Tm(Tm(Tm({},"".concat(ud,"-right"),Ie(r)&&t&&Ie(t.x)&&r>=t.x),"".concat(ud,"-left"),Ie(r)&&t&&Ie(t.x)&&r<t.x),"".concat(ud,"-bottom"),Ie(n)&&t&&Ie(t.y)&&n>=t.y),"".concat(ud,"-top"),Ie(n)&&t&&Ie(t.y)&&n<t.y))}function dA(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,i=e.offsetTopLeft,s=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,f=e.viewBoxDimension;if(s&&Ie(s[n]))return s[n];var h=r[n]-l-i,d=r[n]+i;if(t[n])return o[n]?h:d;if(o[n]){var m=h,p=c[n];return m<p?Math.max(d,c[n]):Math.max(h,c[n])}var x=d+l,y=c[n]+f;return x>y?Math.max(h,c[n]):Math.max(d,c[n])}function hJ(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function mJ(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,s=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,f,h,d;return o.height>0&&o.width>0&&r?(h=dA({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=dA({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),f=hJ({translateX:h,translateY:d,useTranslate3d:l})):f=dJ,{cssProperties:f,cssClasses:fJ({translateX:h,translateY:d,coordinate:r})}}function Ac(e){"@babel/helpers - typeof";return Ac=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},Ac(e)}function fA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fA(Object(r),!0).forEach(function(n){y1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gJ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a$(n.key),n)}}function yJ(e,t,r){return t&&gJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vJ(e,t,r){return t=Dp(t),xJ(e,n$()?Reflect.construct(t,r||[],Dp(e).constructor):t.apply(e,r))}function xJ(e,t){if(t&&(Ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bJ(e)}function bJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(n$=function(){return!!e})()}function Dp(e){return Dp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dp(e)}function wJ(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&&g1(e,t)}function g1(e,t){return g1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},g1(e,t)}function y1(e,t,r){return t=a$(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a$(e){var t=_J(e,"string");return Ac(t)=="symbol"?t:t+""}function _J(e,t){if(Ac(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ac(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var mA=1,jJ=(function(e){function t(){var r;pJ(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=vJ(this,t,[].concat(i)),y1(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),y1(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,f,h;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(f=(h=r.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&f!==void 0?f:0}})}}),r}return wJ(t,e),yJ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>mA||Math.abs(n.height-this.state.lastBoundingBox.height)>mA)&&this.setState({lastBoundingBox:{width:n.width,height:n.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 n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,s=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,f=i.children,h=i.coordinate,d=i.hasPayload,m=i.isAnimationActive,p=i.offset,x=i.position,y=i.reverseDirection,v=i.useTranslate3d,b=i.viewBox,w=i.wrapperStyle,_=mJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:p,position:x,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:b}),N=_.cssClasses,S=_.cssProperties,k=hA(hA({transition:m&&s?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&d?"visible":"hidden",position:"absolute",top:0,left:0},w);return oe.createElement("div",{tabIndex:-1,className:N,style:k,ref:function(O){n.wrapperNode=O}},f)}}])})(I.PureComponent),NJ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},dl={isSsr:NJ()};function Rc(e){"@babel/helpers - typeof";return Rc=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},Rc(e)}function pA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pA(Object(r),!0).forEach(function(n){RS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kJ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s$(n.key),n)}}function CJ(e,t,r){return t&&kJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function FJ(e,t,r){return t=$p(t),OJ(e,i$()?Reflect.construct(t,r||[],$p(e).constructor):t.apply(e,r))}function OJ(e,t){if(t&&(Rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return EJ(e)}function EJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i$(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i$=function(){return!!e})()}function $p(e){return $p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$p(e)}function PJ(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&&v1(e,t)}function v1(e,t){return v1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},v1(e,t)}function RS(e,t,r){return t=s$(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s$(e){var t=TJ(e,"string");return Rc(t)=="symbol"?t:t+""}function TJ(e,t){if(Rc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function AJ(e){return e.dataKey}function RJ(e,t){return oe.isValidElement(e)?oe.cloneElement(e,t):typeof e=="function"?oe.createElement(e,t):oe.createElement(lJ,t)}var fr=(function(e){function t(){return SJ(this,t),FJ(this,t,arguments)}return PJ(t,e),CJ(t,[{key:"render",value:function(){var n=this,i=this.props,s=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,f=i.content,h=i.coordinate,d=i.filterNull,m=i.isAnimationActive,p=i.offset,x=i.payload,y=i.payloadUniqBy,v=i.position,b=i.reverseDirection,w=i.useTranslate3d,_=i.viewBox,N=i.wrapperStyle,S=x??[];d&&S.length&&(S=Q3(x.filter(function(C){return C.value!=null&&(C.hide!==!0||n.props.includeHidden)}),y,AJ));var k=S.length>0;return oe.createElement(jJ,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:m,active:s,coordinate:h,hasPayload:k,offset:p,position:v,reverseDirection:b,useTranslate3d:w,viewBox:_,wrapperStyle:N},RJ(f,gA(gA({},this.props),{},{payload:S})))}}])})(I.PureComponent);RS(fr,"displayName","Tooltip");RS(fr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!dl.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 Xw,yA;function IJ(){if(yA)return Xw;yA=1;var e=gi(),t=function(){return e.Date.now()};return Xw=t,Xw}var Zw,vA;function MJ(){if(vA)return Zw;vA=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Zw=t,Zw}var Jw,xA;function LJ(){if(xA)return Jw;xA=1;var e=MJ(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Jw=r,Jw}var e_,bA;function o$(){if(bA)return e_;bA=1;var e=LJ(),t=Ys(),r=cu(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function c(f){if(typeof f=="number")return f;if(r(f))return n;if(t(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=t(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var d=s.test(f);return d||o.test(f)?l(f.slice(2),d?2:8):i.test(f)?n:+f}return e_=c,e_}var t_,wA;function DJ(){if(wA)return t_;wA=1;var e=Ys(),t=IJ(),r=o$(),n="Expected a function",i=Math.max,s=Math.min;function o(l,c,f){var h,d,m,p,x,y,v=0,b=!1,w=!1,_=!0;if(typeof l!="function")throw new TypeError(n);c=r(c)||0,e(f)&&(b=!!f.leading,w="maxWait"in f,m=w?i(r(f.maxWait)||0,c):m,_="trailing"in f?!!f.trailing:_);function N(T){var $=h,D=d;return h=d=void 0,v=T,p=l.apply(D,$),p}function S(T){return v=T,x=setTimeout(O,c),b?N(T):p}function k(T){var $=T-y,D=T-v,W=c-$;return w?s(W,m-D):W}function C(T){var $=T-y,D=T-v;return y===void 0||$>=c||$<0||w&&D>=m}function O(){var T=t();if(C(T))return R(T);x=setTimeout(O,k(T))}function R(T){return x=void 0,_&&h?N(T):(h=d=void 0,p)}function A(){x!==void 0&&clearTimeout(x),v=0,h=y=d=x=void 0}function P(){return x===void 0?p:R(t())}function E(){var T=t(),$=C(T);if(h=arguments,d=this,y=T,$){if(x===void 0)return S(y);if(w)return clearTimeout(x),x=setTimeout(O,c),N(y)}return x===void 0&&(x=setTimeout(O,c)),p}return E.cancel=A,E.flush=P,E}return t_=o,t_}var r_,_A;function $J(){if(_A)return r_;_A=1;var e=DJ(),t=Ys(),r="Expected a function";function n(i,s,o){var l=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return t(o)&&(l="leading"in o?!!o.leading:l,c="trailing"in o?!!o.trailing:c),e(i,s,{leading:l,maxWait:s,trailing:c})}return r_=n,r_}var qJ=$J();const l$=Ft(qJ);function tf(e){"@babel/helpers - typeof";return tf=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},tf(e)}function jA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Am(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jA(Object(r),!0).forEach(function(n){BJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BJ(e,t,r){return t=zJ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zJ(e){var t=UJ(e,"string");return tf(t)=="symbol"?t:t+""}function UJ(e,t){if(tf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(tf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function HJ(e,t){return GJ(e)||KJ(e,t)||WJ(e,t)||VJ()}function VJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
423In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WJ(e,t){if(e){if(typeof e=="string")return NA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NA(e,t)}}function NA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function KJ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function GJ(e){if(Array.isArray(e))return e}var En=I.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,i=n===void 0?{width:-1,height:-1}:n,s=e.width,o=s===void 0?"100%":s,l=e.height,c=l===void 0?"100%":l,f=e.minWidth,h=f===void 0?0:f,d=e.minHeight,m=e.maxHeight,p=e.children,x=e.debounce,y=x===void 0?0:x,v=e.id,b=e.className,w=e.onResize,_=e.style,N=_===void 0?{}:_,S=I.useRef(null),k=I.useRef();k.current=w,I.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 C=I.useState({containerWidth:i.width,containerHeight:i.height}),O=HJ(C,2),R=O[0],A=O[1],P=I.useCallback(function(T,$){A(function(D){var W=Math.round(T),U=Math.round($);return D.containerWidth===W&&D.containerHeight===U?D:{containerWidth:W,containerHeight:U}})},[]);I.useEffect(function(){var T=function(K){var q,L=K[0].contentRect,V=L.width,z=L.height;P(V,z),(q=k.current)===null||q===void 0||q.call(k,V,z)};y>0&&(T=l$(T,y,{trailing:!0,leading:!1}));var $=new ResizeObserver(T),D=S.current.getBoundingClientRect(),W=D.width,U=D.height;return P(W,U),$.observe(S.current),function(){$.disconnect()}},[P,y]);var E=I.useMemo(function(){var T=R.containerWidth,$=R.containerHeight;if(T<0||$<0)return null;Ia(Co(o)||Co(c),`The width(%s) and height(%s) are both fixed numbers,
424       maybe you don't need to use a ResponsiveContainer.`,o,c),Ia(!r||r>0,"The aspect(%s) must be greater than zero.",r);var D=Co(o)?T:o,W=Co(c)?$:c;r&&r>0&&(D?W=D/r:W&&(D=W*r),m&&W>m&&(W=m)),Ia(D>0||W>0,`The width(%s) and height(%s) of chart should be greater than 0,
425       please check the style of container, or the props width(%s) and height(%s),
426       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
427       height and width.`,D,W,o,c,h,d,r);var U=!Array.isArray(p)&&Bi(p.type).endsWith("Chart");return oe.Children.map(p,function(H){return oe.isValidElement(H)?I.cloneElement(H,Am({width:D,height:W},U?{style:Am({height:"100%",width:"100%",maxHeight:W,maxWidth:D},H.props.style)}:{})):H})},[r,p,c,m,d,h,R,o]);return oe.createElement("div",{id:v?"".concat(v):void 0,className:xt("recharts-responsive-container",b),style:Am(Am({},N),{},{width:o,height:c,minWidth:h,minHeight:d,maxHeight:m}),ref:S},E)}),Ma=function(t){return null};Ma.displayName="Cell";function rf(e){"@babel/helpers - typeof";return rf=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},rf(e)}function SA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function x1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SA(Object(r),!0).forEach(function(n){YJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SA(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YJ(e,t,r){return t=QJ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QJ(e){var t=XJ(e,"string");return rf(t)=="symbol"?t:t+""}function XJ(e,t){if(rf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(rf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zl={widthCache:{},cacheCount:0},ZJ=2e3,JJ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},kA="recharts_measurement_span";function eee(e){var t=x1({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var Id=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||dl.isSsr)return{width:0,height:0};var n=eee(r),i=JSON.stringify({text:t,copyStyle:n});if(zl.widthCache[i])return zl.widthCache[i];try{var s=document.getElementById(kA);s||(s=document.createElement("span"),s.setAttribute("id",kA),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var o=x1(x1({},JJ),n);Object.assign(s.style,o),s.textContent="".concat(t);var l=s.getBoundingClientRect(),c={width:l.width,height:l.height};return zl.widthCache[i]=c,++zl.cacheCount>ZJ&&(zl.cacheCount=0,zl.widthCache={}),c}catch{return{width:0,height:0}}},tee=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function nf(e){"@babel/helpers - typeof";return nf=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},nf(e)}function qp(e,t){return iee(e)||aee(e,t)||nee(e,t)||ree()}function ree(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
428In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nee(e,t){if(e){if(typeof e=="string")return CA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return CA(e,t)}}function CA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function aee(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function iee(e){if(Array.isArray(e))return e}function see(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lee(n.key),n)}}function oee(e,t,r){return t&&FA(e.prototype,t),r&&FA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lee(e){var t=cee(e,"string");return nf(t)=="symbol"?t:t+""}function cee(e,t){if(nf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(nf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var OA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,EA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,uee=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,dee=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,c$={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},fee=Object.keys(c$),tc="NaN";function hee(e,t){return e*c$[t]}var Rm=(function(){function e(t,r){see(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!uee.test(r)&&(this.num=NaN,this.unit=""),fee.includes(r)&&(this.num=hee(t,r),this.unit="px")}return oee(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.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(r){var n,i=(n=dee.exec(r))!==null&&n!==void 0?n:[],s=qp(i,3),o=s[1],l=s[2];return new e(parseFloat(o),l??"")}}])})();function u$(e){if(e.includes(tc))return tc;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=OA.exec(t))!==null&&r!==void 0?r:[],i=qp(n,4),s=i[1],o=i[2],l=i[3],c=Rm.parse(s??""),f=Rm.parse(l??""),h=o==="*"?c.multiply(f):c.divide(f);if(h.isNaN())return tc;t=t.replace(OA,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,m=(d=EA.exec(t))!==null&&d!==void 0?d:[],p=qp(m,4),x=p[1],y=p[2],v=p[3],b=Rm.parse(x??""),w=Rm.parse(v??""),_=y==="+"?b.add(w):b.subtract(w);if(_.isNaN())return tc;t=t.replace(EA,_.toString())}return t}var PA=/\(([^()]*)\)/;function mee(e){for(var t=e;t.includes("(");){var r=PA.exec(t),n=qp(r,2),i=n[1];t=t.replace(PA,u$(i))}return t}function pee(e){var t=e.replace(/\s+/g,"");return t=mee(t),t=u$(t),t}function gee(e){try{return pee(e)}catch{return tc}}function n_(e){var t=gee(e.slice(5,-1));return t===tc?"":t}var yee=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],vee=["dx","dy","angle","className","breakAll"];function b1(){return b1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
428for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},b1.apply(this,arguments)}function TA(e,t){if(e==null)return{};var r=xee(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function AA(e,t){return jee(e)||_ee(e,t)||wee(e,t)||bee()}function bee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
429In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wee(e,t){if(e){if(typeof e=="string")return RA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return RA(e,t)}}function RA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _ee(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function jee(e){if(Array.isArray(e))return e}var d$=/[ \f\n\r\t\v\u2028\u2029]+/,f$=function(t){var r=t.children,n=t.breakAll,i=t.style;try{var s=[];yt(r)||(n?s=r.toString().split(""):s=r.toString().split(d$));var o=s.map(function(c){return{word:c,width:Id(c,i).width}}),l=n?0:Id(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},Nee=function(t,r,n,i,s){var o=t.maxLines,l=t.children,c=t.style,f=t.breakAll,h=Ie(o),d=l,m=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return D.reduce(function(W,U){var H=U.word,K=U.width,q=W[W.length-1];if(q&&(i==null||s||q.width+K+n<Number(i)))q.words.push(H),q.width+=K+n;else{var L={words:[H],width:K};W.push(L)}return W},[])},p=m(r),x=function(D){return D.reduce(function(W,U){return W.width>U.width?W:U})};if(!h)return p;for(var y="…",v=function(D){var W=d.slice(0,D),U=f$({breakAll:f,style:c,children:W+y}).wordsWithComputedWidth,H=m(U),K=H.length>o||x(H).width>Number(i);return[K,H]},b=0,w=d.length-1,_=0,N;b<=w&&_<=d.length-1;){var S=Math.floor((b+w)/2),k=S-1,C=v(k),O=AA(C,2),R=O[0],A=O[1],P=v(S),E=AA(P,1),T=E[0];if(!R&&!T&&(b=S+1),R&&T&&(w=S-1),!R&&T){N=A;break}_++}return N||p},IA=function(t){var r=yt(t)?[]:t.toString().split(d$);return[{words:r}]},See=function(t){var r=t.width,n=t.scaleToFit,i=t.children,s=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!dl.isSsr){var c,f,h=f$({breakAll:o,children:i,style:s});if(h){var d=h.wordsWithComputedWidth,m=h.spaceWidth;c=d,f=m}else return IA(i);return Nee({breakAll:o,children:i,maxLines:l,style:s},c,f,r,n)}return IA(i)},MA="#808080",Qo=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,s=i===void 0?0:i,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,f=c===void 0?"0.71em":c,h=t.scaleToFit,d=h===void 0?!1:h,m=t.textAnchor,p=m===void 0?"start":m,x=t.verticalAnchor,y=x===void 0?"end":x,v=t.fill,b=v===void 0?MA:v,w=TA(t,yee),_=I.useMemo(function(){return See({breakAll:w.breakAll,children:w.children,maxLines:w.maxLines,scaleToFit:d,style:w.style,width:w.width})},[w.breakAll,w.children,w.maxLines,d,w.style,w.width]),N=w.dx,S=w.dy,k=w.angle,C=w.className,O=w.breakAll,R=TA(w,vee);if(!Rr(n)||!Rr(s))return null;var A=n+(Ie(N)?N:0),P=s+(Ie(S)?S:0),E;switch(y){case"start":E=n_("calc(".concat(f,")"));break;case"middle":E=n_("calc(".concat((_.length-1)/2," * -").concat(l," + (").concat(f," / 2))"));break;default:E=n_("calc(".concat(_.length-1," * -").concat(l,")"));break}var T=[];if(d){var $=_[0].width,D=w.width;T.push("scale(".concat((Ie(D)?D/$:1)/$,")"))}return k&&T.push("rotate(".concat(k,", ").concat(A,", ").concat(P,")")),T.length&&(R.transform=T.join(" ")),oe.createElement("text",b1({},lt(R,!0),{x:A,y:P,className:xt("recharts-text",C),textAnchor:p,fill:b.includes("url")?MA:b}),_.map(function(W,U){var H=W.words.join(O?"":" ");return oe.createElement("tspan",{x:A,dy:U===0?E:l,key:"".concat(H,"-").concat(U)},H)}))};function Us(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function kee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function IS(e){let t,r,n;e.length!==2?(t=Us,r=(l,c)=>Us(e(l),c),n=(l,c)=>e(l)-c):(t=e===Us||e===kee?e:Cee,r=e,n=e);function i(l,c,f=0,h=l.length){if(f<h){if(t(c,c)!==0)return h;do{const d=f+h>>>1;r(l[d],c)<0?f=d+1:h=d}while(f<h)}return f}function s(l,c,f=0,h=l.length){if(f<h){if(t(c,c)!==0)return h;do{const d=f+h>>>1;r(l[d],c)<=0?f=d+1:h=d}while(f<h)}return f}function o(l,c,f=0,h=l.length){const d=i(l,c,f,h-1);return d>f&&n(l[d-1],c)>-n(l[d],c)?d-1:d}return{left:i,center:o,right:s}}function Cee(){return 0}function h$(e){return e===null?NaN:+e}function*Fee(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Oee=IS(Us),eh=Oee.right;IS(h$).center;class LA extends Map{constructor(t,r=Tee){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}
429get(t){return super.get(DA(this,t))}has(t){return super.has(DA(this,t))}set(t,r){return super.set(Eee(this,t),r)}delete(t){return super.delete(Pee(this,t))}}function DA({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function Eee({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Pee({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Tee(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Aee(e=Us){if(e===Us)return m$;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function m$(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Ree=Math.sqrt(50),Iee=Math.sqrt(10),Mee=Math.sqrt(2);function Bp(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),o=s>=Ree?10:s>=Iee?5:s>=Mee?2:1;let l,c,f;return i<0?(f=Math.pow(10,-i)/o,l=Math.round(e*f),c=Math.round(t*f),l/f<e&&++l,c/f>t&&--c,f=-f):(f=Math.pow(10,i)*o,l=Math.round(e/f),c=Math.round(t/f),l*f<e&&++l,c*f>t&&--c),c<l&&.5<=r&&r<2?Bp(e,t,r*2):[l,c,f]}function w1(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,s,o]=n?Bp(t,e,r):Bp(e,t,r);if(!(s>=i))return[];const l=s-i+1,c=new Array(l);if(n)if(o<0)for(let f=0;f<l;++f)c[f]=(s-f)/-o;else for(let f=0;f<l;++f)c[f]=(s-f)*o;else if(o<0)for(let f=0;f<l;++f)c[f]=(i+f)/-o;else for(let f=0;f<l;++f)c[f]=(i+f)*o;return c}function _1(e,t,r){return t=+t,e=+e,r=+r,Bp(e,t,r)[2]}function j1(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?_1(t,e,r):_1(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function $A(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function qA(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function p$(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?m$:Aee(i);n>r;){if(n-r>600){const c=n-r+1,f=t-r+1,h=Math.log(c),d=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*d*(c-d)/c)*(f-c/2<0?-1:1),p=Math.max(r,Math.floor(t-f*d/c+m)),x=Math.min(n,Math.floor(t+(c-f)*d/c+m));p$(e,t,p,x,i)}const s=e[t];let o=r,l=n;for(dd(e,r,t),i(e[n],s)>0&&dd(e,r,n);o<l;){for(dd(e,o,l),++o,--l;i(e[o],s)<0;)++o;for(;i(e[l],s)>0;)--l}i(e[r],s)===0?dd(e,r,l):(++l,dd(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function dd(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Lee(e,t,r){if(e=Float64Array.from(Fee(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return qA(e);if(t>=1)return $A(e);var n,i=(n-1)*t,s=Math.floor(i),o=$A(p$(e,s).subarray(0,s+1)),l=qA(e.subarray(s+1));return o+(l-o)*(i-s)}}function Dee(e,t,r=h$){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,s=Math.floor(i),o=+r(e[s],s,e),l=+r(e[s+1],s+1,e);return o+(l-o)*(i-s)}}function $ee(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,s=new Array(i);++n<i;)s[n]=e+n*r;return s}function ya(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function es(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 N1=Symbol("implicit");function MS(){var e=new LA,t=[],r=[],n=N1;function i(s){let o=e.get(s);if(o===void 0){if(n!==N1)return n;e.set(s,o=t.push(s)-1)}return r[o%r.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new LA;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(s){return arguments.length?(r=Array.from(s),i):r.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return MS(t,r).unknown(n)},ya.apply(i,arguments),i}function af(){var e=MS().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,s,o,l=!1,c=0,f=0,h=.5;delete e.unknown;function d(){var m=t().length,p=i<n,x=p?i:n,y=p?n:i;s=(y-x)/Math.max(1,m-c+f*2),l&&(s=Math.floor(s)),x+=(y-x-s*(m-c))*h,o=s*(1-c),l&&(x=Math.round(x),o=Math.round(o));var v=$ee(m).map(function(b){return x+s*b});return r(p?v.reverse():v)}return e.domain=function(m){return arguments.length?(t(m),d()):t()},e.range=function(m){return arguments.length?([n,i]=m,n=+n,i=+i,d()):[n,i]},e.rangeRound=function(m){return[n,i]=m,n=+n,i=+i,l=!0,d()},e.bandwidth=function(){return o},e.step=function(){return s},e.round=function(m){return arguments.length?(l=!!m,d()):l},e.padding=function(m){return arguments.length?(c=Math.min(1,f=+m),d()):c},e.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),d()):c},e.paddingOuter=function(m){return arguments.length?(f=+m,d()):f},e.align=function(m){return arguments.length?(h=Math.max(0,Math.min(1,m)),d()):h},e.copy=function(){return af(t(),[n,i]).round(l).paddingInner(c).paddingOuter(f).align(h)},ya.apply(d(),arguments)}function g$(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return g$(t())},e}function Md(){return g$(af.apply(null,arguments).paddingInner(1))}function LS(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function y$(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function th(){}var sf=.7,zp=1/sf,lc="\\s*([+-]?\\d+)\\s*",of="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ai="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qee=/^#([0-9a-f]{3,8}
vendor: 7,878 bytes, line 429
429)$/,Bee=new RegExp(`^rgb\\(${lc},${lc},${lc}\\)$`),zee=new RegExp(`^rgb\\(${ai},${ai},${ai}\\)$`),Uee=new RegExp(`^rgba\\(${lc},${lc},${lc},${of}\\)$`),Hee=new RegExp(`^rgba\\(${ai},${ai},${ai},${of}\\)$`),Vee=new RegExp(`^hsl\\(${of},${ai},${ai}\\)$`),Wee=new RegExp(`^hsla\\(${of},${ai},${ai},${of}\\)$`),BA={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};LS(th,lf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zA,formatHex:zA,formatHex8:Kee,formatHsl:Gee,formatRgb:UA,toString:UA});function zA(){return this.rgb().formatHex()}function Kee(){return this.rgb().formatHex8()}function Gee(){return v$(this).formatHsl()}function UA(){return this.rgb().formatRgb()}function lf(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=qee.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?HA(t):r===3?new Fn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Im(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Im(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=Bee.exec(e))?new Fn(t[1],t[2],t[3],1):(t=zee.exec(e))?new Fn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Uee.exec(e))?Im(t[1],t[2],t[3],t[4]):(t=Hee.exec(e))?Im(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vee.exec(e))?KA(t[1],t[2]/100,t[3]/100,1):(t=Wee.exec(e))?KA(t[1],t[2]/100,t[3]/100,t[4]):BA.hasOwnProperty(e)?HA(BA[e]):e==="transparent"?new Fn(NaN,NaN,NaN,0):null}function HA(e){return new Fn(e>>16&255,e>>8&255,e&255,1)}function Im(e,t,r,n){return n<=0&&(e=t=r=NaN),new Fn(e,t,r,n)}function Yee(e){return e instanceof th||(e=lf(e)),e?(e=e.rgb(),new Fn(e.r,e.g,e.b,e.opacity)):new Fn}function S1(e,t,r,n){return arguments.length===1?Yee(e):new Fn(e,t,r,n??1)}function Fn(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}LS(Fn,S1,y$(th,{brighter(e){return e=e==null?zp:Math.pow(zp,e),new Fn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sf:Math.pow(sf,e),new Fn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fn(Bo(this.r),Bo(this.g),Bo(this.b),Up(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:VA,formatHex:VA,formatHex8:Qee,formatRgb:WA,toString:WA}));function VA(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}`}function Qee(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}${Fo((isNaN(this.opacity)?1:this.opacity)*255)}`}function WA(){const e=Up(this.opacity);return`${e===1?"rgb(":"rgba("}${Bo(this.r)}, ${Bo(this.g)}, ${Bo(this.b)}${e===1?")":`, ${e})`}`}function Up(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fo(e){return e=Bo(e),(e<16?"0":"")+e.toString(16)}function KA(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Aa(e,t,r,n)}function v$(e){if(e instanceof Aa)return new Aa(e.h,e.s,e.l,e.opacity);if(e instanceof th||(e=lf(e)),!e)return new Aa;if(e instanceof Aa)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),s=Math.max(t,r,n),o=NaN,l=s-i,c=(s+i)/2;return l?(t===s?o=(r-n)/l+(r<n)*6:r===s?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?s+i:2-s-i,o*=60):l=c>0&&c<1?0:o,new Aa(o,l,c,e.opacity)}function Xee(e,t,r,n){return arguments.length===1?v$(e):new Aa(e,t,r,n??1)}function Aa(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}LS(Aa,Xee,y$(th,{brighter(e){return e=e==null?zp:Math.pow(zp,e),new Aa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sf:Math.pow(sf,e),new Aa(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,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Fn(a_(e>=240?e-240:e+120,i,n),a_(e,i,n),a_(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Aa(GA(this.h),Mm(this.s),Mm(this.l),Up(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=Up(this.opacity);return`${e===1?"hsl(":"hsla("}${GA(this.h)}, ${Mm(this.s)*100}%, ${Mm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function GA(e){return e=(e||0)%360,e<0?e+360:e}function Mm(e){return Math.max(0,Math.min(1,e||0))}function a_(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const DS=e=>()=>e;function Zee(e,t){return function(r){return e+r*t}}function Jee(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function ete(e){return(e=+e)==1?x$:function(t,r){return r-t?Jee(t,r,e):DS(isNaN(t)?r:t)}}function x$(e,t){var r=t-e;return r?Zee(e,r):DS(isNaN(e)?t:e)}const YA=(function e(t){var r=ete(t);function n(i,s){var o=r((i=S1(i)).r,(s=S1(s)).r),l=r(i.g,s.g),c=r(i.b,s.b),f=x$(i.opacity,s.opacity);return function(h){return i.r=o(h),i.g=l(h),i.b=c(h),i.opacity=f(h),i+""}}return n.gamma=e,n})(1);function tte(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(s){for(i=0;i<r;++i)n[i]=e[i]*(1-s)+t[i]*s;return n}}function rte(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function nte(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),s=new Array(r),o;for(o=0;o<n;++o)i[o]=hu(e[o],t[o]);for(;o<r;
vendor: 5,514 bytes, line 429
429++o)s[o]=t[o];return function(l){for(o=0;o<n;++o)s[o]=i[o](l);return s}}function ate(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Hp(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function ite(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=hu(e[i],t[i]):n[i]=t[i];return function(s){for(i in r)n[i]=r[i](s);return n}}var k1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,i_=new RegExp(k1.source,"g");function ste(e){return function(){return e}}function ote(e){return function(t){return e(t)+""}}function lte(e,t){var r=k1.lastIndex=i_.lastIndex=0,n,i,s,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=k1.exec(e))&&(i=i_.exec(t));)(s=i.index)>r&&(s=t.slice(r,s),l[o]?l[o]+=s:l[++o]=s),(n=n[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:Hp(n,i)})),r=i_.lastIndex;return r<t.length&&(s=t.slice(r),l[o]?l[o]+=s:l[++o]=s),l.length<2?c[0]?ote(c[0].x):ste(t):(t=c.length,function(f){for(var h=0,d;h<t;++h)l[(d=c[h]).i]=d.x(f);return l.join("")})}function hu(e,t){var r=typeof t,n;return t==null||r==="boolean"?DS(t):(r==="number"?Hp:r==="string"?(n=lf(t))?(t=n,YA):lte:t instanceof lf?YA:t instanceof Date?ate:rte(t)?tte:Array.isArray(t)?nte:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ite:Hp)(e,t)}function $S(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function cte(e,t){t===void 0&&(t=e,e=hu);for(var r=0,n=t.length-1,i=t[0],s=new Array(n<0?0:n);r<n;)s[r]=e(i,i=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return s[l](o-l)}}function ute(e){return function(){return e}}function Vp(e){return+e}var QA=[0,1];function vn(e){return e}function C1(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:ute(isNaN(t)?NaN:.5)}function dte(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function fte(e,t,r){var n=e[0],i=e[1],s=t[0],o=t[1];return i<n?(n=C1(i,n),s=r(o,s)):(n=C1(n,i),s=r(s,o)),function(l){return s(n(l))}}function hte(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),s=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=C1(e[o],e[o+1]),s[o]=r(t[o],t[o+1]);return function(l){var c=eh(e,l,1,n)-1;return s[c](i[c](l))}}function rh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function sy(){var e=QA,t=QA,r=hu,n,i,s,o=vn,l,c,f;function h(){var m=Math.min(e.length,t.length);return o!==vn&&(o=dte(e[0],e[m-1])),l=m>2?hte:fte,c=f=null,d}function d(m){return m==null||isNaN(m=+m)?s:(c||(c=l(e.map(n),t,r)))(n(o(m)))}return d.invert=function(m){return o(i((f||(f=l(t,e.map(n),Hp)))(m)))},d.domain=function(m){return arguments.length?(e=Array.from(m,Vp),h()):e.slice()},d.range=function(m){return arguments.length?(t=Array.from(m),h()):t.slice()},d.rangeRound=function(m){return t=Array.from(m),r=$S,h()},d.clamp=function(m){return arguments.length?(o=m?!0:vn,h()):o!==vn},d.interpolate=function(m){return arguments.length?(r=m,h()):r},d.unknown=function(m){return arguments.length?(s=m,d):s},function(m,p){return n=m,i=p,h()}}function qS(){return sy()(vn,vn)}function mte(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Wp(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ic(e){return e=Wp(Math.abs(e)),e?e[1]:NaN}function pte(e,t){return function(r,n){for(var i=r.length,s=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),s.push(r.substring(i-=l,i+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function gte(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var yte=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cf(e){if(!(t=yte.exec(e)))throw new Error("invalid format: "+e);var t;return new BS({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]})}cf.prototype=BS.prototype;function BS(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+""}BS.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 vte(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var b$;function xte(e,t){var r=Wp(e,t);if(!r)return e+"";var n=r[0],i=r[1],s=i-(b$=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return s===o?n:s>o?n+new Array(s-o+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+Wp(e,Math.max(0,t+s-1))[0]}function XA(e,t){var r=Wp(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const ZA={"%":(e,t)=>
vendor: 4,886 bytes, line 429
429(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:mte,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)=>XA(e*100,t),r:XA,s:xte,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function JA(e){return e}var e4=Array.prototype.map,t4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function bte(e){var t=e.grouping===void 0||e.thousands===void 0?JA:pte(e4.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?JA:gte(e4.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 f(d){d=cf(d);var m=d.fill,p=d.align,x=d.sign,y=d.symbol,v=d.zero,b=d.width,w=d.comma,_=d.precision,N=d.trim,S=d.type;S==="n"?(w=!0,S="g"):ZA[S]||(_===void 0&&(_=12),N=!0,S="g"),(v||m==="0"&&p==="=")&&(v=!0,m="0",p="=");var k=y==="$"?r:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",C=y==="$"?n:/[%p]/.test(S)?o:"",O=ZA[S],R=/[defgprs%]/.test(S);_=_===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function A(P){var E=k,T=C,$,D,W;if(S==="c")T=O(P)+T,P="";else{P=+P;var U=P<0||1/P<0;if(P=isNaN(P)?c:O(Math.abs(P),_),N&&(P=vte(P)),U&&+P==0&&x!=="+"&&(U=!1),E=(U?x==="("?x:l:x==="-"||x==="("?"":x)+E,T=(S==="s"?t4[8+b$/3]:"")+T+(U&&x==="("?")":""),R){for($=-1,D=P.length;++$<D;)if(W=P.charCodeAt($),48>W||W>57){T=(W===46?i+P.slice($+1):P.slice($))+T,P=P.slice(0,$);break}}}w&&!v&&(P=t(P,1/0));var H=E.length+P.length+T.length,K=H<b?new Array(b-H+1).join(m):"";switch(w&&v&&(P=t(K+P,K.length?b-T.length:1/0),K=""),p){case"<":P=E+P+T+K;break;case"=":P=E+K+P+T;break;case"^":P=K.slice(0,H=K.length>>1)+E+P+T+K.slice(H);break;default:P=K+E+P+T;break}return s(P)}return A.toString=function(){return d+""},A}function h(d,m){var p=f((d=cf(d),d.type="f",d)),x=Math.max(-8,Math.min(8,Math.floor(Ic(m)/3)))*3,y=Math.pow(10,-x),v=t4[8+x/3];return function(b){return p(y*b)+v}}return{format:f,formatPrefix:h}}var Lm,zS,w$;wte({thousands:",",grouping:[3],currency:["$",""]});function wte(e){return Lm=bte(e),zS=Lm.format,w$=Lm.formatPrefix,Lm}function _te(e){return Math.max(0,-Ic(Math.abs(e)))}function jte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ic(t)/3)))*3-Ic(Math.abs(e)))}function Nte(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ic(t)-Ic(e))+1}function _$(e,t,r,n){var i=j1(e,t,r),s;switch(n=cf(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(s=jte(i,o))&&(n.precision=s),w$(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=Nte(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=_te(i))&&(n.precision=s-(n.type==="%")*2);break}}return zS(n)}function Qs(e){var t=e.domain;return e.ticks=function(r){var n=t();return w1(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return _$(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,s=n.length-1,o=n[i],l=n[s],c,f,h=10;for(l<o&&(f=o,o=l,l=f,f=i,i=s,s=f);h-- >0;){if(f=_1(o,l,r),f===c)return n[i]=o,n[s]=l,t(n);if(f>0)o=Math.floor(o/f)*f,l=Math.ceil(l/f)*f;else if(f<0)o=Math.ceil(o*f)/f,l=Math.floor(l*f)/f;else break;c=f}return e},e}function Kp(){var e=qS();return e.copy=function(){return rh(e,Kp())},ya.apply(e,arguments),Qs(e)}function j$(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Vp),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return j$(e).unknown(t)},e=arguments.length?Array.from(e,Vp):[0,1],Qs(r)}function N$(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],s=e[n],o;return s<i&&(o=r,r=n,n=o,o=i,i=s,s=o),e[r]=t.floor(i),e[n]=t.ceil(s),e}function r4(e){return Math.log(e)}function n4(e){return Math.exp(e)}function Ste(e){return-Math.log(-e)}function kte(e){return-Math.exp(-e)}function Cte(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Fte(e){return e===10?Cte:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ote(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 a4(e){return(t,r)=>-e(-t,r)}function US(e){const t=e(r4,n4),r=t.domain;let n=10,i,s;function o(){return i=Ote(n),s=Fte(n),r()[0]<0?(i=a4(i),s=a4(s),e(Ste,kte)):e(r4,n4),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let f=c[0],h=c[c.length-1];const d=h<f;d&&([f,h]=[h,f]);let m=i(f),p=i(h),x,y;const v=l==null?10:+l;let b=[];if(!(n%1)&&p-m<v){if(m=Math.floor(m),p=Math.ceil(p),f>0){for(;m<=p;++m)for(x=1;x<n;
429++x)if(y=m<0?x/s(-m):x*s(m),!(y<f)){if(y>h)break;b.push(y)}}else for(;m<=p;++m)for(x=n-1;x>=1;--x)if(y=m>0?x/s(-m):x*s(m),!(y<f)){if(y>h)break;b.push(y)}b.length*2<v&&(b=w1(f,h,v))}else b=w1(m,p,Math.min(p-m,v)).map(s);return d?b.reverse():b},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=cf(c)).precision==null&&(c.trim=!0),c=zS(c)),l===1/0)return c;const f=Math.max(1,n*l/t.ticks().length);return h=>{let d=h/s(Math.round(i(h)));return d*n<n-.5&&(d*=n),d<=f?c(h):""}},t.nice=()=>r(N$(r(),{floor:l=>s(Math.floor(i(l))),ceil:l=>s(Math.ceil(i(l)))})),t}function S$(){const e=US(sy()).domain([1,10]);return e.copy=()=>rh(e,S$()).base(e.base()),ya.apply(e,arguments),e}function i4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function s4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function HS(e){var t=1,r=e(i4(t),s4(t));return r.constant=function(n){return arguments.length?e(i4(t=+n),s4(t)):t},Qs(r)}function k$(){var e=HS(sy());return e.copy=function(){return rh(e,k$()).constant(e.constant())},ya.apply(e,arguments)}function o4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ete(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Pte(e){return e<0?-e*e:e*e}function VS(e){var t=e(vn,vn),r=1;function n(){return r===1?e(vn,vn):r===.5?e(Ete,Pte):e(o4(r),o4(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Qs(t)}function WS(){var e=VS(sy());return e.copy=function(){return rh(e,WS()).exponent(e.exponent())},ya.apply(e,arguments),e}function Tte(){return WS.apply(null,arguments).exponent(.5)}function l4(e){return Math.sign(e)*e*e}function Ate(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function C$(){var e=qS(),t=[0,1],r=!1,n;function i(s){var o=Ate(e(s));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(s){return e.invert(l4(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,Vp)).map(l4)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(r=!!s,i):r},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return C$(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ya.apply(i,arguments),Qs(i)}function F$(){var e=[],t=[],r=[],n;function i(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=Dee(e,o/l);return s}function s(o){return o==null||isNaN(o=+o)?n:t[eh(r,o)]}return s.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},s.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(Us),i()},s.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},s.unknown=function(o){return arguments.length?(n=o,s):n},s.quantiles=function(){return r.slice()},s.copy=function(){return F$().domain(e).range(t).unknown(n)},ya.apply(s,arguments)}function O$(){var e=0,t=1,r=1,n=[.5],i=[0,1],s;function o(c){return c!=null&&c<=c?i[eh(n,c,0,r)]:s}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+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?(r=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var f=i.indexOf(c);return f<0?[NaN,NaN]:f<1?[e,n[0]]:f>=r?[n[r-1],t]:[n[f-1],n[f]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return O$().domain([e,t]).range(i).unknown(s)},ya.apply(Qs(o),arguments)}function E$(){var e=[.5],t=[0,1],r,n=1;function i(s){return s!=null&&s<=s?t[eh(e,s,0,n)]:r}return i.domain=function(s){return arguments.length?(e=Array.from(s),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return E$().domain(e).range(t).unknown(r)},ya.apply(i,arguments)}const s_=new Date,o_=new Date;function Mr(e,t,r,n){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),l=i.ceil(s);return s-o<l-s?o:l},i.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,l)=>{const c=[];if(s=i.ceil(s),l=l==null?1:Math.floor(l),!(s<o)||!(l>0))return c;let f;do c.push(f=new Date(+s)),t(s,l),e(s);while(f<s&&s<o);return c},i.filter=s=>Mr(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),r&&(i.count=(s,o)=>(s_.setTime(+s),o_.setTime(+o),e(s_),e(o_),Math.floor(r(s_,o_))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?o=>n(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const Gp=Mr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Gp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Mr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Gp);Gp.range;const Li=1e3,pa=Li*60,Di=pa*60,Ki=Di*24,KS=Ki*7,c4=Ki*30,l_=Ki*365,Oo=Mr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Li)},(e,t)=>(t-e)/Li,e=>e.getUTCSeconds());Oo.range;const GS=Mr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Li)},(e,t)=>{e.setTime(+e+t*pa)},(e,t)=>(t-e)/pa,e=>e.getMinutes());GS.range;const YS=Mr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pa)},(e,t)=>(t-e)/pa,e=>e.getUTCMinutes());YS.range;const QS=Mr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Li-e.getMinutes()*pa)},(e,t)=>{e.setTime(+e+t*Di)},(e,t)=>(t-e)/Di,e=>e.getHours());QS.range;const XS=Mr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Di)},(e,t)=>(t-e)/Di,e=>e.getUTCHours());XS.range;const nh=Mr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pa)/Ki,e=>e.getDate()-1);nh.range;const oy=Mr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ki,e=>e.getUTCDate()-1);oy.range;const P$=Mr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ki,e=>Math.floor(e/Ki));P$.range;function fl(e){return Mr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*pa)/KS)}const ly=fl(0),Yp=fl(1),Rte=fl(2),Ite=fl(3),Mc=fl(4),Mte=fl(5),Lte=fl(6);ly.range;Yp.range;Rte.range;Ite.range;Mc.range;Mte.range;Lte.range;function hl(e){return Mr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/KS)}const cy=hl(0),Qp=hl(1),Dte=hl(2),$te=hl(3),Lc=hl(4),qte=hl(5),Bte=hl(6);cy.range;Qp.range;Dte.range;$te.range;Lc.range;qte.range;Bte.range;const ZS=Mr(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());ZS.range;const JS=Mr(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());JS.range;const Gi=Mr(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());Gi.every=e=>
vendor: 10,234 bytes, line 429
429!isFinite(e=Math.floor(e))||!(e>0)?null:Mr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Gi.range;const Yi=Mr(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());Yi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Mr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Yi.range;function T$(e,t,r,n,i,s){const o=[[Oo,1,Li],[Oo,5,5*Li],[Oo,15,15*Li],[Oo,30,30*Li],[s,1,pa],[s,5,5*pa],[s,15,15*pa],[s,30,30*pa],[i,1,Di],[i,3,3*Di],[i,6,6*Di],[i,12,12*Di],[n,1,Ki],[n,2,2*Ki],[r,1,KS],[t,1,c4],[t,3,3*c4],[e,1,l_]];function l(f,h,d){const m=h<f;m&&([f,h]=[h,f]);const p=d&&typeof d.range=="function"?d:c(f,h,d),x=p?p.range(f,+h+1):[];return m?x.reverse():x}function c(f,h,d){const m=Math.abs(h-f)/d,p=IS(([,,v])=>v).right(o,m);if(p===o.length)return e.every(j1(f/l_,h/l_,d));if(p===0)return Gp.every(Math.max(j1(f,h,d),1));const[x,y]=o[m/o[p-1][2]<o[p][2]/m?p-1:p];return x.every(y)}return[l,c]}const[zte,Ute]=T$(Yi,JS,cy,P$,XS,YS),[Hte,Vte]=T$(Gi,ZS,ly,nh,QS,GS);function c_(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 u_(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 fd(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function Wte(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,s=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,f=hd(i),h=md(i),d=hd(s),m=md(s),p=hd(o),x=md(o),y=hd(l),v=md(l),b=hd(c),w=md(c),_={a:U,A:H,b:K,B:q,c:null,d:p4,e:p4,f:pre,g:Sre,G:Cre,H:fre,I:hre,j:mre,L:A$,m:gre,M:yre,p:L,q:V,Q:v4,s:x4,S:vre,u:xre,U:bre,V:wre,w:_re,W:jre,x:null,X:null,y:Nre,Y:kre,Z:Fre,"%":y4},N={a:z,A:Z,b:re,B:G,c:null,d:g4,e:g4,f:Tre,g:zre,G:Hre,H:Ore,I:Ere,j:Pre,L:I$,m:Are,M:Rre,p:X,q:ie,Q:v4,s:x4,S:Ire,u:Mre,U:Lre,V:Dre,w:$re,W:qre,x:null,X:null,y:Bre,Y:Ure,Z:Vre,"%":y4},S={a:A,A:P,b:E,B:T,c:$,d:h4,e:h4,f:lre,g:f4,G:d4,H:m4,I:m4,j:are,L:ore,m:nre,M:ire,p:R,q:rre,Q:ure,s:dre,S:sre,u:Xte,U:Zte,V:Jte,w:Qte,W:ere,x:D,X:W,y:f4,Y:d4,Z:tre,"%":cre};_.x=k(r,_),_.X=k(n,_),_.c=k(t,_),N.x=k(r,N),N.X=k(n,N),N.c=k(t,N);function k(J,ue){return function(ge){var fe=[],Ee=-1,Oe=0,Ve=J.length,Ae,tt,ye;for(ge instanceof Date||(ge=new Date(+ge));++Ee<Ve;)J.charCodeAt(Ee)===37&&(fe.push(J.slice(Oe,Ee)),(tt=u4[Ae=J.charAt(++Ee)])!=null?Ae=J.charAt(++Ee):tt=Ae==="e"?" ":"0",(ye=ue[Ae])&&(Ae=ye(ge,tt)),fe.push(Ae),Oe=Ee+1);return fe.push(J.slice(Oe,Ee)),fe.join("")}}function C(J,ue){return function(ge){var fe=fd(1900,void 0,1),Ee=O(fe,J,ge+="",0),Oe,Ve;if(Ee!=ge.length)return null;if("Q"in fe)return new Date(fe.Q);if("s"in fe)return new Date(fe.s*1e3+("L"in fe?fe.L:0));if(ue&&!("Z"in fe)&&(fe.Z=0),"p"in fe&&(fe.H=fe.H%12+fe.p*12),fe.m===void 0&&(fe.m="q"in fe?fe.q:0),"V"in fe){if(fe.V<1||fe.V>53)return null;"w"in fe||(fe.w=1),"Z"in fe?(Oe=u_(fd(fe.y,0,1)),Ve=Oe.getUTCDay(),Oe=Ve>4||Ve===0?Qp.ceil(Oe):Qp(Oe),Oe=oy.offset(Oe,(fe.V-1)*7),fe.y=Oe.getUTCFullYear(),fe.m=Oe.getUTCMonth(),fe.d=Oe.getUTCDate()+(fe.w+6)%7):(Oe=c_(fd(fe.y,0,1)),Ve=Oe.getDay(),Oe=Ve>4||Ve===0?Yp.ceil(Oe):Yp(Oe),Oe=nh.offset(Oe,(fe.V-1)*7),fe.y=Oe.getFullYear(),fe.m=Oe.getMonth(),fe.d=Oe.getDate()+(fe.w+6)%7)}else("W"in fe||"U"in fe)&&("w"in fe||(fe.w="u"in fe?fe.u%7:"W"in fe?1:0),Ve="Z"in fe?u_(fd(fe.y,0,1)).getUTCDay():c_(fd(fe.y,0,1)).getDay(),fe.m=0,fe.d="W"in fe?(fe.w+6)%7+fe.W*7-(Ve+5)%7:fe.w+fe.U*7-(Ve+6)%7);return"Z"in fe?(fe.H+=fe.Z/100|0,fe.M+=fe.Z%100,u_(fe)):c_(fe)}}function O(J,ue,ge,fe){for(var Ee=0,Oe=ue.length,Ve=ge.length,Ae,tt;Ee<Oe;){if(fe>=Ve)return-1;if(Ae=ue.charCodeAt(Ee++),Ae===37){if(Ae=ue.charAt(Ee++),tt=S[Ae in u4?ue.charAt(Ee++):Ae],!tt||(fe=tt(J,ge,fe))<0)return-1}else if(Ae!=ge.charCodeAt(fe++))return-1}return fe}function R(J,ue,ge){var fe=f.exec(ue.slice(ge));return fe?(J.p=h.get(fe[0].toLowerCase()),ge+fe[0].length):-1}function A(J,ue,ge){var fe=p.exec(ue.slice(ge));return fe?(J.w=x.get(fe[0].toLowerCase()),ge+fe[0].length):-1}function P(J,ue,ge){var fe=d.exec(ue.slice(ge));return fe?(J.w=m.get(fe[0].toLowerCase()),ge+fe[0].length):-1}function E(J,ue,ge){var fe=b.exec(ue.slice(ge));return fe?(J.m=w.get(fe[0].toLowerCase()),ge+fe[0].length):-1}function T(J,ue,ge){var fe=y.exec(ue.slice(ge));return fe?(J.m=v.get(fe[0].toLowerCase()),ge+fe[0].length):-1}function $(J,ue,ge){return O(J,t,ue,ge)}function D(J,ue,ge){return O(J,r,ue,ge)}function W(J,ue,ge){return O(J,n,ue,ge)}function U(J){return o[J.getDay()]}function H(J){return s[J.getDay()]}function K(J){return c[J.getMonth()]}function q(J){return l[J.getMonth()]}function L(J){return i[+(J.getHours()>=12)]}function V(J){return 1+~~(J.getMonth()/3)}function z(J){return o[J.getUTCDay()]}function Z(J){return s[J.getUTCDay()]}function re(J){return c[J.getUTCMonth()]}function G(J){return l[J.getUTCMonth()]}function X(J){return i[+(J.getUTCHours()>=12)]}function ie(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var ue=k(J+="",_);return ue.toString=function(){return J},ue},parse:function(J){var ue=C(J+="",!1);return ue.toString=function(){return J},ue},utcFormat:function(J){var ue=k(J+="",N);return ue.toString=function(){return J},ue},utcParse:function(J){var ue=C(J+="",!0);return ue.toString=function(){return J},ue}}}var u4={"-":"",_:" ",0:"0"},Vr=/^\s*\d+/,Kte=/^%/,Gte=/[\\^$*+?|[\]().{}]/g;function Rt(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",s=i.length;return n+(s<r?new Array(r-s+1).join(t)+i:i)}function Yte(e){return e.replace(Gte,"\\$&")}function hd(e){return new RegExp("^(?:"+e.map(Yte).join("|")+")","i")}function md(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function Qte(e,t,r){var n=Vr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Xte(e,t,r){var n=Vr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Zte(e,t,r){var n=Vr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Jte(e,t,r){var n=Vr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function ere(e,t,r){var n=Vr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function d4(e,t,r){var n=Vr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function f4(e,t,r){var n=Vr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function tre(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function rre(e,t,r){var n=Vr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function nre(e,t,r){var n=Vr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function h4(e,t,r){var n=Vr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function are(e,t,r){var n=Vr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function m4(e,t,r){var n=Vr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function ire(e,t,r){var n=Vr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function sre(e,t,r){var n=Vr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function ore(e,t,r){var n=Vr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function lre(e,t,r){var n=Vr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function cre(e,t,r){var n=Kte.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function ure(e,t,r){var n=Vr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function dre(e,t,r){var n=Vr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function p4(e,t){return Rt(e.getDate(),t,2)}function fre(e,t){return Rt(e.getHours(),t,2)}function hre(e,t){return Rt(e.getHours()%12||12,t,2)}function mre(e,t){return Rt(1+nh.count(Gi(e),e),t,3)}function A$(e,t){return Rt(e.getMilliseconds(),t,3)}function pre(e,t){return A$(e,t)+"000"}function gre(e,t){return Rt(e.getMonth()+1,t,2)}function yre(e,t){return Rt(e.getMinutes(),t,2)}function vre(e,t){return Rt(e.getSeconds(),t,2)}function xre(e){var t=e.getDay();return t===0?7:t}function bre(e,t){return Rt(ly.count(Gi(e)-1,e),t,2)}function R$(e){var t=e.getDay();return t>=4||t===0?Mc(e):Mc.ceil(e)}function wre(e,t){return e=R$(e),Rt(Mc.count(Gi(e),e)+(Gi(e).getDay()===4),t,2)}function _re(e){return e.getDay()}function jre(e,t){return Rt(Yp.count(Gi(e)-1,e),t,2)}function Nre(e,t){return Rt(e.getFullYear()%100,t,2)}function Sre(e,t){return e=R$(e),Rt(e.getFullYear()%100,t,2)}function kre(e,t){return Rt(e.getFullYear()%1e4,t,4)}function Cre(e,t){var r=e.getDay();return e=r>=4||r===0?Mc(e):Mc.ceil(e),Rt(e.getFullYear()%1e4,t,4)}function Fre(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Rt(t/60|0,"0",2)+Rt(t%60,"0",2)}function g4(e,t){return Rt(e.getUTCDate(),t,2)}function Ore(e,t){return Rt(e.getUTCHours(),t,2)}function Ere(e,t){return Rt(e.getUTCHours()%12||12,t,2)}function Pre(e,t){return Rt(1+oy.count(Yi(e),e),t,3)}function I$(e,t){return Rt(e.getUTCMilliseconds(),t,3)}function Tre(e,t){return I$(e,t)+"000"}function Are(e,t){return Rt(e.getUTCMonth()+1,t,2)}function Rre(e,t){return Rt(e.getUTCMinutes(),t,2)}function Ire(e,t){return Rt(e.getUTCSeconds(),t,2)}function Mre(e){var t=e.getUTCDay();return t===0?7:t}function Lre(e,t){return Rt(cy.count(Yi(e)-1,e),t,2)}function M$(e){var t=e.getUTCDay();return t>=4||t===0?Lc(e):Lc.ceil(e)}function Dre(e,t){return e=M$(e),Rt(Lc.count(Yi(e),e)+(Yi(e).getUTCDay()===4),t,2)}function $re(e){return e.getUTCDay()}function qre(e,t){return Rt(Qp.count(Yi(e)-1,e),t,2)}function Bre(e,t){return Rt(e.getUTCFullYear()%100,t,2)}function zre(e,t){return e=M$(e),Rt(e.getUTCFullYear()%100,t,2)}function Ure(e,t){return Rt(e.getUTCFullYear()%1e4,t,4)}function Hre(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Lc(e):Lc.ceil(e),Rt(e.getUTCFullYear()%1e4,t,4)}function Vre(){return"+0000"}function y4(){return"%"}function v4(e){return+e}function x4(e){return Math.floor(+e/1e3)}var Ul,L$,D$;Wre({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
429ay","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 Wre(e){return Ul=Wte(e),L$=Ul.format,Ul.parse,D$=Ul.utcFormat,Ul.utcParse,Ul}function Kre(e){return new Date(e)}function Gre(e){return e instanceof Date?+e:+new Date(+e)}function ek(e,t,r,n,i,s,o,l,c,f){var h=qS(),d=h.invert,m=h.domain,p=f(".%L"),x=f(":%S"),y=f("%I:%M"),v=f("%I %p"),b=f("%a %d"),w=f("%b %d"),_=f("%B"),N=f("%Y");function S(k){return(c(k)<k?p:l(k)<k?x:o(k)<k?y:s(k)<k?v:n(k)<k?i(k)<k?b:w:r(k)<k?_:N)(k)}return h.invert=function(k){return new Date(d(k))},h.domain=function(k){return arguments.length?m(Array.from(k,Gre)):m().map(Kre)},h.ticks=function(k){var C=m();return e(C[0],C[C.length-1],k??10)},h.tickFormat=function(k,C){return C==null?S:f(C)},h.nice=function(k){var C=m();return(!k||typeof k.range!="function")&&(k=t(C[0],C[C.length-1],k??10)),k?m(N$(C,k)):h},h.copy=function(){return rh(h,ek(e,t,r,n,i,s,o,l,c,f))},h}function Yre(){return ya.apply(ek(Hte,Vte,Gi,ZS,ly,nh,QS,GS,Oo,L$).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Qre(){return ya.apply(ek(zte,Ute,Yi,JS,cy,oy,XS,YS,Oo,D$).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function uy(){var e=0,t=1,r,n,i,s,o=vn,l=!1,c;function f(d){return d==null||isNaN(d=+d)?c:o(i===0?.5:(d=(s(d)-r)*i,l?Math.max(0,Math.min(1,d)):d))}f.domain=function(d){return arguments.length?([e,t]=d,r=s(e=+e),n=s(t=+t),i=r===n?0:1/(n-r),f):[e,t]},f.clamp=function(d){return arguments.length?(l=!!d,f):l},f.interpolator=function(d){return arguments.length?(o=d,f):o};function h(d){return function(m){var p,x;return arguments.length?([p,x]=m,o=d(p,x),f):[o(0),o(1)]}}return f.range=h(hu),f.rangeRound=h($S),f.unknown=function(d){return arguments.length?(c=d,f):c},function(d){return s=d,r=d(e),n=d(t),i=r===n?0:1/(n-r),f}}function Xs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function $$(){var e=Qs(uy()(vn));return e.copy=function(){return Xs(e,$$())},es.apply(e,arguments)}function q$(){var e=US(uy()).domain([1,10]);return e.copy=function(){return Xs(e,q$()).base(e.base())},es.apply(e,arguments)}function B$(){var e=HS(uy());return e.copy=function(){return Xs(e,B$()).constant(e.constant())},es.apply(e,arguments)}function tk(){var e=VS(uy());return e.copy=function(){return Xs(e,tk()).exponent(e.exponent())},es.apply(e,arguments)}function Xre(){return tk.apply(null,arguments).exponent(.5)}function z$(){var e=[],t=vn;function r(n){if(n!=null&&!isNaN(n=+n))return t((eh(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Us),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,s)=>Lee(e,s/n))},r.copy=function(){return z$(t).domain(e)},es.apply(r,arguments)}function dy(){var e=0,t=.5,r=1,n=1,i,s,o,l,c,f=vn,h,d=!1,m;function p(y){return isNaN(y=+y)?m:(y=.5+((y=+h(y))-s)*(n*y<n*s?l:c),f(d?Math.max(0,Math.min(1,y)):y))}p.domain=function(y){return arguments.length?([e,t,r]=y,i=h(e=+e),s=h(t=+t),o=h(r=+r),l=i===s?0:.5/(s-i),c=s===o?0:.5/(o-s),n=s<i?-1:1,p):[e,t,r]},p.clamp=function(y){return arguments.length?(d=!!y,p):d},p.interpolator=function(y){return arguments.length?(f=y,p):f};function x(y){return function(v){var b,w,_;return arguments.length?([b,w,_]=v,f=cte(y,[b,w,_]),p):[f(0),f(.5),f(1)]}}return p.range=x(hu),p.rangeRound=x($S),p.unknown=function(y){return arguments.length?(m=y,p):m},function(y){return h=y,i=y(e),s=y(t),o=y(r),l=i===s?0:.5/(s-i),c=s===o?0:.5/(o-s),n=s<i?-1:1,p}}function U$(){var e=Qs(dy()(vn));return e.copy=function(){return Xs(e,U$())},es.apply(e,arguments)}function H$(){var e=US(dy()).domain([.1,1,10]);return e.copy=function(){return Xs(e,H$()).base(e.base())},es.apply(e,arguments)}function V$(){var e=HS(dy());return e.copy=function(){return Xs(e,V$()).constant(e.constant())},es.apply(e,arguments)}function rk(){var e=VS(dy());return e.copy=function(){return Xs(e,rk()).exponent(e.exponent())},es.apply(e,arguments)}function Zre(){return rk.apply(null,arguments).exponent(.5)}const b4=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:af,scaleDiverging:U$,scaleDivergingLog:H$,scaleDivergingPow:rk,scaleDivergingSqrt:Zre,scaleDivergingSymlog:V$,scaleIdentity:j$,scaleImplicit:N1,scaleLinear:Kp,scaleLog:S$,scaleOrdinal:MS,scalePoint:Md,scalePow:WS,scaleQuantile:F$,scaleQuantize:O$,scaleRadial:C$,scaleSequential:$$,scaleSequentialLog:q$,scaleSequentialPow:tk,scaleSequentialQuantile:z$,scaleSequentialSqrt:Xre,scaleSequentialSymlog:B$,scaleSqrt:Tte,scaleSymlog:k$,scaleThreshold:E$,scaleTime:Yre,scaleUtc:Qre,tickFormat:_$},Symbol.toStringTag,{value:"Module"}));var d_,w4;function fy(){if(w4)return d_;w4=1;var e=cu();function t(r,n,i){for(var s=-1,o=r.length;++s<o;){var l=r[s],c=n(l);if(c!=null&&(f===void 0?c===c&&!e(c):i(c,f)))var f=c,h=l}return h}return d_=t,d_}var f_,_4;function W$(){if(_4)return f_;_4=1;function e(t,r){return t>r}return f_=e,f_}var h_,j4;function Jre(){if(j4)return h_;j4=1;
vendor: 69,668 bytes, lines 429-456
429var e=fy(),t=W$(),r=fu();function n(i){return i&&i.length?e(i,r,t):void 0}return h_=n,h_}var ene=Jre();const hy=Ft(ene);var m_,N4;function K$(){if(N4)return m_;N4=1;function e(t,r){return t<r}return m_=e,m_}var p_,S4;function tne(){if(S4)return p_;S4=1;var e=fy(),t=K$(),r=fu();function n(i){return i&&i.length?e(i,r,t):void 0}return p_=n,p_}var rne=tne();const my=Ft(rne);var g_,k4;function nne(){if(k4)return g_;k4=1;var e=vS(),t=yi(),r=t$(),n=Tn();function i(s,o){var l=n(s)?e:r;return l(s,t(o,3))}return g_=i,g_}var y_,C4;function ane(){if(C4)return y_;C4=1;var e=J3(),t=nne();function r(n,i){return e(t(n,i),1)}return y_=r,y_}var ine=ane();const sne=Ft(ine);var v_,F4;function G$(){if(F4)return v_;F4=1;var e=PS();function t(r,n){return e(r,n)}return v_=t,v_}var one=G$();const ah=Ft(one);var mu=1e9,lne={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ak,lr=!0,ga="[DecimalError] ",zo=ga+"Invalid argument: ",nk=ga+"Exponent out of range: ",pu=Math.floor,_o=Math.pow,cne=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Vn,Br=1e7,sr=7,Y$=9007199254740991,Xp=pu(Y$/sr),Ge={};Ge.absoluteValue=Ge.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ge.comparedTo=Ge.cmp=function(e){var t,r,n,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(n=s.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};Ge.decimalPlaces=Ge.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*sr;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Ge.dividedBy=Ge.div=function(e){return Ui(this,new this.constructor(e))};Ge.dividedToIntegerBy=Ge.idiv=function(e){var t=this,r=t.constructor;return Yt(Ui(t,new r(e),0,1),r.precision)};Ge.equals=Ge.eq=function(e){return!this.cmp(e)};Ge.exponent=function(){return kr(this)};Ge.greaterThan=Ge.gt=function(e){return this.cmp(e)>0};Ge.greaterThanOrEqualTo=Ge.gte=function(e){return this.cmp(e)>=0};Ge.isInteger=Ge.isint=function(){return this.e>this.d.length-2};Ge.isNegative=Ge.isneg=function(){return this.s<0};Ge.isPositive=Ge.ispos=function(){return this.s>0};Ge.isZero=function(){return this.s===0};Ge.lessThan=Ge.lt=function(e){return this.cmp(e)<0};Ge.lessThanOrEqualTo=Ge.lte=function(e){return this.cmp(e)<1};Ge.logarithm=Ge.log=function(e){var t,r=this,n=r.constructor,i=n.precision,s=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Vn))throw Error(ga+"NaN");if(r.s<1)throw Error(ga+(r.s?"NaN":"-Infinity"));return r.eq(Vn)?new n(0):(lr=!1,t=Ui(uf(r,s),uf(e,s),s),lr=!0,Yt(t,i))};Ge.minus=Ge.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Z$(t,e):Q$(t,(e.s=-e.s,e))};Ge.modulo=Ge.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ga+"NaN");return r.s?(lr=!1,t=Ui(r,e,0,1).times(e),lr=!0,r.minus(t)):Yt(new n(r),i)};Ge.naturalExponential=Ge.exp=function(){return X$(this)};Ge.naturalLogarithm=Ge.ln=function(){return uf(this)};Ge.negated=Ge.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ge.plus=Ge.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Q$(t,e):Z$(t,(e.s=-e.s,e))};Ge.precision=Ge.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(zo+e);if(t=kr(i)+1,n=i.d.length-1,r=n*sr+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Ge.squareRoot=Ge.sqrt=function(){var e,t,r,n,i,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(ga+"NaN")}for(e=kr(l),lr=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=ti(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=pu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(s=n,n=s.plus(Ui(l,s,o+2)).times(.5),ti(s.d).slice(0,o)===(t=ti(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Yt(s,r+1,0),s.times(s).eq(l)){n=s;break}}else if(t!="9999")break;o+=4}return lr=!0,Yt(n,r)};Ge.times=Ge.mul=function(e){var t,r,n,i,s,o,l,c,f,h=this,d=h.constructor,m=h.d,p=(e=new d(e)).d;if(!h.s||!e.s)return new d(0);for(e.s*=h.s,r=h.e+e.e,c=m.length,f=p.length,c<f&&(s=m,m=p,p=s,o=c,c=f,f=o),s=[],o=c+f,n=o;n--;)s.push(0);for(n=f;--n>=0;){for(t=0,i=c+n;i>n;)l=s[i]+p[n]*m[i-n-1]+t,s[i--]=l%Br|0,t=l/Br|0;s[i]=(s[i]+t)%Br|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,lr?Yt(e,d.precision):e};Ge.toDecimalPlaces=Ge.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ui(e,0,mu),t===void 0?t=n.rounding:ui(t,0,8),Yt(r,e+kr(r)+1,t))};Ge.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Xo(n,!0):(ui(e,0,mu),t===void 0?t=i.rounding:ui(t,0,8),n=Yt(new i(n),e+1,t),r=Xo(n,!0,e+1)),r};Ge.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?Xo(i):(ui(e,0,mu),t===void 0?t=s.rounding:ui(t,0,8),n=Yt(new s(i),e+kr(i)+1,t),r=Xo(n.abs(),!1,e+kr(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Ge.toInteger=Ge.toint=function(){var e=this,t=e.constructor;return Yt(new t(e),kr(e)+1,t.rounding)};Ge.toNumber=function(){return+this};Ge.toPower=Ge.pow=function(e){var t,r,n,i,s,o,l=this,c=l.constructor,f=12,h=+(e=new c(e));if(!e.s)return new c(Vn);if(l=new c(l),!l.s){if(e.s<1)throw Error(ga+"Infinity");return l}if(l.eq(Vn))return l;if(n=c.precision,e.eq(Vn))return Yt(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,s=l.s,o){if((r=h<0?-h:h)<=Y$){for(i=new c(Vn),t=Math.ceil(n/sr+4),lr=!1;r%2&&(i=i.times(l),E4(i.d,t)),r=pu(r/2),r!==0;)l=l.times(l),E4(l.d,t);return lr=!0,e.s<0?new c(Vn).div(i):Yt(i,n)}}else if(s<0)throw Error(ga+"NaN");return s=s<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,lr=!1,i=e.times(uf(l,n+f)),lr=!0,i=X$(i),i.s=s,i};Ge.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=kr(i),n=Xo(i,r<=s.toExpNeg||r>=s.toExpPos)):(ui(e,1,mu),t===void 0?t=s.rounding:ui(t,0,8),i=Yt(new s(i),e,t),r=kr(i),n=Xo(i,e<=r||r<=s.toExpNeg,e)),n};Ge.toSignificantDigits=Ge.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ui(e,1,mu),t===void 0?t=n.rounding:ui(t,0,8)),Yt(new n(r),e,t)};Ge.toString=Ge.valueOf=Ge.val=Ge.toJSON=Ge[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=kr(e),r=e.constructor;return Xo(e,t<=r.toExpNeg||t>=r.toExpPos)};function Q$(e,t){var r,n,i,s,o,l,c,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),lr?Yt(t,d):t;if(c=e.d,f=t.d,o=e.e,i=t.e,c=c.slice(),s=o-i,s){for(s<0?(n=c,s=-s,l=f.length):(n=f,i=o,l=c.length),o=Math.ceil(d/sr),l=o>l?o+1:l+1,s>l&&(s=l,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(l=c.length,s=f.length,l-s<0&&(s=l,n=f,f=c,c=n),r=0;s;)r=(c[--s]=c[s]+f[s]+r)/Br|0,c[s]%=Br;for(r&&(c.unshift(r),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,lr?Yt(t,d):t}function ui(e,t,r){if(e!==~~e||e<t||e>r)throw Error(zo+e)}function ti(e){var t,r,n,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)n=e[t]+"",r=sr-n.length,r&&(s+=ks(r)),s+=n;o=e[t],n=o+"",r=sr-n.length,r&&(s+=ks(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}var Ui=(function(){function e(n,i){var s,o=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+o,n[l]=s%Br|0,o=s/Br|0;return o&&n.unshift(o),n}function t(n,i,s,o){var l,c;if(s!=o)c=s>o?1:-1;else for(l=c=0;l<s;l++)if(n[l]!=i[l]){c=n[l]>i[l]?1:-1;break}return c}function r(n,i,s){for(var o=0;s--;)n[s]-=o,o=n[s]<i[s]?1:0,n[s]=o*Br+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,o){var l,c,f,h,d,m,p,x,y,v,b,w,_,N,S,k,C,O,R=n.constructor,A=n.s==i.s?1:-1,P=n.d,E=i.d;if(!n.s)return new R(n);if(!i.s)throw Error(ga+"Division by zero");for(c=n.e-i.e,C=E.length,S=P.length,p=new R(A),x=p.d=[],f=0;E[f]==(P[f]||0);)++f;if(E[f]>(P[f]||0)&&--c,s==null?w=s=R.precision:o?w=s+(kr(n)-kr(i))+1:w=s,w<0)return new R(0);if(w=w/sr+2|0,f=0,C==1)for(h=0,E=E[0],w++;(f<S||h)&&w--;f++)_=h*Br+(P[f]||0),x[f]=_/E|0,h=_%E|0;else{for(h=Br/(E[0]+1)|0,h>1&&(E=e(E,h),P=e(P,h),C=E.length,S=P.length),N=C,y=P.slice(0,C),v=y.length;v<C;)y[v++]=0;O=E.slice(),O.unshift(0),k=E[0],E[1]>=Br/2&&++k;do h=0,l=t(E,y,C,v),l<0?(b=y[0],C!=v&&(b=b*Br+(y[1]||0)),h=b/k|0,h>1?(h>=Br&&(h=Br-1),d=e(E,h),m=d.length,v=y.length,l=t(d,y,m,v),l==1&&(h--,r(d,C<m?O:E,m))):(h==0&&(l=h=1),d=E.slice()),m=d.length,m<v&&d.unshift(0),r(y,d,v),l==-1&&(v=y.length,l=t(E,y,C,v),l<1&&(h++,r(y,C<v?O:E,v))),v=y.length):l===0&&(h++,y=[0]),x[f++]=h,l&&y[0]?y[v++]=P[N]||0:(y=[P[N]],v=1);while((N++<S||y[0]!==void 0)&&w--)}return x[0]||x.shift(),p.e=c,Yt(p,o?s+kr(p)+1:s)}})();function X$(e,t){var r,n,i,s,o,l,c=0,f=0,h=e.constructor,d=h.precision;if(kr(e)>16)throw Error(nk+kr(e));if(!e.s)return new h(Vn);for(lr=!1,l=d,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(n=Math.log(_o(2,f))/Math.LN10*2+5|0,l+=n,r=i=s=new h(Vn),h.precision=l;;){if(i=Yt(i.times(e),l),r=r.times(++c),o=s.plus(Ui(i,r,l)),ti(o.d).slice(0,l)===ti(s.d).slice(0,l)){for(;f--;)s=Yt(s.times(s),l);return h.precision=d,t==null?(lr=!0,Yt(s,d)):s}s=o}}function kr(e){for(var t=e.e*sr,r=e.d[0];r>=10;r/=10)t++;return t}function x_(e,t,r){if(t>e.LN10.sd())throw lr=!0,r&&(e.precision=r),Error(ga+"LN10 precision limit exceeded");return Yt(new e(e.LN10),t)}function ks(e){for(var t="";e--;)t+="0";return t}function uf(e,t){var r,n,i,s,o,l,c,f,h,d=1,m=10,p=e,x=p.d,y=p.constructor,v=y.precision;if(p.s<1)throw Error(ga+(p.s?"NaN":"-Infinity"));if(p.eq(Vn))return new y(0);if(t==null?(lr=!1,f=v):f=t,p.eq(10))return t==null&&(lr=!0),x_(y,f);if(f+=m,y.precision=f,r=ti(x),n=r.charAt(0),s=kr(p),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=ti(p.d),n=r.charAt(0),d++;s=kr(p),n>1?(p=new y("0."+r),s++):p=new y(n+"."+r.slice(1))}else return c=x_(y,f+2,v).times(s+""),p=uf(new y(n+"."+r.slice(1)),f-m).plus(c),y.precision=v,t==null?(lr=!0,Yt(p,v)):p;for(l=o=p=Ui(p.minus(Vn),p.plus(Vn),f),h=Yt(p.times(p),f),i=3;;){if(o=Yt(o.times(h),f),c=l.plus(Ui(o,new y(i),f)),ti(c.d).slice(0,f)===ti(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(x_(y,f+2,v).times(s+""))),l=Ui(l,new y(d),f),y.precision=v,t==null?(lr=!0,Yt(l,v)):l;l=c,i+=2}}function O4(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=pu(r/sr),e.d=[],n=(r+1)%sr,r<0&&(n+=sr),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=sr;n<i;)e.d.push(+t.slice(n,n+=sr));t=t.slice(n),n=sr-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),lr&&(e.e>Xp||e.e<-Xp))throw Error(nk+r)}else e.s=0,e.e=0,e.d=[0];return e}function Yt(e,t,r){var n,i,s,o,l,c,f,h,d=e.d;for(o=1,s=d[0];s>=10;s/=10)o++;if(n=t-o,n<0)n+=sr,i=t,f=d[h=0];else{if(h=Math.ceil((n+1)/sr),s=d.length,h>=s)return e;for(f=s=d[h],o=1;s>=10;s/=10)o++;n%=sr,i=n-sr+o}if(r!==void 0&&(s=_o(10,o-i-1),l=f/s%10|0,c=t<0||d[h+1]!==void 0||f%s,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?i>0?f/_o(10,o-i):0:d[h-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(s=kr(e),d.length=1,t=t-s-1,d[0]=_o(10,(sr-t%sr)%sr),e.e=pu(-t/sr)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=h,s=1,h--):(d.length=h+1,s=_o(10,sr-n),d[h]=i>0?(f/_o(10,o-i)%_o(10,i)|0)*s:0),c)for(;;)if(h==0){(d[0]+=s)==Br&&(d[0]=1,++e.e);break}else{if(d[h]+=s,d[h]!=Br)break;d[h--]=0,s=1}for(n=d.length;d[--n]===0;)d.pop();if(lr&&(e.e>Xp||e.e<-Xp))throw Error(nk+kr(e));return e}function Z$(e,t){var r,n,i,s,o,l,c,f,h,d,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),lr?Yt(t,p):t;if(c=e.d,d=t.d,n=t.e,f=e.e,c=c.slice(),o=f-n,o){for(h=o<0,h?(r=c,o=-o,l=d.length):(r=d,n=f,l=c.length),i=Math.max(Math.ceil(p/sr),l)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,l=d.length,h=i<l,h&&(l=i),i=0;i<l;i++)if(c[i]!=d[i]){h=c[i]<d[i];break}o=0}for(h&&(r=c,c=d,d=r,t.s=-t.s),l=c.length,i=d.length-l;i>0;--i)c[l++]=0;for(i=d.length;i>o;){if(c[--i]<d[i]){for(s=i;s&&c[--s]===0;)c[s]=Br-1;--c[s],c[i]+=Br}c[i]-=d[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,lr?Yt(t,p):t):new m(0)}function Xo(e,t,r){var n,i=kr(e),s=ti(e.d),o=s.length;return t?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+ks(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+ks(-i-1)+s,r&&(n=r-o)>0&&(s+=ks(n))):i>=o?(s+=ks(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+ks(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=ks(n))),e.s<0?"-"+s:s}function E4(e,t){if(e.length>t)return e.length=t,!0}function J$(e){var t,r,n;function i(s){var o=this;if(!(o instanceof i))return new i(s);if(o.constructor=i,s instanceof i){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(zo+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return O4(o,s.toString())}else if(typeof s!="string")throw Error(zo+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,cne.test(s))O4(o,s);else throw Error(zo+s)}if(i.prototype=Ge,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=J$,i.config=i.set=une,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function une(e){if(!e||typeof e!="object")throw Error(ga+"Object expected");var t,r,n,i=["precision",1,mu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(pu(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(zo+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(zo+r+": "+n);return this}var ak=J$(lne);Vn=new ak(1);const Wt=ak;function dne(e){return pne(e)||mne(e)||hne(e)||fne()}function fne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
430In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hne(e,t){if(e){if(typeof e=="string")return F1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F1(e,t)}}function mne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function pne(e){if(Array.isArray(e))return F1(e)}function F1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var gne=function(t){return t},e5={},t5=function(t){return t===e5},P4=function(t){return function r(){return arguments.length===0||arguments.length===1&&t5(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},yne=function e(t,r){return t===1?r:P4(function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];var o=i.filter(function(l){return l!==e5}).length;return o>=t?r.apply(void 0,i):e(t-o,P4(function(){for(var l=arguments.length,c=new Array(l),f=0;f<l;f++)c[f]=arguments[f];var h=i.map(function(d){return t5(d)?c.shift():d});return r.apply(void 0,dne(h).concat(c))}))})},py=function(t){return yne(t.length,t)},O1=function(t,r){for(var n=[],i=t;i<r;++i)n[i-t]=i;return n},vne=py(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),xne=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return gne;var i=r.reverse(),s=i[0],o=i.slice(1);return function(){return o.reduce(function(l,c){return c(l)},s.apply(void 0,arguments))}},E1=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},r5=function(t){var r=null,n=null;return function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return r&&s.every(function(l,c){return l===r[c]})||(r=s,n=t.apply(void 0,s)),n}};function bne(e){var t;return e===0?t=1:t=Math.floor(new Wt(e).abs().log(10).toNumber())+1,t}function wne(e,t,r){for(var n=new Wt(e),i=0,s=[];n.lt(t)&&i<1e5;)s.push(n.toNumber()),n=n.add(r),i++;return s}var _ne=py(function(e,t,r){var n=+e,i=+t;return n+r*(i-n)}),jne=py(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),Nne=py(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const gy={rangeStep:wne,getDigitCount:bne,interpolateNumber:_ne,uninterpolateNumber:jne,uninterpolateTruncation:Nne};function P1(e){return Cne(e)||kne(e)||n5(e)||Sne()}function Sne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
431In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Cne(e){if(Array.isArray(e))return T1(e)}function df(e,t){return Ene(e)||One(e,t)||n5(e,t)||Fne()}function Fne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
432In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n5(e,t){if(e){if(typeof e=="string")return T1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T1(e,t)}}function T1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function One(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,s=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){i=!0,s=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return r}}function Ene(e){if(Array.isArray(e))return e}function a5(e){var t=df(e,2),r=t[0],n=t[1],i=r,s=n;return r>n&&(i=n,s=r),[i,s]}function i5(e,t,r){if(e.lte(0))return new Wt(0);var n=gy.getDigitCount(e.toNumber()),i=new Wt(10).pow(n),s=e.div(i),o=n!==1?.05:.1,l=new Wt(Math.ceil(s.div(o).toNumber())).add(r).mul(o),c=l.mul(i);return t?c:new Wt(Math.ceil(c))}function Pne(e,t,r){var n=1,i=new Wt(e);if(!i.isint()&&r){var s=Math.abs(e);s<1?(n=new Wt(10).pow(gy.getDigitCount(e)-1),i=new Wt(Math.floor(i.div(n).toNumber())).mul(n)):s>1&&(i=new Wt(Math.floor(e)))}else e===0?i=new Wt(Math.floor((t-1)/2)):r||(i=new Wt(Math.floor(e)));var o=Math.floor((t-1)/2),l=xne(vne(function(c){return i.add(new Wt(c-o).mul(n)).toNumber()}),O1);return l(0,t)}function s5(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Wt(0),tickMin:new Wt(0),tickMax:new Wt(0)};var s=i5(new Wt(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Wt(0):(o=new Wt(e).add(t).div(2),o=o.sub(new Wt(o).mod(s)));var l=Math.ceil(o.sub(e).div(s).toNumber()),c=Math.ceil(new Wt(t).sub(o).div(s).toNumber()),f=l+c+1;return f>r?s5(e,t,r,n,i+1):(f<r&&(c=t>0?c+(r-f):c,l=t>0?l:l+(r-f)),{step:s,tickMin:o.sub(new Wt(l).mul(s)),tickMax:o.add(new Wt(c).mul(s))})}function Tne(e){var t=df(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),l=a5([r,n]),c=df(l,2),f=c[0],h=c[1];if(f===-1/0||h===1/0){var d=h===1/0?[f].concat(P1(O1(0,i-1).map(function(){return 1/0}))):[].concat(P1(O1(0,i-1).map(function(){return-1/0})),[h]);return r>n?E1(d):d}if(f===h)return Pne(f,i,s);var m=s5(f,h,o,s),p=m.step,x=m.tickMin,y=m.tickMax,v=gy.rangeStep(x,y.add(new Wt(.1).mul(p)),p);return r>n?E1(v):v}function Ane(e,t){var r=df(e,2),n=r[0],i=r[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=a5([n,i]),l=df(o,2),c=l[0],f=l[1];if(c===-1/0||f===1/0)return[n,i];if(c===f)return[c];var h=Math.max(t,2),d=i5(new Wt(f).sub(c).div(h-1),s,0),m=[].concat(P1(gy.rangeStep(new Wt(c),new Wt(f).sub(new Wt(.99).mul(d)),d)),[f]);return n>i?E1(m):m}var Rne=r5(Tne),Ine=r5(Ane),Mne="Invariant failed";function Zo(e,t){throw new Error(Mne)}var Lne=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Dc(e){"@babel/helpers - typeof";return Dc=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},Dc(e)}function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zp.apply(this,arguments)}function Dne(e,t){return zne(e)||Bne(e,t)||qne(e,t)||$ne()}function $ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
433In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qne(e,t){if(e){if(typeof e=="string")return T4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T4(e,t)}}function T4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bne(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function zne(e){if(Array.isArray(e))return e}function Une(e,t){if(e==null)return{};var r=Hne(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Vne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wne(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c5(n.key),n)}}function Kne(e,t,r){return t&&Wne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gne(e,t,r){return t=Jp(t),Yne(e,o5()?Reflect.construct(t,r||[],Jp(e).constructor):t.apply(e,r))}function Yne(e,t){if(t&&(Dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qne(e)}function Qne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o5=function(){return!!e})()}function Jp(e){return Jp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Jp(e)}function Xne(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&&A1(e,t)}function A1(e,t){return A1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},A1(e,t)}function l5(e,t,r){return t=c5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c5(e){var t=Zne(e,"string");return Dc(t)=="symbol"?t:t+""}function Zne(e,t){if(Dc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Dc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ih=(function(e){function t(){return Vne(this,t),Gne(this,t,arguments)}return Xne(t,e),Kne(t,[{key:"render",value:function(){var n=this.props,i=n.offset,s=n.layout,o=n.width,l=n.dataKey,c=n.data,f=n.dataPointFormatter,h=n.xAxis,d=n.yAxis,m=Une(n,Lne),p=lt(m,!1);this.props.direction==="x"&&h.type!=="number"&&Zo();var x=c.map(function(y){var v=f(y,l),b=v.x,w=v.y,_=v.value,N=v.errorVal;if(!N)return null;var S=[],k,C;if(Array.isArray(N)){var O=Dne(N,2);k=O[0],C=O[1]}else k=C=N;if(s==="vertical"){var R=h.scale,A=w+i,P=A+o,E=A-o,T=R(_-k),$=R(_+C);S.push({x1:$,y1:P,x2:$,y2:E}),S.push({x1:T,y1:A,x2:$,y2:A}),S.push({x1:T,y1:P,x2:T,y2:E})}else if(s==="horizontal"){var D=d.scale,W=b+i,U=W-o,H=W+o,K=D(_-k),q=D(_+C);S.push({x1:U,y1:q,x2:H,y2:q}),S.push({x1:W,y1:K,x2:W,y2:q}),S.push({x1:U,y1:K,x2:H,y2:K})}return oe.createElement(At,Zp({className:"recharts-errorBar",key:"bar-".concat(S.map(function(L){return"".concat(L.x1,"-").concat(L.x2,"-").concat(L.y1,"-").concat(L.y2)}))},p),S.map(function(L){return oe.createElement("line",Zp({},L,{key:"line-".concat(L.x1,"-").concat(L.x2,"-").concat(L.y1,"-").concat(L.y2)}))}))});return oe.createElement(At,{className:"recharts-errorBars"},x)}}])})(oe.Component);l5(ih,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});l5(ih,"displayName","ErrorBar");function ff(e){"@babel/helpers - typeof";return ff=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},ff(e)}function A4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?A4(Object(r),!0).forEach(function(n){Jne(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jne(e,t,r){return t=eae(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eae(e){var t=tae(e,"string");return ff(t)=="symbol"?t:t+""}function tae(e,t){if(ff(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ff(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var u5=function(t){var r=t.children,n=t.formattedGraphicalItems,i=t.legendWidth,s=t.legendContent,o=zn(r,zi);if(!o)return null;var l=zi.defaultProps,c=l!==void 0?vo(vo({},l),o.props):{},f;return o.props&&o.props.payload?f=o.props&&o.props.payload:s==="children"?f=(n||[]).reduce(function(h,d){var m=d.item,p=d.props,x=p.sectors||p.data||[];return h.concat(x.map(function(y){return{type:o.props.iconType||m.props.legendType,value:y.name,color:y.fill,payload:y}}))},[]):f=(n||[]).map(function(h){var d=h.item,m=d.type.defaultProps,p=m!==void 0?vo(vo({},m),d.props):{},x=p.dataKey,y=p.name,v=p.legendType,b=p.hide;return{inactive:b,dataKey:x,type:c.iconType||v||"square",color:ik(d),value:y||x,payload:p}}),vo(vo(vo({},c),zi.getWithHeight(o,i)),{},{payload:f,item:o})};function hf(e){"@babel/helpers - typeof";return hf=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},hf(e)}function R4(e){return iae(e)||aae(e)||nae(e)||rae()}function rae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
434In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nae(e,t){if(e){if(typeof e=="string")return R1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R1(e,t)}}function aae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iae(e){if(Array.isArray(e))return R1(e)}function R1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function I4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?I4(Object(r),!0).forEach(function(n){cc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cc(e,t,r){return t=sae(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sae(e){var t=oae(e,"string");return hf(t)=="symbol"?t:t+""}function oae(e,t){if(hf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(hf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ar(e,t,r){return yt(e)||yt(t)?r:Rr(t)?Kn(e,t,r):ht(t)?t(e):r}function Ld(e,t,r,n){var i=sne(e,function(l){return Ar(l,t)});if(r==="number"){var s=i.filter(function(l){return Ie(l)||parseFloat(l)});return s.length?[my(s),hy(s)]:[1/0,-1/0]}var o=n?i.filter(function(l){return!yt(l)}):i;return o.map(function(l){return Rr(l)||l instanceof Date?l:""})}var lae=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,f=0;f<l;f++){var h=f>0?i[f-1].coordinate:i[l-1].coordinate,d=i[f].coordinate,m=f>=l-1?i[0].coordinate:i[f+1].coordinate,p=void 0;if(gn(d-h)!==gn(m-d)){var x=[];if(gn(m-d)===gn(c[1]-c[0])){p=m;var y=d+c[1]-c[0];x[0]=Math.min(y,(y+h)/2),x[1]=Math.max(y,(y+h)/2)}else{p=h;var v=m+c[1]-c[0];x[0]=Math.min(d,(v+d)/2),x[1]=Math.max(d,(v+d)/2)}var b=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(t>b[0]&&t<=b[1]||t>=x[0]&&t<=x[1]){o=i[f].index;break}}else{var w=Math.min(h,m),_=Math.max(h,m);if(t>(w+d)/2&&t<=(_+d)/2){o=i[f].index;break}}}else for(var N=0;N<l;N++)if(N===0&&t<=(n[N].coordinate+n[N+1].coordinate)/2||N>0&&N<l-1&&t>(n[N].coordinate+n[N-1].coordinate)/2&&t<=(n[N].coordinate+n[N+1].coordinate)/2||N===l-1&&t>(n[N].coordinate+n[N-1].coordinate)/2){o=n[N].index;break}return o},ik=function(t){var r,n=t,i=n.type.displayName,s=(r=t.type)!==null&&r!==void 0&&r.defaultProps?gr(gr({},t.type.defaultProps),t.props):t.props,o=s.stroke,l=s.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},cae=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var o={},l=Object.keys(s),c=0,f=l.length;c<f;c++)for(var h=s[l[c]].stackGroups,d=Object.keys(h),m=0,p=d.length;m<p;m++){var x=h[d[m]],y=x.items,v=x.cateAxisId,b=y.filter(function(C){return Bi(C.type).indexOf("Bar")>=0});if(b&&b.length){var w=b[0].type.defaultProps,_=w!==void 0?gr(gr({},w),b[0].props):b[0].props,N=_.barSize,S=_[v];o[S]||(o[S]=[]);var k=yt(N)?r:N;o[S].push({item:b[0],stackList:b.slice(1),barSize:yt(k)?void 0:yn(k,n,0)})}}return o},uae=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,s=t.sizeList,o=s===void 0?[]:s,l=t.maxBarSize,c=o.length;if(c<1)return null;var f=yn(r,i,0,!0),h,d=[];if(o[0].barSize===+o[0].barSize){var m=!1,p=i/c,x=o.reduce(function(N,S){return N+S.barSize||0},0);x+=(c-1)*f,x>=i&&(x-=(c-1)*f,f=0),x>=i&&p>0&&(m=!0,p*=.9,x=c*p);var y=(i-x)/2>>0,v={offset:y-f,size:0};h=o.reduce(function(N,S){var k={item:S.item,position:{offset:v.offset+v.size+f,size:m?p:S.barSize}},C=[].concat(R4(N),[k]);return v=C[C.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(O){C.push({item:O,position:v})}),C},d)}else{var b=yn(n,i,0,!0);i-2*b-(c-1)*f<=0&&(f=0);var w=(i-2*b-(c-1)*f)/c;w>1&&(w>>=0);var _=l===+l?Math.min(w,l):w;h=o.reduce(function(N,S,k){var C=[].concat(R4(N),[{item:S.item,position:{offset:b+(w+f)*k+(w-_)/2,size:_}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(O){C.push({item:O,position:C[C.length-1].position})}),C},d)}return h},dae=function(t,r,n,i){var s=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),f=u5({children:s,legendWidth:c});if(f){var h=i||{},d=h.width,m=h.height,p=f.align,x=f.verticalAlign,y=f.layout;if((y==="vertical"||y==="horizontal"&&x==="middle")&&p!=="center"&&Ie(t[p]))return gr(gr({},t),{},cc({},p,t[p]+(d||0)));if((y==="horizontal"||y==="vertical"&&p==="center")&&x!=="middle"&&Ie(t[x]))return gr(gr({},t),{},cc({},x,t[x]+(m||0)))}return t},fae=function(t,r,n){return yt(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},d5=function(t,r,n,i,s){var o=r.props.children,l=Gn(o,ih).filter(function(f){return fae(i,s,f.props.direction)});if(l&&l.length){var c=l.map(function(f){return f.props.dataKey});return t.reduce(function(f,h){var d=Ar(h,n);if(yt(d))return f;var m=Array.isArray(d)?[my(d),hy(d)]:[d,d],p=c.reduce(function(x,y){var v=Ar(h,y,0),b=m[0]-Math.abs(Array.isArray(v)?v[0]:v),w=m[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(b,x[0]),Math.max(w,x[1])]},[1/0,-1/0]);return[Math.min(p[0],f[0]),Math.max(p[1],f[1])]},[1/0,-1/0])}return null},hae=function(t,r,n,i,s){var o=r.map(function(l){return d5(t,l,n,s,i)}).filter(function(l){return!yt(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},f5=function(t,r,n,i,s){var o=r.map(function(c){var f=c.props.dataKey;return n==="number"&&f&&d5(t,c,f,i)||Ld(t,f,n,s)});if(n==="number")return o.reduce(function(c,f){return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,f){for(var h=0,d=f.length;h<d;h++)l[f[h]]||(l[f[h]]=!0,c.push(f[h]));return c},[])},h5=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},m5=function(t,r,n,i){if(i)return t.map(function(c){return c.coordinate});var s,o,l=t.map(function(c){return c.coordinate===r&&(s=!0),c.coordinate===n&&(o=!0),c.coordinate});return s||l.push(r),o||l.push(n),l},$i=function(t,r,n){if(!t)return null;var i=t.scale,s=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,f=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/c:0;if(f=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?gn(l[0]-l[1])*2*f:f,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(d){var m=s?s.indexOf(d):d;return{coordinate:i(m)+f,value:d,offset:f}});return h.filter(function(d){return!Zf(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,m){return{coordinate:i(d)+f,value:d,index:m,offset:f}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(d){return{coordinate:i(d)+f,value:d,offset:f}}):i.domain().map(function(d,m){return{coordinate:i(d)+f,value:s?s[d]:d,index:m,offset:f}})},b_=new WeakMap,Dm=function(t,r){if(typeof r!="function")return t;b_.has(t)||b_.set(t,new WeakMap);var n=b_.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},p5=function(t,r,n){var i=t.scale,s=t.type,o=t.layout,l=t.axisType;if(i==="auto")return o==="radial"&&l==="radiusAxis"?{scale:af(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:Kp(),realScaleType:"linear"}:s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Md(),realScaleType:"point"}:s==="category"?{scale:af(),realScaleType:"band"}:{scale:Kp(),realScaleType:"linear"};if(Go(i)){var c="scale".concat(Jg(i));return{scale:(b4[c]||Md)(),realScaleType:b4[c]?c:"point"}}return ht(i)?{scale:i}:{scale:Md(),realScaleType:"point"}},M4=1e-4,g5=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),s=Math.min(i[0],i[1])-M4,o=Math.max(i[0],i[1])+M4,l=t(r[0]),c=t(r[n-1]);(l<s||l>o||c<s||c>o)&&t.domain([r[0],r[n-1]])}},mae=function(t,r){if(!t)return null;for(var n=0,i=t.length;n<i;n++)if(t[n].item===r)return t[n].position;return null},pae=function(t,r){if(!r||r.length!==2||!Ie(r[0])||!Ie(r[1]))return t;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),s=[t[0],t[1]];return(!Ie(t[0])||t[0]<n)&&(s[0]=n),(!Ie(t[1])||t[1]>i)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]<n&&(s[1]=n),s},gae=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n<i;++n)for(var s=0,o=0,l=0;l<r;++l){var c=Zf(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},yae=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n<i;++n)for(var s=0,o=0;o<r;++o){var l=Zf(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=s,t[o][n][1]=s+l,s=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},vae={sign:gae,expand:sX,none:Ec,silhouette:oX,wiggle:lX,positive:yae},xae=function(t,r,n){var i=r.map(function(l){return l.props.dataKey}),s=vae[n],o=iX().keys(i).value(function(l,c){return+Ar(l,c,0)}).order(u1).offset(s);return o(t)},bae=function(t,r,n,i,s,o){if(!t)return null;var l=o?r.reverse():r,c={},f=l.reduce(function(d,m){var p,x=(p=m.type)!==null&&p!==void 0&&p.defaultProps?gr(gr({},m.type.defaultProps),m.props):m.props,y=x.stackId,v=x.hide;if(v)return d;var b=x[n],w=d[b]||{hasStack:!1,stackGroups:{}};if(Rr(y)){var _=w.stackGroups[y]||{numericAxisId:n,cateAxisId:i,items:[]};_.items.push(m),w.hasStack=!0,w.stackGroups[y]=_}else w.stackGroups[du("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[m]};return gr(gr({},d),{},cc({},b,w))},c),h={};return Object.keys(f).reduce(function(d,m){var p=f[m];if(p.hasStack){var x={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(y,v){var b=p.stackGroups[v];return gr(gr({},y),{},cc({},v,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:xae(t,b.items,s)}))},x)}return gr(gr({},d),{},cc({},m,p))},h)},y5=function(t,r){var n=r.realScaleType,i=r.type,s=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=Rne(f,s,l);return t.domain([my(h),hy(h)]),{niceTicks:h}}if(s&&i==="number"){var d=t.domain(),m=Ine(d,s,l);return{niceTicks:m}}return null};function L4(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,s=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!yt(i[t.dataKey])){var l=Op(r,"value",i[t.dataKey]);if(l)return l.coordinate+n/2}return r[s]?r[s].coordinate+n/2:null}var c=Ar(i,yt(o)?t.dataKey:o);return yt(c)?null:t.scale(c)}var D4=function(t){var r=t.axis,n=t.ticks,i=t.offset,s=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+i:null;var c=Ar(o,r.dataKey,r.domain[l]);return yt(c)?null:r.scale(c)-s/2+i},wae=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]);return i<=0&&s>=0?0:s<0?s:i}return n[0]},_ae=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?gr(gr({},t.type.defaultProps),t.props):t.props,s=i.stackId;if(Rr(s)){var o=r[s];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},jae=function(t){return t.reduce(function(r,n){return[my(n.concat([r[0]]).filter(Ie)),hy(n.concat([r[1]]).filter(Ie))]},[1/0,-1/0])},v5=function(t,r,n){return Object.keys(t).reduce(function(i,s){var o=t[s],l=o.stackedData,c=l.reduce(function(f,h){var d=jae(h.slice(r,n+1));return[Math.min(f[0],d[0]),Math.max(f[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},$4=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,q4=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,I1=function(t,r,n){if(ht(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(Ie(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if($4.test(t[0])){var s=+$4.exec(t[0])[1];i[0]=r[0]-s}else ht(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(Ie(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(q4.test(t[1])){var o=+q4.exec(t[1])[1];i[1]=r[1]+o}else ht(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},eg=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var s=AS(r,function(d){return d.coordinate}),o=1/0,l=1,c=s.length;l<c;l++){var f=s[l],h=s[l-1];o=Math.min((f.coordinate||0)-(h.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},B4=function(t,r,n){return!t||!t.length||ah(t,Kn(n,"type.defaultProps.domain"))?r:t},x5=function(t,r){var n=t.type.defaultProps?gr(gr({},t.type.defaultProps),t.props):t.props,i=n.dataKey,s=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,f=n.chartType,h=n.hide;return gr(gr({},lt(t,!1)),{},{dataKey:i,unit:o,formatter:l,name:s||i,color:ik(t),value:Ar(r,i),type:c,payload:r,chartType:f,hide:h})};function mf(e){"@babel/helpers - typeof";return mf=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},mf(e)}function z4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?z4(Object(r),!0).forEach(function(n){b5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function b5(e,t,r){return t=Nae(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nae(e){var t=Sae(e,"string");return mf(t)=="symbol"?t:t+""}function Sae(e,t){if(mf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(mf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kae(e,t){return Eae(e)||Oae(e,t)||Fae(e,t)||Cae()}function Cae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
435In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fae(e,t){if(e){if(typeof e=="string")return U4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U4(e,t)}}function U4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Oae(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function Eae(e){if(Array.isArray(e))return e}var tg=Math.PI/180,Pae=function(t){return t*180/Math.PI},nr=function(t,r,n,i){return{x:t+Math.cos(-tg*i)*n,y:r+Math.sin(-tg*i)*n}},w5=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},Tae=function(t,r,n,i,s){var o=t.width,l=t.height,c=t.startAngle,f=t.endAngle,h=yn(t.cx,o,o/2),d=yn(t.cy,l,l/2),m=w5(o,l,n),p=yn(t.innerRadius,m,0),x=yn(t.outerRadius,m,m*.8),y=Object.keys(r);return y.reduce(function(v,b){var w=r[b],_=w.domain,N=w.reversed,S;if(yt(w.range))i==="angleAxis"?S=[c,f]:i==="radiusAxis"&&(S=[p,x]),N&&(S=[S[1],S[0]]);else{S=w.range;var k=S,C=kae(k,2);c=C[0],f=C[1]}var O=p5(w,s),R=O.realScaleType,A=O.scale;A.domain(_).range(S),g5(A);var P=y5(A,Pi(Pi({},w),{},{realScaleType:R})),E=Pi(Pi(Pi({},w),P),{},{range:S,radius:x,realScaleType:R,scale:A,cx:h,cy:d,innerRadius:p,outerRadius:x,startAngle:c,endAngle:f});return Pi(Pi({},v),{},b5({},b,E))},{})},Aae=function(t,r){var n=t.x,i=t.y,s=r.x,o=r.y;return Math.sqrt(Math.pow(n-s,2)+Math.pow(i-o,2))},Rae=function(t,r){var n=t.x,i=t.y,s=r.cx,o=r.cy,l=Aae({x:n,y:i},{x:s,y:o});if(l<=0)return{radius:l};var c=(n-s)/l,f=Math.acos(c);return i>o&&(f=2*Math.PI-f),{radius:l,angle:Pae(f),angleInRadian:f}},Iae=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),s=Math.floor(n/360),o=Math.min(i,s);return{startAngle:r-o*360,endAngle:n-o*360}},Mae=function(t,r){var n=r.startAngle,i=r.endAngle,s=Math.floor(n/360),o=Math.floor(i/360),l=Math.min(s,o);return t+l*360},H4=function(t,r){var n=t.x,i=t.y,s=Rae({x:n,y:i},r),o=s.radius,l=s.angle,c=r.innerRadius,f=r.outerRadius;if(o<c||o>f)return!1;if(o===0)return!0;var h=Iae(r),d=h.startAngle,m=h.endAngle,p=l,x;if(d<=m){for(;p>m;)p-=360;for(;p<d;)p+=360;x=p>=d&&p<=m}else{for(;p>d;)p-=360;for(;p<m;)p+=360;x=p>=m&&p<=d}return x?Pi(Pi({},r),{},{radius:o,angle:Mae(p,r)}):null},_5=function(t){return!I.isValidElement(t)&&!ht(t)&&typeof t!="boolean"?t.className:""};function pf(e){"@babel/helpers - typeof";return pf=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},pf(e)}var Lae=["offset"];function Dae(e){return zae(e)||Bae(e)||qae(e)||$ae()}function $ae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
436In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qae(e,t){if(e){if(typeof e=="string")return M1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return M1(e,t)}}function Bae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zae(e){if(Array.isArray(e))return M1(e)}function M1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Uae(e,t){if(e==null)return{};var r=Hae(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function V4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?V4(Object(r),!0).forEach(function(n){Vae(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vae(e,t,r){return t=Wae(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wae(e){var t=Kae(e,"string");return pf(t)=="symbol"?t:t+""}function Kae(e,t){if(pf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(pf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gf(){return gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gf.apply(this,arguments)}var Gae=function(t){var r=t.value,n=t.formatter,i=yt(t.children)?r:t.children;return ht(n)?n(i):i},Yae=function(t,r){var n=gn(r-t),i=Math.min(Math.abs(r-t),360);return n*i},Qae=function(t,r,n){var i=t.position,s=t.viewBox,o=t.offset,l=t.className,c=s,f=c.cx,h=c.cy,d=c.innerRadius,m=c.outerRadius,p=c.startAngle,x=c.endAngle,y=c.clockWise,v=(d+m)/2,b=Yae(p,x),w=b>=0?1:-1,_,N;i==="insideStart"?(_=p+w*o,N=y):i==="insideEnd"?(_=x-w*o,N=!y):i==="end"&&(_=x+w*o,N=y),N=b<=0?N:!N;var S=nr(f,h,v,_),k=nr(f,h,v,_+(N?1:-1)*359),C="M".concat(S.x,",").concat(S.y,`
437    A`).concat(v,",").concat(v,",0,1,").concat(N?0:1,`,
438    `).concat(k.x,",").concat(k.y),O=yt(t.id)?du("recharts-radial-line-"):t.id;return oe.createElement("text",gf({},n,{dominantBaseline:"central",className:xt("recharts-radial-bar-label",l)}),oe.createElement("defs",null,oe.createElement("path",{id:O,d:C})),oe.createElement("textPath",{xlinkHref:"#".concat(O)},r))},Xae=function(t){var r=t.viewBox,n=t.offset,i=t.position,s=r,o=s.cx,l=s.cy,c=s.innerRadius,f=s.outerRadius,h=s.startAngle,d=s.endAngle,m=(h+d)/2;if(i==="outside"){var p=nr(o,l,f+n,m),x=p.x,y=p.y;return{x,y,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var v=(c+f)/2,b=nr(o,l,v,m),w=b.x,_=b.y;return{x:w,y:_,textAnchor:"middle",verticalAnchor:"middle"}},Zae=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,s=t.position,o=r,l=o.x,c=o.y,f=o.width,h=o.height,d=h>=0?1:-1,m=d*i,p=d>0?"end":"start",x=d>0?"start":"end",y=f>=0?1:-1,v=y*i,b=y>0?"end":"start",w=y>0?"start":"end";if(s==="top"){var _={x:l+f/2,y:c-d*i,textAnchor:"middle",verticalAnchor:p};return Pr(Pr({},_),n?{height:Math.max(c-n.y,0),width:f}:{})}if(s==="bottom"){var N={x:l+f/2,y:c+h+m,textAnchor:"middle",verticalAnchor:x};return Pr(Pr({},N),n?{height:Math.max(n.y+n.height-(c+h),0),width:f}:{})}if(s==="left"){var S={x:l-v,y:c+h/2,textAnchor:b,verticalAnchor:"middle"};return Pr(Pr({},S),n?{width:Math.max(S.x-n.x,0),height:h}:{})}if(s==="right"){var k={x:l+f+v,y:c+h/2,textAnchor:w,verticalAnchor:"middle"};return Pr(Pr({},k),n?{width:Math.max(n.x+n.width-k.x,0),height:h}:{})}var C=n?{width:f,height:h}:{};return s==="insideLeft"?Pr({x:l+v,y:c+h/2,textAnchor:w,verticalAnchor:"middle"},C):s==="insideRight"?Pr({x:l+f-v,y:c+h/2,textAnchor:b,verticalAnchor:"middle"},C):s==="insideTop"?Pr({x:l+f/2,y:c+m,textAnchor:"middle",verticalAnchor:x},C):s==="insideBottom"?Pr({x:l+f/2,y:c+h-m,textAnchor:"middle",verticalAnchor:p},C):s==="insideTopLeft"?Pr({x:l+v,y:c+m,textAnchor:w,verticalAnchor:x},C):s==="insideTopRight"?Pr({x:l+f-v,y:c+m,textAnchor:b,verticalAnchor:x},C):s==="insideBottomLeft"?Pr({x:l+v,y:c+h-m,textAnchor:w,verticalAnchor:p},C):s==="insideBottomRight"?Pr({x:l+f-v,y:c+h-m,textAnchor:b,verticalAnchor:p},C):uu(s)&&(Ie(s.x)||Co(s.x))&&(Ie(s.y)||Co(s.y))?Pr({x:l+yn(s.x,f),y:c+yn(s.y,h),textAnchor:"end",verticalAnchor:"end"},C):Pr({x:l+f/2,y:c+h/2,textAnchor:"middle",verticalAnchor:"middle"},C)},Jae=function(t){return"cx"in t&&Ie(t.cx)};function zr(e){var t=e.offset,r=t===void 0?5:t,n=Uae(e,Lae),i=Pr({offset:r},n),s=i.viewBox,o=i.position,l=i.value,c=i.children,f=i.content,h=i.className,d=h===void 0?"":h,m=i.textBreakAll;if(!s||yt(l)&&yt(c)&&!I.isValidElement(f)&&!ht(f))return null;if(I.isValidElement(f))return I.cloneElement(f,i);var p;if(ht(f)){if(p=I.createElement(f,i),I.isValidElement(p))return p}else p=Gae(i);var x=Jae(s),y=lt(i,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Qae(i,p,y);var v=x?Xae(i):Zae(i);return oe.createElement(Qo,gf({className:xt("recharts-label",d)},y,v,{breakAll:m}),p)}zr.displayName="Label";var j5=function(t){var r=t.cx,n=t.cy,i=t.angle,s=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,f=t.innerRadius,h=t.outerRadius,d=t.x,m=t.y,p=t.top,x=t.left,y=t.width,v=t.height,b=t.clockWise,w=t.labelViewBox;if(w)return w;if(Ie(y)&&Ie(v)){if(Ie(d)&&Ie(m))return{x:d,y:m,width:y,height:v};if(Ie(p)&&Ie(x))return{x:p,y:x,width:y,height:v}}return Ie(d)&&Ie(m)?{x:d,y:m,width:0,height:0}:Ie(r)&&Ie(n)?{cx:r,cy:n,startAngle:s||i||0,endAngle:o||i||0,innerRadius:f||0,outerRadius:h||c||l||0,clockWise:b}:t.viewBox?t.viewBox:{}},eie=function(t,r){return t?t===!0?oe.createElement(zr,{key:"label-implicit",viewBox:r}):Rr(t)?oe.createElement(zr,{key:"label-implicit",viewBox:r,value:t}):I.isValidElement(t)?t.type===zr?I.cloneElement(t,{key:"label-implicit",viewBox:r}):oe.createElement(zr,{key:"label-implicit",content:t,viewBox:r}):ht(t)?oe.createElement(zr,{key:"label-implicit",content:t,viewBox:r}):uu(t)?oe.createElement(zr,gf({viewBox:r},t,{key:"label-implicit"})):null:null},tie=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,s=j5(t),o=Gn(i,zr).map(function(c,f){return I.cloneElement(c,{viewBox:r||s,key:"label-".concat(f)})});if(!n)return o;var l=eie(t.label,r||s);return[l].concat(Dae(o))};zr.parseViewBox=j5;zr.renderCallByParent=tie;var w_,W4;function rie(){if(W4)return w_;W4=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return w_=e,w_}var nie=rie();const aie=Ft(nie);function yf(e){"@babel/helpers - typeof";return yf=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},yf(e)}var iie=["valueAccessor"],sie=["data","dataKey","clockWise","id","textBreakAll"];function oie(e){return die(e)||uie(e)||cie(e)||lie()}function lie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
439In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cie(e,t){if(e){if(typeof e=="string")return L1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L1(e,t)}}function uie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function die(e){if(Array.isArray(e))return L1(e)}function L1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rg(){return rg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rg.apply(this,arguments)}function K4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function G4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K4(Object(r),!0).forEach(function(n){fie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fie(e,t,r){return t=hie(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hie(e){var t=mie(e,"string");return yf(t)=="symbol"?t:t+""}function mie(e,t){if(yf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y4(e,t){if(e==null)return{};var r=pie(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var gie=function(t){return Array.isArray(t.value)?aie(t.value):t.value};function Hi(e){var t=e.valueAccessor,r=t===void 0?gie:t,n=Y4(e,iie),i=n.data,s=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,f=Y4(n,sie);return!i||!i.length?null:oe.createElement(At,{className:"recharts-label-list"},i.map(function(h,d){var m=yt(s)?r(h,d):Ar(h&&h.payload,s),p=yt(l)?{}:{id:"".concat(l,"-").concat(d)};return oe.createElement(zr,rg({},lt(h,!0),f,p,{parentViewBox:h.parentViewBox,value:m,textBreakAll:c,viewBox:zr.parseViewBox(yt(o)?h:G4(G4({},h),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}Hi.displayName="LabelList";function yie(e,t){return e?e===!0?oe.createElement(Hi,{key:"labelList-implicit",data:t}):oe.isValidElement(e)||ht(e)?oe.createElement(Hi,{key:"labelList-implicit",data:t,content:e}):uu(e)?oe.createElement(Hi,rg({data:t},e,{key:"labelList-implicit"})):null:null}function vie(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Gn(n,Hi).map(function(o,l){return I.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return i;var s=yie(e.label,t);return[s].concat(oie(i))}Hi.renderCallByParent=vie;function vf(e){"@babel/helpers - typeof";return vf=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},vf(e)}function D1(){return D1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D1.apply(this,arguments)}function Q4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function X4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Q4(Object(r),!0).forEach(function(n){xie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xie(e,t,r){return t=bie(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bie(e){var t=wie(e,"string");return vf(t)=="symbol"?t:t+""}function wie(e,t){if(vf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(vf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _ie=function(t,r){var n=gn(r-t),i=Math.min(Math.abs(r-t),359.999);return n*i},$m=function(t){var r=t.cx,n=t.cy,i=t.radius,s=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,f=t.cornerIsExternal,h=c*(l?1:-1)+i,d=Math.asin(c/h)/tg,m=f?s:s+o*d,p=nr(r,n,h,m),x=nr(r,n,i,m),y=f?s-o*d:s,v=nr(r,n,h*Math.cos(d*tg),y);return{center:p,circleTangency:x,lineTangency:v,theta:d}},N5=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,s=t.outerRadius,o=t.startAngle,l=t.endAngle,c=_ie(o,l),f=o+c,h=nr(r,n,s,o),d=nr(r,n,s,f),m="M ".concat(h.x,",").concat(h.y,`
440    A `).concat(s,",").concat(s,`,0,
441    `).concat(+(Math.abs(c)>180),",").concat(+(o>f),`,
442    `).concat(d.x,",").concat(d.y,`
443  `);if(i>0){var p=nr(r,n,i,o),x=nr(r,n,i,f);m+="L ".concat(x.x,",").concat(x.y,`
444            A `).concat(i,",").concat(i,`,0,
445            `).concat(+(Math.abs(c)>180),",").concat(+(o<=f),`,
446            `).concat(p.x,",").concat(p.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},jie=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,s=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,d=gn(h-f),m=$m({cx:r,cy:n,radius:s,angle:f,sign:d,cornerRadius:o,cornerIsExternal:c}),p=m.circleTangency,x=m.lineTangency,y=m.theta,v=$m({cx:r,cy:n,radius:s,angle:h,sign:-d,cornerRadius:o,cornerIsExternal:c}),b=v.circleTangency,w=v.lineTangency,_=v.theta,N=c?Math.abs(f-h):Math.abs(f-h)-y-_;if(N<0)return l?"M ".concat(x.x,",").concat(x.y,`
447        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
448        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
449      `):N5({cx:r,cy:n,innerRadius:i,outerRadius:s,startAngle:f,endAngle:h});var S="M ".concat(x.x,",").concat(x.y,`
450    A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,`
451    A`).concat(s,",").concat(s,",0,").concat(+(N>180),",").concat(+(d<0),",").concat(b.x,",").concat(b.y,`
452    A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(w.x,",").concat(w.y,`
453  `);if(i>0){var k=$m({cx:r,cy:n,radius:i,angle:f,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),C=k.circleTangency,O=k.lineTangency,R=k.theta,A=$m({cx:r,cy:n,radius:i,angle:h,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),P=A.circleTangency,E=A.lineTangency,T=A.theta,$=c?Math.abs(f-h):Math.abs(f-h)-R-T;if($<0&&o===0)return"".concat(S,"L").concat(r,",").concat(n,"Z");S+="L".concat(E.x,",").concat(E.y,`
454      A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,`
455      A`).concat(i,",").concat(i,",0,").concat(+($>180),",").concat(+(d>0),",").concat(C.x,",").concat(C.y,`
456      A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(O.x,",").concat(O.y,"Z")}else S+="L".concat(r,",").concat(n,"Z");return S},Nie={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},S5=function(t){var r=X4(X4({},Nie),t),n=r.cx,i=r.cy,s=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,f=r.cornerIsExternal,h=r.startAngle,d=r.endAngle,m=r.className;if(o<s||h===d)return null;var p=xt("recharts-sector",m),x=o-s,y=yn(l,x,0,!0),v;return y>0&&Math.abs(h-d)<360?v=jie({cx:n,cy:i,innerRadius:s,outerRadius:o,cornerRadius:Math.min(y,x/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:h,endAngle:d}):v=N5({cx:n,cy:i,innerRadius:s,outerRadius:o,startAngle:h,endAngle:d}),oe.createElement("path",D1({},lt(r,!0),{className:p,d:v,role:"img"}))};function xf(e){"@babel/helpers - typeof";return xf=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},xf(e)}function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$1.apply(this,arguments)}function Z4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function J4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z4(Object(r),!0).forEach(function(n){Sie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z4(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sie(e,t,r){return t=kie(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kie(e){var t=Cie(e,"string");return xf(t)=="symbol"?t:t+""}function Cie(e,t){if(xf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eR={curveBasisClosed:GQ,curveBasisOpen:YQ,curveBasis:KQ,curveBumpX:AQ,curveBumpY:RQ,curveLinearClosed:QQ,curveLinear:ty,curveMonotoneX:XQ,curveMonotoneY:ZQ,curveNatural:JQ,curveStep:eX,curveStepAfter:rX,curveStepBefore:tX},qm=function(t){return t.x===+t.x&&t.y===+t.y},pd=function(t){return t.x},gd=function(t){return t.y},Fie=function(t,r){if(ht(t))return t;var n="curve".concat(Jg(t));return(n==="curveMonotone"||n==="curveBump")&&r?eR["".concat(n).concat(r==="vertical"?"Y":"X")]:eR[n]||ty},Oie=function(t){var r=t.type,n=r===void 0?"linear":r,i=t.points,s=i===void 0?[]:i,o=t.baseLine,l=t.layout,c=t.connectNulls,f=c===void 0?!1:c,h=Fie(n,l),d=f?s.filter(function(y){return qm(y)}):s,m;if(Array.isArray(o)){var p=f?o.filter(function(y){return qm(y)}):o,x=d.map(function(y,v){return J4(J4({},y),{},{base:p[v]})});return l==="vertical"?m=Pm().y(gd).x1(pd).x0(function(y){return y.base.x}):m=Pm().x(pd).y1(gd).y0(function(y){return y.base.y}),m.defined(qm).curve(h),m(x)}return l==="vertical"&&Ie(o)?m=Pm().y(gd).x1(pd).x0(o):Ie(o)?m=Pm().x(pd).y1(gd).y0(o):m=_3().x(pd).y(gd),m.defined(qm).curve(h),m(d)},ng=function(t){var r=t.className,n=t.points,i=t.path,s=t.pathRef;if((!n||!n.length)&&!i)return null;var o=n&&n.length?Oie(t):i;return I.createElement("path",$1({},lt(t,!1),Ep(t),{className:xt("recharts-curve",r),d:o,ref:s}))},__={exports:{}},j_,tR;function Eie(){if(tR)return j_;tR=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return j_=e,j_}var N_,rR;function Pie(){if(rR)return N_;rR=1;var e=Eie();function t(){}function r(){}return r.resetWarningCache=t,N_=function(){function n(o,l,c,f,h,d){if(d!==e){var m=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 m.name="Invariant Violation",m}}n.isRequired=n;function i(){return n}var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return s.PropTypes=s,s},N_}var nR;function Tie(){return nR||(nR=1,__.exports=Pie()()),__.exports}var Aie=Tie();const Lt=Ft(Aie);var Rie=Object.getOwnPropertyNames,Iie=Object.getOwnPropertySymbols,Mie=Object.prototype.hasOwnProperty;function aR(e,t){return function(n,i,s){return e(n,i,s)&&t(n,i,s)}}function Bm(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var s=i.cache,o=s.get(r),l=s.get(n);if(o&&l)return o===n&&l===r;s.set(r,n),s.set(n,r);var c=e(r,n,i);return s.delete(r),s.delete(n),c}}function iR(e){return Rie(e).concat(Iie(e))}var Lie=Object.hasOwn||(function(e,t){return Mie.call(e,t)});function ml(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Die="__v",$ie="__o",qie="_owner",sR=Object.getOwnPropertyDescriptor,oR=Object.keys;function Bie(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function zie(e,t){return ml(e.getTime(),t.getTime())}function Uie(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Hie(e,t){return e===t}function lR(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),s=e.entries(),o,l,c=0;(o=s.next())&&!o.done;){for(var f=t.entries(),h=!1,d=0;(l=f.next())&&!l.done;){if(i[d]){d++;continue}var m=o.value,p=l.value;if(r.equals(m[0],p[0],c,d,e,t,r)&&r.equals(m[1],p[1],m[0],p[0],e,t,r)){h=i[d]=!0;break}d++}if(!h)return!1;c++}return!0}var Vie=ml;function Wie(e,t,r){var n=oR(e),i=n.length;if(oR(t).length!==i)return!1;for(;i-- >0;)if(!k5(e,t,r,n[i]))return!1;return!0}function yd(e,t,r){var n=iR(e),i=n.length;if(iR(t).length!==i)return!1;for(var s,o,l;i-- >0;)if(s=n[i],!k5(e,t,r,s)||(o=sR(e,s),l=sR(t,s),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function Kie(e,t){return ml(e.valueOf(),t.valueOf())}function Gie(e,t){return e.source===t.source&&e.flags===t.flags}function cR(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var i=new Array(n),s=e.values(),o,l;(o=s.next())&&!o.done;){for(var c=t.values(),f=!1,h=0;(l=c.next())&&!l.done;){if(!i[h]&&r.equals(o.value,l.value,o.value,l.value,e,t,r)){f=i[h]=!0;break}h++}if(!f)return!1}return!0}function Yie(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function Qie(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 k5(e,t,r,n){return(n===qie||n===$ie||n===Die)&&(e.$$typeof||t.$$typeof)?!0:Lie(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var Xie="[object Arguments]",Zie="[object Boolean]",Jie="[object Date]",ese="[object Error]",tse="[object Map]",rse="[object Number]",nse="[object Object]",ase="[object RegExp]",ise="[object Set]",sse="[object String]",ose="[object URL]",lse=Array.isArray,uR=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,dR=Object.assign,cse=Object.prototype.toString.call.bind(Object.prototype.toString);function use(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,i=e.areFunctionsEqual,s=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,f=e.areRegExpsEqual,h=e.areSetsEqual,d=e.areTypedArraysEqual,m=e.areUrlsEqual;return function(x,y,v){if(x===y)return!0;
456if(x==null||y==null)return!1;var b=typeof x;if(b!==typeof y)return!1;if(b!=="object")return b==="number"?o(x,y,v):b==="function"?i(x,y,v):!1;var w=x.constructor;if(w!==y.constructor)return!1;if(w===Object)return l(x,y,v);if(lse(x))return t(x,y,v);if(uR!=null&&uR(x))return d(x,y,v);if(w===Date)return r(x,y,v);if(w===RegExp)return f(x,y,v);if(w===Map)return s(x,y,v);if(w===Set)return h(x,y,v);var _=cse(x);return _===Jie?r(x,y,v):_===ase?f(x,y,v):_===tse?s(x,y,v):_===ise?h(x,y,v):_===nse?typeof x.then!="function"&&typeof y.then!="function"&&l(x,y,v):_===ose?m(x,y,v):_===ese?n(x,y,v):_===Xie?l(x,y,v):_===Zie||_===rse||_===sse?c(x,y,v):!1}}function dse(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?yd:Bie,areDatesEqual:zie,areErrorsEqual:Uie,areFunctionsEqual:Hie,areMapsEqual:n?aR(lR,yd):lR,areNumbersEqual:Vie,areObjectsEqual:n?yd:Wie,arePrimitiveWrappersEqual:Kie,areRegExpsEqual:Gie,areSetsEqual:n?aR(cR,yd):cR,areTypedArraysEqual:n?yd:Yie,areUrlsEqual:Qie};if(r&&(i=dR({},i,r(i))),t){var s=Bm(i.areArraysEqual),o=Bm(i.areMapsEqual),l=Bm(i.areObjectsEqual),c=Bm(i.areSetsEqual);i=dR({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return i}function fse(e){return function(t,r,n,i,s,o,l){return e(t,r,l)}}function hse(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,s=e.strict;if(n)return function(c,f){var h=n(),d=h.cache,m=d===void 0?t?new WeakMap:void 0:d,p=h.meta;return r(c,f,{cache:m,equals:i,meta:p,strict:s})};if(t)return function(c,f){return r(c,f,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,f){return r(c,f,o)}}var mse=Zs();Zs({strict:!0});Zs({circular:!0});Zs({circular:!0,strict:!0});Zs({createInternalComparator:function(){return ml}});Zs({strict:!0,createInternalComparator:function(){return ml}});Zs({circular:!0,createInternalComparator:function(){return ml}});Zs({circular:!0,createInternalComparator:function(){return ml},strict:!0});function Zs(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,s=e.strict,o=s===void 0?!1:s,l=dse(e),c=use(l),f=n?n(c):fse(c);return hse({circular:r,comparator:c,createState:i,equals:f,strict:o})}function pse(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function fR(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(s){r<0&&(r=s),s-r>t?(e(s),r=-1):pse(i)};requestAnimationFrame(n)}function q1(e){"@babel/helpers - typeof";return q1=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},q1(e)}function gse(e){return bse(e)||xse(e)||vse(e)||yse()}function yse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
457In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vse(e,t){if(e){if(typeof e=="string")return hR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hR(e,t)}}function hR(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bse(e){if(Array.isArray(e))return e}function wse(){var e={},t=function(){return null},r=!1,n=function i(s){if(!r){if(Array.isArray(s)){if(!s.length)return;var o=s,l=gse(o),c=l[0],f=l.slice(1);if(typeof c=="number"){fR(i.bind(null,f),c);return}i(c),fR(i.bind(null,f));return}q1(s)==="object"&&(e=s,t(e)),typeof s=="function"&&s()}};return{stop:function(){r=!0},start:function(s){r=!1,n(s)},subscribe:function(s){return t=s,function(){t=function(){return null}}}}}function bf(e){"@babel/helpers - typeof";return bf=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},bf(e)}function mR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 58,846 bytes, lines 457-475
457t%2?mR(Object(r),!0).forEach(function(n){C5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function C5(e,t,r){return t=_se(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _se(e){var t=jse(e,"string");return bf(t)==="symbol"?t:String(t)}function jse(e,t){if(bf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(bf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nse=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,i){return n.filter(function(s){return i.includes(s)})})},Sse=function(t){return t},kse=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Dd=function(t,r){return Object.keys(r).reduce(function(n,i){return pR(pR({},n),{},C5({},i,t(i,r[i])))},{})},gR=function(t,r,n){return t.map(function(i){return"".concat(kse(i)," ").concat(r,"ms ").concat(n)}).join(",")};function Cse(e,t){return Ese(e)||Ose(e,t)||F5(e,t)||Fse()}function Fse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
458In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ose(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function Ese(e){if(Array.isArray(e))return e}function Pse(e){return Rse(e)||Ase(e)||F5(e)||Tse()}function Tse(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
459In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F5(e,t){if(e){if(typeof e=="string")return B1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B1(e,t)}}function Ase(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rse(e){if(Array.isArray(e))return B1(e)}function B1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ag=1e-4,O5=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},E5=function(t,r){return t.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},yR=function(t,r){return function(n){var i=O5(t,r);return E5(i,n)}},Ise=function(t,r){return function(n){var i=O5(t,r),s=[].concat(Pse(i.map(function(o,l){return o*l}).slice(1)),[0]);return E5(s,n)}},vR=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0],s=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,s=0,o=1,l=1;break;case"ease":i=.25,s=.1,o=.25,l=1;break;case"ease-in":i=.42,s=0,o=1,l=1;break;case"ease-out":i=.42,s=0,o=.58,l=1;break;case"ease-in-out":i=0,s=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var f=c[1].split(")")[0].split(",").map(function(v){return parseFloat(v)}),h=Cse(f,4);i=h[0],s=h[1],o=h[2],l=h[3]}}}var d=yR(i,o),m=yR(s,l),p=Ise(i,o),x=function(b){return b>1?1:b<0?0:b},y=function(b){for(var w=b>1?1:b,_=w,N=0;N<8;++N){var S=d(_)-w,k=p(_);if(Math.abs(S-w)<ag||k<ag)return m(_);_=x(_-S/k)}return m(_)};return y.isStepper=!1,y},Mse=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,s=i===void 0?8:i,o=t.dt,l=o===void 0?17:o,c=function(h,d,m){var p=-(h-d)*n,x=m*s,y=m+(p-x)*l/1e3,v=m*l/1e3+h;return Math.abs(v-d)<ag&&Math.abs(y)<ag?[d,0]:[v,y]};return c.isStepper=!0,c.dt=l,c},Lse=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return vR(i);case"spring":return Mse();default:if(i.split("(")[0]==="cubic-bezier")return vR(i)}return typeof i=="function"?i:null};function wf(e){"@babel/helpers - typeof";return wf=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},wf(e)}function xR(e){return qse(e)||$se(e)||P5(e)||Dse()}function Dse(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
460In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $se(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qse(e){if(Array.isArray(e))return U1(e)}function bR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bR(Object(r),!0).forEach(function(n){z1(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function z1(e,t,r){return t=Bse(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bse(e){var t=zse(e,"string");return wf(t)==="symbol"?t:String(t)}function zse(e,t){if(wf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Use(e,t){return Wse(e)||Vse(e,t)||P5(e,t)||Hse()}function Hse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
461In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P5(e,t){if(e){if(typeof e=="string")return U1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U1(e,t)}}function U1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Vse(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function Wse(e){if(Array.isArray(e))return e}var ig=function(t,r,n){return t+(r-t)*n},H1=function(t){var r=t.from,n=t.to;return r!==n},Kse=function e(t,r,n){var i=Dd(function(s,o){if(H1(o)){var l=t(o.from,o.to,o.velocity),c=Use(l,2),f=c[0],h=c[1];return Qr(Qr({},o),{},{from:f,velocity:h})}return o},r);return n<1?Dd(function(s,o){return H1(o)?Qr(Qr({},o),{},{velocity:ig(o.velocity,i[s].velocity,n),from:ig(o.from,i[s].from,n)}):o},r):e(t,i,n-1)};const Gse=(function(e,t,r,n,i){var s=Nse(e,t),o=s.reduce(function(v,b){return Qr(Qr({},v),{},z1({},b,[e[b],t[b]]))},{}),l=s.reduce(function(v,b){return Qr(Qr({},v),{},z1({},b,{from:e[b],velocity:0,to:t[b]}))},{}),c=-1,f,h,d=function(){return null},m=function(){return Dd(function(b,w){return w.from},l)},p=function(){return!Object.values(l).filter(H1).length},x=function(b){f||(f=b);var w=b-f,_=w/r.dt;l=Kse(r,l,_),i(Qr(Qr(Qr({},e),t),m())),f=b,p()||(c=requestAnimationFrame(d))},y=function(b){h||(h=b);var w=(b-h)/n,_=Dd(function(S,k){return ig.apply(void 0,xR(k).concat([r(w)]))},o);if(i(Qr(Qr(Qr({},e),t),_)),w<1)c=requestAnimationFrame(d);else{var N=Dd(function(S,k){return ig.apply(void 0,xR(k).concat([r(1)]))},o);i(Qr(Qr(Qr({},e),t),N))}};return d=r.isStepper?x:y,function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}});function $c(e){"@babel/helpers - typeof";return $c=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},$c(e)}var Yse=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Qse(e,t){if(e==null)return{};var r=Xse(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Xse(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function S_(e){return toe(e)||eoe(e)||Jse(e)||Zse()}function Zse(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
462In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jse(e,t){if(e){if(typeof e=="string")return V1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V1(e,t)}}function eoe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function toe(e){if(Array.isArray(e))return V1(e)}function V1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Sa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wR(Object(r),!0).forEach(function(n){Pd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pd(e,t,r){return t=T5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function roe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function noe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,T5(n.key),n)}}function aoe(e,t,r){return t&&noe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function T5(e){var t=ioe(e,"string");return $c(t)==="symbol"?t:String(t)}function ioe(e,t){if($c(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($c(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function soe(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&&W1(e,t)}function W1(e,t){return W1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},W1(e,t)}function ooe(e){var t=loe();return function(){var n=sg(e),i;if(t){var s=sg(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return K1(this,i)}}function K1(e,t){if(t&&($c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G1(e)}function G1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function loe(){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 sg(e){return sg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sg(e)}var di=(function(e){soe(r,e);var t=ooe(r);function r(n,i){var s;roe(this,r),s=t.call(this,n,i);var o=s.props,l=o.isActive,c=o.attributeName,f=o.from,h=o.to,d=o.steps,m=o.children,p=o.duration;if(s.handleStyleChange=s.handleStyleChange.bind(G1(s)),s.changeStyle=s.changeStyle.bind(G1(s)),!l||p<=0)return s.state={style:{}},typeof m=="function"&&(s.state={style:h}),K1(s);if(d&&d.length)s.state={style:d[0].style};else if(f){if(typeof m=="function")return s.state={style:f},K1(s);s.state={style:c?Pd({},c,f):f}}else s.state={style:{}};return s}return aoe(r,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,o=i.canBegin;this.mounted=!0,!(!s||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,o=s.isActive,l=s.canBegin,c=s.attributeName,f=s.shouldReAnimate,h=s.to,d=s.from,m=this.state.style;if(l){if(!o){var p={style:c?Pd({},c,h):h};this.state&&m&&(c&&m[c]!==h||!c&&m!==h)&&this.setState(p);return}if(!(mse(i.to,h)&&i.canBegin&&i.isActive)){var x=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=x||f?d:i.to;if(this.state&&m){var v={style:c?Pd({},c,y):y};(c&&m[c]!==y||!c&&m!==y)&&this.setState(v)}this.runAnimation(Sa(Sa({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,o=i.from,l=i.to,c=i.duration,f=i.easing,h=i.begin,d=i.onAnimationEnd,m=i.onAnimationStart,p=Gse(o,l,Lse(f),c,this.changeStyle),x=function(){s.stopJSAnimation=p()};this.manager.start([m,h,x,c,d])}},{key:"runStepAnimation",value:function(i){var s=this,o=i.steps,l=i.begin,c=i.onAnimationStart,f=o[0],h=f.style,d=f.duration,m=d===void 0?0:d,p=function(y,v,b){if(b===0)return y;var w=v.duration,_=v.easing,N=_===void 0?"ease":_,S=v.style,k=v.properties,C=v.onAnimationEnd,O=b>0?o[b-1]:v,R=k||Object.keys(S);if(typeof N=="function"||N==="spring")return[].concat(S_(y),[s.runJSAnimation.bind(s,{from:O.style,to:S,duration:w,easing:N}),w]);var A=gR(R,w,N),P=Sa(Sa(Sa({},O.style),S),{},{transition:A});return[].concat(S_(y),[P,w,C]).filter(Sse)};return this.manager.start([c].concat(S_(o.reduce(p,[h,Math.max(m,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=wse());var s=i.begin,o=i.duration,l=i.attributeName,c=i.to,f=i.easing,h=i.onAnimationStart,d=i.onAnimationEnd,m=i.steps,p=i.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof f=="function"||typeof p=="function"||f==="spring"){this.runJSAnimation(i);return}if(m.length>1){this.runStepAnimation(i);return}var y=l?Pd({},l,c):c,v=gR(Object.keys(y),o,f);x.start([h,s,Sa(Sa({},y),{},{transition:v}),o,d])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=Qse(i,Yse),f=I.Children.count(s),h=this.state.style;if(typeof s=="function")return s(h);if(!l||f===0||o<=0)return s;var d=function(p){var x=p.props,y=x.style,v=y===void 0?{}:y,b=x.className,w=I.cloneElement(p,Sa(Sa({},c),{},{style:Sa(Sa({},v),h),className:b}));return w};return f===1?d(I.Children.only(s)):oe.createElement("div",null,I.Children.map(s,function(m){return d(m)}))}}]),r})(I.PureComponent);di.displayName="Animate";di.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};di.propTypes={from:Lt.oneOfType([Lt.object,Lt.string]),to:Lt.oneOfType([Lt.object,Lt.string]),attributeName:Lt.string,duration:Lt.number,begin:Lt.number,easing:Lt.oneOfType([Lt.string,Lt.func]),steps:Lt.arrayOf(Lt.shape({duration:Lt.number.isRequired,style:Lt.object.isRequired,easing:Lt.oneOfType([Lt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Lt.func]),properties:Lt.arrayOf("string"),onAnimationEnd:Lt.func})),children:Lt.oneOfType([Lt.node,Lt.func]),isActive:Lt.bool,canBegin:Lt.bool,onAnimationEnd:Lt.func,shouldReAnimate:Lt.bool,onAnimationStart:Lt.func,onAnimationReStart:Lt.func};function _f(e){"@babel/helpers - typeof";return _f=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},_f(e)}function og(){return og=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},og.apply(this,arguments)}function coe(e,t){return hoe(e)||foe(e,t)||doe(e,t)||uoe()}function uoe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
463In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function doe(e,t){if(e){if(typeof e=="string")return _R(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _R(e,t)}}function _R(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function foe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function hoe(e){if(Array.isArray(e))return e}function jR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function NR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jR(Object(r),!0).forEach(function(n){moe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function moe(e,t,r){return t=poe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function poe(e){var t=goe(e,"string");return _f(t)=="symbol"?t:t+""}function goe(e,t){if(_f(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_f(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SR=function(t,r,n,i,s){var o=Math.min(Math.abs(n)/2,Math.abs(i)/2),l=i>=0?1:-1,c=n>=0?1:-1,f=i>=0&&n>=0||i<0&&n<0?1:0,h;if(o>0&&s instanceof Array){for(var d=[0,0,0,0],m=0,p=4;m<p;m++)d[m]=s[m]>o?o:s[m];h="M".concat(t,",").concat(r+l*d[0]),d[0]>0&&(h+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(f,",").concat(t+c*d[0],",").concat(r)),h+="L ".concat(t+n-c*d[1],",").concat(r),d[1]>0&&(h+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(f,`,
464        `).concat(t+n,",").concat(r+l*d[1])),h+="L ".concat(t+n,",").concat(r+i-l*d[2]),d[2]>0&&(h+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(f,`,
465        `).concat(t+n-c*d[2],",").concat(r+i)),h+="L ".concat(t+c*d[3],",").concat(r+i),d[3]>0&&(h+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(f,`,
466        `).concat(t,",").concat(r+i-l*d[3])),h+="Z"}else if(o>0&&s===+s&&s>0){var x=Math.min(o,s);h="M ".concat(t,",").concat(r+l*x,`
467            A `).concat(x,",").concat(x,",0,0,").concat(f,",").concat(t+c*x,",").concat(r,`
468            L `).concat(t+n-c*x,",").concat(r,`
469            A `).concat(x,",").concat(x,",0,0,").concat(f,",").concat(t+n,",").concat(r+l*x,`
470            L `).concat(t+n,",").concat(r+i-l*x,`
471            A `).concat(x,",").concat(x,",0,0,").concat(f,",").concat(t+n-c*x,",").concat(r+i,`
472            L `).concat(t+c*x,",").concat(r+i,`
473            A `).concat(x,",").concat(x,",0,0,").concat(f,",").concat(t,",").concat(r+i-l*x," Z")}else h="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return h},yoe=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,s=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var f=Math.min(s,s+l),h=Math.max(s,s+l),d=Math.min(o,o+c),m=Math.max(o,o+c);return n>=f&&n<=h&&i>=d&&i<=m}return!1},voe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},sk=function(t){var r=NR(NR({},voe),t),n=I.useRef(),i=I.useState(-1),s=coe(i,2),o=s[0],l=s[1];I.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var N=n.current.getTotalLength();N&&l(N)}catch{}},[]);var c=r.x,f=r.y,h=r.width,d=r.height,m=r.radius,p=r.className,x=r.animationEasing,y=r.animationDuration,v=r.animationBegin,b=r.isAnimationActive,w=r.isUpdateAnimationActive;if(c!==+c||f!==+f||h!==+h||d!==+d||h===0||d===0)return null;var _=xt("recharts-rectangle",p);return w?oe.createElement(di,{canBegin:o>0,from:{width:h,height:d,x:c,y:f},to:{width:h,height:d,x:c,y:f},duration:y,animationEasing:x,isActive:w},function(N){var S=N.width,k=N.height,C=N.x,O=N.y;return oe.createElement(di,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,isActive:b,easing:x},oe.createElement("path",og({},lt(r,!0),{className:_,d:SR(C,O,S,k,m),ref:n})))}):oe.createElement("path",og({},lt(r,!0),{className:_,d:SR(c,f,h,d,m)}))},xoe=["points","className","baseLinePoints","connectNulls"];function rc(){return rc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rc.apply(this,arguments)}function boe(e,t){if(e==null)return{};var r=woe(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function woe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function kR(e){return Soe(e)||Noe(e)||joe(e)||_oe()}function _oe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
474In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function joe(e,t){if(e){if(typeof e=="string")return Y1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Y1(e,t)}}function Noe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Soe(e){if(Array.isArray(e))return Y1(e)}function Y1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var CR=function(t){return t&&t.x===+t.x&&t.y===+t.y},koe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){CR(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),CR(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},$d=function(t,r){var n=koe(t);r&&(n=[n.reduce(function(s,o){return[].concat(kR(s),kR(o))},[])]);var i=n.map(function(s){return s.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},Coe=function(t,r,n){var i=$d(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat($d(r.reverse(),n).slice(1))},Foe=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,s=t.connectNulls,o=boe(t,xoe);if(!r||!r.length)return null;var l=xt("recharts-polygon",n);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",f=Coe(r,i,s);return oe.createElement("g",{className:l},oe.createElement("path",rc({},lt(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),c?oe.createElement("path",rc({},lt(o,!0),{fill:"none",d:$d(r,s)})):null,c?oe.createElement("path",rc({},lt(o,!0),{fill:"none",d:$d(i,s)})):null)}var h=$d(r,s);return oe.createElement("path",rc({},lt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:l,d:h}))};function Q1(){return Q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Q1.apply(this,arguments)}var yy=function(t){var r=t.cx,n=t.cy,i=t.r,s=t.className,o=xt("recharts-dot",s);return r===+r&&n===+n&&i===+i?I.createElement("circle",Q1({},lt(t,!1),Ep(t),{className:o,cx:r,cy:n,r:i})):null};function jf(e){"@babel/helpers - typeof";return jf=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},jf(e)}var Ooe=["x","y","top","left","width","height","className"];function X1(){return X1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},X1.apply(this,arguments)}function FR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Eoe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FR(Object(r),!0).forEach(function(n){Poe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Poe(e,t,r){return t=Toe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Toe(e){var t=Aoe(e,"string");return jf(t)=="symbol"?t:t+""}function Aoe(e,t){if(jf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Roe(e,t){if(e==null)return{};var r=Ioe(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ioe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Moe=function(t,r,n,i,s,o){return"M".concat(t,",").concat(s,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},Loe=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,s=i===void 0?0:i,o=t.top,l=o===void 0?0:o,c=t.left,f=c===void 0?0:c,h=t.width,d=h===void 0?0:h,m=t.height,p=m===void 0?0:m,x=t.className,y=Roe(t,Ooe),v=Eoe({x:n,y:s,top:l,left:f,width:d,height:p},y);return!Ie(n)||!Ie(s)||!Ie(d)||!Ie(p)||!Ie(l)||!Ie(f)?null:oe.createElement("path",X1({},lt(v,!0),{className:xt("recharts-cross",x),d:Moe(n,s,d,p,l,f)}))},k_,OR;function Doe(){if(OR)return k_;OR=1;var e=fy(),t=W$(),r=yi();function n(i,s){return i&&i.length?e(i,r(s,2),t):void 0}return k_=n,k_}var $oe=Doe();const qoe=Ft($oe);var C_,ER;function Boe(){if(ER)return C_;ER=1;var e=fy(),t=yi(),r=K$();function n(i,s){return i&&i.length?e(i,t(s,2),r):void 0}return C_=n,C_}var zoe=Boe();const Uoe=Ft(zoe);var Hoe=["cx","cy","angle","ticks","axisLine"],Voe=["ticks","tick","angle","tickFormatter","stroke"];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)}function qd(){return qd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qd.apply(this,arguments)}function PR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PR(Object(r),!0).forEach(function(n){vy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TR(e,t){if(e==null)return{};var r=Woe(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Woe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Koe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,R5(n.key),n)}}function Goe(e,t,r){return t&&AR(e.prototype,t),r&&AR(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yoe(e,t,r){return t=lg(t),Qoe(e,A5()?Reflect.construct(t,r||[],lg(e).constructor):t.apply(e,r))}function Qoe(e,t){if(t&&(qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xoe(e)}function Xoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A5=function(){return!!e})()}function lg(e){return lg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lg(e)}function Zoe(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&&Z1(e,t)}function Z1(e,t){return Z1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Z1(e,t)}function vy(e,t,r){return t=R5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R5(e){var t=Joe(e,"string");return qc(t)=="symbol"?t:t+""}function Joe(e,t){if(qc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var xy=(function(e){function t(){return Koe(this,t),Yoe(this,t,arguments)}return Zoe(t,e),Goe(t,[{key:"getTickValueCoord",value:function(n){var i=n.coordinate,s=this.props,o=s.angle,l=s.cx,c=s.cy;return nr(l,c,i,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,i;switch(n){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var n=this.props,i=n.cx,s=n.cy,o=n.angle,l=n.ticks,c=qoe(l,function(h){return h.coordinate||0}),f=Uoe(l,function(h){return h.coordinate||0});return{cx:i,cy:s,startAngle:o,endAngle:o,innerRadius:f.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,s=n.cy,o=n.angle,l=n.ticks,c=n.axisLine,f=TR(n,Hoe),h=l.reduce(function(x,y){return[Math.min(x[0],y.coordinate),Math.max(x[1],y.coordinate)]},[1/0,-1/0]),d=nr(i,s,h[0],o),m=nr(i,s,h[1],o),p=xo(xo(xo({},lt(f,!1)),{},{fill:"none"},lt(c,!1)),{},{x1:d.x,y1:d.y,x2:m.x,y2:m.y});return oe.createElement("line",qd({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var n=this,i=this.props,s=i.ticks,o=i.tick,l=i.angle,c=i.tickFormatter,f=i.stroke,h=TR(i,Voe),d=this.getTickTextAnchor(),m=lt(h,!1),p=lt(o,!1),x=s.map(function(y,v){var b=n.getTickValueCoord(y),w=xo(xo(xo(xo({textAnchor:d,transform:"rotate(".concat(90-l,", ").concat(b.x,", ").concat(b.y,")")},m),{},{stroke:"none",fill:f},p),{},{index:v},b),{},{payload:y});return oe.createElement(At,qd({className:xt("recharts-polar-radius-axis-tick",_5(o)),key:"tick-".concat(y.coordinate)},Yo(n.props,y,v)),t.renderTickItem(o,w,c?c(y.value,v):y.value))});return oe.createElement(At,{className:"recharts-polar-radius-axis-ticks"},x)}},{key:"render",value:function(){var n=this.props,i=n.ticks,s=n.axisLine,o=n.tick;return!i||!i.length?null:oe.createElement(At,{className:xt("recharts-polar-radius-axis",this.props.className)},s&&this.renderAxisLine(),o&&this.renderTicks(),zr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,i,s){var o;return oe.isValidElement(n)?o=oe.cloneElement(n,i):ht(n)?o=n(i):o=oe.createElement(Qo,qd({},i,{className:"recharts-polar-radius-axis-tick-value"}),s),o}}])})(I.PureComponent);vy(xy,"displayName","PolarRadiusAxis");vy(xy,"axisType","radiusAxis");vy(xy,"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 Bc(e){"@babel/helpers - typeof";return Bc=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},Bc(e)}function No(){return No=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},No.apply(this,arguments)}function RR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RR(Object(r),!0).forEach(function(n){by(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ele(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,M5(n.key),n)}}function tle(e,t,r){return t&&IR(e.prototype,t),r&&IR(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function rle(e,t,r){return t=cg(t),nle(e,I5()?Reflect.construct(t,r||[],cg(e).constructor):t.apply(e,r))}function nle(e,t){if(t&&(Bc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ale(e)}function ale(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I5=function(){return!!e})()}function cg(e){return cg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cg(e)}function ile(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&&J1(e,t)}function J1(e,t){return J1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},J1(e,t)}function by(e,t,r){return t=M5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M5(e){var t=sle(e,"string");return Bc(t)=="symbol"?t:t+""}function sle(e,t){if(Bc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ole=Math.PI/180,MR=1e-5,wy=(function(e){function t(){return ele(this,t),rle(this,t,arguments)}return ile(t,e),tle(t,[{key:"getTickLineCoord",value:function(n){var i=this.props,s=i.cx,o=i.cy,l=i.radius,c=i.orientation,f=i.tickSize,h=f||8,d=nr(s,o,l,n.coordinate),m=nr(s,o,l+(c==="inner"?-1:1)*h,n.coordinate);return{x1:d.x,y1:d.y,x2:m.x,y2:m.y}}},{key:"getTickTextAnchor",value:function(n){var i=this.props.orientation,s=Math.cos(-n.coordinate*ole),o;return s>MR?o=i==="outer"?"start":"end":s<-MR?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,s=n.cy,o=n.radius,l=n.axisLine,c=n.axisLineType,f=bo(bo({},lt(this.props,!1)),{},{fill:"none"},lt(l,!1));if(c==="circle")return oe.createElement(yy,No({className:"recharts-polar-angle-axis-line"},f,{cx:i,cy:s,r:o}));var h=this.props.ticks,d=h.map(function(m){return nr(i,s,o,m.coordinate)});return oe.createElement(Foe,No({className:"recharts-polar-angle-axis-line"},f,{points:d}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,s=i.ticks,o=i.tick,l=i.tickLine,c=i.tickFormatter,f=i.stroke,h=lt(this.props,!1),d=lt(o,!1),m=bo(bo({},h),{},{fill:"none"},lt(l,!1)),p=s.map(function(x,y){var v=n.getTickLineCoord(x),b=n.getTickTextAnchor(x),w=bo(bo(bo({textAnchor:b},h),{},{stroke:"none",fill:f},d),{},{index:y,payload:x,x:v.x2,y:v.y2});return oe.createElement(At,No({className:xt("recharts-polar-angle-axis-tick",_5(o)),key:"tick-".concat(x.coordinate)},Yo(n.props,x,y)),l&&oe.createElement("line",No({className:"recharts-polar-angle-axis-tick-line"},m,v)),o&&t.renderTickItem(o,w,c?c(x.value,y):x.value))});return oe.createElement(At,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,i=n.ticks,s=n.radius,o=n.axisLine;return s<=0||!i||!i.length?null:oe.createElement(At,{className:xt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,s){var o;return oe.isValidElement(n)?o=oe.cloneElement(n,i):ht(n)?o=n(i):o=oe.createElement(Qo,No({},i,{className:"recharts-polar-angle-axis-tick-value"}),s),o}}])})(I.PureComponent);by(wy,"displayName","PolarAngleAxis");by(wy,"axisType","angleAxis");by(wy,"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 F_,LR;function lle(){if(LR)return F_;LR=1;var e=V3(),t=e(Object.getPrototypeOf,Object);return F_=t,F_}var O_,DR;function cle(){if(DR)return O_;DR=1;var e=Zi(),t=lle(),r=Ji(),n="[object Object]",i=Function.prototype,s=Object.prototype,o=i.toString,l=s.hasOwnProperty,c=o.call(Object);function f(h){if(!r(h)||e(h)!=n)return!1;var d=t(h);if(d===null)return!0;var m=l.call(d,"constructor")&&d.constructor;return typeof m=="function"&&m instanceof m&&o.call(m)==c}return O_=f,O_}var ule=cle();const dle=Ft(ule);var E_,$R;function fle(){if($R)return E_;$R=1;var e=Zi(),t=Ji(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return E_=n,E_}var hle=fle();const mle=Ft(hle);function Nf(e){"@babel/helpers - typeof";return Nf=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},Nf(e)}function ug(){return ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ug.apply(this,arguments)}function ple(e,t){return xle(e)||vle(e,t)||yle(e,t)||gle()}function gle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
475In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yle(e,t){if(e){if(typeof e=="string")return qR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qR(e,t)}}function qR(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vle(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function xle(e){if(Array.isArray(e))return e}function BR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BR(Object(r),!0).forEach(function(n){ble(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ble(e,t,r){return t=wle(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wle(e){var t=_le(e,"string");return Nf(t)=="symbol"?t:t+""}function _le(e,t){if(Nf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var UR=function(t,r,n,i,s){var o=n-i,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-o/2,",").concat(r+s),l+="L ".concat(t+n-o/2-i,",").concat(r+s),l+="L ".concat(t,",").concat(r," Z"),l},jle={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Nle=function(t){var r=zR(zR({},jle),t),n=I.useRef(),i=I.useState(-1),s=ple(i,2),o=s[0],l=s[1];I.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var _=n.current.getTotalLength();_&&l(_)}catch{}},[]);var c=r.x,f=r.y,h=r.upperWidth,d=r.lowerWidth,m=r.height,p=r.className,x=r.animationEasing,y=r.animationDuration,v=r.animationBegin,b=r.isUpdateAnimationActive;if(c!==+c||f!==+f||h!==+h||d!==+d||m!==+m||h===0&&d===0||m===0)return null;var w=xt("recharts-trapezoid",p);return b?oe.createElement(di,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:m,x:c,y:f},to:{upperWidth:h,lowerWidth:d,height:m,x:c,y:f},duration:y,animationEasing:x,isActive:b},function(_){var N=_.upperWidth,S=_.lowerWidth,k=_.height,C=_.x,O=_.y;return oe.createElement(di,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:y,easing:x},oe.createElement("path",ug({},lt(r,!0),{className:w,d:UR(C,O,N,S,k),ref:n})))}):oe.createElement("g",null,oe.createElement("path",ug({},lt(r,!0),{className:w,d:UR(c,f,h,d,m)})))},Sle=["option","shapeType","propTransformer","activeClassName","isActive"];function Sf(e){"@babel/helpers - typeof";return Sf=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},Sf(e)}function kle(e,t){if(e==null)return{};var r=Cle(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cle(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function HR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HR(Object(r),!0).forEach(function(n){Fle(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Fle(e,t,r){return t=Ole(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ole(e){var t=Ele(e,"string");return Sf(t)=="symbol"?t:t+""}function Ele(e,t){if(Sf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Sf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ple(e,t){return dg(dg({},t),e)}function Tle(e,t){return e==="symbols"}function VR(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return oe.createElement(sk,r);case"trapezoid":return oe.createElement(Nle,r);case"sector":return oe.createElement(S5,r);case"symbols":if(Tle(t))return oe.createElement(SS,r);break;default:return null}}function Ale(e){return I.isValidElement(e)?e.props:e}function L5(e){var t=e.option,r=e.shapeType,n=e.propTransformer,i=n===void 0?Ple:n,s=e.activeClassName,o=s===void 0?"recharts-active-shape":s,l=e.isActive,c=kle(e,Sle),f;if(I.isValidElement(t))f=I.cloneElement(t,dg(dg({},c),Ale(t)));else if(ht(t))f=t(c);else if(dle(t)&&!mle(t)){var h=i(t,c);f=oe.createElement(VR,{shapeType:r,elementProps:h})}else{var d=c;f=oe.createElement(VR,{shapeType:r,elementProps:d})}return l?oe.createElement(At,{className:o},f):f}function _y(e,t){return t!=null&&"trapezoids"in e.props}function jy(e,t){return t!=null&&"sectors"in e.props}function kf(e,t){return t!=null&&"points"in e.props}function Rle(e,t){var r,n,i=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,s=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return i&&s}function Ile(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Mle(e,t){var r=e.x===t.x,n=e.y===t.y,i=e.z===t.z;return r&&n&&i}function Lle(e,t){var r;return _y(e,t)?r=Rle:jy(e,t)?r=Ile:kf(e,t)&&(r=Mle),r}function Dle(e,t){var r;return _y(e,t)?r="trapezoids":jy(e,t)?r="sectors":kf(e,t)&&(r="points"),r}function $le(e,t){if(_y(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}if(jy(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}return kf(e,t)?t.payload:{}}function qle(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,i=Dle(r,t),s=$le(r,t),o=n.filter(function(c,f){var h=ah(s,c),d=r.props[i].filter(function(x){var y=Lle(r,t);return y(x,t)}),m=r.props[i].indexOf(d[d.length-1]),p=f===m;return h&&p}),l=n.indexOf(o[o.length-1]);return l}var fp;function zc(e){"@babel/helpers - typeof";return zc=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},zc(e)}function nc(){return nc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nc.apply(this,arguments)}function WR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WR(Object(r),!0).forEach(function(n){ma(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ble(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$5(n.key),n)}}function zle(e,t,r){return t&&KR(e.prototype,t),r&&KR(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ule(e,t,r){return t=fg(t),Hle(e,D5()?Reflect.construct(t,r||[],fg(e).constructor):t.apply(e,r))}function Hle(e,t){if(t&&(zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vle(e)}function Vle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D5=function(){return!!e})()}function fg(e){return fg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fg(e)}function Wle(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&&eN(e,t)}function eN(e,t){return eN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},eN(e,t)}function ma(e,t,r){return t=$5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $5(e){var t=Kle(e,"string");return zc(t)=="symbol"?t:t+""}function Kle(e,t){if(zc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ln=(function(e){function t(r){var n;return Ble(this,t),n=Ule(this,t,[r]),ma(n,"pieRef",null),ma(n,"sectorRefs",[]),ma(n,"id",du("recharts-pie-")),ma(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ht(i)&&i()}),ma(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ht(i)&&i()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return Wle(t,e),zle(t,[{key:"isActiveIndex",value:function(n){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(n)!==-1:n===i}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.label,l=s.labelLine,c=s.dataKey,f=s.valueKey,h=lt(this.props,!1),d=lt(o,!1),m=lt(l,!1),p=o&&o.offsetRadius||20,x=n.map(function(y,v){var b=(y.startAngle+y.endAngle)/2,w=nr(y.cx,y.cy,y.outerRadius+p,b),_=er(er(er(er({},h),y),{},{stroke:"none"},d),{},{index:v,textAnchor:t.getTextAnchor(w.x,y.cx)},w),N=er(er(er(er({},h),y),{},{fill:"none",stroke:y.fill},m),{},{index:v,points:[nr(y.cx,y.cy,y.outerRadius,b),w]}),S=c;return yt(c)&&yt(f)?S="value":yt(c)&&(S=f),oe.createElement(At,{key:"label-".concat(y.startAngle,"-").concat(y.endAngle,"-").concat(y.midAngle,"-").concat(v)},l&&t.renderLabelLineItem(l,N,"line"),t.renderLabelItem(o,_,Ar(y,S)))});return oe.createElement(At,{className:"recharts-pie-labels"},x)}},{key:"renderSectorsStatically",value:function(n){var i=this,s=this.props,o=s.activeShape,l=s.blendStroke,c=s.inactiveShape;return n.map(function(f,h){if((f==null?void 0:f.startAngle)===0&&(f==null?void 0:f.endAngle)===0&&n.length!==1)return null;var d=i.isActiveIndex(h),m=c&&i.hasActiveIndex()?c:null,p=d?o:m,x=er(er({},f),{},{stroke:l?f.fill:f.stroke,tabIndex:-1});return oe.createElement(At,nc({ref:function(v){v&&!i.sectorRefs.includes(v)&&i.sectorRefs.push(v)},tabIndex:-1,className:"recharts-pie-sector"},Yo(i.props,f,h),{key:"sector-".concat(f==null?void 0:f.startAngle,"-").concat(f==null?void 0:f.endAngle,"-").concat(f.midAngle,"-").concat(h)}),oe.createElement(L5,nc({option:p,isActive:d,shapeType:"sector"},x)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,i=this.props,s=i.sectors,o=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,f=i.animationEasing,h=i.animationId,d=this.state,m=d.prevSectors,p=d.prevIsAnimationActive;return oe.createElement(di,{begin:l,duration:c,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(x){var y=x.t,v=[],b=s&&s[0],w=b.startAngle;return s.forEach(function(_,N){var S=m&&m[N],k=N>0?Kn(_,"paddingAngle",0):0;if(S){var C=Un(S.endAngle-S.startAngle,_.endAngle-_.startAngle),O=er(er({},_),{},{startAngle:w+k,endAngle:w+C(y)+k});v.push(O),w=O.endAngle}else{var R=_.endAngle,A=_.startAngle,P=Un(0,R-A),E=P(y),T=er(er({},_),{},{startAngle:w+k,endAngle:w+E+k});v.push(T),w=T.endAngle}}),oe.createElement(At,null,n.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(s){if(!s.altKey)switch(s.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,s=n.isAnimationActive,o=this.state.prevSectors;return s&&i&&i.length&&(!o||!ah(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,s=i.hide,o=i.sectors,l=i.className,c=i.label,f=i.cx,h=i.cy,d=i.innerRadius,m=i.outerRadius,p=i.isAnimationActive,x=this.state.isAnimationFinished;if(s||!o||!o.length||!Ie(f)||!Ie(h)||!Ie(d)||!Ie(m))return null;var y=xt("recharts-pie",l);return oe.createElement(At,{tabIndex:this.props.rootTabIndex,className:y,ref:function(b){n.pieRef=b}},this.renderSectors(),c&&this.renderLabels(o),zr.renderCallByParent(this.props,null,!1),(!p||x)&&Hi.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,i,s){if(oe.isValidElement(n))return oe.cloneElement(n,i);if(ht(n))return n(i);var o=xt("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return oe.createElement(ng,nc({},i,{key:s,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,i,s){if(oe.isValidElement(n))return oe.cloneElement(n,i);var o=s;if(ht(n)&&(o=n(i),oe.isValidElement(o)))return o;var l=xt("recharts-pie-label-text",typeof n!="boolean"&&!ht(n)?n.className:"");return oe.createElement(Qo,nc({},i,{alignmentBaseline:"middle",className:l}),o)}}])})(I.PureComponent);fp=ln;ma(ln,"displayName","Pie");ma(ln,"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:!dl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ma(ln,"parseDeltaAngle",function(e,t){var r=gn(t-e),n=Math.min(Math.abs(t-e),360);return r*n});ma(ln,"getRealPieData",function(e){var t=e.data,r=e.children,n=lt(e,!1),i=Gn(r,Ma);return t&&t.length?t.map(function(s,o){return er(er(er({payload:s},n),s),i&&i[o]&&i[o].props)}):i&&i.length?i.map(function(s){return er(er({},n),s.props)}):[]});ma(ln,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,i=t.width,s=t.height,o=w5(i,s),l=n+yn(e.cx,i,i/2),c=r+yn(e.cy,s,s/2),f=yn(e.innerRadius,o,0),h=yn(e.outerRadius,o,o*.8),d=e.maxRadius||Math.sqrt(i*i+s*s)/2;return{cx:l,cy:c,innerRadius:f,outerRadius:h,maxRadius:d}});ma(ln,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?er(er({},t.type.defaultProps),t.props):t.props,i=fp.getRealPieData(n);if(!i||!i.length)return null;var s=n.cornerRadius,o=n.startAngle,l=n.endAngle,c=n.paddingAngle,f=n.dataKey,h=n.nameKey,d=n.valueKey,m=n.tooltipType,p=Math.abs(n.minAngle),x=fp.parseCoordinateOfPie(n,r),y=fp.parseDeltaAngle(o,l),v=Math.abs(y),b=f;yt(f)&&yt(d)?(Ia(!1,`Use "dataKey" to specify the value of pie,
476      the props "valueKey" will be deprecated in 1.1.0`),b="value"):yt(f)&&(Ia(!1,`Use "dataKey" to specify the value of pie,
477      the props "valueKey" will be deprecated in 1.1.0`),b=d);var w=i.filter(function(O){return Ar(O,b,0)!==0}).length,_=(v>=360?w:w-1)*c,N=v-w*p-_,S=i.reduce(function(O,R){var A=Ar(R,b,0);return O+(Ie(A)?A:0)},0),k;if(S>0){var C;k=i.map(function(O,R){var A=Ar(O,b,0),P=Ar(O,h,R),E=(Ie(A)?A:0)/S,T;R?T=C.endAngle+gn(y)*c*(A!==0?1:0):T=o;var $=T+gn(y)*((A!==0?p:0)+E*N),D=(T+$)/2,W=(x.innerRadius+x.outerRadius)/2,U=[{name:P,value:A,payload:O,dataKey:b,type:m}],H=nr(x.cx,x.cy,W,D);return C=er(er(er({percent:E,cornerRadius:s,name:P,tooltipPayload:U,midAngle:D,middleRadius:W,tooltipPosition:H},O),x),{},{value:Ar(O,b),startAngle:T,endAngle:$,payload:O,paddingAngle:gn(y)*c}),C})}return er(er({},x),{},{sectors:k,data:i})});var P_,GR;function Gle(){if(GR)return P_;GR=1;var e=Math.ceil,t=Math.max;function r(n,i,s,o){for(var l=-1,c=t(e((i-n)/(s||1)),0),f=Array(c);c--;)f[o?c:++l]=n,n+=s;return f}return P_=r,P_}var T_,YR;function q5(){if(YR)return T_;YR=1;var e=o$(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var s=i<0?-1:1;return s*r}return i===i?i:0}return T_=n,T_}var A_,QR;function Yle(){if(QR)return A_;QR=1;var e=Gle(),t=iy(),r=q5();function n(i){return function(s,o,l){return l&&typeof l!="number"&&t(s,o,l)&&(o=l=void 0),s=r(s),o===void 0?(o=s,s=0):o=r(o),l=l===void 0?s<o?1:-1:r(l),e(s,o,l,i)}}return A_=n,A_}var R_,XR;function Qle(){if(XR)return R_;XR=1;var e=Yle(),t=e();return R_=t,R_}var Xle=Qle();const hg=Ft(Xle);function Cf(e){"@babel/helpers - typeof";return Cf=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},Cf(e)}function ZR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function JR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZR(Object(r),!0).forEach(function(n){B5(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B5(e,t,r){return t=Zle(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zle(e){var t=Jle(e,"string");return Cf(t)=="symbol"?t:t+""}function Jle(e,t){if(Cf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Cf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ece=["Webkit","Moz","O","ms"],tce=function(t,r){var n=t.replace(/(\w)/,function(s){return s.toUpperCase()}),i=ece.reduce(function(s,o){return JR(JR({},s),{},B5({},o+n,r))},{});return i[t]=r,i};function Uc(e){"@babel/helpers - typeof";return Uc=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},Uc(e)}function mg(){return mg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mg.apply(this,arguments)}function eI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function I_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eI(Object(r),!0).forEach(function(n){Bn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,U5(n.key),n)}}function nce(e,t,r){return t&&tI(e.prototype,t),r&&tI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ace(e,t,r){return t=pg(t),ice(e,z5()?Reflect.construct(t,r||[],pg(e).constructor):t.apply(e,r))}function ice(e,t){if(t&&(Uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sce(e)}function sce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(z5=function(){return!!e})()}function pg(e){return pg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pg(e)}function oce(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&&tN(e,t)}
vendor: 120,916 bytes, lines 477-482
477function tN(e,t){return tN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},tN(e,t)}function Bn(e,t,r){return t=U5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function U5(e){var t=lce(e,"string");return Uc(t)=="symbol"?t:t+""}function lce(e,t){if(Uc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Uc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var cce=function(t){var r=t.data,n=t.startIndex,i=t.endIndex,s=t.x,o=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,f=Md().domain(hg(0,c)).range([s,s+o-l]),h=f.domain().map(function(d){return f(d)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:f(n),endX:f(i),scale:f,scaleValues:h}},rI=function(t){return t.changedTouches&&!!t.changedTouches.length},Hc=(function(e){function t(r){var n;return rce(this,t),n=ace(this,t,[r]),Bn(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),Bn(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),Bn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,s=i.endIndex,o=i.onDragEnd,l=i.startIndex;o==null||o({endIndex:s,startIndex:l})}),n.detachDragEndListener()}),Bn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Bn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Bn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Bn(n,"handleSlideDragStart",function(i){var s=rI(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return oce(t,e),nce(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,s=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,f=l.data,h=f.length-1,d=Math.min(i,s),m=Math.max(i,s),p=t.getIndexInRange(o,d),x=t.getIndexInRange(o,m);return{startIndex:p-p%c,endIndex:x===h?h:x-x%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,s=i.data,o=i.tickFormatter,l=i.dataKey,c=Ar(s[n],l,n);return ht(o)?o(c,n):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(n){var i=this.state,s=i.slideMoveStartX,o=i.startX,l=i.endX,c=this.props,f=c.x,h=c.width,d=c.travellerWidth,m=c.startIndex,p=c.endIndex,x=c.onChange,y=n.pageX-s;y>0?y=Math.min(y,f+h-d-l,f+h-d-o):y<0&&(y=Math.max(y,f-o,f-l));var v=this.getIndex({startX:o+y,endX:l+y});(v.startIndex!==m||v.endIndex!==p)&&x&&x(v),this.setState({startX:o+y,endX:l+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var s=rI(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,s=i.brushMoveStartX,o=i.movingTravellerId,l=i.endX,c=i.startX,f=this.state[o],h=this.props,d=h.x,m=h.width,p=h.travellerWidth,x=h.onChange,y=h.gap,v=h.data,b={startX:this.state.startX,endX:this.state.endX},w=n.pageX-s;w>0?w=Math.min(w,d+m-p-f):w<0&&(w=Math.max(w,d-f)),b[o]=f+w;var _=this.getIndex(b),N=_.startIndex,S=_.endIndex,k=function(){var O=v.length-1;return o==="startX"&&(l>c?N%y===0:S%y===0)||l<c&&S===O||o==="endX"&&(l>c?S%y===0:N%y===0)||l>c&&S===O};this.setState(Bn(Bn({},o,f+w),"brushMoveStartX",n.pageX),function(){x&&k()&&x(_)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var s=this,o=this.state,l=o.scaleValues,c=o.startX,f=o.endX,h=this.state[i],d=l.indexOf(h);if(d!==-1){var m=d+n;if(!(m===-1||m>=l.length)){var p=l[m];i==="startX"&&p>=f||i==="endX"&&p<=c||this.setState(Bn({},i,p),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.fill,f=n.stroke;return oe.createElement("rect",{stroke:f,fill:c,x:i,y:s,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.data,f=n.children,h=n.padding,d=I.Children.only(f);return d?oe.cloneElement(d,{x:i,y:s,width:o,height:l,margin:h,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var s,o,l=this,c=this.props,f=c.y,h=c.travellerWidth,d=c.height,m=c.traveller,p=c.ariaLabel,x=c.data,y=c.startIndex,v=c.endIndex,b=Math.max(n,this.props.x),w=I_(I_({},lt(this.props,!1)),{},{x:b,y:f,width:h,height:d}),_=p||"Min value: ".concat((s=x[y])===null||s===void 0?void 0:s.name,", Max value: ").concat((o=x[v])===null||o===void 0?void 0:o.name);return oe.createElement(At,{tabIndex:0,role:"slider","aria-label":_,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,w))}},{key:"renderSlide",value:function(n,i){var s=this.props,o=s.y,l=s.height,c=s.stroke,f=s.travellerWidth,h=Math.min(n,i)+f,d=Math.max(Math.abs(i-n)-f,0);return oe.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:h,y:o,width:d,height:l})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,s=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,f=n.stroke,h=this.state,d=h.startX,m=h.endX,p=5,x={pointerEvents:"none",fill:f};return oe.createElement(At,{className:"recharts-brush-texts"},oe.createElement(Qo,mg({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,m)-p,y:o+l/2},x),this.getTextOfTick(i)),oe.createElement(Qo,mg({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,m)+c+p,y:o+l/2},x),this.getTextOfTick(s)))}},{key:"render",value:function(){var n=this.props,i=n.data,s=n.className,o=n.children,l=n.x,c=n.y,f=n.width,h=n.height,d=n.alwaysShowText,m=this.state,p=m.startX,x=m.endX,y=m.isTextActive,v=m.isSlideMoving,b=m.isTravellerMoving,w=m.isTravellerFocused;if(!i||!i.length||!Ie(l)||!Ie(c)||!Ie(f)||!Ie(h)||f<=0||h<=0)return null;var _=xt("recharts-brush",s),N=oe.Children.count(o)===1,S=tce("userSelect","none");return oe.createElement(At,{className:_,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(p,x),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(x,"endX"),(y||v||b||w||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,s=n.y,o=n.width,l=n.height,c=n.stroke,f=Math.floor(s+l/2)-1;return oe.createElement(oe.Fragment,null,oe.createElement("rect",{x:i,y:s,width:o,height:l,fill:c,stroke:"none"}),oe.createElement("line",{x1:i+1,y1:f,x2:i+o-1,y2:f,fill:"none",stroke:"#fff"}),oe.createElement("line",{x1:i+1,y1:f+2,x2:i+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var s;return oe.isValidElement(n)?s=oe.cloneElement(n,i):ht(n)?s=n(i):s=t.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(n,i){var s=n.data,o=n.width,l=n.x,c=n.travellerWidth,f=n.updateId,h=n.startIndex,d=n.endIndex;if(s!==i.prevData||f!==i.prevUpdateId)return I_({prevData:s,prevTravellerWidth:c,prevUpdateId:f,prevX:l,prevWidth:o},s&&s.length?cce({data:s,width:o,x:l,travellerWidth:c,startIndex:h,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+o-c]);var m=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:f,prevX:l,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,i){for(var s=n.length,o=0,l=s-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>i?l=c:o=c}return i>=n[l]?l:o}}])})(I.PureComponent);Bn(Hc,"displayName","Brush");Bn(Hc,"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 M_,nI;function uce(){if(nI)return M_;nI=1;var e=TS();function t(r,n){var i;return e(r,function(s,o,l){return i=n(s,o,l),!i}),!!i}return M_=t,M_}var L_,aI;function dce(){if(aI)return L_;aI=1;var e=D3(),t=yi(),r=uce(),n=Tn(),i=iy();function s(o,l,c){var f=n(o)?e:r;return c&&i(o,l,c)&&(l=void 0),f(o,t(l,3))}return L_=s,L_}var fce=dce();const hce=Ft(fce);var ii=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},D_,iI;function mce(){if(iI)return D_;iI=1;var e=r$();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return D_=t,D_}var $_,sI;function pce(){if(sI)return $_;sI=1;var e=mce(),t=e$(),r=yi();function n(i,s){var o={};return s=r(s,3),t(i,function(l,c,f){e(o,c,s(l,c,f))}),o}return $_=n,$_}var gce=pce();const yce=Ft(gce);var q_,oI;function vce(){if(oI)return q_;oI=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(!r(t[n],n,t))return!1;return!0}return q_=e,q_}var B_,lI;function xce(){if(lI)return B_;lI=1;var e=TS();function t(r,n){var i=!0;return e(r,function(s,o,l){return i=!!n(s,o,l),i}),i}return B_=t,B_}var z_,cI;function bce(){if(cI)return z_;cI=1;var e=vce(),t=xce(),r=yi(),n=Tn(),i=iy();function s(o,l,c){var f=n(o)?e:t;return c&&i(o,l,c)&&(l=void 0),f(o,r(l,3))}return z_=s,z_}var wce=bce();const H5=Ft(wce);var _ce=["x","y"];function Ff(e){"@babel/helpers - typeof";return Ff=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},Ff(e)}function rN(){return rN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rN.apply(this,arguments)}function uI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function vd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uI(Object(r),!0).forEach(function(n){jce(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jce(e,t,r){return t=Nce(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nce(e){var t=Sce(e,"string");return Ff(t)=="symbol"?t:t+""}function Sce(e,t){if(Ff(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ff(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kce(e,t){if(e==null)return{};var r=Cce(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Fce(e,t){var r=e.x,n=e.y,i=kce(e,_ce),s="".concat(r),o=parseInt(s,10),l="".concat(n),c=parseInt(l,10),f="".concat(t.height||i.height),h=parseInt(f,10),d="".concat(t.width||i.width),m=parseInt(d,10);return vd(vd(vd(vd(vd({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:h,width:m,name:t.name,radius:t.radius})}function dI(e){return oe.createElement(L5,rN({shapeType:"rectangle",propTransformer:Fce,activeClassName:"recharts-active-bar"},e))}var Oce=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var s=Ie(n)||eQ(n);return s?t(n,i):(s||Zo(),r)}},Ece=["value","background"],V5;function Vc(e){"@babel/helpers - typeof";return Vc=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},Vc(e)}function Pce(e,t){if(e==null)return{};var r=Tce(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gg(){return gg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gg.apply(this,arguments)}function fI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fI(Object(r),!0).forEach(function(n){Ds(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ace(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,K5(n.key),n)}}function Rce(e,t,r){return t&&hI(e.prototype,t),r&&hI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ice(e,t,r){return t=yg(t),Mce(e,W5()?Reflect.construct(t,r||[],yg(e).constructor):t.apply(e,r))}function Mce(e,t){if(t&&(Vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lce(e)}function Lce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(W5=function(){return!!e})()}function yg(e){return yg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yg(e)}function Dce(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&&nN(e,t)}function nN(e,t){return nN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},nN(e,t)}function Ds(e,t,r){return t=K5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function K5(e){var t=$ce(e,"string");return Vc(t)=="symbol"?t:t+""}function $ce(e,t){if(Vc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qn=(function(e){function t(){var r;Ace(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=Ice(this,t,[].concat(i)),Ds(r,"state",{isAnimationFinished:!1}),Ds(r,"id",du("recharts-bar-")),Ds(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),Ds(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return Dce(t,e),Rce(t,[{key:"renderRectanglesStatically",value:function(n){var i=this,s=this.props,o=s.shape,l=s.dataKey,c=s.activeIndex,f=s.activeBar,h=lt(this.props,!1);return n&&n.map(function(d,m){var p=m===c,x=p?f:o,y=_r(_r(_r({},h),d),{},{isActive:p,option:x,index:m,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return oe.createElement(At,gg({className:"recharts-bar-rectangle"},Yo(i.props,d,m),{key:"rectangle-".concat(d==null?void 0:d.x,"-").concat(d==null?void 0:d.y,"-").concat(d==null?void 0:d.value,"-").concat(m)}),oe.createElement(dI,y))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,s=i.data,o=i.layout,l=i.isAnimationActive,c=i.animationBegin,f=i.animationDuration,h=i.animationEasing,d=i.animationId,m=this.state.prevData;return oe.createElement(di,{begin:c,duration:f,isActive:l,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var x=p.t,y=s.map(function(v,b){var w=m&&m[b];if(w){var _=Un(w.x,v.x),N=Un(w.y,v.y),S=Un(w.width,v.width),k=Un(w.height,v.height);return _r(_r({},v),{},{x:_(x),y:N(x),width:S(x),height:k(x)})}if(o==="horizontal"){var C=Un(0,v.height),O=C(x);return _r(_r({},v),{},{y:v.y+v.height-O,height:O})}var R=Un(0,v.width),A=R(x);return _r(_r({},v),{},{width:A})});return oe.createElement(At,null,n.renderRectanglesStatically(y))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,s=n.isAnimationActive,o=this.state.prevData;return s&&i&&i.length&&(!o||!ah(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,s=i.data,o=i.dataKey,l=i.activeIndex,c=lt(this.props.background,!1);return s.map(function(f,h){f.value;var d=f.background,m=Pce(f,Ece);if(!d)return null;var p=_r(_r(_r(_r(_r({},m),{},{fill:"#eee"},d),c),Yo(n.props,f,h)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return oe.createElement(dI,gg({key:"background-bar-".concat(h),option:n.props.background,isActive:h===l},p))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.data,l=s.xAxis,c=s.yAxis,f=s.layout,h=s.children,d=Gn(h,ih);if(!d)return null;var m=f==="vertical"?o[0].height/2:o[0].width/2,p=function(v,b){var w=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:w,errorVal:Ar(v,b)}},x={clipPath:n?"url(#clipPath-".concat(i,")"):null};return oe.createElement(At,x,d.map(function(y){return oe.cloneElement(y,{key:"error-bar-".concat(i,"-").concat(y.props.dataKey),data:o,xAxis:l,yAxis:c,layout:f,offset:m,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,s=n.data,o=n.className,l=n.xAxis,c=n.yAxis,f=n.left,h=n.top,d=n.width,m=n.height,p=n.isAnimationActive,x=n.background,y=n.id;if(i||!s||!s.length)return null;var v=this.state.isAnimationFinished,b=xt("recharts-bar",o),w=l&&l.allowDataOverflow,_=c&&c.allowDataOverflow,N=w||_,S=yt(y)?this.id:y;return oe.createElement(At,{className:b},w||_?oe.createElement("defs",null,oe.createElement("clipPath",{id:"clipPath-".concat(S)},oe.createElement("rect",{x:w?f:f-d/2,y:_?h:h-m/2,width:w?d:d*2,height:_?m:m*2}))):null,oe.createElement(At,{className:"recharts-bar-rectangles",clipPath:N?"url(#clipPath-".concat(S,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(N,S),(!p||v)&&Hi.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])})(I.PureComponent);V5=Qn;Ds(Qn,"displayName","Bar");Ds(Qn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!dl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ds(Qn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,i=e.bandSize,s=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,d=e.displayedData,m=e.offset,p=mae(n,r);if(!p)return null;var x=t.layout,y=r.type.defaultProps,v=y!==void 0?_r(_r({},y),r.props):r.props,b=v.dataKey,w=v.children,_=v.minPointSize,N=x==="horizontal"?o:s,S=f?N.scale.domain():null,k=wae({numericAxis:N}),C=Gn(w,Ma),O=d.map(function(R,A){var P,E,T,$,D,W;f?P=pae(f[h+A],S):(P=Ar(R,b),Array.isArray(P)||(P=[k,P]));var U=Oce(_,V5.defaultProps.minPointSize)(P[1],A);if(x==="horizontal"){var H,K=[o.scale(P[0]),o.scale(P[1])],q=K[0],L=K[1];E=D4({axis:s,ticks:l,bandSize:i,offset:p.offset,entry:R,index:A}),T=(H=L??q)!==null&&H!==void 0?H:void 0,$=p.size;var V=q-L;if(D=Number.isNaN(V)?0:V,W={x:E,y:o.y,width:$,height:o.height},Math.abs(U)>0&&Math.abs(D)<Math.abs(U)){var z=gn(D||U)*(Math.abs(U)-Math.abs(D));T-=z,D+=z}}else{var Z=[s.scale(P[0]),s.scale(P[1])],re=Z[0],G=Z[1];if(E=re,T=D4({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:R,index:A}),$=G-re,D=p.size,W={x:s.x,y:T,width:s.width,height:D},Math.abs(U)>0&&Math.abs($)<Math.abs(U)){var X=gn($||U)*(Math.abs(U)-Math.abs($));$+=X}}return _r(_r(_r({},R),{},{x:E,y:T,width:$,height:D,value:f?P:P[1],payload:R,background:W},C&&C[A]&&C[A].props),{},{tooltipPayload:[x5(r,R)],tooltipPosition:{x:E+$/2,y:T+D/2}})});return _r({data:O,layout:x},m)});function Of(e){"@babel/helpers - typeof";return Of=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},Of(e)}function qce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,G5(n.key),n)}}function Bce(e,t,r){return t&&mI(e.prototype,t),r&&mI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function pI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pI(Object(r),!0).forEach(function(n){Ny(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ny(e,t,r){return t=G5(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G5(e){var t=zce(e,"string");return Of(t)=="symbol"?t:t+""}function zce(e,t){if(Of(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Of(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Y5=function(t,r,n,i,s){var o=t.width,l=t.height,c=t.layout,f=t.children,h=Object.keys(r),d={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},m=!!zn(f,Qn);return h.reduce(function(p,x){var y=r[x],v=y.orientation,b=y.domain,w=y.padding,_=w===void 0?{}:w,N=y.mirror,S=y.reversed,k="".concat(v).concat(N?"Mirror":""),C,O,R,A,P;if(y.type==="number"&&(y.padding==="gap"||y.padding==="no-gap")){var E=b[1]-b[0],T=1/0,$=y.categoricalDomain.sort(nQ);if($.forEach(function(Z,re){re>0&&(T=Math.min((Z||0)-($[re-1]||0),T))}),Number.isFinite(T)){var D=T/E,W=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(C=D*W/2),y.padding==="no-gap"){var U=yn(t.barCategoryGap,D*W),H=D*W/2;C=H-U-(H-U)/W*U}}}i==="xAxis"?O=[n.left+(_.left||0)+(C||0),n.left+n.width-(_.right||0)-(C||0)]:i==="yAxis"?O=c==="horizontal"?[n.top+n.height-(_.bottom||0),n.top+(_.top||0)]:[n.top+(_.top||0)+(C||0),n.top+n.height-(_.bottom||0)-(C||0)]:O=y.range,S&&(O=[O[1],O[0]]);var K=p5(y,s,m),q=K.scale,L=K.realScaleType;q.domain(b).range(O),g5(q);var V=y5(q,Pa(Pa({},y),{},{realScaleType:L}));i==="xAxis"?(P=v==="top"&&!N||v==="bottom"&&N,R=n.left,A=d[k]-P*y.height):i==="yAxis"&&(P=v==="left"&&!N||v==="right"&&N,R=d[k]-P*y.width,A=n.top);var z=Pa(Pa(Pa({},y),V),{},{realScaleType:L,x:R,y:A,scale:q,width:i==="xAxis"?n.width:y.width,height:i==="yAxis"?n.height:y.height});return z.bandSize=eg(z,V),!y.hide&&i==="xAxis"?d[k]+=(P?-1:1)*z.height:y.hide||(d[k]+=(P?-1:1)*z.width),Pa(Pa({},p),{},Ny({},x,z))},{})},Q5=function(t,r){var n=t.x,i=t.y,s=r.x,o=r.y;return{x:Math.min(n,s),y:Math.min(i,o),width:Math.abs(s-n),height:Math.abs(o-i)}},Uce=function(t){var r=t.x1,n=t.y1,i=t.x2,s=t.y2;return Q5({x:r,y:n},{x:i,y:s})},X5=(function(){function e(t){qce(this,e),this.scale=t}return Bce(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(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,s=n.position;if(r!==void 0){if(s)switch(s){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],s=n[n.length-1];return i<=s?r>=i&&r<=s:r>=s&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])})();Ny(X5,"EPS",1e-4);var ok=function(t){var r=Object.keys(t).reduce(function(n,i){return Pa(Pa({},n),{},Ny({},i,X5.create(t[i])))},{});return Pa(Pa({},r),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=s.bandAware,l=s.position;return yce(i,function(c,f){return r[f].apply(c,{bandAware:o,position:l})})},isInRange:function(i){return H5(i,function(s,o){return r[o].isInRange(s)})}})};function Hce(e){return(e%180+180)%180}var Vce=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=Hce(i),o=s*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},U_,gI;function Wce(){if(gI)return U_;gI=1;var e=yi(),t=Jf(),r=ny();function n(i){return function(s,o,l){var c=Object(s);if(!t(s)){var f=e(o,3);s=r(s),o=function(d){return f(c[d],d,c)}}var h=i(s,o,l);return h>-1?c[f?s[h]:h]:void 0}}return U_=n,U_}var H_,yI;function Kce(){if(yI)return H_;yI=1;var e=q5();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return H_=t,H_}var V_,vI;function Gce(){if(vI)return V_;vI=1;var e=Y3(),t=yi(),r=Kce(),n=Math.max;function i(s,o,l){var c=s==null?0:s.length;if(!c)return-1;var f=l==null?0:r(l);return f<0&&(f=n(c+f,0)),e(s,t(o,3),f)}return V_=i,V_}var W_,xI;function Yce(){if(xI)return W_;xI=1;var e=Wce(),t=Gce(),r=e(t);return W_=r,W_}var Qce=Yce();const Xce=Ft(Qce);var Zce=d3();const Jce=Ft(Zce);var eue=Jce(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("")}),lk=I.createContext(void 0),ck=I.createContext(void 0),Z5=I.createContext(void 0),J5=I.createContext({}),e6=I.createContext(void 0),t6=I.createContext(0),r6=I.createContext(0),bI=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,s=r.offset,o=t.clipPathId,l=t.children,c=t.width,f=t.height,h=eue(s);return oe.createElement(lk.Provider,{value:n},oe.createElement(ck.Provider,{value:i},oe.createElement(J5.Provider,{value:s},oe.createElement(Z5.Provider,{value:h},oe.createElement(e6.Provider,{value:o},oe.createElement(t6.Provider,{value:f},oe.createElement(r6.Provider,{value:c},l)))))))},tue=function(){return I.useContext(e6)},n6=function(t){var r=I.useContext(lk);r==null&&Zo();var n=r[t];return n==null&&Zo(),n},rue=function(){var t=I.useContext(lk);return Cs(t)},nue=function(){var t=I.useContext(ck),r=Xce(t,function(n){return H5(n.domain,Number.isFinite)});return r||Cs(t)},a6=function(t){var r=I.useContext(ck);r==null&&Zo();var n=r[t];return n==null&&Zo(),n},aue=function(){var t=I.useContext(Z5);return t},iue=function(){return I.useContext(J5)},uk=function(){return I.useContext(r6)},dk=function(){return I.useContext(t6)};function Wc(e){"@babel/helpers - typeof";return Wc=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},Wc(e)}function sue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s6(n.key),n)}}function lue(e,t,r){return t&&oue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cue(e,t,r){return t=vg(t),uue(e,i6()?Reflect.construct(t,r||[],vg(e).constructor):t.apply(e,r))}function uue(e,t){if(t&&(Wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return due(e)}function due(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i6=function(){return!!e})()}function vg(e){return vg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vg(e)}function fue(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&&aN(e,t)}function aN(e,t){return aN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},aN(e,t)}function wI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _I(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wI(Object(r),!0).forEach(function(n){fk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fk(e,t,r){return t=s6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s6(e){var t=hue(e,"string");return Wc(t)=="symbol"?t:t+""}function hue(e,t){if(Wc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function mue(e,t){return vue(e)||yue(e,t)||gue(e,t)||pue()}function pue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
478In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gue(e,t){if(e){if(typeof e=="string")return jI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jI(e,t)}}function jI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yue(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function vue(e){if(Array.isArray(e))return e}function iN(){return iN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iN.apply(this,arguments)}var xue=function(t,r){var n;return oe.isValidElement(t)?n=oe.cloneElement(t,r):ht(t)?n=t(r):n=oe.createElement("line",iN({},r,{className:"recharts-reference-line-line"})),n},bue=function(t,r,n,i,s,o,l,c,f){var h=s.x,d=s.y,m=s.width,p=s.height;if(n){var x=f.y,y=t.y.apply(x,{position:o});if(ii(f,"discard")&&!t.y.isInRange(y))return null;var v=[{x:h+m,y},{x:h,y}];return c==="left"?v.reverse():v}if(r){var b=f.x,w=t.x.apply(b,{position:o});if(ii(f,"discard")&&!t.x.isInRange(w))return null;var _=[{x:w,y:d+p},{x:w,y:d}];return l==="top"?_.reverse():_}if(i){var N=f.segment,S=N.map(function(k){return t.apply(k,{position:o})});return ii(f,"discard")&&hce(S,function(k){return!t.isInRange(k)})?null:S}return null};function wue(e){var t=e.x,r=e.y,n=e.segment,i=e.xAxisId,s=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,f=tue(),h=n6(i),d=a6(s),m=aue();if(!f||!m)return null;Ia(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=ok({x:h.scale,y:d.scale}),x=Rr(t),y=Rr(r),v=n&&n.length===2,b=bue(p,x,y,v,m,e.position,h.orientation,d.orientation,e);if(!b)return null;var w=mue(b,2),_=w[0],N=_.x,S=_.y,k=w[1],C=k.x,O=k.y,R=ii(e,"hidden")?"url(#".concat(f,")"):void 0,A=_I(_I({clipPath:R},lt(e,!0)),{},{x1:N,y1:S,x2:C,y2:O});return oe.createElement(At,{className:xt("recharts-reference-line",l)},xue(o,A),zr.renderCallByParent(e,Uce({x1:N,y1:S,x2:C,y2:O})))}var hk=(function(e){function t(){return sue(this,t),cue(this,t,arguments)}return fue(t,e),lue(t,[{key:"render",value:function(){return oe.createElement(wue,this.props)}}])})(oe.Component);fk(hk,"displayName","ReferenceLine");fk(hk,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function sN(){return sN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sN.apply(this,arguments)}function Kc(e){"@babel/helpers - typeof";return Kc=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},Kc(e)}function NI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function SI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?NI(Object(r),!0).forEach(function(n){Sy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l6(n.key),n)}}function Nue(e,t,r){return t&&jue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sue(e,t,r){return t=xg(t),kue(e,o6()?Reflect.construct(t,r||[],xg(e).constructor):t.apply(e,r))}function kue(e,t){if(t&&(Kc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cue(e)}function Cue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o6=function(){return!!e})()}function xg(e){return xg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},xg(e)}function Fue(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&&oN(e,t)}function oN(e,t){return oN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},oN(e,t)}function Sy(e,t,r){return t=l6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l6(e){var t=Oue(e,"string");return Kc(t)=="symbol"?t:t+""}function Oue(e,t){if(Kc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Kc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Eue=function(t){var r=t.x,n=t.y,i=t.xAxis,s=t.yAxis,o=ok({x:i.scale,y:s.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return ii(t,"discard")&&!o.isInRange(l)?null:l},ky=(function(e){function t(){return _ue(this,t),Sue(this,t,arguments)}return Fue(t,e),Nue(t,[{key:"render",value:function(){var n=this.props,i=n.x,s=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,f=Rr(i),h=Rr(s);if(Ia(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var d=Eue(this.props);if(!d)return null;var m=d.x,p=d.y,x=this.props,y=x.shape,v=x.className,b=ii(this.props,"hidden")?"url(#".concat(c,")"):void 0,w=SI(SI({clipPath:b},lt(this.props,!0)),{},{cx:m,cy:p});return oe.createElement(At,{className:xt("recharts-reference-dot",v)},t.renderDot(y,w),zr.renderCallByParent(this.props,{x:m-o,y:p-o,width:2*o,height:2*o}))}}])})(oe.Component);Sy(ky,"displayName","ReferenceDot");Sy(ky,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Sy(ky,"renderDot",function(e,t){var r;return oe.isValidElement(e)?r=oe.cloneElement(e,t):ht(e)?r=e(t):r=oe.createElement(yy,sN({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function lN(){return lN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lN.apply(this,arguments)}function Gc(e){"@babel/helpers - typeof";return Gc=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},Gc(e)}function kI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function CI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(r),!0).forEach(function(n){Cy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u6(n.key),n)}}function Aue(e,t,r){return t&&Tue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rue(e,t,r){return t=bg(t),Iue(e,c6()?Reflect.construct(t,r||[],bg(e).constructor):t.apply(e,r))}function Iue(e,t){if(t&&(Gc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mue(e)}function Mue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c6=function(){return!!e})()}function bg(e){return bg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bg(e)}function Lue(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&&cN(e,t)}function cN(e,t){return cN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cN(e,t)}function Cy(e,t,r){return t=u6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u6(e){var t=Due(e,"string");return Gc(t)=="symbol"?t:t+""}function Due(e,t){if(Gc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $ue=function(t,r,n,i,s){var o=s.x1,l=s.x2,c=s.y1,f=s.y2,h=s.xAxis,d=s.yAxis;if(!h||!d)return null;var m=ok({x:h.scale,y:d.scale}),p={x:t?m.x.apply(o,{position:"start"}):m.x.rangeMin,y:n?m.y.apply(c,{position:"start"}):m.y.rangeMin},x={x:r?m.x.apply(l,{position:"end"}):m.x.rangeMax,y:i?m.y.apply(f,{position:"end"}):m.y.rangeMax};return ii(s,"discard")&&(!m.isInRange(p)||!m.isInRange(x))?null:Q5(p,x)},Fy=(function(e){function t(){return Pue(this,t),Rue(this,t,arguments)}return Lue(t,e),Aue(t,[{key:"render",value:function(){var n=this.props,i=n.x1,s=n.x2,o=n.y1,l=n.y2,c=n.className,f=n.alwaysShow,h=n.clipPathId;Ia(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=Rr(i),m=Rr(s),p=Rr(o),x=Rr(l),y=this.props.shape;if(!d&&!m&&!p&&!x&&!y)return null;var v=$ue(d,m,p,x,this.props);if(!v&&!y)return null;var b=ii(this.props,"hidden")?"url(#".concat(h,")"):void 0;return oe.createElement(At,{className:xt("recharts-reference-area",c)},t.renderRect(y,CI(CI({clipPath:b},lt(this.props,!0)),v)),zr.renderCallByParent(this.props,v))}}])})(oe.Component);Cy(Fy,"displayName","ReferenceArea");Cy(Fy,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Cy(Fy,"renderRect",function(e,t){var r;return oe.isValidElement(e)?r=oe.cloneElement(e,t):ht(e)?r=e(t):r=oe.createElement(sk,lN({},t,{className:"recharts-reference-area-rect"})),r});function d6(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],i=0;i<e.length;i+=t)n.push(e[i]);return n}function que(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return Vce(n,r)}function Bue(e,t,r){var n=r==="width",i=e.x,s=e.y,o=e.width,l=e.height;return t===1?{start:n?i:s,end:n?i+o:s+l}:{start:n?i+o:s+l,end:n?i:s}}function wg(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var s=r();return e*(t-e*s/2-n)>=0&&e*(t+e*s/2-i)<=0}function zue(e,t){return d6(e,t+1)}function Uue(e,t,r,n,i){for(var s=(n||[]).slice(),o=t.start,l=t.end,c=0,f=1,h=o,d=function(){var x=n==null?void 0:n[c];if(x===void 0)return{v:d6(n,f)};var y=c,v,b=function(){return v===void 0&&(v=r(x,y)),v},w=x.coordinate,_=c===0||wg(e,w,b,h,l);_||(c=0,h=o,f+=1),_&&(h=w+e*(b()/2+i),c+=f)},m;f<=s.length;)if(m=d(),m)return m.v;return[]}function Ef(e){"@babel/helpers - typeof";return Ef=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},Ef(e)}function FI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function an(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FI(Object(r),!0).forEach(function(n){Hue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hue(e,t,r){return t=Vue(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vue(e){var t=Wue(e,"string");return Ef(t)=="symbol"?t:t+""}function Wue(e,t){if(Ef(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ef(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kue(e,t,r,n,i){for(var s=(n||[]).slice(),o=s.length,l=t.start,c=t.end,f=function(m){var p=s[m],x,y=function(){return x===void 0&&(x=r(p,m)),x};if(m===o-1){var v=e*(p.coordinate+e*y()/2-c);s[m]=p=an(an({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate})}else s[m]=p=an(an({},p),{},{tickCoord:p.coordinate});var b=wg(e,p.tickCoord,y,l,c);b&&(c=p.tickCoord-e*(y()/2+i),s[m]=an(an({},p),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return s}function Gue(e,t,r,n,i,s){var o=(n||[]).slice(),l=o.length,c=t.start,f=t.end;if(s){var h=n[l-1],d=r(h,l-1),m=e*(h.coordinate+e*d/2-f);o[l-1]=h=an(an({},h),{},{tickCoord:m>0?h.coordinate-m*e:h.coordinate});var p=wg(e,h.tickCoord,function(){return d},c,f);p&&(f=h.tickCoord-e*(d/2+i),o[l-1]=an(an({},h),{},{isShow:!0}))}for(var x=s?l-1:l,y=function(w){var _=o[w],N,S=function(){return N===void 0&&(N=r(_,w)),N};if(w===0){var k=e*(_.coordinate-e*S()/2-c);o[w]=_=an(an({},_),{},{tickCoord:k<0?_.coordinate-k*e:_.coordinate})}else o[w]=_=an(an({},_),{},{tickCoord:_.coordinate});var C=wg(e,_.tickCoord,S,c,f);C&&(c=_.tickCoord+e*(S()/2+i),o[w]=an(an({},_),{},{isShow:!0}))},v=0;v<x;v++)y(v);return o}function mk(e,t,r){var n=e.tick,i=e.ticks,s=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,f=e.tickFormatter,h=e.unit,d=e.angle;if(!i||!i.length||!n)return[];if(Ie(c)||dl.isSsr)return zue(i,typeof c=="number"&&Ie(c)?c:0);var m=[],p=l==="top"||l==="bottom"?"width":"height",x=h&&p==="width"?Id(h,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=function(_,N){var S=ht(f)?f(_.value,N):_.value;return p==="width"?que(Id(S,{fontSize:t,letterSpacing:r}),x,d):Id(S,{fontSize:t,letterSpacing:r})[p]},v=i.length>=2?gn(i[1].coordinate-i[0].coordinate):1,b=Bue(s,v,p);return c==="equidistantPreserveStart"?Uue(v,b,y,i,o):(c==="preserveStart"||c==="preserveStartEnd"?m=Gue(v,b,y,i,o,c==="preserveStartEnd"):m=Kue(v,b,y,i,o),m.filter(function(w){return w.isShow}))}var Yue=["viewBox"],Que=["viewBox"],Xue=["ticks"];function Yc(e){"@babel/helpers - typeof";return Yc=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},Yc(e)}function ac(){return ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ac.apply(this,arguments)}function OI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(r),!0).forEach(function(n){pk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function K_(e,t){if(e==null)return{};var r=Zue(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zue(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Jue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,h6(n.key),n)}}function ede(e,t,r){return t&&EI(e.prototype,t),r&&EI(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tde(e,t,r){return t=_g(t),rde(e,f6()?Reflect.construct(t,r||[],_g(e).constructor):t.apply(e,r))}function rde(e,t){if(t&&(Yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nde(e)}function nde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f6=function(){return!!e})()}function _g(e){return _g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_g(e)}function ade(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&&uN(e,t)}function uN(e,t){return uN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},uN(e,t)}function pk(e,t,r){return t=h6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h6(e){var t=ide(e,"string");return Yc(t)=="symbol"?t:t+""}function ide(e,t){if(Yc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Yc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var gu=(function(e){function t(r){var n;return Jue(this,t),n=tde(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return ade(t,e),ede(t,[{key:"shouldComponentUpdate",value:function(n,i){var s=n.viewBox,o=K_(n,Yue),l=this.props,c=l.viewBox,f=K_(l,Que);return!oc(s,c)||!oc(o,f)||!oc(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,s=i.x,o=i.y,l=i.width,c=i.height,f=i.orientation,h=i.tickSize,d=i.mirror,m=i.tickMargin,p,x,y,v,b,w,_=d?-1:1,N=n.tickSize||h,S=Ie(n.tickCoord)?n.tickCoord:n.coordinate;switch(f){case"top":p=x=n.coordinate,v=o+ +!d*c,y=v-_*N,w=y-_*m,b=S;break;case"left":y=v=n.coordinate,x=s+ +!d*l,p=x-_*N,b=p-_*m,w=S;break;case"right":y=v=n.coordinate,x=s+ +d*l,p=x+_*N,b=p+_*m,w=S;break;default:p=x=n.coordinate,v=o+ +d*c,y=v+_*N,w=y+_*m,b=S;break}return{line:{x1:p,y1:y,x2:x,y2:v},tick:{x:b,y:w}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,s=n.mirror,o;switch(i){case"left":o=s?"start":"end";break;case"right":o=s?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,i=n.orientation,s=n.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=s?"start":"end";break;default:o=s?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.x,s=n.y,o=n.width,l=n.height,c=n.orientation,f=n.mirror,h=n.axisLine,d=Er(Er(Er({},lt(this.props,!1)),lt(h,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var m=+(c==="top"&&!f||c==="bottom"&&f);d=Er(Er({},d),{},{x1:i,y1:s+m*l,x2:i+o,y2:s+m*l})}else{var p=+(c==="left"&&!f||c==="right"&&f);d=Er(Er({},d),{},{x1:i+p*o,y1:s,x2:i+p*o,y2:s+l})}return oe.createElement("line",ac({},d,{className:xt("recharts-cartesian-axis-line",Kn(h,"className"))}))}},{key:"renderTicks",value:function(n,i,s){var o=this,l=this.props,c=l.tickLine,f=l.stroke,h=l.tick,d=l.tickFormatter,m=l.unit,p=mk(Er(Er({},this.props),{},{ticks:n}),i,s),x=this.getTickTextAnchor(),y=this.getTickVerticalAnchor(),v=lt(this.props,!1),b=lt(h,!1),w=Er(Er({},v),{},{fill:"none"},lt(c,!1)),_=p.map(function(N,S){var k=o.getTickLineCoord(N),C=k.line,O=k.tick,R=Er(Er(Er(Er({textAnchor:x,verticalAnchor:y},v),{},{stroke:"none",fill:f},b),O),{},{index:S,payload:N,visibleTicksCount:p.length,tickFormatter:d});return oe.createElement(At,ac({className:"recharts-cartesian-axis-tick",key:"tick-".concat(N.value,"-").concat(N.coordinate,"-").concat(N.tickCoord)},Yo(o.props,N,S)),c&&oe.createElement("line",ac({},w,C,{className:xt("recharts-cartesian-axis-tick-line",Kn(c,"className"))})),h&&t.renderTickItem(h,R,"".concat(ht(d)?d(N.value,S):N.value).concat(m||"")))});return oe.createElement("g",{className:"recharts-cartesian-axis-ticks"},_)}},{key:"render",value:function(){var n=this,i=this.props,s=i.axisLine,o=i.width,l=i.height,c=i.ticksGenerator,f=i.className,h=i.hide;if(h)return null;var d=this.props,m=d.ticks,p=K_(d,Xue),x=m;return ht(c)&&(x=m&&m.length>0?c(this.props):c(p)),o<=0||l<=0||!x||!x.length?null:oe.createElement(At,{className:xt("recharts-cartesian-axis",f),ref:function(v){n.layerReference=v}},s&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),zr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,s){var o,l=xt(i.className,"recharts-cartesian-axis-tick-value");return oe.isValidElement(n)?o=oe.cloneElement(n,Er(Er({},i),{},{className:l})):ht(n)?o=n(Er(Er({},i),{},{className:l})):o=oe.createElement(Qo,ac({},i,{className:"recharts-cartesian-axis-tick-value"}),s),o}}])})(I.Component);pk(gu,"displayName","CartesianAxis");pk(gu,"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"});var sde=["x1","y1","x2","y2","key"],ode=["offset"];function Jo(e){"@babel/helpers - typeof";return Jo=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},Jo(e)}function PI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PI(Object(r),!0).forEach(function(n){lde(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lde(e,t,r){return t=cde(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cde(e){var t=ude(e,"string");return Jo(t)=="symbol"?t:t+""}function ude(e,t){if(Jo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Eo(){return Eo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eo.apply(this,arguments)}function TI(e,t){if(e==null)return{};var r=dde(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dde(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var fde=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,s=t.y,o=t.width,l=t.height,c=t.ry;return oe.createElement("rect",{x:i,y:s,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function m6(e,t){var r;if(oe.isValidElement(e))r=oe.cloneElement(e,t);else if(ht(e))r=e(t);else{var n=t.x1,i=t.y1,s=t.x2,o=t.y2,l=t.key,c=TI(t,sde),f=lt(c,!1);f.offset;var h=TI(f,ode);r=oe.createElement("line",Eo({},h,{x1:n,y1:i,x2:s,y2:o,fill:"none",key:l}))}return r}function hde(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,s=e.horizontalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(l,c){var f=sn(sn({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return m6(i,f)});return oe.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function mde(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,s=e.verticalPoints;if(!i||!s||!s.length)return null;var o=s.map(function(l,c){var f=sn(sn({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return m6(i,f)});return oe.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function pde(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,s=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,f=c===void 0?!0:c;if(!f||!t||!t.length)return null;var h=l.map(function(m){return Math.round(m+i-i)}).sort(function(m,p){return m-p});i!==h[0]&&h.unshift(0);var d=h.map(function(m,p){var x=!h[p+1],y=x?i+o-m:h[p+1]-m;if(y<=0)return null;var v=p%t.length;return oe.createElement("rect",{key:"react-".concat(p),y:m,x:n,height:y,width:s,stroke:"none",fill:t[v],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return oe.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function gde(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,s=e.x,o=e.y,l=e.width,c=e.height,f=e.verticalPoints;if(!r||!n||!n.length)return null;var h=f.map(function(m){return Math.round(m+s-s)}).sort(function(m,p){return m-p});s!==h[0]&&h.unshift(0);var d=h.map(function(m,p){var x=!h[p+1],y=x?s+l-m:h[p+1]-m;if(y<=0)return null;var v=p%n.length;return oe.createElement("rect",{key:"react-".concat(p),x:m,y:o,width:y,height:c,stroke:"none",fill:n[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return oe.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var yde=function(t,r){var n=t.xAxis,i=t.width,s=t.height,o=t.offset;return m5(mk(sn(sn(sn({},gu.defaultProps),n),{},{ticks:$i(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.left,o.left+o.width,r)},vde=function(t,r){var n=t.yAxis,i=t.width,s=t.height,o=t.offset;return m5(mk(sn(sn(sn({},gu.defaultProps),n),{},{ticks:$i(n,!0),viewBox:{x:0,y:0,width:i,height:s}})),o.top,o.top+o.height,r)},Hl={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function el(e){var t,r,n,i,s,o,l=uk(),c=dk(),f=iue(),h=sn(sn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Hl.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Hl.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Hl.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Hl.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:Hl.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Hl.verticalFill,x:Ie(e.x)?e.x:f.left,y:Ie(e.y)?e.y:f.top,width:Ie(e.width)?e.width:f.width,height:Ie(e.height)?e.height:f.height}),d=h.x,m=h.y,p=h.width,x=h.height,y=h.syncWithTicks,v=h.horizontalValues,b=h.verticalValues,w=rue(),_=nue();if(!Ie(p)||p<=0||!Ie(x)||x<=0||!Ie(d)||d!==+d||!Ie(m)||m!==+m)return null;var N=h.verticalCoordinatesGenerator||yde,S=h.horizontalCoordinatesGenerator||vde,k=h.horizontalPoints,C=h.verticalPoints;if((!k||!k.length)&&ht(S)){var O=v&&v.length,R=S({yAxis:_?sn(sn({},_),{},{ticks:O?v:_.ticks}):void 0,width:l,height:c,offset:f},O?!0:y);Ia(Array.isArray(R),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Jo(R),"]")),Array.isArray(R)&&(k=R)}if((!C||!C.length)&&ht(N)){var A=b&&b.length,P=N({xAxis:w?sn(sn({},w),{},{ticks:A?b:w.ticks}):void 0,width:l,height:c,offset:f},A?!0:y);Ia(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Jo(P),"]")),Array.isArray(P)&&(C=P)}return oe.createElement("g",{className:"recharts-cartesian-grid"},oe.createElement(fde,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),oe.createElement(hde,Eo({},h,{offset:f,horizontalPoints:k,xAxis:w,yAxis:_})),oe.createElement(mde,Eo({},h,{offset:f,verticalPoints:C,xAxis:w,yAxis:_})),oe.createElement(pde,Eo({},h,{horizontalPoints:k})),oe.createElement(gde,Eo({},h,{verticalPoints:C})))}el.displayName="CartesianGrid";var xde=["type","layout","connectNulls","ref"],bde=["key"];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)}function AI(e,t){if(e==null)return{};var r=wde(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wde(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Bd(){return Bd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bd.apply(this,arguments)}function RI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RI(Object(r),!0).forEach(function(n){Ta(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vl(e){return Sde(e)||Nde(e)||jde(e)||_de()}function _de(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
479In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jde(e,t){if(e){if(typeof e=="string")return dN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dN(e,t)}}function Nde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Sde(e){if(Array.isArray(e))return dN(e)}function dN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function II(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g6(n.key),n)}}function Cde(e,t,r){return t&&II(e.prototype,t),r&&II(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fde(e,t,r){return t=jg(t),Ode(e,p6()?Reflect.construct(t,r||[],jg(e).constructor):t.apply(e,r))}function Ode(e,t){if(t&&(Qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ede(e)}function Ede(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p6=function(){return!!e})()}function jg(e){return jg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jg(e)}function Pde(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&&fN(e,t)}function fN(e,t){return fN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fN(e,t)}function Ta(e,t,r){return t=g6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g6(e){var t=Tde(e,"string");return Qc(t)=="symbol"?t:t+""}function Tde(e,t){if(Qc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sh=(function(e){function t(){var r;kde(this,t);for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return r=Fde(this,t,[].concat(i)),Ta(r,"state",{isAnimationFinished:!0,totalLength:0}),Ta(r,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Ta(r,"getStrokeDasharray",function(o,l,c){var f=c.reduce(function(b,w){return b+w});if(!f)return r.generateSimpleStrokeDasharray(l,o);for(var h=Math.floor(o/f),d=o%f,m=l-o,p=[],x=0,y=0;x<c.length;y+=c[x],++x)if(y+c[x]>d){p=[].concat(Vl(c.slice(0,x)),[d-y]);break}var v=p.length%2===0?[0,m]:[m];return[].concat(Vl(t.repeat(c,h)),Vl(p),v).map(function(b){return"".concat(b,"px")}).join(", ")}),Ta(r,"id",du("recharts-line-")),Ta(r,"pathRef",function(o){r.mainCurve=o}),Ta(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Ta(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Pde(t,e),Cde(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,o=s.points,l=s.xAxis,c=s.yAxis,f=s.layout,h=s.children,d=Gn(h,ih);if(!d)return null;var m=function(y,v){return{x:y.x,y:y.y,value:y.value,errorVal:Ar(y.payload,v)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return oe.createElement(At,p,d.map(function(x){return oe.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:l,yAxis:c,layout:f,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,i,s){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,f=l.points,h=l.dataKey,d=lt(this.props,!1),m=lt(c,!0),p=f.map(function(y,v){var b=$n($n($n({key:"dot-".concat(v),r:3},d),m),{},{index:v,cx:y.x,cy:y.y,value:y.value,dataKey:h,payload:y.payload,points:f});return t.renderDotItem(c,b)}),x={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return oe.createElement(At,Bd({className:"recharts-line-dots",key:"dots"},x),p)}},{key:"renderCurveStatically",value:function(n,i,s,o){var l=this.props,c=l.type,f=l.layout,h=l.connectNulls;l.ref;var d=AI(l,xde),m=$n($n($n({},lt(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:n},o),{},{type:c,layout:f,connectNulls:h});return oe.createElement(ng,Bd({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var s=this,o=this.props,l=o.points,c=o.strokeDasharray,f=o.isAnimationActive,h=o.animationBegin,d=o.animationDuration,m=o.animationEasing,p=o.animationId,x=o.animateNewValues,y=o.width,v=o.height,b=this.state,w=b.prevPoints,_=b.totalLength;return oe.createElement(di,{begin:h,duration:d,isActive:f,easing:m,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var S=N.t;if(w){var k=w.length/l.length,C=l.map(function(E,T){var $=Math.floor(T*k);if(w[$]){var D=w[$],W=Un(D.x,E.x),U=Un(D.y,E.y);return $n($n({},E),{},{x:W(S),y:U(S)})}if(x){var H=Un(y*2,E.x),K=Un(v/2,E.y);return $n($n({},E),{},{x:H(S),y:K(S)})}return $n($n({},E),{},{x:E.x,y:E.y})});return s.renderCurveStatically(C,n,i)}var O=Un(0,_),R=O(S),A;if(c){var P="".concat(c).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});A=s.getStrokeDasharray(R,_,P)}else A=s.generateSimpleStrokeDasharray(_,R);return s.renderCurveStatically(l,n,i,{strokeDasharray:A})})}},{key:"renderCurve",value:function(n,i){var s=this.props,o=s.points,l=s.isAnimationActive,c=this.state,f=c.prevPoints,h=c.totalLength;return l&&o&&o.length&&(!f&&h>0||!ah(f,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,s=i.hide,o=i.dot,l=i.points,c=i.className,f=i.xAxis,h=i.yAxis,d=i.top,m=i.left,p=i.width,x=i.height,y=i.isAnimationActive,v=i.id;if(s||!l||!l.length)return null;var b=this.state.isAnimationFinished,w=l.length===1,_=xt("recharts-line",c),N=f&&f.allowDataOverflow,S=h&&h.allowDataOverflow,k=N||S,C=yt(v)?this.id:v,O=(n=lt(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},R=O.r,A=R===void 0?3:R,P=O.strokeWidth,E=P===void 0?2:P,T=fQ(o)?o:{},$=T.clipDot,D=$===void 0?!0:$,W=A*2+E;return oe.createElement(At,{className:_},N||S?oe.createElement("defs",null,oe.createElement("clipPath",{id:"clipPath-".concat(C)},oe.createElement("rect",{x:N?m:m-p/2,y:S?d:d-x/2,width:N?p:p*2,height:S?x:x*2})),!D&&oe.createElement("clipPath",{id:"clipPath-dots-".concat(C)},oe.createElement("rect",{x:m-W/2,y:d-W/2,width:p+W,height:x+W}))):null,!w&&this.renderCurve(k,C),this.renderErrorBar(k,C),(w||o)&&this.renderDots(k,D,C),(!y||b)&&Hi.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var s=n.length%2!==0?[].concat(Vl(n),[0]):n,o=[],l=0;l<i;++l)o=[].concat(Vl(o),Vl(s));return o}},{key:"renderDotItem",value:function(n,i){var s;if(oe.isValidElement(n))s=oe.cloneElement(n,i);else if(ht(n))s=n(i);else{var o=i.key,l=AI(i,bde),c=xt("recharts-line-dot",typeof n!="boolean"?n.className:"");s=oe.createElement(yy,Bd({key:o},l,{className:c}))}return s}}])})(I.PureComponent);Ta(sh,"displayName","Line");Ta(sh,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!dl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ta(sh,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,s=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,f=e.offset,h=t.layout,d=c.map(function(m,p){var x=Ar(m,o);return h==="horizontal"?{x:L4({axis:r,ticks:i,bandSize:l,entry:m,index:p}),y:yt(x)?null:n.scale(x),value:x,payload:m}:{x:yt(x)?null:r.scale(x),y:L4({axis:n,ticks:s,bandSize:l,entry:m,index:p}),value:x,payload:m}});return $n({points:d,layout:h},f)});function Xc(e){"@babel/helpers - typeof";return Xc=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},Xc(e)}function Ade(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rde(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,x6(n.key),n)}}function Ide(e,t,r){return t&&Rde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mde(e,t,r){return t=Ng(t),Lde(e,y6()?Reflect.construct(t,r||[],Ng(e).constructor):t.apply(e,r))}function Lde(e,t){if(t&&(Xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dde(e)}function Dde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y6=function(){return!!e})()}function Ng(e){return Ng=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ng(e)}function $de(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&&hN(e,t)}function hN(e,t){return hN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hN(e,t)}function v6(e,t,r){return t=x6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x6(e){var t=qde(e,"string");return Xc(t)=="symbol"?t:t+""}function qde(e,t){if(Xc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function mN(){return mN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mN.apply(this,arguments)}function Bde(e){var t=e.xAxisId,r=uk(),n=dk(),i=n6(t);return i==null?null:I.createElement(gu,mN({},i,{className:xt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return $i(o,!0)}}))}var fi=(function(e){function t(){return Ade(this,t),Mde(this,t,arguments)}return $de(t,e),Ide(t,[{key:"render",value:function(){return I.createElement(Bde,this.props)}}])})(I.Component);v6(fi,"displayName","XAxis");v6(fi,"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 Zc(e){"@babel/helpers - typeof";return Zc=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},Zc(e)}function zde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ude(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_6(n.key),n)}}function Hde(e,t,r){return t&&Ude(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vde(e,t,r){return t=Sg(t),Wde(e,b6()?Reflect.construct(t,r||[],Sg(e).constructor):t.apply(e,r))}function Wde(e,t){if(t&&(Zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kde(e)}function Kde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(b6=function(){return!!e})()}function Sg(e){return Sg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sg(e)}function Gde(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&&pN(e,t)}function pN(e,t){return pN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pN(e,t)}function w6(e,t,r){return t=_6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _6(e){var t=Yde(e,"string");return Zc(t)=="symbol"?t:t+""}function Yde(e,t){if(Zc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function gN(){return gN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gN.apply(this,arguments)}var Qde=function(t){var r=t.yAxisId,n=uk(),i=dk(),s=a6(r);return s==null?null:I.createElement(gu,gN({},s,{className:xt("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(l){return $i(l,!0)}}))},hi=(function(e){function t(){return zde(this,t),Vde(this,t,arguments)}return Gde(t,e),Hde(t,[{key:"render",value:function(){return I.createElement(Qde,this.props)}}])})(I.Component);w6(hi,"displayName","YAxis");w6(hi,"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 MI(e){return efe(e)||Jde(e)||Zde(e)||Xde()}function Xde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
480In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zde(e,t){if(e){if(typeof e=="string")return yN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yN(e,t)}}function Jde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function efe(e){if(Array.isArray(e))return yN(e)}function yN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vN=function(t,r,n,i,s){var o=Gn(t,hk),l=Gn(t,ky),c=[].concat(MI(o),MI(l)),f=Gn(t,Fy),h="".concat(i,"Id"),d=i[0],m=r;if(c.length&&(m=c.reduce(function(y,v){if(v.props[h]===n&&ii(v.props,"extendDomain")&&Ie(v.props[d])){var b=v.props[d];return[Math.min(y[0],b),Math.max(y[1],b)]}return y},m)),f.length){var p="".concat(d,"1"),x="".concat(d,"2");m=f.reduce(function(y,v){if(v.props[h]===n&&ii(v.props,"extendDomain")&&Ie(v.props[p])&&Ie(v.props[x])){var b=v.props[p],w=v.props[x];return[Math.min(y[0],b,w),Math.max(y[1],b,w)]}return y},m)}return s&&s.length&&(m=s.reduce(function(y,v){return Ie(v)?[Math.min(y[0],v),Math.max(y[1],v)]:y},m)),m},G_={exports:{}},LI;function tfe(){return LI||(LI=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,f,h){this.fn=c,this.context=f,this.once=h||!1}function s(c,f,h,d,m){if(typeof h!="function")throw new TypeError("The listener must be a function");var p=new i(h,d||c,m),x=r?r+f:f;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],p]:c._events[x].push(p):(c._events[x]=p,c._eventsCount++),c}function o(c,f){--c._eventsCount===0?c._events=new n:delete c._events[f]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var f=[],h,d;if(this._eventsCount===0)return f;for(d in h=this._events)t.call(h,d)&&f.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},l.prototype.listeners=function(f){var h=r?r+f:f,d=this._events[h];if(!d)return[];if(d.fn)return[d.fn];for(var m=0,p=d.length,x=new Array(p);m<p;m++)x[m]=d[m].fn;return x},l.prototype.listenerCount=function(f){var h=r?r+f:f,d=this._events[h];return d?d.fn?1:d.length:0},l.prototype.emit=function(f,h,d,m,p,x){var y=r?r+f:f;if(!this._events[y])return!1;var v=this._events[y],b=arguments.length,w,_;if(v.fn){switch(v.once&&this.removeListener(f,v.fn,void 0,!0),b){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,h),!0;case 3:return v.fn.call(v.context,h,d),!0;case 4:return v.fn.call(v.context,h,d,m),!0;case 5:return v.fn.call(v.context,h,d,m,p),!0;case 6:return v.fn.call(v.context,h,d,m,p,x),!0}for(_=1,w=new Array(b-1);_<b;_++)w[_-1]=arguments[_];v.fn.apply(v.context,w)}else{var N=v.length,S;for(_=0;_<N;_++)switch(v[_].once&&this.removeListener(f,v[_].fn,void 0,!0),b){case 1:v[_].fn.call(v[_].context);break;case 2:v[_].fn.call(v[_].context,h);break;case 3:v[_].fn.call(v[_].context,h,d);break;case 4:v[_].fn.call(v[_].context,h,d,m);break;default:if(!w)for(S=1,w=new Array(b-1);S<b;S++)w[S-1]=arguments[S];v[_].fn.apply(v[_].context,w)}}return!0},l.prototype.on=function(f,h,d){return s(this,f,h,d,!1)},l.prototype.once=function(f,h,d){return s(this,f,h,d,!0)},l.prototype.removeListener=function(f,h,d,m){var p=r?r+f:f;if(!this._events[p])return this;if(!h)return o(this,p),this;var x=this._events[p];if(x.fn)x.fn===h&&(!m||x.once)&&(!d||x.context===d)&&o(this,p);else{for(var y=0,v=[],b=x.length;y<b;y++)(x[y].fn!==h||m&&!x[y].once||d&&x[y].context!==d)&&v.push(x[y]);v.length?this._events[p]=v.length===1?v[0]:v:o(this,p)}return this},l.prototype.removeAllListeners=function(f){var h;return f?(h=r?r+f:f,this._events[h]&&o(this,h)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(G_)),G_.exports}var rfe=tfe();const nfe=Ft(rfe);var Y_=new nfe,Q_="recharts.syncMouseEvents";function Pf(e){"@babel/helpers - typeof";return Pf=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},Pf(e)}function afe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ife(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j6(n.key),n)}}function sfe(e,t,r){return t&&ife(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function X_(e,t,r){return t=j6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j6(e){var t=ofe(e,"string");return Pf(t)=="symbol"?t:t+""}function ofe(e,t){if(Pf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var lfe=(function(){function e(){afe(this,e),X_(this,"activeIndex",0),X_(this,"coordinateList",[]),X_(this,"layout","horizontal")}return sfe(e,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,s=i===void 0?null:i,o=r.container,l=o===void 0?null:o,c=r.layout,f=c===void 0?null:c,h=r.offset,d=h===void 0?null:h,m=r.mouseHandlerCallback,p=m===void 0?null:m;this.coordinateList=(n=s??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=f??this.layout,this.offset=d??this.offset,this.mouseHandlerCallback=p??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(r){if(this.coordinateList.length!==0)switch(r.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(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),s=i.x,o=i.y,l=i.height,c=this.coordinateList[this.activeIndex].coordinate,f=((r=window)===null||r===void 0?void 0:r.scrollX)||0,h=((n=window)===null||n===void 0?void 0:n.scrollY)||0,d=s+c+f,m=o+this.offset.top+l/2+h;this.mouseHandlerCallback({pageX:d,pageY:m})}}}])})();function cfe(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],i=e==null?void 0:e[1];if(n&&i&&Ie(n)&&Ie(i))return!0}return!1}function ufe(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function N6(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,s=e.endAngle,o=nr(t,r,n,i),l=nr(t,r,n,s);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:i,endAngle:s}}function dfe(e,t,r){var n,i,s,o;if(e==="horizontal")n=t.x,s=n,i=r.top,o=r.top+r.height;else if(e==="vertical")i=t.y,o=i,n=r.left,s=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,f=t.innerRadius,h=t.outerRadius,d=t.angle,m=nr(l,c,f,d),p=nr(l,c,h,d);n=m.x,i=m.y,s=p.x,o=p.y}else return N6(t);return[{x:n,y:i},{x:s,y:o}]}function Tf(e){"@babel/helpers - typeof";return Tf=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},Tf(e)}function DI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(r),!0).forEach(function(n){ffe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ffe(e,t,r){return t=hfe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hfe(e){var t=mfe(e,"string");return Tf(t)=="symbol"?t:t+""}function mfe(e,t){if(Tf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Tf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pfe(e){var t,r,n=e.element,i=e.tooltipEventType,s=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,d=e.layout,m=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!s||!o||m!=="ScatterChart"&&i!=="axis")return null;var x,y=ng;if(m==="ScatterChart")x=o,y=Loe;else if(m==="BarChart")x=ufe(d,o,c,h),y=sk;else if(d==="radial"){var v=N6(o),b=v.cx,w=v.cy,_=v.radius,N=v.startAngle,S=v.endAngle;x={cx:b,cy:w,startAngle:N,endAngle:S,innerRadius:_,outerRadius:_},y=S5}else x={points:dfe(d,o,c)},y=ng;var k=zm(zm(zm(zm({stroke:"#ccc",pointerEvents:"none"},c),x),lt(p,!1)),{},{payload:l,payloadIndex:f,className:xt("recharts-tooltip-cursor",p.className)});return I.isValidElement(p)?I.cloneElement(p,k):I.createElement(y,k)}var gfe=["item"],yfe=["children","className","width","height","style","compact","title","desc"];function Jc(e){"@babel/helpers - typeof";return Jc=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},Jc(e)}function ic(){return ic=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ic.apply(this,arguments)}function $I(e,t){return bfe(e)||xfe(e,t)||k6(e,t)||vfe()}function vfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
481In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xfe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,s,o,l=[],c=!0,f=!1;try{if(s=(r=r.call(e)).next,t!==0)for(;!(c=(n=s.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return l}}function bfe(e){if(Array.isArray(e))return e}function qI(e,t){if(e==null)return{};var r=wfe(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wfe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jfe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,C6(n.key),n)}}function Nfe(e,t,r){return t&&jfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sfe(e,t,r){return t=kg(t),kfe(e,S6()?Reflect.construct(t,r||[],kg(e).constructor):t.apply(e,r))}function kfe(e,t){if(t&&(Jc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cfe(e)}function Cfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S6=function(){return!!e})()}function kg(e){return kg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kg(e)}function Ffe(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&&xN(e,t)}function xN(e,t){return xN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},xN(e,t)}function eu(e){return Pfe(e)||Efe(e)||k6(e)||Ofe()}function Ofe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
482In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k6(e,t){if(e){if(typeof e=="string")return bN(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bN(e,t)}}function Efe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pfe(e){if(Array.isArray(e))return bN(e)}function bN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function BI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function we(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BI(Object(r),!0).forEach(function(n){ct(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ct(e,t,r){return t=C6(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C6(e){var t=Tfe(e,"string");return Jc(t)=="symbol"?t:t+""}function Tfe(e,t){if(Jc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Afe={xAxis:["bottom","top"],yAxis:["left","right"]},Rfe={width:"100%",height:"100%"},F6={x:0,y:0};function Um(e){return e}var Ife=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},Mfe=function(t,r,n,i){var s=r.find(function(h){return h&&h.index===n});if(s){if(t==="horizontal")return{x:s.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:s.coordinate};if(t==="centric"){var o=s.coordinate,l=i.radius;return we(we(we({},i),nr(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var c=s.coordinate,f=i.angle;return we(we(we({},i),nr(i.cx,i.cy,c,f)),{},{angle:f,radius:c})}return F6},Oy=function(t,r){var n=r.graphicalItems,i=r.dataStartIndex,s=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var f=c.props.data;return f&&f.length?[].concat(eu(l),eu(f)):l},[]);return o.length>0?o:t&&t.length&&Ie(i)&&Ie(s)?t.slice(i,s+1):[]};function O6(e){return e==="number"?[0,"auto"]:void 0}var wN=function(t,r,n,i){var s=t.graphicalItems,o=t.tooltipAxis,l=Oy(r,t);return n<0||!s||!s.length||n>=l.length?null:s.reduce(function(c,f){var h,d=(h=f.props.data)!==null&&h!==void 0?h:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(o.dataKey&&!o.allowDuplicatedCategory){var p=d===void 0?l:d;m=Op(p,o.dataKey,i)}else m=d&&d[n]||l[n];return m?[].concat(eu(c),[x5(f,m)]):c},[])},zI=function(t,r,n,i){var s=i||{x:t.chartX,y:t.chartY},o=Ife(s,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,f=t.tooltipTicks,h=lae(o,l,f,c);if(h>=0&&f){var d=f[h]&&f[h].value,m=wN(t,r,h,d),p=Mfe(n,l,h,s);return{activeTooltipIndex:h,activeLabel:d,activePayload:m,activeCoordinate:p}}return null},Lfe=function(t,r){var n=r.axes,i=r.graphicalItems,s=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,f=r.dataEndIndex,h=t.layout,d=t.children,m=t.stackOffset,p=h5(h,s);return n.reduce(function(x,y){var v,b=y.type.defaultProps!==void 0?we(we({},y.type.defaultProps),y.props):y.props,w=b.type,_=b.dataKey,N=b.allowDataOverflow,S=b.allowDuplicatedCategory,k=b.scale,C=b.ticks,O=b.includeHidden,R=b[o];if(x[R])return x;var A=Oy(t.data,{graphicalItems:i.filter(function(V){var z,Z=o in V.props?V.props[o]:(z=V.type.defaultProps)===null||z===void 0?void 0:z[o];return Z===R}),dataStartIndex:c,dataEndIndex:f}),P=A.length,E,T,$;cfe(b.domain,N,w)&&(E=I1(b.domain,null,N),p&&(w==="number"||k!=="auto")&&($=Ld(A,_,"category")));var D=O6(w);if(!E||E.length===0){var W,U=(W=b.domain)!==null&&W!==void 0?W:D;if(_){if(E=Ld(A,_,w),w==="category"&&p){var H=rQ(E);S&&H?(T=E,E=hg(0,P)):S||(E=B4(U,E,y).reduce(function(V,z){return V.indexOf(z)>=0?V:[].concat(eu(V),[z])},[]))}else if(w==="category")S?E=E.filter(function(V){return V!==""&&!yt(V)}):E=B4(U,E,y).reduce(function(V,z){return V.indexOf(z)>=0||z===""||yt(z)?V:[].concat(eu(V),[z])},[]);else if(w==="number"){var K=hae(A,i.filter(function(V){var z,Z,re=o in V.props?V.props[o]:(z=V.type.defaultProps)===null||z===void 0?void 0:z[o],G="hide"in V.props?V.props.hide:(Z=V.type.defaultProps)===null||Z===void 0?void 0:Z.hide;return re===R&&(O||!G)}),_,s,h);K&&(E=K)}p&&(w==="number"||k!=="auto")&&($=Ld(A,_,"category"))}else p?E=hg(0,P):l&&l[R]&&l[R].hasStack&&w==="number"?E=m==="expand"?[0,1]:v5(l[R].stackGroups,c,f):E=f5(A,i.filter(function(V){var z=o in V.props?V.props[o]:V.type.defaultProps[o],Z="hide"in V.props?V.props.hide:V.type.defaultProps.hide;return z===R&&(O||!Z)}),w,h,!0);if(w==="number")E=vN(d,E,R,s,C),U&&(E=I1(U,E,N));else if(w==="category"&&U){var q=U,L=E.every(function(V){return q.indexOf(V)>=0});L&&(E=q)}}return we(we({},x),{},ct({},R,we(we({},b),{},{axisType:s,domain:E,categoricalDomain:$,duplicateDomain:T,originalDomain:(v=b.domain)!==null&&v!==void 0?v:D,isCategorical:p,layout:h})))},{})},Dfe=function(t,r){var n=r.graphicalItems,i=r.Axis,s=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,f=r.dataEndIndex,h=t.layout,d=t.children,m=Oy(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:f}),p=m.length,x=h5(h,s),y=-1;return n.reduce(function(v,b){var w=b.type.defaultProps!==void 0?we(we({},b.type.defaultProps),b.props):b.props,_=w[o],N=O6("number");if(!v[_]){y++;var S;return x?S=hg(0,p):l&&l[_]&&l[_].hasStack?(S=v5(l[_].stackGroups,c,f),S=vN(d,S,_,s)):(S=I1(N,f5(m,n.filter(function(k){var C,O,R=o in k.props?k.props[o]:(C=k.type.defaultProps)===null||C===void 0?void 0:C[o],A="hide"in k.props?k.props.hide:(O=k.type.defaultProps)===null||O===void 0?void 0:O.hide;return R===_&&!A}),"number",h),i.defaultProps.allowDataOverflow),S=vN(d,S,_,s)),we(we({},v),{},ct({},_,we(we({axisType:s},i.defaultProps),{},{hide:!0,orientation:Kn(Afe,"".concat(s,".").concat(y%2),null),domain:S,originalDomain:N,isCategorical:x,layout:h})))}return v},{})},$fe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,s=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,f=r.dataEndIndex,h=t.children,d="".concat(i,"Id"),m=Gn(h,s),p={};return m&&m.length?p=Lfe(t,{axes:m,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:f}):o&&o.length&&(p=Dfe(t,{Axis:s,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:f})),p},qfe=function(t){var r=Cs(t),n=$i(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:AS(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:eg(r,n)}},UI=function(t){var r=t.children,n=t.defaultShowTooltip,i=zn(r,Hc),s=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Bfe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Bi(r&&r.type);return n&&n.indexOf("Bar")>=0})},HI=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"}},zfe=function(t,r){var n=t.props,i=t.graphicalItems,s=t.xAxisMap,o=s===void 0?{}:s,l=t.yAxisMap,c=l===void 0?{}:l,f=n.width,h=n.height,d=n.children,m=n.margin||{},p=zn(d,Hc),x=zn(d,zi),y=Object.keys(c).reduce(function(S,k){var C=c[k],O=C.orientation;return!C.mirror&&!C.hide?we(we({},S),{},ct({},O,S[O]+C.width)):S},{left:m.left||0,right:m.right||0}),v=Object.keys(o).reduce(function(S,k){var C=o[k],O=C.orientation;return!C.mirror&&!C.hide?we(we({},S),{},ct({},O,Kn(S,"".concat(O))+C.height)):S},{top:m.top||0,bottom:m.bottom||0}),b=we(we({},v),y),w=b.bottom;p&&(b.bottom+=p.props.height||Hc.defaultProps.height),x&&r&&(b=dae(b,i,n,r));var _=f-b.left-b.right,N=h-b.top-b.bottom;return we(we({brushBottom:w},b),{},{width:Math.max(_,0),height:Math.max(N,0)})},Ufe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},gk=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,d=t.defaultProps,m=function(b,w){var _=w.graphicalItems,N=w.stackGroups,S=w.offset,k=w.updateId,C=w.dataStartIndex,O=w.dataEndIndex,R=b.barSize,A=b.layout,P=b.barGap,E=b.barCategoryGap,T=b.maxBarSize,$=HI(A),D=$.numericAxisName,W=$.cateAxisName,U=Bfe(_),H=[];return _.forEach(function(K,q){var L=Oy(b.data,{graphicalItems:[K],dataStartIndex:C,dataEndIndex:O}),V=K.type.defaultProps!==void 0?we(we({},K.type.defaultProps),K.props):K.props,z=V.dataKey,Z=V.maxBarSize,re=V["".concat(D,"Id")],G=V["".concat(W,"Id")],X={},ie=c.reduce(function(Re,_e){var dt=w["".concat(_e.axisType,"Map")],pt=V["".concat(_e.axisType,"Id")];dt&&dt[pt]||_e.axisType==="zAxis"||Zo();var gt=dt[pt];return we(we({},Re),{},ct(ct({},_e.axisType,gt),"".concat(_e.axisType,"Ticks"),$i(gt)))},X),J=ie[W],ue=ie["".concat(W,"Ticks")],ge=N&&N[re]&&N[re].hasStack&&_ae(K,N[re].stackGroups),fe=Bi(K.type).indexOf("Bar")>=0,Ee=eg(J,ue),Oe=[],Ve=U&&cae({barSize:R,stackGroups:N,totalSize:Ufe(ie,W)});if(fe){var Ae,tt,ye=yt(Z)?T:Z,xe=(Ae=(tt=eg(J,ue,!0))!==null&&tt!==void 0?tt:ye)!==null&&Ae!==void 0?Ae:0;Oe=uae({barGap:P,barCategoryGap:E,bandSize:xe!==Ee?xe:Ee,sizeList:Ve[G],maxBarSize:ye}),xe!==Ee&&(Oe=Oe.map(function(Re){return we(we({},Re),{},{position:we(we({},Re.position),{},{offset:Re.position.offset-xe/2})})}))}var Ce=K&&K.type&&K.type.getComposedData;Ce&&H.push({props:we(we({},Ce(we(we({},ie),{},{displayedData:L,props:b,dataKey:z,item:K,bandSize:Ee,barPosition:Oe,offset:S,stackedData:ge,layout:A,dataStartIndex:C,dataEndIndex:O}))),{},ct(ct(ct({key:K.key||"item-".concat(q)},D,ie[D]),W,ie[W]),"animationId",k)),childIndex:pQ(K,b.children),item:K})}),H},p=function(b,w){var _=b.props,N=b.dataStartIndex,S=b.dataEndIndex,k=b.updateId;if(!tP({props:_}))return null;var C=_.children,O=_.layout,R=_.stackOffset,A=_.data,P=_.reverseStackOrder,E=HI(O),T=E.numericAxisName,$=E.cateAxisName,D=Gn(C,n),W=bae(A,D,"".concat(T,"Id"),"".concat($,"Id"),R,P),U=c.reduce(function(V,z){var Z="".concat(z.axisType,"Map");return we(we({},V),{},ct({},Z,$fe(_,we(we({},z),{},{graphicalItems:D,stackGroups:z.axisType===T&&W,dataStartIndex:N,dataEndIndex:S}))))},{}),H=zfe(we(we({},U),{},{props:_,graphicalItems:D}),w==null?void 0:w.legendBBox);Object.keys(U).forEach(function(V){U[V]=h(_,U[V],H,V.replace("Map",""),r)});var K=U["".concat($,"Map")],q=qfe(K),L=m(_,we(we({},U),{},{dataStartIndex:N,dataEndIndex:S,updateId:k,graphicalItems:D,stackGroups:W,offset:H}));return we(we({formattedGraphicalItems:L,graphicalItems:D,offset:H,stackGroups:W},q),U)},x=(function(v){function b(w){var _,N,S;return _fe(this,b),S=Sfe(this,b,[w]),ct(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ct(S,"accessibilityManager",new lfe),ct(S,"handleLegendBBoxUpdate",function(k){if(k){var C=S.state,O=C.dataStartIndex,R=C.dataEndIndex,A=C.updateId;S.setState(we({legendBBox:k},p({props:S.props,dataStartIndex:O,dataEndIndex:R,updateId:A},we(we({},S.state),{},{legendBBox:k}))))}}),ct(S,"handleReceiveSyncEvent",function(k,C,O){if(S.props.syncId===k){if(O===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(C)}}),ct(S,"handleBrushChange",function(k){var C=k.startIndex,O=k.endIndex;if(C!==S.state.dataStartIndex||O!==S.state.dataEndIndex){var R=S.state.updateId;S.setState(function(){return we({dataStartIndex:C,dataEndIndex:O},p({props:S.props,dataStartIndex:C,dataEndIndex:O,updateId:R},S.state))}),S.triggerSyncEvent({dataStartIndex:C,dataEndIndex:O})}}),ct(S,"handleMouseEnter",function(k){var C=S.getMouseInfo(k);if(C){var O=we(we({},C),{},{isTooltipActive:!0});S.setState(O),S.triggerSyncEvent(O);var R=S.props.onMouseEnter;ht(R)&&R(O,k)}}),ct(S,"triggeredAfterMouseMove",function(k){var C=S.getMouseInfo(k),O=C?we(we({},C),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(O),S.triggerSyncEvent(O);var R=S.props.onMouseMove;ht(R)&&R(O,k)}),ct(S,"handleItemMouseEnter",function(k){S.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),ct(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),ct(S,"handleMouseMove",function(k){k.persist(),S.throttleTriggeredAfterMouseMove(k)}),ct(S,"handleMouseLeave",function(k){S.throttleTriggeredAfterMouseMove.cancel();var C={isTooltipActive:!1};S.setState(C),S.triggerSyncEvent(C);var O=S.props.onMouseLeave;ht(O)&&O(C,k)}),ct(S,"handleOuterEvent",function(k){var C=mQ(k),O=Kn(S.props,"".concat(C));if(C&&ht(O)){var R,A;/.*touch.*/i.test(C)?A=S.getMouseInfo(k.changedTouches[0]):A=S.getMouseInfo(k),O((R=A)!==null&&R!==void 0?R:{},k)}}),ct(S,"handleClick",function(k){var C=S.getMouseInfo(k);if(C){var O=we(we({},C),{},{isTooltipActive:!0});S.setState(O),S.triggerSyncEvent(O);var R=S.props.onClick;ht(R)&&R(O,k)}}),ct(S,"handleMouseDown",function(k){var C=S.props.onMouseDown;if(ht(C)){var O=S.getMouseInfo(k);C(O,k)}}),ct(S,"handleMouseUp",function(k){var C=S.props.onMouseUp;if(ht(C)){var O=S.getMouseInfo(k);C(O,k)}}),ct(S,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),ct(S,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&S.handleMouseDown(k.changedTouches[0])}),ct(S,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&S.handleMouseUp(k.changedTouches[0])}),ct(S,"handleDoubleClick",function(k){var C=S.props.onDoubleClick;if(ht(C)){var O=S.getMouseInfo(k);C(O,k)}}),ct(S,"handleContextMenu",function(k){var C=S.props.onContextMenu;if(ht(C)){var O=S.getMouseInfo(k);C(O,k)}}),ct(S,"triggerSyncEvent",function(k){S.props.syncId!==void 0&&Y_.emit(Q_,S.props.syncId,k,S.eventEmitterSymbol)}),ct(S,"applySyncEvent",function(k){var C=S.props,O=C.layout,R=C.syncMethod,A=S.state.updateId,P=k.dataStartIndex,E=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)S.setState(we({dataStartIndex:P,dataEndIndex:E},p({props:S.props,dataStartIndex:P,dataEndIndex:E,updateId:A},S.state)));else if(k.activeTooltipIndex!==void 0){var T=k.chartX,$=k.chartY,D=k.activeTooltipIndex,W=S.state,U=W.offset,H=W.tooltipTicks;if(!U)return;if(typeof R=="function")D=R(H,k);else if(R==="value"){D=-1;for(var K=0;K<H.length;K++)if(H[K].value===k.activeLabel){D=K;break}}var q=we(we({},U),{},{x:U.left,y:U.top}),L=Math.min(T,q.x+q.width),V=Math.min($,q.y+q.height),z=H[D]&&H[D].value,Z=wN(S.state,S.props.data,D),re=H[D]?{x:O==="horizontal"?H[D].coordinate:L,y:O==="horizontal"?V:H[D].coordinate}:F6;S.setState(we(we({},k),{},{activeLabel:z,activeCoordinate:re,activePayload:Z,activeTooltipIndex:D}))}else S.setState(k)}),ct(S,"renderCursor",function(k){var C,O=S.state,R=O.isTooltipActive,A=O.activeCoordinate,P=O.activePayload,E=O.offset,T=O.activeTooltipIndex,$=O.tooltipAxisBandSize,D=S.getTooltipEventType(),W=(C=k.props.active)!==null&&C!==void 0?C:R,U=S.props.layout,H=k.key||"_recharts-cursor";return oe.createElement(pfe,{key:H,activeCoordinate:A,activePayload:P,activeTooltipIndex:T,chartName:r,element:k,isActive:W,layout:U,offset:E,tooltipAxisBandSize:$,tooltipEventType:D})}),ct(S,"renderPolarAxis",function(k,C,O){var R=Kn(k,"type.axisType"),A=Kn(S.state,"".concat(R,"Map")),P=k.type.defaultProps,E=P!==void 0?we(we({},P),k.props):k.props,T=A&&A[E["".concat(R,"Id")]];return I.cloneElement(k,we(we({},T),{},{className:xt(R,T.className),key:k.key||"".concat(C,"-").concat(O),ticks:$i(T,!0)}))}),ct(S,"renderPolarGrid",function(k){var C=k.props,O=C.radialLines,R=C.polarAngles,A=C.polarRadius,P=S.state,E=P.radiusAxisMap,T=P.angleAxisMap,$=Cs(E),D=Cs(T),W=D.cx,U=D.cy,H=D.innerRadius,K=D.outerRadius;return I.cloneElement(k,{polarAngles:Array.isArray(R)?R:$i(D,!0).map(function(q){return q.coordinate}),polarRadius:Array.isArray(A)?A:$i($,!0).map(function(q){return q.coordinate}),cx:W,cy:U,innerRadius:H,outerRadius:K,key:k.key||"polar-grid",radialLines:O})}),ct(S,"renderLegend",function(){var k=S.state.formattedGraphicalItems,C=S.props,O=C.children,R=C.width,A=C.height,P=S.props.margin||{},E=R-(P.left||0)-(P.right||0),T=u5({children:O,formattedGraphicalItems:k,legendWidth:E,legendContent:f});if(!T)return null;var $=T.item,D=qI(T,gfe);return I.cloneElement($,we(we({},D),{},{chartWidth:R,chartHeight:A,margin:P,onBBoxUpdate:S.handleLegendBBoxUpdate}))}),ct(S,"renderTooltip",function(){var k,C=S.props,O=C.children,R=C.accessibilityLayer,A=zn(O,fr);if(!A)return null;var P=S.state,E=P.isTooltipActive,T=P.activeCoordinate,$=P.activePayload,D=P.activeLabel,W=P.offset,U=(k=A.props.active)!==null&&k!==void 0?k:E;return I.cloneElement(A,{viewBox:we(we({},W),{},{x:W.left,y:W.top}),active:U,label:D,payload:U?$:[],coordinate:T,accessibilityLayer:R})}),ct(S,"renderBrush",function(k){var C=S.props,O=C.margin,R=C.data,A=S.state,P=A.offset,E=A.dataStartIndex,T=A.dataEndIndex,$=A.updateId;return I.cloneElement(k,{key:k.key||"_recharts-brush",onChange:Dm(S.handleBrushChange,k.props.onChange),data:R,x:Ie(k.props.x)?k.props.x:P.left,y:Ie(k.props.y)?k.props.y:P.top+P.height+P.brushBottom-(O.bottom||0),width:Ie(k.props.width)?k.props.width:P.width,startIndex:E,endIndex:T,updateId:"brush-".concat($)})}),ct(S,"renderReferenceElement",function(k,C,O){if(!k)return null;var R=S,A=R.clipPathId,P=S.state,E=P.xAxisMap,T=P.yAxisMap,$=P.offset,D=k.type.defaultProps||{},W=k.props,U=W.xAxisId,H=U===void 0?D.xAxisId:U,K=W.yAxisId,q=K===void 0?D.yAxisId:K;return I.cloneElement(k,{key:k.key||"".concat(C,"-").concat(O),xAxis:E[H],yAxis:T[q],viewBox:{x:$.left,y:$.top,width:$.width,height:$.height},clipPathId:A})}),ct(S,"renderActivePoints",function(k){var C=k.item,O=k.activePoint,R=k.basePoint,A=k.childIndex,P=k.isRange,E=[],T=C.props.key,$=C.item.type.defaultProps!==void 0?we(we({},C.item.type.defaultProps),C.item.props):C.item.props,D=$.activeDot,W=$.dataKey,U=we(we({index:A,dataKey:W,cx:O.x,cy:O.y,r:4,fill:ik(C.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value},lt(D,!1)),Ep(D));return E.push(b.renderActiveDot(D,U,"".concat(T,"-activePoint-").concat(A))),R?E.push(b.renderActiveDot(D,we(we({},U),{},{cx:R.x,cy:R.y}),"".concat(T,"-basePoint-").concat(A))):P&&E.push(null),E}),ct(S,"renderGraphicChild",function(k,C,O){var R=S.filterFormatItem(k,C,O);if(!R)return null;var A=S.getTooltipEventType(),P=S.state,E=P.isTooltipActive,T=P.tooltipAxis,$=P.activeTooltipIndex,D=P.activeLabel,W=S.props.children,U=zn(W,fr),H=R.props,K=H.points,q=H.isRange,L=H.baseLine,V=R.item.type.defaultProps!==void 0?we(we({},R.item.type.defaultProps),R.item.props):R.item.props,z=V.activeDot,Z=V.hide,re=V.activeBar,G=V.activeShape,X=!!(!Z&&E&&U&&(z||re||G)),ie={};A!=="axis"&&U&&U.props.trigger==="click"?ie={onClick:Dm(S.handleItemMouseEnter,k.props.onClick)}:A!=="axis"&&(ie={onMouseLeave:Dm(S.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:Dm(S.handleItemMouseEnter,k.props.onMouseEnter)});var J=I.cloneElement(k,we(we({},R.props),ie));function ue(_e){return typeof T.dataKey=="function"?T.dataKey(_e.payload):null}if(X)if($>=0){var ge,fe;if(T.dataKey&&!T.allowDuplicatedCategory){var Ee=typeof T.dataKey=="function"?ue:"payload.".concat(T.dataKey.toString());ge=Op(K,Ee,D),fe=q&&L&&Op(L,Ee,D)}else ge=K==null?void 0:K[$],fe=q&&L&&L[$];if(G||re){var Oe=k.props.activeIndex!==void 0?k.props.activeIndex:$;return[I.cloneElement(k,we(we(we({},R.props),ie),{},{activeIndex:Oe})),null,null]}if(!yt(ge))return[J].concat(eu(S.renderActivePoints({item:R,activePoint:ge,basePoint:fe,childIndex:$,isRange:q})))}else{var Ve,Ae=(Ve=S.getItemByXY(S.state.activeCoordinate))!==null&&Ve!==void 0?Ve:{graphicalItem:J},tt=Ae.graphicalItem,ye=tt.item,xe=ye===void 0?k:ye,Ce=tt.childIndex,Re=we(we(we({},R.props),ie),{},{activeIndex:Ce});return[I.cloneElement(xe,Re),null,null]}return q?[J,null,null]:[J,null]}),ct(S,"renderCustomized",function(k,C,O){return I.cloneElement(k,we(we({key:"recharts-customized-".concat(O)},S.props),S.state))}),ct(S,"renderMap",{CartesianGrid:{handler:Um,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:Um},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:Um},YAxis:{handler:Um},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.id)!==null&&_!==void 0?_:du("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=l$(S.triggeredAfterMouseMove,(N=w.throttleDelay)!==null&&N!==void 0?N:1e3/60),S.state={},S}return Ffe(b,v),Nfe(b,[{key:"componentDidMount",value:function(){var _,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var _=this.props,N=_.children,S=_.data,k=_.height,C=_.layout,O=zn(N,fr);if(O){var R=O.props.defaultIndex;if(!(typeof R!="number"||R<0||R>this.state.tooltipTicks.length-1)){var A=this.state.tooltipTicks[R]&&this.state.tooltipTicks[R].value,P=wN(this.state,S,R,A),E=this.state.tooltipTicks[R].coordinate,T=(this.state.offset.top+k)/2,$=C==="horizontal",D=$?{x:E,y:T}:{y:E,x:T},W=this.state.formattedGraphicalItems.find(function(H){var K=H.item;return K.type.name==="Scatter"});W&&(D=we(we({},D),W.props.points[R].tooltipPosition),P=W.props.points[R].tooltipPayload);var U={activeTooltipIndex:R,isTooltipActive:!0,activeLabel:A,activePayload:P,activeCoordinate:D};this.setState(U),this.renderCursor(O),this.accessibilityManager.setIndex(R)}}}},{key:"getSnapshotBeforeUpdate",value:function(_,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==_.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==_.margin){var S,k;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(_){n1([zn(_.children,fr)],[zn(this.props.children,fr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var _=zn(this.props.children,fr);if(_&&typeof _.props.shared=="boolean"){var N=_.props.shared?"axis":"item";return l.indexOf(N)>=0?N:s}return s}},{key:"getMouseInfo",value:function(_){if(!this.container)return null;var N=this.container,S=N.getBoundingClientRect(),k=tee(S),C={chartX:Math.round(_.pageX-k.left),chartY:Math.round(_.pageY-k.top)},O=S.width/N.offsetWidth||1,R=this.inRange(C.chartX,C.chartY,O);if(!R)return null;var A=this.state,P=A.xAxisMap,E=A.yAxisMap,T=this.getTooltipEventType(),$=zI(this.state,this.props.data,this.props.layout,R);if(T!=="axis"&&P&&E){var D=Cs(P).scale,W=Cs(E).scale,U=D&&D.invert?D.invert(C.chartX):null,H=W&&W.invert?W.invert(C.chartY):null;return we(we({},C),{},{xValue:U,yValue:H},$)}return $?we(we({},C),$):null}},{key:"inRange",value:function(_,N){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,C=_/S,O=N/S;if(k==="horizontal"||k==="vertical"){var R=this.state.offset,A=C>=R.left&&C<=R.left+R.width&&O>=R.top&&O<=R.top+R.height;return A?{x:C,y:O}:null}var P=this.state,E=P.angleAxisMap,T=P.radiusAxisMap;if(E&&T){var $=Cs(E);return H4({x:C,y:O},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var _=this.props.children,N=this.getTooltipEventType(),S=zn(_,fr),k={};S&&N==="axis"&&(S.props.trigger==="click"?k={onClick:this.handleClick}:k={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 C=Ep(this.props,this.handleOuterEvent);return we(we({},C),k)}},{key:"addListener",value:function(){Y_.on(Q_,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Y_.removeListener(Q_,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(_,N,S){for(var k=this.state.formattedGraphicalItems,C=0,O=k.length;C<O;C++){var R=k[C];if(R.item===_||R.props.key===_.key||N===Bi(R.item.type)&&S===R.childIndex)return R}return null}},{key:"renderClipPath",value:function(){var _=this.clipPathId,N=this.state.offset,S=N.left,k=N.top,C=N.height,O=N.width;return oe.createElement("defs",null,oe.createElement("clipPath",{id:_},oe.createElement("rect",{x:S,y:k,height:C,width:O})))}},{key:"getXScales",value:function(){var _=this.state.xAxisMap;return _?Object.entries(_).reduce(function(N,S){var k=$I(S,2),C=k[0],O=k[1];return we(we({},N),{},ct({},C,O.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(N,S){var k=$I(S,2),C=k[0],O=k[1];return we(we({},N),{},ct({},C,O.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(_){var N;return(N=this.state.xAxisMap)===null||N===void 0||(N=N[_])===null||N===void 0?void 0:N.scale}},{key:"getYScaleByAxisId",value:function(_){var N;return(N=this.state.yAxisMap)===null||N===void 0||(N=N[_])===null||N===void 0?void 0:N.scale}},{key:"getItemByXY",value:function(_){var N=this.state,S=N.formattedGraphicalItems,k=N.activeItem;if(S&&S.length)for(var C=0,O=S.length;C<O;C++){var R=S[C],A=R.props,P=R.item,E=P.type.defaultProps!==void 0?we(we({},P.type.defaultProps),P.props):P.props,T=Bi(P.type);if(T==="Bar"){var $=(A.data||[]).find(function(H){return yoe(_,H)});if($)return{graphicalItem:R,payload:$}}else if(T==="RadialBar"){var D=(A.data||[]).find(function(H){return H4(_,H)});if(D)return{graphicalItem:R,payload:D}}else if(_y(R,k)||jy(R,k)||kf(R,k)){var W=qle({graphicalItem:R,activeTooltipItem:k,itemData:E.data}),U=E.activeIndex===void 0?W:E.activeIndex;return{graphicalItem:we(we({},R),{},{childIndex:U}),payload:kf(R,k)?E.data[W]:R.props.data[W]}}}return null}},{key:"render",value:function(){var _=this;if(!tP(this))return null;var N=this.props,S=N.children,k=N.className,C=N.width,O=N.height,R=N.style,A=N.compact,P=N.title,E=N.desc,T=qI(N,yfe),$=lt(T,!1);if(A)return oe.createElement(bI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},oe.createElement(i1,ic({},$,{width:C,height:O,title:P,desc:E}),this.renderClipPath(),nP(S,this.renderMap)));if(this.props.accessibilityLayer){var D,W;$.tabIndex=(D=this.props.tabIndex)!==null&&D!==void 0?D:0,$.role=(W=this.props.role)!==null&&W!==void 0?W:"application",$.onKeyDown=function(H){_.accessibilityManager.keyboardEvent(H)},$.onFocus=function(){_.accessibilityManager.focus()}}var U=this.parseEventsOfWrapper();return oe.createElement(bI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},oe.createElement("div",ic({className:xt("recharts-wrapper",k),style:we({position:"relative",curs
482or:"default",width:C,height:O},R)},U,{ref:function(K){_.container=K}}),oe.createElement(i1,ic({},$,{width:C,height:O,title:P,desc:E,style:Rfe}),this.renderClipPath(),nP(S,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(I.Component);ct(x,"displayName",r),ct(x,"defaultProps",we({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),ct(x,"getDerivedStateFromProps",function(v,b){var w=v.dataKey,_=v.data,N=v.children,S=v.width,k=v.height,C=v.layout,O=v.stackOffset,R=v.margin,A=b.dataStartIndex,P=b.dataEndIndex;if(b.updateId===void 0){var E=UI(v);return we(we(we({},E),{},{updateId:0},p(we(we({props:v},E),{},{updateId:0}),b)),{},{prevDataKey:w,prevData:_,prevWidth:S,prevHeight:k,prevLayout:C,prevStackOffset:O,prevMargin:R,prevChildren:N})}if(w!==b.prevDataKey||_!==b.prevData||S!==b.prevWidth||k!==b.prevHeight||C!==b.prevLayout||O!==b.prevStackOffset||!oc(R,b.prevMargin)){var T=UI(v),$={chartX:b.chartX,chartY:b.chartY,isTooltipActive:b.isTooltipActive},D=we(we({},zI(b,_,C)),{},{updateId:b.updateId+1}),W=we(we(we({},T),$),D);return we(we(we({},W),p(we({props:v},W),b)),{},{prevDataKey:w,prevData:_,prevWidth:S,prevHeight:k,prevLayout:C,prevStackOffset:O,prevMargin:R,prevChildren:N})}if(!n1(N,b.prevChildren)){var U,H,K,q,L=zn(N,Hc),V=L&&(U=(H=L.props)===null||H===void 0?void 0:H.startIndex)!==null&&U!==void 0?U:A,z=L&&(K=(q=L.props)===null||q===void 0?void 0:q.endIndex)!==null&&K!==void 0?K:P,Z=V!==A||z!==P,re=!yt(_),G=re&&!Z?b.updateId:b.updateId+1;return we(we({updateId:G},p(we(we({props:v},b),{},{updateId:G,dataStartIndex:V,dataEndIndex:z}),b)),{},{prevChildren:N,dataStartIndex:V,dataEndIndex:z})}return null}),ct(x,"renderActiveDot",function(v,b,w){var _;return I.isValidElement(v)?_=I.cloneElement(v,b):ht(v)?_=v(b):_=oe.createElement(yy,b),oe.createElement(At,{className:"recharts-active-dot",key:w},_)});var y=I.forwardRef(function(b,w){return oe.createElement(x,ic({},b,{ref:w}))});return y.displayName=x.displayName,y},Hfe=gk({chartName:"LineChart",GraphicalChild:sh,axisComponents:[{axisType:"xAxis",AxisComp:fi},{axisType:"yAxis",AxisComp:hi}],formatAxisMap:Y5}),oh=gk({chartName:"BarChart",GraphicalChild:Qn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:fi},{axisType:"yAxis",AxisComp:hi}],formatAxisMap:Y5}),Hs=gk({chartName:"PieChart",GraphicalChild:ln,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:wy},{axisType:"radiusAxis",AxisComp:xy}],formatAxisMap:Tae,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function za(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 tl(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const E6=6048e5,Vfe=864e5,P6=6e4,T6=36e5;let Wfe={};function Ey(){return Wfe}function Af(e,t){var l,c,f,h;const r=Ey(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,i=za(e),s=i.getDay(),o=(s<n?7:0)+s-n;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Cg(e){return Af(e,{weekStartsOn:1})}function A6(e){const t=za(e),r=t.getFullYear(),n=tl(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const i=Cg(n),s=tl(e,0);s.setFullYear(r,0,4),s.setHours(0,0,0,0);const o=Cg(s);return t.getTime()>=i.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function VI(e){const t=za(e);return t.setHours(0,0,0,0),t}function WI(e){const t=za(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Kfe(e,t){const r=VI(e),n=VI(t),i=+r-WI(r),s=+n-WI(n);return Math.round((i-s)/Vfe)}function Gfe(e){const t=A6(e),r=tl(e,0);
vendor: 18,440 bytes, line 482
482return r.setFullYear(t,0,4),r.setHours(0,0,0,0),Cg(r)}function Yfe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Qfe(e){if(!Yfe(e)&&typeof e!="number")return!1;const t=za(e);return!isNaN(Number(t))}function Xfe(e){const t=za(e),r=tl(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Zfe={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"}},Jfe=(e,t,r)=>{let n;const i=Zfe[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Z_(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const ehe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},the={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rhe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nhe={date:Z_({formats:ehe,defaultWidth:"full"}),time:Z_({formats:the,defaultWidth:"full"}),dateTime:Z_({formats:rhe,defaultWidth:"full"})},ahe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ihe=(e,t,r,n)=>ahe[e];function xd(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;i=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[l]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const she={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ohe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lhe={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"]},che={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","Friday","Saturday"]},uhe={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"}},dhe={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"}},fhe=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},hhe={ordinalNumber:fhe,era:xd({values:she,defaultWidth:"wide"}),quarter:xd({values:ohe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:xd({values:lhe,defaultWidth:"wide"}),day:xd({values:che,defaultWidth:"wide"}),dayPeriod:xd({values:uhe,defaultWidth:"wide",formattingValues:dhe,defaultFormattingWidth:"wide"})};function bd(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?phe(l,d=>d.test(o)):mhe(l,d=>d.test(o));let f;f=e.valueCallback?e.valueCallback(c):c,f=r.valueCallback?r.valueCallback(f):f;const h=t.slice(o.length);return{value:f,rest:h}}}function mhe(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function phe(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function ghe(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(i.length);return{value:o,rest:l}}}const yhe=/^(\d+)(th|st|nd|rd)?/i,vhe=/\d+/i,xhe={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},bhe={any:[/^b/i,/^(a|c)/i]},whe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_he={any:[/1/i,/2/i,/3/i,/4/i]},jhe={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},Nhe={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]},She={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},khe={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]},Che={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},Fhe={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}},Ohe={ordinalNumber:ghe({matchPattern:yhe,parsePattern:vhe,valueCallback:e=>parseInt(e,10)}),era:bd({matchPatterns:xhe,defaultMatchWidth:"wide",parsePatterns:bhe,defaultParseWidth:"any"}),quarter:bd({matchPatterns:whe,defaultMatchWidth:"wide",parsePatterns:_he,defaultParseWidth:"any",valueCallback:e=>e+1}),month:bd({matchPatterns:jhe,defaultMatchWidth:"wide",parsePatterns:Nhe,defaultParseWidth:"any"}),day:bd({matchPatterns:She,defaultMatchWidth:"wide",parsePatterns:khe,defaultParseWidth:"any"}),dayPeriod:bd({matchPatterns:Che,defaultMatchWidth:"any",parsePatterns:Fhe,defaultParseWidth:"any"})},Ehe={code:"en-US",formatDistance:Jfe,formatLong:nhe,formatRelative:ihe,localize:hhe,match:Ohe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Phe(e){const t=za(e);return Kfe(t,Xfe(t))+1}function The(e){const t=za(e),r=+Cg(t)-+Gfe(t);return Math.round(r/E6)+1}function R6(e,t){var h,d,m,p;const r=za(e),n=r.getFullYear(),i=Ey(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(m=i.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=tl(e,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const l=Af(o,t),c=tl(e,0);c.setFullYear(n,0,s),c.setHours(0,0,0,0);const f=Af(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function Ahe(e,t){var l,c,f,h;const r=Ey(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=R6(e,t),s=tl(e,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),Af(s,t)}function Rhe(e,t){const r=za(e),n=+Af(r,t)-+Ahe(r,t);return Math.round(n/E6)+1}function zt(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const _s={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return zt(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):zt(r+1,2)},d(e,t){return zt(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return zt(e.getHours()%12||12,t.length)},H(e,t){return zt(e.getHours(),t.length)},m(e,t){return zt(e.getMinutes(),t.length)},s(e,t){return zt(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return zt(i,t.length)}},Wl={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},KI={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return _s.y(e,t)},Y:function(e,t,r,n){const i=R6(e,n),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return zt(o,2)}return t==="Yo"?r.ordinalNumber(s,{unit:"year"}):zt(s,t.length)},R:function(e,t){const r=A6(e);return zt(r,t.length)},u:function(e,t){const r=e.getFullYear();return zt(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return zt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return zt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return _s.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return zt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=Rhe(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):zt(i,t.length)},I:function(e,t,r){const n=The(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):zt(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):_s.d(e,t)},D:function(e,t,r){const n=Phe(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):zt(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return zt(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return zt(s,t.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return zt(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=Wl.noon:n===0?i=Wl.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=Wl.evening:n>=12?i=Wl.afternoon:n>=4?i=Wl.morning:i=Wl.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return _s.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):_s.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):zt(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):zt(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):_s.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):_s.s(e,t)},S:function(e,t){return _s.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return YI(n);case"XXXX":case"XX":return jo(n);case"XXXXX":case"XXX":default:return jo(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return YI(n);case"xxxx":case"xx":return jo(n);case"xxxxx":case"xxx":default:return jo(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+GI(n,":");case"OOOO":default:return"GMT"+jo(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+GI(n,":");case"zzzz":default:return"GMT"+jo(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return zt(n,t.length)},T:function(e,t,r){const n=e.getTime();return zt(n,t.length)}};function GI(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),s=n%60;return s===0?r+String(i):r+String(i)+t+zt(s,2)}function YI(e,t){return e%60===0?(e>0?"-":"+")+zt(Math.abs(e)/60,2):jo(e,t)}function jo(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=zt(Math.trunc(n/60),2),s=zt(n%60,2);return r+i+t+s}const QI=(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"})}},I6=(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"})}},Ihe=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return QI(e,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",QI(n,t)).replace("{{time}}",I6(i,t))},Mhe={p:I6,P:Ihe},Lhe=/^D+$/,Dhe=/^Y+$/,$he=["D","DD","YY","YYYY"];function qhe(e){return Lhe.test(e)}function Bhe(e){return Dhe.test(e)}function zhe(e,t,r){const n=Uhe(e,t,r);if(console.warn(n),$he.includes(e))throw new RangeError(n)}function Uhe(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Hhe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Vhe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Whe=/^'([^]*?)'?$/,Khe=/''/g,Ghe=/[a-zA-Z]/;function Yhe(e,t,r){var h,d,m,p;const n=Ey(),i=n.locale??Ehe,s=n.firstWeekContainsDate??((d=(h=n.locale)==null?void 0:h.options)==null?void 0:d.firstWeekContainsDate)??1,o=n.weekStartsOn??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,l=za(e);if(!Qfe(l))throw new RangeError("Invalid time value");let c=t.match(Vhe).map(x=>{const y=x[0];if(y==="p"||y==="P"){const v=Mhe[y];return v(x,i.formatLong)}return x}).join("").match(Hhe).map(x=>
vendor: 3,803 bytes, line 482
482{if(x==="''")return{isToken:!1,value:"'"};const y=x[0];if(y==="'")return{isToken:!1,value:Qhe(x)};if(KI[y])return{isToken:!0,value:x};if(y.match(Ghe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:x}});i.localize.preprocessor&&(c=i.localize.preprocessor(l,c));const f={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return c.map(x=>{if(!x.isToken)return x.value;const y=x.value;(Bhe(y)||qhe(y))&&zhe(y,t,String(e));const v=KI[y[0]];return v(l,y,i.localize,f)}).join("")}function Qhe(e){const t=e.match(Whe);return t?t[1].replace(Khe,"'"):e}function Xhe(e,t){const n=tme(e);let i;if(n.date){const c=rme(n.date,2);i=nme(c.restDateString,c.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);const s=i.getTime();let o=0,l;if(n.time&&(o=ame(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(l=ime(n.timezone),isNaN(l))return new Date(NaN)}else{const c=new Date(s+o),f=new Date(0);return f.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),f.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),f}return new Date(s+o+l)}const Hm={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Zhe=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Jhe=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,eme=/^([+-])(\d{2})(?::?(\d{2}))?$/;function tme(e){const t={},r=e.split(Hm.dateTimeDelimiter);let n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],Hm.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Hm.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){const i=Hm.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function rme(e,t){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:s===null?i:s*100,restDateString:e.slice((n[1]||n[2]).length)}}function nme(e,t){if(t===null)return new Date(NaN);const r=e.match(Zhe);if(!r)return new Date(NaN);const n=!!r[4],i=wd(r[1]),s=wd(r[2])-1,o=wd(r[3]),l=wd(r[4]),c=wd(r[5])-1;if(n)return ume(t,l,c)?sme(t,l,c):new Date(NaN);{const f=new Date(0);return!lme(t,s,o)||!cme(t,i)?new Date(NaN):(f.setUTCFullYear(t,s,Math.max(i,o)),f)}}function wd(e){return e?parseInt(e):1}function ame(e){const t=e.match(Jhe);if(!t)return NaN;const r=J_(t[1]),n=J_(t[2]),i=J_(t[3]);return dme(r,n,i)?r*T6+n*P6+i*1e3:NaN}function J_(e){return e&&parseFloat(e.replace(",","."))||0}function ime(e){if(e==="Z")return 0;const t=e.match(eme);if(!t)return 0;const r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return fme(n,i)?r*(n*T6+i*P6):NaN}function sme(e,t,r){const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,s=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+s),n}const ome=[31,null,31,30,31,30,31,31,30,31,30,31];function M6(e){return e%400===0||e%4===0&&e%100!==0}function lme(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(ome[t]||(M6(e)?29:28))}function cme(e,t){return t>=1&&t<=(M6(e)?366:365)}function ume(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function dme(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function fme(e,t){return t>=0&&t<=59}function XI(e){if(!e)return null;try{const t=typeof e=="string"?Xhe(e.slice(0,10)):new Date(e);return Yhe(t,"yyyy-MM")}catch{return null}}const hme=({active:e,payload:t,label:r})=>!e||!(t!=null&&t.length)?null:a.jsxs("div",{className:"bg-gray-900 border border-gray-600 rounded-lg p-3 text-xs space-y-1",children:[a.jsx("p",{className:"text-gray-300 font-semibold mb-1",children:r}),t.map(n=>a.jsxs("p",{style:{color:n.color},children:[n.name,":NT$ ",(n.value||0).toLocaleString()]},n.name))]});
482function mme({receivableItems:e,payableItems:t}){const r=I.useMemo(()=>{const n={};return e.forEach(i=>{const s=XI(i.date);s&&(n[s]||(n[s]={month:s,應收:0,應付:0}),n[s].應收+=i.total||0)}),t.forEach(i=>{const s=XI(i.date);s&&(n[s]||(n[s]={month:s,應收:0,應付:0}),n[s].應付+=i.total||0)}),Object.values(n).sort((i,s)=>i.month.localeCompare(s.month)).slice(-12).map(i=>({...i,month:i.month.slice(0,7)}))},[e,t]);return r.length===0?a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 flex items-center justify-center h-48",children:a.jsx("p",{className:"text-gray-500 text-sm",children:"暫無月度資料"})}):a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-5",children:[a.jsx("h2",{className:"text-sm font-semibold text-[#00FFFF] mb-4 tracking-wide uppercase",children:"月度現金流量概覽(最近 12 個月)"}),a.jsx(En,{width:"100%",height:280,children:a.jsxs(oh,{data:r,margin:{top:5,right:20,left:10,bottom:5},children:[a.jsx(el,{strokeDasharray:"3 3",stroke:"rgba(255,255,255,0.06)"}),a.jsx(fi,{dataKey:"month",tick:{fill:"#9CA3AF",fontSize:11},axisLine:{stroke:"#374151"},tickLine:!1}
482),a.jsx(hi,{tick:{fill:"#9CA3AF",fontSize:11},axisLine:!1,tickLine:!1,tickFormatter:n=>n>=1e3?`${(n/1e3).toFixed(0)}k`:n}),a.jsx(fr,{content:a.jsx(hme,{}),cursor:{fill:"rgba(255,255,255,0.04)"}}),a.jsx(zi,{wrapperStyle:{fontSize:12,color:"#9CA3AF",paddingTop:8}}),a.jsx(Qn,{dataKey:"應收",fill:"#00FFFF",radius:[3,3,0,0],maxBarSize:36}),a.jsx(Qn,{dataKey:"應付",fill:"#FF6B6B",radius:[3,3,0,0],maxBarSize:36})]})})]})}function pme(){return a.jsx(Kg,{requiredRole:"admin",children:a.jsx(yme,{})})}const gme=[{key:"receivable",label:"應收帳款"},{key:"payable",label:"應付帳款"},{key:"unpaid",label:"未收款明細"},{key:"collected",label:"已收款明細"},{key:"all_transactions",label:"收付款明細"}];function yme(){const[e,t]=I.useState("receivable"),[r,n]=I.useState(""),[i,s]=I.useState("all"),[o,l]=I.useState(""),[c,f]=I.useState(""),[h,d]=I.useState("all"),{data:m=[]}=Te({queryKey:["software_invoices"],queryFn:()=>ee.entities.SoftwareInvoice.list()}),{data:p=[]}=Te({queryKey:["course_invoices"],queryFn:()=>ee.entities.CourseInvoice.list()}),{data:x=[]}=Te({queryKey:["course_registrations"],queryFn:()=>ee.entities.CourseRegistration.list()}),{data:y=[]}=Te({queryKey:["online_course_sales"],queryFn:()=>ee.entities.OnlineCourseSale.list()}),{data:v=[]}=Te({queryKey:["salary_payments"],queryFn:()=>ee.entities.SalaryPayment.list()}),{data:b=[]}=Te({queryKey:["instructor_payments"],queryFn:()=>ee.entities.InstructorPayment.list()}),{data:w=[]}=Te({queryKey:["contract_costs"],queryFn:()=>ee.entities.ContractCost.list()}),{data:_=[]}=Te({queryKey:["payrolls"],queryFn:()=>ee.entities.Payroll.list()}),N=I.useMemo(()=>{const U=[];return m.forEach(H=>{U.push({id:H.id,source:"軟體專案請款",name:H.project_name||H.invoice_number,counterparty:H.vendor_name||"—",total:H.invoice_amount||0,received:H.received_amount||0,outstanding:H.outstanding_amount||H.invoice_amount-(H.received_amount||0),date:H.invoice_date,due_date:H.due_date,status:H.status,type:"receivable"})}),p.forEach(H=>{U.push({id:H.id,source:"企業培訓請款",name:H.training_name||H.course_name||H.invoice_number,counterparty:H.client_company||"—",total:H.invoice_amount||0,received:H.received_amount||0,outstanding:H.outstanding_amount||H.invoice_amount-(H.received_amount||0),date:H.invoice_date,due_date:H.due_date,status:H.status,type:"receivable"})}),x.forEach(H=>{U.push({id:H.id,source:"課程報名收款",name:H.applicant_name,counterparty:H.company_school_name||"個人",total:H.payment_amount||0,received:H.payment_status==="paid"?H.payment_amount||0:H.deposit_amount||0,outstanding:H.unpaid_amount||H.payment_amount-(H.deposit_amount||0),date:H.registration_date,due_date:null,status:H.payment_status,type:"receivable"})}),y.forEach(H=>{U.push({id:H.id,source:"線上課程銷售",name:H.course_name,counterparty:H.student_name,total:H.purchase_amount||0,received:H.payment_status==="completed"&&H.purchase_amount||0,outstanding:H.payment_status==="completed"?0:H.purchase_amount||0,date:H.purchase_date,due_date:null,status:H.payment_status,type:"receivable"})}),U},[m,p,x,y]),S=I.useMemo(()=>{const U=[];return v.forEach(H=>{const K=H.status==="paid"||H.status==="confirmed",q=H.amount||0;U.push({id:H.id,source:"薪資支領",name:H.employee_name||"—",counterparty:H.employee_name||"—",total:q,paid:K?q:0,outstanding:K?0:q,date:H.payment_date,status:K?"paid":H.status,type:"payable"})}),b.forEach(H=>{U.push({id:H.id,source:"講師費",name:H.instructor_name,counterparty:H.instructor_name,total:H.total_payment_amount||0,paid:H.paid_amount||0,outstanding:H.unpaid_amount||H.total_payment_amount-(H.paid_amount||0),date:H.payment_date,status:H.status,type:"payable"})}
482),w.forEach(H=>{U.push({id:H.id,source:"合約成本",name:H.cost_item_name,counterparty:H.vendor_name||"—",total:H.cost_amount||0,paid:H.payment_status==="paid"&&H.cost_amount||0,outstanding:H.payment_status==="paid"?0:H.cost_amount||0,date:H.payment_date,status:H.payment_status,type:"payable"})}),_.forEach(H=>{U.push({id:H.id,source:"薪酬管理",name:H.employee_name,counterparty:H.employee_name,total:H.total_payroll_amount||0,paid:H.paid_amount||0,outstanding:H.unpaid_amount||H.total_payroll_amount-(H.paid_amount||0),date:null,status:H.status,type:"payable"})}),U},[v,b,w,_]),k=N.reduce((U,H)=>U+H.total,0),C=N.reduce((U,H)=>U+H.received,0),O=N.reduce((U,H)=>U+Math.max(0,H.outstanding),0),R=S.reduce((U,H)=>U+H.total,0),A=S.reduce((U,H)=>U+H.paid,0),P=S.reduce((U,H)=>U+Math.max(0,H.outstanding),0),E=["軟體專案請款","企業培訓請款","課程報名收款","線上課程銷售","薪資支領","講師費","合約成本","薪酬管理"],T=U=>U.filter(H=>{var G,X,ie;const K=r.toLowerCase(),q=!K||((G=H.name)==null?void 0:G.toLowerCase().includes(K))||((X=H.counterparty)==null?void 0:X.toLowerCase().includes(K))||((ie=H.source)==null?void 0:ie.toLowerCase().includes(K)),L=i==="all"||H.status===i,V=h==="all"||H.source===h,z=H.date?new Date(H.date):null,Z=!o||z&&z>=new Date(o),re=!c||z&&z<=new Date(c);return q&&L&&V&&Z&&re}),$=I.useMemo(()=>{const U=N.filter(K=>K.status==="cancelled"||K.status==="terminated"||K.source==="課程報名收款"&&K.status==="refunded"?!1:K.outstanding>0);return{receivable:T(N),payable:T(S),unpaid:T(U),collected:T(N.filter(K=>K.received>0)),all_transactions:T([...N.map(K=>({...K,direction:"收款"})),...S.map(K=>({...K,direction:"付款",received:K.paid,outstanding:K.outstanding}))])}},[N,S,r,i,o,c]),D=U=>({draft:{label:"草稿",color:"bg-gray-700 text-gray-300"},pending:{label:"待付款",color:"bg-yellow-900 text-yellow-300"},sent:{label:"已發送",color:"bg-blue-900 text-blue-300"},paid:{label:"已付款",color:"bg-green-900 text-green-300"},completed:{label:"已完成",color:"bg-green-900 text-green-300"},cancelled:{label:"已取消",color:"bg-red-900 text-red-300"},unpaid:{label:"未付款",color:"bg-red-900 text-red-300"},partial:{label:"部分付款",color:"bg-orange-900 text-orange-300"},confirmed:{label:"已確認",color:"bg-cyan-900 text-cyan-300"},refunded:{label:"已退款",color:"bg-purple-900 text-purple-300"}})[U]||{label:U||"—",color:"bg-gray-700 text-gray-300"},W=$[e]||[];return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"帳款管理"}),a.jsx(mme,{receivableItems:N,payableItems:S}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[a.jsx(Kl,{icon:sl,color:"#00FFFF",label:"應收總額",value:k}),a.jsx(Kl,{icon:xr,color:"#00FF00",label:"已收款",value:C}),a.jsx(Kl,{icon:Ra,color:"#FF4444",label:"應收未收",value:O}),a.jsx(Kl,{icon:EL,color:"#FF8C00",label:"應付總額",value:R}),a.jsx(Kl,{icon:xr,color:"#9370DB",label:"已付款",value:A}),a.jsx(Kl,{icon:Ra,color:"#FF6B6B",label:"應付未付",value:P})]}),a.jsx("div",{className:"flex flex-wrap gap-2 border-b border-gray-700 pb-2",children:gme.map(U=>a.jsxs("button",{onClick:()=>t(U.key),className:`px-4 py-2 rounded-t text-sm font-medium transition-all ${e===U.key?"bg-[#00FFFF] text-black":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[U.label,a.jsxs("span",{className:"ml-2 text-xs opacity-70",children:["(",($[U.key]||[]).length,")"]})]},U.key))}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 flex flex-wrap gap-3 items-center",children:[a.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{value:r,onChange:U=>n(U.target.value),placeholder:"搜尋名稱、對象、來源...",className:"pl-9 bg-black border-gray-700"})]}),a.jsxs("select",{value:i,onChange:U=>s(U.target.value),className:"bg-black border border-gray-700 rounded px-3 py-2 text-white text-sm",children:[a.jsx("option",{value:"all",children:"所有狀態"}),a.jsx("option",{value:"pending",children:"待付款"}),a.jsx("option",{value:"paid",children:"已付款"}),a.jsx("option",{value:"completed",children:"已完成"}),a.jsx("option",{value:"partial",children:"部分付款"}),a.jsx("option",{value:"unpaid",children:"未付款"}),a.jsx("option",{value:"cancelled",children:"已取消"})]}),a.jsx(ne,{type:"date",value:o,onChange:U=>l(U.target.value),className:"bg-black border-gray-700 w-36"}),a.jsx("span",{className:"text-gray-500",children:"—"}),a.jsx(ne,{type:"date",value:c,onChange:U=>f(U.target.value),className:"bg-black border-gray-700 w-36"}),a.jsxs("select",{value:h,onChange:U=>d(U.target.value),className:"bg-black border border-gray-700 rounded px-3 py-2 text-white text-sm",children:[a.jsx("option",{value:"all",children:"所有來源"}),E.map(U=>a.jsx("option",{value:U,children:U},U))]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{n(""),s("all"),d("all"),l(""),f("")},className:"bg-gray-800 text-white border-gray-600 hover:bg-gray-700",children:"重置"})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-gray-700 text-gray-400 text-xs uppercase",children:[a.jsx("th",{className:"text-left px-4 py-3",children:"來源"}),a.jsx("th",{className:"text-left px-4 py-3",children:"名稱"}),a.jsx("th",{className:"text-left px-4 py-3",children:"往來對象"}),e==="all_transactions"&&a.jsx("th",{className:"text-left px-4 py-3",children:"方向"}),a.jsx("th",{className:"text-right px-4 py-3",children:"總金額"}),a.jsx("th",{className:"text-right px-4 py-3",children:e==="payable"?"已付款":"已收款"}),a.jsxs("th",{className:"text-right px-4 py-3",children:["未",e==="payable"?"付":"收","款"]}),a.jsx("th",{className:"text-left px-4 py-3",children:"日期"}),a.jsx("th",{className:"text-left px-4 py-3",children:"狀態"})]})}),a.jsx("tbody",{children:W.length===0?a.jsx("tr",{children:a.jsxs("td",{colSpan:"9",className:"text-center py-12 text-gray-500",children:[a.jsx(Et,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),"暫無資料"]})}):W.map((U,H)=>{const K=D(U.status),q=Math.max(0,U.outstanding??0),L=U.received??U.paid??0;return a.jsxs("tr",{className:"border-b border-gray-800 hover:bg-gray-900/50 transition-colors",children:[a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:"text-xs bg-gray-800 text-gray-300 px-2 py-0.5 rounded",children:U.source})}),a.jsx("td",{className:"px-4 py-3 text-white font-medium max-w-[180px] truncate",children:U.name||"—"}),a.jsx("td",{className:"px-4 py-3 text-gray-400 max-w-[140px] truncate",children:U.counterparty||"—"}),e==="all_transactions"&&a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`text-xs px-2 py-0.5 rounded font-semibold ${U.direction==="收款"?"bg-green-900 text-green-300":"bg-red-900 text-red-300"}`,children:U.direction})}),a.jsxs("td",{className:"px-4 py-3 text-right text-white",children:["NT$ ",(U.total||0).toLocaleStr
482ing()]}),a.jsxs("td",{className:"px-4 py-3 text-right text-green-400",children:["NT$ ",L.toLocaleString()]}),a.jsx("td",{className:`px-4 py-3 text-right font-semibold ${q>0?"text-red-400":"text-gray-500"}`,children:q>0?`NT$ ${q.toLocaleString()}`:"—"}),a.jsx("td",{className:"px-4 py-3 text-gray-400 text-xs",children:U.date?U.date.slice(0,10):"—"}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${K.color}`,children:K.label})})]},`${U.id}-${H}`)})}),W.length>0&&a.jsx("tfoot",{children:a.jsxs("tr",{className:"border-t border-gray-600 bg-gray-900/60",children:[a.jsxs("td",{colSpan:e==="all_transactions"?4:3,className:"px-4 py-3 text-gray-400 text-xs font-semibold",children:["合計(",W.length," 筆)"]}),a.jsxs("td",{className:"px-4 py-3 text-right text-white font-bold",children:["NT$ ",W.reduce((U,H)=>U+(H.total||0),0).toLocaleString()]}),a.jsxs("td",{className:"px-4 py-3 text-right text-green-400 font-bold",children:["NT$ ",W.reduce((U,H)=>U+(H.received??H.paid??0),0).toLocaleString()]}),a.jsxs("td",{className:"px-4 py-3 text-right text-red-400 font-bold",children:["NT$ ",W.reduce((U,H)=>U+Math.max(0,H.outstanding??0),0).toLocaleString()]}),a.jsx("td",{colSpan:"2"})]})})]})})})]})}function Kl({icon:e,color:t,label:r,value:n}){return a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 hover-glow",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx(e,{className:"w-4 h-4",style:{color:t}}),a.jsx("span",{className:"text-gray-400 text-xs",children:r})]}),a.jsxs("p",{className:"text-lg font-bold",style:{color:t},children:["NT$ ",(n||0).toLocaleString()]})]})}var vme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Kt=vme.reduce((e,t)=>{const r=Qd(`Primitive.${t}`),n=I.forwardRef((i,s)=>{const{asChild:o,...l}=i,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function xme(e,t){e&&Hf.flushSync(()=>e.dispatchEvent(t))}var bme="Label",L6=I.forwardRef((e,t)=>a.jsx(Kt.label,{...e,ref:t,onMouseDown:r=>{var i;r.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));L6.displayName=bme;var D6=L6;const wme=Dg("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Q=I.forwardRef(({className:e,...t},r)=>a.jsx(D6,{ref:r,className:Vt(wme(),e),...t}));Q.displayName=D6.displayName;const Pt=I.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:Vt("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));Pt.displayName="Textarea";function _me({card:e,onClose:t}){const[r,n]=I.useState({full_name:"",title:"",company_name:"",phone:"",email:"",address:"",website:"",card_image_url:"",notes:"",...e}),[i,s]=I.useState(!1),[o,l]=I.useState(!1),c=at(),f=Ye({mutationFn:m=>e?ee.entities.BusinessCard.update(e.id,m):ee.entities.BusinessCard.create(m),onSuccess:()=>{c.invalidateQueries(["businessCards"]),alert("儲存成功!"),t()}}),h=async m=>{const p=m.target.files[0];if(p)try{s(!0);const{file_url:x}=await ee.integrations.Core.UploadFile({file:p});n(v=>({...v,card_image_url:x})),l(!0);const y=await ee.integrations.Core.ExtractDataFromUploadedFile({file_url:x,json_schema:{type:"object",properties:{full_name:{type:"string",description:"姓名"},title:{type:"string",description:"職稱"},company_name:{type:"string",description:"公司名稱"},phone:{type:"string",description:"電話或手機號碼"},email:{type:"string",description:"Email地址"},address:{type:"string",description:"公司地址"},website:{type:"string",description:"公司網址"}}}});if(y.status==="success"&&y.output){const v=y.output;n(b=>({...b,full_name:v.full_name||b.full_name,title:v.title||b.title,company_name:v.company_name||b.company_name,phone:v.phone||b.phone,email:v.email||b.email,address:v.address||b.address,website:v.website||b.website}))}}catch(x){console.error("OCR/Upload failed:",x),alert("圖片處理失敗,請手動輸入")}finally{s(!1),l(!1)}},d=m=>{m.preventDefault(),f.mutate(r)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯名片":"新增名片"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:d,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"名片圖片 (OCR 自動辨識)"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:()=>document.getElementById("card-upload").click(),className:"bg-gray-800 border-gray-700 hover:bg-gray-700 h-24 w-full border-dashed border-2 flex flex-col gap-2",disabled:i||o,children:o?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-8 h-8 animate-spin text-[#00FFFF]"}),a.jsx("span",{className:"text-[#00FFFF]",children:"正在辨識文字..."})]}):i?a.jsxs(a.Fragment,{children:[a.jsx(Ht,{className:"w-8 h-8 animate-spin"}),a.jsx("span",{children:"上傳中..."})]}):a.jsxs(a.Fragment,{children:[a.jsx(Mz,{className:"w-8 h-8 text-gray-400"}),a.jsx("span",{className:"text-gray-400",children:"點擊上傳或拍攝名片"})]})}),a.jsx(ne,{id:"card-upload",type:"file",accept:"image/*",className:"hidden",onChange:h})]}),r.card_image_url&&!i&&!o&&a.jsx("div",{className:"mt-2 relative w-full h-48 bg-gray-900 rounded-lg overflow-hidden border border-gray-700",children:a.jsx("img",{src:r.card_image_url,alt:"Card Preview",className:"w-full h-full object-contain"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"姓名 *"}),a.jsx(ne,{required:!0,value:r.full_name,onChange:m=>n({...r,full_name:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"職稱"}),a.jsx(ne,{value:r.title,onChange:m=>n({...r,title:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"公司名稱"}),a.jsx(ne,{value:r.company_name,onChange:m=>n({...r,company_name:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"電話"}),a.jsx(ne,{value:r.phone,onChange:m=>n({...r,phone:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Email"}),a.jsx(ne,{value:r.email,onChange:m=>n({...r,email:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"網站"}),a.jsx(ne,{value:r.website,onChange:m=>n({...r,website:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"地址"}),a.jsx(ne,{value:r.address,onChange:m=>n({...r,address:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:r.notes,onChange:m=>n({...r,notes:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-[#8B0000] text-white border-[#8B0000] hover:bg-[#660000]",children:"取消"}),a.jsx(te,{type:"submit",disabled:f.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:f.isPending?"儲存中...":"儲存"})]})]})]})})}
482function jme(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(""),o=at(),{data:l=[],isLoading:c}=Te({queryKey:["businessCards"],queryFn:()=>ee.entities.BusinessCard.list("-created_date")}),f=Ye({mutationFn:d=>ee.entities.BusinessCard.delete(d),onSuccess:()=>{o.invalidateQueries(["businessCards"])}}),h=l.filter(d=>{var m,p,x;return((m=d.full_name)==null?void 0:m.toLowerCase().includes(i.toLowerCase()))||((p=d.company_name)==null?void 0:p.toLowerCase().includes(i.toLowerCase()))||((x=d.title)==null?void 0:x.toLowerCase().includes(i.toLowerCase()))});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"名片管理"}),a.jsxs(te,{onClick:()=>{n(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"新增名片"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(ne,{placeholder:"搜尋姓名、公司或職稱...",value:i,onChange:d=>s(d.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]})}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:c?a.jsx("div",{className:"col-span-full text-center py-8 text-gray-400",children:"載入中..."}):h.length===0?a.jsx("div",{className:"col-span-full text-center py-8 text-gray-400",children:"尚無名片資料"}):h.map(d=>a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow flex flex-col gap-4",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 bg-gray-800 rounded-full flex items-center justify-center overflow-hidden border border-gray-700",children:d.card_image_url?a.jsx("img",{src:d.card_image_url,alt:d.full_name,className:"w-full h-full object-cover"}):a.jsx(SL,{className:"w-6 h-6 text-gray-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-bold cyber-text",children:d.full_name}),a.jsx("p",{className:"text-sm text-gray-400",children:d.title})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:()=>{n(d),t(!0)},className:"text-gray-400 hover:text-[#00FFFF]",children:a.jsx(qt,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>{confirm("確認刪除?")&&f.mutate(d.id)},className:"text-gray-400 hover:text-red-500",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"space-y-2 text-sm text-gray-300 border-t border-gray-800 pt-4",children:[a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-500 w-12 inline-block",children:"公司:"})," ",d.company_name||"-"]}),a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-500 w-12 inline-block",children:"電話:"})," ",d.phone||"-"]}),a.jsxs("p",{children:[a.jsx("span",{className:"text-gray-500 w-12 inline-block",children:"Email:"})," ",d.email||"-"]}),a.jsxs("p",{className:"truncate",children:[a.jsx("span",{className:"text-gray-500 w-12 inline-block",children:"地址:"})," ",d.address||"-"]})]})]},d.id))}),e&&a.jsx(_me,{card:r,onClose:()=>{t(!1),n(null)}})]})}function $6({meeting:e,onClose:t,onEdit:r}){const[n,i]=oe.useState(e.meeting_notes||""),[s,o]=oe.useState(!1),[l,c]=oe.useState(e.meeting_record_file_url||""),f=at(),h=Ye({mutationFn:y=>ee.entities.Meeting.update(e.id,{meeting_notes:y}),onSuccess:()=>{f.invalidateQueries(["meetings"]),alert("儲存成功!")}}),d=async y=>{const v=y.target.files[0];if(v){if(v.type!=="application/pdf"){alert("僅接受 PDF 檔案");return}try{o(!0);const{file_url:b}=await ee.integrations.Core.UploadFile({file:v});c(b),await ee.entities.Meeting.update(e.id,{meeting_record_file_url:b}),f.invalidateQueries(["meetings"]),alert("✅ 會議記錄已上傳")}catch(b){console.error(b),alert("上傳失敗")}finally{o(!1)}}},m=async()=>
482{if(!e.participants||e.participants.length===0){alert("沒有參與者可邀請");return}if(!confirm(`確定要發送邀請給 ${e.participants.length} 位參與者?`))return;let y=0;for(const v of e.participants){if(!v.email)continue;const b=`您好 ${v.name},您已被邀請參加會議:
483
484會議主題:${e.meeting_title}
485開始時間:${new Date(e.start_time).toLocaleString("zh-TW")}
486結束時間:${new Date(e.end_time).toLocaleString("zh-TW")}
487${e.meeting_link?`會議連結:${e.meeting_link}`:""}
488      `;try{await ee.integrations.Core.SendEmail({to:v.email,subject:`會議邀請:${e.meeting_title}`,body:b}),y++}catch(w){console.error(w)}}alert(`✅ 發送完成,成功寄出 ${y} 封邀請`)},p=y=>({scheduled:"已排程",in_progress:"進行中",completed:"已完成",cancelled:"已取消"})[y]||y,x=y=>({online:"線上會議",offline:"實體會議",hybrid:"混合會議"})[y]||y;return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"會議詳情"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議主題"}),a.jsx("h3",{className:"text-xl font-bold cyber-text mt-1",children:e.meeting_title})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議類型"}),a.jsxs("div",{className:"text-white mt-1 flex items-center gap-2",children:[e.meeting_type==="online"?a.jsx(wp,{className:"w-4 h-4 text-[#00FFFF]"}):a.jsx(Uo,{className:"w-4 h-4 text-[#FFD700]"}),x(e.meeting_type)]})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"狀態"}),a.jsx("div",{className:"text-white mt-1",children:p(e.status)})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"開始時間"}),a.jsxs("div",{className:"text-white mt-1 flex items-center gap-2",children:[a.jsx(Vs,{className:"w-4 h-4 text-[#00FFFF]"}),new Date(e.start_time).toLocaleString("zh-TW")]})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"結束時間"}),a.jsx("div",{className:"text-white mt-1",children:new Date(e.end_time).toLocaleString("zh-TW")})]})]}),e.organizer&&a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"主持人"}),a.jsx("div",{className:"text-white mt-1",children:e.organizer})]}),e.meeting_link&&a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議連結"}),a.jsxs("a",{href:e.meeting_link,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline flex items-center gap-2 mt-1",children:[a.jsx(il,{className:"w-4 h-4"}),e.meeting_platform?`開啟 ${e.meeting_platform}`:"開啟會議室"]})]}),e.location&&a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議地點"}),a.jsxs("div",{className:"text-white mt-1 flex items-center gap-2",children:[a.jsx(Uo,{className:"w-4 h-4 text-[#FFD700]"}),e.location]})]}),e.agenda&&a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議議程"}),a.jsx("div",{className:"text-white mt-1 bg-gray-900 p-4 rounded border border-gray-700 whitespace-pre-wrap",children:e.agenda})]}),e.participants&&e.participants.length>0&&a.jsxs("div",{children:[a.jsxs(Q,{className:"text-gray-400 flex items-center gap-2",children:[a.jsx(Xr,{className:"w-4 h-4"}),"參與者 (",e.participants.length,")"]}),a.jsx("div",{className:"mt-2 space-y-2",children:e.participants.map((y,v)=>a.jsxs("div",{className:"bg-gray-900 p-3 rounded border border-gray-700 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-white font-medium",children:y.name}),a.jsx("div",{className:"text-gray-400 text-sm",children:y.email})]}),a.jsx("span",{className:`px-2 py-1 rounded text-xs ${y.status==="confirmed"?"bg-green-900 text-green-300":y.status==="declined"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300"}`,children:y.status==="confirmed"?"已確認":y.status==="declined"?"已婉拒":"已邀請"})]},v))})]})]}),a.jsxs("div",{className:"border-t border-gray-700 pt-6 space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議邀請"}),a.jsx("div",{className:"flex gap-2 mt-2",children:a.jsxs(te,{type:"button",onClick:m,className:"bg-blue-900 text-white hover:bg-blue-800 border border-blue-700",children:[a.jsx(sc,{className:"w-4 h-4 mr-2"}),"發送邀請"]})})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議記錄檔案上傳(
488僅接受 PDF)"}),a.jsxs("div",{className:"flex gap-2 mt-2",children:[a.jsx(ne,{type:"file",accept:".pdf",onChange:d,disabled:s,className:"bg-black border-gray-700"}),s&&a.jsx(Ht,{className:"w-5 h-5 animate-spin text-[#00FFFF]"})]}),l&&a.jsxs("a",{href:l,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline flex items-center gap-2 mt-2 text-sm",children:[a.jsx(Et,{className:"w-4 h-4"}),"查看已上傳的會議記錄"]})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議紀錄"}),a.jsx(Pt,{value:n,onChange:y=>i(y.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF] h-32 mt-2",placeholder:"輸入會議紀錄、討論內容、決議事項..."}),a.jsxs(te,{type:"button",onClick:()=>h.mutate(n),disabled:h.isPending,className:"mt-2 bg-gray-800 text-white hover:bg-gray-700 border border-gray-600",children:[h.isPending?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):null,"儲存紀錄"]})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-700",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-gray-800 text-white border-gray-600 hover:bg-gray-700",children:"關閉"}),a.jsxs(te,{type:"button",onClick:r,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(qt,{className:"w-4 h-4 mr-2"}),"編輯會議"]})]})]})]})})}function ZI(e,[t,r]){return Math.min(r,Math.max(t,e))}function Ut(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function lh(e,t=[]){let r=[];function n(s,o){const l=I.createContext(o),c=r.length;r=[...r,o];const f=d=>{var b;const{scope:m,children:p,...x}=d,y=((b=m==null?void 0:m[e])==null?void 0:b[c])||l,v=I.useMemo(()=>x,Object.values(x));return a.jsx(y.Provider,{value:v,children:p})};f.displayName=s+"Provider";function h(d,m){var y;const p=((y=m==null?void 0:m[e])==null?void 0:y[c])||l,x=I.useContext(p);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[f,h]}const i=()=>{const s=r.map(o=>I.createContext(o));return function(l){const c=(l==null?void 0:l[e])||s;return I.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[n,Nme(i,...t)]}function Nme(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((l,{useScope:c,scopeName:f})=>{const d=c(s)[`__scope${f}`];return{...l,...d}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function q6(e){const t=e+"CollectionProvider",[r,n]=lh(t),[i,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=y=>{const{scope:v,children:b}=y,w=oe.useRef(null),_=oe.useRef(new Map).current;return a.jsx(i,{scope:v,itemMap:_,collectionRef:w,children:b})};o.displayName=t;const l=e+"CollectionSlot",c=Qd(l),f=oe.forwardRef((y,v)=>{const{scope:b,children:w}=y,_=s(l,b),N=Ir(v,_.collectionRef);return a.jsx(c,{ref:N,children:w})});f.displayName=l;const h=e+"CollectionItemSlot",d="data-radix-collection-item",m=Qd(h),p=oe.forwardRef((y,v)=>{const{scope:b,children:w,..._}=y,N=oe.useRef(null),S=Ir(v,N),k=s(h,b);return oe.useEffect(()=>(k.itemMap.set(N,{ref:N,..._}),()=>void k.itemMap.delete(N))),a.jsx(m,{[d]:"",ref:S,children:w})});p.displayName=h;function x(y){const v=s(e+"CollectionConsumer",y);return oe.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const _=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((k,C)=>_.indexOf(k.ref.current)-_.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:f,ItemSlot:p},x,n]}var Sme=I.createContext(void 0);function yk(e){const t=I.useContext(Sme);return e||t||"ltr"}function Ws(e){const t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function kme(e,t=globalThis==null?void 0:globalThis.document){const r=Ws(e);I.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Cme="DismissableLayer",_N="dismissableLayer.update",Fme="dismissableLayer.pointerDownOutside",Ome="dismissableLayer.focusOutside",JI,B6=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),z6=I.forwardRef((e,t)=>
vendor: 33,571 bytes, line 488
488{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:l,...c}=e,f=I.useContext(B6),[h,d]=I.useState(null),m=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=I.useState({}),x=Ir(t,C=>d(C)),y=Array.from(f.layers),[v]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=h?y.indexOf(h):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,N=w>=b,S=Tme(C=>{const O=C.target,R=[...f.branches].some(A=>A.contains(O));!N||R||(i==null||i(C),o==null||o(C),C.defaultPrevented||l==null||l())},m),k=Ame(C=>{const O=C.target;[...f.branches].some(A=>A.contains(O))||(s==null||s(C),o==null||o(C),C.defaultPrevented||l==null||l())},m);return kme(C=>{w===f.layers.size-1&&(n==null||n(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},m),I.useEffect(()=>{if(h)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(JI=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),eM(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=JI)}},[h,m,r,f]),I.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),eM())},[h,f]),I.useEffect(()=>{const C=()=>p({});return document.addEventListener(_N,C),()=>document.removeEventListener(_N,C)},[]),a.jsx(Kt.div,{...c,ref:x,style:{pointerEvents:_?N?"auto":"none":void 0,...e.style},onFocusCapture:Ut(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Ut(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Ut(e.onPointerDownCapture,S.onPointerDownCapture)})});z6.displayName=Cme;var Eme="DismissableLayerBranch",Pme=I.forwardRef((e,t)=>{const r=I.useContext(B6),n=I.useRef(null),i=Ir(t,n);return I.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),a.jsx(Kt.div,{...e,ref:i})});Pme.displayName=Eme;function Tme(e,t=globalThis==null?void 0:globalThis.document){const r=Ws(e),n=I.useRef(!1),i=I.useRef(()=>{});return I.useEffect(()=>{const s=l=>{if(l.target&&!n.current){let c=function(){U6(Fme,r,f,{discrete:!0})};const f={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Ame(e,t=globalThis==null?void 0:globalThis.document){const r=Ws(e),n=I.useRef(!1);return I.useEffect(()=>{const i=s=>{s.target&&!n.current&&U6(Ome,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function eM(){const e=new CustomEvent(_N);document.dispatchEvent(e)}function U6(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?xme(i,s):i.dispatchEvent(s)}var ej=0;function Rme(){I.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tM()),document.body.insertAdjacentElement("beforeend",e[1]??tM()),ej++,()=>{ej===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ej--}},[])}function tM(){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 tj="focusScope.autoFocusOnMount",rj="focusScope.autoFocusOnUnmount",rM={bubbles:!1,cancelable:!0},Ime="FocusScope",H6=I.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[l,c]=I.useState(null),f=Ws(i),h=Ws(s),d=I.useRef(null),m=Ir(t,y=>c(y)),p=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(n){let y=function(_){if(p.paused||!l)return;const N=_.target;l.contains(N)?d.current=N:Ss(d.current,{select:!0})},v=function(_){if(p.paused||!l)return;const N=_.relatedTarget;N!==null&&(l.contains(N)||Ss(d.current,{select:!0}))},b=function(_){if(document.activeElement===document.body)for(const S of _)S.removedNodes.length>0&&Ss(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",v);const w=new MutationObserver(b);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",v),w.disconnect()}}},[n,l,p.paused]),I.useEffect(()=>{if(l){aM.add(p);const y=document.activeElement;if(!l.contains(y)){const b=new CustomEvent(tj,rM);l.addEventListener(tj,f),l.dispatchEvent(b),b.defaultPrevented||(Mme(Bme(V6(l)),{select:!0}),document.activeElement===y&&Ss(l))}return()=>{l.removeEventListener(tj,f),setTimeout(()=>{const b=new CustomEvent(rj,rM);l.addEventListener(rj,h),l.dispatchEvent(b),b.defaultPrevented||Ss(y??document.body,{select:!0}),l.removeEventListener(rj,h),aM.remove(p)},0)}}},[l,f,h,p]);const x=I.useCallback(y=>{if(!r&&!n||p.paused)return;const v=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,b=document.activeElement;if(v&&b){const w=y.currentTarget,[_,N]=Lme(w);_&&N?!y.shiftKey&&b===N?(y.preventDefault(),r&&Ss(_,{select:!0})):y.shiftKey&&b===_&&(y.preventDefault(),r&&Ss(N,{select:!0})):b===w&&y.preventDefault()}},[r,n,p.paused]);return a.jsx(Kt.div,{tabIndex:-1,...o,ref:m,onKeyDown:x})});H6.displayName=Ime;function Mme(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ss(n,{select:t}),document.activeElement!==r)return}function Lme(e){const t=V6(e),r=nM(t,e),n=nM(t.reverse(),e);return[r,n]}function V6(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function nM(e,t){for(const r of e)if(!Dme(r,{upTo:t}))return r}function Dme(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 $me(e){return e instanceof HTMLInputElement&&"select"in e}function Ss(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&$me(e)&&t&&e.select()}}var aM=qme();function qme(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=iM(e,t),e.unshift(t)},remove(t){var r;e=iM(e,t),(r=e[0])==null||r.resume()}}}function iM(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Bme(e){return e.filter(t=>t.tagName!=="A")}var cn=globalThis!=null&&globalThis.document?I.useLayoutEffect:()=>{},zme=HN[" useId ".trim().toString()]||(()=>{}),Ume=0;function ch(e){const[t,r]=I.useState(zme());return cn(()=>{r(n=>n??String(Ume++))},[e]),t?`radix-${t}`:""}const Hme=["top","right","bottom","left"],Ks=Math.min,Hn=Math.max,Fg=Math.round,Vm=Math.floor,si=e=>({x:e,y:e}),Vme={left:"right",right:"left",bottom:"top",top:"bottom"},Wme={start:"end",end:"start"};function jN(e,t,r){return Hn(e,Ks(t,r))}function Qi(e,t){return typeof e=="function"?e(t):e}function Xi(e){return e.split("-")[0]}function yu(e){return e.split("-")[1]}function vk(e){return e==="x"?"y":"x"}function xk(e){return e==="y"?"height":"width"}const Kme=new Set(["top","bottom"]);function ri(e){return Kme.has(Xi(e))?"y":"x"}function bk(e){return vk(ri(e))}function Gme(e,t,r){r===void 0&&(r=!1);const n=yu(e),i=bk(e),s=xk(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Og(o)),[o,Og(o)]}function Yme(e){const t=Og(e);return[NN(e),t,NN(t)]}function NN(e){return e.replace(/start|end/g,t=>Wme[t])}const sM=["left","right"],oM=["right","left"],Qme=["top","bottom"],Xme=["bottom","top"];function Zme(e,t,r){switch(e){case"top":case"bottom":return r?t?oM:sM:t?sM:oM;case"left":case"right":return t?Qme:Xme;default:return[]}}function Jme(e,t,r,n){const i=yu(e);let s=Zme(Xi(e),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(NN)))),s}function Og(e){return e.replace(/left|right|bottom|top/g,t=>Vme[t])}function epe(e){return{top:0,right:0,bottom:0,left:0,...e}}function W6(e){return typeof e!="number"?epe(e):{top:e,right:e,bottom:e,left:e}}function Eg(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function lM(e,t,r){let{reference:n,floating:i}=e;const s=ri(t),o=bk(t),l=xk(o),c=Xi(t),f=s==="y",h=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,m=n[l]/2-i[l]/2;let p;switch(c){case"top":p={x:h,y:n.y-i.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}switch(yu(t)){case"start":p[o]-=m*(r&&f?-1:1);break;case"end":p[o]+=m*(r&&f?-1:1);break}return p}const tpe=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,l=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:d}=lM(f,n,c),m=n,p={},x=0;for(let y=0;y<l.length;y++){const{name:v,fn:b}=l[y],{x:w,y:_,data:N,reset:S}=await b({x:h,y:d,initialPlacement:n,placement:m,strategy:i,middlewareData:p,rects:f,platform:o,elements:{reference:e,floating:t}});h=w??h,d=_??d,p={...p,[v]:{...p[v],...N}},S&&x<=50&&(x++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(f=S.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:h,y:d}=lM(f,m,c)),y=-1)}return{x:h,y:d,placement:m,strategy:i,middlewareData:p}};async function Rf(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:m=!1,padding:p=0}=Qi(t,e),x=W6(p),v=l[m?d==="floating"?"reference":"floating":d],b=Eg(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(v)))==null||r?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:h,strategy:c})),w=d==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),N=await(s.isElement==null?void 0:s.isElement(_))?await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1}:{x:1,y:1},S=Eg(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:_,strategy:c}):w);return{top:(b.top-S.top+x.top)/N.y,bottom:(S.bottom-b.bottom+x.bottom)/N.y,left:(b.left-S.left+x.left)/N.x,right:(S.right-b.right+x.right)/N.x}}const rpe=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:f,padding:h=0}=Qi(e,t)||{};if(f==null)return{};const d=W6(h),m={x:r,y:n},p=bk(i),x=xk(p),y=await o.getDimensions(f),v=p==="y",b=v?"top":"left",w=v?"bottom":"right",_=v?"clientHeight":"clientWidth",N=s.reference[x]+s.reference[p]-m[p]-s.floating[x],S=m[p]-s.reference[p],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let C=k?k[_]:0;(!C||!await(o.isElement==null?void 0:o.isElement(k)))&&(C=l.floating[_]||s.floating[x]);const O=N/2-S/2,R=C/2-y[x]/2-1,A=Ks(d[b],R),P=Ks(d[w],R),E=A,T=C-y[x]-P,$=C/2-y[x]/2+O,D=jN(E,$,T),W=!c.arrow&&yu(i)!=null&&$!==D&&s.reference[x]/2-($<E?A:P)-y[x]/2<0,U=W?$<E?$-E:$-T:0;return{[p]:m[p]+U,data:{[p]:D,centerOffset:$-D-U,...W&&{alignmentOffset:U}},reset:W}}}),npe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:s,rects:o,initialPlacement:l,platform:c,elements:f}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...v}=Qi(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const b=Xi(i),w=ri(l),_=Xi(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(f.floating)),S=m||(_||!y?[Og(l)]:Yme(l)),k=x!=="none";!m&&k&&S.push(...Jme(l,y,x,N));const C=[l,...S],O=await Rf(t,v),R=[];let A=((n=s.flip)==null?void 0:n.overflows)||[];if(h&&R.push(O[b]),d){const $=Gme(i,o,N);R.push(O[$[0]],O[$[1]])}if(A=[...A,{placement:i,overflows:R}],!R.every($=>$<=0)){var P,E;const $=(((P=s.flip)==null?void 0:P.index)||0)+1,D=C[$];if(D&&(!(d==="alignment"?w!==ri(D):!1)||A.every(H=>ri(H.placement)===w?H.overflows[0]>0:!0)))return{data:{index:$,overflows:A},reset:{placement:D}};let W=(E=A.filter(U=>U.overflows[0]<=0).sort((U,H)=>U.overflows[1]-H.overflows[1])[0])==null?void 0:E.placement;if(!W)switch(p){case"bestFit":{var T;const U=(T=A.filter(H=>{if(k){const K=ri(H.placement);return K===w||K==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(K=>K>0).reduce((K,q)=>K+q,0)]).sort((H,K)=>H[1]-K[1])[0])==null?void 0:T[0];U&&(W=U);break}case"initialPlacement":W=l;break}if(i!==W)return{reset:{placement:W}}}return{}}}};function cM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uM(e){return Hme.some(t=>e[t]>=0)}const ape=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=Qi(e,t);switch(n){case"referenceHidden":{const s=await Rf(t,{...i,elementContext:"reference"}),o=cM(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:uM(o)}}}case"escaped":{const s=await Rf(t,{...i,altBoundary:!0}),o=cM(s,r.floating);return{data:{escapedOffsets:o,escaped:uM(o)}}}default:return{}}}}},K6=new Set(["left","top"]);async function ipe(e,t){const{placement:r,platform:n,elements:i}=e,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Xi(r),l=yu(r),c=ri(r)==="y",f=K6.has(o)?-1:1,h=s&&c?-1:1,d=Qi(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),c?{x:p*h,y:m*f}:{x:m*f,y:p*h}}const spe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:s,placement:o,middlewareData:l}=t,c=await ipe(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},ope=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:l={fn:v=>{let{x:b,y:w}=v;return{x:b,y:w}}},...c}=Qi(e,t),f={x:r,y:n},h=await Rf(t,c),d=ri(Xi(i)),m=vk(d);let p=f[m],x=f[d];if(s){const v=m==="y"?"top":"left",b=m==="y"?"bottom":"right",w=p+h[v],_=p-h[b];p=jN(w,p,_)}if(o){const v=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=x+h[v],_=x-h[b];x=jN(w,x,_)}const y=l.fn({...t,[m]:p,[d]:x});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[m]:s,[d]:o}}}}}},lpe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:f=!0}=Qi(e,t),h={x:r,y:n},d=ri(i),m=vk(d);let p=h[m],x=h[d];const y=Qi(l,t),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const _=m==="y"?"height":"width",N=s.reference[m]-s.floating[_]+v.mainAxis,S=s.reference[m]+s.reference[_]-v.mainAxis;p<N?p=N:p>S&&(p=S)}if(f){var b,w;const _=m==="y"?"width":"height",N=K6.has(Xi(i)),S=s.reference[d]-s.floating[_]+(N&&((b=o.offset)==null?void 0:b[d])||0)+(N?0:v.crossAxis),k=s.reference[d]+s.reference[_]+(N?0:((w=o.offset)==null?void 0:w[d])||0)-(N?v.crossAxis:0);x<S?x=S:x>k&&(x=k)}return{[m]:p,[d]:x}}}},cpe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:s,platform:o,elements:l}=t,{apply:c=()=>{},...f}=Qi(e,t),h=await Rf(t,f),d=Xi(i),m=yu(i),p=ri(i)==="y",{width:x,height:y}=s.floating;let v,b;d==="top"||d==="bottom"?(v=d,b=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(b=d,v=m==="end"?"top":"bottom");const w=y-h.top-h.bottom,_=x-h.left-h.right,N=Ks(y-h[v],w),S=Ks(x-h[b],_),k=!t.middlewareData.shift;let C=N,O=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(O=_),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=w),k&&!m){const A=Hn(h.left,0),P=Hn(h.right,0),E=Hn(h.top,0),T=Hn(h.bottom,0);p?O=x-2*(A!==0||P!==0?A+P:Hn(h.left,h.right)):C=y-2*(E!==0||T!==0?E+T:Hn(h.top,h.bottom))}await c({...t,availableWidth:O,availableHeight:C});const R=await o.getDimensions(l.floating);return x!==R.width||y!==R.height?{reset:{rects:!0}}:{}}}};function Py(){return typeof window<"u"}function vu(e){return G6(e)?(e.nodeName||"").toLowerCase():"#document"}function Yn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vi(e){var t;return(t=(G6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function G6(e){return Py()?e instanceof Node||e instanceof Yn(e).Node:!1}function La(e){return Py()?e instanceof Element||e instanceof Yn(e).Element:!1}function mi(e){return Py()?e instanceof HTMLElement||e instanceof Yn(e).HTMLElement:!1}function dM(e){return!Py()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Yn(e).ShadowRoot}const upe=new Set(["inline","contents"]);function uh(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Da(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!upe.has(i)}const dpe=new Set(["table","td","th"]);function fpe(e){return dpe.has(vu(e))}const hpe=[":popover-open",":modal"];function Ty(e){return hpe.some(t=>{try{return e.matches(t)}catch{return!1}})}const mpe=["transform","translate","scale","rotate","perspective"],ppe=["transform","translate","scale","rotate","perspective","filter"],gpe=["paint","layout","strict","content"];function wk(e){const t=_k(),r=La(e)?Da(e):e;return mpe.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||ppe.some(n=>(r.willChange||"").includes(n))||gpe.some(n=>(r.contain||"").includes(n))}function ype(e){let t=Gs(e);for(;mi(t)&&!tu(t);){if(wk(t))return t;if(Ty(t))return null;t=Gs(t)}return null}function _k(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vpe=new Set(["html","body","#document"]);function tu(e){return vpe.has(vu(e))}function Da(e){return Yn(e).getComputedStyle(e)}function Ay(e){return La(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gs(e){if(vu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dM(e)&&e.host||vi(e);return dM(t)?t.host:t}function Y6(e){const t=Gs(e);return tu(t)?e.ownerDocument?e.ownerDocument.body:e.body:mi(t)&&uh(t)?t:Y6(t)}function If(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=Y6(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=Yn(i);if(s){const l=SN(o);return t.concat(o,o.visualViewport||[],uh(i)?i:[],l&&r?If(l):[])}return t.concat(i,If(i,[],r))}function SN(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q6(e){const t=Da(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=mi(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,l=Fg(r)!==s||Fg(n)!==o;return l&&(r=s,n=o),{width:r,height:n,$:l}}function jk(e){return La(e)?e:e.contextElement}function uc(e){const t=jk(e);if(!mi(t))return si(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:s}=Q6(t);let o=(s?Fg(r.width):r.width)/n,l=(s?Fg(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const xpe=si(0);function X6(e){const t=Yn(e);return!_k()||!t.visualViewport?xpe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bpe(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Yn(e)?!1:t}function rl(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),s=jk(e);let o=si(1);t&&(n?La(n)&&(o=uc(n)):o=uc(e));const l=bpe(s,r,n)?X6(s):si(0);let c=(i.left+l.x)/o.x,f=(i.top+l.y)/o.y,h=i.width/o.x,d=i.height/o.y;if(s){const m=Yn(s),p=n&&La(n)?Yn(n):n;let x=m,y=SN(x);for(;y&&n&&p!==x;){const v=uc(y),b=y.getBoundingClientRect(),w=Da(y),_=b.left+(y.clientLeft+parseFloat(w.paddingLeft))*v.x,N=b.top+(y.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,f*=v.y,h*=v.x,d*=v.y,c+=_,f+=N,x=Yn(y),y=SN(x)}}return Eg({width:h,height:d,x:c,y:f})}function Ry(e,t){const r=Ay(e).scrollLeft;return t?t.left+r:rl(vi(e)).left+r}function Z6(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Ry(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function wpe(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const s=i==="fixed",o=vi(n),l=t?Ty(t.floating):!1;if(n===o||l&&s)return r;let c={scrollLeft:0,scrollTop:0},f=si(1);const h=si(0),d=mi(n);if((d||!d&&!s)&&((vu(n)!=="body"||uh(o))&&(c=Ay(n)),mi(n))){const p=rl(n);f=uc(n),h.x=p.x+n.clientLeft,h.y=p.y+n.clientTop}const m=o&&!d&&!s?Z6(o,c):si(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-c.scrollLeft*f.x+h.x+m.x,y:r.y*f.y-c.scrollTop*f.y+h.y+m.y}}function _pe(e){return Array.from(e.getClientRects())}function jpe(e){const t=vi(e),r=Ay(e),n=e.ownerDocument.body,i=Hn(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Hn(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Ry(e);const l=-r.scrollTop;return Da(n).direction==="rtl"&&(o+=Hn(t.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:l}}const fM=25;function Npe(e,t){const r=Yn(e),n=vi(e),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,l=0,c=0;if(i){s=i.width,o=i.height;const h=_k();(!h||h&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const f=Ry(n);if(f<=0){const h=n.ownerDocument,d=h.body,m=getComputedStyle(d),p=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(n.clientWidth-d.clientWidth-p);x<=fM&&(s-=x)}else f<=fM&&(s+=f);return{width:s,height:o,x:l,y:c}}const Spe=new Set(["absolute","fixed"]);function kpe(e,t){const r=rl(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=mi(e)?uc(e):si(1),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=i*s.x,f=n*s.y;return{width:o,height:l,x:c,y:f}}function hM(e,t,r){let n;if(t==="viewport")n=Npe(e,r);else if(t==="document")n=jpe(vi(e));else if(La(t))n=kpe(t,r);else{const i=X6(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Eg(n)}function J6(e,t){const r=Gs(e);return r===t||!La(r)||tu(r)?!1:Da(r).position==="fixed"||J6(r,t)}function Cpe(e,t){const r=t.get(e);if(r)return r;let n=If(e,[],!1).filter(l=>La(l)&&vu(l)!=="body"),i=null;const s=Da(e).position==="fixed";let o=s?Gs(e):e;for(;La(o)&&!tu(o);){const l=Da(o),c=wk(o);!c&&l.position==="fixed"&&(i=null),(s?!c&&!i:!c&&l.position==="static"&&!!i&&Spe.has(i.position)||uh(o)&&!c&&J6(e,o))?n=n.filter(h=>h!==o):i=l,o=Gs(o)}return t.set(e,n),n}function Fpe(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?Ty(t)?[]:Cpe(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((f,h)=>{const d=hM(t,h,i);return f.top=Hn(d.top,f.top),f.right=Ks(d.right,f.right),f.bottom=Ks(d.bottom,f.bottom),f.left=Hn(d.left,f.left),f},hM(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ope(e){const{width:t,height:r}=Q6(e);return{width:t,height:r}}function Epe(e,t,r){const n=mi(t),i=vi(t),s=r==="fixed",o=rl(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=si(0);function f(){c.x=Ry(i)}if(n||!n&&!s)if((vu(t)!=="body"||uh(i))&&(l=Ay(t)),n){const p=rl(t,!0,s,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else i&&f();s&&!n&&i&&f();const h=i&&!n&&!s?Z6(i,l):si(0),d=o.left+l.scrollLeft-c.x-h.x,m=o.top+l.scrollTop-c.y-h.y;return{x:d,y:m,width:o.width,height:o.height}}function nj(e){return Da(e).position==="static"}function mM(e,t){if(!mi(e)||Da(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return vi(e)===r&&(r=r.ownerDocument.body),r}function eq(e,t){const r=Yn(e);if(Ty(e))return r;if(!mi(e)){let i=Gs(e);for(;i&&!tu(i);){if(La(i)&&!nj(i))return i;i=Gs(i)}return r}let n=mM(e,t);for(;n&&fpe(n)&&nj(n);)n=mM(n,t);return n&&tu(n)&&nj(n)&&!wk(n)?r:n||ype(e)||r}const Ppe=async function(e){const t=this.getOffsetParent||eq,r=this.getDimensions,n=await r(e.floating);return{reference:Epe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Tpe(e){return Da(e).direction==="rtl"}const Ape={convertOffsetParentRelativeRectToViewportRelativeRect:wpe,getDocumentElement:vi,getClippingRect:Fpe,getOffsetParent:eq,getElementRects:Ppe,getClientRects:_pe,getDimensions:Ope,getScale:uc,isElement:La,isRTL:Tpe};function tq(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rpe(e,t){let r=null,n;const i=vi(e);function s(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const f=e.getBoundingClientRect(),{left:h,top:d,width:m,height:p}=f;if(l||t(),!m||!p)return;const x=Vm(d),y=Vm(i.clientWidth-(h+m)),v=Vm(i.clientHeight-(d+p)),b=Vm(h),_={rootMargin:-x+"px "+-y+"px "+-v+"px "+-b+"px",threshold:Hn(0,Ks(1,c))||1};let N=!0;function S(k){const C=k[0].intersectionRatio;if(C!==c){if(!N)return o();C?o(!1,C):n=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!tq(f,e.getBoundingClientRect())&&o(),N=!1}try{r=new IntersectionObserver(S,{..._,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,_)}r.observe(e)}return o(!0),s}function Ipe(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,f=jk(e),h=i||s?[...f?If(f):[],...If(t)]:[];h.forEach(b=>{i&&b.addEventListener("scroll",r,{passive:!0}),s&&b.addEventListener("resize",r)});const d=f&&l?Rpe(f,r):null;let m=-1,p=null;o&&(p=new ResizeObserver(b=>{let[w]=b;w&&w.target===f&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var _;(_=p)==null||_.observe(t)})),r()}),f&&!c&&p.observe(f),p.observe(t));let x,y=c?rl(e):null;c&&v();function v(){const b=rl(e);y&&!tq(y,b)&&r(),y=b,x=requestAnimationFrame(v)}return r(),()=>{var b;h.forEach(w=>{i&&w.removeEventListener("scroll",r),s&&w.removeEventListener("resize",r)}),d==null||d(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(x)}}const Mpe=spe,Lpe=ope,Dpe=npe,$pe=cpe,qpe=ape,pM=rpe,Bpe=lpe,zpe=(e,t,r)=>{const n=new Map,i={platform:Ape,...r},s={...i.platform,_c:n};return tpe(e,t,{...i,platform:s})};var Upe=typeof document<"u",Hpe=function(){},hp=Upe?I.useLayoutEffect:Hpe;function Pg(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 r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Pg(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&e.$$typeof)&&!Pg(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function rq(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gM(e,t){const r=rq(e);return Math.round(t*r)/r}function aj(e){const t=I.useRef(e);return hp(()=>{t.current=e}),t}function Vpe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:f}=e,[h,d]=I.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=I.useState(n);Pg(m,n)||p(n);const[x,y]=I.useState(null),[v,b]=I.useState(null),w=I.useCallback(H=>{H!==k.current&&(k.current=H,y(H))},[]),_=I.useCallback(H=>{H!==C.current&&(C.current=H,b(H))},[]),N=s||x,S=o||v,k=I.useRef(null),C=I.useRef(null),O=I.useRef(h),R=c!=null,A=aj(c),P=aj(i),E=aj(f),T=I.useCallback(()=>{if(!k.current||!C.current)return;const H={placement:t,strategy:r,middleware:m};P.current&&(H.platform=P.current),zpe(k.current,C.current,H).then(K=>{const q={...K,isPositioned:E.current!==!1};$.current&&!Pg(O.current,q)&&(O.current=q,Hf.flushSync(()=>{d(q)}))})},[m,t,r,P,E]);hp(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(H=>({...H,isPositioned:!1})))},[f]);const $=I.useRef(!1);hp(()=>($.current=!0,()=>{$.current=!1}),[]),hp(()=>{if(N&&(k.current=N),S&&(C.current=S),N&&S){if(A.current)return A.current(N,S,T);T()}},[N,S,T,A,R]);const D=I.useMemo(()=>({reference:k,floating:C,setReference:w,setFloating:_}),[w,_]),W=I.useMemo(()=>({reference:N,floating:S}),[N,S]),U=I.useMemo(()=>{const H={position:r,left:0,top:0};if(!W.floating)return H;const K=gM(W.floating,h.x),q=gM(W.floating,h.y);return l?{...H,transform:"translate("+K+"px, "+q+"px)",...rq(W.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:K,top:q}},[r,l,W.floating,h.x,h.y]);return I.useMemo(()=>({...h,update:T,refs:D,elements:W,floatingStyles:U}),[h,T,D,W,U])}const Wpe=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?pM({element:n.current,padding:i}).fn(r):{}:n?pM({element:n,padding:i}).fn(r):{}}}},Kpe=(e,t)=>({...Mpe(e),options:[e,t]}),Gpe=(e,t)=>({...Lpe(e),options:[e,t]}),Ype=(e,t)=>({...Bpe(e),options:[e,t]}),Qpe=(e,t)=>({...Dpe(e),options:[e,t]}),Xpe=(e,t)=>({...$pe(e),options:[e,t]}),Zpe=(e,t)=>({...qpe(e),options:[e,t]}),Jpe=(e,t)=>({...Wpe(e),options:[e,t]});var ege="Arrow",nq=I.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...s}=e;return a.jsx(Kt.svg,{...s,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});nq.displayName=ege;var tge=nq;function rge(e){const[t,r]=I.useState(void 0);return cn(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,f=Array.isArray(c)?c[0]:c;o=f.inlineSize,l=f.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Nk="Popper",[aq,iq]=lh(Nk),[nge,sq]=aq(Nk),oq=e=>{const{__scopePopper:t,children:r}=e,[n,i]=I.useState(null);return a.jsx(nge,{scope:t,anchor:n,onAnchorChange:i,children:r})};oq.displayName=Nk;var lq="PopperAnchor",cq=I.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,s=sq(lq,r),o=I.useRef(null),l=Ir(t,o),c=I.useRef(null);return I.useEffect(()=>{const f=c.current;c.current=(n==null?void 0:n.current)||o.current,f!==c.current&&s.onAnchorChange(c.current)}),n?null:a.jsx(Kt.div,{...i,ref:l})});cq.displayName=lq;var Sk="PopperContent",[age,ige]=aq(Sk),uq=I.forwardRef((e,t)=>{var X,ie,J,ue,ge,fe;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:x,...y}=e,v=sq(Sk,r),[b,w]=I.useState(null),_=Ir(t,Ee=>w(Ee)),[N,S]=I.useState(null),k=rge(N),C=(k==null?void 0:k.width)??0,O=(k==null?void 0:k.height)??0,R=n+(s!=="center"?"-"+s:""),A=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},P=Array.isArray(f)?f:[f],E=P.length>0,T={padding:A,boundary:P.filter(oge),altBoundary:E},{refs:$,floatingStyles:D,placement:W,isPositioned:U,middlewareData:H}=Vpe({strategy:"fixed",placement:R,whileElementsMounted:(...Ee)=>Ipe(...Ee,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[Kpe({mainAxis:i+O,alignmentAxis:o}),c&&Gpe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Ype():void 0,...T}),c&&Qpe({...T}),Xpe({...T,apply:({elements:Ee,rects:Oe,availableWidth:Ve,availableHeight:Ae})=>{const{width:tt,height:ye}=Oe.reference,xe=Ee.floating.style;xe.setProperty("--radix-popper-available-width",`${Ve}px`),xe.setProperty("--radix-popper-available-height",`${Ae}px`),xe.setProperty("--radix-popper-anchor-width",`${tt}px`),xe.setProperty("--radix-popper-anchor-height",`${ye}px`)}}),N&&Jpe({element:N,padding:l}),lge({arrowWidth:C,arrowHeight:O}),m&&Zpe({strategy:"referenceHidden",...T})]}),[K,q]=hq(W),L=Ws(x);cn(()=>{U&&(L==null||L())},[U,L]);const V=(X=H.arrow)==null?void 0:X.x,z=(ie=H.arrow)==null?void 0:ie.y,Z=((J=H.arrow)==null?void 0:J.centerOffset)!==0,[re,G]=I.useState();return cn(()=>{b&&G(window.getComputedStyle(b).zIndex)},[b]),a.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:U?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(ue=H.transformOrigin)==null?void 0:ue.x,(ge=H.transformOrigin)==null?void 0:ge.y].join(" "),...((fe=H.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(age,{scope:r,placedSide:K,onArrowChange:S,arrowX:V,arrowY:z,shouldHideArrow:Z,children:a.jsx(Kt.div,{"data-side":K,"data-align":q,...y,ref:_,style:{...y.style,animation:U?void 0:"none"}})})})});uq.displayName=Sk;var dq="PopperArrow",sge={top:"bottom",right:"left",bottom:"top",left:"r
488ight"},fq=I.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,s=ige(dq,n),o=sge[s.placedSide];return a.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:a.jsx(tge,{...i,ref:r,style:{...i.style,display:"block"}})})});fq.displayName=dq;function oge(e){return e!==null}var lge=e=>({name:"transformOrigin",options:e,fn(t){var v,b,w;const{placement:r,rects:n,middlewareData:i}=t,o=((v=i.arrow)==null?void 0:v.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[f,h]=hq(r),d={start:"0%",center:"50%",end:"100%"}[h],m=(((b=i.arrow)==null?void 0:b.x)??0)+l/2,p=(((w=i.arrow)==null?void 0:w.y)??0)+c/2;let x="",y="";return f==="bottom"?(x=o?d:`${m}px`,y=`${-c}px`):f==="top"?(x=o?d:`${m}px`,y=`${n.floating.height+c}px`):f==="right"?(x=`${-c}px`,y=o?d:`${p}px`):f==="left"&&(x=`${n.floating.width+c}px`,y=o?d:`${p}px`),{data:{x,y}}}});function hq(e){const[t,r="center"]=e.split("-");return[t,r]}var cge=oq,uge=cq,dge=uq,fge=fq,hge="Portal",mq=I.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[i,s]=I.useState(!1);cn(()=>s(!0),[]);const o=r||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?bH.createPortal(a.jsx(Kt.div,{...n,ref:t}),o):null});mq.displayName=hge;var mge=HN[" useInsertionEffect ".trim().toString()]||cn;function Tg({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,s,o]=pge({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:i;{const h=I.useRef(e!==void 0);I.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${n} is changing from ${d?"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.`),h.current=l},[l,n])}const f=I.useCallback(h=>{var d;if(l){const m=gge(h)?h(e):h;m!==e&&((d=o.current)==null||d.call(o,m))}else s(h)},[l,e,s,o]);return[c,f]}function pge({defaultProp:e,onChange:t}){const[r,n]=I.useState(e),i=I.useRef(r),s=I.useRef(t);return mge(()=>{s.current=t},[t]),I.useEffect(()=>{var o;i.current!==r&&((o=s.current)==null||o.call(s,r),i.current=r)},[r,i]),[r,n,s]}function gge(e){return typeof e=="function"}function yge(e){const t=I.useRef({value:e,previous:e});return I.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var pq=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"}),vge="VisuallyHidden",xge=I.forwardRef((e,t)=>a.jsx(Kt.span,{...e,ref:t,style:{...pq,...e.style}}));xge.displayName=vge;var bge=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Gl=new WeakMap,Wm=new WeakMap,Km={},ij=0,gq=function(e){return e&&(e.host||gq(e.parentNode))},wge=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=gq(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},_ge=function(e,t,r,n){var i=wge(t,Array.isArray(e)?e:[e]);Km[r]||(Km[r]=new WeakMap);var s=Km[r],o=[],l=new Set,c=new Set(i),f=function(d){!d||l.has(d)||(l.add(d),f(d.parentNode))};i.forEach(f);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(m){if(l.has(m))h(m);else try{var p=m.getAttribute(n),x=p!==null&&p!=="false",y=(Gl.get(m)||0)+1,v=(s.get(m)||0)+1;Gl.set(m,y),s.set(m,v),o.push(m),y===1&&x&&Wm.set(m,!0),v===1&&m.setAttribute(r,"true"),x||m.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",m,b)}})};return h(t),l.clear(),ij++,function(){o.forEach(function(d){var m=Gl.get(d)-1,p=s.get(d)-1;Gl.set(d,m),s.set(d,p),m||(Wm.has(d)||d.removeAttribute(n),Wm.delete(d)),p||d.removeAttribute(r)}),ij--,ij||(Gl=new WeakMap,Gl=new WeakMap,Wm=new WeakMap,Km={})}},jge=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=bge(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),_ge(n,i,r,"aria-hidden")):function(){return null}},Ja=function(){return Ja=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];
vendor: 5,521 bytes, lines 488-503
488for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Ja.apply(this,arguments)};function yq(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Nge(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}var mp="right-scroll-bar-position",pp="width-before-scroll-bar",Sge="with-scroll-bars-hidden",kge="--removed-body-scroll-bar-size";function sj(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Cge(e,t){var r=I.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=t,r.facade}var Fge=typeof window<"u"?I.useLayoutEffect:I.useEffect,yM=new WeakMap;function Oge(e,t){var r=Cge(null,function(n){return e.forEach(function(i){return sj(i,n)})});return Fge(function(){var n=yM.get(r);if(n){var i=new Set(n),s=new Set(e),o=r.current;i.forEach(function(l){s.has(l)||sj(l,null)}),s.forEach(function(l){i.has(l)||sj(l,o)})}yM.set(r,e)},[e]),r}function Ege(e){return e}function Pge(e,t){t===void 0&&(t=Ege);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(s){var o=t(s,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(l){return s(l)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(s),o=r}var c=function(){var h=o;o=[],h.forEach(s)},f=function(){return Promise.resolve().then(c)};f(),r={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),r}}}};return i}function Tge(e){e===void 0&&(e={});var t=Pge(null);return t.options=Ja({async:!0,ssr:!1},e),t}var vq=function(e){var t=e.sideCar,r=yq(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return I.createElement(n,Ja({},r))};vq.isSideCarExport=!0;function Age(e,t){return e.useMedium(t),vq}var xq=Tge(),oj=function(){},Iy=I.forwardRef(function(e,t){var r=I.useRef(null),n=I.useState({onScrollCapture:oj,onWheelCapture:oj,onTouchMoveCapture:oj}),i=n[0],s=n[1],o=e.forwardProps,l=e.children,c=e.className,f=e.removeScrollBar,h=e.enabled,d=e.shards,m=e.sideCar,p=e.noRelative,x=e.noIsolation,y=e.inert,v=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,_=e.gapMode,N=yq(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=Oge([r,t]),C=Ja(Ja({},N),i);return I.createElement(I.Fragment,null,h&&I.createElement(S,{sideCar:xq,removeScrollBar:f,shards:d,noRelative:p,noIsolation:x,inert:y,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:_}),o?I.cloneElement(I.Children.only(l),Ja(Ja({},C),{ref:k})):I.createElement(w,Ja({},C,{className:c,ref:k}),l))});Iy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Iy.classNames={fullWidth:pp,zeroRight:mp};var Rge=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ige(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Rge();return t&&e.setAttribute("nonce",t),e}function Mge(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Lge(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Dge=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Ige())&&(Mge(t,r),Lge(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$ge=function(){var e=Dge();return function(t,r){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},bq=function(){var e=$ge(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},qge={left:0,top:0,right:0,gap:0},lj=function(e){return parseInt(e||"",10)||0},Bge=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[lj(r),lj(n),lj(i)]},zge=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qge;var t=Bge(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Uge=bq(),dc="data-scroll-locked",Hge=function(e,t,r,n){var i=e.left,s=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),`
489  .`.concat(Sge,` {
490   overflow: hidden `).concat(n,`;
491   padding-right: `).concat(l,"px ").concat(n,`;
492  }
493  body[`).concat(dc,`] {
494    overflow: hidden `).concat(n,`;
495    overscroll-behavior: contain;
496    `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
497    padding-left: `.concat(i,`px;
498    padding-top: `).concat(s,`px;
499    padding-right: `).concat(o,`px;
500    margin-left:0;
501    margin-top:0;
502    margin-right: `).concat(l,"px ").concat(n,`;
503    `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
503")].filter(Boolean).join(""),`
504  }
505  
506  .`).concat(mp,` {
507    right: `).concat(l,"px ").concat(n,`;
508  }
509  
510  .`).concat(pp,` {
511    margin-right: `).concat(l,"px ").concat(n,`;
512  }
513  
514  .`).concat(mp," .").concat(mp,` {
515    right: 0 `).concat(n,`;
516  }
517  
518  .`).concat(pp," .").concat(pp,` {
519    margin-right: 0 `).concat(n,`;
520  }
521  
522  body[`).concat(dc,`] {
523    `).concat(kge,": ").concat(l,`px;
524  }
525`)},vM=function(){var e=parseInt(document.body.getAttribute(dc)||"0",10);return isFinite(e)?e:0},Vge=function(){I.useEffect(function(){return document.body.setAttribute(dc,(vM()+1).toString()),function(){var e=vM()-1;e<=0?document.body.removeAttribute(dc):document.body.setAttribute(dc,e.toString())}},[])},Wge=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;Vge();var s=I.useMemo(function(){return zge(i)},[i]);return I.createElement(Uge,{styles:Hge(s,!t,i,r?"":"!important")})},kN=!1;if(typeof window<"u")try{var Gm=Object.defineProperty({},"passive",{get:function(){return kN=!0,!0}});window.addEventListener("test",Gm,Gm),window.removeEventListener("test",Gm,Gm)}catch{kN=!1}var Yl=kN?{passive:!1}:!1,Kge=function(e){return e.tagName==="TEXTAREA"},wq=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Kge(e)&&r[t]==="visible")},Gge=function(e){return wq(e,"overflowY")},Yge=function(e){return wq(e,"overflowX")},xM=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=_q(e,n);if(i){var s=jq(e,n),o=s[1],l=s[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Qge=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Xge=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},_q=function(e,t){return e==="v"?Gge(t):Yge(t)},jq=function(e,t){return e==="v"?Qge(t):Xge(t)},Zge=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jge=function(e,t,r,n,i){var s=Zge(e,window.getComputedStyle(t).direction),o=s*n,l=r.target,c=t.contains(l),f=!1,h=o>0,d=0,m=0;do{if(!l)break;var p=jq(e,l),x=p[0],y=p[1],v=p[2],b=y-v-s*x;(x||b)&&_q(e,l)&&(d+=b,m+=x);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(m)<1)&&(f=!0),f},Ym=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bM=function(e){return[e.deltaX,e.deltaY]},wM=function(e){return e&&"current"in e?e.current:e},eye=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tye=function(e){return`
526  .block-interactivity-`.concat(e,` {pointer-events: none;}
527  .allow-interactivity-`).concat(e,` {pointer-events: all;}
528`)},rye=0,Ql=[];function nye(e){var t=I.useRef([]),r=I.useRef([0,0]),n=I.useRef(),i=I.useState(rye++)[0],s=I.useState(bq)[0],o=I.useRef(e);I.useEffect(function(){o.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=Nge([e.lockRef.current],(e.shards||[]).map(wM),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=I.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var b=Ym(y),w=r.current,_="deltaX"in y?y.deltaX:w[0]-b[0],N="deltaY"in y?y.deltaY:w[1]-b[1],S,k=y.target,C=Math.abs(_)>Math.abs(N)?"h":"v";if("touches"in y&&C==="h"&&k.type==="range")return!1;var O=xM(C,k);if(!O)return!0;if(O?S=C:(S=C==="v"?"h":"v",O=xM(C,k)),!O)return!1;if(!n.current&&"changedTouches"in y&&(_||N)&&(n.current=S),!S)return!0;var R=n.current||S;return Jge(R,v,y,R==="h"?_:N)},[]),c=I.useCallback(function(y){var v=y;if(!(!Ql.length||Ql[Ql.length-1]!==s)){var b="deltaY"in v?bM(v):Ym(v),w=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&eye(S.delta,b)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}
vendor: 2,026 bytes, line 528
528if(!w){var _=(o.current.shards||[]).map(wM).filter(Boolean).filter(function(S){return S.contains(v.target)}),N=_.length>0?l(v,_[0]):!o.current.noIsolation;N&&v.cancelable&&v.preventDefault()}}},[]),f=I.useCallback(function(y,v,b,w){var _={name:y,delta:v,target:b,should:w,shadowParent:aye(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(N){return N!==_})},1)},[]),h=I.useCallback(function(y){r.current=Ym(y),n.current=void 0},[]),d=I.useCallback(function(y){f(y.type,bM(y),y.target,l(y,e.lockRef.current))},[]),m=I.useCallback(function(y){f(y.type,Ym(y),y.target,l(y,e.lockRef.current))},[]);I.useEffect(function(){return Ql.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Yl),document.addEventListener("touchmove",c,Yl),document.addEventListener("touchstart",h,Yl),function(){Ql=Ql.filter(function(y){return y!==s}),document.removeEventListener("wheel",c,Yl),document.removeEventListener("touchmove",c,Yl),document.removeEventListener("touchstart",h,Yl)}},[]);var p=e.removeScrollBar,x=e.inert;return I.createElement(I.Fragment,null,x?I.createElement(s,{styles:tye(i)}):null,p?I.createElement(Wge,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aye(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const iye=Age(xq,nye);var Nq=I.forwardRef(function(e,t){return I.createElement(Iy,Ja({},e,{ref:t,sideCar:iye}))});Nq.classNames=Iy.classNames;var sye=[" ","Enter","ArrowUp","ArrowDown"],oye=[" ","Enter"],nl="Select",[My,Ly,lye]=q6(nl),[xu]=lh(nl,[lye,iq]),Dy=iq(),[cye,Js]=xu(nl),[uye,dye]=xu(nl),Sq=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:l,onValueChange:c,dir:f,name:h,autoComplete:d,disabled:m,required:p,form:x}=e,y=Dy(t),[v,b]=I.useState(null),[w,_]=I.useState(null),[N,S]=I.useState(!1),k=yk(f),[C,O]=Tg({prop:n,defaultProp:i??!1,onChange:s,caller:nl}),[R,A]=Tg({prop:o,defaultProp:l,onChange:c,caller:nl}
vendor: 3,660 bytes, line 528
528),P=I.useRef(null),E=v?x||!!v.closest("form"):!0,[T,$]=I.useState(new Set),D=Array.from(T).map(W=>W.props.value).join(";");return a.jsx(cge,{...y,children:a.jsxs(cye,{required:p,scope:t,trigger:v,onTriggerChange:b,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:N,onValueNodeHasChildrenChange:S,contentId:ch(),value:R,onValueChange:A,open:C,onOpenChange:O,dir:k,triggerPointerDownPosRef:P,disabled:m,children:[a.jsx(My.Provider,{scope:t,children:a.jsx(uye,{scope:e.__scopeSelect,onNativeOptionAdd:I.useCallback(W=>{$(U=>new Set(U).add(W))},[]),onNativeOptionRemove:I.useCallback(W=>{$(U=>{const H=new Set(U);return H.delete(W),H})},[]),children:r})}),E?a.jsxs(Yq,{"aria-hidden":!0,required:p,tabIndex:-1,name:h,autoComplete:d,value:R,onChange:W=>A(W.target.value),disabled:m,form:x,children:[R===void 0?a.jsx("option",{value:""}):null,Array.from(T)]},D):null]})})};Sq.displayName=nl;var kq="SelectTrigger",Cq=I.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,s=Dy(r),o=Js(kq,r),l=o.disabled||n,c=Ir(t,o.onTriggerChange),f=Ly(r),h=I.useRef("touch"),[d,m,p]=Xq(y=>{const v=f().filter(_=>!_.disabled),b=v.find(_=>_.value===o.value),w=Zq(v,y,b);w!==void 0&&o.onValueChange(w.value)}),x=y=>{l||(o.onOpenChange(!0),p()),y&&(o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return a.jsx(uge,{asChild:!0,...s,children:a.jsx(Kt.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":Qq(o.value)?"":void 0,...i,ref:c,onClick:Ut(i.onClick,y=>{y.currentTarget.focus(),h.current!=="mouse"&&x(y)}),onPointerDown:Ut(i.onPointerDown,y=>{h.current=y.pointerType;const v=y.target;v.hasPointerCapture(y.pointerId)&&v.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(x(y),y.preventDefault())}),onKeyDown:Ut(i.onKeyDown,y=>{const v=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&m(y.key),!(v&&y.key===" ")&&sye.includes(y.key)&&(x(),y.preventDefault())})})})});Cq.displayName=kq;var Fq="SelectValue",Oq=I.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...l}=e,c=Js(Fq,r),{onValueNodeHasChildrenChange:f}=c,h=s!==void 0,d=Ir(t,c.onValueNodeChange);return cn(()=>{f(h)},[f,h]),a.jsx(Kt.span,{...l,ref:d,style:{pointerEvents:"none"},children:Qq(c.value)?a.jsx(a.Fragment,{children:o}):s})});Oq.displayName=Fq;var fye="SelectIcon",Eq=I.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return a.jsx(Kt.span,{"aria-hidden":!0,...i,ref:t,children:n||"▼"})});Eq.displayName=fye;var hye="SelectPortal",Pq=e=>a.jsx(mq,{asChild:!0,...e});Pq.displayName=hye;var al="SelectContent",Tq=I.forwardRef((e,t)=>{const r=Js(al,e.__scopeSelect),[n,i]=I.useState();if(cn(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?Hf.createPortal(a.jsx(Aq,{scope:e.__scopeSelect,children:a.jsx(My.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),s):null}return a.jsx(Rq,{...e,ref:t})});Tq.displayName=al;var Ca=10,[Aq,eo]=xu(al),mye="SelectContentImpl",pye=Qd("SelectContent.RemoveScroll"),Rq=I.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:l,sideOffset:c,align:f,alignOffset:h,arrowPadding:d,collisionBoundary:m,collisionPadding:p,sticky:x,hideWhenDetached:y,avoidCollisions:v,...b}=e,w=Js(al,r),[_,N]=I.useState(null),[S,k]=I.useState(null),C=Ir(t,X=>N(X)),[O,R]=I.useState(null),[A,P]=I.useState(null),E=Ly(r),[T,$]=I.use
vendor: 13,976 bytes, line 528
528State(!1),D=I.useRef(!1);I.useEffect(()=>{if(_)return jge(_)},[_]),Rme();const W=I.useCallback(X=>{const[ie,...J]=E().map(fe=>fe.ref.current),[ue]=J.slice(-1),ge=document.activeElement;for(const fe of X)if(fe===ge||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===ie&&S&&(S.scrollTop=0),fe===ue&&S&&(S.scrollTop=S.scrollHeight),fe==null||fe.focus(),document.activeElement!==ge))return},[E,S]),U=I.useCallback(()=>W([O,_]),[W,O,_]);I.useEffect(()=>{T&&U()},[T,U]);const{onOpenChange:H,triggerPointerDownPosRef:K}=w;I.useEffect(()=>{if(_){let X={x:0,y:0};const ie=ue=>{var ge,fe;X={x:Math.abs(Math.round(ue.pageX)-(((ge=K.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((fe=K.current)==null?void 0:fe.y)??0))}},J=ue=>{X.x<=10&&X.y<=10?ue.preventDefault():_.contains(ue.target)||H(!1),document.removeEventListener("pointermove",ie),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",J,{capture:!0})}}},[_,H,K]),I.useEffect(()=>{const X=()=>H(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[H]);const[q,L]=Xq(X=>{const ie=E().filter(ge=>!ge.disabled),J=ie.find(ge=>ge.ref.current===document.activeElement),ue=Zq(ie,X,J);ue&&setTimeout(()=>ue.ref.current.focus())}),V=I.useCallback((X,ie,J)=>{const ue=!D.current&&!J;(w.value!==void 0&&w.value===ie||ue)&&(R(X),ue&&(D.current=!0))},[w.value]),z=I.useCallback(()=>_==null?void 0:_.focus(),[_]),Z=I.useCallback((X,ie,J)=>{const ue=!D.current&&!J;(w.value!==void 0&&w.value===ie||ue)&&P(X)},[w.value]),re=n==="popper"?CN:Iq,G=re===CN?{side:l,sideOffset:c,align:f,alignOffset:h,arrowPadding:d,collisionBoundary:m,collisionPadding:p,sticky:x,hideWhenDetached:y,avoidCollisions:v}:{};return a.jsx(Aq,{scope:r,content:_,viewport:S,onViewportChange:k,itemRefCallback:V,selectedItem:O,onItemLeave:z,itemTextRefCallback:Z,focusSelectedItem:U,selectedItemText:A,position:n,isPositioned:T,searchRef:q,children:a.jsx(Nq,{as:pye,allowPinchZoom:!0,children:a.jsx(H6,{asChild:!0,trapped:w.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Ut(i,X=>{var ie;(ie=w.trigger)==null||ie.focus({preventScroll:!0}),X.preventDefault()}),children:a.jsx(z6,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:a.jsx(re,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:X=>X.preventDefault(),...b,...G,onPlaced:()=>$(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ut(b.onKeyDown,X=>{const ie=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!ie&&X.key.length===1&&L(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let ue=E().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(X.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const ge=X.target,fe=ue.indexOf(ge);ue=ue.slice(fe+1)}setTimeout(()=>W(ue)),X.preventDefault()}})})})})})})});Rq.displayName=mye;var gye="SelectItemAlignedPosition",Iq=I.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,s=Js(al,r),o=eo(al,r),[l,c]=I.useState(null),[f,h]=I.useState(null),d=Ir(t,C=>h(C)),m=Ly(r),p=I.useRef(!1),x=I.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=o,_=I.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&f&&y&&v&&b){const C=s.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),R=s.valueNode.getBoundingClientRect(),A=b.getBoundingClientRect();if(s.dir!=="rtl"){const ge=A.left-O.left,fe=R.left-ge,Ee=C.left-fe,Oe=C.width+Ee,Ve=Math.max(Oe,O.width),Ae=window.innerWidth-Ca,tt=ZI(fe,[Ca,Math.max(Ca,Ae-Ve)]);l.style.minWidth=Oe+"px",l.style.left=tt+"px"}else{const ge=O.right-A.right,fe=window.innerWidth-R.right-ge,Ee=window.innerWidth-C.right-fe,Oe=C.width+Ee,Ve=Math.max(Oe,O.width),Ae=window.innerWidth-Ca,tt=ZI(fe,[Ca,Math.max(Ca,Ae-Ve)]);l.style.minWidth=Oe+"px",l.style.right=tt+"px"}const P=m(),E=window.innerHeight-Ca*2,T=y.scrollHeight,$=window.getComputedStyle(f),D=parseInt($.borderTopWidth,10),W=parseInt($.paddingTop,10),U=parseInt($.borderBottomWidth,10),H=parseInt($.paddingBottom,10),K=D+W+T+H+U,q=Math.min(v.offsetHeight*5,K),L=window.getComputedStyle(y),V=parseInt(L.paddingTop,10),z=parseInt(L.paddingBottom,10),Z=C.top+C.height/2-Ca,re=E-Z,G=v.offsetHeight/2,X=v.offsetTop+G,ie=D+W+X,J=K-ie;if(ie<=Z){const ge=P.length>0&&v===P[P.length-1].ref.current;l.style.bottom="0px";const fe=f.clientHeight-y.offsetTop-y.offsetHeight,Ee=Math.max(re,G+(ge?z:0)+fe+U),Oe=ie+Ee;l.style.height=Oe+"px"}else{const ge=P.length>0&&v===P[0].ref.current;l.style.top="0px";const Ee=Math.max(Z,D+y.offsetTop+(ge?V:0)+G)+J;l.style.height=Ee+"px",y.scrollTop=ie-Z+y.offsetTop}l.style.margin=`${Ca}px 0`,l.style.minHeight=q+"px",l.style.maxHeight=E+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[m,s.trigger,s.valueNode,l,f,y,v,b,s.dir,n]);cn(()=>_(),[_]);const[N,S]=I.useState();cn(()=>{f&&S(window.getComputedStyle(f).zIndex)},[f]);const k=I.useCallback(C=>{C&&x.current===!0&&(_(),w==null||w(),x.current=!1)},[_,w]);return a.jsx(vye,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:k,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:a.jsx(Kt.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Iq.displayName=gye;var yye="SelectPopperPosition",CN=I.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Ca,...s}=e,o=Dy(r);return a.jsx(dge,{...o,...s,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})});CN.displayName=yye;var[vye,kk]=xu(al,{}),FN="SelectViewport",Mq=I.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,s=eo(FN,r),o=kk(FN,r),l=Ir(t,s.onViewportChange),c=I.useRef(0);return a.jsxs(a.Fragment,{children:[a.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:n}),a.jsx(My.Slot,{scope:r,children:a.jsx(Kt.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ut(i.onScroll,f=>{const h=f.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&d){const p=Math.abs(c.current-h.scrollTop);if(p>0){const x=window.innerHeight-Ca*2,y=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),b=Math.max(y,v);if(b<x){const w=b+p,_=Math.min(x,w),N=w-_;d.style.height=_+"px",d.style.bottom==="0px"&&(h.scrollTop=N>0?N:0,d.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});Mq.displayName=FN;var Lq="SelectGroup",[xye,bye]=xu(Lq),wye=I.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=ch();return a.jsx(xye,{scope:r,id:i,children:a.jsx(Kt.div,{role:"group","aria-labelledby":i,...n,ref:t})})});wye.displayName=Lq;var Dq="SelectLabel",$q=I.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=bye(Dq,r);return a.jsx(Kt.div,{id:i.id,...n,ref:t})});$q.displayName=Dq;var Ag="SelectItem",[_ye,qq]=xu(Ag),Bq=I.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=e,l=Js(Ag,r),c=eo(Ag,r),f=l.value===n,[h,d]=I.useState(s??""),[m,p]=I.useState(!1),x=Ir(t,w=>{var _;return(_=c.itemRefCallback)==null?void 0:_.call(c,w,n,i)}),y=ch(),v=I.useRef("touch"),b=()=>{i||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")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 a.jsx(_ye,{scope:r,value:n,disabled:i,textId:y,isSelected:f,onItemTextChange:I.useCallback(w=>{d(_=>_||((w==null?void 0:w.textContent)??"").trim())},[]),children:a.jsx(My.ItemSlot,{scope:r,value:n,disabled:i,textValue:h,children:a.jsx(Kt.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":f&&m,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:x,onFocus:Ut(o.onFocus,()=>p(!0)),onBlur:Ut(o.onBlur,()=>p(!1)),onClick:Ut(o.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:Ut(o.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:Ut(o.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:Ut(o.onPointerMove,w=>{var _;v.current=w.pointerType,i?(_=c.onItemLeave)==null||_.call(c):v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ut(o.onPointerLeave,w=>{var _;w.currentTarget===document.activeElement&&((_=c.onItemLeave)==null||_.call(c))}),onKeyDown:Ut(o.onKeyDown,w=>{var N;((N=c.searchRef)==null?void 0:N.current)!==""&&w.key===" "||(oye.includes(w.key)&&b(),w.key===" "&&w.preventDefault())})})})})});Bq.displayName=Ag;var Td="SelectItemText",zq=I.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...s}=e,o=Js(Td,r),l=eo(Td,r),c=qq(Td,r),f=dye(Td,r),[h,d]=I.useState(null),m=Ir(t,b=>d(b),c.onItemTextChange,b=>{var w;return(w=l.itemTextRefCallback)==null?void 0:w.call(l,b,c.value,c.disabled)}),p=h==null?void 0:h.textContent,x=I.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:v}=f;return cn(()=>(y(x),()=>v(x)),[y,v,x]),a.jsxs(a.Fragment,{children:[a.jsx(Kt.span,{id:c.textId,...s,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Hf.createPortal(s.children,o.valueNode):null]})});zq.displayName=Td;var Uq="SelectItemIndicator",Hq=I.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return qq(Uq,r).isSelected?a.jsx(Kt.span,{"aria-hidden":!0,...n,ref:t}):null});Hq.displayName=Uq;var ON="SelectScrollUpButton",Vq=I.forwardRef((e,t)=>{const r=eo(ON,e.__scopeSelect),n=kk(ON,e.__scopeSelect),[i,s]=I.useState(!1),o=Ir(t,n.onScrollButtonChange);return cn(()=>{if(r.viewport&&r.isPositioned){let l=function(){const f=c.scrollTop>0;s(f)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),i?a.jsx(Kq,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Vq.displayName=ON;var EN="SelectScrollDownButton",Wq=I.forwardRef((e,t)=>{const r=eo(EN,e.__scopeSelect),n=kk(EN,e.__scopeSelect),[i,s]=I.useState(!1),o=Ir(t,n.onScrollButtonChange);return cn(()=>{if(r.viewport&&r.isPositioned){let l=function(){const f=c.scrollHeight-c.clientHeight,h=Math.ceil(c.scrollTop)<f;s(h)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),i?a.jsx(Kq,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Wq.displayName=EN;var Kq=I.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,s=eo("SelectScrollButton",r),o=I.useRef(null),l=Ly(r),c=I.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return I.useEffect(()=>()=>c(),[c]),cn(()=>{var h;const f=l().find(d=>d.ref.current===document.activeElement);(h=f==null?void 0:f.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),a.jsx(Kt.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ut(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:Ut(i.onPointerMove,()=>{var f;(f=s.onItemLeave)==null||f.call(s),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:Ut(i.onPointerLeave,()=>{c()})})}),jye="SelectSeparator",Gq=I.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return a.jsx(Kt.div,{"aria-hidden":!0,...n,ref:t})});Gq.displayName=jye;var PN="SelectArrow",Nye=I.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Dy(r),s=Js(PN,r),o=eo(PN,r);return s.open&&o.position==="popper"?a.jsx(fge,{...i,...n,ref:t}):null});Nye.displayName=PN;var Sye="SelectBubbleInput",Yq=I.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const i=I.useRef(null),s=Ir(n,i),o=yge(t);return I.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&h){const d=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(d)}},[o,t]),a.jsx(Kt.select,{...r,style:{...pq,...r.style},ref:s,defaultValue:t})});Yq.displayName=Sye;function Qq(e){return e===""||e===void 0}function Xq(e){const t=Ws(e),r=I.useRef(""),n=I.useRef(0),i=I.useCallback(o=>{const l=r.current+o;t(l),(function c(f){r.current=f,window.clearTimeout(n.current),f!==""&&(n.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),s=I.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function Zq(e,t,r){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let o=kye(e,Math.max(s,0));i.length===1&&(o=o.filter(f=>f!==r));const c=o.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function kye(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Cye=Sq,Jq=Cq,Fye=Oq,Oye=Eq,Eye=Pq,e8=Tq,Pye=Mq,t8=$q,r8=Bq,Tye=zq,Aye=Hq,n8=Vq,a8=Wq,i8=Gq;const qe=Cye,Be=Fye,De=I.forwardRef(({className:e,children:t,...r},n)=>
528a.jsxs(Jq,{ref:n,className:Vt("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,a.jsx(Oye,{asChild:!0,children:a.jsx(bp,{className:"h-4 w-4 opacity-50"})})]}));De.displayName=Jq.displayName;const s8=I.forwardRef(({className:e,...t},r)=>a.jsx(n8,{ref:r,className:Vt("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Hz,{className:"h-4 w-4"})}));s8.displayName=n8.displayName;const o8=I.forwardRef(({className:e,...t},r)=>a.jsx(a8,{ref:r,className:Vt("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(bp,{className:"h-4 w-4"})}));o8.displayName=a8.displayName;const $e=I.forwardRef(({className:e,children:t,position:r="popper",...n},i)=>a.jsx(Eye,{children:a.jsxs(e8,{ref:i,className:Vt("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",r==="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:r,...n,children:[a.jsx(s8,{}),a.jsx(Pye,{className:Vt("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(o8,{})]})}));$e.displayName=e8.displayName;const Rye=I.forwardRef(({className:e,...t},r)=>a.jsx(t8,{ref:r,className:Vt("px-2 py-1.5 text-sm font-semibold",e),...t}));Rye.displayName=t8.displayName;const se=I.forwardRef(({className:e,children:t,...r},n)=>a.jsxs(r8,{ref:n,className:Vt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[a.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(Aye,{children:a.jsx(xp,{className:"h-4 w-4"})})}),a.jsx(Tye,{children:t})]}));se.displayName=r8.displayName;const Iye=I.forwardRef(({className:e,...t},r)=>a.jsx(i8,{ref:r,className:Vt("-mx-1 my-1 h-px bg-muted",e),...t}));Iye.displayName=i8.displayName;function Mye({contractId:e}){const[t,r]=I.useState(!1),[n,i]=I.useState(null),[s,o]=I.useState({milestone_name:"",expected_delivery_date:"",actual_delivery_date:"",acceptance_date:"",billing_percentage:"",billing_amount:"",status:"pending",payment_status:"unpaid"}),[l,c]=I.useState(null),f=Wf(),h=at(),{data:d=[],isLoading:m}=Te({queryKey:["milestones",e],queryFn:()=>ee.entities.Milestone.filter({contract_id:e})});Te({queryKey:["contract",e],queryFn:async()=>{const O=(await ee.entities.Contract.list()).find(R=>R.id===e);return c(O),O}});const p=Ye({mutationFn:async C=>n?await ee.entities.Milestone.update(n.id,C):await ee.entities.Milestone.create(C),onSuccess:()=>{h.invalidateQueries(["milestones",e]),h.invalidateQueries(["contracts"]),r(!1),i(null),o({milestone_name:"",expected_delivery_date:"",actual_delivery_date:"",acceptance_date:"",billing_percentage:"",billing_amount:"",status:"pending",payment_status:"unpaid"}),alert(n?"里程碑更新成功!":"里程碑新增成功!")}}),x=Ye({mutationFn:C=>ee.entities.Milestone.delete(C),onSuccess:()=>{h.invalidateQueries(["milestones",e]),alert("刪除成功!")}}),y=C=>{C.preventDefault(),p.mutate({...s,contract_id:e})},v=C=>{i(C),o({milestone_name:C.milestone_name,expected_delivery_date:C.expected_delivery_date,actual_delivery_date:C.actual_delivery_date||"",acceptance_date:C.acceptance_date||"",billing_percentage:C.billing_percentage||"",billing_amount:C.billing_amount||"",status:C.status,payment_status:C.payment_status||"unpaid"}),r(!0)},b=()=>{r(!1),i(null),o({milestone_name:"",expected_delivery_date:"",actual_delivery_date:"",acceptance_date:"",billing_percentage:"",billing_amount:"",status:"pending",payment_status:"unpaid"})},w=Ye({mutationFn:async({id:C,updates:O})=>await ee.entities.Milestone.update(C,O),onSuccess:()=>{h.invalidateQueries(["milestones",e]),alert("狀態更新成功!")}}),_=(C,O)=>{const R={status:O};O==="delivered"&&!C.actual_delivery_date&&(R.actual_delivery_date=new Date().toISOString().split("T")[0]),O==="accepted"&&!C.acceptance_date&&(R.acceptance_date=new Date().toISOString().split("T")[0]),w.mutate({id:C.id,updates:R})},N=C=>{if(!C.billing_amount||C.billing_amount<=0){alert("此里程碑無請款金額,無法建立請款單");return}if(!l){alert("無法取得合約資訊");return}const O={invoice_number:`INV-${l.contract_number}-M${d.indexOf(C)+1}-${Date.now()}`,contract_id:e,contract_number:l.contract_number,project_name:l.project_name,milestone_id:C.id,milestone_name:C.milestone_name,invoice_amount:C.billing_amount,vendor_name:l.customer_name||"",invoice_date:new Date().toISOString().split("T")[0],due_date:C.expected_delivery_date||"",requestor_name:l.created_by||"",payment_method:"匯款",purpose:`${C.milestone_name} - 里程碑款項`,status:"draft",received_amount:0,outstanding_amount:C.billing_amount,invoice_link:"",bank_passbook_url:"",file_url:"",payment_records:[]};sessionStorage.setItem("newInvoiceData",JSON.stringify(O)),f(Ur("SoftwareProjectInvoicing")+"?action=create")},S=C=>
528{switch(C){case"pending":return a.jsx(Ra,{className:"w-5 h-5 text-yellow-400"});case"delivered":return a.jsx(Ra,{className:"w-5 h-5 text-blue-400"});case"accepted":return a.jsx(xr,{className:"w-5 h-5 text-green-400"});case"rejected":return a.jsx($s,{className:"w-5 h-5 text-red-400"});default:return a.jsx(Ra,{className:"w-5 h-5 text-gray-400"})}},k=C=>({pending:"待交付",delivered:"已交付(待驗收)",accepted:"已驗收",rejected:"未通過/待修正"})[C]||C;return a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"交付里程碑"}),a.jsxs(te,{onClick:()=>{t&&!n?r(!1):(b(),r(!0))},size:"sm",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"新增里程碑"]})]}),t&&a.jsxs("form",{onSubmit:y,className:"cyber-bg border border-gray-700 rounded-lg p-4 space-y-4",children:[a.jsx("h4",{className:"text-md font-semibold text-white border-b border-gray-700 pb-2",children:n?"編輯里程碑":"新增里程碑"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"里程碑名稱 *"}),a.jsx(ne,{required:!0,value:s.milestone_name,onChange:C=>o({...s,milestone_name:C.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"預計交付日期 *"}),a.jsx(ne,{type:"date",required:!0,value:s.expected_delivery_date,onChange:C=>o({...s,expected_delivery_date:C.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"實際交付日期"}),a.jsx(ne,{type:"date",value:s.actual_delivery_date,onChange:C=>o({...s,actual_delivery_date:C.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"驗收日期"}),a.jsx(ne,{type:"date",value:s.acceptance_date,onChange:C=>o({...s,acceptance_date:C.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款比例 %"}),a.jsx(ne,{type:"number",value:s.billing_percentage,onChange:C=>{const O=parseFloat(C.target.value)||0,R=l?l.total_amount*O/100:0;o({...s,billing_percentage:O,billing_amount:R})},className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{children:["請款金額",n?"":"(自動計算)"]}),a.jsx(ne,{type:"number",value:s.billing_amount,onChange:n?C=>o({...s,billing_amount:parseFloat(C.target.value)||0}):void 0,readOnly:!n,className:n?"bg-black border-gray-700":"bg-gray-900 border-gray-700 text-[#00FFFF] font-semibold"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"狀態"}),a.jsxs(qe,{value:s.status,onValueChange:C=>o({...s,status:C}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"pending",className:"text-white",children:"待交付"}),a.jsx(se,{value:"delivered",className:"text-white",children:"已交付"}),a.jsx(se,{value:"accepted",className:"text-white",children:"已驗收"}),a.jsx(se,{value:"rejected",className:"text-white",children:"未通過"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"收款狀態"}),a.jsxs(qe,{value:s.payment_status,onValueChange:C=>o({...s,payment_status:C}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"unpaid",className:"text-white",children:"未收款"}),a.jsx(se,{value:"paid",className:"text-white",children:"已收款"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(te,{type:"button",variant:"outline",onClick:b,className:"bg-red-900 text-white hover:bg-red-800 border-red-700",children:"取消"}),a.jsx(te,{type:"submit",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:n?"更新":"新增"})]})]}),a.jsx("div",{className:"space-y-3",children:m?a.jsx("div",{className:"text-center py-8 text-gray-400",children:"載入中..."}):d.length===0?a.jsx("div",{className:"text-center py-8 text-gray-400",children:"尚無里程碑"}):d.map(C=>a.jsx("div",{className:"border border-gray-700 rounded-lg p-4 hover:border-[#00FFFF] transition-colors",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[S(C.status),a.jsx("h4",{className:"font-semibold text-gray-200",children:C.milestone_name}),a.jsx("span",{className:"text-xs text-gray-500",children:k(C.status)})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-sm text-gray-400",children:[a.jsxs("div",{children:["預計交付:",C.expected_delivery_date]}),C.actual_delivery_date&&a.jsxs("div",{children:["實際交付:",C.actual_delivery_date]}),C.acceptance_date&&a.jsxs("div",{children:["驗收日期:",C.acceptance_date]}),C.billing_amount&&a.jsxs("div",{className:"text-[#00FFFF]",children:["請款:NT$ ",C.billing_amount.toLocaleStr
528ing()]}),C.payment_status&&a.jsx("div",{className:C.payment_status==="paid"?"text-green-400":"text-red-400",children:C.payment_status==="paid"?"已收款":"未收款"})]})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsxs(te,{size:"sm",variant:"outline",onClick:()=>N(C),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(ut,{className:"w-4 h-4 mr-1"}),"建立請款單"]}),a.jsx(te,{size:"sm",variant:"outline",onClick:()=>v(C),className:"border-blue-600 text-blue-400 hover:bg-blue-900",children:"編輯"}),C.status==="pending"&&a.jsx(te,{size:"sm",variant:"outline",onClick:()=>_(C,"delivered"),className:"border-green-600 text-green-400 hover:bg-green-900",children:"標記已交付"}),C.status==="delivered"&&a.jsx(te,{size:"sm",variant:"outline",onClick:()=>_(C,"accepted"),className:"border-green-600 text-green-400 hover:bg-green-900",children:"標記已驗收"}),a.jsx(te,{size:"sm",variant:"outline",onClick:()=>{window.confirm("確定要刪除此里程碑嗎?此操作無法復原。")&&x.mutate(C.id)},className:"border-red-600 text-red-400 hover:bg-red-900",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},C.id))})]})}function $a({fileUrl:e,fileName:t,onClose:r}){const[n,i]=I.useState(!0),[s,o]=I.useState(null),[l,c]=I.useState(100),[f,h]=I.useState(null),[d,m]=I.useState(null);I.useEffect(()=>
528{if(!e){o("沒有可用的文件"),i(!1);return}return(async()=>{try{const v=await fetch(e),b=v.headers.get("content-type")||"";if(b.includes("application/pdf")||e.toLowerCase().includes(".pdf")){m("pdf");const w=await v.blob(),_=URL.createObjectURL(new Blob([w],{type:"application/pdf"}));h(_)}else b.includes("image/")||e.match(/\.(jpg|jpeg|png|gif|webp)$/i)?m("image"):m("unknown");i(!1)}catch(v){console.error("Error fetching file:",v);const b=e.toLowerCase();b.includes(".pdf")?m("pdf"):b.match(/\.(jpg|jpeg|png|gif|webp)/)?m("image"):m("unknown"),i(!1)}})(),()=>{f&&URL.revokeObjectURL(f)}},[e]);const p=()=>{window.open(f||e,"_blank")},x=()=>{navigator.clipboard.writeText(e),alert("✅ 文件連結已複製到剪貼簿!")};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-90 flex items-center justify-center z-[60] p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg w-full h-full max-w-7xl max-h-[95vh] flex flex-col",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl font-bold cyber-text",children:"文件預覽"}),t&&a.jsx("p",{className:"text-sm text-gray-400 mt-1",children:t})]}),!n&&!s&&a.jsxs("div",{className:"flex items-center gap-2 mr-4",children:[a.jsx(te,{size:"sm",variant:"outline",onClick:()=>c(y=>Math.max(y-25,50)),disabled:l<=50,className:"bg-gray-700 text-white border-gray-600 hover:bg-gray-600",children:a.jsx(e9,{className:"w-4 h-4 text-white"})}),a.jsxs("span",{className:"text-sm text-gray-400 min-w-[60px] text-center",children:[l,"%"]}),a.jsx(te,{size:"sm",variant:"outline",onClick:()=>c(y=>Math.min(y+25,200)),disabled:l>=200,className:"bg-gray-700 text-white border-gray-600 hover:bg-gray-600",children:a.jsx(ZU,{className:"w-4 h-4 text-white"})}),a.jsx(te,{size:"sm",variant:"outline",onClick:x,className:"bg-gray-700 text-white border-gray-600 hover:bg-gray-600",title:"分享連結",children:a.jsx(PU,{className:"w-4 h-4 text-white"})}),a.jsxs(te,{size:"sm",variant:"outline",onClick:p,className:"bg-gray-700 text-white border-gray-600 hover:bg-gray-600",children:[a.jsx(il,{className:"w-4 h-4 text-white mr-1"}),"新視窗"]}),a.jsxs("a",{href:e,download:!0,className:"flex items-center gap-2 px-3 py-2 bg-[#00FFFF] text-black hover:bg-[#00CCCC] rounded text-sm font-semibold",children:[a.jsx(li,{className:"w-4 h-4"}),"下載"]})]}),a.jsx("button",{onClick:r,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsx("div",{className:"flex-1 overflow-hidden relative",children:n?a.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[a.jsx(Ht,{className:"w-12 h-12 text-[#00FFFF] animate-spin"}),a.jsx("p",{className:"text-gray-400",children:"正在載入文件..."})]}):s?a.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[a.jsx(oi,{className:"w-16 h-16 text-red-400"}),a.jsx("p",{className:"text-red-400 text-lg font-semibold",children:s})]}):a.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-900 p-4 overflow-auto",children:d==="pdf"?a.jsx("iframe",{src:`${f||e}#toolbar=1&navpanes=1&scrollbar=1&view=FitH`,className:"border-0 shadow-2xl rounded bg-white",style:{width:`${l}%`,height:"80vh",maxWidth:"100%",minHeight:"500px"},title:"文件預覽",type:"application/pdf"}):d==="image"?a.jsx("img",{src:e,alt:"文件",className:"max-w-full max-h-[80vh] object-contain shadow-2xl rounded",style:{transform:`scale(${l/100})`}}):a.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-gray-400",children:[a.jsx(oi,{className:"w-16 h-16"}),a.jsx("p",{children:"不支援預覽此文件類型"}),a.jsxs("a",{href:e,download:!0,className:"flex items-center gap-2 px-4 py-2 bg-[#00FFFF] text-black hover:bg-[#00CCCC] rounded font-semibold",children:[a.jsx(li,{className:"w-4 h-4"}),"下載文件"]})]})})})]})})}function Lye({contract:e,onUpdate:t}){var b;const[r,n]=I.useState(""),[i,s]=I.useState(""),o=at(),{data:l=[]}=Te({queryKey:["users"],queryFn:()=>ee.entities.User.list()}),{data:c}=Te({queryKey:["currentUser"],queryFn:()=>ee.auth.me()}),f=Ye({mutationFn:w=>ee.entities.Contract.update(e.id,w),onSuccess:()=>{o.invalidateQueries(["contracts"]),t&&t()}}),h=async(w,_,N)=>{try{await ee.integrations.Core.SendEmail({to:w,subject:_,body:N})}catch(S){console.error("Send notification error:",S)}},d=async()=>{var N;if(!i){alert("請選擇審批人");return}const w={action:"submit",from_status:e.status,to_status:"under_review",actor:(c==null?void 0:c.full_name)||"",actor_email:(c==null?void 0:c.email)||"",comment:r,timestamp:new Date().toISOString()},_=[...e.approval_workflow||[],w];await f.mutateAsync({status:"under_review",current_reviewer:i,approval_workflow:_}),l.find(S=>S.email===i),await h(i,`【合約審核請求】${e.project_name}`,`您有一份合約待審核:
529
530合約編號:${e.contract_number}
531專案名稱:${e.project_name}
532金額:NT$ ${(N=e.total_amount)==null?void 0:N.toLocaleString()}
533
534提交人:${c==null?void 0:c.full_name}
535備註:${r||"無"}`),n("")},m=async()=>{var S,k;const w={action:"approve",from_status:e.status,to_status:"approved",actor:(c==null?void 0:c.full_name)||"",actor_email:(c==null?void 0:c.email)||"",comment:r,timestamp:new Date().toISOString()},_=[...e.approval_workflow||[],w];await f.mutateAsync({status:"approved",current_reviewer:null,approval_workflow:_});const N=(k=(S=e.approval_workflow)==null?void 0:S.find(C=>C.action==="submit"))==null?void 0:k.actor_email;N&&await h(N,`【合約已批准】${e.project_name}`,`您提交的合約已獲批准:
536
537合約編號:${e.contract_number}
538專案名稱:${e.project_name}
539
540審批人:${c==null?void 0:c.full_name}
541備註:${r||"無"}`),n("")},p=async()=>{var S,k;const w={action:"reject",from_status:e.status,to_status:"rejected",actor:(c==null?void 0:c.full_name)||"",actor_email:(c==null?void 0:c.email)||"",comment:r,timestamp:new Date().toISOString()},_=[...e.approval_workflow||[],w];await f.mutateAsync({status:"rejected",current_reviewer:null,approval_workflow:_});const N=(k=(S=e.approval_workflow)==null?void 0:S.find(C=>C.action==="submit"))==null?void 0:k.actor_email;N&&await h(N,`【合約已拒絕】${e.project_name}`,`您提交的合約已被拒絕:
542
543合約編號:${e.contract_number}
544專案名稱:${e.project_name}
545
546審批人:${c==null?void 0:c.full_name}
547拒絕原因:${r||"無"}`),n("")},x=w=>{switch(w){case"draft":return a.jsx(kL,{className:"w-5 h-5 text-gray-400"});case"under_review":return a.jsx(Ra,{className:"w-5 h-5 text-yellow-400"});case"approved":return a.jsx(xr,{className:"w-5 h-5 text-green-400"});case"rejected":return a.jsx($s,{className:"w-5 h-5 text-red-400"});default:return a.jsx(oi,{className:"w-5 h-5 text-gray-400"})}},y=w=>({draft:"草稿",under_review:"審核中",approved:"已批准",rejected:"已拒絕",pending:"待簽約",active:"執行中",completed:"已完成",terminated:"已終止"})[w]||w,v=(c==null?void 0:c.email)===e.current_reviewer;return a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 space-y-4",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text flex items-center gap-2",children:[x(e.status),"合約審批工作流程"]}),a.jsxs("div",{className:"flex items-center gap-4 p-4 bg-gray-900 rounded-lg",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"當前狀態"}),a.jsx("p",{className:"text-lg font-semibold",style:{color:e.status==="approved"?"#00FF00":e.status==="rejected"?"#FF4444":e.status==="under_review"?"#FFD700":"#808080"},children:y(e.status)})]}),e.current_reviewer&&a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"當前審批人"}),a.jsx("p",{className:"text-gray-200",children:((b=l.find(w=>w.email===e.current_reviewer))==null?void 0:b.full_name)||e.current_reviewer})]})]}),e.status==="draft"&&a.jsxs("div",{className:"space-y-3 p-4 border border-gray-700 rounded-lg",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"提交審核"}),a.jsxs(qe,{value:i,onValueChange:s,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇審批人"})}),a.jsx($e,{className:"bg-black border-gray-700",children:l.filter(w=>w.role==="admin").map(w=>a.jsxs(se,{value:w.email,className:"text-white",children:[w.full_name," (",w.email,")"]},w.id))})]}),a.jsx(Pt,{placeholder:"備註(選填)",value:r,onChange:w=>n(w.target.value),className:"bg-black border-gray-700 h-20"}),a.jsxs(te,{onClick:d,disabled:f.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] w-full",children:[a.jsx(Wi,{className:"w-4 h-4 mr-2"}),f.isPending?"提交中...":"提交審核"]})]}),e.status==="under_review"&&v&&a.jsxs("div",{className:"space-y-3 p-4 border border-gray-700 rounded-lg",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"審批操作"}),a.jsx(Pt,{placeholder:"審批意見(選填)",value:r,onChange:w=>n(w.target.value),className:"bg-black border-gray-700 h-20"}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs(te,{onClick:m,disabled:f.isPending,className:"bg-green-600 hover:bg-green-700 flex-1",children:[a.jsx(xr,{className:"w-4 h-4 mr-2"}),"批准"]}),a.jsxs(te,{onClick:p,disabled:f.isPending,className:"bg-red-600 hover:bg-red-700 flex-1",children:[a.jsx($s,{className:"w-4 h-4 mr-2"}),"拒絕"]})]})]}),e.status==="under_review"&&!v&&a.jsxs("div",{className:"p-4 bg-yellow-900/30 border border-yellow-600 rounded-lg text-yellow-400 text-center",children:[a.jsx(Ra,{className:"w-6 h-6 mx-auto mb-2"}),"等待審批人審核中..."]}),e.status==="rejected"&&a.jsxs("div",{className:"space-y-3 p-4 border border-gray-700 rounded-lg",children:[a.jsx("p",{className:"text-sm text-red-400",children:"合約已被拒絕,您可以修改後重新提交"}),a.jsx(te,{onClick:()=>f.mutate({status:"draft"}),disabled:f.isPending,className:"bg-gray-700 hover:bg-gray-600",children:"重新編輯為草稿"})]}),e.approval_workflow&&e.approval_workflow.length>0&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-400",children:"審批歷史"}),a.jsx("div",{className:"space-y-2",children:e.approval_workflow.map((w,_)=>a.jsxs("div",{className:"flex items-start gap-3 p-3 bg-gray-900 rounded-lg text-sm",children:[a.jsxs("div",{className:"mt-0.5",children:[w.action==="submit"&&a.jsx(Wi,{className:"w-4 h-4 text-blue-400"}),w.action==="approve"&&a.jsx(xr,{className:"w-4 h-4 text-green-400"}),w.action==="reject"&&a.jsx($s,{className:"w-4 h-4 text-red-400"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-200",children:w.actor}),a.jsx("span",{className:"text-gray-500",children:w.action==="submit"?"提交審核":w.action==="approve"?"批准":"拒絕"})]}),w.comment&&a.jsx("p",{className:"text-gray-400 mt-1",children:w.
547comment}),a.jsx("p",{className:"text-gray-500 text-xs mt-1",children:new Date(w.timestamp).toLocaleString("zh-TW")})]})]},_))})]})]})}function Dye({contract:e}){const[t,r]=I.useState(!1),[n,i]=I.useState(null),s=at(),{data:o=[]}=Te({queryKey:["contract_costs",e.id],queryFn:()=>ee.entities.ContractCost.filter({contract_id:e.id})}),l=Ye({mutationFn:d=>ee.entities.ContractCost.delete(d),onSuccess:()=>{s.invalidateQueries(["contract_costs"]),alert("成本項目已刪除")}}),c=o.reduce((d,m)=>d+(m.cost_amount||0),0),f=o.filter(d=>d.payment_status==="paid").reduce((d,m)=>d+(m.cost_amount||0),0),h=d=>{const m={unpaid:{label:"未支付",color:"#FFD700"},paid:{label:"已支付",color:"#00FF00"}},p=m[d]||m.unpaid;return a.jsx("span",{className:"px-2 py-1 rounded text-xs font-semibold",style:{backgroundColor:p.color+"33",color:p.color,border:`1px solid ${p.color}`},children:p.label})};return a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ut,{className:"w-6 h-6 text-[#00FFFF]"}),a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:"成本管理"})]}),a.jsxs(te,{onClick:()=>{i(null),r(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"新增成本"]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"總成本"}),a.jsxs("p",{className:"text-2xl font-bold text-[#00FFFF]",children:["NT$ ",c.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已支付成本"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",f.toLocaleString()]})]})]}),a.jsx("div",{className:"space-y-3",children:o.length===0?a.jsxs("div",{className:"text-center py-8 text-gray-400",children:[a.jsx(ut,{className:"w-12 h-12 mx-auto mb-2 text-gray-600"}),a.jsx("p",{children:"尚無成本記錄"})]}):o.map(d=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("h4",{className:"font-semibold text-white",children:d.cost_item_name}),h(d.payment_status)]}),a.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[a.jsxs("p",{children:["金額:",a.jsxs("span",{className:"text-[#00FFFF] font-semibold",children:["NT$ ",(d.cost_amount||0).toLocaleString()]})]}),d.vendor_name&&a.jsxs("p",{children:["廠商:",d.vendor_name]}),d.payment_date&&a.jsxs("p",{children:["支付日期:",d.payment_date]}),d.notes&&a.jsxs("p",{children:["備註:",d.notes]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{i(d),r(!0)},className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:a.jsx(qt,{className:"w-4 h-4"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{confirm("確定要刪除此成本項目嗎?")&&l.mutate(d.id)},className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},d.id))}),t&&a.jsx($ye,{cost:n,contract:e,onClose:()=>{r(!1),i(null)}})]})}function $ye({cost:e,contract:t,onClose:r}){const[n,i]=I.useState({contract_id:t.id,contract_number:t.contract_number,project_name:t.project_name,cost_item_name:"",cost_amount:"",payment_date:new Date().toISOString().split("T")[0],payment_status:"unpaid",vendor_name:"",notes:"",...e}),s=at(),o=Ye({mutationFn:c=>e?ee.entities.ContractCost.update(e.id,c):ee.entities.ContractCost.create(c),onSuccess:()=>{s.invalidateQueries(["contract_costs"]),alert("儲存成功!"),r()}}),l=c=>{c.preventDefault(),o.mutate({...n,cost_amount:parseFloat(n.cost_amount)})};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h3",{className:"text-xl font-bold cyber-text",children:e?"編輯成本項目":"新增成本項目"}),a.jsx("button",{onClick:r,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:l,className:"p-6 space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"成本項目名稱 *"}),a.jsx(ne,{required:!0,value:n.cost_item_name,onChange:c=>i({...n,cost_item_name:c.target.value}
547),placeholder:"例如:人力成本、設備費用",className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"成本金額 *"}),a.jsx(ne,{type:"number",required:!0,value:n.cost_amount,onChange:c=>i({...n,cost_amount:c.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"供應商/廠商名稱"}),a.jsx(ne,{value:n.vendor_name,onChange:c=>i({...n,vendor_name:c.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"支付日期"}),a.jsx(ne,{type:"date",value:n.payment_date,onChange:c=>i({...n,payment_date:c.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"支付狀態"}),a.jsxs(qe,{value:n.payment_status,onValueChange:c=>i({...n,payment_status:c}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"unpaid",className:"text-white",children:"未支付"}),a.jsx(se,{value:"paid",className:"text-white",children:"已支付"})]})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:n.notes,onChange:c=>i({...n,notes:c.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]",rows:3})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:r,className:"bg-gray-800 text-white border-gray-600 hover:bg-gray-700",children:"取消"}),a.jsx(te,{type:"submit",disabled:o.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:o.isPending?"儲存中...":"儲存"})]})]})]})})}function l8({contract:e,onClose:t,onEdit:r}){const[n,i]=I.useState(!1),[s,o]=I.useState(!1),[l,c]=I.useState(e.customer_name||"");at();const f=Ye({mutationFn:async d=>{var y;if(!e.file_url)throw new Error("無合約檔案可發送");const p=((y=(await ee.entities.CompanySetting.list())[0])==null?void 0:y.company_name)||"無限未來有限公司",x=`您好,
548
549附件為貴公司的專案合約文件:
550
551專案名稱:${e.project_name}
552合約編號:${e.contract_number}
553合約金額:NT$ ${(e.total_amount||0).toLocaleString()}
554簽約日期:${e.signing_date}
555
556合約文件下載連結:${e.file_url}
557
558請查閱附件檔案。如有任何疑問,請隨時與我們聯繫。
559
560此致
561${p}`;await ee.integrations.Core.SendEmail({from_name:"無限未來管理系統",to:d,subject:`合約文件 - ${e.project_name} (${e.contract_number})`,body:x})},onSuccess:()=>{alert("✅ 合約已成功發送!"),o(!1)},onError:d=>alert("發送失敗: "+d.message)}),h=d=>({draft:"草稿",under_review:"審核中",approved:"已批准",rejected:"已拒絕",pending:"待簽約",active:"執行中",completed:"已完成",terminated:"已終止"})[d]||d;return a.jsxs("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-5xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"合約詳情"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",onClick:()=>o(!0),disabled:!e.file_url,className:"bg-blue-900 text-white hover:bg-blue-800 border-blue-700",children:[a.jsx(Wi,{className:"w-4 h-4 mr-2"}),"發送合約"]}),a.jsxs(te,{variant:"outline",onClick:()=>i(!0),disabled:!e.file_url,className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"}),"預覽合約"]}),a.jsxs(te,{variant:"outline",onClick:r,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(qt,{className:"w-4 h-4 mr-2 text-black"}),"編輯"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"專案名稱"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:e.project_name})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"合約編號"}),a.jsx("p",{className:"text-gray-200",children:e.contract_number})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"客戶名稱"}),a.jsx("p",{className:"text-gray-200",children:e.customer_name})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"合約金額"}),a.jsxs("p",{className:"text-2xl font-bold text-[#00FFFF]",children:["NT$ ",(e.total_amount||0).toLocaleStr
561ing()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"簽約日期"}),a.jsx("p",{className:"text-gray-200",children:e.signing_date})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"狀態"}),a.jsx("p",{className:"text-gray-200",children:h(e.status)})]})]})]}),a.jsx(Lye,{contract:e}),e.notes&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-3",children:"備註"}),a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.notes})]}),a.jsx(Mye,{contractId:e.id}),a.jsx(Dye,{contract:e})]})]}),n&&e.file_url&&a.jsx($a,{fileUrl:e.file_url,fileName:`${e.project_name} - 合約文件`,onClose:()=>i(!1)}),n&&e.file_url&&a.jsx($a,{fileUrl:e.file_url,fileName:`${e.project_name} - 合約文件`,onClose:()=>i(!1)}),s&&a.jsx("div",{className:"fixed inset-0 bg-black/90 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-md w-full p-6",children:[a.jsx("h3",{className:"text-xl font-bold cyber-text mb-4",children:"發送合約"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-300",children:"收件人Email"}),a.jsx(ne,{type:"email",value:l,onChange:d=>c(d.target.value),placeholder:"輸入收件人Email",className:"bg-black border-gray-700 mt-2"})]}),a.jsxs("div",{className:"text-sm text-gray-400",children:[a.jsxs("p",{children:["合約:",e.contract_number]}),a.jsxs("p",{children:["專案:",e.project_name]})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[a.jsx(te,{variant:"outline",onClick:()=>o(!1),className:"bg-gray-800 text-white border-gray-600",children:"取消"}),a.jsxs(te,{onClick:()=>f.mutate(l),disabled:!l||f.isPending,className:"bg-blue-900 text-white hover:bg-blue-800",children:[a.jsx(Wi,{className:"w-4 h-4 mr-2"}),f.isPending?"發送中...":"發送"]})]})]})]})})]})}function c8({invoice:e,onClose:t,onEdit:r}){const[n,i]=I.useState(!1),s=l=>({draft:"草稿",issued:"已開立",voided:"作廢"})[l]||l,o=l=>({software_project:"軟體專案",course_project:"課程專案",online_course:"線上課程",other:"其他"})[l]||l;return a.jsxs("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"發票詳情"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(te,{onClick:r,variant:"outline",className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(qt,{className:"w-4 h-4 mr-2"}),"編輯"]}),e.file_url&&a.jsxs(te,{onClick:()=>i(!0),variant:"outline",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"}),"查看檔案"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"發票號碼"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:e.invoice_number})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"狀態"}),a.jsx("p",{className:"text-gray-200",children:s(e.status)})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"發票類型"}),a.jsx("p",{className:"text-gray-200",children:o(e.invoice_type)})]}),e.related_name&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"關聯專案"}),a.jsx("p",{className:"text-gray-200",children:e.related_name})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"客戶名稱"}),a.jsx("p",{className:"text-gray-200",children:e.customer_name})]}),e.customer_tax_id&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"客戶統編"}),a.jsx("p",{className:"text-gray-200",children:e.customer_tax_id})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"開立日期"}),a.jsx("p",{className:"text-gray-200",children:e.issue_date})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"金額明細"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"未稅金額"}),a.jsxs("span",{className:"text-gray-200",children:["NT$ ",(e.untaxed_amount||0).toLocaleStr
561ing()]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-400",children:"稅額 (5%)"}),a.jsxs("span",{className:"text-gray-200",children:["NT$ ",(e.tax_amount||0).toLocaleString()]})]}),a.jsxs("div",{className:"flex justify-between border-t border-gray-700 pt-3",children:[a.jsx("span",{className:"text-[#00FFFF] font-semibold",children:"含稅總金額"}),a.jsxs("span",{className:"text-[#00FFFF] font-semibold text-xl",children:["NT$ ",(e.total_amount||0).toLocaleString()]})]})]})]}),e.notes&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-400 mb-2",children:"備註"}),a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.notes})]})]})]}),n&&e.file_url&&a.jsx($a,{fileUrl:e.file_url,fileName:`發票 - ${e.invoice_number}`,onClose:()=>i(!1)})]})}function qye(){const[e,t]=I.useState(new Date),[r,n]=I.useState([]),[i,s]=I.useState(null),[o,l]=I.useState(!1),c=Wf(),{data:f=[]}=Te({queryKey:["contracts"],queryFn:()=>ee.entities.Contract.list()}),{data:h=[]}=Te({queryKey:["milestones"],queryFn:()=>ee.entities.Milestone.list()}),{data:d=[]}=Te({queryKey:["invoices"],queryFn:()=>ee.entities.Invoice.list()}),{data:m=[]}=Te({queryKey:["employees"],queryFn:()=>ee.entities.User.list()}),{data:p=[]}=Te({queryKey:["meetings"],queryFn:()=>ee.entities.Meeting.list()});I.useEffect(()=>{const C=[];p.forEach(O=>{O.start_time&&C.push({date:O.start_time.split("T")[0],title:`會議:${O.meeting_title}`,type:"meeting",color:"#9C27B0",id:O.id,data:O})}),f.forEach(O=>{O.signing_date&&C.push({date:O.signing_date,title:`合約簽署:${O.project_name}`,type:"contract",color:"#00FFFF",id:O.id,data:O})}),h.forEach(O=>{if(O.expected_delivery_date){const R=f.find(A=>A.id===O.contract_id);C.push({date:O.expected_delivery_date,title:`里程碑:${O.milestone_name}`,type:"milestone",color:"#FFD700",id:O.id,contractId:O.contract_id,data:R})}}),d.forEach(O=>{O.due_date&&O.status!=="paid"&&C.push({date:O.due_date,title:`發票到期:${O.invoice_number}`,type:"invoice",color:"#FF6347",id:O.id,data:O})}),m.forEach(O=>{if(O.birthday){const R=new Date(O.birthday),A=new Date(e.getFullYear(),R.getMonth(),R.getDate());C.push({date:A.toISOString().split("T")[0],title:`生日:${O.full_name}`,type:"birthday",color:"#FF69B4",id:O.id,linkPage:"Employees"})}}),n(C)},[f,h,d,m,p,e]);const x=C=>new Date(C.getFullYear(),C.getMonth()+1,0).getDate(),y=C=>new Date(C.getFullYear(),C.getMonth(),1).getDay(),v=()=>{t(new Date(e.getFullYear(),e.getMonth()-1))},b=()=>{t(new Date(e.getFullYear(),e.getMonth()+1))},w=C=>{const O=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(C).padStart(2,"0")}`;return r.filter(R=>R.date===O)},_=x(e),N=y(e),S=e.toLocaleDateString("zh-TW",{year:"numeric",month:"long"}),k=[];for(let C=0;C<N;C++)k.push(null);for(let C=1;C<=_;C++)k.push(C);return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"事件日曆"})}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx(te,{variant:"outline",onClick:v,className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:a.jsx(qz,{className:"w-5 h-5"})}),a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:S}),a.jsx(te,{variant:"outline",onClick:b,className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:a.jsx(zz,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"grid grid-cols-7 gap-2",children:[["日","一","二","三","四","五","六"].map(C=>a.jsx("div",{className:"text-center font-semibold text-[#00FFFF] p-2",children:C},C)),k.map((C,O)=>{const R=C?w(C):[],A=C&&new Date().getDate()===C&&new Date().getMonth()===e.getMonth()&&new Date().getFullYear()===e.getFullYear();return a.jsx("div",{className:`min-h-[100px] p-2 cyber-border rounded ${C?"bg-gray-900":"bg-transparent"} ${A?"border-[#00FFFF] border-2":""}`,children:C&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"text-right text-gray-400 text-sm mb-1",children:C}),a.jsx("div",{className:"space-y-1",children:R.map((P,E)=>a.jsx("div",{className:"text-xs p-1 rounded cursor-pointer hover:opacity-80 transition-opacity",style:{backgroundColor:P.color+"33",borderLeft:`3px solid ${P.color}`},title:P.title,onClick:()=>{P.type==="meeting"||P.type==="contract"||P.type==="invoice"?(s(P),l(!0)):P.type==="birthday"&&c(Ur("Employees"))},children:a.jsx("div",{className:"truncate",children:P.title})},E))})]})},O)})]}),a.jsxs("div",{className:"mt-6 flex flex-wrap gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:"#9
561C27B0"}}),a.jsx("span",{className:"text-sm text-gray-300",children:"會議"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:"#00FFFF"}}),a.jsx("span",{className:"text-sm text-gray-300",children:"合約簽署"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:"#FFD700"}}),a.jsx("span",{className:"text-sm text-gray-300",children:"里程碑"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:"#FF6347"}}),a.jsx("span",{className:"text-sm text-gray-300",children:"發票到期"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:"#FF69B4"}}),a.jsx("span",{className:"text-sm text-gray-300",children:"員工生日"})]})]})]}),o&&i&&i.type==="meeting"&&a.jsx($6,{meeting:i.data,onClose:()=>{l(!1),s(null)},onEdit:()=>{l(!1),c(Ur("Meetings"))}}),o&&i&&i.type==="contract"&&a.jsx(l8,{contract:i.data,onClose:()=>{l(!1),s(null)},onEdit:()=>{l(!1),c(Ur("Contracts"))}}),o&&i&&i.type==="invoice"&&a.jsx(c8,{invoice:i.data,onClose:()=>{l(!1),s(null)},onEdit:()=>{l(!1),c(Ur("InvoiceManagement"))}})]})}function Bye(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(""),[o,l]=I.useState("all"),[c,f]=I.useState(null),h=at(),{data:d=[],isLoading:m}=Te({queryKey:["companyDocuments"],queryFn:()=>ee.entities.CompanyDocument.list("-created_date")}),p=Ye({mutationFn:w=>ee.entities.CompanyDocument.delete(w),onSuccess:()=>{h.invalidateQueries(["companyDocuments"])}}),x=d.filter(w=>{var S,k;const _=!i||((S=w.document_name)==null?void 0:S.toLowerCase().includes(i.toLowerCase()))||((k=w.description)==null?void 0:k.toLowerCase().includes(i.toLowerCase())),N=o==="all"||w.document_type===o;return _&&N}),y=w=>({registration:"設立登記文件",articles:"公司章程",introduction:"公司介紹文件",procurement:"採購文件",company_seal:"公司大章",personal_seal:"個人小章",other:"其他"})[w]||"其他",v=w=>({registration:"#00FFFF",articles:"#FFD700",introduction:"#00FF00",procurement:"#FFA500",company_seal:"#FF00FF",personal_seal:"#00BFFF",other:"#808080"})[w]||"#808080",b=w=>{window.open(w.file_url,"_blank")};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"公司文件管理"}),a.jsxs(te,{onClick:()=>{n(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"上傳文件"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(Et,{className:"w-8 h-8 text-[#00FFFF]"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"文件總數"}),a.jsx("p",{className:"text-2xl font-bold cyber-text",children:d.length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(M0,{className:"w-8 h-8 text-[#FF00FF]"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"公司大章"}),a.jsx("p",{className:"text-2xl font-bold text-[#FF00FF]",children:d.filter(w=>w.document_type==="company_seal").length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(M0,{className:"w-8 h-8 text-[#00BFFF]"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"個人小章"}),a.jsx("p",{className:"text-2xl font-bold text-[#00BFFF]",children:d.filter(w=>w.document_type==="personal_seal").length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(Et,{className:"w-8 h-8 text-green-400"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"其他文件"}),a.jsx("p",{className:"text-2xl font-bold text-green-400",children:d.filter(w=>
561!["company_seal","personal_seal"].includes(w.document_type)).length})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative col-span-2",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋文件名稱或描述...",value:i,onChange:w=>s(w.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("select",{value:o,onChange:w=>l(w.target.value),className:"px-4 py-2 bg-black border border-gray-700 rounded text-white focus:border-[#00FFFF] focus:outline-none",children:[a.jsx("option",{value:"all",children:"所有類型"}),a.jsx("option",{value:"registration",children:"設立登記文件"}),a.jsx("option",{value:"articles",children:"公司章程"}),a.jsx("option",{value:"introduction",children:"公司介紹文件"}),a.jsx("option",{value:"procurement",children:"採購文件"}),a.jsx("option",{value:"company_seal",children:"公司大章"}),a.jsx("option",{value:"personal_seal",children:"個人小章"}),a.jsx("option",{value:"other",children:"其他"})]})]})}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:m?a.jsx("div",{className:"col-span-full text-center py-12 text-gray-400",children:"載入中..."}):x.length===0?a.jsxs("div",{className:"col-span-full text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(Et,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無文件資料"})]}):x.map(w=>{const _=v(w.document_type),N=["company_seal","personal_seal"].includes(w.document_type);return a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-start justify-between",children:a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[N?a.jsx(M0,{className:"w-5 h-5",style:{color:_}}):a.jsx(Et,{className:"w-5 h-5",style:{color:_}}),a.jsx("h3",{className:"font-semibold text-white",children:w.document_name})]}),a.jsx("span",{className:"px-2 py-1 rounded text-xs font-semibold",style:{backgroundColor:`${_}33`,color:_,border:`1px solid ${_}`},children:y(w.document_type)})]})}),w.description&&a.jsx("p",{className:"text-sm text-gray-400 line-clamp-2",children:w.description}),a.jsxs("div",{className:"text-xs text-gray-500",children:["上傳日期:",w.upload_date||new Date(w.created_date).toLocaleDateString()]}),a.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-gray-700",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>f(w.file_url),className:"flex-1 bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"預覽"]}),a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>b(w),className:"flex-1 bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(li,{className:"w-4 h-4 mr-1"}),"下載"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{window.confirm("確定要刪除此文件嗎?")&&p.mutate(w.id)},className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},w.id)})}),e&&a.jsx(zye,{document:r,onClose:()=>{t(!1),n(null)}}),c&&a.jsx($a,{fileUrl:c,onClose:()=>f(null)})]})}function zye({document:e,onClose:t}){const[r,n]=I.useState({document_name:"",document_type:"other",file_url:"",description:"",upload_date:new Date().toISOString().split("T")[0],...e}),[i,s]=I.useState(!1),o=oe.useRef(null),l=at(),c=Ye({mutationFn:d=>e?ee.entities.CompanyDocument.update(e.id,d):ee.entities.CompanyDocument.create(d),onSuccess:()=>{l.invalidateQueries(["companyDocuments"]),t()}}),f=async d=>{const m=d.target.files[0];if(m)try{s(!0);const{file_url:p}=await ee.integrations.Core.UploadFile({file:m});n({...r,file_url:p,document_name:r.document_name||m.name})}catch(p){console.error(p),alert("上傳失敗")}finally{s(!1)}},h=d=>{d.preventDefault(),c.mutate(r)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯文件":"上傳文件"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:h,className:"p-6 space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm text-gray-400",children:"文件類型 *"}
561),a.jsxs("select",{required:!0,value:r.document_type,onChange:d=>n({...r,document_type:d.target.value}),className:"w-full px-4 py-2 bg-black border border-gray-700 rounded text-white focus:border-[#00FFFF] focus:outline-none",children:[a.jsx("option",{value:"registration",children:"設立登記文件"}),a.jsx("option",{value:"articles",children:"公司章程"}),a.jsx("option",{value:"introduction",children:"公司介紹文件"}),a.jsx("option",{value:"procurement",children:"採購文件"}),a.jsx("option",{value:"company_seal",children:"公司大章"}),a.jsx("option",{value:"personal_seal",children:"個人小章"}),a.jsx("option",{value:"other",children:"其他"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm text-gray-400",children:"文件名稱 *"}),a.jsx(ne,{required:!0,value:r.document_name,onChange:d=>n({...r,document_name:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]",placeholder:"例如:公司設立登記證明"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm text-gray-400",children:"上傳文件 *"}),a.jsxs("div",{className:"flex items-center gap-4",children:[r.file_url&&a.jsxs("div",{className:"flex-1 text-sm text-green-400 flex items-center",children:[a.jsx(Et,{className:"w-4 h-4 mr-2"}),"已上傳文件"]}),a.jsxs(te,{type:"button",variant:"outline",disabled:i,className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",onClick:()=>{var d;return(d=o.current)==null?void 0:d.click()},children:[i?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),i?"上傳中...":"選擇文件"]}),a.jsx("input",{ref:o,type:"file",className:"hidden",onChange:f,accept:".pdf,.doc,.docx,.jpg,.jpeg,.png"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm text-gray-400",children:"文件描述"}),a.jsx(ne,{value:r.description,onChange:d=>n({...r,description:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]",placeholder:"簡單描述文件內容"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm text-gray-400",children:"上傳日期"}),a.jsx(ne,{type:"date",value:r.upload_date,onChange:d=>n({...r,upload_date:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-gray-800 text-white border-gray-600 hover:bg-gray-700",children:"取消"}),a.jsxs(te,{type:"submit",disabled:c.isPending||!r.file_url,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[c.isPending?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):null,c.isPending?"儲存中...":"儲存"]})]})]})]})})}function Uye({contract:e,customers:t,orders:r=[],onClose:n}){const[i,s]=I.useState({contract_number:"",project_name:"",customer_id:"",customer_name:"",order_id:"",order_number:"",total_amount:"",signing_date:new Date().toISOString().split("T")[0],end_date:"",status:"draft",file_url:"",notes:"",...e}),[o,l]=I.useState(!1),[c,f]=I.useState(!1),h=at(),d=Ye({mutationFn:async v=>{let b;if(e?b=await ee.entities.Contract.update(e.id,v):b=await ee.entities.Contract.create(v),v.status==="active"&&(!e||e.status!=="active"))try{await ee.entities.Invoice.create({invoice_number:`INV-${b.contract_number}-${Date.now()}`,invoice_type:"software_project",related_id:b.id,related_name:b.project_name,customer_name:b.customer_name,issue_date:new Date().toISOString().split("T")[0],total_amount:b.total_amount,tax_amount:Math.round(b.total_amount*.05),untaxed_amount:Math.round(b.total_amount*.95),status:"draft",notes:`自動生成 - 合約編號:${b.contract_number}`}),await ee.entities.Notification.create({title:"合約啟動 - 自動生成發票",message:`合約 ${b.contract_number} 已啟動,系統自動生成發票草稿`,type:"info",link:"/InvoiceManagement",created_at:new Date().toISOString()})}catch(w){console.error("Auto-generate invoice failed:",w)}return b},onSuccess:()=>{h.invalidateQueries(["contracts"]),h.invalidateQueries(["invoices"]),alert("儲存成功!"),n()}}),m=async v=>{const b=v.target.files[0];if(b)try{l(!0);const{file_url:w}=await ee.integrations.Core.UploadFile({file:b});if(s(_=>({..._,file_url:w})),b.type==="application/pdf"||b.type.includes("image")){f(!0);const _=await ee.integrations.Core.ExtractDataFromUploadedFile({file_url:w,json_schema:{type:"object",properties:{contract_subject:{type:"string",description:"合約標的物名稱或專案名稱"},total_price:{type:"number",description:"價款總額或合約金額"},contract_number:{type:"string",description:"合約編號"},signing_date:{type:"string",description:"簽約日期,格式YYYY-MM-DD"}}}});_.status==="success"&&_.output&&s(N=>({...N,project_name:_.output.contract_subject||N.project_name,total_amount:_.output.total_price||N.total_amount,contract_number:_.output.contract_number||N.c
561ontract_number,signing_date:_.output.signing_date||N.signing_date})),f(!1)}}catch(w){console.error("File upload error:",w),alert("文件上傳失敗")}finally{l(!1)}},p=v=>{const b=t.find(w=>w.id===v);s(w=>({...w,customer_id:v,customer_name:(b==null?void 0:b.customer_name)||""}))},x=v=>{const b=r.find(w=>w.id===v);b&&s(w=>({...w,order_id:v,order_number:b.order_number,project_name:b.project_name,total_amount:b.total_amount}))},y=v=>{v.preventDefault(),d.mutate(i)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-3xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯合約":"新增合約"}),a.jsx("button",{onClick:n,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:y,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"合約文件上傳(PDF/DOCX)"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("input",{type:"file",accept:".pdf,.docx,.jpg,.jpeg,.png",onChange:m,className:"hidden",id:"file-upload"}),a.jsxs("label",{htmlFor:"file-upload",className:"flex items-center gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-700 rounded cursor-pointer border border-gray-600",children:[a.jsx(Hr,{className:"w-4 h-4"}),o?"上傳中...":"選擇文件"]}),i.file_url&&a.jsx("a",{href:i.file_url,target:"_blank",rel:"noopener noreferrer",className:"text-[#00FFFF] hover:underline text-sm",children:"查看已上傳文件"})]}),c&&a.jsxs("div",{className:"flex items-center gap-2 text-[#00FFFF] text-sm",children:[a.jsx(Ht,{className:"w-4 h-4 animate-spin"}),"正在智能提取合約資訊..."]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"合約編號 *"}),a.jsx(ne,{required:!0,value:i.contract_number,onChange:v=>s({...i,contract_number:v.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"專案名稱(合約標的物)*"}),a.jsx(ne,{required:!0,value:i.project_name,onChange:v=>s({...i,project_name:v.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶 *"}),a.jsxs(qe,{value:i.customer_id,onValueChange:p,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇客戶"})}),a.jsx($e,{className:"bg-black border-gray-700",children:t.map(v=>a.jsx(se,{value:v.id,className:"text-white",children:v.customer_name},v.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯訂單"}),a.jsxs(qe,{value:i.order_id,onValueChange:x,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇訂單(選填)"})}),a.jsx($e,{className:"bg-black border-gray-700",children:r.map(v=>a.jsxs(se,{value:v.id,className:"text-white",children:[v.order_number," - ",v.project_name]},v.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"合約總金額 *"}),a.jsx(ne,{type:"number",required:!0,value:i.total_amount,onChange:v=>s({...i,total_amount:parseFloat(v.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"簽約日期 *"}),a.jsx(ne,{type:"date",required:!0,value:i.signing_date,onChange:v=>s({...i,signing_date:v.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"合約到期日"}),a.jsx(ne,{type:"date",value:i.end_date,onChange:v=>s({...i,end_date:v.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"合約狀態"}),a.jsxs(qe,{value:i.status,onValueChange:v=>s({...i,status:v}),children:[a.jsx(De,{className:"bg-black border-gray-700 text-white",children:a.jsx(Be,{className:"text-white"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"draft",className:"text-white",children:"草稿"}),a.jsx(se,{value:"under_review",className:"text-white",children:"審核中"}),a.jsx(se,{value:"approved",className:"text-white",children:"已批准"}),a.jsx(se,{value:"rejected",className:"text-white",children:"已拒絕"}),a.jsx(se,{value:"pending",className:"text-white",children:"待簽約"}),a.jsx(se,{value:"active",className:"text-white",children:"執行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"}),a.jsx(se,{value:"terminated",className:"text-white",children:"已終止"})]})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:i.notes,onChange:v=>s({...i,notes:v.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-24"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:n,className:"bg-[#8B0000] text-white border-[#8B0000] hover:bg-[#660000]",children:"取消"}),a.jsx(te,{type:"submit",disabled:d.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:d.isPending?"儲存中...":"儲存"})]})]})]})})}function Hye(){return a.jsx(Kg,{requiredRole:"admin",children:a.jsx(Vye,{})})}
561function Vye(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState("all"),[c,f]=I.useState(""),[h,d]=I.useState(""),[m,p]=I.useState(""),x=at(),{data:y=[],isLoading:v}=Te({queryKey:["contracts"],queryFn:()=>ee.entities.Contract.list("-created_date")}),{data:b=[]}=Te({queryKey:["all_milestones"],queryFn:()=>ee.entities.Milestone.list()}),{data:w=[]}=Te({queryKey:["customers"],queryFn:()=>ee.entities.Customer.list()}),{data:_=[]}=Te({queryKey:["orders"],queryFn:()=>ee.entities.Order.list()}),N=$=>{const W=b.filter(U=>U.contract_id===$.id&&U.payment_status==="paid").reduce((U,H)=>U+(H.billing_amount||0),0);return($.total_amount||0)-W},S=Ye({mutationFn:$=>ee.entities.Contract.delete($),onSuccess:()=>{x.invalidateQueries(["contracts"])}}),k=y.filter($=>{var K,q,L;const D=o==="all"||$.status===o,W=!c||((K=$.project_name)==null?void 0:K.toLowerCase().includes(c.toLowerCase()))||((q=$.contract_number)==null?void 0:q.toLowerCase().includes(c.toLowerCase()))||((L=$.customer_name)==null?void 0:L.toLowerCase().includes(c.toLowerCase())),U=!h||new Date($.signing_date)>=new Date(h),H=!m||new Date($.signing_date)<=new Date(m);return D&&W&&U&&H}),C=k.reduce(($,D)=>$+(D.total_amount||0),0),O=new Date,R=new Date;R.setDate(O.getDate()+30);const A=y.filter($=>!$.end_date||$.status==="completed"||$.status==="terminated"?!1:new Date($.end_date)<=R).sort(($,D)=>new Date($.end_date)-new Date(D.end_date)),P=$=>{const D=new Date($)-O;return Math.ceil(D/(1e3*60*60*24))},E=$=>{const D={draft:{label:"草稿",color:"#808080"},under_review:{label:"審核中",color:"#FFD700"},approved:{label:"已批准",color:"#00FF00"},rejected:{label:"已拒絕",color:"#FF4444"},pending:{label:"待簽約",color:"#FFA500"},active:{label:"執行中",color:"#00FFFF"},completed:{label:"已完成",color:"#00FF00"},terminated:{label:"已終止",color:"#FF4444"}},W=D[$]||D.draft;return a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:W.color+"33",color:W.color,border:`1px solid ${W.color}`}
561,children:W.label})},T=$=>{window.confirm(`確定要刪除合約「${$.project_name}」嗎?`)&&S.mutate($.id)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"合約管理"}),a.jsxs(te,{onClick:()=>{s(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增合約"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ut,{className:"w-8 h-8 text-[#00FFFF]"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"合約總金額"}),a.jsxs("p",{className:"text-3xl font-bold cyber-text",children:["NT$ ",C.toLocaleString()]})]})]})}),A.length>0&&a.jsxs("div",{className:"rounded-lg border border-orange-500 bg-orange-950/30 p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(vp,{className:"w-5 h-5 text-orange-400"}),a.jsx("h3",{className:"text-orange-400 font-semibold",children:"合約到期提醒(30天內)"}),a.jsx("span",{className:"bg-orange-500 text-white text-xs font-bold px-2 py-0.5 rounded-full",children:A.length})]}),a.jsx("div",{className:"space-y-2",children:A.map($=>{const D=P($.end_date),W=D<0,U=D<=7;return a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 bg-black/40 rounded p-3 border border-orange-800/50",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(WN,{className:`w-4 h-4 flex-shrink-0 ${W?"text-red-400":U?"text-orange-400":"text-yellow-400"}`}),a.jsxs("div",{children:[a.jsx("span",{className:"text-white font-medium",children:$.project_name}),a.jsxs("span",{className:"text-gray-400 text-sm ml-2",children:["(",$.contract_number,")"]}),a.jsxs("span",{className:"text-gray-400 text-sm ml-2",children:["客戶:",$.customer_name]})]})]}),a.jsxs("div",{className:"flex items-center gap-3 ml-7 sm:ml-0",children:[a.jsxs("span",{className:"text-gray-400 text-sm",children:["到期日:",$.end_date]}),a.jsx("span",{className:`text-xs font-bold px-2 py-1 rounded-full ${W?"bg-red-900 text-red-300 border border-red-600":U?"bg-orange-900 text-orange-300 border border-orange-600":"bg-yellow-900 text-yellow-300 border border-yellow-600"}`,children:W?`已過期 ${Math.abs(D)} 天`:D===0?"今天到期":`還剩 ${D} 天`}),a.jsx("button",{onClick:()=>n($),className:"text-xs text-[#00FFFF] hover:underline",children:"查看"})]})]},$.id)})})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋合約編號、專案名稱、客戶...",value:c,onChange:$=>f($.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(qe,{value:o,onValueChange:l,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"狀態篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有狀態"}),a.jsx(se,{value:"draft",className:"text-white",children:"草稿"}),a.jsx(se,{value:"under_review",className:"text-white",children:"審核中"}),a.jsx(se,{value:"approved",className:"text-white",children:"已批准"}),a.jsx(se,{value:"rejected",className:"text-white",children:"已拒絕"}),a.jsx(se,{value:"pending",className:"text-white",children:"待簽約"}),a.jsx(se,{value:"active",className:"text-white",children:"執行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"}),a.jsx(se,{value:"terminated",className:"text-white",children:"已終止"})]})]}),a.jsx(ne,{type:"date",placeholder:"開始日期",value:h,onChange:$=>d($.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]"}),a.jsx(ne,{type:"date",placeholder:"結束日期",value:m,onChange:$=>p($.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]"}),a.jsx(te,{variant:"outline",onClick:()=>{f(""),l("all"),d(""),p("")},className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"清除篩選"})]})}),a.jsx("div",{className:"grid grid-cols-1 gap-4",children:v?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):k.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(Et,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無合約資料"})]}):k.map($=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:$.project_name}),E($.status)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx(Et,{className:"w-4 h-4 text-[#00FFFF]"}),a.jsxs("span",{children:["合約編號:",$.contract_number]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx(Vs,{className:"w-4 h-4 text-[#00FFFF]"}),a.jsxs("span",{children:["簽約日期:",$.signing_date]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx(ut,{className:"w-4 h-4 text-[#00FFFF]"}),a.jsxs("span",{children:["合約金額:NT$ ",($.total_amount||0).toLocaleStr
561ing()]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx(ut,{className:"w-4 h-4 text-red-400"}),a.jsxs("span",{children:["未收金額:NT$ ",N($).toLocaleString()]})]}),a.jsx("div",{className:"flex items-center gap-2 text-gray-300",children:a.jsxs("span",{children:["客戶:",$.customer_name]})})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>n($),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"詳情"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{s($),t(!0)},className:"border-gray-600 hover:bg-gray-800",children:a.jsx(qt,{className:"w-4 h-4 text-black"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>T($),className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},$.id))}),e&&a.jsx(Uye,{contract:i,customers:w,orders:_,onClose:()=>{t(!1),s(null)}}),r&&!e&&a.jsx(l8,{contract:r,onClose:()=>n(null),onEdit:()=>{s(r),t(!0),n(null)}})]})}function Wye({project:e,onClose:t}){const[r,n]=I.useState({project_name:"",client_company:"",contact_person:"",contact_email:"",contact_phone:"",training_type:"onsite",order_amount:"",received_amount:0,outstanding_amount:"",start_date:"",end_date:"",training_location:"",training_hours:"",participant_count:"",instructor_name:"",training_objectives:"",training_content:"",contract_file_url:"",training_plan_file_url:"",status:"planning",notes:"",...e}),[i,s]=I.useState(!1),o=at(),{data:l=[]}=Te({queryKey:["customers"],queryFn:()=>ee.entities.Customer.list()});I.useEffect(()=>{const d=(r.order_amount||0)-(r.received_amount||0);n(m=>({...m,outstanding_amount:d}))},[r.order_amount,r.received_amount]);const c=Ye({mutationFn:async d=>{const m={...d,order_amount:Number(d.order_amount)||0,received_amount:Number(d.received_amount)||0,outstanding_amount:Number(d.outstanding_amount)||0,training_hours:d.training_hours?Number(d.training_hours):void 0,participant_count:d.participant_count?Number(d.participant_count):void 0};return e?await ee.entities.CorporateTraining.update(e.id,m):await ee.entities.CorporateTraining.create(m)},onSuccess:()=>{o.invalidateQueries(["corporate_trainings"]),alert("儲存成功!"),t()},onError:d=>{console.error("儲存失敗:",d),alert("儲存失敗,請檢查欄位是否正確填寫")}}),f=async(d,m)=>{const p=d.target.files[0];if(p)try{s(!0);const{file_url:x}=await ee.integrations.Core.UploadFile({file:p});n(y=>({...y,[m]:x}))}catch{alert("文件上傳失敗")}finally{s(!1)}},h=d=>{d.preventDefault(),c.mutate(r)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯企業培訓專案":"新增企業培訓專案"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:h,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"專案名稱 *"}),a.jsx(ne,{required:!0,value:r.project_name,onChange:d=>n({...r,project_name:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶公司 *"}),a.jsxs(qe,{value:r.client_company,onValueChange:d=>{const m=l.find(p=>p.customer_name===d);n({...r,client_company:d,contact_person:(m==null?void 0:m.contact_person)||r.contact_person,contact_email:(m==null?void 0:m.email)||r.contact_email,contact_phone:(m==null?void 0:m.ph
561one)||r.contact_phone})},children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇客戶公司"})}),a.jsx($e,{className:"bg-black border-gray-700",children:l.map(d=>a.jsx(se,{value:d.customer_name,className:"text-white",children:d.customer_name},d.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"聯絡人"}),a.jsx(ne,{value:r.contact_person,onChange:d=>n({...r,contact_person:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"聯絡Email"}),a.jsx(ne,{type:"email",value:r.contact_email,onChange:d=>n({...r,contact_email:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"聯絡電話"}),a.jsx(ne,{value:r.contact_phone,onChange:d=>n({...r,contact_phone:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"培訓類型"}),a.jsxs(qe,{value:r.training_type,onValueChange:d=>n({...r,training_type:d}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"onsite",className:"text-white",children:"現場培訓"}),a.jsx(se,{value:"online",className:"text-white",children:"線上培訓"}),a.jsx(se,{value:"hybrid",className:"text-white",children:"混合培訓"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"訂單金額 *"}),a.jsx(ne,{type:"number",required:!0,value:r.order_amount,onChange:d=>n({...r,order_amount:parseFloat(d.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"已收金額"}),a.jsx(ne,{type:"number",value:r.received_amount,onChange:d=>n({...r,received_amount:parseFloat(d.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"未收金額"}),a.jsx(ne,{type:"number",value:r.outstanding_amount,readOnly:!0,className:"bg-gray-900 border-gray-700 text-red-400 font-semibold"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"開始日期"}),a.jsx(ne,{type:"date",value:r.start_date,onChange:d=>n({...r,start_date:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"結束日期"}),a.jsx(ne,{type:"date",value:r.end_date,onChange:d=>n({...r,end_date:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"培訓地點"}),a.jsx(ne,{value:r.training_location,onChange:d=>n({...r,training_location:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"培訓時數"}),a.jsx(ne,{type:"number",value:r.training_hours,onChange:d=>n({...r,training_hours:parseFloat(d.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"參訓人數"}),a.jsx(ne,{type:"number",value:r.participant_count,onChange:d=>n({...r,participant_count:parseInt(d.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"主講師"}),a.jsx(ne,{value:r.instructor_name,onChange:d=>n({...r,instructor_name:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"專案狀態"}),a.jsxs(qe,{value:r.status,onValueChange:d=>n({...r,status:d}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"planning",className:"text-white",children:"規劃中"}),a.jsx(se,{value:"confirmed",className:"text-white",children:"已確認"}),a.jsx(se,{value:"in_progress",className:"text-white",children:"進行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已取消"})]})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"培訓目標"}),a.jsx(Pt,{value:r.training_objectives,onChange:d=>n({...r,training_objectives:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-20"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"培訓內容"}),a.jsx(Pt,{value:r.training_content,onChange:d=>n({...r,training_content:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-20"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"合約文件"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{type:"button",variant:"outline",onClick:d=>{var m;d.preventDefault(),(m=document.getElementById("contract-upload"))==null||m.click()},className:"bg-gray-800 border-gray-700 hover:bg-gray-700",disabled:i,children:[i?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),i?"上傳中...":"上傳合約"]}),a.jsx("input",{id:"contract-upload",type:"file",accept:".pdf,.docx",className:"hidden",onChange:d=>f(d,"contract_file_url")}),r.contract_file_url&&a.jsx("a",{href:r.contract_file_url,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline text-sm",children:"查看已上傳文件"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"訓練規劃PDF"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{type:"button",variant:"outline",onClick:d=>{var m;d.preventDefault(),(m=document.getElementById("training-plan-upload"))==null||m.click()},className:"bg-gray-800 border-gray-700 hover:bg-gray-700",disabled:i,children:[i?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),i?"上傳中...":"上傳訓練規劃"]}),a.jsx("input",{id:"training-plan-upload",type:"file",accept:".pdf",className:"hidden",onChange:d=>f(d,"training_plan_file_url")}),r.training_plan_file_url&&a.jsx("a",{href:r.training_plan_file_url,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline text-sm",children:"查看已上傳訓練規劃"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:r.notes,onChange:d=>n({...r,notes:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-20"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-red-900 text-white hover:bg-red-800 border-red-700",children:"取消"}),a.jsx(te,{type:"submit",disabled:c.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:c.isPending?"儲存中...":"儲存"})]})]})]})})}function u8({invoice:e,courses:t,trainings:r,onClose:n}){const[i,s]=I.useState(()=>e?{invoice_number:e.invoice_number||"",course_id:e.course_id||"",course_name:e.course_name||"",training_id:e.training_id||"",training_name:e.training_name||"",client_company:e.client_company||"",invoice_amount:e.invoice_amount||"",received_amount:e.received_amount||0,outstanding_amount:e.outstanding_amount||0,invoice_date:e.invoice_date||new Date().toISOString().split("T")[0],due_date:e.due_date||"",payment_method:e.payment_method||"",invoice_link:e.invoice_link||"",bank_account_info:e.bank_account_info||"",file_url:e.file_url||"",status:e.status||"draft",notes:e.notes||"",payment_records:e.payment_records||[]}:{invoice_number:"",course_id:"",course_name:"",training_id:"",training_name:"",client_company:"",invoice_amount:"",received_amount:0,outstanding_amount:"",invoice_date:new Date().toISOString().split("T")[0],due_date:"",payment_method:"",invoice_link:"",bank_account_info:"",file_url:"",status:"draft",notes:"",payment_records:[]}),[o,l]=I.useState(!1),c=at();I.useEffect(()=>{const p=(i.invoice_amount||0)-(i.received_amount||0);s(x=>({...x,outstanding_amount:p}))},[i.invoice_amount,i.received_amount]);const f=Ye({mutationFn:async p=>{const x={invoice_number:p.invoice_number,course_id:p.course_id||"",course_name:p.course_name||"",training_id:p.training_id||"",training_name:p.training_name||"",client_company:
561p.client_company||"",invoice_amount:parseFloat(p.invoice_amount)||0,tax_amount:Math.round((parseFloat(p.invoice_amount)||0)*.05/1.05),untaxed_amount:Math.round((parseFloat(p.invoice_amount)||0)/1.05),received_amount:parseFloat(p.received_amount)||0,outstanding_amount:parseFloat(p.outstanding_amount)||0,invoice_date:p.invoice_date,due_date:p.due_date||"",payment_method:p.payment_method||"",invoice_link:p.invoice_link||"",bank_account_info:p.bank_account_info||"",file_url:p.file_url||"",status:p.status||"draft",notes:p.notes||"",payment_records:p.payment_records||[]};return e&&e.id?await ee.entities.CourseInvoice.update(e.id,x):await ee.entities.CourseInvoice.create(x)},onSuccess:async p=>{var v;await c.invalidateQueries(["course_invoices"]);const x=e?"課程請款單已更新":"新課程請款單建立",y=e?`請款單 ${p.invoice_number} 已更新。`:`已建立新的請款單 ${p.invoice_number},金額 NT$ ${(v=p.invoice_amount)==null?void 0:v.toLocaleString()}。`;try{await ee.entities.Notification.create({title:x,message:y,type:"success",link:"/CourseProjectInvoicing",created_at:new Date().toISOString()})}catch(b){console.error("Failed to create notification:",b)}alert("儲存成功!"),n()},onError:p=>{console.error("Save failed:",p),alert("儲存失敗:"+(p.message||"未知錯誤"))}}),h=p=>{const x=r.find(y=>y.id===p);x&&s(y=>({...y,training_id:p,training_name:x.project_name||x.training_name,client_company:x.client_company||"",invoice_amount:x.order_amount||x.contract_amount||y.invoice_amount}))},d=async p=>{const x=p.target.files[0];if(x)try{l(!0);const{file_url:y}=await ee.integrations.Core.UploadFile({file:x});s(v=>({...v,file_url:y}))}catch(y){console.error("Upload failed:",y),alert("檔案上傳失敗,請重試")}finally{l(!1)}},m=p=>{p.preventDefault(),f.mutate(i)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-3xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯請款單":"新增請款單"}),a.jsx("button",{onClick:n,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:m,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款單編號 *"}),a.jsx(ne,{required:!0,value:i.invoice_number,onChange:p=>s({...i,invoice_number:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯企業培訓"}),a.jsxs(qe,{value:i.training_id,onValueChange:h,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇企業培訓專案"})}),a.jsx($e,{className:"bg-black border-gray-700",children:r.map(p=>a.jsx(se,{value:p.id,className:"text-white",children:p.project_name||p.training_name},p.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶公司"}),a.jsx(ne,{value:i.client_company,onChange:p=>s({...i,client_company:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款金額 *"}),a.jsx(ne,{type:"number",required:!0,value:i.invoice_amount,onChange:p=>s({...i,invoice_amount:parseFloat(p.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款日期 *"}),a.jsx(ne,{type:"date",required:!0,value:i.invoice_date,onChange:p=>s({...i,invoice_date:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"到期日"}),a.jsx(ne,{type:"date",value:i.due_date,onChange:p=>s({...i,due_date:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"付款方式"}),a.jsxs(qe,{value:i.payment_method,onValueChange:p=>s({...i,payment_method:p}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇付款方式"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"轉帳",className:"text-white",children:"轉帳"}),a.jsx(se,{value:"匯款",className:"text-white",children:"匯款"}),a.jsx(se,{value:"支票",className:"text-white",children:"支票"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"已收金額"}),a.jsx(ne,{type:"number",value:i.received_amount,onChange:p=>s({...i,received_amount:parseFloat(p.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"未收金額"}),a.jsx(ne,{type:"number",value:i.outstanding_amount,readOnly:!0,className:"bg-gray-900 border-gray-700 text-red-400 font-semibold"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"狀態"}),a.jsxs(qe,{value:i.status,onValueChange:p=>s({...i,status:p}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"draft",className:"text-white",children:"草稿"}),a.jsx(se,{value:"pending",className:"text-white",children:"待審核"}),a.jsx(se,{value:"sent",className:"text-white",children:"已發送"}),a.jsx(se,{value:"paid",className:"text-white",children:"已結清"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已作廢"})]})]})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(Q,{children:"電子發票連結"}),a.jsx(ne,{value:i.invoice_link,onChange:p=>s({...i,invoice_link:p.target.value}),placeholder:"https://...",className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(Q,{children:"匯款帳號資訊"}),a.jsx(Pt,{value:i.bank_account_info||"",onChange:p=>s({...i,bank_account_info:p.target.value}),placeholder:"請輸入匯款帳號資訊",className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-[100px]"})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(Q,{children:"請款單 PDF"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{type:"button",variant:"outline",onClick:()=>document.getElementById("course-invoice-file-upload").click(),className:"bg-gray-800 border-gray-700 hover:bg-gray-700",disabled:o,children:[o?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),o?"上傳中...":"上傳 PDF"]}),a.jsx(ne,{id:"course-invoice-file-upload",type:"file",accept:".pdf",className:"hidden",onChange:d}),i.file_url&&a.jsxs("span",{className:"text-sm text-[#00FFFF] flex items-center",children:[a.jsx("a",{href:i.file_url,target:"_blank",rel:"noreferrer",className:"hover:underline",children:"已上傳 (點擊查看)"}),a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>s(p=>({...p,file_url:""})),className:"text-red-500 hover:text-red-400 ml-2",children:a.jsx(vt,{className:"w-4 h-4"})})]})]})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:i.notes||"",onChange:p=>s({...i,notes:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-[100px]"})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:n,className:"bg-red-900 text-white hover:bg-red-800 border-red-700",children:"取消"}),a.jsx(te,{type:"submit",disabled:f.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:f.isPending?"儲存中...":"儲存"})]})]})]})})}function Kye({project:e,onClose:t,onEdit:r}){const n=at(),[i,s]=I.useState(!1),[o,l]=I.useState(null),c=Ye({mutationFn:async()=>await ee.entities.CorporateTraining.delete(e.id),onSuccess:()=>{n.invalidateQueries(["corporate_trainings"]),alert("刪除成功!"),t()}}),f=d=>({planning:"規劃中",confirmed:"已確認",in_progress:"進行中",completed:"已完成",cancelled:"已取消"})[d]||d,h=d=>({onsite:"現場培訓",online:"線上培訓",hybrid:"混合培訓"})[d]||d;return a.jsxs("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"企業培訓專案詳情"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",onClick:()=>s(!0),className:"bg-green-900 text-white hover:bg-green-800 border-green-700",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"建立請款單"]}
561),a.jsxs(te,{variant:"outline",onClick:r,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(qt,{className:"w-4 h-4 mr-2 text-black"}),"編輯"]}),a.jsxs(te,{variant:"outline",onClick:()=>{confirm("確定要刪除此培訓專案嗎?")&&c.mutate()},className:"bg-red-900 text-white hover:bg-red-800 border-red-700",children:[a.jsx(Qt,{className:"w-4 h-4 mr-2"}),"刪除"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"專案名稱"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:e.project_name})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"客戶公司"}),a.jsx("p",{className:"text-gray-200",children:e.client_company})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"聯絡人"}),a.jsx("p",{className:"text-gray-200",children:e.contact_person||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"聯絡Email"}),a.jsx("p",{className:"text-gray-200",children:e.contact_email||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"培訓類型"}),a.jsx("p",{className:"text-gray-200",children:h(e.training_type)})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"專案狀態"}),a.jsx("p",{className:"text-gray-200",children:f(e.status)})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx(ut,{className:"w-5 h-5 cyber-text"}),a.jsx("h3",{className:"text-lg font-semibold text-white",children:"財務資訊"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-400",children:"訂單金額"}),a.jsxs("p",{className:"text-xl font-bold text-[#00FFFF]",children:["NT$ ",(e.order_amount||0).toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-400",children:"已收金額"}),a.jsxs("p",{className:"text-lg font-semibold text-green-400",children:["NT$ ",(e.received_amount||0).toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-400",children:"未收金額"}),a.jsxs("p",{className:"text-lg font-semibold text-red-400",children:["NT$ ",(e.outstanding_amount||0).toLocaleString()]})]})]})]}),e.start_date&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"培訓日期"}),a.jsxs("p",{className:"text-gray-200",children:[e.start_date," ~ ",e.end_date||"進行中"]})]}),e.participant_count&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"參訓人數"}),a.jsxs("p",{className:"text-gray-200",children:[e.participant_count," 人"]})]}),e.training_location&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"培訓地點"}),a.jsx("p",{className:"text-gray-200",children:e.training_location})]}),e.instructor_name&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"主講師"}),a.jsx("p",{className:"text-gray-200",children:e.instructor_name})]})]})]}),e.training_objectives&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-2",children:"培訓目標"}),a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.training_objectives})]}),e.training_content&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-2",children:"培訓內容"}),a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.training_content})]}),e.contract_file_url&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text mb-2 flex items-center gap-2",children:[a.jsx(Et,{className:"w-5 h-5"}),"合約文件"]}),a.jsxs(te,{variant:"outline",onClick:()=>l(e.contract_file_url),className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(Et,{className:"w-4 h-4 mr-2"}),"預覽合約文件"]})]}),e.training_plan_file_url&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text mb-2 flex items-center gap-2",children:[a.jsx(Et,{className:"w-5 h-5"}),"訓練規劃文件"]}),a.jsxs(te,{variant:"outline",onClick:()=>l(e.training_plan_file_url),className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(Et,{className:"w-4 h-4 mr-2"}),"預覽訓練規劃"]})]}),e.notes&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-2",children:"備註"}),a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.notes})]})]})]}),i&&a.jsx(u8,{invoice:{training_id:e.id,training_name:e.project_name,client_company:e.client_company,invoice_amount:e.order_amount,invoice_number:`INV-${e.project_name}-${new Date().getTime()}`},courses:[],trainings:[e],onClose:()=>s(!1)}),o&&a.jsx($a,{fileUrl:o,onClose:()=>l(null)})]})}
561function Gye(){const[e,t]=I.useState(""),[r,n]=I.useState("all"),[i,s]=I.useState("all"),[o,l]=I.useState(!1),[c,f]=I.useState(null),[h,d]=I.useState(null),{data:m=[],isLoading:p}=Te({queryKey:["corporate_trainings"],queryFn:()=>ee.entities.CorporateTraining.list("-created_date")}),x=m.filter(_=>{var C,O;const N=r==="all"||_.status===r,S=i==="all"||_.training_type===i,k=!e||((C=_.project_name)==null?void 0:C.toLowerCase().includes(e.toLowerCase()))||((O=_.client_company)==null?void 0:O.toLowerCase().includes(e.toLowerCase()));return N&&S&&k}),y=x.reduce((_,N)=>_+(N.order_amount||0),0),v=x.reduce((_,N)=>_+(N.received_amount||0),0),b=x.reduce((_,N)=>_+(N.outstanding_amount||0),0),w=_=>{const N={planning:{label:"規劃中",color:"#808080"},confirmed:{label:"已確認",color:"#FFD700"},in_progress:{label:"進行中",color:"#00FFFF"},completed:{label:"已完成",color:"#00FF00"},cancelled:{label:"已取消",color:"#FF4444"}},S=N[_]||N.planning;return a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:S.color+"33",color:S.color,border:`1px solid ${S.color}`},children:S.label})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx($2,{className:"w-8 h-8 cyber-text"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"企業培訓專案管理"})]}),a.jsxs(te,{onClick:()=>{f(null),l(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增企業培訓專案"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"訂單總金額"}),a.jsxs("p",{className:"text-2xl font-bold cyber-text",children:["NT$ ",y.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已收金額"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",v.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未收金額"}),a.jsxs("p",{className:"text-2xl font-bold text-red-400",children:["NT$ ",b.toLocaleString()]})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋專案名稱、客戶...",value:e,onChange:_=>t(_.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(qe,{value:i,onValueChange:s,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"培訓類型"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有類型"}),a.jsx(se,{value:"onsite",className:"text-white",children:"現場培訓"}),a.jsx(se,{value:"online",className:"text-white",children:"線上培訓"}),a.jsx(se,{value:"hybrid",className:"text-white",children:"混合培訓"})]})]}),a.jsxs(qe,{value:r,onValueChange:n,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"狀態篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有狀態"}),a.jsx(se,{value:"planning",className:"text-white",children:"規劃中"}),a.jsx(se,{value:"confirmed",className:"text-white",children:"已確認"}),a.jsx(se,{value:"in_progress",className:"text-white",children:"進行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已取消"})]})]}),a.jsx(te,{variant:"outline",onClick:()=>{t(""),n("all"),s("all")},className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"清除篩選"})]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h2",{className:"text-xl font-bold text-white",children:"培訓專案列表"}),p?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):x.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx($2,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無企業培訓專案資料"})]}):a.jsx("div",{className:"space-y-3",children:x.map(_=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:_.project_name}),w(_.status)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3 text-sm",children:[a.jsxs("div",{className:"text-gray-300",children:["客戶:",_.client_company]}),a.jsxs("div",{className:"text-gray-300",children:["聯絡人:",_.contact_person||"-"]}
561),a.jsxs("div",{className:"text-gray-300",children:["類型:",_.training_type==="onsite"?"現場":_.training_type==="online"?"線上":"混合"]}),a.jsxs("div",{className:"text-[#00FFFF] font-semibold",children:["訂單:NT$ ",(_.order_amount||0).toLocaleString()]}),a.jsxs("div",{className:"text-green-400",children:["已收:NT$ ",(_.received_amount||0).toLocaleString()]}),a.jsxs("div",{className:"text-red-400",children:["未收:NT$ ",(_.outstanding_amount||0).toLocaleString()]}),_.start_date&&a.jsxs("div",{className:"text-gray-300",children:["開始:",_.start_date]}),_.participant_count&&a.jsxs("div",{className:"text-gray-300",children:["參訓:",_.participant_count,"人"]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>d(_),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"詳情"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{f(_),l(!0)},className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:a.jsx(qt,{className:"w-4 h-4"})})]})]})},_.id))})]}),o&&a.jsx(Wye,{project:c,onClose:()=>{l(!1),f(null)}}),h&&!o&&a.jsx(Kye,{project:h,onClose:()=>d(null),onEdit:()=>{f(h),l(!0),d(null)}})]})}function Yye(){return a.jsx(Kg,{requiredRole:"admin",children:a.jsx(Qye,{})})}function Qye(){const[e,t]=I.useState(null),[r,n]=I.useState(""),[i,s]=I.useState("all"),[o,l]=I.useState("all"),[c,f]=I.useState([]),[h,d]=I.useState(!1),[m,p]=I.useState(""),[x,y]=I.useState(null),[v,b]=I.useState(!1),[w,_]=I.useState(0),N=at(),{data:S=[]}=Te({queryKey:["courses"],queryFn:()=>ee.entities.Course.list()}),{data:k=[],isLoading:C}=Te({queryKey:["course_registrations"],queryFn:()=>ee.entities.CourseRegistration.list("-registration_date")}),O=Ye({mutationFn:async({id:L,status:V})=>{const z=k.find(re=>re.id===L),Z={payment_status:V};return V==="paid"&&z&&(Z.deposit_amount=z.payment_amount||0,Z.unpaid_amount=0),await ee.entities.CourseRegistration.update(L,Z)},onSuccess:()=>{N.invalidateQueries(["course_registrations"]),alert("收款狀態更新成功!")}}),R=Ye({mutationFn:async({id:L,data:V})=>{const z=(V.payment_amount||0)-(V.deposit_amount||0);return await ee.entities.CourseRegistration.update(L,{...V,unpaid_amount:z})},onSuccess:()=>{N.invalidateQueries(["course_registrations"]),alert("更新成功!"),b(!1),y(null)}}),A=Ye({mutationFn:async({registrationIds:L,emailBody:V})=>{var z;for(const Z of L){const re=k.find(ie=>ie.id===Z);if(!re)continue;const G="課程報名費用收款通知",X=V.replace("{學員姓名}",re.applicant_name).replace("{課程名稱}",((z=S.find(ie=>ie.id===re.course_id))==null?void 0:z.course_name)||"課程").replace("{收款金額}",`NT$ ${(re.payment_amount||0).toLocaleString()}`);await ee.integrations.Core.SendEmail({to:re.applicant_email,subject:G,body:X})}},onSuccess:()=>{alert("收款通知已發送!"),d(!1),f([])}}),P=S.map(L=>{const V=k.filter(J=>J.course_id===L.id),z=V.length,Z=V.filter(J=>J.payment_status==="pending").length,re=V.filter(J=>J.payment_status==="paid").length,G=V.reduce((J,ue)=>J+(ue.payment_amount||0),0),X=V.reduce((J,ue)=>J+(ue.deposit_amount||0),0),ie=V.reduce((J,ue)=>J+((ue.payment_amount||0)-(ue.deposit_amount||0)),0);return{...L,totalRegistrations:z,totalPending:Z,totalPaid:re,totalAmount:G,totalDeposit:X,totalUnpaid:ie}}),E=k.filter(L=>L.payment_status==="paid").reduce((L,V)=>L+(V.payment_amount||0),0),T=k.filter(L=>L.payment_status==="pending").reduce((L,V)=>L+(V.payment_amount||0),0),$=k.reduce((L,V)=>L+((V.payment_amount||0)-(V.deposit_amount||0)),0),D=e?k.filter(L=>L.course_id===e.id):[],W=D.filter(L=>{var re,G;const V=i==="all"||(L==null?void 0:L.payment_status)===i,z=o==="all"||(L==null?void 0:L.deposit_status)===o,Z=!r||((re=L==null?void 0:L.applicant_name)==null?void 0:re.toLowerCase().includes(r.toLowerCase()))||((G=L==null?void 0:L.applicant_email)==null?void 0:G.toLowerCase().includes(r.toLowerCase()));return V&&z&&Z}),U=L=>{const V={pending:{label:"待付款",icon:Ra,color:"#FFD700"},paid:{label:"已付款",icon:xr,color:"#00FF00"},refunded:{label:"已退款",icon:$s,color:"#FF4444"}},z=V[L]||V.pending,Z=z.icon;return a.jsxs("span",{className:"px-3 py-1 rounded-full text-xs font-semibold flex items-center gap-1",style:{backgroundColor:z.color+"33",color:z.color,border:`1px solid ${z.color}`}
561,children:[a.jsx(Z,{className:"w-3 h-3"}),z.label]})},H=L=>{const V={unpaid:{label:"未付訂金",color:"#FF8C00"},paid:{label:"已付訂金",color:"#00FFFF"}},z=V[L]||V.unpaid;return a.jsx("span",{className:"px-2 py-1 rounded text-xs font-semibold",style:{backgroundColor:z.color+"33",color:z.color,border:`1px solid ${z.color}`},children:z.label})},K=()=>{if(c.length===0){alert("請先選擇要發送通知的報名者");return}p(`親愛的 {學員姓名} 您好,
562
563感謝您報名參加 {課程名稱}。
564
565應付款項:{收款金額}
566
567請點擊以下連結完成付款:
568[付款連結]
569
570如有任何問題,歡迎與我們聯繫。
571
572祝您學習愉快!`),d(!0)},q=L=>{y({...L,payment_amount:L.payment_amount||0,deposit_amount:L.deposit_amount||0,original_deposit_amount:L.original_deposit_amount||0,deposit_status:L.deposit_status||"unpaid"}),_(L.original_deposit_amount||0),b(!0)};return e?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(te,{variant:"outline",onClick:()=>t(null),className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(zf,{className:"w-4 h-4 mr-2"}),"返回課程列表"]}),a.jsx(ut,{className:"w-8 h-8 cyber-text"}),a.jsxs("h1",{className:"text-3xl font-bold cyber-text",children:[e.course_name," - 報名者管理"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"總報名人數"}),a.jsx("p",{className:"text-2xl font-bold cyber-text",children:D.length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"待付款"}),a.jsx("p",{className:"text-2xl font-bold text-yellow-400",children:D.filter(L=>L.payment_status==="pending").length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已付款"}),a.jsx("p",{className:"text-2xl font-bold text-green-400",children:D.filter(L=>L.payment_status==="paid").length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未付金額總計"}),a.jsxs("p",{className:"text-2xl font-bold text-red-400",children:["NT$ ",D.reduce((L,V)=>L+((V.payment_amount||0)-(V.deposit_amount||0)),0).toLocaleString()]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋學員姓名或Email...",value:r,onChange:L=>n(L.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(qe,{value:i,onValueChange:s,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"付款狀態"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有狀態"}),a.jsx(se,{value:"pending",className:"text-white",children:"待付款"}),a.jsx(se,{value:"paid",className:"text-white",children:"已付款"}),a.jsx(se,{value:"refunded",className:"text-white",children:"已退款"})]})]}),a.jsxs(qe,{value:o,onValueChange:l,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"訂金狀態"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有訂金狀態"}),a.jsx(se,{value:"unpaid",className:"text-white",children:"未付訂金"}),a.jsx(se,{value:"paid",className:"text-white",children:"已付訂金"})]})]}),a.jsx(te,{onClick:()=>{n(""),s("all"),l("all")},variant:"outline",className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"清除篩選"})]}),a.jsx("div",{className:"flex gap-2",children:a.jsxs(te,{onClick:K,disabled:c.length===0,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(sc,{className:"w-4 h-4 mr-2"}),"批次發送收款通知 (",c.length,")"]})})]}),a.jsx("div",{className:"space-y-3",children:W.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(Xr,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無報名資料"})]}):W.map(L=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[a.jsx("input",{type:"checkbox",checked:c.includes(L.id
572),onChange:V=>{V.target.checked?f([...c,L.id]):f(c.filter(z=>z!==L.id))},className:"mt-1 w-4 h-4 rounded border-gray-600 bg-black"}),a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:L.applicant_name}),U(L.payment_status),H(L.deposit_status)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 text-sm",children:[a.jsxs("div",{className:"text-gray-300",children:["Email: ",L.applicant_email]}),a.jsxs("div",{className:"text-gray-300",children:["電話: ",L.phone_number||"-"]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 text-sm",children:[a.jsxs("div",{className:"text-[#00FFFF] font-semibold",children:["應付總金額: NT$ ",(L.payment_amount||0).toLocaleString()]}),a.jsxs("div",{className:"text-cyan-400 font-semibold",children:["已付金額: NT$ ",(L.deposit_amount||0).toLocaleString()]}),a.jsxs("div",{className:"text-red-400 font-semibold",children:["未付金額: NT$ ",((L.payment_amount||0)-(L.deposit_amount||0)).toLocaleString()]}),a.jsxs("div",{className:"text-gray-400",children:["報名日期: ",L.registration_date?new Date(L.registration_date).toLocaleDateString():"-"]})]})]})]}),a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs(te,{size:"sm",onClick:()=>q(L),className:"bg-blue-900 text-white hover:bg-blue-800 border-blue-700",children:[a.jsx(qt,{className:"w-4 h-4 mr-1"}),"編輯"]}),L.payment_status==="pending"&&a.jsxs(te,{size:"sm",onClick:()=>O.mutate({id:L.id,status:"paid"}),className:"bg-green-900 text-white hover:bg-green-800 border-green-700",children:[a.jsx(xr,{className:"w-4 h-4 mr-1"}),"標記已付款"]})]})]})},L.id))}),h&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-2xl w-full p-6 space-y-4",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"批次發送收款通知"}),a.jsxs("p",{className:"text-gray-400",children:["將發送給 ",c.length," 位學員"]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm text-gray-400",children:"Email 內容"}),a.jsx(Pt,{value:m,onChange:L=>p(L.target.value),className:"bg-black border-gray-700 text-white min-h-[300px]"}),a.jsxs("p",{className:"text-xs text-gray-500",children:["可用變數:","{學員姓名}",", ","{課程名稱}",", ","{收款金額}"]})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(te,{onClick:()=>d(!1),variant:"ghost",className:"flex-1 text-gray-400",children:"取消"}),a.jsx(te,{onClick:()=>A.mutate({registrationIds:c,emailBody:m}),disabled:A.isPending,className:"flex-1 bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:A.isPending?"發送中...":"確認發送"})]})]})}),v&&x&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-2xl w-full p-6 space-y-4",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"編輯報名資料"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"收款連結"}),a.jsx(ne,{type:"url",value:x.payment_link||"",onChange:L=>y({...x,payment_link:L.target.value}),className:"bg-black border-gray-700 text-white",placeholder:"https://..."})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"應付總金額"}),a.jsx(ne,{type:"number",value:x.payment_amount,readOnly:!0,className:"bg-gray-900 border-gray-700 text-gray-400 font-semibold"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"已付金額"}),a.jsx(ne,{type:"number",value:x.deposit_amount,onChange:L=>y({...x,deposit_amount:parseFloat(L.target.value)||0}),className:"bg-black border-gray-700 text-green-400 font-semibold focus:border-[#00FFFF]"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"未付金額(自動計算)"}),a.jsx(ne,{type:"number",value:(x.payment_amount||0)-(x.deposit_amount||0),readOnly:!0,className:"bg-gray-900 border-gray-700 text-red-400 font-semibold"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"訂金付款狀態"}),a.jsxs(qe,{value:x.deposit_status,onValueChange:L=>{y({...x,deposit_status:L,deposit_amount:L==="unpaid"?0:w}),L==="unpaid"&&_(0)},children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"unpaid",className:"text-white",children:"未付訂金"}),a.jsx(se,{value:"paid",className:"text-white",children:"已付訂金"})]})]})]}),x.deposit_status==="paid"&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"訂金金額"}),a.jsx(ne,{type:"number",value:w,onChange:L=>{const V=parseFloat(L.target.value)||0;_(V),y({...x,original_deposit_amount:V})},className:"bg-black border-gray-700 text-white",placeholder:"請輸入訂金金額"})]})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(te,{onClick:()=>{b(!1),y(null)},variant:"ghost",className:"flex-1 text-gray-400",children:"取消"}),a.jsx(te,{onClick:()=>R.mutate({id:x.id,data:{payment_amount:x.payment_amount,deposit_amount:x.deposit_amount,original_deposit_amount:x.original_deposit_amount,deposit_status:x.deposit_status,payment_link:x.payment_link}}),disabled:R.isPending,className:"flex-1 bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:R.isPending?"儲存中...":"儲存"}),x.payment_link&&a.jsxs(te,{onClick:async()=>{try{await ee.integrations.Core.SendEmail({to:x.applicant_email,subject:"課程報名收款連結通知",body:`親愛的 ${x.applicant_name} 您好,
573
574感謝您報名參加課程。
575
576應付款項:NT$ ${(x.payment_amount||0).toLocaleString()}
577
578請點擊以下連結完成付款:
579${x.payment_link}
580
581如有任何問題,歡迎與我們聯繫。
582
583祝您學習愉快!`}),alert("收款連結已發送!")}catch(L){alert("發送失敗:"+L.message)}},className:"flex-1 bg-green-900 text-white hover:bg-green-800",children:[a.jsx(sc,{className:"w-4 h-4 mr-2"}),"寄發收款連結"]})]})]})})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ut,{className:"w-8 h-8 cyber-text"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"課程專案收款管理"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已付款總金額"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",E.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"待付款總金額"}),a.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["NT$ ",T.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未付款總金額"}),a.jsxs("p",{className:"text-2xl font-bold text-red-400",children:["NT$ ",$.toLocaleString()]})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋課程名稱...",value:r,onChange:L=>n(L.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]})}),a.jsx("div",{className:"space-y-3",children:C?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):P.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(ut,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無課程資料"})]}):P.filter(L=>{var V;return!r||((V=L.course_name)==null?void 0:V.toLowerCase().includes(r.toLowerCase()))}).map(L=>a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all cursor-pointer",onClick:()=>t(L),children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:L.course_name}),a.jsxs(te,{size:"sm",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Xr,{className:"w-4 h-4 mr-2"}),"查看報名者 (",L.totalRegistrations,")"]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400",children:"總報名數"}),a.jsx("p",{className:"text-lg font-bold text-[#00FFFF]",children:L.totalRegistrations})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400",children:"待付款"}),a.jsx("p",{className:"text-lg font-bold text-yellow-400",children:L.totalPending})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400",children:"已付款"}),a.jsx("p",{className:"text-lg font-bold text-green-400",children:L.totalPaid})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400",children:"已收款"}),a.jsxs("p",{className:"text-lg font-bold text-cyan-400",children:["NT$ ",L.totalDeposit.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400",children:"未付金額"}),a.jsxs("p",{className:"text-lg font-bold text-red-400",children:["NT$ ",L.totalUnpaid.toLocaleString()]})]})]})]},L.id))})]})}async function Xye(e){let t={};try{const n=await ee.entities.CompanySetting.list();n.length>0&&(t=n[0])}catch(n){console.error("Failed to load settings:",n)}const r=window.open("","_blank");r.document.write(`
584    <html>
585      <head>
586        <title>請款單</title>
587        <meta charset="UTF-8">
588        <style>
589          * { margin: 0; padding: 0; box-sizing: border-box; }
590          body { font-family: "Microsoft JhengHei", Arial, sans-serif; padding: 0; color: #333; background: white; }
591          .header { background: #000; color: #fff; padding: 12px 20px; display: flex; align-items: center; }
592          .logo { font-size: 16px; font-weight: bold; display: flex; align-items: center; gap: 8px; }
593          h1 { text-align: center; font-size: 24px; margin: 30px 0 20px 0; color: #333; }
594          .content-wrapper { padding: 0 40px 40px 40px; max-width: 800px; margin: 0 auto; }
595          .info-section { border: 1px solid #333; margin-bottom: 20px; }
596          .info-row { display: flex; border-bottom: 1px solid #333; }
597          .info-row:last-child { border-bottom: none; }
598          .info-cell { padding: 10px 12px; flex: 1; border-right: 1px solid #333; font-size: 13px; }
599          .info-cell:last-child { border-right: none; }
600          .info-label { background: #f5f5f5; font-weight: bold; min-width: 100px; flex: 0 0 100px; }
601          table { width: 100%; border-collapse: collapse; margin: 20px 0; border: 1px solid #333; }
602          th, td { border: 1px solid #333; padding: 10px 8px; text-align: center; font-size: 13px; vertical-align: middle; }
603          th { background: #e0e0e0; font-weight: bold; }
604          .item-desc { text-align: left; padding-left: 12px; }
605          .amount { text-align: right; padding-right: 12px; }
606          .total-row { background: #f5f5f5; font-weight: bold; }
607          .footer-section { margin-top: 20px; border: 1px solid #333; }
608          .footer-title { background: #e0e0e0; padding: 10px; font-weight: bold; text-align: center; font-size: 14px; border-bottom: 1px solid #333; }
609          .footer-content { padding: 15px; line-height: 1.8; font-size: 13px; white-space: pre-line; }
610          .footer-content a { color: #0066cc; text-decoration: underline; word-break: break-all; }
611          @media print { 
612            body { padding: 0; } 
613            .header { background: #000 !important; -webkit-print-color-adjust: exact; color: #fff !important; } 
614            th, .total-row { -webkit-print-color-adjust: exact; }
615          }
616        </style>
617      </head>
618      <body>
619        <div class="header">
620          <div class="logo">
621            ${t.company_logo_url?`<img src="${t.company_logo_url}" alt="LOGO" style="width: 28px; height: 28px; object-fit: contain; background: white; padding: 2px; border-radius: 3px;" />`:""}
622            <span>${t.company_name||"無限未來有限公司"}</span>
623          </div>
624        </div>
625        <div class="content-wrapper">
626          <h1>請款單</h1>
627          <div class="info-section">
628            <div class="info-row">
629              <div class="info-cell info-label">請款單編號</div>
630              <div class="info-cell">${e.invoice_number||""}</div>
631              <div class="info-cell info-label">請款日期</div>
632              <div class="info-cell">${e.invoice_date||""}</div>
633            </div>
634            <div class="info-row">
635              <div class="info-cell info-label">客戶公司</div>
636              <div class="info-cell">${e.client_company||""}</div>
637              <div class="info-cell info-label">到期日</div>
638              <div class="info-cell">${e.due_date||""}</div>
639            </div>
640            <div class="info-row">
641              <div class="info-cell info-label">課程名稱</div>
642              <div class="info-cell">${e.course_name||""}</div>
643              <div class="info-cell info-label">付款方式</div>
644              <div class="info-cell">${e.payment_method||"匯款"}</div>
645            </div>
646            ${e.training_name?`
647            <div class="info-row">
648              <div class="info-cell info-label">培訓專案</div>
649              <div class="info-cell" style="flex: 3;">${e.training_name}</div>
650            </div>
651            `:""}
652          </div>
653          <table>
654            <thead>
655              <tr>
656                <th style="width: 45%">請款明細</th>
657                <th style="width: 10%">數量</th>
658                <th style="width: 15%">金額</th>
659                <th style="width: 12%">稅額</th>
660                <th style="width: 15%">含稅總價</th>
661                <th style="width: 8%">備註</th>
662              </tr>
663            </thead>
664            <tbody>
665              <tr>
666                <td class="item-desc">
667                  ${e.course_name||e.training_name||""}
668                  ${e.training_name&&e.course_name?`<br/><small style="color: #666;">${e.training_name}</small>`:""}
669                </td>
670                <td>1</td>
671                <td class="amount">${Math.round(e.untaxed_amount||0).toLocaleString()}</td>
672                <td class="amount">${Math.round(e.tax_amount||0).toLocaleString()}</td>
673                <td class="amount">${Math.round(e.invoice_amount||0).toLocaleString()}</td>
674                <td></td>
675              </tr>
676              <tr class="total-row">
677                <td colspan="4" style="text-align: right; padding-right: 20px;">合計</td>
678                <td class="amount">
678${Math.round(e.invoice_amount||0).toLocaleString()}</td>
679                <td></td>
680              </tr>
681            </tbody>
682          </table>
683
684          ${e.invoice_link?`
685          <div class="footer-section">
686            <div class="footer-title">三聯式電子發票連結</div>
687            <div class="footer-content" style="text-align: center;">
688              <a href="${e.invoice_link}" target="_blank">${e.invoice_link}</a>
689            </div>
690          </div>
691          `:""}
692
693          <div class="footer-section" style="margin-top: ${e.invoice_link?"20px":"0"};">
694            <div class="footer-title">匯款帳號</div>
695            <div class="footer-content">
696              ${e.bank_account_info?e.bank_account_info:`戶名:${t.company_name||"無限未來有限公司"}
697金融機構代碼:808
698玉山銀行 北高雄分行
699活存帳號:0347-940-019360`}
700            </div>
701          </div>
702
703          ${e.notes?`
704          <div class="footer-section" style="margin-top: 20px;">
705            <div class="footer-title">備註</div>
706            <div class="footer-content">${e.notes}</div>
707          </div>
708          `:""}
709        </div>
710      </body>
711    </html>
712  `),r.document.close(),r.print()}function Zye({invoice:e,onClose:t,onEdit:r}){const[n,i]=I.useState(!1),s=at(),o=Ye({mutationFn:async c=>{const f=(e==null?void 0:e.invoice_amount)||0;if(await ee.entities.CourseInvoice.update(e.id,{status:c,received_amount:f,outstanding_amount:0}),e!=null&&e.training_id){const d=(await ee.entities.CorporateTraining.list()).find(m=>m.id===e.training_id);if(d){const m=(d.received_amount||0)+(e.outstanding_amount||0),p=(d.outstanding_amount||0)-(e.outstanding_amount||0);await ee.entities.CorporateTraining.update(e.training_id,{received_amount:Math.max(0,m),outstanding_amount:Math.max(0,p)})}}},onSuccess:()=>{s.invalidateQueries(["course_invoices"]),s.invalidateQueries(["corporate_trainings"]),alert("狀態更新成功!"),t()}}),l=c=>({draft:"草稿",pending:"待審核",sent:"已發送",paid:"已結清",cancelled:"已作廢"})[c]||c;return a.jsxs("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"請款單詳情"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",onClick:r,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(qt,{className:"w-4 h-4 mr-2 text-black"}),"編輯"]}),a.jsxs(te,{variant:"outline",onClick:()=>Xye(e),className:"bg-gray-800 text-white border-gray-600 hover:bg-gray-700",children:[a.jsx($g,{className:"w-4 h-4 mr-2"}),"列印請款單"]}),(e==null?void 0:e.file_url)&&a.jsxs(te,{variant:"outline",onClick:()=>i(!0),className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"}),"查看附件"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"請款單編號"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:(e==null?void 0:e.invoice_number)||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"課程名稱"}),a.jsx("p",{className:"text-gray-200",children:(e==null?void 0:e.course_name)||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"企業培訓專案"}),a.jsx("p",{className:"text-gray-200",children:(e==null?void 0:e.training_name)||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"客戶公司"}),a.jsx("p",{className:"text-gray-200",children:(e==null?void 0:e.client_company)||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"狀態"}),a.jsx("p",{className:"text-gray-200",children:l(e==null?void 0:e.status)})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"請款金額"}),a.jsxs("p",{className:"text-2xl font-bold text-[#00FFFF]",children:["NT$ ",((e==null?void 0:e.invoice_amount)||0).toLocaleStr
712ing()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已收金額"}),a.jsxs("p",{className:"text-xl font-semibold text-green-400",children:["NT$ ",((e==null?void 0:e.received_amount)||0).toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未收金額"}),a.jsxs("p",{className:"text-xl font-semibold text-red-400",children:["NT$ ",((e==null?void 0:e.outstanding_amount)||0).toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"請款日期"}),a.jsx("p",{className:"text-gray-200",children:(e==null?void 0:e.invoice_date)||"-"})]}),(e==null?void 0:e.due_date)&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"到期日"}),a.jsx("p",{className:"text-gray-200",children:e.due_date})]})]})]}),(e==null?void 0:e.invoice_link)&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"電子發票連結"}),a.jsx("a",{href:e.invoice_link,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline",children:e.invoice_link})]}),(e==null?void 0:e.bank_account_info)&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"匯款帳號資訊"}),a.jsx("pre",{className:"text-gray-200 whitespace-pre-wrap bg-gray-900 p-4 rounded",children:e.bank_account_info})]}),(e==null?void 0:e.notes)&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"備註"}),a.jsx("p",{className:"text-gray-200 whitespace-pre-wrap",children:e.notes})]}),(e==null?void 0:e.status)!=="paid"&&(e==null?void 0:e.status)!=="cancelled"&&a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs(te,{onClick:()=>{confirm("確認此請款單已全額收款?")&&o.mutate("paid")},disabled:o.isPending,className:"bg-green-900 text-white hover:bg-green-800 border-green-700",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"標記為已結清"]})})]})]}),n&&(e==null?void 0:e.file_url)&&a.jsx($a,{fileUrl:e.file_url,fileName:`請款單 - ${(e==null?void 0:e.invoice_number)||"請款單"}`,onClose:()=>i(!1)})]})}function Jye(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState(""),[c,f]=I.useState("all"),[h,d]=I.useState(""),[m,p]=I.useState(""),x=at(),{data:y=[],isLoading:v}=Te({queryKey:["course_invoices"],queryFn:async()=>await ee.entities.CourseInvoice.list("-created_date")}),{data:b=[]}=Te({queryKey:["courses"],queryFn:()=>ee.entities.Course.list()}),{data:w=[]}=Te({queryKey:["corporate_trainings"],queryFn:()=>ee.entities.CorporateTraining.list()}),_=Ye({mutationFn:async E=>await ee.entities.CourseInvoice.delete(E),onSuccess:async()=>{await x.invalidateQueries(["course_invoices"]),alert("刪除成功!")}}),N=y.filter(E=>{var U,H,K,q;const T=c==="all"||(E==null?void 0:E.status)===c,$=!o||((U=E==null?void 0:E.invoice_number)==null?void 0:U.toLowerCase().includes(o.toLowerCase()))||((H=E==null?void 0:E.course_name)==null?void 0:H.toLowerCase().includes(o.toLowerCase()))||((K=E==null?void 0:E.training_name)==null?void 0:K.toLowerCase().includes(o.toLowerCase()))||((q=E==null?void 0:E.client_company)==null?void 0:q.toLowerCase().includes(o.toLowerCase())),D=E==null?void 0:E.invoice_date;let W=!0;return D?(h&&new Date(D)<new Date(h)&&(W=!1),m&&new Date(D)>new Date(m)&&(W=!1)):(h||m)&&(W=!1),T&&$&&W}),S=N.reduce((E,T)=>E+((T==null?void 0:T.invoice_amount)||0),0),k=N.reduce((E,T)=>E+((T==null?void 0:T.received_amount)||0),0),C=N.reduce((E,T)=>E+((T==null?void 0:T.outstanding_amount)||0),0),O=E=>{const T={draft:{label:"草稿",color:"#808080"},pending:{label:"待審核",color:"#FFD700"},sent:{label:"已發送",color:"#00FFFF"},paid:{label:"已結清",color:"#00FF00"},cancelled:{label:"已作廢",color:"#FF4444"}},$=T[E]||T.draft;return a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:$.color+"33",color:$.color,border:`1px solid ${$.color}`}
712,children:$.label})},R=[{name:"已請款",value:S},{name:"已收款",value:k},{name:"未收款",value:C}].filter(E=>E.value>0),A=[{name:"已請款",amount:S},{name:"已收款",amount:k},{name:"未收款",amount:C}],P=["#00FFFF","#00FF00","#FF4444"];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ut,{className:"w-8 h-8 cyber-text"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"企業培訓專案請款"})]}),a.jsxs(te,{onClick:()=>{s(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增請款單"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(ut,{className:"w-8 h-8 text-[#00FFFF]"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已請款金額"}),a.jsxs("p",{className:"text-2xl font-bold cyber-text",children:["NT$ ",(S||0).toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(ut,{className:"w-8 h-8 text-green-400"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已收款金額"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",(k||0).toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(ut,{className:"w-8 h-8 text-red-400"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未收款金額"}),a.jsxs("p",{className:"text-2xl font-bold text-red-400",children:["NT$ ",(C||0).toLocaleString()]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋請款單編號、課程、企業培訓...",value:o,onChange:E=>l(E.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(qe,{value:c,onValueChange:f,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"狀態篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有狀態"}),a.jsx(se,{value:"draft",className:"text-white",children:"草稿"}),a.jsx(se,{value:"pending",className:"text-white",children:"待審核"}),a.jsx(se,{value:"sent",className:"text-white",children:"已發送"}),a.jsx(se,{value:"paid",className:"text-white",children:"已結清"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已作廢"})]})]}),a.jsx(te,{variant:"outline",onClick:()=>{l(""),f("all"),d(""),p("")},className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"清除篩選"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-gray-400",children:"日期範圍:"}),a.jsx(ne,{type:"date",value:h,onChange:E=>d(E.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]"}),a.jsx("span",{className:"text-gray-400",children:"-"}),a.jsx(ne,{type:"date",value:m,onChange:E=>p(E.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),N.length>0&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"金額分布"}),a.jsx(En,{width:"100%",height:300,children:a.jsxs(oh,{data:A,children:[a.jsx(el,{strokeDasharray:"3 3",stroke:"#333"}),a.jsx(fi,{dataKey:"name",stroke:"#888"}),a.jsx(hi,{stroke:"#888"}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF"},formatter:E=>
712`NT$ ${E.toLocaleString()}`}),a.jsx(Qn,{dataKey:"amount",fill:"#00FFFF",name:"金額 (NT$)"})]})})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"請款狀態比例"}),a.jsx(En,{width:"100%",height:300,children:a.jsxs(Hs,{children:[a.jsx(ln,{data:R,cx:"50%",cy:"50%",labelLine:!1,label:({name:E,percent:T,value:$})=>`${E} ${(T*100).toFixed(0)}% (NT$ ${$.toLocaleString()})`,outerRadius:80,fill:"#8884d8",dataKey:"value",children:R.map((E,T)=>a.jsx(Ma,{fill:P[T%P.length]},`cell-${T}`))}),a.jsx(fr,{formatter:E=>`NT$ ${E.toLocaleString()}`})]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h2",{className:"text-xl font-bold text-white",children:"請款單列表"}),v?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):N.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(ut,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無請款單資料"})]}):a.jsx("div",{className:"space-y-3",children:N.map(E=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:(E==null?void 0:E.invoice_number)||"-"}),O(E==null?void 0:E.status)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3 text-sm",children:[a.jsxs("div",{className:"text-gray-300",children:["課程:",(E==null?void 0:E.course_name)||"-"]}),a.jsxs("div",{className:"text-gray-300",children:["企業培訓:",(E==null?void 0:E.training_name)||"-"]}),a.jsxs("div",{className:"text-gray-300",children:["客戶:",(E==null?void 0:E.client_company)||"-"]}),a.jsxs("div",{className:"text-gray-300",children:["請款日期:",(E==null?void 0:E.invoice_date)||"-"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 text-sm",children:[a.jsxs("div",{className:"text-[#00FFFF] font-semibold",children:["請款:NT$ ",((E==null?void 0:E.invoice_amount)||0).toLocaleString()]}),a.jsxs("div",{className:"text-green-400",children:["已收:NT$ ",((E==null?void 0:E.received_amount)||0).toLocaleString()]}),a.jsxs("div",{className:"text-red-400 font-semibold",children:["未收:NT$ ",((E==null?void 0:E.outstanding_amount)||0).toLocaleString()]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>n(E),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"詳情"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{s(E),t(!0)},className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:a.jsx(qt,{className:"w-4 h-4"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{window.confirm("確定要刪除此請款單嗎?")&&_.mutate(E.id)},className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},E.id))})]}),e&&a.jsx(u8,{invoice:i,courses:b,trainings:w,onClose:()=>{t(!1),s(null)}}),r&&!e&&a.jsx(Zye,{invoice:r,onClose:()=>n(null),onEdit:()=>{s(r),t(!0),n(null)}})]})}var gp={exports:{}};/*!
713 * Quill Editor v1.3.7
714 * https://quilljs.com/
715 * Copyright (c) 2014, Jason Chen
716 * Copyright (c) 2013, salesforce.com
717 */var eve=gp.exports,_M;function tve(){return _M||(_M=1,(function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:eve,function(){return(function(r){var n={};function i(s){if(n[s])return n[s].exports;var o=n[s]={i:s,l:!1,exports:{}};return r[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(s,o,l){i.o(s,o)||Object.defineProperty(s,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(o,"a",o),o},i.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},i.p="",i(i.s=109)})([(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(17),o=i(18),l=i(19),c=i(45),f=i(46),h=i(47),d=i(48),m=i(49),p=i(12),x=i(32),y=i(33),v=i(31),b=i(1),w={Scope:b.Scope,create:b.create,find:b.find,query:b.query,register:b.register,Container:s.default,Format:o.default,Leaf:l.default,Embed:d.default,Scroll:c.default,Block:h.default,Inline:f.default,Text:m.default,Attributor:{Attribute:p.default,Class:x.default,Style:y.default,Store:v.default}};n.default=w}),(function(r,n,i){var s=this&&this.__extends||(function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var _ in w)w.hasOwnProperty(_)&&(b[_]=w[_])};return function(b,w){v(b,w);function _(){this.constructor=b}
vendor: 89,760 bytes, lines 717-742
717b.prototype=w===null?Object.create(w):(_.prototype=w.prototype,new _)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=(function(v){s(b,v);function b(w){var _=this;return w="[Parchment] "+w,_=v.call(this,w)||this,_.message=w,_.name=_.constructor.name,_}return b})(Error);n.ParchmentError=o;var l={},c={},f={},h={};n.DATA_KEY="__blot";var d;(function(v){v[v.TYPE=3]="TYPE",v[v.LEVEL=12]="LEVEL",v[v.ATTRIBUTE=13]="ATTRIBUTE",v[v.BLOT=14]="BLOT",v[v.INLINE=7]="INLINE",v[v.BLOCK=11]="BLOCK",v[v.BLOCK_BLOT=10]="BLOCK_BLOT",v[v.INLINE_BLOT=6]="INLINE_BLOT",v[v.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",v[v.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",v[v.ANY=15]="ANY"})(d=n.Scope||(n.Scope={}));function m(v,b){var w=x(v);if(w==null)throw new o("Unable to create "+v+" blot");var _=w,N=v instanceof Node||v.nodeType===Node.TEXT_NODE?v:_.create(b);return new _(N,b)}n.create=m;function p(v,b){return b===void 0&&(b=!1),v==null?null:v[n.DATA_KEY]!=null?v[n.DATA_KEY].blot:b?p(v.parentNode,b):null}n.find=p;function x(v,b){b===void 0&&(b=d.ANY);var w;if(typeof v=="string")w=h[v]||l[v];else if(v instanceof Text||v.nodeType===Node.TEXT_NODE)w=h.text;else if(typeof v=="number")v&d.LEVEL&d.BLOCK?w=h.block:v&d.LEVEL&d.INLINE&&(w=h.inline);else if(v instanceof HTMLElement){var _=(v.getAttribute("class")||"").split(/\s+/);for(var N in _)if(w=c[_[N]],w)break;w=w||f[v.tagName]}return w==null?null:b&d.LEVEL&w.scope&&b&d.TYPE&w.scope?w:null}n.query=x;function y(){for(var v=[],b=0;b<arguments.length;b++)v[b]=arguments[b];if(v.length>1)return v.map(function(N){return y(N)});var w=v[0];if(typeof w.blotName!="string"&&typeof w.attrName!="string")throw new o("Invalid definition");if(w.blotName==="abstract")throw new o("Cannot register abstract class");if(h[w.blotName||w.attrName]=w,typeof w.keyName=="string")l[w.keyName]=w;else if(w.className!=null&&(c[w.className]=w),w.tagName!=null){Array.isArray(w.tagName)?w.tagName=w.tagName.map(function(N){return N.toUpperCase()}):w.tagName=w.tagName.toUpperCase();var _=Array.isArray(w.tagName)?w.tagName:[w.tagName];_.forEach(function(N){(f[N]==null||w.className==null)&&(f[N]=w)})}return w}n.register=y}),(function(r,n,i){var s=i(51),o=i(11),l=i(3),c=i(20),f="\0",h=function(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]};h.prototype.insert=function(d,m){var p={};return d.length===0?this:(p.insert=d,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(p.attributes=m),this.push(p))},h.prototype.delete=function(d){return d<=0?this:this.push({delete:d})},h.prototype.retain=function(d,m){if(d<=0)return this;var p={retain:d};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(p.attributes=m),this.push(p)},h.prototype.push=function(d){var m=this.ops.length,p=this.ops[m-1];if(d=l(!0,{},d),typeof p=="object"){if(typeof d.delete=="number"&&typeof p.delete=="number")return this.ops[m-1]={delete:p.delete+d.delete},this;if(typeof p.delete=="number"&&d.insert!=null&&(m-=1,p=this.ops[m-1],typeof p!="object"))return this.ops.unshift(d),this;if(o(d.attributes,p.attributes)){if(typeof d.insert=="string"&&typeof p.insert=="string")return this.ops[m-1]={insert:p.insert+d.insert},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof p.retain=="number")return this.ops[m-1]={retain:p.retain+d.retain},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this}}return m===this.ops.length?this.ops.push(d):this.ops.splice(m,0,d),this},h.prototype.chop=function(){var d=this.ops[this.ops.length-1];return d&&d.retain&&!d.attributes&&this.ops.pop(),this},h.prototype.filter=function(d){return this.ops.filter(d)},h.prototype.forEach=function(d){this.ops.forEach(d)},h.prototype.map=function(d){return this.ops.map(d)},h.prototype.partition=function(d){var m=[],p=[];return this.forEach(function(x){var y=d(x)?m:p;y.push(x)}),[m,p]},h.prototype.reduce=function(d,m){return this.ops.reduce(d,m)},h.prototype.changeLength=function(){return this.reduce(function(d,m){return m.insert?d+c.length(m):m.delete?d-m.delete:d},0)},h.prototype.length=function(){return this.reduce(function(d,m){return d+c.length(m)},0)},h.prototype.slice=function(d,m){d=d||0,typeof m!="number"&&(m=1/0);for(var p=[],x=c.iterator(this.ops),y=0;y<m&&x.hasNext();){var v;y<d?v=x.next(d-y):(v=x.next(m-y),p.push(v)),y+=c.length(v)}return new h(p)},h.prototype.compose=function(d){var m=c.iterator(this.ops),p=c.iterator(d.ops),x=[],y=p.peek();if(y!=null&&typeof y.retain=="number"&&y.attributes==null){for(var v=y.retain;m.peekType()==="insert"&&m.peekLength()<=v;)v-=m.peekLength(),x.push(m.next());y.retain-v>0&&p.next(y.retain-v)}for(var b=new h(x);m.hasNext()||p.hasNext();)if(p.peekType()==="insert")b.push(p.next());else if(m.peekType()==="delete")b.push(m.next());else{var w=Math.min(m.peekLength(),p.peekLength()),_=m.next(w),N=p.next(w);if(typeof N.retain=="number"){var S={};typeof _.retain=="number"?S.retain=w:S.insert=_.insert;var k=c.attributes.compose(_.attributes,N.attributes,typeof _.retain=="number");if(k&&(S.attributes=k),b.push(S),!p.hasNext()&&o(b.ops[b.ops.length-1],S)){var C=new h(m.rest());return b.concat(C).chop()}}else typeof N.delete=="number"&&typeof _.retain=="number"&&b.push(N)}return b.chop()},h.prototype.concat=function(d){var m=new h(this.ops.slice());return d.ops.length>0&&(m.push(d.ops[0]),m.ops=m.ops.concat(d.ops.slice(1))),m},h.prototype.diff=function(d,m){if(this.ops===d.ops)return new h;var p=[this,d].map(function(w){return w.map(function(_){if(_.insert!=null)return typeof _.insert=="string"?_.insert:f;var N=w===d?"on":"with";throw new Error("diff() called "+N+" non-document")}).join("")}),x=new h,y=s(p[0],p[1],m),v=c.iterator(this.ops),b=c.iterator(d.ops);return y.forEach(function(w){for(var _=w[1].length;_>0;){var N=0;switch(w[0]){case s.INSERT:N=Math.min(b.peekLength(),_),x.push(b.next(N));break;case s.DELETE:N=Math.min(_,v.peekLength()),v.next(N),x.delete(N);break;case s.EQUAL:N=Math.min(v.peekLength(),b.peekLength(),_);var S=v.next(N),k=b.next(N);o(S.insert,k.insert)?x.retain(N,c.attributes.diff(S.attributes,k.attributes)):x.push(k).delete(N);break}_-=N}}),x.chop()},h.prototype.eachLine=function(d,m){m=m||`
718`;for(var p=c.iterator(this.ops),x=new h,y=0;p.hasNext();){if(p.peekType()!=="insert")return;var v=p.peek(),b=c.length(v)-p.peekLength(),w=typeof v.insert=="string"?v.insert.indexOf(m,b)-b:-1;if(w<0)x.push(p.next());else if(w>0)x.push(p.next(w));else{if(d(x,p.next(1).attributes||{},y)===!1)return;y+=1,x=new h}}x.length()>0&&d(x,{},y)},h.prototype.transform=function(d,m){if(m=!!m,typeof d=="number")return this.transformPosition(d,m);for(var p=c.iterator(this.ops),x=c.iterator(d.ops),y=new h;p.hasNext()||x.hasNext();)if(p.peekType()==="insert"&&(m||x.peekType()!=="insert"))y.retain(c.length(p.next()));else if(x.peekType()==="insert")y.push(x.next());else{var v=Math.min(p.peekLength(),x.peekLength()),b=p.next(v),w=x.next(v);if(b.delete)continue;w.delete?y.push(w):y.retain(v,c.attributes.transform(b.attributes,w.attributes,m))}return y.chop()},h.prototype.transformPosition=function(d,m){m=!!m;for(var p=c.iterator(this.ops),x=0;p.hasNext()&&x<=d;){var y=p.peekLength(),v=p.peekType();if(p.next(),v==="delete"){d-=Math.min(y,d-x);continue}else v==="insert"&&(x<d||!m)&&(d+=y);x+=y}return d},r.exports=h}),(function(r,n){var i=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=function(p){return typeof Array.isArray=="function"?Array.isArray(p):s.call(p)==="[object Array]"},f=function(p){if(!p||s.call(p)!=="[object Object]")return!1;var x=i.call(p,"constructor"),y=p.constructor&&p.constructor.prototype&&i.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!x&&!y)return!1;var v;for(v in p);return typeof v>"u"||i.call(p,v)},h=function(p,x){o&&x.name==="__proto__"?o(p,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):p[x.name]=x.newValue},d=function(p,x){if(x==="__proto__")if(i.call(p,x)){if(l)return l(p,x).value}else return;return p[x]};r.exports=function m(){var p,x,y,v,b,w,_=arguments[0],N=1,S=arguments.length,k=!1;for(typeof _=="boolean"&&(k=_,_=arguments[1]||{},N=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});N<S;++N)if(p=arguments[N],p!=null)for(x in p)y=d(_,x),v=d(p,x),_!==v&&(k&&v&&(f(v)||(b=c(v)))?(b?(b=!1,w=y&&c(y)?y:[]):w=y&&f(y)?y:{},h(_,{name:x,newValue:m(k,w,v)})):typeof v<"u"&&h(_,{name:x,newValue:v}));return _}}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var s=(function(){function P(E,T){for(var $=0;$<T.length;$++){var D=T[$];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}return function(E,T,$){return T&&P(E.prototype,T),$&&P(E,$),E}})(),o=function P(E,T,$){E===null&&(E=Function.prototype);var D=Object.getOwnPropertyDescriptor(E,T);if(D===void 0){var W=Object.getPrototypeOf(E);return W===null?void 0:P(W,T,$)}else{if("value"in D)return D.value;var U=D.get;return U===void 0?void 0:U.call($)}},l=i(3),c=_(l),f=i(2),h=_(f),d=i(0),m=_(d),p=i(16),x=_(p),y=i(6),v=_(y),b=i(7),w=_(b);function _(P){return P&&P.__esModule?P:{default:P}}function N(P,E){if(!(P instanceof E))throw new TypeError("Cannot call a class as a function")}function S(P,E){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:P}function k(P,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);P.prototype=Object.create(E&&E.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(P,E):P.__proto__=E)}var C=1,O=(function(P){k(E,P);function E(){return N(this,E),S(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return s(E,[{key:"attach",value:function(){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"attach",this).call(this),this.attributes=new m.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,c.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function($,D){var W=m.default.query($,m.default.Scope.BLOCK_ATTRIBUTE);W!=null&&this.attributes.attribute(W,D)}},{key:"formatAt",value:function($,D,W,U){this.format(W,U)}},{key:"insertAt",value:function($,D,W){if(typeof D=="string"&&D.endsWith(`
719`)){var U=m.default.create(R.blotName);this.parent.insertBefore(U,$===0?this:this.next),U.insertAt(0,D.slice(0,-1))}else o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertAt",this).call(this,$,D,W)}}]),E})(m.default.Embed);O.scope=m.default.Scope.BLOCK_BLOT;var R=(function(P){k(E,P);function E(T){N(this,E);var $=S(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,T));return $.cache={},$}return s(E,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(m.default.Leaf).reduce(function($,D){return D.length()===0?$:$.insert(D.value(),A(D))},new h.default).insert(`
720`,A(this))),this.cache.delta}},{key:"deleteAt",value:function($,D){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"deleteAt",this).call(this,$,D),this.cache={}}},{key:"formatAt",value:function($,D,W,U){D<=0||(m.default.query(W,m.default.Scope.BLOCK)?$+D===this.length()&&this.format(W,U):o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"formatAt",this).call(this,$,Math.min(D,this.length()-$-1),W,U),this.cache={})}},{key:"insertAt",value:function($,D,W){if(W!=null)return o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertAt",this).call(this,$,D,W);if(D.length!==0){var U=D.split(`
721`),H=U.shift();H.length>0&&($<this.length()-1||this.children.tail==null?o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertAt",this).call(this,Math.min($,this.length()-1),H):this.children.tail.insertAt(this.children.tail.length(),H),this.cache={});var K=this;U.reduce(function(q,L){return K=K.split(q,!0),K.insertAt(0,L),L.length},$+H.length)}}},{key:"insertBefore",value:function($,D){var W=this.children.head;o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertBefore",this).call(this,$,D),W instanceof x.default&&W.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"length",this).call(this)+C),this.cache.length}},{key:"moveChildren",value:function($,D){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"moveChildren",this).call(this,$,D),this.cache={}}},{key:"optimize",value:function($){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,$),this.cache={}}},{key:"path",value:function($){return o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"path",this).call(this,$,!0)}},{key:"removeChild",value:function($){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"removeChild",this).call(this,$),this.cache={}}},{key:"split",value:function($){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(D&&($===0||$>=this.length()-C)){var W=this.clone();return $===0?(this.parent.insertBefore(W,this),this):(this.parent.insertBefore(W,this.next),W)}else{var U=o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"split",this).call(this,$,D);return this.cache={},U}}}]),E})(m.default.Block);R.blotName="block",R.tagName="P",R.defaultChild="break",R.allowedChildren=[v.default,m.default.Embed,w.default];function A(P){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return P==null||(typeof P.formats=="function"&&(E=(0,c.default)(E,P.formats())),P.parent==null||P.parent.blotName=="scroll"||P.parent.statics.scope!==P.statics.scope)?E:A(P.parent,E)}n.bubbleFormats=A,n.BlockEmbed=O,n.default=R}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},o=(function(){function K(q,L){var V=[],z=!0,Z=!1,re=void 0;try{for(var G=q[Symbol.iterator](),X;!(z=(X=G.next()).done)&&(V.push(X.value),!(L&&V.length===L));z=!0);}catch(ie){Z=!0,re=ie}finally{try{!z&&G.return&&G.return()}finally{if(Z)throw re}}return V}return function(q,L){if(Array.isArray(q))return q;if(Symbol.iterator in Object(q))return K(q,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function K(q,L){for(var V=0;V<L.length;V++){var z=L[V];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(q,z.key,z)}}return function(q,L,V){return L&&K(q.prototype,L),V&&K(q,V),q}})();i(50);var c=i(2),f=A(c),h=i(14),d=A(h),m=i(8),p=A(m),x=i(9),y=A(x),v=i(0),b=A(v),w=i(15),_=A(w),N=i(3),S=A(N),k=i(10),C=A(k),O=i(34),R=A(O);function A(K){return K&&K.__esModule?K:{default:K}}function P(K,q,L){return q in K?Object.defineProperty(K,q,{value:L,enumerable:!0,configurable:!0,writable:!0}):K[q]=L,K}function E(K,q){if(!(K instanceof q))throw new TypeError("Cannot call a class as a function")}var T=(0,C.default)("quill"),$=(function(){l(K,null,[{key:"debug",value:function(L){L===!0&&(L="log"),C.default.level(L)}},{key:"find",value:function(L){return L.__quill||b.default.find(L)}},{key:"import",value:function(L){return this.imports[L]==null&&T.error("Cannot import "+L+". Are you sure it was registered?"),this.imports[L]}},{key:"register",value:function(L,V){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof L!="string"){var re=L.attrName||L.blotName;typeof re=="string"?this.register("formats/"+re,L,V):Object.keys(L).forEach(function(G){z.register(G,L[G],V)})}else this.imports[L]!=null&&!Z&&T.warn("Overwriting "+L+" with",V),this.imports[L]=V,(L.startsWith("blots/")||L.startsWith("formats/"))&&V.blotName!=="abstract"?b.default.register(V):L.startsWith("modules")&&typeof V.register=="function"&&V.register()}}]);function K(q){var L=this,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(E(this,K),this.options=D(q,V),this.container=this.options.container,this.container==null)return T.error("Invalid Quill container",q);this.options.debug&&K.debug(this.options.debug);var z=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new p.default,this.scroll=b.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new d.default(this.scroll),this.selection=new _.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(re){re===p.default.events.TEXT_CHANGE&&L.root.classList.toggle("ql-blank",L.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(re,G){var X=L.selection.lastRange,ie=X&&X.length===0?X.index:void 0;W.call(L,function(){return L.editor.update(null,G,ie)},re)});var Z=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+z+"<p><br></p></div>");this.setContents(Z),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(K,[{key:"addContainer",value:function(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof L=="string"){var z=L;L=document.createElement("div"),L.classList.add(z)}return this.container.insertBefore(L,V),L}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(L,V,z){var Z=this,re=U(L,V,z),G=o(re,4);return L=G[0],V=G[1],z=G[3],W.call(this,function(){return Z.editor.deleteText(L,V)},z,L,-1*V)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(L),this.container.classList.toggle("ql-disabled",!L)}},{key:"focus",value:function(){var L=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=L,this.scrollIntoView()}},{key:"format",value:function(L,V){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return W.call(this,function(){var re=z.getSelection(!0),G=new f.default;if(re==null)return G;if(b.default.query(L,b.default.Scope.BLOCK))G=z.editor.formatLine(re.index,re.length,P({},L,V));else{if(re.length===0)return z.selection.format(L,V),G;G=z.editor.formatText(re.index,re.length,P({},L,V))}return z.setSelection(re,p.default.sources.SILENT),G},Z)}},{key:"formatLine",value:function(L,V,z,Z,re){var G=this,X=void 0,ie=U(L,V,z,Z,re),J=o(ie,4);return L=J[0],V=J[1],X=J[2],re=J[3],W.call(this,function(){return G.editor.formatLine(L,V,X)},re,L,0)}},{key:"formatText",value:function(L,V,z,Z,re){var G=this,X=void 0,ie=U(L,V,z,Z,re),J=o(ie,4);return L=J[0],V=J[1],X=J[2],re=J[3],W.call(this,function(){return G.editor.formatText(L,V,X)},re,L,0)}},{key:"getBounds",value:function(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=void 0;typeof L=="number"?z=this.selection.getBounds(L,V):z=this.selection.getBounds(L.index,L.length);var Z=this.container.getBoundingClientRect();return{bottom:z.bottom-Z.top,height:z.height,left:z.left-Z.left,right:z.right-Z.left,top:z.top-Z.top,width:z.width}}},{key:"getContents",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,z=U(L,V),Z=o(z,2);return L=Z[0],V=Z[1],this.editor.getContents(L,V)}},{key:"getFormat",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof L=="number"?this.editor.getFormat(L,V):this.editor.getFormat(L.index,L.length)}},{key:"getIndex",value:function(L){return L.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(L){return this.scroll.leaf(L)}},{key:"getLine",value:function(L){return this.scroll.line(L)}},{key:"getLines",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof L!="number"?this.scroll.lines(L.index,L.length):this.scroll.lines(L,V)}},{key:"getModule",value:function(L){return this.theme.modules[L]}},{key:"getSelection",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return L&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-L,z=U(L,V),Z=o(z,2);return L=Z[0],V=Z[1],this.editor.getText(L,V)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(L,V,z){var Z=this,re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:K.sources.API;return W.call(this,function(){return Z.editor.insertEmbed(L,V,z)},re,L)}},{key:"insertText",value:function(L,V,z,Z,re){var G=this,X=void 0,ie=U(L,0,z,Z,re),J=o(ie,4);return L=J[0],X=J[2],re=J[3],W.call(this,function(){return G.editor.insertText(L,V,X)},re,L,V.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(L,V,z){this.clipboard.dangerouslyPasteHTML(L,V,z)}},{key:"removeFormat",value:function(L,V,z){var Z=this,re=U(L,V,z),G=o(re,4);return L=G[0],V=G[1],z=G[3],W.call(this,function(){return Z.editor.removeFormat(L,V)},z,L)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(L){var V=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return W.call(this,function(){L=new f.default(L);var Z=V.getLength(),re=V.editor.deleteText(0,Z),G=V.editor.applyDelta(L),X=G.ops[G.ops.length-1];X!=null&&typeof X.insert=="string"&&X.insert[X.insert.length-1]===`
722`&&(V.editor.deleteText(V.getLength()-1,1),G.delete(1));var ie=re.compose(G);return ie},z)}},{key:"setSelection",value:function(L,V,z){if(L==null)this.selection.setRange(null,V||K.sources.API);else{var Z=U(L,V,z),re=o(Z,4);L=re[0],V=re[1],z=re[3],this.selection.setRange(new w.Range(L,V),z),z!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,z=new f.default().insert(L);return this.setContents(z,V)}},{key:"update",value:function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,V=this.scroll.update(L);return this.selection.update(L),V}},{key:"updateContents",value:function(L){var V=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return W.call(this,function(){return L=new f.default(L),V.editor.applyDelta(L,z)},z,!0)}}]),K})();$.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},$.events=p.default.events,$.sources=p.default.sources,$.version="1.3.7",$.imports={delta:f.default,parchment:b.default,"core/module":y.default,"core/theme":R.default};function D(K,q){if(q=(0,S.default)(!0,{container:K,modules:{clipboard:!0,keyboard:!0,history:!0}},q),!q.theme||q.theme===$.DEFAULTS.theme)q.theme=R.default;else if(q.theme=$.import("themes/"+q.theme),q.theme==null)throw new Error("Invalid theme "+q.theme+". Did you register it?");var L=(0,S.default)(!0,{},q.theme.DEFAULTS);[L,q].forEach(function(Z){Z.modules=Z.modules||{},Object.keys(Z.modules).forEach(function(re){Z.modules[re]===!0&&(Z.modules[re]={})})});var V=Object.keys(L.modules).concat(Object.keys(q.modules)),z=V.reduce(function(Z,re){var G=$.import("modules/"+re);return G==null?T.error("Cannot load "+re+" module. Are you sure you registered it?"):Z[re]=G.DEFAULTS||{},Z},{});return q.modules!=null&&q.modules.toolbar&&q.modules.toolbar.constructor!==Object&&(q.modules.toolbar={container:q.modules.toolbar}),q=(0,S.default)(!0,{},$.DEFAULTS,{modules:z},L,q),["bounds","container","scrollingContainer"].forEach(function(Z){typeof q[Z]=="string"&&(q[Z]=document.querySelector(q[Z]))}),q.modules=Object.keys(q.modules).reduce(function(Z,re){return q.modules[re]&&(Z[re]=q.modules[re]),Z},{}),q}function W(K,q,L,V){if(this.options.strict&&!this.isEnabled()&&q===p.default.sources.USER)return new f.default;var z=L==null?null:this.getSelection(),Z=this.editor.delta,re=K();if(z!=null&&(L===!0&&(L=z.index),V==null?z=H(z,re,q):V!==0&&(z=H(z,L,V,q)),this.setSelection(z,p.default.sources.SILENT)),re.length()>0){var G,X=[p.default.events.TEXT_CHANGE,re,Z,q];if((G=this.emitter).emit.apply(G,[p.default.events.EDITOR_CHANGE].concat(X)),q!==p.default.sources.SILENT){var ie;(ie=this.emitter).emit.apply(ie,X)}}return re}function U(K,q,L,V,z){var Z={};return typeof K.index=="number"&&typeof K.length=="number"?typeof q!="number"?(z=V,V=L,L=q,q=K.length,K=K.index):(q=K.length,K=K.index):typeof q!="number"&&(z=V,V=L,L=q,q=0),(typeof L>"u"?"undefined":s(L))==="object"?(Z=L,z=V):typeof L=="string"&&(V!=null?Z[L]=V:z=L),z=z||p.default.sources.API,[K,q,Z,z]}function H(K,q,L,V){if(K==null)return null;var z=void 0,Z=void 0;if(q instanceof f.default){var re=[K.index,K.index+K.length].map(function(J){return q.transformPosition(J,V!==p.default.sources.USER)}),G=o(re,2);z=G[0],Z=G[1]}else{var X=[K.index,K.index+K.length].map(function(J){return J<q||J===q&&V===p.default.sources.USER?J:L>=0?J+L:Math.max(q,J+L)}),ie=o(X,2);z=ie[0],Z=ie[1]}return new w.Range(z,Z-z)}n.expandConfig=D,n.overload=U,n.default=$}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function v(b,w){for(var _=0;_<w.length;_++){var N=w[_];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(b,N.key,N)}}return function(b,w,_){return w&&v(b.prototype,w),_&&v(b,_),b}})(),o=function v(b,w,_){b===null&&(b=Function.prototype);var N=Object.getOwnPropertyDescriptor(b,w);if(N===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:v(S,w,_)}else{if("value"in N)return N.value;var k=N.get;return k===void 0?void 0:k.call(_)}},l=i(7),c=d(l),f=i(0),h=d(f);function d(v){return v&&v.__esModule?v:{default:v}}function m(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function p(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function x(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var y=(function(v){x(b,v);function b(){return m(this,b),p(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"formatAt",value:function(_,N,S,k){if(b.compare(this.statics.blotName,S)<0&&h.default.query(S,h.default.Scope.BLOT)){var C=this.isolate(_,N);k&&C.wrap(S,k)}else o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,_,N,S,k)}},{key:"optimize",value:function(_){if(o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,_),this.parent instanceof b&&b.compare(this.statics.blotName,this.parent.statics.blotName)>0){var N=this.parent.isolate(this.offset(),this.length());this.moveChildren(N),N.wrap(this)}}}],[{key:"compare",value:function(_,N){var S=b.order.indexOf(_),k=b.order.indexOf(N);return S>=0||k>=0?S-k:_===N?0:_<N?-1:1}}]),b})(h.default.Inline);y.allowedChildren=[y,h.default.Embed,c.default],y.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=y}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),o=l(s);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function f(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function h(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var d=(function(m){h(p,m);function p(){return c(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(o.default.Text);n.default=d}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function w(_,N){for(var S=0;S<N.length;S++){var k=N[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(_,k.key,k)}}return function(_,N,S){return N&&w(_.prototype,N),S&&w(_,S),_}})(),o=function w(_,N,S){_===null&&(_=Function.prototype);var k=Object.getOwnPropertyDescriptor(_,N);if(k===void 0){var C=Object.getPrototypeOf(_);return C===null?void 0:w(C,N,S)}else{if("value"in k)return k.value;var O=k.get;return O===void 0?void 0:O.call(S)}},l=i(54),c=d(l),f=i(10),h=d(f);function d(w){return w&&w.__esModule?w:{default:w}}function m(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}function p(w,_){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:w}function x(w,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);w.prototype=Object.create(_&&_.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(w,_):w.__proto__=_)}var y=(0,h.default)("quill:events"),v=["selectionchange","mousedown","mouseup","click"];v.forEach(function(w){document.addEventListener(w,function(){for(var _=arguments.length,N=Array(_),S=0;S<_;S++)N[S]=arguments[S];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(k){if(k.__quill&&k.__quill.emitter){var C;(C=k.__quill.emitter).handleDOM.apply(C,N)}})})});var b=(function(w){x(_,w);function _(){m(this,_);var N=p(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));return N.listeners={},N.on("error",y.error),N}return s(_,[{key:"emit",value:function(){y.log.apply(y,arguments),o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(S){for(var k=arguments.length,C=Array(k>1?k-1:0),O=1;O<k;O++)C[O-1]=arguments[O];(this.listeners[S.type]||[]).forEach(function(R){var A=R.node,P=R.handler;(S.target===A||A.contains(S.target))&&P.apply(void 0,[S].concat(C))})}},{key:"listenDOM",value:function(S,k,C){this.listeners[S]||(this.listeners[S]=[]),this.listeners[S].push({node:k,handler:C})}}]),_})(c.default);b.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},b.sources={API:"api",SILENT:"silent",USER:"user"},n.default=b}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function s(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}var o=function l(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s(this,l),this.quill=c,this.options=f};o.DEFAULTS={},n.default=o}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=["error","warn","log","info"],o="warn";function l(f){if(s.indexOf(f)<=s.indexOf(o)){for(var h,d=arguments.length,m=Array(d>1?d-1:0),p=1;p<d;p++)m[p-1]=arguments[p];(h=console)[f].apply(h,m)}}function c(f){return s.reduce(function(h,d){return h[d]=l.bind(console,d,f),h},{})}l.level=c.level=function(f){o=f},n.default=c}),(function(r,n,i){var s=Array.prototype.slice,o=i(52),l=i(53),c=r.exports=function(m,p,x){return x||(x={}),m===p?!0:m instanceof Date&&p instanceof Date?m.getTime()===p.getTime():!m||!p||typeof m!="object"&&typeof p!="object"?x.strict?m===p:m==p:d(m,p,x)};function f(m){return m==null}function h(m){return!(!m||typeof m!="object"||typeof m.length!="number"||typeof m.copy!="function"||typeof m.slice!="function"||m.length>0&&typeof m[0]!="number")}function d(m,p,x){var y,v;if(f(m)||f(p)||m.prototype!==p.prototype)return!1;if(l(m))return l(p)?(m=s.call(m),p=s.call(p),c(m,p,x)):!1;if(h(m)){if(!h(p)||m.length!==p.length)return!1;for(y=0;y<m.length;y++)if(m[y]!==p[y])return!1;return!0}try{var b=o(m),w=o(p)}catch{return!1}if(b.length!=w.length)return!1;for(b.sort(),w.sort(),y=b.length-1;y>=0;y--)if(b[y]!=w[y])return!1;for(y=b.length-1;y>=0;y--)if(v=b[y],!c(m[v],p[v],x))return!1;return typeof m==typeof p}}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(1),o=(function(){function l(c,f,h){h===void 0&&(h={}),this.attrName=c,this.keyName=f;var d=s.Scope.TYPE&s.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&s.Scope.LEVEL|d:this.scope=s.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.whitelist)}return l.keys=function(c){return[].map.call(c.attributes,function(f){return f.name})},l.prototype.add=function(c,f){return this.canAdd(c,f)?(c.setAttribute(this.keyName,f),!0):!1},l.prototype.canAdd=function(c,f){var h=s.query(c,s.Scope.BLOT&(this.scope|s.Scope.TYPE));return h==null?!1:this.whitelist==null?!0:typeof f=="string"?this.whitelist.indexOf(f.replace(/["']/g,""))>-1:this.whitelist.indexOf(f)>-1},l.prototype.remove=function(c){c.removeAttribute(this.keyName)},l.prototype.value=function(c){var f=c.getAttribute(this.keyName);return this.canAdd(c,f)&&f?f:""},l})();n.default=o}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var s=(function(){function O(R,A){var P=[],E=!0,T=!1,$=void 0;try{for(var D=R[Symbol.iterator](),W;!(E=(W=D.next()).done)&&(P.push(W.value),!(A&&P.length===A));E=!0);}catch(U){T=!0,$=U}finally{try{!E&&D.return&&D.return()}finally{if(T)throw $}}return P}return function(R,A){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return O(R,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function O(R,A){for(var P=0;P<A.length;P++){var E=A[P];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(R,E.key,E)}}return function(R,A,P){return A&&O(R.prototype,A),P&&O(R,P),R}})(),l=function O(R,A,P){R===null&&(R=Function.prototype);var E=Object.getOwnPropertyDescriptor(R,A);if(E===void 0){var T=Object.getPrototypeOf(R);return T===null?void 0:O(T,A,P)}else{if("value"in E)return E.value;var $=E.get;return $===void 0?void 0:$.call(P)}},c=i(2),f=w(c),h=i(0),d=w(h),m=i(4),p=w(m),x=i(6),y=w(x),v=i(7),b=w(v);function w(O){return O&&O.__esModule?O:{default:O}}function _(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}function N(O,R){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:O}function S(O,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);O.prototype=Object.create(R&&R.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(O,R):O.__proto__=R)}var k=(function(O){S(R,O);function R(){return _(this,R),N(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return R})(y.default);k.blotName="code",k.tagName="CODE";var C=(function(O){S(R,O);function R(){return _(this,R),N(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return o(R,[{key:"delta",value:function(){var P=this,E=this.domNode.textContent;return E.endsWith(`
723`)&&(E=E.slice(0,-1)),E.split(`
724`).reduce(function(T,$){return T.insert($).insert(`
725`,P.formats())},new f.default)}},{key:"format",value:function(P,E){if(!(P===this.statics.blotName&&E)){var T=this.descendant(b.default,this.length()-1),$=s(T,1),D=$[0];D!=null&&D.deleteAt(D.length()-1,1),l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"format",this).call(this,P,E)}}},{key:"formatAt",value:function(P,E,T,$){if(E!==0&&!(d.default.query(T,d.default.Scope.BLOCK)==null||T===this.statics.blotName&&$===this.statics.formats(this.domNode))){var D=this.newlineIndex(P);if(!(D<0||D>=P+E)){var W=this.newlineIndex(P,!0)+1,U=D-W+1,H=this.isolate(W,U),K=H.next;H.format(T,$),K instanceof R&&K.formatAt(0,P-W+E-U,T,$)}}}},{key:"insertAt",value:function(P,E,T){if(T==null){var $=this.descendant(b.default,P),D=s($,2),W=D[0],U=D[1];W.insertAt(U,E)}}},{key:"length",value:function(){var P=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
726`)?P:P+1}},{key:"newlineIndex",value:function(P){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(E)return this.domNode.textContent.slice(0,P).lastIndexOf(`
727`);var T=this.domNode.textContent.slice(P).indexOf(`
728`);return T>-1?P+T:-1}},{key:"optimize",value:function(P){this.domNode.textContent.endsWith(`
729`)||this.appendChild(d.default.create("text",`
730`)),l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,P);var E=this.next;E!=null&&E.prev===this&&E.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===E.statics.formats(E.domNode)&&(E.optimize(P),E.moveChildren(this),E.remove())}},{key:"replace",value:function(P){l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"replace",this).call(this,P),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(E){var T=d.default.find(E);T==null?E.parentNode.removeChild(E):T instanceof d.default.Embed?T.remove():T.unwrap()})}}],[{key:"create",value:function(P){var E=l(R.__proto__||Object.getPrototypeOf(R),"create",this).call(this,P);return E.setAttribute("spellcheck",!1),E}},{key:"formats",value:function(){return!0}}]),R})(p.default);C.blotName="code-block",C.tagName="PRE",C.TAB="  ",n.Code=k,n.default=C}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},o=(function(){function K(q,L){var V=[],z=!0,Z=!1,re=void 0;try{for(var G=q[Symbol.iterator](),X;!(z=(X=G.next()).done)&&(V.push(X.value),!(L&&V.length===L));z=!0);}catch(ie){Z=!0,re=ie}finally{try{!z&&G.return&&G.return()}finally{if(Z)throw re}}return V}return function(q,L){if(Array.isArray(q))return q;if(Symbol.iterator in Object(q))return K(q,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function K(q,L){for(var V=0;V<L.length;V++){var z=L[V];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(q,z.key,z)}}return function(q,L,V){return L&&K(q.prototype,L),V&&K(q,V),q}})(),c=i(2),f=E(c),h=i(20),d=E(h),m=i(0),p=E(m),x=i(13),y=E(x),v=i(24),b=E(v),w=i(4),_=E(w),N=i(16),S=E(N),k=i(21),C=E(k),O=i(11),R=E(O),A=i(3),P=E(A);function E(K){return K&&K.__esModule?K:{default:K}}function T(K,q,L){return q in K?Object.defineProperty(K,q,{value:L,enumerable:!0,configurable:!0,writable:!0}):K[q]=L,K}function $(K,q){if(!(K instanceof q))throw new TypeError("Cannot call a class as a function")}var D=/^[ -~]*$/,W=(function(){function K(q){$(this,K),this.scroll=q,this.delta=this.getDelta()}return l(K,[{key:"applyDelta",value:function(L){var V=this,z=!1;this.scroll.update();var Z=this.scroll.length();return this.scroll.batchStart(),L=H(L),L.reduce(function(re,G){var X=G.retain||G.delete||G.insert.length||1,ie=G.attributes||{};if(G.insert!=null){if(typeof G.insert=="string"){var J=G.insert;J.endsWith(`
731`)&&z&&(z=!1,J=J.slice(0,-1)),re>=Z&&!J.endsWith(`
732`)&&(z=!0),V.scroll.insertAt(re,J);var ue=V.scroll.line(re),ge=o(ue,2),fe=ge[0],Ee=ge[1],Oe=(0,P.default)({},(0,w.bubbleFormats)(fe));if(fe instanceof _.default){var Ve=fe.descendant(p.default.Leaf,Ee),Ae=o(Ve,1),tt=Ae[0];Oe=(0,P.default)(Oe,(0,w.bubbleFormats)(tt))}ie=d.default.attributes.diff(Oe,ie)||{}}else if(s(G.insert)==="object"){var ye=Object.keys(G.insert)[0];if(ye==null)return re;V.scroll.insertAt(re,ye,G.insert[ye])}Z+=X}return Object.keys(ie).forEach(function(xe){V.scroll.formatAt(re,X,xe,ie[xe])}),re+X},0),L.reduce(function(re,G){return typeof G.delete=="number"?(V.scroll.deleteAt(re,G.delete),re):re+(G.retain||G.insert.length||1)},0),this.scroll.batchEnd(),this.update(L)}},{key:"deleteText",value:function(L,V){return this.scroll.deleteAt(L,V),this.update(new f.default().retain(L).delete(V))}},{key:"formatLine",value:function(L,V){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Z).forEach(function(re){if(!(z.scroll.whitelist!=null&&!z.scroll.whitelist[re])){var G=z.scroll.lines(L,Math.max(V,1)),X=V;G.forEach(function(ie){var J=ie.length();if(!(ie instanceof y.default))ie.format(re,Z[re]);else{var ue=L-ie.offset(z.scroll),ge=ie.newlineIndex(ue+X)-ue+1;ie.formatAt(ue,ge,re,Z[re])}X-=J})}}),this.scroll.optimize(),this.update(new f.default().retain(L).retain(V,(0,C.default)(Z)))}},{key:"formatText",value:function(L,V){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Z).forEach(function(re){z.scroll.formatAt(L,V,re,Z[re])}),this.update(new f.default().retain(L).retain(V,(0,C.default)(Z)))}},{key:"getContents",value:function(L,V){return this.delta.slice(L,L+V)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(L,V){return L.concat(V.delta())},new f.default)}},{key:"getFormat",value:function(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=[],Z=[];V===0?this.scroll.path(L).forEach(function(G){var X=o(G,1),ie=X[0];ie instanceof _.default?z.push(ie):ie instanceof p.default.Leaf&&Z.push(ie)}):(z=this.scroll.lines(L,V),Z=this.scroll.descendants(p.default.Leaf,L,V));var re=[z,Z].map(function(G){if(G.length===0)return{};for(var X=(0,w.bubbleFormats)(G.shift());Object.keys(X).length>0;){var ie=G.shift();if(ie==null)return X;X=U((0,w.bubbleFormats)(ie),X)}return X});return P.default.apply(P.default,re)}},{key:"getText",value:function(L,V){return this.getContents(L,V).filter(function(z){return typeof z.insert=="string"}).map(function(z){return z.insert}).join("")}},{key:"insertEmbed",value:function(L,V,z){return this.scroll.insertAt(L,V,z),this.update(new f.default().retain(L).insert(T({},V,z)))}},{key:"insertText",value:function(L,V){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return V=V.replace(/\r\n/g,`
733`).replace(/\r/g,`
734`),this.scroll.insertAt(L,V),Object.keys(Z).forEach(function(re){z.scroll.formatAt(L,V.length,re,Z[re])}),this.update(new f.default().retain(L).insert(V,(0,C.default)(Z)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var L=this.scroll.children.head;return L.statics.blotName!==_.default.blotName||L.children.length>1?!1:L.children.head instanceof S.default}},{key:"removeFormat",value:function(L,V){var z=this.getText(L,V),Z=this.scroll.line(L+V),re=o(Z,2),G=re[0],X=re[1],ie=0,J=new f.default;G!=null&&(G instanceof y.default?ie=G.newlineIndex(X)-X+1:ie=G.length()-X,J=G.delta().slice(X,X+ie-1).insert(`
735`));var ue=this.getContents(L,V+ie),ge=ue.diff(new f.default().insert(z).concat(J)),fe=new f.default().retain(L).concat(ge);return this.applyDelta(fe)}},{key:"update",value:function(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Z=this.delta;if(V.length===1&&V[0].type==="characterData"&&V[0].target.data.match(D)&&p.default.find(V[0].target)){var re=p.default.find(V[0].target),G=(0,w.bubbleFormats)(re),X=re.offset(this.scroll),ie=V[0].oldValue.replace(b.default.CONTENTS,""),J=new f.default().insert(ie),ue=new f.default().insert(re.value()),ge=new f.default().retain(X).concat(J.diff(ue,z));L=ge.reduce(function(fe,Ee){return Ee.insert?fe.insert(Ee.insert,G):fe.push(Ee)},new f.default),this.delta=Z.compose(L)}else this.delta=this.getDelta(),(!L||!(0,R.default)(Z.compose(L),this.delta))&&(L=Z.diff(this.delta,z));return L}}]),K})();function U(K,q){return Object.keys(q).reduce(function(L,V){return K[V]==null||(q[V]===K[V]?L[V]=q[V]:Array.isArray(q[V])?q[V].indexOf(K[V])<0&&(L[V]=q[V].concat([K[V]])):L[V]=[q[V],K[V]]),L},{})}function H(K){return K.reduce(function(q,L){if(L.insert===1){var V=(0,C.default)(L.attributes);return delete V.image,q.insert({image:L.attributes.image},V)}if(L.attributes!=null&&(L.attributes.list===!0||L.attributes.bullet===!0)&&(L=(0,C.default)(L),L.attributes.list?L.attributes.list="ordered":(L.attributes.list="bullet",delete L.attributes.bullet)),typeof L.insert=="string"){var z=L.insert.replace(/\r\n/g,`
736`).replace(/\r/g,`
737`);return q.insert(z,L.attributes)}return q.push(L)},new f.default)}n.default=W}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var s=(function(){function O(R,A){var P=[],E=!0,T=!1,$=void 0;try{for(var D=R[Symbol.iterator](),W;!(E=(W=D.next()).done)&&(P.push(W.value),!(A&&P.length===A));E=!0);}catch(U){T=!0,$=U}finally{try{!E&&D.return&&D.return()}finally{if(T)throw $}}return P}return function(R,A){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return O(R,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function O(R,A){for(var P=0;P<A.length;P++){var E=A[P];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(R,E.key,E)}}return function(R,A,P){return A&&O(R.prototype,A),P&&O(R,P),R}})(),l=i(0),c=b(l),f=i(21),h=b(f),d=i(11),m=b(d),p=i(8),x=b(p),y=i(10),v=b(y);function b(O){return O&&O.__esModule?O:{default:O}}function w(O){if(Array.isArray(O)){for(var R=0,A=Array(O.length);R<O.length;R++)A[R]=O[R];return A}else return Array.from(O)}function _(O,R){if(!(O instanceof R))throw new TypeError("Cannot call a class as a function")}var N=(0,v.default)("quill:selection"),S=function O(R){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;_(this,O),this.index=R,this.length=A},k=(function(){function O(R,A){var P=this;_(this,O),this.emitter=A,this.scroll=R,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new S(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){P.mouseDown||setTimeout(P.update.bind(P,x.default.sources.USER),1)}),this.emitter.on(x.default.events.EDITOR_CHANGE,function(E,T){E===x.default.events.TEXT_CHANGE&&T.length()>0&&P.update(x.default.sources.SILENT)}),this.emitter.on(x.default.events.SCROLL_BEFORE_UPDATE,function(){if(P.hasFocus()){var E=P.getNativeRange();E!=null&&E.start.node!==P.cursor.textNode&&P.emitter.once(x.default.events.SCROLL_UPDATE,function(){try{P.setNativeRange(E.start.node,E.start.offset,E.end.node,E.end.offset)}catch{}})}}),this.emitter.on(x.default.events.SCROLL_OPTIMIZE,function(E,T){if(T.range){var $=T.range,D=$.startNode,W=$.startOffset,U=$.endNode,H=$.endOffset;P.setNativeRange(D,W,U,H)}}),this.update(x.default.sources.SILENT)}return o(O,[{key:"handleComposition",value:function(){var A=this;this.root.addEventListener("compositionstart",function(){A.composing=!0}),this.root.addEventListener("compositionend",function(){if(A.composing=!1,A.cursor.parent){var P=A.cursor.restore();if(!P)return;setTimeout(function(){A.setNativeRange(P.startNode,P.startOffset,P.endNode,P.endOffset)},1)}})}},{key:"handleDragging",value:function(){var A=this;this.emitter.listenDOM("mousedown",document.body,function(){A.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){A.mouseDown=!1,A.update(x.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(A,P){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[A])){this.scroll.update();var E=this.getNativeRange();if(!(E==null||!E.native.collapsed||c.default.query(A,c.default.Scope.BLOCK))){if(E.start.node!==this.cursor.textNode){var T=c.default.find(E.start.node,!1);if(T==null)return;if(T instanceof c.default.Leaf){var $=T.split(E.start.offset);T.parent.insertBefore(this.cursor,$)}else T.insertBefore(this.cursor,E.start.node);this.cursor.attach()}this.cursor.format(A,P),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(A){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,E=this.scroll.length();A=Math.min(A,E-1),P=Math.min(A+P,E-1)-A;var T=void 0,$=this.scroll.leaf(A),D=s($,2),W=D[0],U=D[1];if(W==null)return null;var H=W.position(U,!0),K=s(H,2);T=K[0],U=K[1];var q=document.createRange();if(P>0){q.setStart(T,U);var L=this.scroll.leaf(A+P),V=s(L,2);if(W=V[0],U=V[1],W==null)return null;var z=W.position(U,!0),Z=s(z,2);return T=Z[0],U=Z[1],q.setEnd(T,U),q.getBoundingClientRect()}else{var re="left",G=void 0;return T instanceof Text?(U<T.data.length?(q.setStart(T,U),q.setEnd(T,U+1)):(q.setStart(T,U-1),q.setEnd(T,U),re="right"),G=q.getBoundingClientRect()):(G=W.domNode.getBoundingClientRect(),U>0&&(re="right")),{bottom:G.top+G.height,height:G.height,left:G[re],right:G[re],top:G.top,width:0}}}},{key:"getNativeRange",value:function(){var A=document.getSelection();if(A==null||A.rangeCount<=0)return null;var P=A.getRangeAt(0);if(P==null)return null;var E=this.normalizeNative(P);return N.info("getNativeRange",E),E}},{key:"getRange",value:function(){var A=this.getNativeRange();if(A==null)return[null,null];var P=this.normalizedToRange(A);return[P,A]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(A){var P=this,E=[[A.start.node,A.start.offset]];A.native.collapsed||E.push([A.end.node,A.end.offset]);var T=E.map(function(W){var U=s(W,2),H=U[0],K=U[1],q=c.default.find(H,!0),L=q.offset(P.scroll);return K===0?L:q instanceof c.default.Container?L+q.length():L+q.index(H,K)}),$=Math.min(Math.max.apply(Math,w(T)),this.scroll.length()-1),D=Math.min.apply(Math,[$].concat(w(T)));return new S(D,$-D)}},{key:"normalizeNative",value:function(A){if(!C(this.root,A.startContainer)||!A.collapsed&&!C(this.root,A.endContainer))return null;var P={start:{node:A.startContainer,offset:A.startOffset},end:{node:A.endContainer,offset:A.endOffset},native:A};return[P.start,P.end].forEach(function(E){for(var T=E.node,$=E.offset;!(T instanceof Text)&&T.childNodes.length>0;)if(T.childNodes.length>$)T=T.childNodes[$],$=0;else if(T.childNodes.length===$)T=T.lastChild,$=T instanceof Text?T.data.length:T.childNodes.length+1;else break;E.node=T,E.offset=$}),P}},{key:"rangeToNative",value:function(A){var P=this,E=A.collapsed?[A.index]:[A.index,A.index+A.length],T=[],$=this.scroll.length();return E.forEach(function(D,W){D=Math.min($-1,D);var U=void 0,H=P.scroll.leaf(D),K=s(H,2),q=K[0],L=K[1],V=q.position(L,W!==0),z=s(V,2);U=z[0],L=z[1],T.push(U,L)}),T.length<2&&(T=T.concat(T)),T}},{key:"scrollIntoView",value:function(A){var P=this.lastRange;if(P!=null){var E=this.getBounds(P.index,P.length);if(E!=null){var T=this.scroll.length()-1,$=this.scroll.line(Math.min(P.index,T)),D=s($,1),W=D[0],U=W;if(P.length>0){var H=this.scroll.line(Math.min(P.index+P.length,T)),K=s(H,1);U=K[0]}if(!(W==null||U==null)){var q=A.getBoundingClientRect();E.top<q.top?A.scrollTop-=q.top-E.top:E.bottom>q.bottom&&(A.scrollTop+=E.bottom-q.bottom)}}}}},{key:"setNativeRange",value:function(A,P){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A,T=arguments.length>3&&arguments[3]!==void 0?arguments[3]:P,$=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(N.info("setNativeRange",A,P,E,T),!(A!=null&&(this.root.parentNode==null||A.parentNode==null||E.parentNode==null))){var D=document.getSelection();if(D!=null)if(A!=null){this.hasFocus()||this.root.focus();var W=(this.getNativeRange()||{}).native;if(W==null||$||A!==W.startContainer||P!==W.startOffset||E!==W.endContainer||T!==W.endOffset){A.tagName=="BR"&&(P=[].indexOf.call(A.parentNode.childNodes,A),A=A.parentNode),E.tagName=="BR"&&(T=[].indexOf.call(E.parentNode.childNodes,E),E=E.parentNode);var U=document.createRange();U.setStart(A,P),U.setEnd(E,T),D.removeAllRanges(),D.addRange(U)}}else D.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(A){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x.default.sources.API;if(typeof P=="string"&&(E=P,P=!1),N.info("setRange",A),A!=null){var T=this.rangeToNative(A);this.setNativeRange.apply(this,w(T).concat([P]))}else this.setNativeRange(null);this.update(E)}},{key:"update",value:function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x.default.sources.USER,P=this.lastRange,E=this.getRange(),T=s(E,2),$=T[0],D=T[1];if(this.lastRange=$,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,m.default)(P,this.lastRange)){var W;!this.composing&&D!=null&&D.native.collapsed&&D.start.node!==this.cursor.textNode&&this.cursor.restore();var U=[x.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(P),A];if((W=this.emitter).emit.apply(W,[x.default.events.EDITOR_CHANGE].concat(U)),A!==x.default.sources.SILENT){var H;(H=this.emitter).emit.apply(H,U)}}}}]),O})();function C(O,R){try{R.parentNode}catch{return!1}return R instanceof Text&&(R=R.parentNode),O.contains(R)}n.Range=S,n.default=k}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function x(y,v){for(var b=0;b<v.length;b++){var w=v[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(y,w.key,w)}}return function(y,v,b){return v&&x(y.prototype,v),b&&x(y,b),y}})(),o=function x(y,v,b){y===null&&(y=Function.prototype);var w=Object.getOwnPropertyDescriptor(y,v);if(w===void 0){var _=Object.getPrototypeOf(y);return _===null?void 0:x(_,v,b)}else{if("value"in w)return w.value;var N=w.get;return N===void 0?void 0:N.call(b)}},l=i(0),c=f(l);function f(x){return x&&x.__esModule?x:{default:x}}function h(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function d(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function m(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var p=(function(x){m(y,x);function y(){return h(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"insertInto",value:function(b,w){b.children.length===0?o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"insertInto",this).call(this,b,w):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),y})(c.default.Embed);p.blotName="break",p.tagName="BR",n.default=p}),(function(r,n,i){var s=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,p){m.__proto__=p}||function(m,p){for(var x in p)p.hasOwnProperty(x)&&(m[x]=p[x])};return function(m,p){d(m,p);function x(){this.constructor=m}m.prototype=p===null?Object.create(p):(x.prototype=p.prototype,new x)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),c=i(1),f=(function(d){s(m,d);function m(p){var x=d.call(this,p)||this;return x.build(),x}return m.prototype.appendChild=function(p){this.insertBefore(p)},m.prototype.attach=function(){d.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},m.prototype.build=function(){var p=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(x){try{var y=h(x);p.insertBefore(y,p.children.head||void 0)}catch(v){if(v instanceof c.ParchmentError)return;throw v}})},m.prototype.deleteAt=function(p,x){if(p===0&&x===this.length())return this.remove();this.children.forEachAt(p,x,function(y,v,b){y.deleteAt(v,b)})},m.prototype.descendant=function(p,x){var y=this.children.find(x),v=y[0],b=y[1];return p.blotName==null&&p(v)||p.blotName!=null&&v instanceof p?[v,b]:v instanceof m?v.descendant(p,b):[null,-1]},m.prototype.descendants=function(p,x,y){x===void 0&&(x=0),y===void 0&&(y=Number.MAX_VALUE);var v=[],b=y;return this.children.forEachAt(x,y,function(w,_,N){(p.blotName==null&&p(w)||p.blotName!=null&&w instanceof p)&&v.push(w),w instanceof m&&(v=v.concat(w.descendants(p,_,b))),b-=N}),v},m.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),d.prototype.detach.call(this)},m.prototype.formatAt=function(p,x,y,v){this.children.forEachAt(p,x,function(b,w,_){b.formatAt(w,_,y,v)})},m.prototype.insertAt=function(p,x,y){var v=this.children.find(p),b=v[0],w=v[1];if(b)b.insertAt(w,x,y);else{var _=y==null?c.create("text",x):c.create(x,y);this.appendChild(_)}},m.prototype.insertBefore=function(p,x){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(y){return p instanceof y}))throw new c.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,x)},m.prototype.length=function(){return this.children.reduce(function(p,x){return p+x.length()},0)},m.prototype.moveChildren=function(p,x){this.children.forEach(function(y){p.insertBefore(y,x)})},m.prototype.optimize=function(p){if(d.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var x=c.create(this.statics.defaultChild);this.appendChild(x),x.optimize(p)}else this.remove()},m.prototype.path=function(p,x){x===void 0&&(x=!1);var y=this.children.find(p,x),v=y[0],b=y[1],w=[[this,p]];return v instanceof m?w.concat(v.path(b,x)):(v!=null&&w.push([v,b]),w)},m.prototype.removeChild=function(p){this.children.remove(p)},m.prototype.replace=function(p){p instanceof m&&p.moveChildren(this),d.prototype.replace.call(this,p)},m.prototype.split=function(p,x){if(x===void 0&&(x=!1),!x){if(p===0)return this;if(p===this.length())return this.next}var y=this.clone();return this.parent.insertBefore(y,this.next),this.children.forEachAt(p,this.length(),function(v,b,w){v=v.split(b,x),y.appendChild(v)}),y},m.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},m.prototype.update=function(p,x){var y=this,v=[],b=[];p.forEach(function(w){w.target===y.domNode&&w.type==="childList"&&(v.push.apply(v,w.addedNodes),b.push.apply(b,w.removedNodes))}),b.forEach(function(w){if(!(w.parentNode!=null&&w.tagName!=="IFRAME"&&document.body.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var _=c.find(w);_!=null&&(_.domNode.parentNode==null||_.domNode.parentNode===y.domNode)&&_.detach()}}),v.filter(function(w){return w.parentNode==y.domNode}).sort(function(w,_){return w===_?0:w.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(w){var _=null;w.nextSibling!=null&&(_=c.find(w.nextSibling));var N=h(w);(N.next!=_||N.next==null)&&(N.parent!=null&&N.parent.removeChild(y),y.insertBefore(N,_||void 0))})},m})(l.default);function h(d){var m=c.find(d);if(m==null)try{m=c.create(d)}catch{m=c.create(c.Scope.INLINE),[].slice.call(d.childNodes).forEach(function(x){m.domNode.appendChild(x)}),d.parentNode&&d.parentNode.replaceChild(m.domNode,d),m.attach()}return m}n.default=f}),(function(r,n,i){var s=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,p){m.__proto__=p}||function(m,p){for(var x in p)p.hasOwnProperty(x)&&(m[x]=p[x])};return function(m,p){d(m,p);function x(){this.constructor=m}m.prototype=p===null?Object.create(p):(x.prototype=p.prototype,new x)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),c=i(17),f=i(1),h=(function(d){s(m,d);function m(p){var x=d.call(this,p)||this;return x.attributes=new l.default(x.domNode),x}return m.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},m.prototype.format=function(p,x){var y=f.query(p);y instanceof o.default?this.attributes.attribute(y,x):x&&y!=null&&(p!==this.statics.blotName||this.formats()[p]!==x)&&this.replaceWith(p,x)},m.prototype.formats=function(){var p=this.attributes.values(),x=this.statics.formats(this.domNode);return x!=null&&(p[this.statics.blotName]=x),p},m.prototype.replaceWith=function(p,x){var y=d.prototype.replaceWith.call(this,p,x);return this.attributes.copy(y),y},m.prototype.update=function(p,x){var y=this;d.prototype.update.call(this,p,x),p.some(function(v){return v.target===y.domNode&&v.type==="attributes"})&&this.attributes.build()},m.prototype.wrap=function(p,x){var y=d.prototype.wrap.call(this,p,x);return y instanceof m&&y.statics.scope===this.statics.scope&&this.attributes.move(y),y},m})(c.default);n.default=h}),(function(r,n,i){var s=this&&this.__extends||(function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){f(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),c=(function(f){s(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.value=function(d){return!0},h.prototype.index=function(d,m){return this.domNode===d||this.domNode.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(m,1):-1},h.prototype.position=function(d,m){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return d>0&&(p+=1),[this.parent.domNode,p]},h.prototype.value=function(){var d;return d={},d[this.statics.blotName]=this.statics.value(this.domNode)||!0,d},h.scope=l.Scope.INLINE_BLOT,h})(o.default);n.default=c}),(function(r,n,i){var s=i(11),o=i(3),l={attributes:{compose:function(f,h,d){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var m=o(!0,{},h);d||(m=Object.keys(m).reduce(function(x,y){return m[y]!=null&&(x[y]=m[y]),x},{}));for(var p in f)f[p]!==void 0&&h[p]===void 0&&(m[p]=f[p]);return Object.keys(m).length>0?m:void 0},diff:function(f,h){typeof f!="object"&&(f={}),typeof h!="object"&&(h={});var d=Object.keys(f).concat(Object.keys(h)).reduce(function(m,p){return s(f[p],h[p])||(m[p]=h[p]===void 0?null:h[p]),m},{});return Object.keys(d).length>0?d:void 0},transform:function(f,h,d){if(typeof f!="object")return h;if(typeof h=="object"){if(!d)return h;var m=Object.keys(h).reduce(function(p,x){return f[x]===void 0&&(p[x]=h[x]),p},{});return Object.keys(m).length>0?m:void 0}}},iterator:function(f){return new c(f)},length:function(f){return typeof f.delete=="number"?f.delete:typeof f.retain=="number"?f.retain:typeof f.insert=="string"?f.insert.length:1}};function c(f){this.ops=f,this.index=0,this.offset=0}c.prototype.hasNext=function(){return this.peekLength()<1/0},c.prototype.next=function(f){f||(f=1/0);var h=this.ops[this.index];if(h){var d=this.offset,m=l.length(h);if(f>=m-d?(f=m-d,this.index+=1,this.offset=0):this.offset+=f,typeof h.delete=="number")return{delete:f};var p={};return h.attributes&&(p.attributes=h.attributes),typeof h.retain=="number"?p.retain=f:typeof h.insert=="string"?p.insert=h.insert.substr(d,f):p.insert=h.insert,p}else return{retain:1/0}},c.prototype.peek=function(){return this.ops[this.index]},c.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},c.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},c.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var f=this.offset,h=this.index,d=this.next(),m=this.ops.slice(this.index);return this.offset=f,this.index=h,[d].concat(m)}else return[]},r.exports=l}),(function(r,n){var i=(function(){function s(y,v){return v!=null&&y instanceof v}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var c;try{c=Promise}catch{c=function(){}}function f(y,v,b,w,_){typeof v=="object"&&(b=v.depth,w=v.prototype,_=v.includeNonEnumerable,v=v.circular);var N=[],S=[],k=typeof Buffer<"u";typeof v>"u"&&(v=!0),typeof b>"u"&&(b=1/0);function C(O,R){if(O===null)return null;if(R===0)return O;var A,P;if(typeof O!="object")return O;if(s(O,o))A=new o;else if(s(O,l))A=new l;else if(s(O,c))A=new c(function(q,L){O.then(function(V){q(C(V,R-1))},function(V){L(C(V,R-1))})});else if(f.__isArray(O))A=[];else if(f.__isRegExp(O))A=new RegExp(O.source,x(O)),O.lastIndex&&(A.lastIndex=O.lastIndex);else if(f.__isDate(O))A=new Date(O.getTime());else{if(k&&Buffer.isBuffer(O))return Buffer.allocUnsafe?A=Buffer.allocUnsafe(O.length):A=new Buffer(O.length),O.copy(A),A;s(O,Error)?A=Object.create(O):typeof w>"u"?(P=Object.getPrototypeOf(O),A=Object.create(P)):(A=Object.create(w),P=w)}if(v){var E=N.indexOf(O);if(E!=-1)return S[E];N.push(O),S.push(A)}s(O,o)&&O.forEach(function(q,L){var V=C(L,R-1),z=C(q,R-1);A.set(V,z)}),s(O,l)&&O.forEach(function(q){var L=C(q,R-1);A.add(L)});for(var T in O){var $;P&&($=Object.getOwnPropertyDescriptor(P,T)),!($&&$.set==null)&&(A[T]=C(O[T],R-1))}if(Object.getOwnPropertySymbols)for(var D=Object.getOwnPropertySymbols(O),T=0;T<D.length;T++){var W=D[T],U=Object.getOwnPropertyDescriptor(O,W);U&&!U.enumerable&&!_||(A[W]=C(O[W],R-1),U.enumerable||Object.defineProperty(A,W,{enumerable:!1}))}if(_)for(var H=Object.getOwnPropertyNames(O),T=0;T<H.length;T++){var K=H[T],U=Object.getOwnPropertyDescriptor(O,K);U&&U.enumerable||(A[K]=C(O[K],R-1),Object.defineProperty(A,K,{enumerable:!1}))}return A}return C(y,b)}f.clonePrototype=function(v){if(v===null)return null;var b=function(){};return b.prototype=v,new b};function h(y){return Object.prototype.toString.call(y)}f.__objToStr=h;function d(y){return typeof y=="object"&&h(y)==="[object Date]"}f.__isDate=d;function m(y){return typeof y=="object"&&h(y)==="[object Array]"}f.__isArray=m;function p(y){return typeof y=="object"&&h(y)==="[object RegExp]"}f.__isRegExp=p;function x(y){var v="";return y.global&&(v+="g"),y.ignoreCase&&(v+="i"),y.multiline&&(v+="m"),v}return f.__getRegExpFlags=x,f})();typeof r=="object"&&r.exports&&(r.exports=i)}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function A(P,E){var T=[],$=!0,D=!1,W=void 0;try{for(var U=P[Symbol.iterator](),H;!($=(H=U.next()).done)&&(T.push(H.value),!(E&&T.length===E));$=!0);}catch(K){D=!0,W=K}finally{try{!$&&U.return&&U.return()}finally{if(D)throw W}}return T}return function(P,E){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return A(P,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function A(P,E){for(var T=0;T<E.length;T++){var $=E[T];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(P,$.key,$)}}return function(P,E,T){return E&&A(P.prototype,E),T&&A(P,T),P}})(),l=function A(P,E,T){P===null&&(P=Function.prototype);var $=Object.getOwnPropertyDescriptor(P,E);if($===void 0){var D=Object.getPrototypeOf(P);return D===null?void 0:A(D,E,T)}else{if("value"in $)return $.value;var W=$.get;return W===void 0?void 0:W.call(T)}},c=i(0),f=N(c),h=i(8),d=N(h),m=i(4),p=N(m),x=i(16),y=N(x),v=i(13),b=N(v),w=i(25),_=N(w);function N(A){return A&&A.__esModule?A:{default:A}}function S(A,P){if(!(A instanceof P))throw new TypeError("Cannot call a class as a function")}function k(A,P){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:A}function C(A,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);A.prototype=Object.create(P&&P.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(A,P):A.__proto__=P)}function O(A){return A instanceof p.default||A instanceof m.BlockEmbed}var R=(function(A){C(P,A);function P(E,T){S(this,P);var $=k(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,E));return $.emitter=T.emitter,Array.isArray(T.whitelist)&&($.whitelist=T.whitelist.reduce(function(D,W){return D[W]=!0,D},{})),$.domNode.addEventListener("DOMNodeInserted",function(){}),$.optimize(),$.enable(),$}return o(P,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(T,$){var D=this.line(T),W=s(D,2),U=W[0],H=W[1],K=this.line(T+$),q=s(K,1),L=q[0];if(l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"deleteAt",this).call(this,T,$),L!=null&&U!==L&&H>0){if(U instanceof m.BlockEmbed||L instanceof m.BlockEmbed){this.optimize();return}if(U instanceof b.default){var V=U.newlineIndex(U.length(),!0);if(V>-1&&(U=U.split(V+1),U===L)){this.optimize();return}}else if(L instanceof b.default){var z=L.newlineIndex(0);z>-1&&L.split(z+1)}var Z=L.children.head instanceof y.default?null:L.children.head;U.moveChildren(L,Z),U.remove()}this.optimize()}},{key:"enable",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",T)}},{key:"formatAt",value:function(T,$,D,W){this.whitelist!=null&&!this.whitelist[D]||(l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"formatAt",this).call(this,T,$,D,W),this.optimize())}},{key:"insertAt",value:function(T,$,D){if(!(D!=null&&this.whitelist!=null&&!this.whitelist[$])){if(T>=this.length())if(D==null||f.default.query($,f.default.Scope.BLOCK)==null){var W=f.default.create(this.statics.defaultChild);this.appendChild(W),D==null&&$.endsWith(`
738`)&&($=$.slice(0,-1)),W.insertAt(0,$,D)}else{var U=f.default.create($,D);this.appendChild(U)}else l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertAt",this).call(this,T,$,D);this.optimize()}}},{key:"insertBefore",value:function(T,$){if(T.statics.scope===f.default.Scope.INLINE_BLOT){var D=f.default.create(this.statics.defaultChild);D.appendChild(T),T=D}l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertBefore",this).call(this,T,$)}},{key:"leaf",value:function(T){return this.path(T).pop()||[null,-1]}},{key:"line",value:function(T){return T===this.length()?this.line(T-1):this.descendant(O,T)}},{key:"lines",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,D=function W(U,H,K){var q=[],L=K;return U.children.forEachAt(H,K,function(V,z,Z){O(V)?q.push(V):V instanceof f.default.Container&&(q=q.concat(W(V,z,L))),L-=Z}),q};return D(this,T,$)}},{key:"optimize",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,T,$),T.length>0&&this.emitter.emit(d.default.events.SCROLL_OPTIMIZE,T,$))}},{key:"path",value:function(T){return l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"path",this).call(this,T).slice(1)}},{key:"update",value:function(T){if(this.batch!==!0){var $=d.default.sources.USER;typeof T=="string"&&($=T),Array.isArray(T)||(T=this.observer.takeRecords()),T.length>0&&this.emitter.emit(d.default.events.SCROLL_BEFORE_UPDATE,$,T),l(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"update",this).call(this,T.concat([])),T.length>0&&this.emitter.emit(d.default.events.SCROLL_UPDATE,$,T)}}}]),P})(f.default.Scroll);R.blotName="scroll",R.className="ql-editor",R.tagName="DIV",R.defaultChild="block",R.allowedChildren=[p.default,m.BlockEmbed,_.default],n.default=R}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},o=(function(){function G(X,ie){var J=[],ue=!0,ge=!1,fe=void 0;try{for(var Ee=X[Symbol.iterator](),Oe;!(ue=(Oe=Ee.next()).done)&&(J.push(Oe.value),!(ie&&J.length===ie));ue=!0);}catch(Ve){ge=!0,fe=Ve}finally{try{!ue&&Ee.return&&Ee.return()}finally{if(ge)throw fe}}return J}return function(X,ie){if(Array.isArray(X))return X;if(Symbol.iterator in Object(X))return G(X,ie);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function G(X,ie){for(var J=0;J<ie.length;J++){var ue=ie[J];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(X,ue.key,ue)}}return function(X,ie,J){return ie&&G(X.prototype,ie),J&&G(X,J),X}})(),c=i(21),f=A(c),h=i(11),d=A(h),m=i(3),p=A(m),x=i(2),y=A(x),v=i(20),b=A(v),w=i(0),_=A(w),N=i(5),S=A(N),k=i(10),C=A(k),O=i(9),R=A(O);function A(G){return G&&G.__esModule?G:{default:G}}function P(G,X,ie){return X in G?Object.defineProperty(G,X,{value:ie,enumerable:!0,configurable:!0,writable:!0}):G[X]=ie,G}function E(G,X){if(!(G instanceof X))throw new TypeError("Cannot call a class as a function")}function T(G,X){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return X&&(typeof X=="object"||typeof X=="function")?X:G}function $(G,X){if(typeof X!="function"&&X!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof X);G.prototype=Object.create(X&&X.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),X&&(Object.setPrototypeOf?Object.setPrototypeOf(G,X):G.__proto__=X)}var D=(0,C.default)("quill:keyboard"),W=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",U=(function(G){$(X,G),l(X,null,[{key:"match",value:function(J,ue){return ue=re(ue),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ge){return!!ue[ge]!==J[ge]&&ue[ge]!==null})?!1:ue.key===(J.which||J.keyCode)}}]);function X(ie,J){E(this,X);var ue=T(this,(X.__proto__||Object.getPrototypeOf(X)).call(this,ie,J));return ue.bindings={},Object.keys(ue.options.bindings).forEach(function(ge){ge==="list autofill"&&ie.scroll.whitelist!=null&&!ie.scroll.whitelist.list||ue.options.bindings[ge]&&ue.addBinding(ue.options.bindings[ge])}),ue.addBinding({key:X.keys.ENTER,shiftKey:null},V),ue.addBinding({key:X.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ue.addBinding({key:X.keys.BACKSPACE},{collapsed:!0},K),ue.addBinding({key:X.keys.DELETE},{collapsed:!0},q)):(ue.addBinding({key:X.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},K),ue.addBinding({key:X.keys.DELETE},{collapsed:!0,suffix:/^.?$/},q)),ue.addBinding({key:X.keys.BACKSPACE},{collapsed:!1},L),ue.addBinding({key:X.keys.DELETE},{collapsed:!1},L),ue.addBinding({key:X.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},K),ue.listen(),ue}return l(X,[{key:"addBinding",value:function(J){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},fe=re(J);if(fe==null||fe.key==null)return D.warn("Attempted to add invalid keyboard binding",fe);typeof ue=="function"&&(ue={handler:ue}),typeof ge=="function"&&(ge={handler:ge}),fe=(0,p.default)(fe,ue,ge),this.bindings[fe.key]=this.bindings[fe.key]||[],this.bindings[fe.key].push(fe)}},{key:"listen",value:function(){var J=this;this.quill.root.addEventListener("keydown",function(ue){if(!ue.defaultPrevented){var ge=ue.which||ue.keyCode,fe=(J.bindings[ge]||[]).filter(function(it){return X.match(ue,it)});if(fe.length!==0){var Ee=J.quill.getSelection();if(!(Ee==null||!J.quill.hasFocus())){var Oe=J.quill.getLine(Ee.index),Ve=o(Oe,2),Ae=Ve[0],tt=Ve[1],ye=J.quill.getLeaf(Ee.index),xe=o(ye,2),Ce=xe[0],Re=xe[1],_e=Ee.length===0?[Ce,Re]:J.quill.getLeaf(Ee.index+Ee.length),dt=o(_e,2),pt=dt[0],gt=dt[1],be=Ce instanceof _.default.Text?Ce.value().slice(0,Re):"",ke=pt instanceof _.default.Text?pt.value().slice(gt):"",He={collapsed:Ee.length===0,empty:Ee.length===0&&Ae.length()<=1,format:J.quill.getFormat(Ee),offset:tt,prefix:be,suffix:ke},wt=fe.some(function(it){if(it.collapsed!=null&&it.collapsed!==He.collapsed||it.empty!=null&&it.empty!==He.empty||it.offset!=null&&it.offset!==He.offset)return!1;if(Array.isArray(it.format)){if(it.format.every(function(Xt){return He.format[Xt]==null}))return!1}else if(s(it.format)==="object"&&!Object.keys(it.format).every(function(Xt){return it.format[Xt]===!0?He.format[Xt]!=null:it.format[Xt]===!1?He.format[Xt]==null:(0,d.default)(it.format[Xt],He.format[Xt])}))return!1;return it.prefix!=null&&!it.prefix.test(He.prefix)||it.suffix!=null&&!it.suffix.test(He.suffix)?!1:it.handler.call(J,Ee,He)!==!0});wt&&ue.preventDefault()}}}})}}]),X})(R.default);U.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},U.DEFAULTS={bindings:{bold:Z("bold"),italic:Z("italic"),underline:Z("underline"),indent:{key:U.keys.TAB,format:["blockquote","indent","list"],handler:function(X,ie){if(ie.collapsed&&ie.offset!==0)return!0;this.quill.format("indent","+1",S.default.sources.USER)}},outdent:{key:U.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(X,ie){if(ie.collapsed&&ie.offset!==0)return!0;this.quill.format("indent","-1",S.default.sources.USER)}},"outdent backspace":{key:U.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(X,ie){ie.format.indent!=null?this.quill.format("indent","-1",S.default.sources.USER):ie.format.list!=null&&this.quill.format("list",!1,S.default.sources.USER)}},"indent code-block":z(!0),"outdent code-block":z(!1),"remove tab":{key:U.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(X){this.quill.deleteText(X.index-1,1,S.default.sources.USER)}},tab:{key:U.keys.TAB,handler:function(X){this.quill.history.cutoff();var ie=new y.default().retain(X.index).delete(X.length).insert("	");this.quill.updateContents(ie,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(X.index+1,S.default.sources.SILENT)}},"list empty enter":{key:U.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(X,ie){this.quill.format("list",!1,S.default.sources.USER),ie.format.indent&&this.quill.format("indent",!1,S.default.sources.USER)}},"checklist enter":{key:U.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(X){var ie=this.quill.getLine(X.index),J=o(ie,2),ue=J[0],ge=J[1],fe=(0,p.default)({},ue.formats(),{list:"checked"}),Ee=new y.default().retain(X.index).insert(`
739`,fe).retain(ue.length()-ge-1).retain(1,{list:"unchecked"});this.quill.updateContents(Ee,S.default.sources.USER),this.quill.setSelection(X.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:U.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(X,ie){var J=this.quill.getLine(X.index),ue=o(J,2),ge=ue[0],fe=ue[1],Ee=new y.default().retain(X.index).insert(`
740`,ie.format).retain(ge.length()-fe-1).retain(1,{header:null});this.quill.updateContents(Ee,S.default.sources.USER),this.quill.setSelection(X.index+1,S.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(X,ie){var J=ie.prefix.length,ue=this.quill.getLine(X.index),ge=o(ue,2),fe=ge[0],Ee=ge[1];if(Ee>J)return!0;var Oe=void 0;switch(ie.prefix.trim()){case"[]":case"[ ]":Oe="unchecked";break;case"[x]":Oe="checked";break;case"-":case"*":Oe="bullet";break;default:Oe="ordered"}this.quill.insertText(X.index," ",S.default.sources.USER),this.quill.history.cutoff();var Ve=new y.default().retain(X.index-Ee).delete(J+1).retain(fe.length()-2-Ee).retain(1,{list:Oe});this.quill.updateContents(Ve,S.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(X.index-J,S.default.sources.SILENT)}},"code exit":{key:U.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(X){var ie=this.quill.getLine(X.index),J=o(ie,2),ue=J[0],ge=J[1],fe=new y.default().retain(X.index+ue.length()-ge-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(fe,S.default.sources.USER)}},"embed left":H(U.keys.LEFT,!1),"embed left shift":H(U.keys.LEFT,!0),"embed right":H(U.keys.RIGHT,!1),"embed right shift":H(U.keys.RIGHT,!0)}};function H(G,X){var ie,J=G===U.keys.LEFT?"prefix":"suffix";return ie={key:G,shiftKey:X,altKey:null},P(ie,J,/^$/),P(ie,"handler",function(ge){var fe=ge.index;G===U.keys.RIGHT&&(fe+=ge.length+1);var Ee=this.quill.getLeaf(fe),Oe=o(Ee,1),Ve=Oe[0];return Ve instanceof _.default.Embed?(G===U.keys.LEFT?X?this.quill.setSelection(ge.index-1,ge.length+1,S.default.sources.USER):this.quill.setSelection(ge.index-1,S.default.sources.USER):X?this.quill.setSelection(ge.index,ge.length+1,S.default.sources.USER):this.quill.setSelection(ge.index+ge.length+1,S.default.sources.USER),!1):!0}),ie}function K(G,X){if(!(G.index===0||this.quill.getLength()<=1)){var ie=this.quill.getLine(G.index),J=o(ie,1),ue=J[0],ge={};if(X.offset===0){var fe=this.quill.getLine(G.index-1),Ee=o(fe,1),Oe=Ee[0];if(Oe!=null&&Oe.length()>1){var Ve=ue.formats(),Ae=this.quill.getFormat(G.index-1,1);ge=b.default.attributes.diff(Ve,Ae)||{}}}var tt=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(X.prefix)?2:1;this.quill.deleteText(G.index-tt,tt,S.default.sources.USER),Object.keys(ge).length>0&&this.quill.formatLine(G.index-tt,tt,ge,S.default.sources.USER),this.quill.focus()}}function q(G,X){var ie=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(X.suffix)?2:1;if(!(G.index>=this.quill.getLength()-ie)){var J={},ue=0,ge=this.quill.getLine(G.index),fe=o(ge,1),Ee=fe[0];if(X.offset>=Ee.length()-1){var Oe=this.quill.getLine(G.index+1),Ve=o(Oe,1),Ae=Ve[0];if(Ae){var tt=Ee.formats(),ye=this.quill.getFormat(G.index,1);J=b.default.attributes.diff(tt,ye)||{},ue=Ae.length()}}this.quill.deleteText(G.index,ie,S.default.sources.USER),Object.keys(J).length>0&&this.quill.formatLine(G.index+ue-1,ie,J,S.default.sources.USER)}}function L(G){var X=this.quill.getLines(G),ie={};if(X.length>1){var J=X[0].formats(),ue=X[X.length-1].formats();ie=b.default.attributes.diff(ue,J)||{}}this.quill.deleteText(G,S.default.sources.USER),Object.keys(ie).length>0&&this.quill.formatLine(G.index,1,ie,S.default.sources.USER),this.quill.setSelection(G.index,S.default.sources.SILENT),this.quill.focus()}function V(G,X){var ie=this;G.length>0&&this.quill.scroll.deleteAt(G.index,G.length);var J=Object.keys(X.format).reduce(function(ue,ge){return _.default.query(ge,_.default.Scope.BLOCK)&&!Array.isArray(X.format[ge])&&(ue[ge]=X.format[ge]),ue},{});this.quill.insertText(G.index,`
741`,J,S.default.sources.USER),this.quill.setSelection(G.index+1,S.default.sources.SILENT),this.quill.focus(),Object.keys(X.format).forEach(function(ue){J[ue]==null&&(Array.isArray(X.format[ue])||ue!=="link"&&ie.quill.format(ue,X.format[ue],S.default.sources.USER))})}function z(G){return{key:U.keys.TAB,shiftKey:!G,format:{"code-block":!0},handler:function(ie){var J=_.default.query("code-block"),ue=ie.index,ge=ie.length,fe=this.quill.scroll.descendant(J,ue),Ee=o(fe,2),Oe=Ee[0],Ve=Ee[1];if(Oe!=null){var Ae=this.quill.getIndex(Oe),tt=Oe.newlineIndex(Ve,!0)+1,ye=Oe.newlineIndex(Ae+Ve+ge),xe=Oe.domNode.textContent.slice(tt,ye).split(`
742`);Ve=0,xe.forEach(function(Ce,Re){G?(Oe.insertAt(tt+Ve,J.TAB),Ve+=J.TAB.length,Re===0?ue+=J.TAB.length:ge+=J.TAB.length):Ce.startsWith(J.TAB)&&(Oe.deleteAt(tt+Ve,J.TAB.length),Ve-=J.TAB.length,Re===0?ue-=J.TAB.length:ge-=J.TAB.length),Ve+=Ce.length+1}),this.quill.update(S.default.sources.USER),this.quill.setSelection(ue,ge,S.default.sources.SILENT)}}}}function Z(G){return{key:G[0].toUpperCase(),shortKey:!0,handler:function(ie,J){this.quill.format(G,!J.format[G],S.default.sources.USER)}}}function re(G){if(typeof G=="string"||typeof G=="number")return re({key:G});if((typeof G>"u"?"undefined":s(G))==="object"&&(G=(0,f.default)(G,!1)),typeof G.key=="string")if(U.keys[G.key.toUpperCase()]!=null)G.key=U.keys[G.key.toUpperCase()];else if(G.key.length===1)G.key=G.key.toUpperCase().charCodeAt(0);else return null;return G.shortKey&&(G[W]=G.shortKey,delete G.shortKey),G}n.default=U,n.SHORTKEY=W}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function b(w,_){var N=[],S=!0,k=!1,C=void 0;try{for(var O=w[Symbol.iterator](),R;!(S=(R=O.next()).done)&&(N.push(R.value),!(_&&N.length===_));S=!0);}catch(A){k=!0,C=A}finally{try{!S&&O.return&&O.return()}finally{if(k)throw C}}return N}return function(w,_){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return b(w,_);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=function b(w,_,N){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,_);if(S===void 0){var k=Object.getPrototypeOf(w);return k===null?void 0:b(k,_,N)}else{if("value"in S)return S.value;var C=S.get;return C===void 0?void 0:C.call(N)}},l=(function(){function b(w,_){for(var N=0;N<_.length;N++){var S=_[N];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}return function(w,_,N){return _&&b(w.prototype,_),N&&b(w,N),w}})(),c=i(0),f=m(c),h=i(7),d=m(h);function m(b){return b&&b.__esModule?b:{default:b}}function p(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function x(b,w){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:b}function y(b,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);b.prototype=Object.create(w&&w.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(b,w):b.__proto__=w)}var v=(function(b){y(w,b),l(w,null,[{key:"value",value:function(){}}]);function w(_,N){p(this,w);var S=x(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,_));return S.selection=N,S.textNode=document.createTextNode(w.CONTENTS),S.domNode.appendChild(S.textNode),S._length=0,S}return l(w,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(N,S){if(this._length!==0)return o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"format",this).call(this,N,S);for(var k=this,C=0;k!=null&&k.statics.scope!==f.default.Scope.BLOCK_BLOT;)C+=k.offset(k.parent),k=k.parent;k!=null&&(this._length=w.CONTENTS.length,k.optimize(),k.formatAt(C,w.CONTENTS.length,N,S),this._length=0)}},{key:"index",value:function(N,S){return N===this.textNode?0:o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"index",this).call(this,N,S)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var N=this.textNode,S=this.selection.getNativeRange(),k=void 0,C=void 0,O=void 0;if(S!=null&&S.start.node===N&&S.end.node===N){var R=[N,S.start.offset,S.end.offset];k=R[0],C=R[1],O=R[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==w.CONTENTS){var A=this.textNode.data.split(w.CONTENTS).join("");this.next instanceof d.default?(k=this.next.domNode,this.next.insertAt(0,A),this.textNode.data=w.CONTENTS):(this.textNode.data=A,this.parent.insertBefore(f.default.create(this.textNode),this),this.textNode=document.createTextNode(w.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),C!=null){var P=[C,O].map(function(T){return Math.max(0,Math.min(k.data.length,T-1))}),E=s(P,2);return C=E[0],O=E[1],{startNode:k,startOffset:C,endNode:k,endOffset:O}}}}},{key:"update",value:function(N,S){var k=this;if(N.some(function(O){return O.type==="characterData"&&O.target===k.textNode}
742)){var C=this.restore();C&&(S.range=C)}}},{key:"value",value:function(){return""}}]),w})(f.default.Embed);v.blotName="cursor",v.className="ql-cursor",v.tagName="span",v.CONTENTS="\uFEFF",n.default=v}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),o=f(s),l=i(4),c=f(l);function f(x){return x&&x.__esModule?x:{default:x}}function h(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function d(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function m(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var p=(function(x){m(y,x);function y(){return h(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return y})(o.default.Container);p.allowedChildren=[c.default,l.BlockEmbed,p],n.default=p}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var s=(function(){function v(b,w){for(var _=0;_<w.length;_++){var N=w[_];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(b,N.key,N)}}return function(b,w,_){return w&&v(b.prototype,w),_&&v(b,_),b}})(),o=function v(b,w,_){b===null&&(b=Function.prototype);var N=Object.getOwnPropertyDescriptor(b,w);if(N===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:v(S,w,_)}else{if("value"in N)return N.value;var k=N.get;return k===void 0?void 0:k.call(_)}},l=i(0),c=f(l);function f(v){return v&&v.__esModule?v:{default:v}}function h(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function d(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function m(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var p=(function(v){m(b,v);function b(){return h(this,b),d(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"value",value:function(_){var N=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,_);return N.startsWith("rgb(")?(N=N.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+N.split(",").map(function(S){return("00"+parseInt(S).toString(16)).slice(-2)}).join("")):N}}]),b})(c.default.Attributor.Style),x=new c.default.Attributor.Class("color","ql-color",{scope:c.default.Scope.INLINE}),y=new p("color","color",{scope:c.default.Scope.INLINE});n.ColorAttributor=p,n.ColorClass=x,n.ColorStyle=y}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var s=(function(){function y(v,b){for(var w=0;w<b.length;w++){var _=b[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,b,w){return b&&y(v.prototype,b),w&&y(v,w),v}})(),o=function y(v,b,w){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,b);if(_===void 0){var N=Object.getPrototypeOf(v);return N===null?void 0:y(N,b,w)}else{if("value"in _)return _.value;var S=_.get;return S===void 0?void 0:S.call(w)}},l=i(6),c=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function h(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function d(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function m(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var p=(function(y){m(v,y);function v(){return h(this,v),d(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"format",value:function(w,_){if(w!==this.statics.blotName||!_)return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"format",this).call(this,w,_);_=this.constructor.sanitize(_),this.domNode.setAttribute("href",_)}}],[{key:"create",value:function(w){var _=o(v.__proto__||Object.getPrototypeOf(v),"create",this).call(this,w);return w=this.sanitize(w),_.setAttribute("href",w),_.setAttribute("rel","noopener noreferrer"),_.setAttribute("target","_blank"),_}},{key:"formats",value:function(w){return w.getAttribute("href")}},{key:"sanitize",value:function(w){return x(w,this.PROTOCOL_WHITELIST)?w:this.SANITIZED_URL}}]),v})(c.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function x(y,v){var b=document.createElement("a");b.href=y;var w=b.href.slice(0,b.href.indexOf(":"));return v.indexOf(w)>-1}n.default=p,n.sanitize=x}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},o=(function(){function v(b,w){for(var _=0;_<w.length;_++){var N=w[_];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(b,N.key,N)}}return function(b,w,_){return w&&v(b.prototype,w),_&&v(b,_),b}})(),l=i(23),c=d(l),f=i(107),h=d(f);
vendor: 64,859 bytes, lines 742-752
742function d(v){return v&&v.__esModule?v:{default:v}}function m(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}var p=0;function x(v,b){v.setAttribute(b,v.getAttribute(b)!=="true")}var y=(function(){function v(b){var w=this;m(this,v),this.select=b,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){w.togglePicker()}),this.label.addEventListener("keydown",function(_){switch(_.keyCode){case c.default.keys.ENTER:w.togglePicker();break;case c.default.keys.ESCAPE:w.escape(),_.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(v,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),x(this.label,"aria-expanded"),x(this.options,"aria-hidden")}},{key:"buildItem",value:function(w){var _=this,N=document.createElement("span");return N.tabIndex="0",N.setAttribute("role","button"),N.classList.add("ql-picker-item"),w.hasAttribute("value")&&N.setAttribute("data-value",w.getAttribute("value")),w.textContent&&N.setAttribute("data-label",w.textContent),N.addEventListener("click",function(){_.selectItem(N,!0)}),N.addEventListener("keydown",function(S){switch(S.keyCode){case c.default.keys.ENTER:_.selectItem(N,!0),S.preventDefault();break;case c.default.keys.ESCAPE:_.escape(),S.preventDefault();break}}),N}},{key:"buildLabel",value:function(){var w=document.createElement("span");return w.classList.add("ql-picker-label"),w.innerHTML=h.default,w.tabIndex="0",w.setAttribute("role","button"),w.setAttribute("aria-expanded","false"),this.container.appendChild(w),w}},{key:"buildOptions",value:function(){var w=this,_=document.createElement("span");_.classList.add("ql-picker-options"),_.setAttribute("aria-hidden","true"),_.tabIndex="-1",_.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",_.id),this.options=_,[].slice.call(this.select.options).forEach(function(N){var S=w.buildItem(N);_.appendChild(S),N.selected===!0&&w.selectItem(S)}),this.container.appendChild(_)}},{key:"buildPicker",value:function(){var w=this;[].slice.call(this.select.attributes).forEach(function(_){w.container.setAttribute(_.name,_.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var w=this;this.close(),setTimeout(function(){return w.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(w){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,N=this.container.querySelector(".ql-selected");if(w!==N&&(N!=null&&N.classList.remove("ql-selected"),w!=null&&(w.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(w.parentNode.children,w),w.hasAttribute("data-value")?this.label.setAttribute("data-value",w.getAttribute("data-value")):this.label.removeAttribute("data-value"),w.hasAttribute("data-label")?this.label.setAttribute("data-label",w.getAttribute("data-label")):this.label.removeAttribute("data-label"),_))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":s(Event))==="object"){var S=document.createEvent("Event");S.initEvent("change",!0,!0),this.select.dispatchEvent(S)}this.close()}}},{key:"update",value:function(){var w=void 0;if(this.select.selectedIndex>-1){var _=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];w=this.select.options[this.select.selectedIndex],this.selectItem(_)}else this.selectItem(null);var N=w!=null&&w!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",N)}}]),v})();n.default=y}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(0),o=D(s),l=i(5),c=D(l),f=i(4),h=D(f),d=i(16),m=D(d),p=i(25),x=D(p),y=i(24),v=D(y),b=i(35),w=D(b),_=i(6),N=D(_),S=i(22),k=D(S),C=i(7),O=D(C),R=i(55),A=D(R),P=i(42),E=D(P),T=i(23),$=D(T);function D(W){return W&&W.__esModule?W:{default:W}}c.default.register({"blots/block":h.default,"blots/block/embed":f.BlockEmbed,"blots/break":m.default,"blots/container":x.default,"blots/cursor":v.default,"blots/embed":w.default,"blots/inline":N.default,"blots/scroll":k.default,"blots/text":O.default,"modules/clipboard":A.default,"modules/history":E.default,"modules/keyboard":$.default}),o.default.register(h.default,m.default,v.default,N.default,k.default,O.default),n.default=c.default}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(1),o=(function(){function l(c){this.domNode=c,this.domNode[s.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(c){if(this.tagName==null)throw new s.ParchmentError("Blot definition missing tagName");var f;return Array.isArray(this.tagName)?(typeof c=="string"&&(c=c.toUpperCase(),parseInt(c).toString()===c&&(c=parseInt(c))),typeof c=="number"?f=document.createElement(this.tagName[c-1]):this.tagName.indexOf(c)>-1?f=document.createElement(c):f=document.createElement(this.tagName[0])):f=document.createElement(this.tagName),this.className&&f.classList.add(this.className),f},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var c=this.domNode.cloneNode(!1);return s.create(c)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[s.DATA_KEY]},l.prototype.deleteAt=function(c,f){var h=this.isolate(c,f);h.remove()},l.prototype.formatAt=function(c,f,h,d){var m=this.isolate(c,f);if(s.query(h,s.Scope.BLOT)!=null&&d)m.wrap(h,d);else if(s.query(h,s.Scope.ATTRIBUTE)!=null){var p=s.create(this.statics.scope);m.wrap(p),p.format(h,d)}},l.prototype.insertAt=function(c,f,h){var d=h==null?s.create("text",f):s.create(f,h),m=this.split(c);this.parent.insertBefore(d,m)},l.prototype.insertInto=function(c,f){f===void 0&&(f=null),this.parent!=null&&this.parent.children.remove(this);var h=null;c.children.insertBefore(this,f),f!=null&&(h=f.domNode),(this.domNode.parentNode!=c.domNode||this.domNode.nextSibling!=h)&&c.domNode.insertBefore(this.domNode,h),this.parent=c,this.attach()},l.prototype.isolate=function(c,f){var h=this.split(c);return h.split(f),h},l.prototype.length=function(){return 1},l.prototype.offset=function(c){return c===void 0&&(c=this.parent),this.parent==null||this==c?0:this.parent.children.offset(this)+this.parent.offset(c)},l.prototype.optimize=function(c){this.domNode[s.DATA_KEY]!=null&&delete this.domNode[s.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(c){c.parent!=null&&(c.parent.insertBefore(this,c.next),c.remove())},l.prototype.replaceWith=function(c,f){var h=typeof c=="string"?s.create(c,f):c;return h.replace(this),h},l.prototype.split=function(c,f){return c===0?this:this.next},l.prototype.update=function(c,f){},l.prototype.wrap=function(c,f){var h=typeof c=="string"?s.create(c,f):c;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},l.blotName="abstract",l})();n.default=o}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(12),o=i(32),l=i(33),c=i(1),f=(function(){function h(d){this.attributes={},this.domNode=d,this.build()}return h.prototype.attribute=function(d,m){m?d.add(this.domNode,m)&&(d.value(this.domNode)!=null?this.attributes[d.attrName]=d:delete this.attributes[d.attrName]):(d.remove(this.domNode),delete this.attributes[d.attrName])},h.prototype.build=function(){var d=this;this.attributes={};var m=s.default.keys(this.domNode),p=o.default.keys(this.domNode),x=l.default.keys(this.domNode);m.concat(p).concat(x).forEach(function(y){var v=c.query(y,c.Scope.ATTRIBUTE);v instanceof s.default&&(d.attributes[v.attrName]=v)})},h.prototype.copy=function(d){var m=this;Object.keys(this.attributes).forEach(function(p){var x=m.attributes[p].value(m.domNode);d.format(p,x)})},h.prototype.move=function(d){var m=this;this.copy(d),Object.keys(this.attributes).forEach(function(p){m.attributes[p].remove(m.domNode)}),this.attributes={}},h.prototype.values=function(){var d=this;return Object.keys(this.attributes).reduce(function(m,p){return m[p]=d.attributes[p].value(d.domNode),m},{})},h})();n.default=f}),(function(r,n,i){var s=this&&this.__extends||(function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){f(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f,h){var d=f.getAttribute("class")||"";return d.split(/\s+/).filter(function(m){return m.indexOf(h+"-")===0})}var c=(function(f){s(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(d){return(d.getAttribute("class")||"").split(/\s+/).map(function(m){return m.split("-").slice(0,-1).join("-")})},h.prototype.add=function(d,m){return this.canAdd(d,m)?(this.remove(d),d.classList.add(this.keyName+"-"+m),!0):!1},h.prototype.remove=function(d){var m=l(d,this.keyName);m.forEach(function(p){d.classList.remove(p)}),d.classList.length===0&&d.removeAttribute("class")},h.prototype.value=function(d){var m=l(d,this.keyName)[0]||"",p=m.slice(this.keyName.length+1);return this.canAdd(d,p)?p:""},h})(o.default);n.default=c}),(function(r,n,i){var s=this&&this.__extends||(function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){f(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(f){var h=f.split("-"),d=h.slice(1).map(function(m){return m[0].toUpperCase()+m.slice(1)}).join("");return h[0]+d}var c=(function(f){s(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.keys=function(d){return(d.getAttribute("style")||"").split(";").map(function(m){var p=m.split(":");return p[0].trim()})},h.prototype.add=function(d,m){return this.canAdd(d,m)?(d.style[l(this.keyName)]=m,!0):!1},h.prototype.remove=function(d){d.style[l(this.keyName)]="",d.getAttribute("style")||d.removeAttribute("style")},h.prototype.value=function(d){var m=d.style[l(this.keyName)];return this.canAdd(d,m)?m:""},h})(o.default);n.default=c}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function c(f,h){for(var d=0;d<h.length;d++){var m=h[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,h,d){return h&&c(f.prototype,h),d&&c(f,d),f}})();function o(c,f){if(!(c instanceof f))throw new TypeError("Cannot call a class as a function")}var l=(function(){function c(f,h){o(this,c),this.quill=f,this.options=h,this.modules={}}return s(c,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(d){h.modules[d]==null&&h.addModule(d)})}},{key:"addModule",value:function(h){var d=this.quill.constructor.import("modules/"+h);return this.modules[h]=new d(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),c})();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function b(w,_){for(var N=0;N<_.length;N++){var S=_[N];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}return function(w,_,N){return _&&b(w.prototype,_),N&&b(w,N),w}})(),o=function b(w,_,N){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,_);if(S===void 0){var k=Object.getPrototypeOf(w);return k===null?void 0:b(k,_,N)}else{if("value"in S)return S.value;var C=S.get;return C===void 0?void 0:C.call(N)}},l=i(0),c=d(l),f=i(7),h=d(f);function d(b){return b&&b.__esModule?b:{default:b}}function m(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function p(b,w){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:b}function x(b,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);b.prototype=Object.create(w&&w.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(b,w):b.__proto__=w)}var y="\uFEFF",v=(function(b){x(w,b);function w(_){m(this,w);var N=p(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,_));return N.contentNode=document.createElement("span"),N.contentNode.setAttribute("contenteditable",!1),[].slice.call(N.domNode.childNodes).forEach(function(S){N.contentNode.appendChild(S)}),N.leftGuard=document.createTextNode(y),N.rightGuard=document.createTextNode(y),N.domNode.appendChild(N.leftGuard),N.domNode.appendChild(N.contentNode),N.domNode.appendChild(N.rightGuard),N}return s(w,[{key:"index",value:function(N,S){return N===this.leftGuard?0:N===this.rightGuard?1:o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"index",this).call(this,N,S)}},{key:"restore",value:function(N){var S=void 0,k=void 0,C=N.data.split(y).join("");if(N===this.leftGuard)if(this.prev instanceof h.default){var O=this.prev.length();this.prev.insertAt(O,C),S={startNode:this.prev.domNode,startOffset:O+C.length}}else k=document.createTextNode(C),this.parent.insertBefore(c.default.create(k),this),S={startNode:k,startOffset:C.length};else N===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,C),S={startNode:this.next.domNode,startOffset:C.length}):(k=document.createTextNode(C),this.parent.insertBefore(c.default.create(k),this.next),S={startNode:k,startOffset:C.length}));return N.data=y,S}},{key:"update",value:function(N,S){var k=this;N.forEach(function(C){if(C.type==="characterData"&&(C.target===k.leftGuard||C.target===k.rightGuard)){var O=k.restore(C.target);O&&(S.range=O)}})}}]),w})(c.default.Embed);n.default=v}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var s=i(0),o=l(s);function l(m){return m&&m.__esModule?m:{default:m}}var c={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},f=new o.default.Attributor.Attribute("align","align",c),h=new o.default.Attributor.Class("align","ql-align",c),d=new o.default.Attributor.Style("align","text-align",c);n.AlignAttribute=f,n.AlignClass=h,n.AlignStyle=d}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var s=i(0),o=c(s),l=i(26);function c(d){return d&&d.__esModule?d:{default:d}}var f=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=f,n.BackgroundStyle=h}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var s=i(0),o=l(s);function l(m){return m&&m.__esModule?m:{default:m}}var c={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},f=new o.default.Attributor.Attribute("direction","dir",c),h=new o.default.Attributor.Class("direction","ql-direction",c),d=new o.default.Attributor.Style("direction","direction",c);n.DirectionAttribute=f,n.DirectionClass=h,n.DirectionStyle=d}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var s=(function(){function b(w,_){for(var N=0;N<_.length;N++){var S=_[N];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}return function(w,_,N){return _&&b(w.prototype,_),N&&b(w,N),w}})(),o=function b(w,_,N){w===null&&(w=Function.prototype);var S=Object.getOwnPropertyDescriptor(w,_);if(S===void 0){var k=Object.getPrototypeOf(w);return k===null?void 0:b(k,_,N)}else{if("value"in S)return S.value;var C=S.get;return C===void 0?void 0:C.call(N)}},l=i(0),c=f(l);function f(b){return b&&b.__esModule?b:{default:b}}function h(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function d(b,w){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:b}function m(b,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);b.prototype=Object.create(w&&w.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(b,w):b.__proto__=w)}var p={scope:c.default.Scope.INLINE,whitelist:["serif","monospace"]},x=new c.default.Attributor.Class("font","ql-font",p),y=(function(b){m(w,b);function w(){return h(this,w),d(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return s(w,[{key:"value",value:function(N){return o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"value",this).call(this,N).replace(/["']/g,"")}}]),w})(c.default.Attributor.Style),v=new y("font","font-family",p);n.FontStyle=v,n.FontClass=x}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var s=i(0),o=l(s);function l(h){return h&&h.__esModule?h:{default:h}}var c=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),f=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=c,n.SizeStyle=f}),(function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var s=(function(){function _(N,S){for(var k=0;k<S.length;k++){var C=S[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(N,C.key,C)}}return function(N,S,k){return S&&_(N.prototype,S),k&&_(N,k),N}})(),o=i(0),l=m(o),c=i(5),f=m(c),h=i(9),d=m(h);function m(_){return _&&_.__esModule?_:{default:_}}function p(_,N){if(!(_ instanceof N))throw new TypeError("Cannot call a class as a function")}function x(_,N){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:_}function y(_,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);_.prototype=Object.create(N&&N.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(_,N):_.__proto__=N)}var v=(function(_){y(N,_);function N(S,k){p(this,N);var C=x(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,S,k));return C.lastRecorded=0,C.ignoreChange=!1,C.clear(),C.quill.on(f.default.events.EDITOR_CHANGE,function(O,R,A,P){O!==f.default.events.TEXT_CHANGE||C.ignoreChange||(!C.options.userOnly||P===f.default.sources.USER?C.record(R,A):C.transform(R))}),C.quill.keyboard.addBinding({key:"Z",shortKey:!0},C.undo.bind(C)),C.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},C.redo.bind(C)),/Win/i.test(navigator.platform)&&C.quill.keyboard.addBinding({key:"Y",shortKey:!0},C.redo.bind(C)),C}return s(N,[{key:"change",value:function(k,C){if(this.stack[k].length!==0){var O=this.stack[k].pop();this.stack[C].push(O),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(O[k],f.default.sources.USER),this.ignoreChange=!1;var R=w(O[k]);this.quill.setSelection(R)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(k,C){if(k.ops.length!==0){this.stack.redo=[];var O=this.quill.getContents().diff(C),R=Date.now();if(this.lastRecorded+this.options.delay>R&&this.stack.undo.length>0){var A=this.stack.undo.pop();O=O.compose(A.undo),k=A.redo.compose(k)}else this.lastRecorded=R;this.stack.undo.push({redo:k,undo:O}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(k){this.stack.undo.forEach(function(C){C.undo=k.transform(C.undo,!0),C.redo=k.transform(C.redo,!0)}),this.stack.redo.forEach(function(C){C.undo=k.transform(C.undo,!0),C.redo=k.transform(C.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),N})(d.default);v.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function b(_){var N=_.ops[_.ops.length-1];return N==null?!1:N.insert!=null?typeof N.insert=="string"&&N.insert.endsWith(`
743`):N.attributes!=null?Object.keys(N.attributes).some(function(S){return l.default.query(S,l.default.Scope.BLOCK)!=null}):!1}function w(_){var N=_.reduce(function(k,C){return k+=C.delete||0,k},0),S=_.length()-N;return b(_)&&(S-=1),S}n.default=v,n.getLastChangeIndex=w}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var s=(function(){function V(z,Z){for(var re=0;re<Z.length;re++){var G=Z[re];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(z,G.key,G)}}return function(z,Z,re){return Z&&V(z.prototype,Z),re&&V(z,re),z}})(),o=function V(z,Z,re){z===null&&(z=Function.prototype);var G=Object.getOwnPropertyDescriptor(z,Z);if(G===void 0){var X=Object.getPrototypeOf(z);return X===null?void 0:V(X,Z,re)}else{if("value"in G)return G.value;var ie=G.get;return ie===void 0?void 0:ie.call(re)}},l=i(3),c=R(l),f=i(2),h=R(f),d=i(8),m=R(d),p=i(23),x=R(p),y=i(34),v=R(y),b=i(59),w=R(b),_=i(60),N=R(_),S=i(28),k=R(S),C=i(61),O=R(C);function R(V){return V&&V.__esModule?V:{default:V}}function A(V,z){if(!(V instanceof z))throw new TypeError("Cannot call a class as a function")}function P(V,z){if(!V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z&&(typeof z=="object"||typeof z=="function")?z:V}function E(V,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof z);V.prototype=Object.create(z&&z.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf(V,z):V.__proto__=z)}var T=[!1,"center","right","justify"],$=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],D=[!1,"serif","monospace"],W=["1","2","3",!1],U=["small",!1,"large","huge"],H=(function(V){E(z,V);function z(Z,re){A(this,z);var G=P(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,Z,re)),X=function ie(J){if(!document.body.contains(Z.root))return document.body.removeEventListener("click",ie);G.tooltip!=null&&!G.tooltip.root.contains(J.target)&&document.activeElement!==G.tooltip.textbox&&!G.quill.hasFocus()&&G.tooltip.hide(),G.pickers!=null&&G.pickers.forEach(function(ue){ue.container.contains(J.target)||ue.close()})};return Z.emitter.listenDOM("click",document.body,X),G}return s(z,[{key:"addModule",value:function(re){var G=o(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"addModule",this).call(this,re);return re==="toolbar"&&this.extendToolbar(G),G}},{key:"buildButtons",value:function(re,G){re.forEach(function(X){var ie=X.getAttribute("class")||"";ie.split(/\s+/).forEach(function(J){if(J.startsWith("ql-")&&(J=J.slice(3),G[J]!=null))if(J==="direction")X.innerHTML=G[J][""]+G[J].rtl;else if(typeof G[J]=="string")X.innerHTML=G[J];else{var ue=X.value||"";ue!=null&&G[J][ue]&&(X.innerHTML=G[J][ue])}})})}},{key:"buildPickers",value:function(re,G){var X=this;this.pickers=re.map(function(J){if(J.classList.contains("ql-align"))return J.querySelector("option")==null&&L(J,T),new N.default(J,G.align);if(J.classList.contains("ql-background")||J.classList.contains("ql-color")){var ue=J.classList.contains("ql-background")?"background":"color";return J.querySelector("option")==null&&L(J,$,ue==="background"?"#ffffff":"#000000"),new w.default(J,G[ue])}else return J.querySelector("option")==null&&(J.classList.contains("ql-font")?L(J,D):J.classList.contains("ql-header")?L(J,W):J.classList.contains("ql-size")&&L(J,U)),new k.default(J)});var ie=function(){X.pickers.forEach(function(ue){ue.update()})};this.quill.on(m.default.events.EDITOR_CHANGE,ie)}}]),z})(v.default);H.DEFAULTS=(0,c.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var z=this,Z=this.container.querySelector("input.ql-image[type=file]");Z==null&&(Z=document.createElement("input"),Z.setAttribute("type","file"),Z.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Z.classList.add("ql-image"),Z.addEventListener("change",function(){if(Z.files!=null&&Z.files[0]!=null){var re=new FileReader;re.onload=function(G){var X=z.quill.getSelection(!0);z.quill.updateContents(new h.default().retain(X.index).delete(X.length).insert({image:G.target.result}),m.default.sources.USER),z.quill.setSelection(X.index+1,m.default.sources.SILENT),Z.value=""},re.readAsDataURL(Z.files[0])}}),this.container.appendChild(Z)),Z.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var K=(function(V){E(z,V);function z(Z,re){A(this,z);var G=P(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,Z,re));return G.textbox=G.root.querySelector('input[type="text"]'),G.listen(),G}return s(z,[{key:"listen",value:function(){var re=this;this.textbox.addEventListener("keydown",function(G){x.default.match(G,"enter")?(re.save(),G.preventDefault()):x.default.match(G,"escape")&&(re.cancel(),G.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),G!=null?this.textbox.value=G:re!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+re)||""),this.root.setAttribute("data-mode",re)}},{key:"restoreFocus",value:function(){var re=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=re}},{key:"save",value:function(){var re=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var G=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",re,m.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",re,m.default.sources.USER)),this.quill.root.scrollTop=G;break}case"video":re=q(re);case"formula":{if(!re)break;var X=this.quill.getSelection(!0);if(X!=null){var ie=X.index+X.length;this.quill.insertEmbed(ie,this.root.getAttribute("data-mode"),re,m.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(ie+1," ",m.default.sources.USER),this.quill.setSelection(ie+2,m.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),z})(O.default);function q(V){var z=V.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||V.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return z?(z[1]||"https")+"://www.youtube.com/embed/"+z[2]+"?showinfo=0":(z=V.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(z[1]||"https")+"://player.vimeo.com/video/"+z[2]+"/":V}function L(V,z){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;z.forEach(function(re){var G=document.createElement("option");re===Z?G.setAttribute("selected","selected"):G.setAttribute("value",re),V.appendChild(G)})}n.BaseTooltip=K,n.default=H}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var c,f=this.iterator();c=f();)if(c===l)return!0;return!1},o.prototype.insertBefore=function(l,c){l&&(l.next=c,c!=null?(l.prev=c.prev,c.prev!=null&&(c.prev.next=l),c.prev=l,c===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},o.prototype.offset=function(l){for(var c=0,f=this.head;f!=null;){if(f===l)return c;c+=f.length(),f=f.next}return-1},o.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var c=l;return l!=null&&(l=l.next),c}},o.prototype.find=function(l,c){c===void 0&&(c=!1);for(var f,h=this.iterator();f=h();){var d=f.length();if(l<d||c&&l===d&&(f.next==null||f.next.length()!==0))return[f,l];l-=d}return[null,0]},o.prototype.forEach=function(l){for(var c,f=this.iterator();c=f();)l(c)},o.prototype.forEachAt=function(l,c,f){if(!(c<=0))for(var h=this.find(l),d=h[0],m=h[1],p,x=l-m,y=this.iterator(d);(p=y())&&x<l+c;){var v=p.length();l>x?f(p,l-x,Math.min(c,x+v-l)):f(p,0,Math.min(v,l+c-x)),x+=v}},o.prototype.map=function(l){return this.reduce(function(c,f){return c.push(l(f)),c},[])},o.prototype.reduce=function(l,c){for(var f,h=this.iterator();f=h();)c=l(c,f);return c},o})();n.default=s}),(function(r,n,i){var s=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,p){m.__proto__=p}||function(m,p){for(var x in p)p.hasOwnProperty(x)&&(m[x]=p[x])};return function(m,p){d(m,p);function x(){this.constructor=m}m.prototype=p===null?Object.create(p):(x.prototype=p.prototype,new x)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),l=i(1),c={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},f=100,h=(function(d){s(m,d);function m(p){var x=d.call(this,p)||this;return x.scroll=x,x.observer=new MutationObserver(function(y){x.update(y)}),x.observer.observe(x.domNode,c),x.attach(),x}return m.prototype.detach=function(){d.prototype.detach.call(this),this.observer.disconnect()},m.prototype.deleteAt=function(p,x){this.update(),p===0&&x===this.length()?this.children.forEach(function(y){y.remove()}):d.prototype.deleteAt.call(this,p,x)},m.prototype.formatAt=function(p,x,y,v){this.update(),d.prototype.formatAt.call(this,p,x,y,v)},m.prototype.insertAt=function(p,x,y){this.update(),d.prototype.insertAt.call(this,p,x,y)},m.prototype.optimize=function(p,x){var y=this;p===void 0&&(p=[]),x===void 0&&(x={}),d.prototype.optimize.call(this,x);for(var v=[].slice.call(this.observer.takeRecords());v.length>0;)p.push(v.pop());for(var b=function(S,k){k===void 0&&(k=!0),!(S==null||S===y)&&S.domNode.parentNode!=null&&(S.domNode[l.DATA_KEY].mutations==null&&(S.domNode[l.DATA_KEY].mutations=[]),k&&b(S.parent))},w=function(S){S.domNode[l.DATA_KEY]==null||S.domNode[l.DATA_KEY].mutations==null||(S instanceof o.default&&S.children.forEach(w),S.optimize(x))},_=p,N=0;_.length>0;N+=1){if(N>=f)throw new Error("[Parchment] Maximum optimize iterations reached");for(_.forEach(function(S){var k=l.find(S.target,!0);k!=null&&(k.domNode===S.target&&(S.type==="childList"?(b(l.find(S.previousSibling,!1)),[].forEach.call(S.addedNodes,function(C){var O=l.find(C,!1);b(O,!1),O instanceof o.default&&O.children.forEach(function(R){b(R,!1)})})):S.type==="attributes"&&b(k.prev)),b(k))}),this.children.forEach(w),_=[].slice.call(this.observer.takeRecords()),v=_.slice();v.length>0;)p.push(v.pop())}},m.prototype.update=function(p,x){var y=this;x===void 0&&(x={}),p=p||this.observer.takeRecords(),p.map(function(v){var b=l.find(v.target,!0);return b==null?null:b.domNode[l.DATA_KEY].mutations==null?(b.domNode[l.DATA_KEY].mutations=[v],b):(b.domNode[l.DATA_KEY].mutations.push(v),null)}).forEach(function(v){v==null||v===y||v.domNode[l.DATA_KEY]==null||v.update(v.domNode[l.DATA_KEY].mutations||[],x)}),this.domNode[l.DATA_KEY].mutations!=null&&d.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,x),this.optimize(p,x)},m.blotName="scroll",m.defaultChild="block",m.scope=l.Scope.BLOCK_BLOT,m.tagName="DIV",m})(o.default);n.default=h}),(function(r,n,i){var s=this&&this.__extends||(function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,m){d.__proto__=m}||function(d,m){for(var p in m)m.hasOwnProperty(p)&&(d[p]=m[p])};return function(d,m){h(d,m);function p(){this.constructor=d}d.prototype=m===null?Object.create(m):(p.prototype=m.prototype,new p)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function c(h,d){if(Object.keys(h).length!==Object.keys(d).length)return!1;for(var m in h)if(h[m]!==d[m])return!1;return!0}var f=(function(h){s(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.formats=function(m){if(m.tagName!==d.tagName)return h.formats.call(this,m)},d.prototype.format=function(m,p){var x=this;m===this.statics.blotName&&!p?(this.children.forEach(function(y){y instanceof o.default||(y=y.wrap(d.blotName,!0)),x.attributes.copy(y)}),this.unwrap()):h.prototype.format.call(this,m,p)},d.prototype.formatAt=function(m,p,x,y){if(this.formats()[x]!=null||l.query(x,l.Scope.ATTRIBUTE)){var v=this.isolate(m,p);v.format(x,y)}else h.prototype.formatAt.call(this,m,p,x,y)},d.prototype.optimize=function(m){h.prototype.optimize.call(this,m);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var x=this.next;x instanceof d&&x.prev===this&&c(p,x.formats())&&(x.moveChildren(this),x.remove())},d.blotName="inline",d.scope=l.Scope.INLINE_BLOT,d.tagName="SPAN",d})(o.default);n.default=f}),(function(r,n,i){var s=this&&this.__extends||(function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){f(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),c=(function(f){s(h,f);function h(){return f!==null&&f.apply(this,arguments)||this}return h.formats=function(d){var m=l.query(h.blotName).tagName;if(d.tagName!==m)return f.formats.call(this,d)},h.prototype.format=function(d,m){l.query(d,l.Scope.BLOCK)!=null&&(d===this.statics.blotName&&!m?this.replaceWith(h.blotName):f.prototype.format.call(this,d,m))},h.prototype.formatAt=function(d,m,p,x){l.query(p,l.Scope.BLOCK)!=null?this.format(p,x):f.prototype.formatAt.call(this,d,m,p,x)},h.prototype.insertAt=function(d,m,p){if(p==null||l.query(m,l.Scope.INLINE)!=null)f.prototype.insertAt.call(this,d,m,p);else{var x=this.split(d),y=l.create(m,p);x.parent.insertBefore(y,x)}},h.prototype.update=function(d,m){navigator.userAgent.match(/Trident/)?this.build():f.prototype.update.call(this,d,m)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h})(o.default);n.default=c}),(function(r,n,i){var s=this&&this.__extends||(function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var d in h)h.hasOwnProperty(d)&&(f[d]=h[d])};return function(f,h){c(f,h);function d(){this.constructor=f}f.prototype=h===null?Object.create(h):(d.prototype=h.prototype,new d)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=(function(c){s(f,c);function f(){return c!==null&&c.apply(this,arguments)||this}return f.formats=function(h){},f.prototype.format=function(h,d){c.prototype.formatAt.call(this,0,this.length(),h,d)},f.prototype.formatAt=function(h,d,m,p){h===0&&d===this.length()?this.format(m,p):c.prototype.formatAt.call(this,h,d,m,p)},f.prototype.formats=function(){return this.statics.formats(this.domNode)},f})(o.default);n.default=l}),(function(r,n,i){var s=this&&this.__extends||(function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,d){h.__proto__=d}||function(h,d){for(var m in d)d.hasOwnProperty(m)&&(h[m]=d[m])};return function(h,d){f(h,d);function m(){this.constructor=h}h.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}})();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),c=(function(f){s(h,f);function h(d){var m=f.call(this,d)||this;return m.text=m.statics.value(m.domNode),m}return h.create=function(d){return document.createTextNode(d)},h.value=function(d){var m=d.data;return m.normalize&&(m=m.normalize()),m},h.prototype.deleteAt=function(d,m){this.domNode.data=this.text=this.text.slice(0,d)+this.text.slice(d+m)},h.prototype.index=function(d,m){return this.domNode===d?m:-1},h.prototype.insertAt=function(d,m,p){p==null?(this.text=this.text.slice(0,d)+m+this.text.slice(d),this.domNode.data=this.text):f.prototype.insertAt.call(this,d,m,p)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(d){f.prototype.optimize.call(this,d),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof h&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},h.prototype.position=function(d,m){return[this.domNode,d]},h.prototype.split=function(d,m){if(m===void 0&&(m=!1),!m){if(d===0)return this;if(d===this.length())return this.next}var p=l.create(this.domNode.splitText(d));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},h.prototype.update=function(d,m){var p=this;d.some(function(x){return x.type==="characterData"&&x.target===p.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=l.Scope.INLINE_BLOT,h})(o.default);n.default=c}),(function(r,n,i){var s=document.createElement("div");if(s.classList.toggle("test-class",!1),s.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,c){return arguments.length>1&&!this.contains(l)==!c?c:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,c){return c=c||0,this.substr(c,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,c){var f=this.toString();(typeof c!="number"||!isFinite(c)||Math.floor(c)!==c||c>f.length)&&(c=f.length),c-=l.length;var h=f.indexOf(l,c);return h!==-1&&h===c}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(c){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof c!="function")throw new TypeError("predicate must be a function");for(var f=Object(this),h=f.length>>>0,d=arguments[1],m,p=0;p<h;p++)if(m=f[p],c.call(d,m,p,f))return m}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})}),(function(r,n){var i=-1,s=1,o=0;function l(N,S,k){if(N==S)return N?[[o,N]]:[];(k<0||N.length<k)&&(k=null);var C=d(N,S),O=N.substring(0,C);N=N.substring(C),S=S.substring(C),C=m(N,S);var R=N.substring(N.length-C);N=N.substring(0,N.length-C),S=S.substring(0,S.length-C);var A=c(N,S);return O&&A.unshift([o,O]),R&&A.push([o,R]),x(A),k!=null&&(A=b(A,k)),A=w(A),A}function c(N,S){var k;if(!N)return[[s,S]];if(!S)return[[i,N]];var C=N.length>S.length?N:S,O=N.length>S.length?S:N,R=C.indexOf(O);if(R!=-1)return k=[[s,C.substring(0,R)],[o,O],[s,C.substring(R+O.length)]],N.length>S.length&&(k[0][0]=k[2][0]=i),k;if(O.length==1)return[[i,N],[s,S]];var A=p(N,S);if(A){var P=A[0],E=A[1],T=A[2],$=A[3],D=A[4],W=l(P,T),U=l(E,$);return W.concat([[o,D]],U)}return f(N,S)}function f(N,S){for(var k=N.length,C=S.length,O=Math.ceil((k+C)/2),R=O,A=2*O,P=new Array(A),E=new Array(A),T=0;T<A;T++)P[T]=-1,E[T]=-1;P[R+1]=0,E[R+1]=0;for(var $=k-C,D=$%2!=0,W=0,U=0,H=0,K=0,q=0;q<O;q++){for(var L=-q+W;L<=q-U;L+=2){var V=R+L,z;L==-q||L!=q&&P[V-1]<P[V+1]?z=P[V+1]:z=P[V-1]+1;for(var Z=z-L;z<k&&Z<C&&N.charAt(z)==S.charAt(Z);)z++,Z++;if(P[V]=z,z>k)U+=2;else if(Z>C)W+=2;else if(D){var re=R+$-L;if(re>=0&&re<A&&E[re]!=-1){var G=k-E[re];if(z>=G)return h(N,S,z,Z)}}}for(var X=-q+H;X<=q-K;X+=2){var re=R+X,G;X==-q||X!=q&&E[re-1]<E[re+1]?G=E[re+1]:G=E[re-1]+1;for(var ie=G-X;G<k&&ie<C&&N.charAt(k-G-1)==S.charAt(C-ie-1);)G++,ie++;if(E[re]=G,G>k)K+=2;else if(ie>C)H+=2;else if(!D){var V=R+$-X;if(V>=0&&V<A&&P[V]!=-1){var z=P[V],Z=R+z-V;if(G=k-G,z>=G)return h(N,S,z,Z)}}}}return[[i,N],[s,S]]}function h(N,S,k,C){var O=N.substring(0,k),R=S.substring(0,C),A=N.substring(k),P=S.substring(C),E=l(O,R),T=l(A,P);return E.concat(T)}function d(N,S){if(!N||!S||N.charAt(0)!=S.charAt(0))return 0;for(var k=0,C=Math.min(N.length,S.length),O=C,R=0;k<O;)N.substring(R,O)==S.substring(R,O)?(k=O,R=k):C=O,O=Math.floor((C-k)/2+k);return O}function m(N,S){if(!N||!S||N.charAt(N.length-1)!=S.charAt(S.length-1))return 0;for(var k=0,C=Math.min(N.length,S.length),O=C,R=0;k<O;)N.substring(N.length-O,N.length-R)==S.substring(S.length-O,S.length-R)?(k=O,R=k):C=O,O=Math.floor((C-k)/2+k);return O}function p(N,S){var k=N.length>S.length?N:S,C=N.length>S.length?S:N;if(k.length<4||C.length*2<k.length)return null;function O(U,H,K){for(var q=U.substring(K,K+Math.floor(U.length/4)),L=-1,V="",z,Z,re,G;(L=H.indexOf(q,L+1))!=-1;){var X=d(U.substring(K),H.substring(L)),ie=m(U.substring(0,K),H.substring(0,L));V.length<ie+X&&(V=H.substring(L-ie,L)+H.substring(L,L+X),z=U.substring(0,K-ie),Z=U.substring(K+X),re=H.substring(0,L-ie),G=H.substring(L+X))}return V.length*2>=U.length?[z,Z,re,G,V]:null}var R=O(k,C,Math.ceil(k.length/4)),A=O(k,C,Math.ceil(k.length/2)),P;if(!R&&!A)return null;A?R?P=R[4].length>A[4].length?R:A:P=A:P=R;var E,T,$,D;N.length>S.length?(E=P[0],T=P[1],$=P[2],D=P[3]):($=P[0],D=P[1],E=P[2],T=P[3]);var W=P[4];return[E,T,$,D,W]}function x(N){N.push([o,""]);for(var S=0,k=0,C=0,O="",R="",A;S<N.length;)switch(N[S][0]){case s:C++,R+=N[S][1],S++;break;case i:k++,O+=N[S][1],S++;break;case o:k+C>1?(k!==0&&C!==0&&(A=d(R,O),A!==0&&(S-k-C>0&&N[S-k-C-1][0]==o?N[S-k-C-1][1]+=R.substring(0,A):(N.splice(0,0,[o,R.substring(0,A)]),S++),R=R.substring(A),O=O.substring(A)),A=m(R,O),A!==0&&(N[S][1]=R.substring(R.length-A)+N[S][1],R=R.substring(0,R.length-A),O=O.substring(0,O.length-A))),k===0?N.splice(S-C,k+C,[s,R]):C===0?N.splice(S-k,k+C,[i,O]):N.splice(S-k-C,k+C,[i,O],[s,R]),S=S-k-C+(k?1:0)+(C?1:0)+1):S!==0&&N[S-1][0]==o?(N[S-1][1]+=N[S][1],N.splice(S,1)):S++,C=0,k=0,O="",R="";break}N[N.length-1][1]===""&&N.pop();var P=!1;for(S=1;S<N.length-1;)N[S-1][0]==o&&N[S+1][0]==o&&(N[S][1].substring(N[S][1].length-N[S-1][1].length)==N[S-1][1]?(N[S][1]=N[S-1][1]+N[S][1].substring(0,N[S][1].length-N[S-1][1].length),N[S+1][1]=N[S-1][1]+N[S+1][1],N.splice(S-1,1),P=!0):N[S][1].substring(0,N[S+1][1].length)==N[S+1][1]&&(N[S-1][1]+=N[S+1][1],N[S][1]=N[S][1].substring(N[S+1][1].length)+N[S+1][1],N.splice(S+1,1),P=!0)),S++;P&&x(N)}var y=l;y.INSERT=s,y.DELETE=i,y.EQUAL=o,r.exports=y;function v(N,S){if(S===0)return[o,N];for(var k=0,C=0;C<N.length;C++){var O=N[C];if(O[0]===i||O[0]===o){var R=k+O[1].length;if(S===R)return[C+1,N];if(S<R){N=N.slice();var A=S-k,P=[O[0],O[1].slice(0,A)],E=[O[0],O[1].slice(A)];return N.splice(C,1,P,E),[C+1,N]}else k=R}}throw new Error("cursor_pos is out of bounds!")}function b(N,S){var k=v(N,S),C=k[1],O=k[0],R=C[O],A=C[O+1];if(R==null)return N;if(R[0]!==o)return N;if(A!=null&&R[1]+A[1]===A[1]+R[1])return C.splice(O,2,A,R),_(C,O,2);if(A!=null&&A[1].indexOf(R[1])===0){C.splice(O,2,[A[0],R[1]],[0,R[1]]);var P=A[1].slice(R[1].length);return P.length>0&&C.splice(O+2,0,[A[0],P]),_(C,O,3)}else return N}function w(N){for(var S=!1,k=function(A){return A.charCodeAt(0)>=56320&&A.charCodeAt(0)<=57343},C=function(A){return A.charCodeAt(A.length-1)>=55296&&A.charCodeAt(A.length-1)<=56319},O=2;O<N.length;O+=1)N[O-2][0]===o&&C(N[O-2][1])&&N[O-1][0]===i&&k(N[O-1][1])&&N[O][0]===s&&k(N[O][1])&&(S=!0,N[O-1][1]=N[O-2][1].slice(-1)+N[O-1][1],N[O][1]=N[O-2][1].slice(-1)+N[O][1],N[O-2][1]=N[O-2][1].slice(0,-1));if(!S)return N;for(var R=[],O=0;O<N.length;O+=1)N[O][1].length>0&&R.push(N[O]);return R}function _(N,S,k){for(var C=S+k-1;C>=0&&C>=S-1;C--)if(C+1<N.length){var O=N[C],R=N[C+1];O[0]===R[1]&&N.splice(C,2,[O[0],O[1]+R[1]])}return N}}),(function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(s){var o=[];for(var l in s)o.push(l);return o}}),(function(r,n){var i=(function(){return Object.prototype.toString.call(arguments)})()=="[object Arguments]";n=r.exports=i?s:o,n.supported=s;function s(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}}),(function(r,n){var i=Object.prototype.hasOwnProperty,s="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(s=!1));function l(f,h,d){this.fn=f,this.context=h,this.once=d||!1}function c(){this._events=new o,this._eventsCount=0}c.prototype.eventNames=function(){var h=[],d,m;if(this._eventsCount===0)return h;for(m in d=this._events)i.call(d,m)&&h.push(s?m.slice(1):m);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},c.prototype.listeners=function(h,d){var m=s?s+h:h,p=this._events[m];if(d)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var x=0,y=p.length,v=new Array(y);x<y;x++)v[x]=p[x].fn;return v},c.prototype.emit=function(h,d,m,p,x,y){var v=s?s+h:h;if(!this._events[v])return!1;var b=this._events[v],w=arguments.length,_,N;if(b.fn){switch(b.once&&this.removeListener(h,b.fn,void 0,!0),w){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,d),!0;case 3:return b.fn.call(b.context,d,m),!0;case 4:return b.fn.call(b.context,d,m,p),!0;case 5:return b.fn.call(b.context,d,m,p,x),!0;case 6:return b.fn.call(b.context,d,m,p,x,y),!0}for(N=1,_=new Array(w-1);N<w;N++)_[N-1]=arguments[N];b.fn.apply(b.context,_)}else{var S=b.length,k;for(N=0;N<S;N++)switch(b[N].once&&this.removeListener(h,b[N].fn,void 0,!0),w){case 1:b[N].fn.call(b[N].context);break;case 2:b[N].fn.call(b[N].context,d);break;case 3:b[N].fn.call(b[N].context,d,m);break;case 4:b[N].fn.call(b[N].context,d,m,p);break;default:if(!_)for(k=1,_=new Array(w-1);k<w;k++)_[k-1]=arguments[k];b[N].fn.apply(b[N].context,_)}}return!0},c.prototype.on=function(h,d,m){var p=new l(d,m||this),x=s?s+h:h;return this._events[x]?this._events[x].fn?this._events[x]=[this._events[x],p]:this._events[x].push(p):(this._events[x]=p,this._eventsCount++),this},c.prototype.once=function(h,d,m){var p=new l(d,m||this,!0),x=s?s+h:h;return this._events[x]?this._events[x].fn?this._events[x]=[this._events[x],p]:this._events[x].push(p):(this._events[x]=p,this._eventsCount++),this},c.prototype.removeListener=function(h,d,m,p){var x=s?s+h:h;if(!this._events[x])return this;if(!d)return--this._eventsCount===0?this._events=new o:delete this._events[x],this;var y=this._events[x];if(y.fn)y.fn===d&&(!p||y.once)&&(!m||y.context===m)&&(--this._eventsCount===0?this._events=new o:delete this._events[x]);else{for(var v=0,b=[],w=y.length;v<w;v++)(y[v].fn!==d||p&&!y[v].once||m&&y[v].context!==m)&&b.push(y[v]);b.length?this._events[x]=b.length===1?b[0]:b:--this._eventsCount===0?this._events=new o:delete this._events[x]}return this},c.prototype.removeAllListeners=function(h){var d;return h?(d=s?s+h:h,this._events[d]&&(--this._eventsCount===0?this._events=new o:delete this._events[d])):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prototype.setMaxListeners=function(){return this},c.prefixed=s,c.EventEmitter=c,typeof r<"u"&&(r.exports=c)}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ye){return typeof ye}:function(ye){return ye&&typeof Symbol=="function"&&ye.constructor===Symbol&&ye!==Symbol.prototype?"symbol":typeof ye},o=(function(){function ye(xe,Ce){var Re=[],_e=!0,dt=!1,pt=void 0;try{for(var gt=xe[Symbol.iterator](),be;!(_e=(be=gt.next()).done)&&(Re.push(be.value),!(Ce&&Re.length===Ce));_e=!0);}catch(ke){dt=!0,pt=ke}finally{try{!_e&&gt.return&&gt.return()}finally{if(dt)throw pt}}return Re}return function(xe,Ce){if(Array.isArray(xe))return xe;if(Symbol.iterator in Object(xe))return ye(xe,Ce);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function ye(xe,Ce){for(var Re=0;Re<Ce.length;Re++){var _e=Ce[Re];_e.enumerable=_e.enumerable||!1,_e.configurable=!0,"value"in _e&&(_e.writable=!0),Object.defineProperty(xe,_e.key,_e)}}return function(xe,Ce,Re){return Ce&&ye(xe.prototype,Ce),Re&&ye(xe,Re),xe}})(),c=i(3),f=E(c),h=i(2),d=E(h),m=i(0),p=E(m),x=i(5),y=E(x),v=i(10),b=E(v),w=i(9),_=E(w),N=i(36),S=i(37),k=i(13),C=E(k),O=i(26),R=i(38),A=i(39),P=i(40);function E(ye){return ye&&ye.__esModule?ye:{default:ye}}function T(ye,xe,Ce){return xe in ye?Object.defineProperty(ye,xe,{value:Ce,enumerable:!0,configurable:!0,writable:!0}):ye[xe]=Ce,ye}function $(ye,xe){if(!(ye instanceof xe))throw new TypeError("Cannot call a class as a function")}function D(ye,xe){if(!ye)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return xe&&(typeof xe=="object"||typeof xe=="function")?xe:ye}function W(ye,xe){if(typeof xe!="function"&&xe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof xe);ye.prototype=Object.create(xe&&xe.prototype,{constructor:{value:ye,enumerable:!1,writable:!0,configurable:!0}}),xe&&(Object.setPrototypeOf?Object.setPrototypeOf(ye,xe):ye.__proto__=xe)}var U=(0,b.default)("quill:clipboard"),H="__ql-matcher",K=[[Node.TEXT_NODE,tt],[Node.TEXT_NODE,Oe],["br",ge],[Node.ELEMENT_NODE,Oe],[Node.ELEMENT_NODE,ue],[Node.ELEMENT_NODE,Ve],[Node.ELEMENT_NODE,J],[Node.ELEMENT_NODE,Ae],["li",Ee],["b",ie.bind(ie,"bold")],["i",ie.bind(ie,"italic")],["style",fe]],q=[N.AlignAttribute,R.DirectionAttribute].reduce(function(ye,xe){return ye[xe.keyName]=xe,ye},{}),L=[N.AlignStyle,S.BackgroundStyle,O.ColorStyle,R.DirectionStyle,A.FontStyle,P.SizeStyle].reduce(function(ye,xe){return ye[xe.keyName]=xe,ye},{}),V=(function(ye){W(xe,ye);function xe(Ce,Re){$(this,xe);var _e=D(this,(xe.__proto__||Object.getPrototypeOf(xe)).call(this,Ce,Re));return _e.quill.root.addEventListener("paste",_e.onPaste.bind(_e)),_e.container=_e.quill.addContainer("ql-clipboard"),_e.container.setAttribute("contenteditable",!0),_e.container.setAttribute("tabindex",-1),_e.matchers=[],K.concat(_e.options.matchers).forEach(function(dt){var pt=o(dt,2),gt=pt[0],be=pt[1];!Re.matchVisual&&be===Ve||_e.addMatcher(gt,be)}),_e}return l(xe,[{key:"addMatcher",value:function(Re,_e){this.matchers.push([Re,_e])}},{key:"convert",value:function(Re){if(typeof Re=="string")return this.container.innerHTML=Re.replace(/\>\r?\n +\</g,"><"),this.convert();var _e=this.quill.getFormat(this.quill.selection.savedRange.index);if(_e[C.default.blotName]){var dt=this.container.innerText;return this.container.innerHTML="",new d.default().insert(dt,T({},C.default.blotName,_e[C.default.blotName]))}var pt=this.prepareMatching(),gt=o(pt,2),be=gt[0],ke=gt[1],He=X(this.container,be,ke);return re(He,`
744`)&&He.ops[He.ops.length-1].attributes==null&&(He=He.compose(new d.default().retain(He.length()-1).delete(1))),U.log("convert",this.container.innerHTML,He),this.container.innerHTML="",He}},{key:"dangerouslyPasteHTML",value:function(Re,_e){var dt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof Re=="string")this.quill.setContents(this.convert(Re),_e),this.quill.setSelection(0,y.default.sources.SILENT);else{var pt=this.convert(_e);this.quill.updateContents(new d.default().retain(Re).concat(pt),dt),this.quill.setSelection(Re+pt.length(),y.default.sources.SILENT)}}},{key:"onPaste",value:function(Re){var _e=this;if(!(Re.defaultPrevented||!this.quill.isEnabled())){var dt=this.quill.getSelection(),pt=new d.default().retain(dt.index),gt=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(y.default.sources.SILENT),setTimeout(function(){pt=pt.concat(_e.convert()).delete(dt.length),_e.quill.updateContents(pt,y.default.sources.USER),_e.quill.setSelection(pt.length()-dt.length,y.default.sources.SILENT),_e.quill.scrollingContainer.scrollTop=gt,_e.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Re=this,_e=[],dt=[];return this.matchers.forEach(function(pt){var gt=o(pt,2),be=gt[0],ke=gt[1];switch(be){case Node.TEXT_NODE:dt.push(ke);break;case Node.ELEMENT_NODE:_e.push(ke);break;default:[].forEach.call(Re.container.querySelectorAll(be),function(He){He[H]=He[H]||[],He[H].push(ke)});break}}),[_e,dt]}}]),xe})(_.default);V.DEFAULTS={matchers:[],matchVisual:!0};function z(ye,xe,Ce){return(typeof xe>"u"?"undefined":s(xe))==="object"?Object.keys(xe).reduce(function(Re,_e){return z(Re,_e,xe[_e])},ye):ye.reduce(function(Re,_e){return _e.attributes&&_e.attributes[xe]?Re.push(_e):Re.insert(_e.insert,(0,f.default)({},T({},xe,Ce),_e.attributes))},new d.default)}function Z(ye){if(ye.nodeType!==Node.ELEMENT_NODE)return{};var xe="__ql-computed-style";return ye[xe]||(ye[xe]=window.getComputedStyle(ye))}function re(ye,xe){for(var Ce="",Re=ye.ops.length-1;Re>=0&&Ce.length<xe.length;--Re){var _e=ye.ops[Re];if(typeof _e.insert!="string")break;Ce=_e.insert+Ce}return Ce.slice(-1*xe.length)===xe}function G(ye){if(ye.childNodes.length===0)return!1;var xe=Z(ye);return["block","list-item"].indexOf(xe.display)>-1}function X(ye,xe,Ce){return ye.nodeType===ye.TEXT_NODE?Ce.reduce(function(Re,_e){return _e(ye,Re)},new d.default):ye.nodeType===ye.ELEMENT_NODE?[].reduce.call(ye.childNodes||[],function(Re,_e){var dt=X(_e,xe,Ce);return _e.nodeType===ye.ELEMENT_NODE&&(dt=xe.reduce(function(pt,gt){return gt(_e,pt)},dt),dt=(_e[H]||[]).reduce(function(pt,gt){return gt(_e,pt)},dt)),Re.concat(dt)},new d.default):new d.default}function ie(ye,xe,Ce){return z(Ce,ye,!0)}function J(ye,xe){var Ce=p.default.Attributor.Attribute.keys(ye),Re=p.default.Attributor.Class.keys(ye),_e=p.default.Attributor.Style.keys(ye),dt={};return Ce.concat(Re).concat(_e).forEach(function(pt){var gt=p.default.query(pt,p.default.Scope.ATTRIBUTE);gt!=null&&(dt[gt.attrName]=gt.value(ye),dt[gt.attrName])||(gt=q[pt],gt!=null&&(gt.attrName===pt||gt.keyName===pt)&&(dt[gt.attrName]=gt.value(ye)||void 0),gt=L[pt],gt!=null&&(gt.attrName===pt||gt.keyName===pt)&&(gt=L[pt],dt[gt.attrName]=gt.value(ye)||void 0))}),Object.keys(dt).length>0&&(xe=z(xe,dt)),xe}function ue(ye,xe){var Ce=p.default.query(ye);if(Ce==null)return xe;if(Ce.prototype instanceof p.default.Embed){var Re={},_e=Ce.value(ye);_e!=null&&(Re[Ce.blotName]=_e,xe=new d.default().insert(Re,Ce.formats(ye)))}else typeof Ce.formats=="function"&&(xe=z(xe,Ce.blotName,Ce.formats(ye)));return xe}function ge(ye,xe){return re(xe,`
745`)||xe.insert(`
746`),xe}function fe(){return new d.default}function Ee(ye,xe){var Ce=p.default.query(ye);if(Ce==null||Ce.blotName!=="list-item"||!re(xe,`
747`))return xe;for(var Re=-1,_e=ye.parentNode;!_e.classList.contains("ql-clipboard");)(p.default.query(_e)||{}).blotName==="list"&&(Re+=1),_e=_e.parentNode;return Re<=0?xe:xe.compose(new d.default().retain(xe.length()-1).retain(1,{indent:Re}))}function Oe(ye,xe){return re(xe,`
748`)||(G(ye)||xe.length()>0&&ye.nextSibling&&G(ye.nextSibling))&&xe.insert(`
749`),xe}function Ve(ye,xe){if(G(ye)&&ye.nextElementSibling!=null&&!re(xe,`
750
751`)){var Ce=ye.offsetHeight+parseFloat(Z(ye).marginTop)+parseFloat(Z(ye).marginBottom);ye.nextElementSibling.offsetTop>ye.offsetTop+Ce*1.5&&xe.insert(`
752`)}return xe}function Ae(ye,xe){var Ce={},Re=ye.style||{};return Re.fontStyle&&Z(ye).fontStyle==="italic"&&(Ce.italic=!0),Re.fontWeight&&(Z(ye).fontWeight.startsWith("bold")||parseInt(Z(ye).fontWeight)>=700)&&(Ce.bold=!0),Object.keys(Ce).length>0&&(xe=z(xe,Ce)),parseFloat(Re.textIndent||0)>0&&(xe=new d.default().insert("	").concat(xe)),xe}function tt(ye,xe){var Ce=ye.data;if(ye.parentNode.tagName==="O:P")return xe.insert(Ce.trim());if(Ce.trim().length===0&&ye.parentNode.classList.contains("ql-clipboard"))return xe;if(!Z(ye.parentNode).whiteSpace.startsWith("pre")){var Re=function(dt,pt){return pt=pt.replace(/[^\u00a0]/g,""),pt.length<1&&dt?" ":pt};Ce=Ce.replace(/\r\n/g," ").replace(/\n/g," "),Ce=Ce.replace(/\s\s+/g,Re.bind(Re,!0)),(ye.previousSibling==null&&G(ye.parentNode)||ye.previousSibling!=null&&G(ye.previousSibling))&&(Ce=Ce.replace(/^\s+/,Re.bind(Re,!1))),(ye.nextSibling==null&&G(ye.parentNode)||ye.nextSibling!=null&&G(ye.nextSibling))&&(Ce=Ce.replace(/\s+$/,Re.bind(Re,!1)))}return xe.insert(Ce)}n.default=V,n.matchAttributor=J,n.matchBlot=ue,n.matchNewline=Oe,n.matchSpacing=Ve,n.matchText=tt}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function x(y,v){for(var b=0;b<v.length;b++){var w=v[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(y,w.key,w)}}return function(y,v,b){return v&&x(y.prototype,v),b&&x(y,b),y}})(),o=function x(y,v,b){y===null&&(y=Function.prototype);var w=Object.getOwnPropertyDescriptor(y,v);if(w===void 0){var _=Object.getPrototypeOf(y);return _===null?void 0:x(_,v,b)}else{if("value"in w)return w.value;var N=w.get;return N===void 0?void 0:N.call(b)}},l=i(6),c=f(l);function f(x){return x&&x.__esModule?x:{default:x}}function h(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function d(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function m(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var p=(function(x){m(y,x);function y(){return h(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,[{key:"optimize",value:function(b){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"optimize",this).call(this,b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),y})(c.default);p.blotName="bold",p.tagName=["STRONG","B"],n.default=p}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var s=(function(){function P(E,T){var $=[],D=!0,W=!1,U=void 0;try{for(var H=E[Symbol.iterator](),K;!(D=(K=H.next()).done)&&($.push(K.value),!(T&&$.length===T));D=!0);}catch(q){W=!0,U=q}finally{try{!D&&H.return&&H.return()}finally{if(W)throw U}}return $}return function(E,T){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return P(E,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=(function(){function P(E,T){for(var $=0;$<T.length;$++){var D=T[$];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}return function(E,T,$){return T&&P(E.prototype,T),$&&P(E,$),E}})(),l=i(2),c=b(l),f=i(0),h=b(f),d=i(5),m=b(d),p=i(10),x=b(p),y=i(9),v=b(y);function b(P){return P&&P.__esModule?P:{default:P}}function w(P,E,T){return E in P?Object.defineProperty(P,E,{value:T,enumerable:!0,configurable:!0,writable:!0}):P[E]=T,P}function _(P,E){if(!(P instanceof E))throw new TypeError("Cannot call a class as a function")}function N(P,E){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:P}function S(P,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);P.prototype=Object.create(E&&E.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(P,E):P.__proto__=E)}var k=(0,x.default)("quill:toolbar"),C=(function(P){S(E,P);function E(T,$){_(this,E);var D=N(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,T,$));if(Array.isArray(D.options.container)){var W=document.createElement("div");R(W,D.options.container),T.container.parentNode.insertBefore(W,T.container),D.container=W}else typeof D.options.container=="string"?D.container=document.querySelector(D.options.container):D.container=D.options.container;if(!(D.container instanceof HTMLElement)){var U;return U=k.error("Container required for toolbar",D.options),N(D,U)}return D.container.classList.add("ql-toolbar"),D.controls=[],D.handlers={},Object.keys(D.options.handlers).forEach(function(H){D.addHandler(H,D.options.handlers[H])}),[].forEach.call(D.container.querySelectorAll("button, select"),function(H){D.attach(H)}),D.quill.on(m.default.events.EDITOR_CHANGE,function(H,K){H===m.default.events.SELECTION_CHANGE&&D.update(K)}),D.quill.on(m.default.events.SCROLL_OPTIMIZE,function(){var H=D.quill.selection.getRange(),K=s(H,1),q=K[0];D.update(q)}),D}return o(E,[{key:"addHandler",value:function($,D){this.handlers[$]=D}},{key:"attach",value:function($){var D=this,W=[].find.call($.classList,function(H){return H.indexOf("ql-")===0});if(W){if(W=W.slice(3),$.tagName==="BUTTON"&&$.setAttribute("type","button"),this.handlers[W]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[W]==null){k.warn("ignoring attaching to disabled format",W,$);return}if(h.default.query(W)==null){k.warn("ignoring attaching to nonexistent format",W,$);return}}var U=$.tagName==="SELECT"?"change":"click";$.addEventListener(U,function(H){var K=void 0;if($.tagName==="SELECT"){if($.selectedIndex<0)return;var q=$.options[$.selectedIndex];q.hasAttribute("selected")?K=!1:K=q.value||!1}else $.classList.contains("ql-active")?K=!1:K=$.value||!$.hasAttribute("value"),H.preventDefault();D.quill.focus();var L=D.quill.selection.getRange(),V=s(L,1),z=V[0];if(D.handlers[W]!=null)D.handlers[W].call(D,K);else if(h.default.query(W).prototype instanceof h.default.Embed){if(K=prompt("Enter "+W),!K)return;D.quill.updateContents(new c.default().retain(z.index).delete(z.length).insert(w({},W,K)),m.default.sources.USER)}else D.quill.format(W,K,m.default.sources.USER);D.update(z)}),this.controls.push([W,$])}}},{key:"update",value:function($){var D=$==null?{}:this.quill.getFormat($);this.controls.forEach(function(W){var U=s(W,2),H=U[0],K=U[1];if(K.tagName==="SELECT"){var q=void 0;if($==null)q=null;else if(D[H]==null)q=K.querySelector("option[selected]");else if(!Array.isArray(D[H])){var L=D[H];typeof L=="string"&&(L=L.replace(/\"/g,'\\"')),q=K.querySelector('option[value="'+L+'"]')}q==null?(K.value="",K.selectedIndex=-1):q.selected=!0}else if($==null)K.classList.remove("ql-active");else if(K.hasAttribute("value")){var V=D[H]===K.getAttribute("value")||D[H]!=null&&D[H].toString()===K.getAttribute("value")||D[H]==null&&!K.getAttribute("value");K.classList.toggle("ql-active",V)}else K.classList.toggle("ql-active",D[H]!=null)})}}]),E})(v.default);C.DEFAULTS={};function O(P,E,T){var $=document.createElement("button");$.setAttribute("type","button"),$.classList.add("ql-"+E),T!=null&&($.value=T),P.appendChild($)}function R(P,E){Array.isArray(E[0])||(E=[E]),E.forEach(function(T){var $=document.createElement("span");$.classList.add("ql-formats"),T.forEach(function(D){if(typeof D=="str
752ing")O($,D);else{var W=Object.keys(D)[0],U=D[W];Array.isArray(U)?A($,W,U):O($,W,U)}}),P.appendChild($)})}function A(P,E,T){var $=document.createElement("select");$.classList.add("ql-"+E),T.forEach(function(D){var W=document.createElement("option");D!==!1?W.setAttribute("value",D):W.setAttribute("selected","selected"),$.appendChild(W)}),P.appendChild($)}C.DEFAULTS={container:null,handlers:{clean:function(){var E=this,T=this.quill.getSelection();if(T!=null)if(T.length==0){var $=this.quill.getFormat();Object.keys($).forEach(function(D){h.default.query(D,h.default.Scope.INLINE)!=null&&E.quill.format(D,!1)})}else this.quill.removeFormat(T,m.default.sources.USER)},direction:function(E){var T=this.quill.getFormat().align;E==="rtl"&&T==null?this.quill.format("align","right",m.default.sources.USER):!E&&T==="right"&&this.quill.format("align",!1,m.default.sources.USER),this.quill.format("direction",E,m.default.sources.USER)},indent:function(E){var T=this.quill.getSelection(),$=this.quill.getFormat(T),D=parseInt($.indent||0);if(E==="+1"||E==="-1"){var W=E==="+1"?1:-1;$.direction==="rtl"&&(W*=-1),this.quill.format("indent",D+W,m.default.sources.USER)}},link:function(E){E===!0&&(E=prompt("Enter link URL:")),this.quill.format("link",E,m.default.sources.USER)},list:function(E){var T=this.quill.getSelection(),$=this.quill.getFormat(T);E==="check"?$.list==="checked"||$.list==="unchecked"?this.quill.format("list",!1,m.default.sources.USER):this.quill.format("list","unchecked",m.default.sources.USER):this.quill.format("list",E,m.default.sources.USER)}}},n.default=C,n.addControls=R}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function x(y,v){for(var b=0;b<v.length;b++){var w=v[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(y,w.key,w)}}return function(y,v,b){return v&&x(y.prototype,v),b&&x(y,b),y}})(),o=function x(y,v,b){y===null&&(y=Function.prototype);var w=Object.getOwnPropertyDescriptor(y,v);if(w===void 0){var _=Object.getPrototypeOf(y);return _===null?void 0:x(_,v,b)}else{if("value"in w)return w.value;var N=w.get;return N===void 0?void 0:N.call(b)}},l=i(28),c=f(l);function f(x){return x&&x.__esModule?x:{default:x}}function h(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function d(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function m(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var p=(function(x){m(y,x);function y(v,b){h(this,y);var w=d(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,v));return w.label.innerHTML=b,w.container.classList.add("ql-color-picker"),[].slice.call(w.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(_){_.classList.add("ql-primary")}),w}return s(y,[{key:"buildItem",value:function(b){var w=o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"buildItem",this).call(this,b);return w.style.backgroundColor=b.getAttribute("value")||"",w}},{key:"selectItem",value:function(b,w){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"selectItem",this).call(this,b,w);var _=this.label.querySelector(".ql-color-label"),N=b&&b.getAttribute("data-value")||"";_&&(_.tagName==="line"?_.style.stroke=N:_.style.fill=N)}}]),y})(c.default);n.default=p}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function x(y,v){for(var b=0;b<v.length;b++){var w=v[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(y,w.key,w)}}return function(y,v,b){return v&&x(y.prototype,v),b&&x(y,b),y}})(),o=function x(y,v,b){y===null&&(y=Function.prototype);var w=Object.getOwnPropertyDescriptor(y,v);if(w===void 0){var _=Object.getPrototypeOf(y);return _===null?void 0:x(_,v,b)}else{if("value"in w)return w.value;var N=w.get;return N===void 0?void 0:N.call(b)}},l=i(28),c=f(l);function f(x){return x&&x.__esModule?x:{default:x}}function h(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function d(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}
vendor: 17,925 bytes, line 752
752function m(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var p=(function(x){m(y,x);function y(v,b){h(this,y);var w=d(this,(y.__proto__||Object.getPrototypeOf(y)).call(this,v));return w.container.classList.add("ql-icon-picker"),[].forEach.call(w.container.querySelectorAll(".ql-picker-item"),function(_){_.innerHTML=b[_.getAttribute("data-value")||""]}),w.defaultItem=w.container.querySelector(".ql-selected"),w.selectItem(w.defaultItem),w}return s(y,[{key:"selectItem",value:function(b,w){o(y.prototype.__proto__||Object.getPrototypeOf(y.prototype),"selectItem",this).call(this,b,w),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),y})(c.default);n.default=p}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function c(f,h){for(var d=0;d<h.length;d++){var m=h[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}return function(f,h,d){return h&&c(f.prototype,h),d&&c(f,d),f}})();function o(c,f){if(!(c instanceof f))throw new TypeError("Cannot call a class as a function")}var l=(function(){function c(f,h){var d=this;o(this,c),this.quill=f,this.boundsContainer=h||document.body,this.root=f.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){d.root.style.marginTop=-1*d.quill.root.scrollTop+"px"}),this.hide()}return s(c,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(h){var d=h.left+h.width/2-this.root.offsetWidth/2,m=h.bottom+this.quill.root.scrollTop;this.root.style.left=d+"px",this.root.style.top=m+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),x=this.root.getBoundingClientRect(),y=0;if(x.right>p.right&&(y=p.right-x.right,this.root.style.left=d+y+"px"),x.left<p.left&&(y=p.left-x.left,this.root.style.left=d+y+"px"),x.bottom>p.bottom){var v=x.bottom-x.top,b=h.bottom-h.top+v;this.root.style.top=m-b+"px",this.root.classList.add("ql-flip")}return y}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),c})();n.default=l}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function A(P,E){var T=[],$=!0,D=!1,W=void 0;try{for(var U=P[Symbol.iterator](),H;!($=(H=U.next()).done)&&(T.push(H.value),!(E&&T.length===E));$=!0);}catch(K){D=!0,W=K}finally{try{!$&&U.return&&U.return()}finally{if(D)throw W}}return T}return function(P,E){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return A(P,E);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),o=function A(P,E,T){P===null&&(P=Function.prototype);var $=Object.getOwnPropertyDescriptor(P,E);if($===void 0){var D=Object.getPrototypeOf(P);return D===null?void 0:A(D,E,T)}else{if("value"in $)return $.value;var W=$.get;return W===void 0?void 0:W.call(T)}},l=(function(){function A(P,E){for(var T=0;T<E.length;T++){var $=E[T];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(P,$.key,$)}}return function(P,E,T){return E&&A(P.prototype,E),T&&A(P,T),P}})(),c=i(3),f=_(c),h=i(8),d=_(h),m=i(43),p=_(m),x=i(27),y=_(x),v=i(15),b=i(41),w=_(b);function _(A){return A&&A.__esModule?A:{default:A}}function N(A,P){if(!(A instanceof P))throw new TypeError("Cannot call a class as a function")}function S(A,P){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:A}function k(A,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);A.prototype=Object.create(P&&P.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(A,P):A.__proto__=P)}var C=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],O=(function(A){k(P,A);function P(E,T){N(this,P),T.modules.toolbar!=null&&T.modules.toolbar.container==null&&(T.modules.toolbar.container=C);var $=S(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,E,T));return $.quill.container.classList.add("ql-snow"),$}return l(P,[{key:"extendToolbar",value:function(T){T.container.classList.add("ql-snow"),this.buildButtons([].slice.call(T.container.querySelectorAll("button")),w.default),this.buildPickers([].slice.call(T.container.querySelectorAll("select")),w.default),this.tooltip=new R(this.quill,this.options.bounds),T.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function($,D){T.handlers.link.call(T,!D.format.link)})}}]),P})(p.default);O.DEFAULTS=(0,f.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(P){if(P){var E=this.quill.getSelection();if(E==null||E.length==0)return;var T=this.quill.getText(E);/^\S+@\S+\.\S+$/.test(T)&&T.indexOf("mailto:")!==0&&(T="mailto:"+T);var $=this.quill.theme.tooltip;$.edit("link",T)}else this.quill.format("link",!1)}}}}});var R=(function(A){k(P,A);function P(E,T){N(this,P);var $=S(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,E,T));return $.preview=$.root.querySelector("a.ql-preview"),$}return l(P,[{key:"listen",value:function(){var T=this;o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function($){T.root.classList.contains("ql-editing")?T.save():T.edit("link",T.preview.textContent),$.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function($){if(T.linkRange!=null){var D=T.linkRange;T.restoreFocus(),T.quill.formatText(D,"link",!1,d.default.sources.USER),delete T.linkRange}$.preventDefault(),T.hide()}),this.quill.on(d.default.events.SELECTION_CHANGE,function($,D,W){if($!=null){if($.length===0&&W===d.default.sources.USER){var U=T.quill.scroll.descendant(y.default,$.index),H=s(U,2),K=H[0],q=H[1];if(K!=null){T.linkRange=new v.Range($.index-q,K.length());var L=y.default.formats(K.domNode);T.preview.textContent=L,T.preview.setAttribute("href",L),T.show(),T.position(T.quill.getBounds(T.linkRange));return}}else delete T.linkRange;T.hide()}})}},{key:"show",value:function(){o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),P})(m.BaseTooltip);R.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=O}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(29),o=_e(s),l=i(36),c=i(38),f=i(64),h=i(65),d=_e(h),m=i(66),p=_e(m),x=i(67),y=_e(x),v=i(37),b=i(26),w=i(39),_=i(40),N=i(56),S=_e(N),k=i(68),C=_e(k),O=i(27),R=_e(O),A=i(69),P=_e(A),E=i(70),T=_e(E),$=i(71),D=_e($),W=i(72),U=_e(W),H=i(73),K=_e(H),q=i(13),L=_e(q),V=i(74),z=_e(V),Z=i(75),re=_e(Z),G=i(57),X=_e(G),ie=i(41),J=_e(ie),ue=i(28),ge=_e(ue),fe=i(59),Ee=_e(fe),Oe=i(60),Ve=_e(Oe),Ae=i(61),tt=_e(Ae),ye=i(108),xe=_e(ye),Ce=i(62),Re=_e(Ce);function _e(dt){return dt&&dt.__esModule?dt:{default:dt}}o.default.register({"attributors/attribute/direction":c.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":v.BackgroundClass,"attributors/class/color":b.ColorClass,"attributors/class/direction":c.DirectionClass,"attributors/class/font":w.FontClass,"attributors/class/size":_.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":v.BackgroundStyle,"attributors/style/color":b.ColorStyle,"attributors/style/direction":c.DirectionStyle,"attributors/style/font":w.FontStyle,"attributors/style/size":_.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":c.DirectionClass,"formats/indent":f.IndentClass,"formats/background":v.BackgroundStyle,"formats/color":b.ColorStyle,"formats/font":w.FontClass,"formats/size":_.SizeClass,"formats/blockquote":d.default,"formats/code-block":L.default,"formats/header":p.default,"formats/list":y.default,"formats/bold":S.default,"formats/code":q.Code,"formats/italic":C.default,"formats/link":R.default,"formats/script":P.default,"formats/strike":T.default,"formats/underline":D.default,"formats/image":U.default,"formats/video":K.default,"formats/list/item":x.ListItem,"modules/formula":z.default,"modules/syntax":re.default,"modules/toolbar":X.default,"themes/bubble":xe.default,"themes/snow":Re.default,"ui/icons":J.default,"ui/picker":ge.default,"ui/icon-picker":Ve.default,"ui/color-picker":Ee.default,"ui/tooltip":tt.default},!0),n.default=o.default}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var s=(function(){function y(v,b){for(var w=0;w<b.length;w++){var _=b[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(v,_.key,_)}}return function(v,b,w){return b&&y(v.prototype,b),w&&y(v,w),v}})(),o=function y(v,b,w){v===null&&(v=Function.prototype);var _=Object.getOwnPropertyDescriptor(v,b);if(_===void 0){var N=Object.getPrototypeOf(v);return N===null?void 0:y(N,b,w)}else{if("value"in _)return _.value;var S=_.get;return S===void 0?void 0:S.call(w)}},l=i(0),c=f(l);function f(y){return y&&y.__esModule?y:{default:y}}function h(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function d(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function m(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var p=(function(y){m(v,y);function v(){return h(this,v),d(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}return s(v,[{key:"add",value:function(w,_){if(_==="+1"||_==="-1"){var N=this.value(w)||0;_=_==="+1"?N+1:N-1}return _===0?(this.remove(w),!0):o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"add",this).call(this,w,_)}},{key:"canAdd",value:function(w,_){return o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"canAdd",this).call(this,w,_)||o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"canAdd",this).call(this,w,parseInt(_))}},{key:"value",value:function(w){return parseInt(o(v.prototype.__proto__||Object.getPrototypeOf(v.prototype),"value",this).call(this,w))||void 0}}]),v})(c.default.Attributor.Class),x=new p("indent","ql-indent",{scope:c.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=x}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(4),o=l(s);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function f(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function h(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var d=(function(m){h(p,m);function p(){return c(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(o.default);d.blotName="blockquote",d.tagName="blockquote",n.default=d}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function p(x,y){for(var v=0;v<y.length;v++){var b=y[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,y,v){return y&&p(x.prototype,y),v&&p(x,v),x}})(),o=i(4),l=c(o);function c(p){return p&&p.__esModule?p:{default:p}}function f(p,x){if(!(p instanceof x))throw new TypeError("Cannot call a class as a function")}function h(p,x){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:p}function d(p,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);p.prototype=Object.create(x&&x.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(p,x):p.__proto__=x)}var m=(function(p){d(x,p);function x(){return f(this,x),h(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return s(x,null,[{key:"formats",value:function(v){return this.tagName.indexOf(v.tagName)+1}}]),x})(l.default);m.blotName="header",m.tagName=["H1","H2","H3","H4","H5","H6"],n.default=m}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var s=(function(){function N(S,k){for(var C=0;C<k.length;C++){var O=k[C];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}return function(S,k,C){return k&&N(S.prototype,k),C&&N(S,C),S}})(),o=function N(S,k,C){S===null&&(S=Function.prototype);var O=Object.getOwnPropertyDescriptor(S,k);if(O===void 0){var R=Object.getPrototypeOf(S);return R===null?void 0:N(R,k,C)}else{if("value"in O)return O.value;var A=O.get;return A===void 0?void 0:A.call(C)}},l=i(0),c=p(l),f=i(4),h=p(f),d=i(25),m=p(d);function p(N){return N&&N.__esModule?N:{default:N}}function x(N,S,k){return S in N?Object.defineProperty(N,S,{value:k,enumerable:!0,configurable:!0,writable:!0}):N[S]=k,N}function y(N,S){if(!(N instanceof S))throw new TypeError("Cannot call a class as a function")}function v(N,S){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:N}function b(N,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);N.prototype=Object.create(S&&S.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(N,S):N.__proto__=S)}var w=(function(N){b(S,N);function S(){return y(this,S),v(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return s(S,[{key:"format",value:function(C,O){C===_.blotName&&!O?this.replaceWith(c.default.create(this.statics.scope)):o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,C,O)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(C,O){return this.parent.isolate(this.offset(this.parent),this.length()),C===this.parent.statics.blotName?(this.parent.replaceWith(C,O),this):(this.parent.unwrap(),o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replaceWith",this).call(this,C,O))}}],[{key:"formats",value:function(C){return C.tagName===this.tagName?void 0:o(S.__proto__||Object.getPrototypeOf(S),"formats",this).call(this,C)}}]),S})(h.default);w.blotName="list-item",w.tagName="LI";var _=(function(N){b(S,N),s(S,null,[{key:"create",value:function(C){var O=C==="ordered"?"OL":"UL",R=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,O);return(C==="checked"||C==="unchecked")&&R.setAttribute("data-checked",C==="checked"),R}},{key:"formats",value:function(C){if(C.tagName==="OL")return"ordered";if(C.tagName==="UL")return C.hasAttribute("data-checked")?C.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function S(k){y(this,S);var C=v(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,k)),O=function(A){if(A.target.parentNode===k){var P=C.statics.formats(k),E=c.default.find(A.target);P==="checked"?E.format("list","unchecked"):P==="unchecked"&&E.format("list","checked")}};return k.addEventListener("touchstart",O),k.addEventListener("mousedown",O),C}return s(S,[{key:"format",value:function(C,O){this.children.length>0&&this.children.tail.format(C,O)}},{key:"formats",value:function(){return x({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(C,O){if(C instanceof w)o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"insertBefore",this).call(this,C,O);else{var R=O==null?this.length():O.offset(this),A=this.split(R);A.parent.insertBefore(C,A)}}},{key:"optimize",value:function(C){o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,C);var O=this.next;O!=null&&O.prev===this&&O.statics.blotName===this.statics.blotName&&O.domNode.tagName===this.domNode.tagName&&O.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(O.moveChildren(this),O.remove())}},{key:"replace",value:function(C){if(C.statics.blotName!==this.statics.blotName){var O=c.default.create(this.statics.defaultChild);C.moveChildren(O),this.appendChild(O)}o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"replace",this).call(this,C)}}]),S})(m.default);_.blotName="list",_.scope=c.default.Scope.BLOCK_BLOT,_.tagName=["OL","UL"],_.defaultChild="list-item",_.allowedChildren=[w],n.ListItem=w,n.default=_}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(56),o=l(s);
752function l(m){return m&&m.__esModule?m:{default:m}}function c(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function f(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function h(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var d=(function(m){h(p,m);function p(){return c(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(o.default);d.blotName="italic",d.tagName=["EM","I"],n.default=d}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function x(y,v){for(var b=0;b<v.length;b++){var w=v[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(y,w.key,w)}}return function(y,v,b){return v&&x(y.prototype,v),b&&x(y,b),y}})(),o=function x(y,v,b){y===null&&(y=Function.prototype);var w=Object.getOwnPropertyDescriptor(y,v);if(w===void 0){var _=Object.getPrototypeOf(y);return _===null?void 0:x(_,v,b)}else{if("value"in w)return w.value;var N=w.get;return N===void 0?void 0:N.call(b)}},l=i(6),c=f(l);function f(x){return x&&x.__esModule?x:{default:x}}function h(x,y){if(!(x instanceof y))throw new TypeError("Cannot call a class as a function")}function d(x,y){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:x}function m(x,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);x.prototype=Object.create(y&&y.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(x,y):x.__proto__=y)}var p=(function(x){m(y,x);function y(){return h(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return s(y,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):o(y.__proto__||Object.getPrototypeOf(y),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.tagName==="SUP")return"super"}}]),y})(c.default);p.blotName="script",p.tagName=["SUB","SUP"],n.default=p}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(6),o=l(s);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function f(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function h(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var d=(function(m){h(p,m);function p(){return c(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(o.default);d.blotName="strike",d.tagName="S",n.default=d}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=i(6),o=l(s);function l(m){return m&&m.__esModule?m:{default:m}}function c(m,p){if(!(m instanceof p))throw new TypeError("Cannot call a class as a function")}function f(m,p){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:m}function h(m,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);m.prototype=Object.create(p&&p.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(m,p):m.__proto__=p)}var d=(function(m){h(p,m);function p(){return c(this,p),f(this,(p.__proto__||Object.getPrototypeOf(p)
vendor: 9,641 bytes, line 752
752).apply(this,arguments))}return p})(o.default);d.blotName="underline",d.tagName="U",n.default=d}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function v(b,w){for(var _=0;_<w.length;_++){var N=w[_];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(b,N.key,N)}}return function(b,w,_){return w&&v(b.prototype,w),_&&v(b,_),b}})(),o=function v(b,w,_){b===null&&(b=Function.prototype);var N=Object.getOwnPropertyDescriptor(b,w);if(N===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:v(S,w,_)}else{if("value"in N)return N.value;var k=N.get;return k===void 0?void 0:k.call(_)}},l=i(0),c=h(l),f=i(27);function h(v){return v&&v.__esModule?v:{default:v}}function d(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function m(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function p(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var x=["alt","height","width"],y=(function(v){p(b,v);function b(){return d(this,b),m(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"format",value:function(_,N){x.indexOf(_)>-1?N?this.domNode.setAttribute(_,N):this.domNode.removeAttribute(_):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,_,N)}}],[{key:"create",value:function(_){var N=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,_);return typeof _=="string"&&N.setAttribute("src",this.sanitize(_)),N}},{key:"formats",value:function(_){return x.reduce(function(N,S){return _.hasAttribute(S)&&(N[S]=_.getAttribute(S)),N},{})}},{key:"match",value:function(_){return/\.(jpe?g|gif|png)$/.test(_)||/^data:image\/.+;base64/.test(_)}},{key:"sanitize",value:function(_){return(0,f.sanitize)(_,["http","https","data"])?_:"//:0"}},{key:"value",value:function(_){return _.getAttribute("src")}}]),b})(c.default.Embed);y.blotName="image",y.tagName="IMG",n.default=y}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var s=(function(){function v(b,w){for(var _=0;_<w.length;_++){var N=w[_];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(b,N.key,N)}}return function(b,w,_){return w&&v(b.prototype,w),_&&v(b,_),b}})(),o=function v(b,w,_){b===null&&(b=Function.prototype);var N=Object.getOwnPropertyDescriptor(b,w);if(N===void 0){var S=Object.getPrototypeOf(b);return S===null?void 0:v(S,w,_)}else{if("value"in N)return N.value;var k=N.get;return k===void 0?void 0:k.call(_)}},l=i(4),c=i(27),f=h(c);function h(v){return v&&v.__esModule?v:{default:v}}function d(v,b){if(!(v instanceof b))throw new TypeError("Cannot call a class as a function")}function m(v,b){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:v}function p(v,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);v.prototype=Object.create(b&&b.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(v,b):v.__proto__=b)}var x=["height","width"],y=(function(v){p(b,v);function b(){return d(this,b),m(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return s(b,[{key:"format",value:function(_,N){x.indexOf(_)>-1?N?this.domNode.setAttribute(_,N):this.domNode.removeAttribute(_):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,_,N)}}],[{key:"create",value:function(_){var N=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,_);return N.setAttribute("frameborder","0"),N.setAttribute("allowfullscreen",!0),N.setAttribute("src",this.sanitize(_)),N}},{key:"formats",value:function(_){return x.reduce(function(N,S){return _.hasAttribute(S)&&(N[S]=_.getAttribute(S)),N},{})}},{key:"sanitize",value:function(_){return f.default.sanitize(_)}},{key:"value",value:function(_){return _.getAttribute("src")}}]),b})(l.BlockEmbed);y.blotName="video",y.className="ql-video",y.tagName="IFRAME",n.default=y}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var s=(function(){function _(N,S){for(var k=0;k<S.length;k++){var C=S[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(N,C.key,C)}}return function(N,S,k){return S&&_(N.prototype,S),k&&_(N,k),N}})(),o=function _(N,S,k){N===null&&(N=Function.prototype);var C=Object.getOwnPropertyDescriptor(N,S);if(C===void 0){var O=Object.getPrototypeOf(N);return O===null?void 0:_(O,S,k)}else{if("value"in C)return C.value;var R=C.get;return R===void 0?void 0:R.call(k)}},l=i(35),c=p(l),f=i(5),h=p(f),d=i(9),m=p(d);function p(_){return _&&_.__esModule?_:{default:_}}function x(_,N){if(!(_ instanceof N))throw new TypeError("Cannot call a class as a function")}function y(_,N){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:_}function v(_,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);_.prototype=Object.create(N&&N.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(_,N):_.__proto__=N)}var b=(function(_){v(N,_);function N(){return x(this,N),y(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}return s(N,null,[{key:"create",value:function(k){var C=o(N.__proto__||Object.getPrototypeOf(N),"create",this).call(this,k);return typeof k=="string"&&(window.katex.render(k,C,{throwOnError:!1,errorColor:"#f00"}),C.setAttribute("data-value",k)),C}},{key:"value",value:function(k){return k.getAttribute("data-value")}}]),N})(c.default);b.blotName="formula",b.className="ql-formula",b.tagName="SPAN";var w=(function(_){v(N,_),s(N,null,[{key:"register",value:function(){h.default.register(b,!0)}}]);function N(){x(this,N);var S=y(this,(N.__proto__||Object.getPrototypeOf(N)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return S}return N})(m.default);n.FormulaBlot=b,n.default=w}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var s=(function(){function k(C,O){for(var R=0;R<O.length;R++){var A=O[R];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(C,A.key,A)}}return function(C,O,R){return O&&k(C.prototype,O),R&&k(C,R),C}})(),o=function k(C,O,R){C===null&&(C=Function.prototype);var A=Object.getOwnPropertyDescriptor(C,O);if(A===void 0){var P=Object.getPrototypeOf(C);return P===null?void 0:k(P,O,R)}else{if("value"in A)return A.value;var E=A.get;return E===void 0?void 0:E.call(R)}},l=i(0),c=y(l),f=i(5),h=y(f),d=i(9),m=y(d),p=i(13),x=y(p);function y(k){return k&&k.__esModule?k:{default:k}}function v(k,C){if(!(k instanceof C))throw new TypeError("Cannot call a class as a function")}function b(k,C){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:k}function w(k,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);k.prototype=Object.create(C&&C.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(k,C):k.__proto__=C)}var _=(function(k){w(C,k);function C(){return v(this,C),b(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return s(C,[{key:"replaceWith",value:function(R){this.domNode.textContent=this.domNode.textContent,this.attach(),o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"replaceWith",this).call(this,R)}},{key:"highlight",value:function(R){var A=this.domNode.textContent;this.cachedText!==A&&((A.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=R(A),this.domNode.normalize(),this.attach()),this.cachedText=A)}}]),C})(x.default);_.className="ql-syntax";var N=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),S=(function(k){w(C,k),s(C,null,[{key:"register",value:function(){h.default.register(N,!0),h.default.register(_,!0)}}]);function C(O,R){v(this,C);var A=b(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,O,R));if(typeof A.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var P=null;return A.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(P),P=setTimeout(function(){A.highlight(),P=null},A.options.interval)}),A.highlight(),A}return s(C,[{key:"highlight",value:function(){var R=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var A=this.quill.getSelection();this.quill.scroll.descendants(_).forEach(function(P){P.highlight(R.options.highlight)}),this.quill.update(h.default.sources.SILENT),A!=null&&this.quill.setSelection(A,h.default.sources.SILENT)}}}]),C})(m.default);S.DEFAULTS={highlight:(function(){return window.hljs==null?null:function(k){var C=window.hljs.highlightAuto(k);return C.value}})(),interval:1e3}
752,n.CodeBlock=_,n.CodeToken=N,n.default=S}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'}),(function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line>
752 <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'}),(function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'}),(function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'}),(function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'}),(function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var s=function C(O,R,A){O===null&&(O=Function.prototype);var P=Object.getOwnPropertyDescriptor(O,R);if(P===void 0){var E=Object.getPrototypeOf(O);return E===null?void 0:C(E,R,A)}else{if("value"in P)return P.value;var T=P.get;return T===void 0?void 0:T.call(A)}},o=(function(){function C(O,R){for(var A=0;A<R.length;A++){var P=R[A];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(O,P.key,P)}}return function(O,R,A){return R&&C(O.prototype,R),A&&C(O,A),O}})(),l=i(3),c=v(l),f=i(8),h=v(f),d=i(43),m=v(d),p=i(15),x=i(41),y=v(x);function v(C){return C&&C.__esModule?C:{default:C}}function b(C,O){if(!(C instanceof O))throw new TypeError("Cannot call a class as a function")}function w(C,O){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:C}function _(C,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);C.prototype=Object.create(O&&O.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(C,O):C.__proto__=O)}var N=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],S=(function(C){_(O,C);function O(R,A){b(this,O),A.modules.toolbar!=null&&A.modules.toolbar.container==null&&(A.modules.toolbar.container=N);var P=w(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R,A));return P.quill.container.classList.add("ql-bubble"),P}return o(O,[{key:"extendToolbar",value:function(A){this.tooltip=new k(this.quill,this.options.bounds),this.tooltip.root.appendChild(A.container),this.buildButtons([].slice.call(A.container.querySelectorAll("button")),y.default),this.buildPickers([].slice.call(A.container.querySelectorAll("select")),y.default)}}]),O})(m.default);S.DEFAULTS=(0,c.default)(!0,{},m.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(O){O?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var k=(function(C){_(O,C);function O(R,A){b(this,O);var P=w(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,R,A));return P.quill.on(h.default.events.EDITOR_CHANGE,function(E,T,$,D){if(E===h.default.events.SELECTION_CHANGE)if(T!=null&&T.length>0&&D===h.default.sources.USER){P.show(),P.root.style.left="0px",P.root.style.width="",P.root.style.width=P.root.offsetWidth+"px";var W=P.quill.getLines(T.index,T.length);if(W.length===1)P.position(P.quill.getBounds(T));else{var U=W[W.length-1],H=P.quill.getIndex(U),K=Math.min(U.length()-1,T.index+T.length-H),q=P.quill.getBounds(new p.Range(H,K));P.position(q)}}else document.activeElement!==P.textbox&&P.quill.hasFocus()&&P.hide()}),P}return o(O,[{key:"listen",value:function(){var A=this;s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){A.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!A.root.classList.contains("ql-hidden")){var P=A.quill.getSelection();P!=null&&A.position(A.quill.getBounds(P))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(A){var P=s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"position",this).call(this,A),E=this.root.querySelector(".ql-tooltip-arrow");if(E.style.marginLeft="",P===0)return P;E.style.marginLeft=-1*P-E.offsetWidth/2+"px"}}]),O})(d.BaseTooltip);k.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=k,n.default=S}),(function(r,n,i){r.exports=i(63)})]).default})})(gp)),gp.exports}var ka,jM;function rve(){if(jM)return ka;jM=1;var e=ka&&ka.__extends||(function(){var h=function(d,m){return h=Object.
vendor: 5,433 bytes, line 752
752setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,x){p.__proto__=x}||function(p,x){for(var y in x)x.hasOwnProperty(y)&&(p[y]=x[y])},h(d,m)};return function(d,m){h(d,m);function p(){this.constructor=d}d.prototype=m===null?Object.create(m):(p.prototype=m.prototype,new p)}})(),t=ka&&ka.__assign||function(){return t=Object.assign||function(h){for(var d,m=1,p=arguments.length;m<p;m++){d=arguments[m];for(var x in d)Object.prototype.hasOwnProperty.call(d,x)&&(h[x]=d[x])}return h},t.apply(this,arguments)},r=ka&&ka.__spreadArrays||function(){for(var h=0,d=0,m=arguments.length;d<m;d++)h+=arguments[d].length;for(var p=Array(h),x=0,d=0;d<m;d++)for(var y=arguments[d],v=0,b=y.length;v<b;v++,x++)p[x]=y[v];return p},n=ka&&ka.__importDefault||function(h){return h&&h.__esModule?h:{default:h}},i=n(Lg()),s=n(VN()),o=n(G$()),l=n(tve()),c=(function(h){e(d,h);function d(m){var p=h.call(this,m)||this;p.dirtyProps=["modules","formats","bounds","theme","children"],p.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],p.state={generation:0},p.selection=null,p.onEditorChange=function(y,v,b,w){var _,N,S,k;y==="text-change"?(N=(_=p).onEditorChangeText)===null||N===void 0||N.call(_,p.editor.root.innerHTML,v,w,p.unprivilegedEditor):y==="selection-change"&&((k=(S=p).onEditorChangeSelection)===null||k===void 0||k.call(S,v,w,p.unprivilegedEditor))};var x=p.isControlled()?m.value:m.defaultValue;return p.value=x??"",p}return d.prototype.validateProps=function(m){var p;if(i.default.Children.count(m.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(i.default.Children.count(m.children)){var x=i.default.Children.only(m.children);if(((p=x)===null||p===void 0?void 0:p.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&m.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")},d.prototype.shouldComponentUpdate=function(m,p){var x=this,y;if(this.validateProps(m),!this.editor||this.state.generation!==p.generation)return!0;if("value"in m){var v=this.getEditorContents(),b=(y=m.value,y??"");this.isEqualValue(b,v)||this.setEditorContents(this.editor,b)}return m.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,m.readOnly),r(this.cleanProps,this.dirtyProps).some(function(w){return!o.default(m[w],x.props[w])})},d.prototype.shouldComponentRegenerate=function(m){var p=this;return this.dirtyProps.some(function(x){return!o.default(m[x],p.props[x])})},d.prototype.componentDidMount=function(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())},d.prototype.componentWillUnmount=function(){this.destroyEditor()},d.prototype.componentDidUpdate=function(m,p){var x=this;if(this.editor&&this.shouldComponentRegenerate(m)){var y=this.editor.getContents(),v=this.editor.getSelection();this.regenerationSnapshot={delta:y,selection:v},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==p.generation){var b=this.regenerationSnapshot,y=b.delta,w=b.selection;delete this.regenerationSnapshot,this.instantiateEditor();var _=this.editor;_.setContents(y),f(function(){return x.setEditorSelection(_,w)})}},d.prototype.instantiateEditor=function(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())},d.prototype.destroyEditor=function(){this.editor&&this.unhookEditor(this.editor)},d.prototype.isControlled=function(){return"value"in this.props},d.prototype.getEditorConfig=function(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,scrollingContainer:this.props.scrollingContainer,tabIndex:this.props.tabIndex,theme:this.props.theme}},d.prototype.getEditor=function(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor},d.prototype.createEditor=function(m,p){var x=new l.default(m,p);return p.tabIndex!=null&&this.setEditorTabIndex(x,p.tabIndex),this.hookEditor(x),x},d.prototype.hookEditor=function(m){this.unprivilegedEditor=this.makeUnprivilegedEditor(m),m.on("editor-change",this.onEditorChange)},d.prototype.unhookEditor=function(m){m.off("editor-change",this.onEditorChange)},d.prototype.getEditorContents=function(){return this.value},d.prototype.getEditorSelection=function(){return this.selection},d.prototype.isDelta=function(m){return m&&m.ops},d.prototype.isEqualValue=function(m,p){return this.isDelta(m)&&this.isDelta(p)?o.default(m.ops,p.ops):o.default(m,p)},d.prototype.setEditorContents=function(m,p){var x=this;this.value=p;var y=this.getEditorSelection();typeof p=="string"?m.setContents(m.clipboard.convert(p)):m.setContents(p),f(function(){return x.setEditorSelection(m,y)})},d.prototype.setEditorSelection=function(m,p){if(this.selection=p,p){var x=m.getLength();p.index=Math.max(0,Math.min(p.index,x-1)),p.length=Math.max(0,Math.min(p.length,x-1-p.index)),m.setSelection(p)}},d.prototype.setEditorTabIndex=function(m,p){var x,y;!((y=(x=m)===null||x===void 0?void 0:x.scroll)===null||y===void 0)&&y.domNo
752de&&(m.scroll.domNode.tabIndex=p)},d.prototype.setEditorReadOnly=function(m,p){p?m.disable():m.enable()},d.prototype.makeUnprivilegedEditor=function(m){var p=m;return{getHTML:function(){return p.root.innerHTML},getLength:p.getLength.bind(p),getText:p.getText.bind(p),getContents:p.getContents.bind(p),getSelection:p.getSelection.bind(p),getBounds:p.getBounds.bind(p)}},d.prototype.getEditingArea=function(){if(!this.editingArea)throw new Error("Instantiating on missing editing area");var m=s.default.findDOMNode(this.editingArea);if(!m)throw new Error("Cannot find element for editing area");if(m.nodeType===3)throw new Error("Editing area cannot be a text node");return m},d.prototype.renderEditingArea=function(){var m=this,p=this.props,x=p.children,y=p.preserveWhitespace,v=this.state.generation,b={key:v,ref:function(w){m.editingArea=w}};return i.default.Children.count(x)?i.default.cloneElement(i.default.Children.only(x),b):y?i.default.createElement("pre",t({},b)):i.default.createElement("div",t({},b))},d.prototype.render=function(){var m;return i.default.createElement("div",{id:this.props.id,style:this.props.style,key:this.state.generation,className:"quill "+(m=this.props.className,m??""),onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())},d.prototype.onEditorChangeText=function(m,p,x,y){var v,b;if(this.editor){var w=this.isDelta(this.value)?y.getContents():y.getHTML();w!==this.getEditorContents()&&(this.lastDeltaChangeSet=p,this.value=w,(b=(v=this.props).onChange)===null||b===void 0||b.call(v,m,p,x,y))}},d.prototype.onEditorChangeSelection=function(m,p,x){var y,v,b,w,_,N;if(this.editor){var S=this.getEditorSelection(),k=!S&&m,C=S&&!m;o.default(m,S)||(this.selection=m,(v=(y=this.props).onChangeSelection)===null||v===void 0||v.call(y,m,p,x),k?(w=(b=this.props).onFocus)===null||w===void 0||w.call(b,m,p,x):C&&((N=(_=this.props).onBlur)===null||N===void 0||N.call(_,S,p,x)))}},d.prototype.focus=function(){this.editor&&this.editor.focus()},d.prototype.blur=function(){this.editor&&(this.selection=null,this.editor.blur())},d.displayName="React Quill",d.Quill=l.default,d.defaultProps={theme:"snow",modules:{},readOnly:!1},d})(i.default.Component);function f(h){Promise.resolve().then(h)}return ka=c,ka}var nve=rve();const Xl=Ft(nve);function ave(){var w;const[e]=Bg(),t=Wf(),r=e.get("courseId"),n=e.get("formId"),i=e.get("tier")||"standard",s=at(),[o,l]=I.useState({course_id:r,tier:i,title:"",description:"",image_url:"",registration_fee:0,registration_notes:"",terms_of_service:"",deposit_payment_link:"",payment_method_options:[],email_template_subject:"【報名成功通知】{{course_name}}",email_template_body:`親愛的 {{applicant_name}} 您好,
753
754感謝您報名 {{course_name}}。
755我們已收到您的報名資訊。
756
757如有任何問題,歡迎隨時聯繫我們。
758
759無限未來管理系統 團隊 敬上`,commencement_email_subject:"【開課通知】{{course_name}}",commencement_email_body:`親愛的 {{applicant_name}} 您好,
760
761您報名的 {{course_name}} 即將開課。
762
763上課時間:...
764上課地點:...
765
766期待您的參與!`,reminder_email_subject:"【上課提醒】{{course_name}}",reminder_email_body:`親愛的 {{applicant_name}} 您好,
767
768提醒您,{{course_name}} 將於近期上課,請準時出席。`,cancellation_email_subject:"【停開通知】{{course_name}}",cancellation_email_body:`親愛的 {{applicant_name}} 您好,
769
770很遺憾地通知您,因故 {{course_name}} 將暫停開課...
771我們將協助後續退費事宜。`,custom_fields:[],is_active:!0}),[c,f]=I.useState(!1),h=oe.useRef(!1),{data:d}=Te({queryKey:["course",r],queryFn:async()=>(await ee.entities.Course.list()).find(N=>N.id===r),enabled:!!r&&!n}),{data:m}=Te({queryKey:["courseForm",n],queryFn:async()=>(await ee.entities.CourseForm.list()).find(N=>N.id===n),enabled:!!n});I.useEffect(()=>{m&&!h.current?(l(m),h.current=!0):!n&&d&&!h.current&&(l(_=>({..._,title:d.course_name,description:d.description||"",registration_fee:i==="standard"?d.standard_price:(i==="early_bird"?d.early_bird_price:d.late_bird_price)||0,tier:i})),h.current=!0)},[m,d,i,n]);const p=Ye({mutationFn:_=>n?ee.entities.CourseForm.update(n,_):ee.entities.CourseForm.create(_),onSuccess:()=>{s.invalidateQueries(["courseForms"]),alert("儲存成功!"),t(`${Ur("CourseRegistrationManagement")}?courseId=${r}`)}}),x=async _=>{const N=_.target.files[0];if(N)try{f(!0);const{file_url:S}=await ee.integrations.Core.UploadFile({file:N});l(k=>({...k,image_url:S}))}catch(S){console.error(S),alert("上傳失敗")}finally{f(!1)}},y=()=>
771{l(_=>({..._,custom_fields:[..._.custom_fields||[],{label:"",type:"text",options:"",required:!1}]}))},v=(_,N,S)=>{const k=[...o.custom_fields];k[_]={...k[_],[N]:S},l(C=>({...C,custom_fields:k}))},b=_=>{const N=[...o.custom_fields];N.splice(_,1),l(S=>({...S,custom_fields:N}))};return a.jsxs("div",{className:"max-w-4xl mx-auto space-y-8 pb-20",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(qi,{to:`${Ur("CourseRegistrationManagement")}?courseId=${r}`,children:a.jsxs(te,{variant:"ghost",className:"text-gray-400 hover:text-white",children:[a.jsx(zf,{className:"w-5 h-5 mr-2"}),"返回"]})}),a.jsx("h1",{className:"text-2xl font-bold cyber-text",children:n?"編輯報名表單":"建立報名表單"})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"課程圖片"}),a.jsxs("div",{className:"flex flex-col gap-3",children:[o.image_url&&a.jsx("img",{src:o.image_url,alt:"Course",className:"w-32 h-32 object-cover rounded border border-gray-700"}),a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsxs(te,{variant:"outline",onClick:()=>document.getElementById("form-img-upload").click(),disabled:c,className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[c?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),"上傳圖片"]}),a.jsx("input",{id:"form-img-upload",type:"file",accept:"image/*",className:"hidden",onChange:x}),a.jsx("span",{className:"text-gray-500 text-sm",children:"或直接貼上圖片網址:"})]}),a.jsx(ne,{value:o.image_url||"",onChange:_=>l(N=>({...N,image_url:_.target.value})),placeholder:"https://example.com/image.png",className:"bg-black border-gray-700 text-sm"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"課程名稱 (表單標題) *"}),a.jsx(ne,{value:o.title,onChange:_=>l({...o,title:_.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"報名費用 *"}),a.jsx(ne,{type:"number",value:o.registration_fee,onChange:_=>l({...o,registration_fee:parseFloat(_.target.value)}),className:"bg-black border-gray-700"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"課程簡介"}),a.jsx(Pt,{value:o.description,onChange:_=>l({...o,description:_.target.value}),className:"bg-black border-gray-700 h-32"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"報名注意事項"}),a.jsx("div",{className:"bg-white text-black rounded-md overflow-hidden",children:a.jsx(Xl,{theme:"snow",value:o.registration_notes||"",onChange:_=>l(N=>({...N,registration_notes:_})),className:"h-48 mb-12",placeholder:"例如:請自備筆電..."})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"服務條款"}),a.jsx("div",{className:"bg-white text-black rounded-md overflow-hidden",children:a.jsx(Xl,{theme:"snow",value:o.terms_of_service||"",onChange:_=>l(N=>({...N,terms_of_service:_})),className:"h-48 mb-12",placeholder:"報名即代表同意..."})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-[#00FFFF]",children:"訂金付款連結 (報名後自動跳轉)"}),a.jsx(ne,{value:o.deposit_payment_link,onChange:_=>l({...o,deposit_payment_link:_.target.value}),className:"bg-black border-gray-700",placeholder:"https://payment-link.com/..."})]}),a.jsxs("div",{className:"border-t border-gray-700 pt-6 space-y-6",children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:"分期與付款方式選項設定"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"可選的分期與付款方式"}),a.jsx("p",{className:"text-xs text-gray-400 mb-2",children:"請勾選在報名表單中要顯示的選項"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:["信用卡/ATM轉帳一次付清","信用卡分期 3期 (玉山/台新)","信用卡分期 6期 (玉山/台新)","信用卡分期 12期 (玉山/台新)","中租零卡分期 3期","中租零卡分期 6期","中租零卡分期 9期","中租零卡分期 12期","中租零卡分期 18期","中租零卡分期 24期"].map(_=>a.jsxs("div",{className:"flex items-center gap-2 bg-gray-900 p-2 rounded border border-gray-800",children:[a.jsx("input",{type:"checkbox",id:`payment-${_}`,checked:(o.payment_method_options||[]).includes(_),onChange:N=>{const S=o.payment_method_options||[];N.target.checked?l({...o,payment_method_options:[...S,_]}):l({...o,payment_method_options:S.filter(k=>k!==_)})},className:"w-4 h-4"}),a.jsx("label",{htmlFor:`payment-${_}`,className:"text-sm text-gray-300",children:_})]},_))})]})]}),a.jsxs("div",{className:"border-t border-gray-700 pt-6 space-y-6",children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:"自動確認 Email 設定"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Email 標題"}),a.jsx(ne,{value:o.email_template_subject,onChange:_=>l({...o,email_template_subject:_.target.value}
771),className:"bg-black border-gray-700",placeholder:"例如:【報名成功】{{course_name}}"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{children:["Email 內容 (支援 ","{{name}}"," 變數)"]}),a.jsx("div",{className:"bg-white text-black rounded-md overflow-hidden",children:a.jsx(Xl,{theme:"snow",value:o.email_template_body||"",onChange:_=>l(N=>({...N,email_template_body:_})),className:"h-48 mb-12",placeholder:"可用變數: {{applicant_name}}, {{course_name}}"})})]}),a.jsxs("div",{className:"grid grid-cols-1 gap-6 pt-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-blue-400",children:"開課通知信內容"}),a.jsx(ne,{value:o.commencement_email_subject,onChange:_=>l({...o,commencement_email_subject:_.target.value}),placeholder:"標題",className:"bg-black border-gray-700 mb-2"}),a.jsx("div",{className:"bg-white text-black rounded-md overflow-hidden",children:a.jsx(Xl,{theme:"snow",value:o.commencement_email_body||"",onChange:_=>l(N=>({...N,commencement_email_body:_})),className:"h-40 mb-12"})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-yellow-400",children:"上課提醒信內容"}),a.jsx(ne,{value:o.reminder_email_subject,onChange:_=>l({...o,reminder_email_subject:_.target.value}),placeholder:"標題",className:"bg-black border-gray-700 mb-2"}),a.jsx("div",{className:"bg-white text-black rounded-md overflow-hidden",children:a.jsx(Xl,{theme:"snow",value:o.reminder_email_body||"",onChange:_=>l(N=>({...N,reminder_email_body:_})),className:"h-40 mb-12"})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-red-400",children:"停開通知信內容"}),a.jsx(ne,{value:o.cancellation_email_subject,onChange:_=>l({...o,cancellation_email_subject:_.target.value}),placeholder:"標題",className:"bg-black border-gray-700 mb-2"}),a.jsx("div",{className:"bg-white text-black rounded-md overflow-hidden",children:a.jsx(Xl,{theme:"snow",value:o.cancellation_email_body||"",onChange:_=>l(N=>({...N,cancellation_email_body:_})),className:"h-40 mb-12"})})]})]})]}),a.jsxs("div",{className:"border-t border-gray-700 pt-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:"自訂欄位"}),a.jsxs(te,{variant:"outline",onClick:y,size:"sm",className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"新增欄位"]})]}),a.jsxs("div",{className:"space-y-4",children:[(w=o.custom_fields)==null?void 0:w.map((_,N)=>a.jsxs("div",{className:"flex gap-2 items-start bg-gray-900 p-3 rounded border border-gray-800",children:[a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsx(ne,{placeholder:"欄位名稱",value:_.label,onChange:S=>v(N,"label",S.target.value),className:"bg-black border-gray-700 h-8 text-sm"}),a.jsxs("select",{value:_.type,onChange:S=>v(N,"type",S.target.value),className:"w-full bg-black border border-gray-700 rounded h-8 text-sm px-2 text-white",children:[a.jsx("option",{value:"text",children:"文字框"}),a.jsx("option",{value:"number",children:"數字"}),a.jsx("option",{value:"textarea",children:"多行文字"}),a.jsx("option",{value:"select",children:"下拉選單"}),a.jsx("option",{value:"checkbox",children:"核取方塊"})]}),_.type==="select"&&a.jsx(ne,{placeholder:"選項 (用逗號分隔)",value:_.options,onChange:S=>v(N,"options",S.target.value),className:"bg-black border-gray-700 h-8 text-sm"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"checkbox",checked:_.required,onChange:S=>v(N,"required",S.target.checked),id:`req-${N}`}),a.jsx("label",{htmlFor:`req-${N}`,className:"text-xs text-gray-400",children:"必填"})]})]}),a.jsx(te,{variant:"ghost",size:"sm",onClick:()=>b(N),className:"bg-gray-800 text-white hover:bg-gray-700 hover:text-red-300 border border-gray-600",children:a.jsx(Qt,{className:"w-4 h-4"})})]},N)),(!o.custom_fields||o.custom_fields.length===0)&&a.jsx("p",{className:"text-gray-500 text-sm text-center",children:"無自訂欄位"})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-4",children:[a.jsx(qi,{to:`${Ur("CourseRegistrationManagement")}?courseId=${r}`,children:a.jsx(te,{variant:"outline",className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:"取消"})}),a.jsxs(te,{onClick:()=>p.mutate(o),disabled:p.isPending,className:"bg-gray-800 text-white hover:bg-gray-700 font-bold px-8 border border-gray-600",children:[a.jsx(Vd,{className:"w-4 h-4 mr-2"}),"儲存設定"]})]})]})}const Xn=I.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:r,className:Vt("w-full caption-bottom text-sm",e),...t})}));Xn.displayName="Table";const Zn=I.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:Vt("[&_tr]:border-b",e),...t}));Zn.displayName="TableHeader";const Jn=I.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:Vt("[&_tr:last-child]:border-0",e),...t}));Jn.displayName="TableBody";const ive=I.forwardRef(({className:e,...t},r)=>a.jsx("tfoot",{ref:r,className:Vt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));ive.displayName="TableFooter";const Dt=I.forwardRef(({className:e,...t},r)=>a.jsx("tr",{ref:r,className:Vt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Dt.displayName="TableRow";const Le=I.forwardRef(({className:e,...t},r)=>a.jsx("th",{ref:r,className:Vt("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));
vendor: 2,140 bytes, line 771
771Le.displayName="TableHead";const Me=I.forwardRef(({className:e,...t},r)=>a.jsx("td",{ref:r,className:Vt("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Me.displayName="TableCell";const sve=I.forwardRef(({className:e,...t},r)=>a.jsx("caption",{ref:r,className:Vt("mt-4 text-sm text-muted-foreground",e),...t}));sve.displayName="TableCaption";var cj="rovingFocusGroup.onEntryFocus",ove={bubbles:!1,cancelable:!0},dh="RovingFocusGroup",[TN,d8,lve]=q6(dh),[cve,f8]=lh(dh,[lve]),[uve,dve]=cve(dh),h8=I.forwardRef((e,t)=>a.jsx(TN.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(TN.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(fve,{...e,ref:t})})}));h8.displayName=dh;var fve=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...d}=e,m=I.useRef(null),p=Ir(t,m),x=yk(s),[y,v]=Tg({prop:o,defaultProp:l??null,onChange:c,caller:dh}),[b,w]=I.useState(!1),_=Ws(f),N=d8(r),S=I.useRef(!1),[k,C]=I.useState(0);return I.useEffect(()=>{const O=m.current;if(O)return O.addEventListener(cj,_),()=>O.removeEventListener(cj,_)},[_]),a.jsx(uve,{scope:r,orientation:n,dir:x,loop:i,currentTabStopId:y,onItemFocus:I.useCallback(O=>v(O),[v]),onItemShiftTab:I.useCallback(()=>w(!0),[]),onFocusableItemAdd:I.useCallback(()=>C(O=>O+1),[]),onFocusableItemRemove:I.useCallback(()=>C(O=>O-1),[]),children:a.jsx(Kt.div,{tabIndex:b||k===0?-1:0,"data-orientation":n,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Ut(e.onMouseDown,()=>{S.current=!0}),onFocus:Ut(e.onFocus,O=>{const R=!S.current;if(O.target===O.currentTarget&&R&&!b){const A=new CustomEvent(cj,ove);if(O.currentTarget.dispatchEvent(A),!A.defaultPrevented){const P=N().filter(W=>W.focusable),E=P.find(W=>W.active),T=P.find(W=>W.id===y),D=[E,T,...P].filter(Boolean).map(W=>W.ref.current);g8(D,h)}}S.current=!1}),onBlur:Ut(e.onBlur,()=>w(!1))})})}),m8="RovingFocusGroupItem",p8=I.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,children:o,...l}
vendor: 4,192 bytes, line 771
771=e,c=ch(),f=s||c,h=dve(m8,r),d=h.currentTabStopId===f,m=d8(r),{onFocusableItemAdd:p,onFocusableItemRemove:x,currentTabStopId:y}=h;return I.useEffect(()=>{if(n)return p(),()=>x()},[n,p,x]),a.jsx(TN.ItemSlot,{scope:r,id:f,focusable:n,active:i,children:a.jsx(Kt.span,{tabIndex:d?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:Ut(e.onMouseDown,v=>{n?h.onItemFocus(f):v.preventDefault()}),onFocus:Ut(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Ut(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){h.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=pve(v,h.orientation,h.dir);if(b!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let _=m().filter(N=>N.focusable).map(N=>N.ref.current);if(b==="last")_.reverse();else if(b==="prev"||b==="next"){b==="prev"&&_.reverse();const N=_.indexOf(v.currentTarget);_=h.loop?gve(_,N+1):_.slice(N+1)}setTimeout(()=>g8(_))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:y!=null}):o})})});p8.displayName=m8;var hve={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mve(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function pve(e,t,r){const n=mve(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return hve[n]}function g8(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function gve(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var yve=h8,vve=p8;function xve(e,t){return I.useReducer((r,n)=>t[r][n]??r,e)}var y8=e=>{const{present:t,children:r}=e,n=bve(t),i=typeof r=="function"?r({present:n.isPresent}):I.Children.only(r),s=Ir(n.ref,wve(i));return typeof r=="function"||n.isPresent?I.cloneElement(i,{ref:s}):null};y8.displayName="Presence";function bve(e){const[t,r]=I.useState(),n=I.useRef(null),i=I.useRef(e),s=I.useRef("none"),o=e?"mounted":"unmounted",[l,c]=xve(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return I.useEffect(()=>{const f=Qm(n.current);s.current=l==="mounted"?f:"none"},[l]),cn(()=>{const f=n.current,h=i.current;if(h!==e){const m=s.current,p=Qm(f);e?c("MOUNT"):p==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(h&&m!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),cn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,d=p=>{const y=Qm(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&y&&(c("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},m=p=>{p.target===t&&(s.current=Qm(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:I.useCallback(f=>{n.current=f?getComputedStyle(f):null,r(f)},[])}}function Qm(e){return(e==null?void 0:e.animationName)||"none"}function wve(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var $y="Tabs",[_ve]=lh($y,[f8]),v8=f8(),[jve,Ck]=_ve($y),x8=I.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:l,activationMode:c="automatic",...f}=e,h=yk(l),[d,m]=Tg({prop:n,onChange:i,defaultProp:s??"",caller:$y});return a.jsx(jve,{scope:r,baseId:ch(),value:d,onValueChange:m,orientation:o,dir:h,activationMode:c,children:a.jsx(Kt.div,{dir:h,"data-orientation":o,...f,ref:t})})});x8.displayName=$y;var b8="TabsList",w8=I.forwardRef((e,t)=>
771{const{__scopeTabs:r,loop:n=!0,...i}=e,s=Ck(b8,r),o=v8(r);return a.jsx(yve,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:n,children:a.jsx(Kt.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});w8.displayName=b8;var _8="TabsTrigger",j8=I.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=e,o=Ck(_8,r),l=v8(r),c=k8(o.baseId,n),f=C8(o.baseId,n),h=n===o.value;return a.jsx(vve,{asChild:!0,...l,focusable:!i,active:h,children:a.jsx(Kt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:t,onMouseDown:Ut(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?o.onValueChange(n):d.preventDefault()}),onKeyDown:Ut(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&o.onValueChange(n)}),onFocus:Ut(e.onFocus,()=>{const d=o.activationMode!=="manual";!h&&!i&&d&&o.onValueChange(n)})})})});j8.displayName=_8;var N8="TabsContent",S8=I.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=e,l=Ck(N8,r),c=k8(l.baseId,n),f=C8(l.baseId,n),h=n===l.value,d=I.useRef(h);return I.useEffect(()=>{const m=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(y8,{present:i||h,children:({present:m})=>a.jsx(Kt.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:m&&s})})});S8.displayName=N8;function k8(e,t){return`${e}-trigger-${t}`}function C8(e,t){return`${e}-content-${t}`}var Nve=x8,F8=w8,O8=j8,E8=S8;const P8=Nve,Fk=I.forwardRef(({className:e,...t},r)=>a.jsx(F8,{ref:r,className:Vt("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Fk.displayName=F8.displayName;const fc=I.forwardRef(({className:e,...t},r)=>a.jsx(O8,{ref:r,className:Vt("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));fc.displayName=O8.displayName;const Rg=I.forwardRef(({className:e,...t},r)=>a.jsx(E8,{ref:r,className:Vt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Rg.displayName=E8.displayName;function Sve(){var E;const[e]=Bg(),t=e.get("courseId"),[r,n]=I.useState(""),[i,s]=I.useState(!1),[o,l]=I.useState(null),[c,f]=I.useState("standard"),[h,d]=I.useState(!1),[m,p]=I.useState({applicant_name:"",applicant_email:"",phone_number:"",mailing_address:"",company_school_name:"",title_department:"",company_tax_id:"",coding_experience:"",course_info_source:"",preferred_payment_method:"",pre_course_questions:"",remarks:"",admin_remarks:"",status:"pending",payment_status:"pending",payment_amount:0}),x=at(),{data:y}=Te({queryKey:["course",t],queryFn:async()=>t?(await ee.entities.Course.list()).find($=>$.id===t):null,enabled:!!t}),{data:v=[]}=Te({queryKey:["courseForms",t],queryFn:()=>ee.entities.CourseForm.list(),enabled:!!t}),{data:b=[]}=Te({queryKey:["registrations",t],queryFn:()=>ee.entities.CourseRegistration.list("-registration_date"),enabled:!!t}),w=v.find(T=>T.course_id===t&&(T.tier===c||!T.tier&&c==="standard")),_=b.filter(T=>T.form_id?T.form_id===(w==null?void 0:w.id):w&&T.course_id===t).filter(T=>{var $,D;return(($=T.applicant_name)==null?void 0:$.toLowerCase().includes(r.toLowerCase()))||((D=T.applicant_email)==null?void 0:D.toLowerCase().includes(r.toLowerCase()))}),N=Ye({mutationFn:async T=>{const $=b.find(W=>W.id===T.id),D=$&&($.payment_status!==T.payment_status||$.payment_amount!==T.payment_amount);if(await ee.entities.CourseRegistration.update(T.id,T),D&&y){const W=(T.payment_amount||0)-($.payment_amount||0),U=(y.total_revenue||0)+W,H=U-(y.total_cost||0);await ee.entities.Course.update(y.id,{total_revenue:U,net_profit:H})}},onSuccess:()=>{x.invalidateQueries(["registrations"]),x.invalidateQueries(["course",t]),x.invalidateQueries(["courses"]),alert("儲存成功!"),l(null)}}),S=Ye({mutationFn:async T=>{const $={...T,course_id:t,form_id:w.id,registration_date:new Date().toISOString()};return await ee.entities.CourseRegistration.create($)},onSuccess:async T=>
771{if(y&&w){const $={};c==="standard"&&($.standard_enrolled=(y.standard_enrolled||0)+1),c==="early_bird"&&($.early_bird_enrolled=(y.early_bird_enrolled||0)+1),c==="late_bird"&&($.late_bird_enrolled=(y.late_bird_enrolled||0)+1),$.total_enrolled=(y.total_enrolled||0)+1;const D=m.payment_amount||(c==="standard"?y.standard_price:c==="early_bird"?y.early_bird_price:y.late_bird_price)||0;$.total_revenue=(y.total_revenue||0)+D,$.net_profit=$.total_revenue-(y.total_cost||0),await ee.entities.Course.update(y.id,$)}x.invalidateQueries(["registrations"]),x.invalidateQueries(["course",t]),x.invalidateQueries(["courses"]),alert("新增成功!"),d(!1),p({applicant_name:"",applicant_email:"",phone_number:"",mailing_address:"",company_school_name:"",title_department:"",company_tax_id:"",coding_experience:"",course_info_source:"",preferred_payment_method:"",pre_course_questions:"",remarks:"",admin_remarks:"",status:"pending",payment_status:"pending",payment_amount:0})}}),k=Ye({mutationFn:async T=>{const $=b.find(D=>D.id===T);if(await ee.entities.CourseRegistration.delete(T),y&&$){const D={};if($.form_id===(w==null?void 0:w.id)){c==="standard"&&(D.standard_enrolled=Math.max(0,(y.standard_enrolled||0)-1)),c==="early_bird"&&(D.early_bird_enrolled=Math.max(0,(y.early_bird_enrolled||0)-1)),c==="late_bird"&&(D.late_bird_enrolled=Math.max(0,(y.late_bird_enrolled||0)-1)),D.total_enrolled=Math.max(0,(y.total_enrolled||0)-1);const W=$.payment_amount||0;D.total_revenue=Math.max(0,(y.total_revenue||0)-W),D.net_profit=D.total_revenue-(y.total_cost||0),await ee.entities.Course.update(y.id,D)}}},onSuccess:()=>{x.invalidateQueries(["registrations"]),x.invalidateQueries(["course",t]),x.invalidateQueries(["courses"]),alert("刪除成功!")}}),C=()=>{if(_.length===0){alert("無資料可匯出");return}const T=["報名時間","姓名","Email","手機","通訊地址","公司/學校","職稱/系所","統一編號","程式經驗","資訊來源","付款方式","課前詢問","備註","狀態","管理者備註"],$=_.map(K=>[new Date(K.registration_date).toLocaleString(),K.applicant_name,K.applicant_email,K.phone_number,K.mailing_address||"",K.company_school_name||"",K.title_department||"",K.company_tax_id||"",K.coding_experience||"",K.course_info_source||"",K.preferred_payment_method||"",K.pre_course_questions||"",K.remarks||"",K.status==="confirmed"?"已確認":K.status==="cancelled"?"已取消":"待處理",K.admin_remarks||""].map(q=>`"${String(q).replace(/"/g,'""')}"`).join(",")),D="\uFEFF"+[T.join(","),...$].join(`
772`),W=new Blob([D],{type:"text/csv;charset=utf-8;"}),U=URL.createObjectURL(W),H=document.createElement("a");H.href=U,H.setAttribute("download",`${(y==null?void 0:y.course_name)||"Course"}_${c}_Registrations_${new Date().toISOString().slice(0,10)}.csv`),document.body.appendChild(H),H.click(),document.body.removeChild(H)},O=async T=>{const $=T.target.files[0];if($){if(!w){alert("請先建立此方案的報名表單");return}try{s(!0);const{file_url:D}=await ee.integrations.Core.UploadFile({file:$}),W=await ee.integrations.Core.ExtractDataFromUploadedFile({file_url:D,json_schema:{type:"array",items:{type:"object",properties:{applicant_name:{type:"string"},applicant_email:{type:"string"},phone_number:{type:"string"},company_school_name:{type:"string"}},required:["applicant_name","applicant_email","phone_number"]}}});if(W.status==="success"&&Array.isArray(W.output)){await Promise.all(W.output.map(V=>ee.entities.CourseRegistration.create({...V,course_id:t,form_id:w.id,registration_date:new Date().toISOString(),status:"pending",admin_remarks:"批量匯入"}))),x.invalidateQueries(["registrations"]);const U={},H=W.output.length;c==="standard"&&(U.standard_enrolled=(y.standard_enrolled||0)+H),c==="early_bird"&&(U.early_bird_enrolled=(y.early_bird_enrolled||0)+H),c==="late_bird"&&(U.late_bird_enrolled=(y.late_bird_enrolled||0)+H),U.total_enrolled=(y.total_enrolled||0)+H;const K=U.standard_enrolled||y.standard_enrolled||0,q=U.early_bird_enrolled||y.early_bird_enrolled||0,L=U.late_bird_enrolled||y.late_bird_enrolled||0;U.total_revenue=K*(y.standard_price||0)+q*(y.early_bird_price||0)+L*(y.late_bird_price||0),U.net_profit=U.total_revenue-(y.total_cost||0),await ee.entities.Course.update(y.id,U),x.invalidateQueries(["course",t]),x.invalidateQueries(["courses"]),alert(`成功匯入 ${H} 筆資料`)}else alert("匯入失敗或格式不符")}catch(D){console.error(D),alert("匯入發生錯誤")}finally{s(!1)}}},R=async T=>
772{if(!w)return;if(_.length===0){alert("沒有可寄送的對象");return}if(!confirm(`確定要寄送「${T==="commencement"?"開課通知":T==="reminder"?"上課提醒":"停開通知"}」給列表中的 ${_.length} 位報名者嗎?`))return;let $="",D="";if(T==="commencement"?($=w.commencement_email_subject,D=w.commencement_email_body):T==="reminder"?($=w.reminder_email_subject,D=w.reminder_email_body):T==="cancellation"&&($=w.cancellation_email_subject,D=w.cancellation_email_body),!$||!D){alert("請先至「編輯表單」設定信件內容");return}let W=0;for(const U of _){if(!U.applicant_email)continue;const H=$.replace("{{course_name}}",w.title),K=D.replace("{{applicant_name}}",U.applicant_name).replace("{{course_name}}",w.title);try{await ee.integrations.Core.SendEmail({to:U.applicant_email,subject:H,body:K}),W++}catch(q){console.error(q)}}alert(`發送完成,成功寄出 ${W} 封`)},A=w?`${window.location.origin}${Ur("PublicRegistration")}?formId=${w.id}`:"",P=c==="standard"?"標準價":c==="early_bird"?"早鳥價":"晚鳥價";return t?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[a.jsx(qi,{to:Ur("Courses"),children:a.jsxs(te,{variant:"ghost",className:"text-gray-400 hover:text-white",children:[a.jsx(zf,{className:"w-5 h-5 mr-2"}),"返回課程列表"]})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h1",{className:"text-2xl font-bold cyber-text",children:[y==null?void 0:y.course_name," - 報名管理"]}),a.jsxs("div",{className:"flex gap-4 text-sm text-gray-400 mt-1",children:[a.jsxs("span",{children:["總報名: ",(y==null?void 0:y.total_enrolled)||0]}),a.jsxs("span",{children:["標準: ",(y==null?void 0:y.standard_enrolled)||0]}),a.jsxs("span",{children:["早鳥: ",(y==null?void 0:y.early_bird_enrolled)||0]}),a.jsxs("span",{children:["晚鳥: ",(y==null?void 0:y.late_bird_enrolled)||0]})]})]})]}),a.jsxs(P8,{value:c,onValueChange:f,className:"space-y-6",children:[a.jsxs(Fk,{className:"bg-gray-900 border-gray-700",children:[a.jsx(fc,{value:"standard",className:"data-[state=active]:bg-[#00FFFF] data-[state=active]:text-black",children:"標準價方案"}),a.jsx(fc,{value:"early_bird",className:"data-[state=active]:bg-[#FFD700] data-[state=active]:text-black",children:"早鳥價方案"}),a.jsx(fc,{value:"late_bird",className:"data-[state=active]:bg-[#FF4444] data-[state=active]:text-white",children:"晚鳥價方案"})]}),a.jsxs(Rg,{value:c,className:"space-y-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 flex flex-col md:flex-row gap-4 justify-between items-center",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("h3",{className:"text-lg font-semibold text-white",children:[P,"表單設定"]}),w?a.jsxs("div",{className:"text-sm text-gray-400",children:[a.jsxs("p",{children:["狀態: ",a.jsx("span",{className:"text-green-400",children:"已啟用"})]}),a.jsxs("p",{className:"mt-1 flex items-center gap-2",children:["連結:",a.jsx("a",{href:A,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline truncate max-w-xs",children:A}),a.jsx(te,{size:"sm",variant:"ghost",onClick:()=>navigator.clipboard.writeText(A),className:"h-6 px-2 text-gray-400 hover:text-white",children:"複製"})]})]}):a.jsx("p",{className:"text-sm text-yellow-400",children:"尚未建立此方案的報名表單"})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(qi,{to:`${Ur("CourseRegistrationBuilder")}?courseId=${t}&formId=${(w==null?void 0:w.id)||""}&tier=${c}`,children:a.jsxs(te,{className:"bg-gray-800 text-white hover:bg-gray-700 border border-gray-600",children:[a.jsx(qt,{className:"w-4 h-4 mr-2"}),w?"編輯表單":"建立表單"]})}),w&&a.jsx("a",{href:A,target:"_blank",rel:"noreferrer",children:a.jsxs(te,{variant:"outline",className:"bg-gray-800 text-white hover:bg-gray-700 border border-gray-600",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"}),"預覽"]})}),w&&a.jsxs(te,{onClick:()=>d(!0),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"手動新增報名者"]})]})]}),w&&a.jsxs("div",{className:"flex gap-3 flex-wrap",children:[a.jsxs(te,{onClick:()=>R("commencement"),variant:"outline",className:"bg-blue-900 border-blue-700 text-blue-100 hover:bg-blue-800",children:[a.jsx(sc,{className:"w-4 h-4 mr-2"})," 寄發開課通知"]}),a.jsxs(te,{onClick:()=>R("reminder"),variant:"outline",className:"bg-yellow-900 border-yellow-700 text-yellow-100 hover:bg-yellow-800",children:[a.jsx(sc,{className:"w-4 h-4 mr-2"})," 寄發上課提醒"]}),a.jsxs(te,{onClick:()=>R("cancellation"),variant:"outline",className:"bg-red-900 border-red-700 text-red-100 hover:bg-red-800",children:[a.jsx(sc,{className:"w-4 h-4 mr-2"})," 寄發停開通知"]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("h2",{className:"text-xl font-bold text-white",children:[P,"報名者列表 (",_.length,")"]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("div",{className:"relative w-64",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}
772),a.jsx(ne,{placeholder:"搜尋姓名或Email...",value:r,onChange:T=>n(T.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(te,{variant:"outline",className:"bg-gray-800 text-white hover:bg-gray-700 border border-gray-600",onClick:C,disabled:_.length===0,children:[a.jsx(li,{className:"w-4 h-4 mr-2"}),"批量匯出"]}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"file",accept:".csv,.xlsx,.xls,.json",onChange:O,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:i||!w}),a.jsxs(te,{variant:"outline",className:"bg-gray-800 text-white hover:bg-gray-700 border border-gray-600",disabled:i||!w,children:[i?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),"批量匯入"]})]})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{className:"border-gray-700 hover:bg-transparent",children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"報名時間"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"姓名"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"Email"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"手機"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"公司/學校"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"付款方式"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"報名狀態"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"付款狀態"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"操作"})]})}),a.jsx(Jn,{children:_.length===0?a.jsx(Dt,{children:a.jsx(Me,{colSpan:9,className:"text-center text-gray-500 py-8",children:"尚無報名資料"})}):_.map(T=>a.jsxs(Dt,{className:"border-gray-700 hover:bg-gray-900",children:[a.jsx(Me,{className:"text-gray-300",children:new Date(T.registration_date).toLocaleString()}),a.jsx(Me,{className:"font-semibold text-white",children:T.applicant_name}),a.jsx(Me,{className:"text-gray-300",children:T.applicant_email}),a.jsx(Me,{className:"text-gray-300",children:T.phone_number}),a.jsx(Me,{className:"text-gray-300",children:T.company_school_name||"-"}),a.jsx(Me,{className:"text-gray-300",children:T.preferred_payment_method||"-"}),a.jsx(Me,{children:a.jsx("span",{className:`px-2 py-1 rounded text-xs ${T.status==="confirmed"?"bg-green-900 text-green-300":T.status==="cancelled"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300"}`,children:T.status==="confirmed"?"已確認":T.status==="cancelled"?"已取消":"待處理"})}),a.jsx(Me,{children:a.jsx("span",{className:`px-2 py-1 rounded text-xs ${T.payment_status==="paid"?"bg-green-900 text-green-300":T.payment_status==="refunded"?"bg-gray-900 text-gray-300":"bg-yellow-900 text-yellow-300"}`,children:T.payment_status==="paid"?"已付款":T.payment_status==="refunded"?"已退款":"待付款"})}),a.jsx(Me,{children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(te,{size:"sm",variant:"outline",onClick:()=>l(T),className:"bg-gray-800 text-white border-gray-600 hover:bg-gray-700",children:a.jsx(cr,{className:"w-4 h-4"})}),a.jsx(te,{size:"sm",variant:"outline",onClick:()=>{confirm("確認刪除?")&&k.mutate(T.id)},className:"bg-gray-800 text-white border-gray-600 hover:bg-gray-700 hover:text-red-300",children:a.jsx(Qt,{className:"w-4 h-4"})})]})})]},T.id))})]})})]})]})]}),h&&w&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full p-6 max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h2",{className:"text-xl font-bold text-white",children:"手動新增報名者"}),a.jsx("button",{onClick:()=>d(!1),className:"text-gray-400 hover:text-white",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"bg-blue-900/30 border border-blue-700 rounded p-4",children:a.jsxs("p",{className:"text-sm text-blue-200",children:[a.jsx("strong",{children:"課程:"}),y==null?void 0:y.course_name,a.jsx("br",{}),a.jsx("strong",{children:"價格方案:"}),c==="standard"?"標準價":c==="early_bird"?"早鳥價":"晚鳥價",a.jsx("br",{}),a.jsx("strong",{children:"費用:"}),"NT$ ",(E=c==="standard"?y==null?void 0:y.standard_price:c==="early_bird"?y==null?void 0:y.early_bird_price:y==null?void 0:y.late_bird_price)==null?void 0:E.toLocaleStr
772ing()]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-[#00FFFF] font-semibold border-b border-gray-700 pb-2",children:"基本資料"}),a.jsxs("div",{children:[a.jsx(Q,{children:"姓名 *"}),a.jsx(ne,{required:!0,value:m.applicant_name,onChange:T=>p({...m,applicant_name:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"Email *"}),a.jsx(ne,{required:!0,type:"email",value:m.applicant_email,onChange:T=>p({...m,applicant_email:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"手機 *"}),a.jsx(ne,{required:!0,value:m.phone_number,onChange:T=>p({...m,phone_number:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"通訊地址"}),a.jsx(ne,{value:m.mailing_address||"",onChange:T=>p({...m,mailing_address:T.target.value}),className:"bg-black border-gray-700"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-[#00FFFF] font-semibold border-b border-gray-700 pb-2",children:"單位資訊"}),a.jsxs("div",{children:[a.jsx(Q,{children:"公司/學校"}),a.jsx(ne,{value:m.company_school_name||"",onChange:T=>p({...m,company_school_name:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"職稱/系所"}),a.jsx(ne,{value:m.title_department||"",onChange:T=>p({...m,title_department:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"統一編號"}),a.jsx(ne,{value:m.company_tax_id||"",onChange:T=>p({...m,company_tax_id:T.target.value}),className:"bg-black border-gray-700"})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-[#00FFFF] font-semibold border-b border-gray-700 pb-2",children:"管理資訊"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Q,{children:"報名狀態"}),a.jsxs(qe,{value:m.status,onValueChange:T=>p({...m,status:T}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"pending",className:"text-white",children:"待處理"}),a.jsx(se,{value:"confirmed",className:"text-white",children:"已確認"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已取消"})]})]})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"付款狀態"}),a.jsxs(qe,{value:m.payment_status||"pending",onValueChange:T=>p({...m,payment_status:T}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"pending",className:"text-white",children:"待付款"}),a.jsx(se,{value:"paid",className:"text-white",children:"已付款"}),a.jsx(se,{value:"refunded",className:"text-white",children:"已退款"})]})]})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"應付金額"}),a.jsx(ne,{type:"number",value:m.payment_amount||(c==="standard"?y==null?void 0:y.standard_price:c==="early_bird"?y==null?void 0:y.early_bird_price:y==null?void 0:y.late_bird_price)||0,onChange:T=>p({...m,payment_amount:parseFloat(T.target.value)||0}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"管理者備註"}),a.jsx(ne,{value:m.admin_remarks||"",onChange:T=>p({...m,admin_remarks:T.target.value}),className:"bg-black border-gray-700"})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[a.jsx(te,{variant:"outline",onClick:()=>d(!1),className:"bg-gray-800 text-white border-gray-600",children:"取消"}),a.jsxs(te,{onClick:()=>{const T={...m,payment_amount:m.payment_amount||(c==="standard"?y==null?void 0:y.standard_price:c==="early_bird"?y==null?void 0:y.early_bird_price:y==null?void 0:y.late_bird_price)||0};S.mutate(T)},disabled:S.isPending||!m.applicant_name||!m.applicant_email||!m.phone_number,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Vd,{className:"w-4 h-4 mr-2"}),S.isPending?"新增中...":"新增報名者"]})]})]})]})}),o&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full p-6 max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h2",{className:"text-xl font-bold text-white",children:"報名資料詳情"}),a.jsx("button",{onClick:()=>l(null),className:"text-gray-400 hover:text-white",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-[#00FFFF] font-semibold border-b border-gray-700 pb-2",children:"基本資料"}),a.jsxs("div",{children:[a.jsx(Q,{children:"姓名"}),a.jsx(ne,{value:o.applicant_name,onChange:T=>l({...o,applicant_name:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"Email"}),a.jsx(ne,{value:o.applicant_email,onChange:T=>l({...o,applicant_email:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"手機"}),a.jsx(ne,{value:o.phone_number,onChange:T=>l({...o,phone_number:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"通訊地址"}),a.jsx(ne,{value:o.mailing_address||"",onChange:T=>l({...o,mailing_address:T.target.value}),className:"bg-black border-gray-700"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-[#00FFFF] font-semibold border-b border-gray-700 pb-2",children:"單位資訊"}),a.jsxs("div",{children:[a.jsx(Q,{children:"公司/學校"}
772),a.jsx(ne,{value:o.company_school_name||"",onChange:T=>l({...o,company_school_name:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"職稱/系所"}),a.jsx(ne,{value:o.title_department||"",onChange:T=>l({...o,title_department:T.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"統一編號"}),a.jsx(ne,{value:o.company_tax_id||"",onChange:T=>l({...o,company_tax_id:T.target.value}),className:"bg-black border-gray-700"})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-[#00FFFF] font-semibold border-b border-gray-700 pb-2",children:"其他資訊"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Q,{children:"程式語言經驗"}),a.jsx(ne,{value:o.coding_experience||"",readOnly:!0,className:"bg-gray-900 border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"課程資訊來源"}),a.jsx(ne,{value:o.course_info_source||"",readOnly:!0,className:"bg-gray-900 border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"希望付款方式"}),a.jsx(ne,{value:o.preferred_payment_method||"",readOnly:!0,className:"bg-gray-900 border-gray-700"})]})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"課前詢問"}),a.jsx(Pt,{value:o.pre_course_questions||"",readOnly:!0,className:"bg-gray-900 border-gray-700 h-20"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"報名備註"}),a.jsx(Pt,{value:o.remarks||"",readOnly:!0,className:"bg-gray-900 border-gray-700 h-20"})]})]}),a.jsxs("div",{className:"bg-gray-900 p-4 rounded border border-gray-700",children:[a.jsx("h3",{className:"text-[#00FFFF] font-semibold mb-4",children:"管理專區"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Q,{children:"報名狀態"}),a.jsxs(qe,{value:o.status,onValueChange:T=>l({...o,status:T}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"pending",className:"text-white",children:"待處理"}),a.jsx(se,{value:"confirmed",className:"text-white",children:"已確認"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已取消"})]})]})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"付款狀態"}),a.jsxs(qe,{value:o.payment_status||"pending",onValueChange:T=>l({...o,payment_status:T}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"pending",className:"text-white",children:"待付款"}),a.jsx(se,{value:"paid",className:"text-white",children:"已付款"}),a.jsx(se,{value:"refunded",className:"text-white",children:"已退款"})]})]})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"應付金額"}),a.jsx(ne,{type:"number",value:o.payment_amount||"",onChange:T=>l({...o,payment_amount:parseFloat(T.target.value)||0}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"管理者備註"}),a.jsx(ne,{value:o.admin_remarks||"",onChange:T=>l({...o,admin_remarks:T.target.value}),className:"bg-black border-gray-700"})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-2 mt-6",children:[a.jsx(te,{variant:"outline",onClick:()=>l(null),className:"bg-gray-800 text-white border-gray-600",children:"關閉"}),a.jsxs(te,{onClick:()=>N.mutate(o),disabled:N.isPending,className:"bg-gray-800 text-white hover:bg-gray-700 border border-gray-600",children:[a.jsx(Vd,{className:"w-4 h-4 mr-2"}),"儲存變更"]})]})]})]})})]}):a.jsx("div",{className:"p-8 text-center text-gray-400",children:"請選擇課程"})}function kve({costItems:e=[],onChange:t}){const[r,n]=I.useState(e),i=()=>{const c=[...r,{item_name:"",amount:0,notes:""}];n(c),t(c)},s=c=>{const f=r.filter((h,d)=>d!==c);n(f),t(f)},o=(c,f,h)=>{const d=[...r];d[c][f]=h,n(d),t(d)},l=r.reduce((c,f)=>c+(parseFloat(f.amount)||0),0);return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"成本管理"}),a.jsxs(te,{type:"button",onClick:i,size:"sm",className:"bg-[#00FFFF] text-black",children:[a.jsx(Ct,{className:"w-4 h-4 mr-1"})," 新增成本項目"]})]}),r.length>0?r.map((c,f)=>a.jsxs("div",{className:"grid grid-cols-12 gap-2 items-center bg-gray-900/50 p-3 rounded border border-gray-800",children:[a.jsx("div",{className:"col-span-5",children:a.jsx(ne,{placeholder:"成本項目(如:講師費、場地租金)",value:c.item_name,onChange:h=>o(f,"item_name",h.target.value),className:"bg-black border-gray-700"})}),a.jsx("div",{className:"col-span-2",children:a.jsx(ne,{type:"number",placeholder:"金額",value:c.amount,onChange:h=>o(f,"amount",parseFloat(h.target.value)||0),className:"bg-black border-gray-700"})}),a.jsx("div",{className:"col-span-4",children:a.jsx(ne,{placeholder:"備註",value:c.notes,onChange:h=>o(f,"notes",h.target.value),className:"bg-black border-gray-700"})}),a.jsx("div",{className:"col-span-1 text-right",children:a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>s(f),className:"text-red-500 hover:text-red-400",children:a.jsx(Qt,{className:"w-4 h-4"})})})]},f)):a.jsx("div",{className:"text-center py-8 text-gray-400 border border-gray-800 rounded",children:"尚無成本項目"}),a.jsx("div",{className:"flex justify-end pt-4 border-t border-gray-800",children:a.jsxs("div",{className:"text-xl font-bold text-red-400",children:["總成本:NT$ ",l.toLocaleStr
772ing()]})})]})}function Cve({course:e,onClose:t}){const[r,n]=I.useState({course_name:"",course_type:"online",standard_price:"",early_bird_price:"",late_bird_price:"",standard_enrolled:0,early_bird_enrolled:0,late_bird_enrolled:0,total_enrolled:0,enrollment_limit:"",location:"",cost_items:[],total_cost:0,start_date:"",end_date:"",instructor:"",description:"",status:"draft",total_revenue:0,net_profit:0,...e}),i=at();I.useEffect(()=>{const l=(r.standard_enrolled||0)+(r.early_bird_enrolled||0)+(r.late_bird_enrolled||0),c=(r.standard_enrolled||0)*(r.standard_price||0)+(r.early_bird_enrolled||0)*(r.early_bird_price||0)+(r.late_bird_enrolled||0)*(r.late_bird_price||0),f=(r.cost_items||[]).reduce((d,m)=>d+(parseFloat(m.amount)||0),0),h=c-f;n(d=>({...d,total_enrolled:l,total_revenue:c,total_cost:f,net_profit:h}))},[r.standard_enrolled,r.early_bird_enrolled,r.late_bird_enrolled,r.standard_price,r.early_bird_price,r.late_bird_price,r.cost_items]);const s=Ye({mutationFn:async l=>e?await ee.entities.Course.update(e.id,l):await ee.entities.Course.create(l),onSuccess:()=>{i.invalidateQueries(["courses"]),alert(e?"課程更新成功!":"課程新增成功!"),t()},onError:l=>{alert("儲存失敗:"+l.message)}}),o=l=>{l.preventDefault(),s.mutate(r)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-6xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯課程":"新增課程"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:o,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(Q,{children:"課程名稱 *"}),a.jsx(ne,{required:!0,value:r.course_name,onChange:l=>n({...r,course_name:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"課程類型 *"}),a.jsxs(qe,{value:r.course_type,onValueChange:l=>n({...r,course_type:l}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"online",className:"text-white",children:"線上直播課程"}),a.jsx(se,{value:"offline",className:"text-white",children:"實體課程"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"課程地點"}),a.jsx(ne,{value:r.location,onChange:l=>n({...r,location:l.target.value}),placeholder:r.course_type==="online"?"線上平台":"實體地址",className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"價格設定"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"課程定價(標準價)"}),a.jsx(ne,{type:"number",value:r.standard_price,onChange:l=>n({...r,standard_price:parseFloat(l.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"早鳥優惠價"}),a.jsx(ne,{type:"number",value:r.early_bird_price,onChange:l=>n({...r,early_bird_price:parseFloat(l.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"晚鳥優惠價"}),a.jsx(ne,{type:"number",value:r.late_bird_price,onChange:l=>n({...r,late_bird_price:parseFloat(l.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"報名人數追蹤"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"標準價報名人數"}),a.jsx(ne,{type:"number",value:r.standard_enrolled,onChange:l=>n({...r,standard_enrolled:parseInt(l.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"早鳥價報名人數"}),a.jsx(ne,{type:"number",value:r.early_bird_enrolled,onChange:l=>n({...r,early_bird_enrolled:parseInt(l.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"晚鳥價報名人數"}),a.jsx(ne,{type:"number",value:r.late_bird_enrolled,onChange:l=>n({...r,late_bird_enrolled:parseInt(l.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"總報名人數"}),a.jsx(ne,{type:"number",value:r.total_enrolled,readOnly:!0,className:"bg-gray-900 border-gray-700 text-[#00FFFF] font-semibold"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"人數上限"}),a.jsx(ne,{type:"number",value:r.enrollment_limit,onChange:l=>n({...r,enrollment_limit:parseInt(l.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsx(kve,{costItems:r.cost_items,onChange:l=>n({...r,cost_items:l})})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"開課日期"}),a.jsx(ne,{type:"date",value:r.start_date,onChange:l=>n({...r,start_date:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"結束日期"}),a.jsx(ne,{type:"date",value:r.end_date,onChange:l=>n({...r,end_date:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"æŽ
772ˆèª²è¬›å¸«"}),a.jsx(ne,{value:r.instructor,onChange:l=>n({...r,instructor:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"課程狀態"}),a.jsxs(qe,{value:r.status,onValueChange:l=>n({...r,status:l}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"draft",className:"text-white",children:"草稿"}),a.jsx(se,{value:"open",className:"text-white",children:"開放報名"}),a.jsx(se,{value:"full",className:"text-white",children:"已額滿"}),a.jsx(se,{value:"ongoing",className:"text-white",children:"進行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已取消"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"課程說明"}),a.jsx(Pt,{value:r.description,onChange:l=>n({...r,description:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-24"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"歷史報名紀錄連結"}),a.jsx(ne,{value:r.historical_registration_link||"",onChange:l=>n({...r,historical_registration_link:l.target.value}),className:"bg-black border-gray-700",placeholder:"https://docs.google.com/spreadsheets/..."}),a.jsx("p",{className:"text-xs text-gray-500",children:"可設定 Google Sheet 等歷史報名紀錄連結"})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 border border-[#00FFFF]/30",children:[a.jsxs("h3",{className:"text-md font-semibold text-[#00FFFF] mb-4 flex items-center gap-2",children:[a.jsx(ut,{className:"w-4 h-4"})," 課程財務預覽 (即時預覽)"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"bg-black/40 p-3 rounded border border-gray-800",children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"課程總收入 (Total Revenue)"}),a.jsxs("p",{className:"text-[#00FFFF] font-bold text-xl",children:["NT$ ",(r.total_revenue||0).toLocaleString()]})]}),a.jsxs("div",{className:"bg-black/40 p-3 rounded border border-gray-800",children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"總成本 (Total Cost)"}),a.jsxs("p",{className:"text-red-400 font-bold text-xl",children:["NT$ ",(r.total_cost||0).toLocaleString()]})]}),a.jsxs("div",{className:"bg-black/40 p-3 rounded border border-gray-800",children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"淨利潤 (Net Profit)"}),a.jsxs("p",{className:`font-bold text-xl ${r.net_profit>=0?"text-green-400":"text-red-500"}`,children:["NT$ ",(r.net_profit||0).toLocaleString()]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"( 總收入 - 總成本 )"})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-[#8B0000] text-white border-[#8B0000] hover:bg-[#660000]",children:"取消"}),a.jsx(te,{type:"submit",disabled:s.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:s.isPending?"儲存中...":"儲存"})]})]})]})})}function Fve({course:e}){(e.total_revenue||0)+(e.total_cost||0);const t=[{name:"課程預估收入",value:e.total_revenue||0,color:"#00FFFF"},{name:"總成本",value:e.total_cost||0,color:"#FF4444"},{name:"淨利潤",value:Math.max(0,e.net_profit||0),color:"#00FF00"}].filter(i=>i.value>0),r=(e.cost_items||[]).map((i,s)=>({name:i.item_name,value:i.amount||0,color:["#FFD700","#FF6347","#00FFFF","#9370DB","#32CD32"][s%5]})).filter(i=>i.value>0);r.reduce((i,s)=>i+s.value,0);const n=[{name:"標準價",value:e.standard_enrolled||0,color:"#FFD700"},{name:"早鳥價",value:e.early_bird_enrolled||0,color:"#00FFFF"},{name:"晚鳥價",value:e.late_bird_enrolled||0,color:"#FF6347"}].filter(i=>i.value>0);return a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[t.length>0&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"財務數據視覺化"}),a.jsx(En,{width:"100%",height:250,children:a.jsxs(Hs,{children:[a.jsx(ln,{data:t,cx:"50%",cy:"50%",labelLine:!1,label:({name:i,value:s,percent:o})=>`${i}
772: ${s.toLocaleString()} (${(o*100).toFixed(1)}%)`,outerRadius:70,fill:"#8884d8",dataKey:"value",style:{fontSize:"11px"},children:t.map((i,s)=>a.jsx(Ma,{fill:i.color},`cell-${s}`))}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF",borderRadius:"8px",color:"#FFFFFF"},itemStyle:{color:"#FFFFFF"},labelStyle:{color:"#FFFFFF"}})]})})]}),n.length>0&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"報名價格佔比"}),a.jsx(En,{width:"100%",height:250,children:a.jsxs(Hs,{children:[a.jsx(ln,{data:n,cx:"50%",cy:"50%",labelLine:!1,label:({name:i,value:s,percent:o})=>`${i}: ${s}人 (${(o*100).toFixed(1)}%)`,outerRadius:70,fill:"#8884d8",dataKey:"value",style:{fontSize:"11px"},children:n.map((i,s)=>a.jsx(Ma,{fill:i.color},`cell-${s}`))}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF",borderRadius:"8px",color:"#FFFFFF"},itemStyle:{color:"#FFFFFF"},labelStyle:{color:"#FFFFFF"}})]})})]}),r.length>0&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"成本結構百分比"}),a.jsx(En,{width:"100%",height:250,children:a.jsxs(Hs,{children:[a.jsx(ln,{data:r,cx:"50%",cy:"50%",labelLine:!1,label:({name:i,value:s,percent:o})=>`${i}: ${(o*100).toFixed(1)}%`,outerRadius:70,fill:"#8884d8",dataKey:"value",style:{fontSize:"11px"},children:r.map((i,s)=>a.jsx(Ma,{fill:i.color},`cell-${s}`))}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF",borderRadius:"8px",color:"#FFFFFF"},itemStyle:{color:"#FFFFFF"},labelStyle:{color:"#FFFFFF"},formatter:i=>`NT$ ${i.toLocaleString()}`})]})})]})]})}function Ove({course:e,onClose:t,onEdit:r}){const{data:n=[]}=Te({queryKey:["course_registrations",e.id],queryFn:()=>ee.entities.CourseRegistration.list()}),s=n.filter(c=>c.course_id===e.id).filter(c=>c.payment_status==="paid").reduce((c,f)=>c+(f.payment_amount||0),0),o=c=>({draft:"草稿",open:"開放報名",full:"已額滿",ongoing:"進行中",completed:"已完成",cancelled:"已取消"})[c]||c,l=e.enrollment_limit?(e.total_enrolled||0)/e.enrollment_limit*100:0;return e.total_revenue>0&&(e.net_profit||0)/e.total_revenue*100,a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"課程詳情"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",onClick:r,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(qt,{className:"w-4 h-4 mr-2"}),"編輯"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"課程名稱"}),a.jsx("p",{className:"text-2xl font-semibold cyber-text",children:e.course_name})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"課程類型"}),a.jsx("p",{className:"text-gray-200",children:e.course_type==="online"?"🌐 線上直播課程":"🏫 實體課程"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"狀態"}),a.jsx("p",{className:"text-gray-200",children:o(e.status)})]}),e.instructor&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"授課講師"}),a.jsx("p",{className:"text-gray-200",children:e.instructor})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"課程定價"}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("p",{className:"text-gray-300",children:["標準價:NT$ ",(e.standard_price||0).toLocaleStr
772ing()]}),a.jsxs("p",{className:"text-gray-300",children:["早鳥價:NT$ ",(e.early_bird_price||0).toLocaleString()]}),a.jsxs("p",{className:"text-gray-300",children:["晚鳥價:NT$ ",(e.late_bird_price||0).toLocaleString()]})]})]}),e.location&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"課程地點"}),a.jsxs("p",{className:"text-gray-200 flex items-center gap-2",children:[a.jsx(Uo,{className:"w-4 h-4"}),e.location]})]}),e.start_date&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"開課日期"}),a.jsx("p",{className:"text-gray-200",children:e.start_date})]}),e.end_date&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"結束日期"}),a.jsx("p",{className:"text-gray-200",children:e.end_date})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 space-y-4",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text flex items-center gap-2",children:[a.jsx(Xr,{className:"w-5 h-5"}),"報名狀況"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"報名統計"}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("p",{className:"text-gray-300",children:["標準價:",e.standard_enrolled||0," 人"]}),a.jsxs("p",{className:"text-gray-300",children:["早鳥價:",e.early_bird_enrolled||0," 人"]}),a.jsxs("p",{className:"text-gray-300",children:["晚鳥價:",e.late_bird_enrolled||0," 人"]}),a.jsxs("p",{className:"text-xl font-semibold cyber-text mt-2",children:["總報名:",e.total_enrolled||0," / ",e.enrollment_limit||"無限制"]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-400",children:"報名率"}),a.jsxs("span",{className:"cyber-text font-semibold",children:[l.toFixed(1),"%"]})]}),a.jsx("div",{className:"w-full bg-gray-800 rounded-full h-3 overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${l}%`,background:l>=100?"linear-gradient(90deg, #FFD700 0%, #FFA500 100%)":"linear-gradient(90deg, #00FFFF 0%, #0088FF 100%)",boxShadow:l>=100?"0 0 15px rgba(255, 215, 0, 0.5)":"0 0 15px rgba(0, 255, 255, 0.5)"}})})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 space-y-4",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text flex items-center gap-2",children:[a.jsx(ut,{className:"w-5 h-5"}),"財務資訊"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"總收入"}),a.jsxs("p",{className:"text-2xl font-bold text-[#00FFFF]",children:["NT$ ",s.toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"總成本"}),a.jsxs("p",{className:"text-2xl font-bold text-red-400",children:["NT$ ",(e.total_cost||0).toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"淨利潤"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",(s-(e.total_cost||0)).toLocaleString()]}),a.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[a.jsx(sl,{className:"w-3 h-3 text-green-400"}),a.jsxs("span",{className:"text-xs text-green-400",children:["利潤率 ",s>0?((s-(e.total_cost||0))/s*100).toFixed(1):0,"%"]})]})]})]}),e.cost_items&&e.cost_items.length>0&&a.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-700",children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-400 mb-2",children:"成本明細"}),a.jsx("div",{className:"space-y-2",children:e.cost_items.map((c,f)=>a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-400",children:c.item_name}),a.jsxs("span",{className:"text-gray-300",children:["NT$ ",(c.amount||0).toLocaleString()]})]},f))})]})]}),a.jsx(Fve,{course:e}),e.description&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-3",children:"課程說明"}),a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.description})]}),e.historical_registration_link&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-3",children:"歷史報名紀錄"}),a.jsxs("a",{href:e.historical_registration_link,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline flex items-center gap-2",children:[a.jsx(il,{className:"w-4 h-4"}),"查看歷史報名紀錄(新視窗開啟)"]})]})]})]})})}
772function Eve(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState(""),[c,f]=I.useState("all"),[h,d]=I.useState("all"),[m,p]=I.useState(""),[x,y]=I.useState("");at();const{data:v=[],isLoading:b}=Te({queryKey:["courses"],queryFn:()=>ee.entities.Course.list("-created_date")}),{data:w=[]}=Te({queryKey:["course_registrations"],queryFn:()=>ee.entities.CourseRegistration.list()}),_=v.filter(A=>{var D,W;const P=c==="all"||A.course_type===c,E=h==="all"||A.status===h,T=!o||((D=A.course_name)==null?void 0:D.toLowerCase().includes(o.toLowerCase()))||((W=A.instructor)==null?void 0:W.toLowerCase().includes(o.toLowerCase())),$=(!m||!A.start_date||A.start_date>=m)&&(!x||!A.start_date||A.start_date<=x);return P&&E&&T&&$}),N=w.filter(A=>A.payment_status==="paid").reduce((A,P)=>A+(P.payment_amount||0),0),S=v.reduce((A,P)=>A+(P.total_cost||0),0),k=N-S,C=v.filter(A=>A.status==="ongoing"||A.status==="open").length,O=A=>{const P={draft:{label:"草稿",color:"#808080"},open:{label:"開放報名",color:"#00FFFF"},full:{label:"已額滿",color:"#FFD700"},ongoing:{label:"進行中",color:"#00FF00"},completed:{label:"已完成",color:"#0088FF"},cancelled:{label:"已取消",color:"#FF4444"}},E=P[A]||P.draft;return a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:E.color+"33",color:E.color,border:`1px solid ${E.color}`},children:E.label})},R=A=>A==="online"?"🌐":"🏫";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(rp,{className:"w-8 h-8 cyber-text"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"課程專案管理"})]}),a.jsx("div",{className:"flex gap-2",children:a.jsxs(te,{onClick:()=>{s(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增課程"]})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(ut,{className:"w-8 h-8 text-[#00FFFF]"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"總收入"}),a.jsxs("p",{className:"text-2xl font-bold cyber-text",children:["NT$ ",N.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(ut,{className:"w-8 h-8 text-yellow-400"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"總成本"}),a.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["NT$ ",S.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(sl,{className:"w-8 h-8 text-green-400"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"淨利潤"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",k.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(rp,{className:"w-8 h-8 text-purple-400"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"進行中課程"}),a.jsx("p",{className:"text-2xl font-bold text-purple-400",children:C})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-6 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋課程名稱、講師...",value:o,onChange:A=>l(A.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(qe,{value:c,onValueChange:f,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"課程類型"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有類型"}),a.jsx(se,{value:"online",className:"text-white",children:"線上直播課程"}),a.jsx(se,{value:"offline",className:"text-white",children:"實體課程"})]})]}),a.jsxs(qe,{value:h,onValueChange:d,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"狀態篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有狀態"}),a.jsx(se,{value:"open",className:"text-white",children:"開放報名"}),a.jsx(se,{value:"ongoing",className:"text-white",children:"進行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"}),a.jsx(se,{value:"full",className:"text-white",children:"已額滿"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"停開"})]})]}),a.jsx(ne,{type:"date",placeholder:"開始日期",value:m,onChange:A=>p(A.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]"}),a.jsx(ne,{type:"date",placeholder:"結束日期",value:x,onChange:A=>y(A.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]"}),a.jsx(te,{variant:"outline",onClick:()=>{l(""),f("all"),d("all"),p(""),y("")},className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"清除篩選"})]})}),a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:b?a.jsx("div",{className:"col-span-2 text-center py-12 text-gray-400",children:"載入中..."}):_.length===0?a.jsxs("div",{className:"col-span-2 text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(rp,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無課程資料"})]}):_.map(A=>{const P=A.enrollment_limit>0?A.total_enrolled/A.enrollment_limit*100:0;return a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex items-start justify-between",children:a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("span",{className:"text-2xl",children:R(A.course_type)}),a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:A.course_name})]}),a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[O(A.status),a.jsx("span",{className:"text-sm text-gray-400",children:A.course_type==="online"?"線上直播課程":"實體課程"})]})]})}),a.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx(ut,{className:"w-4 h-4 text-[#00FFFF]"}),a.jsxs("span",{children:["費用:NT$ ",(A.course_fee||0).toLocaleStr
772ing()]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[a.jsx(Xr,{className:"w-4 h-4 text-[#00FFFF]"}),a.jsxs("span",{children:["報名:",A.total_enrolled||0," / ",A.enrollment_limit||0]})]}),A.location&&a.jsxs("div",{className:"flex items-center gap-2 text-gray-300 col-span-2",children:[a.jsx(Uo,{className:"w-4 h-4 text-[#00FFFF]"}),a.jsx("span",{children:A.location})]}),A.instructor&&a.jsxs("div",{className:"text-gray-300 col-span-2",children:["講師:",A.instructor]})]}),A.enrollment_limit>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"text-gray-400",children:"報名進度"}),a.jsxs("span",{className:"cyber-text",children:[P.toFixed(0),"%"]})]}),a.jsx("div",{className:"w-full bg-gray-800 rounded-full h-2 overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${P}%`,background:P>=100?"linear-gradient(90deg, #FFD700 0%, #FFA500 100%)":"linear-gradient(90deg, #00FFFF 0%, #0088FF 100%)",boxShadow:P>=100?"0 0 10px rgba(255, 215, 0, 0.5)":"0 0 10px rgba(0, 255, 255, 0.5)"}})})]}),a.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>n(A),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF] flex-1",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"詳情"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{s(A),t(!0)},className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:a.jsx(qt,{className:"w-4 h-4"})}),a.jsx(qi,{to:`${Ur("CourseRegistrationManagement")}?courseId=${A.id}`,children:a.jsx(te,{variant:"outline",size:"sm",className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:"報名管理"})})]})]})},A.id)})}),e&&a.jsx(Cve,{course:i,onClose:()=>{t(!1),s(null)}}),r&&!e&&a.jsx(Ove,{course:r,onClose:()=>n(null),onEdit:()=>{s(r),t(!0),n(null)}})]})}function Pve({customer:e,onClose:t}){const[r,n]=I.useState({customer_name:"",customer_code:"",contact_person:"",email:"",phone:"",address:"",tax_id:"",notes:"",...e}),[i,s]=I.useState(!1),o=at(),l=Ye({mutationFn:h=>e?ee.entities.Customer.update(e.id,h):ee.entities.Customer.create(h),onSuccess:()=>{o.invalidateQueries(["customers"]),alert("儲存成功!"),t()}}),c=async h=>{const d=h.target.files[0];if(d)try{s(!0);const{file_url:m}=await ee.integrations.Core.UploadFile({file:d}),p=await ee.integrations.Core.ExtractDataFromUploadedFile({file_url:m,json_schema:{type:"object",properties:{company_name:{type:"string",description:"公司名稱"},contact_person:{type:"string",description:"聯絡人姓名"},email:{type:"string",description:"Email信箱"},phone:{type:"string",description:"電話號碼"},tax_id:{type:"string",description:"統一編號"},address:{type:"string",description:"地址"}}}});p.status==="success"&&p.output&&(n(x=>({...x,customer_name:p.output.company_name||x.customer_name,contact_person:p.output.contact_person||x.contact_person,email:p.output.email||x.email,phone:p.output.phone||x.phone,tax_id:p.output.tax_id||x.tax_id,address:p.output.address||x.address})),alert("✅ 名片資訊已自動填入!"))}catch(m){console.error("Business card OCR error:",m),alert("名片識別失敗,請手動輸入")}finally{s(!1)}},f=h=>{h.preventDefault(),l.mutate(r)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯客戶資訊":"新增客戶"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:f,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"名片上傳(自動識別)"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("input",{type:"file",accept:"image/*",onChange:c,className:"hidden",id:"business-card-upload",disabled:i}),a.jsxs("label",{htmlFor:"business-card-upload",className:`flex items-center gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-700 rounded cursor-pointer border border-gray-600 ${i?"opacity-50 cursor-not-allowed":""}`,children:[i?a.jsx(Ht,{className:"w-4 h-4 animate-spin"}):a.jsx(Hr,{className:"w-4 h-4"}),i?"識別中...":"上傳名片"]}),a.jsx("span",{className:"text-xs text-gray-500",children:"支援 JPG、PNG 格式,系統將自動識別並填入資料"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶名稱 *"}),a.jsx(ne,{required:!0,value:r.customer_name,onChange:h=>n({...r,customer_name:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶編號"}),a.jsx(ne,{value:r.customer_code,onChange:h=>n({...r,customer_code:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"聯絡人"}),a.jsx(ne,{value:r.contact_person,onChange:h=>n({...r,contact_person:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Email"}),a.jsx(ne,{type:"email",value:r.email,onChange:h=>n({...r,email:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"聯絡電話"}),a.jsx(ne,{value:r.phone,onChange:h=>n({...r,phone:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"統一編號"}),a.jsx(ne,{value:r.tax_id,onChange:h=>n({...r,tax_id:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"地址"}),a.jsx(ne,{value:r.address,onChange:h=>n({...r,address:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:r.notes,onChange:h=>n({...r,notes:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-24"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-red-900 text-white hover:bg-red-800 border-red-700",children:"取消"}),a.jsx(te,{type:"submit",disabled:l.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:l.isPending?"儲存中...":"儲存"})]})]})]})})}
772function Tve(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState("");at();const{data:o=[],isLoading:l}=Te({queryKey:["customers"],queryFn:()=>ee.entities.Customer.list("-created_date")}),c=o.filter(f=>{var h,d,m;return!i||((h=f.customer_name)==null?void 0:h.toLowerCase().includes(i.toLowerCase()))||((d=f.customer_code)==null?void 0:d.toLowerCase().includes(i.toLowerCase()))||((m=f.email)==null?void 0:m.toLowerCase().includes(i.toLowerCase()))});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"客戶管理"}),a.jsxs(te,{onClick:()=>{n(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增客戶"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"relative max-w-md",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋客戶名稱、編號、Email...",value:i,onChange:f=>s(f.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]})}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden",children:l?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):c.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Xr,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無客戶資料"})]}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{className:"border-gray-700 hover:bg-transparent",children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"客戶編號"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"客戶名稱"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"聯絡人"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"Email"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"聯絡電話"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"地址"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"操作"})]})}),a.jsx(Jn,{children:c.map(f=>a.jsxs(Dt,{className:"border-gray-700 hover:bg-gray-900",children:[a.jsx(Me,{className:"font-mono text-gray-300",children:f.customer_code||"-"}),a.jsx(Me,{className:"font-semibold cyber-text",children:f.customer_name}),a.jsx(Me,{className:"text-gray-300",children:f.contact_person||"-"}),a.jsx(Me,{className:"text-gray-300",children:f.email||"-"}),a.jsx(Me,{className:"text-gray-300",children:f.phone||"-"}),a.jsx(Me,{className:"text-gray-300",children:f.address||"-"}),a.jsx(Me,{children:a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>{n(f),t(!0)},className:"border-gray-600 hover:bg-gray-800 text-black",children:[a.jsx(qt,{className:"w-4 h-4 mr-1"}),"編輯"]})})]},f.id))})]})})}),e&&a.jsx(Pve,{customer:r,onClose:()=>{t(!1),n(null)}})]})}function Ave(){return a.jsx(Kg,{requiredRole:"admin",children:a.jsx(Rve,{})})}function Rve(){const[e,t]=I.useState(""),[r,n]=I.useState(""),[i,s]=I.useState("all"),{data:o=[]}=Te({queryKey:["software_invoices"],queryFn:()=>ee.entities.SoftwareInvoice.list()}),{data:l=[]}=Te({queryKey:["course_invoices"],queryFn:()=>ee.entities.CourseInvoice.list()}),{data:c=[]}=Te({queryKey:["course_registrations"],queryFn:()=>ee.entities.CourseRegistration.list()}),f=(T,$)=>T.filter(D=>{const W=D[$];if(!W)return!1;const H=new Date(W).getFullYear().toString();return!(i!=="all"&&H!==i||e&&new Date(W)<new Date(e)||r&&new Date(W)>new Date(r))}),h=f(o,"invoice_date"),d=f(l,"invoice_date"),m=f(c,"registration_date"),p=h.reduce((T,$)=>T+($.invoice_amount||0),0),x=h.reduce((T,$)=>T+($.received_amount||0),0),y=h.reduce((T,$)=>T+($.outstanding_amount||0),0),v=d.reduce((T,$)=>T+($.invoice_amount||0),0),b=d.reduce((T,$)=>T+($.received_amount||0),0),w=d.reduce((T,$)=>T+($.outstanding_amount||0),0),_=m.filter(T=>T.payment_status==="paid").reduce((T,$)=>T+($.payment_amount||0),0),N=m.filter(T=>T.payment_status==="pending").reduce((T,$)=>T+($.payment_amount||0),0),{data:S=[]}=Te({queryKey:["online_course_sales"],queryFn:()=>ee.entities.OnlineCourseSale.list()}),k=f(S,"purchase_date"),C=k.filter(T=>T.payment_status==="completed").reduce((T,$)=>T+($.purchase_amount||0),0),O=x+b+_+C,R=y+w+N,A=O+R,P=[...new Set([...h.map(T=>T.invoice_date?new Date(T.invoice_date).getFullYear():null),...d.map(T=>T.invoice_date?new Date(T.invoice_date).getFullYear():null),...m.map(T=>T.registration_date?new Date(T.registration_date).getFullYear():null)].filter(
772Boolean))].sort((T,$)=>$-T),E=({title:T,value:$,icon:D,color:W,trend:U})=>a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-3 rounded-lg bg-opacity-20",style:{backgroundColor:W+"33"},children:a.jsx(D,{className:"w-6 h-6",style:{color:W}})}),U&&a.jsxs("div",{className:"flex items-center gap-1 text-sm",style:{color:W},children:[a.jsx(sl,{className:"w-4 h-4"}),a.jsx("span",{children:U})]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:T}),a.jsx("p",{className:"text-3xl font-bold cyber-text",children:$})]})]});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"系統儀表板"}),a.jsx("div",{className:"text-sm text-gray-400",children:new Date().toLocaleDateString("zh-TW",{year:"numeric",month:"long",day:"numeric"})})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"flex flex-wrap gap-4 items-center",children:[a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("span",{className:"text-gray-400 text-sm",children:"時間篩選:"})}),a.jsxs("div",{className:"flex gap-2 items-center",children:[a.jsx(ne,{type:"date",value:e,onChange:T=>t(T.target.value),placeholder:"開始日期",className:"bg-black border-gray-700 w-40"}),a.jsx("span",{className:"text-gray-400",children:"-"}),a.jsx(ne,{type:"date",value:r,onChange:T=>n(T.target.value),placeholder:"結束日期",className:"bg-black border-gray-700 w-40"})]}),a.jsxs("div",{className:"flex gap-2 items-center",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:"年度:"}),a.jsxs("select",{value:i,onChange:T=>s(T.target.value),className:"bg-black border border-gray-700 rounded px-3 py-2 text-white",children:[a.jsx("option",{value:"all",children:"全部年度"}),P.map(T=>a.jsxs("option",{value:T.toString(),children:[T,"年"]},T))]})]}),a.jsx(te,{variant:"outline",onClick:()=>{t(""),n(""),s("all")},className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:"重置篩選"})]})}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 bg-gradient-to-br from-purple-900/10 to-blue-900/10",children:[a.jsx("h2",{className:"text-xl font-semibold mb-6 cyber-text",children:"公司財務總覽看板"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 bg-gradient-to-br from-blue-900/20 to-purple-900/20",children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"軟體專案請款已收款"}),a.jsxs("p",{className:"text-2xl font-bold text-blue-400",children:["NT$ ",x.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 bg-gradient-to-br from-green-900/20 to-emerald-900/20",children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"企業培訓專案請款已收款"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",b.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 bg-gradient-to-br from-cyan-900/20 to-teal-900/20",children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"課程收款管理已付款"}),a.jsxs("p",{className:"text-2xl font-bold text-cyan-400",children:["NT$ ",_.toLocaleString()]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 bg-gradient-to-br from-yellow-900/20 to-orange-900/20 border-2 border-[#FFD700]",children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"公司總收入"}),a.jsxs("p",{className:"text-3xl font-bold text-[#FFD700]",children:["NT$ ",O.toLocaleString()]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"所有業務線已收款總額(含線上課程銷售)"})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 bg-gradient-to-br from-orange-900/20 to-red-900/20 border-2 border-[#FF8C00]",children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"公司應收帳款"}),a.jsxs("p",{className:"text-3xl font-bold text-[#FF8C00]",children:["NT$ ",A.toLocaleStr
772ing()]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"總收入 + 未收帳款"})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 bg-gradient-to-br from-red-900/20 to-pink-900/20 border-2 border-[#FF4444]",children:[a.jsx("p",{className:"text-gray-400 text-sm mb-1",children:"公司未收款看板"}),a.jsxs("p",{className:"text-3xl font-bold text-[#FF4444]",children:["NT$ ",R.toLocaleString()]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"所有業務線未收總額(含線上課程銷售)"})]})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-4 cyber-text",children:"軟體專案財務總覽"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsx(E,{title:"已請款金額",value:`NT$ ${p.toLocaleString()}`,icon:ut,color:"#00FFFF"}),a.jsx(E,{title:"已收款金額",value:`NT$ ${x.toLocaleString()}`,icon:ut,color:"#00FF00"}),a.jsx(E,{title:"未收款金額",value:`NT$ ${y.toLocaleString()}`,icon:ut,color:"#FF4444"}),a.jsx(E,{title:"請款單數",value:h.length,icon:Et,color:"#FFD700"})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-4 cyber-text",children:"課程專案財務總覽"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx(E,{title:"已請款金額",value:`NT$ ${v.toLocaleString()}`,icon:ut,color:"#00FFFF"}),a.jsx(E,{title:"已收款金額",value:`NT$ ${b.toLocaleString()}`,icon:ut,color:"#00FF00"}),a.jsx(E,{title:"未收款金額",value:`NT$ ${w.toLocaleString()}`,icon:ut,color:"#FF4444"})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-4 cyber-text",children:"課程專案收款管理總覽"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsx(E,{title:"總報名人數",value:m.length,icon:Xr,color:"#00FFFF"}),a.jsx(E,{title:"待付款",value:`NT$ ${N.toLocaleString()}`,icon:ut,color:"#FFD700"}),a.jsx(E,{title:"已付款",value:`NT$ ${_.toLocaleString()}`,icon:ut,color:"#00FF00"}),a.jsx(E,{title:"待收金額",value:`NT$ ${N.toLocaleString()}`,icon:ut,color:"#FF4444"})]})]}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-semibold mb-4 cyber-text",children:"線上課程銷售管理財務資訊"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx(E,{title:"總銷售筆數",value:k.length,icon:Xr,color:"#9370DB"}),a.jsx(E,{title:"已完成銷售",value:k.filter(T=>T.payment_status==="completed").length,icon:ut,color:"#00FF00"}),a.jsx(E,{title:"銷售總額",value:`NT$ ${C.toLocaleString()}`,icon:ut,color:"#FFD700"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 cyber-text",children:"業務線收款對比"}),a.jsx(En,{width:"100%",height:300,children:a.jsxs(oh,{data:[{name:"軟體專案",已收款:x,未收款:y},{name:"企業培訓",已收款:b,未收款:w},{name:"課程收款",已收款:_,未收款:N},{name:"線上課程",已收款:C,未收款:0}],children:[a.jsx(el,{strokeDasharray:"3 3",stroke:"#333"}),a.jsx(fi,{dataKey:"name",stroke:"#00FFFF"}),a.jsx(hi,{stroke:"#00FFFF"}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF",borderRadius:"8px",color:"#FFFFFF"},itemStyle:{color:"#FFFFFF"},labelStyle:{color:"#FFFFFF"}}),a.jsx(zi,{}),a.jsx(Qn,{dataKey:"已收款",fill:"#00FF00",radius:[8,8,0,0]}),a.jsx(Qn,{dataKey:"未收款",fill:"#FF4444",radius:[8,8,0,0]})]})})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 cyber-text",children:"公司收款狀態分布"}),a.jsx(En,{width:"100%",height:300,children:a.jsxs(Hs,{children:[a.jsx(ln,{data:[{name:"已收款",value:O,color:"#00FF00"},{name:"未收款",value:R,color:"#FF4444"}],cx:"50%",cy:"50%",labelLine:!1,label:({name:T,value:$,percent:D})=>`${T}: NT$ ${$.toLocaleString()} (${(D*100).toFixed(1)}%)`,outerRadius:80,fill:"#8884d8",dataKey:"value",children:[{color:"#00FF00"},{color:"#FF4444"}].map((T,$)=>a.jsx(Ma,{fill:T.color},`cell-${$}`))}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF",borderRadius:"8px",color:"#FFFFFF"},itemStyle:{color:"#FFFFFF"},labelStyle:{color:"#FFFFFF"}})]})})]})]})]})}function Ive({signature:e,contracts:t,onClose:r}){const[n,i]=I.useState({contract_id:"",contract_number:"",project_name:"",workflow_type:"sequential",signers:(e==null?void 0:e.signers)||[{signer_name:"",signer_email:"",signer_role:"甲方",signing_order:1,status:"pending",signature_fields:[]}],status:"draft",audit_trail:(e==null?void 0:e.audit_trail)||[],...e}),s=at(),o=(y,v)=>({timestamp:new Date().toISOString(),action:y,actor:n.created_by||"System",details:v,ip_address:"N/A"}),l=Ye({mutationFn:y=>{const v={...y,audit_trail:[...y.audit_trail||[],o(e?"UPDATE":"CREATE",e?"更新簽約請求":"建立簽約請求")]};return e?ee.entities.ESignature.update(e.id,v):ee.entities.ESignature.create(v)},onSuccess:()=>{s.invalidateQueries(["esignatures"]),alert("儲存成功!"),r()}}),c=Ye({mutationFn:async y=>{const v=y.signers.map((N,S)=>({...N,status:y.workflow_type==="sequential"&&S>0?"pending":"sent"})),b={...y,signers:v,status:"in_progress",audit_trail:[...y.audit_trail||[],o("SEND",`發送簽約邀請給 ${y.signers.length}
772 位簽署人`)]},w=e?await ee.entities.ESignature.update(e.id,b):await ee.entities.ESignature.create(b),_=y.workflow_type==="sequential"?[y.signers[0]]:y.signers;for(const N of _)await ee.integrations.Core.SendEmail({to:N.signer_email,subject:`【線上簽約通知】${y.project_name}`,body:`親愛的 ${N.signer_name},
773
774您有一份合約需要進行線上簽署。
775
776合約編號:${y.contract_number}
777專案名稱:${y.project_name}
778簽署角色:${N.signer_role}
779${y.workflow_type==="sequential"?`簽署順序:第 ${N.signing_order} 位`:""}
780
781請點擊以下連結完成簽署:
782${window.location.origin}/OnlineSign?id=${w.id}&signer=${encodeURIComponent(N.signer_email)}
783
784此連結僅供您本人使用,請妥善保管。
785
786謝謝!`});return w},onSuccess:()=>{s.invalidateQueries(["esignatures"]),r(),alert("✅ 簽約邀請已成功發送!")}}),f=y=>{const v=t.find(b=>b.id===y);v&&i(b=>({...b,contract_id:y,contract_number:v.contract_number,project_name:v.project_name}))},h=y=>{y.preventDefault(),l.mutate(n)},d=()=>{i({...n,signers:[...n.signers,{signer_name:"",signer_email:"",signer_role:"乙方",signing_order:n.signers.length+1,status:"pending",signature_fields:[]}]})},m=y=>{const v=n.signers.filter((b,w)=>w!==y);i({...n,signers:v.map((b,w)=>({...b,signing_order:w+1}))})},p=(y,v,b)=>{const w=[...n.signers];w[y][v]=b,i({...n,signers:w})},x=()=>{if(!n.contract_id){alert("請選擇合約");return}if(n.signers.some(y=>!y.signer_email||!y.signer_name)){alert("請填寫所有簽署人的完整資訊");return}c.mutate(n)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-3xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯簽約請求":"新增簽約請求"}),a.jsx("button",{onClick:r,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:h,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"選擇合約 *"}),a.jsxs(qe,{value:n.contract_id,onValueChange:f,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇合約"})}),a.jsx($e,{className:"bg-black border-gray-700",children:t.map(y=>a.jsxs(se,{value:y.id,className:"text-white",children:[y.contract_number," - ",y.project_name]},y.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"簽署流程類型"}),a.jsxs(qe,{value:n.workflow_type,onValueChange:y=>i({...n,workflow_type:y}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"sequential",className:"text-white",children:"依序簽署(按順序一個接一個)"}),a.jsx(se,{value:"parallel",className:"text-white",children:"並行簽署(所有人同時收到)"})]})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text flex items-center gap-2",children:[a.jsx(Uf,{className:"w-5 h-5"}),"簽署人設定 (",n.signers.length,")"]}),a.jsxs(te,{type:"button",onClick:d,size:"sm",className:"bg-green-900 text-white hover:bg-green-800",children:[a.jsx(Ct,{className:"w-4 h-4 mr-1"}),"新增簽署人"]})]}),n.signers.map((y,v)=>a.jsxs("div",{className:"border border-gray-700 rounded-lg p-4 space-y-3 bg-gray-900/50",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-semibold text-[#00FFFF]",children:["簽署人 #",v+1," ",n.workflow_type==="sequential"&&`(第 ${y.signing_order} 順位)`]}),n.signers.length>1&&a.jsx(te,{type:"button",onClick:()=>m(v),size:"sm",variant:"ghost",className:"text-red-500 hover:bg-red-900",children:a.jsx(Qt,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx(Q,{className:"text-xs",children:"姓名 *"}),a.jsx(ne,{required:!0,value:y.signer_name,onChange:b=>p(v,"signer_name",b.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]",placeholder:"簽署ä
786ººå§“名"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Q,{className:"text-xs",children:"Email *"}),a.jsx(ne,{type:"email",required:!0,value:y.signer_email,onChange:b=>p(v,"signer_email",b.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]",placeholder:"[email protected]"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx(Q,{className:"text-xs",children:"角色"}),a.jsxs(qe,{value:y.signer_role,onValueChange:b=>p(v,"signer_role",b),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"甲方",className:"text-white",children:"甲方"}),a.jsx(se,{value:"乙方",className:"text-white",children:"乙方"}),a.jsx(se,{value:"丙方",className:"text-white",children:"丙方"}),a.jsx(se,{value:"見證人",className:"text-white",children:"見證人"}),a.jsx(se,{value:"法定代理人",className:"text-white",children:"法定代理人"})]})]})]}),n.workflow_type==="sequential"&&a.jsxs("div",{className:"space-y-1",children:[a.jsx(Q,{className:"text-xs",children:"簽署順序"}),a.jsx(ne,{type:"number",min:"1",value:y.signing_order,onChange:b=>p(v,"signing_order",parseInt(b.target.value)),className:"bg-black border-gray-700"})]})]})]},v))]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:r,className:"bg-[#8B0000] text-white border-[#8B0000] hover:bg-[#660000]",children:"取消"}),a.jsx(te,{type:"submit",disabled:l.isPending,className:"bg-gray-700 text-white hover:bg-gray-600",children:"儲存草稿"}),a.jsxs(te,{type:"button",onClick:x,disabled:c.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Wi,{className:"w-4 h-4 mr-2"}),c.isPending?"發送中...":"立即發送"]})]})]})]})})}function Mve({signature:e,onClose:t}){var m,p,x;const[r,n]=I.useState(!1),[i,s]=I.useState(!1),{data:o}=Te({queryKey:["contract",e.contract_id],queryFn:async()=>(await ee.entities.Contract.list()).find(v=>v.id===e.contract_id),enabled:!!e.contract_id}),l=y=>
786({draft:"草稿",pending:"待簽署",in_progress:"簽署中",completed:"已完成",rejected:"已拒絕",cancelled:"已取消",sent:"已發送",signed:"已簽署"})[y]||y,c=y=>({draft:"text-gray-400",pending:"text-yellow-400",in_progress:"text-blue-400",completed:"text-green-400",rejected:"text-red-400",cancelled:"text-gray-500",sent:"text-blue-400",signed:"text-green-400"})[y]||"text-gray-400",f=((m=e.signers)==null?void 0:m.filter(y=>y.status==="signed").length)||0,h=((p=e.signers)==null?void 0:p.length)||0,d=h>0?f/h*100:0;return a.jsxs("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"簽約詳情"}),a.jsxs("div",{className:"flex gap-2",children:[o&&o.file_url&&a.jsxs(te,{onClick:()=>s(!0),variant:"outline",className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"}),"預覽合約"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"簽署進度"}),a.jsx("span",{className:`text-lg font-bold ${c(e.status)}`,children:l(e.status)})]}),a.jsx("div",{className:"w-full bg-gray-800 rounded-full h-3 mb-2",children:a.jsx("div",{className:"bg-gradient-to-r from-[#00FFFF] to-green-400 h-3 rounded-full transition-all duration-500",style:{width:`${d}%`}})}),a.jsxs("p",{className:"text-sm text-gray-400",children:["已完成:",f," / ",h," 位簽署ä
786ºº (",d.toFixed(0),"%)"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"專案名稱"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:e.project_name})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"合約編號"}),a.jsx("p",{className:"text-gray-200",children:e.contract_number})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"簽署流程"}),a.jsx("p",{className:"text-gray-200",children:e.workflow_type==="sequential"?"依序簽署":"並行簽署"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"建立時間"}),a.jsx("p",{className:"text-gray-200",children:e.created_date?new Date(e.created_date).toLocaleString("zh-TW"):"-"})]}),e.completed_date&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"完成時間"}),a.jsx("p",{className:"text-green-400 font-semibold",children:new Date(e.completed_date).toLocaleString("zh-TW")})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 space-y-4",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text flex items-center gap-2",children:[a.jsx(Uf,{className:"w-5 h-5"}),"簽署人狀態"]}),a.jsx("div",{className:"space-y-3",children:(x=e.signers)==null?void 0:x.map((y,v)=>a.jsxs("div",{className:"border border-gray-700 rounded-lg p-4 bg-gray-900/50",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"font-semibold text-gray-200",children:y.signer_name}),a.jsx("span",{className:"text-xs px-2 py-1 rounded bg-gray-800 text-gray-400",children:y.signer_role}),e.workflow_type==="sequential"&&a.jsxs("span",{className:"text-xs px-2 py-1 rounded bg-blue-900 text-blue-200",children:["順序 #",y.signing_order]})]}),a.jsx("p",{className:"text-sm text-gray-400",children:y.signer_email})]}),a.jsx("span",{className:`text-sm font-semibold ${c(y.status)}`,children:l(y.status)})]}),y.signature_date&&a.jsxs("div",{className:"text-xs text-gray-500 flex items-center gap-2 mt-2",children:[a.jsx(Ra,{className:"w-3 h-3"}),"簽署時間:",new Date(y.signature_date).toLocaleString("zh-TW"),y.ip_address&&` | IP:${y.ip_address}`]}),y.rejection_reason&&a.jsxs("div",{className:"mt-2 p-2 bg-red-900/30 border border-red-800 rounded text-xs text-red-300",children:[a.jsx(oi,{className:"w-3 h-3 inline mr-1"}),"拒絕原因:",y.rejection_reason]}),y.signed_document_url&&a.jsxs("a",{href:y.signed_document_url,download:!0,className:"mt-2 inline-flex items-center gap-1 text-xs text-green-400 hover:text-green-300",children:[a.jsx(Et,{className:"w-3 h-3"}),"下載已簽署文件"]})]},v))})]}),e.audit_trail&&e.audit_trail.length>0&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text flex items-center gap-2",children:[a.jsx(OL,{className:"w-5 h-5"}),"審計追蹤記錄"]}),a.jsx(te,{size:"sm",variant:"outline",onClick:()=>n(!r),className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:r?"隱藏":"顯示"})]}),r&&a.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:e.audit_trail.map((y,v)=>a.jsx("div",{className:"border-l-2 border-[#00FFFF] pl-4 py-2 bg-gray-900/30",children:a.jsxs("div",{className:"flex items-start justify-between text-xs",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"font-semibold text-gray-300",children:y.action}),a.jsx("p",{className:"text-gray-400",children:y.details}),a.jsxs("p",{className:"text-gray-500 mt-1",children:["執行者:",y.actor," ",y.ip_address&&`| IP:${y.ip_address}`]})]}),a.jsx("span",{className:"text-gray-500 whitespace-nowrap ml-2",children:new Date(y.timestamp).toLocaleStr
786ing("zh-TW")})]})},v))})]})]})]}),i&&o&&o.file_url&&a.jsx($a,{fileUrl:o.file_url,fileName:`${o.project_name} - 合約文件`,onClose:()=>s(!1)})]})}function Lve(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState("");at();const{data:c=[],isLoading:f}=Te({queryKey:["esignatures"],queryFn:()=>ee.entities.ESignature.list("-created_date")}),{data:h=[]}=Te({queryKey:["contracts"],queryFn:()=>ee.entities.Contract.list()}),d=c.filter(p=>{var x,y,v;return((x=p.project_name)==null?void 0:x.toLowerCase().includes(o.toLowerCase()))||((y=p.contract_number)==null?void 0:y.toLowerCase().includes(o.toLowerCase()))||((v=p.signer_name)==null?void 0:v.toLowerCase().includes(o.toLowerCase()))}),m=p=>{const x={pending:{label:"待發送",color:"bg-gray-700 text-gray-200",icon:null},sent:{label:"已發送",color:"bg-blue-900 text-blue-200",icon:Wi},signed:{label:"已簽署",color:"bg-green-900 text-green-200",icon:xr},rejected:{label:"已拒絕",color:"bg-red-900 text-red-200",icon:$s}};return x[p]||x.pending};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"線上簽約管理"}),a.jsxs(te,{onClick:()=>{s(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"新增簽約請求"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(ne,{placeholder:"搜尋合約編號、專案名稱或簽署人...",value:o,onChange:p=>l(p.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]})}),a.jsx("div",{className:"space-y-4",children:f?a.jsx("div",{className:"text-center py-8 text-gray-400",children:"載入中..."}):d.length===0?a.jsx("div",{className:"text-center py-8 text-gray-400",children:o?"沒有符合條件的簽約請求":"尚無簽約請求"}):d.map(p=>{const x=m(p.status),y=x.icon;return a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:p.project_name}),a.jsxs("span",{className:`px-3 py-1 rounded text-xs font-medium flex items-center gap-1 ${x.color}`,children:[y&&a.jsx(y,{className:"w-3 h-3"}),x.label]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"合約編號:"}),a.jsx("span",{className:"text-gray-200",children:p.contract_number})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"簽署人:"}),a.jsx("span",{className:"text-gray-200",children:p.signer_name})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"Email:"}),a.jsx("span",{className:"text-gray-200",children:p.signer_email})]}),p.sent_date&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"發送日期:"}),a.jsx("span",{className:"text-gray-200",children:p.sent_date})]}),p.signature_date&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"簽署日期:"}),a.jsx("span",{className:"text-[#00FFFF] font-semibold",children:p.signature_date})]})]})]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>n(p),className:"bg-[#4a4a4a] text-white border-[#4a4a4a] hover:bg-[#3a3a3a] ml-4",children:a.jsx(cr,{className:"w-4 h-4"})})]})},p.id)})}),e&&a.jsx(Ive,{signature:i,contracts:h,onClose:()=>{t(!1),s(null)}}),r&&a.jsx(Mve,{signature:r,onClose:()=>n(null)})]})}function Dve(){const[e,t]=I.useState(new Date().getFullYear().toString()),[r,n]=I.useState("all"),{data:i=[]}=Te({queryKey:["employees"],queryFn:()=>ee.entities.User.list()}),{data:s=[]}=Te({queryKey:["tasks"],queryFn:()=>ee.entities.Task.list()}),{data:o=[]}=Te({queryKey:["salaryPayments"],queryFn:()=>ee.entities.SalaryPayment.list()}),c=i.map(p=>{const x=s.filter(N=>N.assigned_to===p.email),y=x.filter(N=>N.status==="completed").length,v=x.length,b=v>0?Math.round(y/v*100):0,w=o.filter(N=>{if(!N.payment_date)return!1;const S=new Date(N.payment_date).getFullYear();return N.employee_id===p.id&&S===parseInt(e)}),_=w.reduce((N,S)=>N+(S.amount||0),0);return{id:p.id,name:p.full_name,email:p.email,totalTasks:v,completedTasks:y,inProgressTasks:x.filter(N=>N.status==="in_progress").length,todoTasks:x.filter(N=>N.status==="todo").length,completionRate:b,totalSalary:_,avgMonthlySalary:w.length>0?Math.round(_/w.length):0}}).filter(p=>p.totalTasks>0||p.totalSalary>0),f=()=>[...Array(12)].map((x,y)=>y+1).map(x=>{const v=o.filter(b=>{if(!b.payment_date)return!1;const w=new Date(b.payment_date);return w.getFullYear()===parseInt(e)&&w.getMonth()+1===x&&(r==="all"||b.employee_id===r)}).reduce((b,w)=>b+(w.amount||0),0);return{month:`${x}月`,amount:v}}),h=()=>{const p=r==="all"?s:s.filter(x=>{var y;return x.assigned_to===((y=i.find(v=>v.id===r))==null?void 0:y.email)});return[{name:"已完成",value:p.filter(x=>x.status==="completed").length,color:"#00FF00"},{name:"進行中",value:p.filter(x=>x.status==="in_progress").length,color:"#FFD700"},{name:"待處理",value:p.filter(x=>x.status==="todo").length,color:"#808080"}].filter(x=>x.value>0)},d={totalEmployees:i.length,avgCompletionRate:c.length>0?Math.round(c.reduce((p,x)=>p+x.completionRate,0)/c.length):0,totalSalaryPaid:o.filter(p=>p.payment_date?new Date(p.payment_date).getFullYear()===parseInt(e):!1).reduce((p,x)=>p+(x.amount||0),0),totalTasksCompleted:s.filter(p=>p.status==="completed").length},m=[...new Set(o.map(p=>p.payment_date?new Date(p.payment_date).getFullYear():new Date().getFullYear()))].sort((p,x)=>x-p);return m.includes(new Date().getFullYear())||m.unshift(new Date().getFullYear()),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"員工績效儀表板"}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs(qe,{value:e,onValueChange:t,children:[a.jsx(De,{className:"w-32 bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsx($e,{className:"bg-black border-gray-700",children:m.map(p=>a.jsxs(se,{value:p.toString(),className:"text-white",children:[p,"年"]},p))})]}),a.jsxs(qe,{value:r,onValueChange:n,children:[a.jsx(De,{className:"w-48 bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇員工"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有員工"}),i.map(p=>a.jsx(se,{value:p.id,className:"text-white",children:p.full_name},p.id))]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx(Xr,{className:"w-8 h-8 text-[#00FFFF] mb-2"}),a.jsx("p",{className:"text-sm text-gray-400",children:"員工總數"}),a.jsx("p",{className:"text-2xl font-bold cyber-text",children:d.totalEmployees})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx(z2,{className:"w-8 h-8 text-green-400 mb-2"}),a.jsx("p",{className:"text-sm text-gray-400",children:"平均任務完成率"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:[d.avgCompletionRate,"%"]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx(xr,{className:"w-8 h-8 text-blue-400 mb-2"}),a.jsx("p",{className:"text-sm text-gray-400",children:"已完成任務"}),a.jsx("p",{className:"text-2xl font-bold text-blue-400",children:d.totalTasksCompleted})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx(ut,{className:"w-8 h-8 text-yellow-400 mb-2"}),a.jsxs("p",{className:"text-sm text-gray-400",children:[e,"年薪資總支出"]}),a.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["NT$ ",d.totalSalaryPaid.toLocaleStr
786ing()]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text mb-4 flex items-center gap-2",children:[a.jsx(sl,{className:"w-5 h-5"}),"薪資趨勢"]}),a.jsx(En,{width:"100%",height:280,children:a.jsxs(Hfe,{data:f(),children:[a.jsx(el,{strokeDasharray:"3 3",stroke:"#333"}),a.jsx(fi,{dataKey:"month",stroke:"#00FFFF",tick:{fill:"#fff"}}),a.jsx(hi,{stroke:"#00FFFF",tick:{fill:"#fff"}}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF",borderRadius:"8px"},formatter:p=>[`NT$ ${p.toLocaleString()}`,"薪資"]}),a.jsx(sh,{type:"monotone",dataKey:"amount",stroke:"#00FFFF",strokeWidth:2,dot:{fill:"#00FFFF"}})]})})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text mb-4 flex items-center gap-2",children:[a.jsx(z2,{className:"w-5 h-5"}),"員工任務完成率"]}),a.jsx(En,{width:"100%",height:280,children:a.jsxs(oh,{data:c.slice(0,8),layout:"vertical",children:[a.jsx(el,{strokeDasharray:"3 3",stroke:"#333"}),a.jsx(fi,{type:"number",domain:[0,100],stroke:"#00FFFF",tick:{fill:"#fff"}}),a.jsx(hi,{type:"category",dataKey:"name",stroke:"#00FFFF",tick:{fill:"#fff"},width:80}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF",borderRadius:"8px"},formatter:p=>[`${p}%`,"完成率"]}),a.jsx(Qn,{dataKey:"completionRate",fill:"#00FFFF",radius:[0,4,4,0]})]})})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsxs("h3",{className:"text-lg font-semibold cyber-text mb-4 flex items-center gap-2",children:[a.jsx(Ra,{className:"w-5 h-5"}),"任務狀態分佈"]}),a.jsx(En,{width:"100%",height:280,children:a.jsxs(Hs,{children:[a.jsx(ln,{data:h(),cx:"50%",cy:"50%",labelLine:!1,label:({name:p,value:x,percent:y})=>`${p}: ${x} (${(y*100).toFixed(0)}%)`,outerRadius:100,dataKey:"value",children:h().map((p,x)=>a.jsx(Ma,{fill:p.color},`cell-${x}`))}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF",borderRadius:"8px"}})]})})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"員工績效明細"}),a.jsxs("div",{className:"space-y-3 max-h-[280px] overflow-y-auto",children:[c.map(p=>a.jsxs("div",{className:"p-3 bg-gray-900 rounded-lg",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"font-semibold text-gray-200",children:p.name}),a.jsxs("span",{className:`text-sm font-bold ${p.completionRate>=80?"text-green-400":p.completionRate>=50?"text-yellow-400":"text-red-400"}`,children:[p.completionRate,"%"]})]}),a.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2 mb-2",children:a.jsx("div",{className:"h-2 rounded-full transition-all",style:{width:`${p.completionRate}%`,backgroundColor:p.completionRate>=80?"#00FF00":p.completionRate>=50?"#FFD700":"#FF4444"}})}),a.jsxs("div",{className:"flex justify-between text-xs text-gray-400",children:[a.jsxs("span",{children:["完成: ",p.completedTasks," / 總計: ",p.totalTasks]}),a.jsxs("span",{children:["年薪資: NT$ ",p.totalSalary.toLocaleString()]})]})]},p.id)),c.length===0&&a.jsx("p",{className:"text-center text-gray-400 py-8",children:"暫無績效數據"})]})]})]})]})}function $ve({employee:e,onClose:t}){const[r,n]=I.useState({full_name:"",email:"",department:"",position:"",mobile:"",id_number:"",birthday:"",gender:"",address:"",role:"user",...e}),[i,s]=I.useState(!1),o=at(),l=Ye({mutationFn:async h=>e?ee.entities.Employee.update(e.id,h):ee.entities.Employee.create(h),onSuccess:()=>{o.invalidateQueries(["employees"]),alert("儲存成功!"),t()}}),c=async h=>{const d=h.target.files[0];if(d)try{s(!0);const{file_url:m}=await ee.integrations.Core.UploadFile({file:d}),p=await ee.integrations.Core.ExtractDataFromUploadedFile({file_url:m,json_schema:{type:"object",properties:{name:{type:"string",description:"姓名"},id_number:{type:"string",description:"身分證字號"},birthday:{type:"string",description:"出生日期,格式YYYY-MM-DD"},gender:{type:"string",description:"性別:male或female"},address:{type:"string",description:"戶籍地址"}}}});p.status==="success"&&p.output&&(n(x=>({...x,full_name:p.output.name||x.full_name,id_number:p.output.id_number||x.id_number,birthday:p.output.birthday||x.birthday,gender:p.output.gender||x.gender,address:p.output.address||x.address})),alert("✅ 身分證資訊已自動填入!"))}catch(m){console.error("ID card OCR error:",m),alert("身分證識別失敗,請手動輸入")}finally{s(!1)}},f=h=>{h.preventDefault(),l.mutate(r)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-3xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯員工":"新增員工"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:f,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"身分證上傳(自動識別)"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("input",{type:"file",accept:"image/*",onChange:c,className:"hidden",id:"id-card-upload",disabled:i}),a.jsxs("label",{htmlFor:"id-card-upload",className:`flex items-center gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-700 rounded cursor-pointer border border-gray-600 ${i?"opacity-50 cursor-not-allowed":""}`,children:[i?a.jsx(Ht,{className:"w-4 h-4 animate-spin"}):a.jsx(Hr,{className:"w-4 h-4"}),i?"識別中...":"上傳身分證"]}),a.jsx("span",{className:"text-xs text-gray-500",children:"支援正反面圖片,系統將自動識別並填入資料"})]})]}),a.jsxs("div",{className:"bg-blue-900 bg-opacity-30 border border-blue-600 rounded-lg p-4 flex items-start gap-3",children:[a.jsx(oi,{className:"w-5 h-5 text-blue-400 flex-shrink-0 mt-0.5"}),a.jsxs("div",{className:"text-sm text-blue-200",children:[a.jsx("p",{className:"font-semibold mb-1",children:"說明"}),a.jsx("p",{children:"此員工資料為獨立模組,僅用於系統記錄與管理,不與使用者帳號連動。"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"姓名 *"}),a.jsx(ne,{required:!0,value:r.full_name,onChange:h=>n({...r,full_name:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"Email *"}),a.jsx(ne,{type:"email",required:!0,value:r.email,onChange:h=>n({...r,email:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"部門"}),a.jsx(ne,{value:r.department,onChange:h=>n({...r,department:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"職位"}),a.jsx(ne,{value:r.position,onChange:h=>n({...r,position:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"手機號碼"}),a.jsx(ne,{value:r.mobile,onChange:h=>n({...r,mobile:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"身分證字號"}
786),a.jsx(ne,{value:r.id_number,onChange:h=>n({...r,id_number:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"生日"}),a.jsx(ne,{type:"date",value:r.birthday,onChange:h=>n({...r,birthday:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"性別"}),a.jsxs(qe,{value:r.gender,onValueChange:h=>n({...r,gender:h}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇性別"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"male",className:"text-white",children:"男性"}),a.jsx(se,{value:"female",className:"text-white",children:"女性"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"角色"}),a.jsxs(qe,{value:r.role,onValueChange:h=>n({...r,role:h}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"admin",className:"text-white",children:"管理員"}),a.jsx(se,{value:"user",className:"text-white",children:"一般用戶"}),a.jsx(se,{value:"guest",className:"text-white",children:"訪客"})]})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"地址"}),a.jsx(ne,{value:r.address,onChange:h=>n({...r,address:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-red-900 text-white hover:bg-red-800 border-red-700",children:"取消"}),a.jsx(te,{type:"submit",disabled:l.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:l.isPending?"儲存中...":"儲存"})]})]})]})})}function qve(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(""),o=at(),{data:l=[],isLoading:c}=Te({queryKey:["employees"],queryFn:()=>ee.entities.Employee.list("-created_date")}),f=Ye({mutationFn:m=>ee.entities.Employee.delete(m),onSuccess:()=>{o.invalidateQueries(["employees"])}}),h=l.filter(m=>{var p,x,y;return!i||((p=m.full_name)==null?void 0:p.toLowerCase().includes(i.toLowerCase()))||((x=m.email)==null?void 0:x.toLowerCase().includes(i.toLowerCase()))||((y=m.department)==null?void 0:y.toLowerCase().includes(i.toLowerCase()))}),d=m=>{const p={admin:{label:"管理員",color:"#00FFFF"},user:{label:"一般用戶",color:"#FFD700"}},x=p[m]||p.user;return a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:x.color+"33",color:x.color,border:`1px solid ${x.color}`},children:x.label})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"員工管理"}),a.jsxs(te,{onClick:()=>{n(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增員工"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"relative max-w-md",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋姓名、Email、部門...",value:i,onChange:m=>s(m.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]})}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden",children:c?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):h.length===0?a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Xr,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無員工資料"})]}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{className:"border-gray-700 hover:bg-transparent",children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"姓名"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"Email"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"部門"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"職位"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"性別"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"手機"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"角色"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"操作"})]})}),a.jsx(Jn,{children:h.map(m=>a.jsxs(Dt,{className:"border-gray-700 hover:bg-gray-900",children:[a.jsx(Me,{className:"font-semibold cyber-text",children:m.full_name}),a.jsx(Me,{className:"text-gray-300",children:m.email}),a.jsx(Me,{className:"text-gray-300",children:m.department||"-"}),a.jsx(Me,{className:"text-gray-300",children:m.position||"-"}),a.jsx(Me,{className:"text-gray-300",children:m.gender==="male"?"男":m.gender==="female"?"女":"-"}),a.jsx(Me,{className:"text-gray-300",children:m.mobile||"-"}),a.jsx(Me,{children:d(m.role)}),a.jsx(Me,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>{n(m),t(!0)},className:"bg-gray-700 text-white hover:bg-gray-600 border-gray-600",children:[a.jsx(qt,{className:"w-4 h-4 mr-1"}),"編輯"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{window.confirm(`確定要刪除員工「${m.full_name}」嗎?`)&&f.mutate(m.id)},className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})})]},m.id))})]})})}),e&&a.jsx($ve,{employee:r,onClose:()=>{t(!1),n(null)}})]})}function Bve(){return a.jsx("div",{})}function zve({payment:e,courses:t,trainings:r,onClose:n}){const[i,s]=I.useState({instructor_name:"",instructor_email:"",instructor_phone:"",related_type:"course",course_id:"",course_name:"",training_id:"",training_name:"",total_payment_amount:"",paid_amount:0,unpaid_amount:"",payment_date:"",payment_method:"",bank_account:"",receipt_file_url:"",status:"pending",notes:"",...e}),[o,l]=I.useState(!1),c=at();I.useEffect(()=>{const m=(i.total_payment_amount||0)-(i.paid_amount||0);s(p=>({...p,unpaid_amount:m}))},[i.total_payment_amount,i.paid_amount]);const f=Ye({mutationFn:async m=>e?await ee.entities.InstructorPayment.update(e.id,m):await ee.entities.InstructorPayment.create(m),onSuccess:()=>{c.invalidateQueries(["instructor_payments"]),alert("儲存成功!"),n()}}),h=(m,p)=>
786{if(m==="course"){const x=t.find(y=>y.id===p);x&&s(y=>({...y,course_id:p,course_name:x.course_name,training_id:"",training_name:""}))}else if(m==="corporate_training"){const x=r.find(y=>y.id===p);x&&s(y=>({...y,training_id:p,training_name:x.project_name||x.training_name,course_id:"",course_name:""}))}},d=m=>{m.preventDefault(),f.mutate(i)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-3xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯講師費付款":"新增講師費付款"}),a.jsx("button",{onClick:n,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:d,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"講師姓名 *"}),a.jsx(ne,{required:!0,value:i.instructor_name,onChange:m=>s({...i,instructor_name:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"講師Email"}),a.jsx(ne,{type:"email",value:i.instructor_email,onChange:m=>s({...i,instructor_email:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"講師電話"}),a.jsx(ne,{value:i.instructor_phone,onChange:m=>s({...i,instructor_phone:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯專案類型"}),a.jsxs(qe,{value:i.related_type,onValueChange:m=>s({...i,related_type:m}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"course",className:"text-white",children:"課程專案"}),a.jsx(se,{value:"corporate_training",className:"text-white",children:"企業培訓專案"})]})]})]}),i.related_type==="course"&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯課程專案"}),a.jsxs(qe,{value:i.course_id,onValueChange:m=>h("course",m),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇課程專案"})}),a.jsx($e,{className:"bg-black border-gray-700",children:t.map(m=>a.jsx(se,{value:m.id,className:"text-white",children:m.course_name},m.id))})]})]}),i.related_type==="corporate_training"&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯企業培訓專案"}),a.jsxs(qe,{value:i.training_id,onValueChange:m=>h("corporate_training",m),children:[a.jsx(De,{className:"bg-black border-gray-700 text-white",children:a.jsx(Be,{placeholder:"選擇企業培訓專案"})}),a.jsx($e,{className:"bg-black border-gray-700",children:r.map(m=>a.jsx(se,{value:m.id,className:"text-white",children:m.project_name||m.training_name},m.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"講師費總金額 *"}),a.jsx(ne,{type:"number",required:!0,value:i.total_payment_amount,onChange:m=>s({...i,total_payment_amount:parseFloat(m.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"已付金額"}),a.jsx(ne,{type:"number",value:i.paid_amount,onChange:m=>s({...i,paid_amount:parseFloat(m.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"未付金額"}),a.jsx(ne,{type:"number",value:i.unpaid_amount,readOnly:!0,className:"bg-gray-900 border-gray-700 text-red-400 font-semibold"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"付款日期"}),a.jsx(ne,{type:"date",value:i.payment_date,onChange:m=>s({...i,payment_date:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"付款方式"}),a.jsxs(qe,{value:i.payment_method,onValueChange:m=>s({...i,payment_method:m}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇付款方式"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"轉帳",className:"text-white",children:"轉帳"}),a.jsx(se,{value:"匯款",className:"text-white",children:"匯款"}),a.jsx(se,{value:"支票",className:"text-white",children:"支票"}),a.jsx(se,{value:"現金",className:"text-white",children:"現金"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"銀行帳號"}),a.jsx(ne,{value:i.bank_account,onChange:m=>s({...i,bank_account:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"付款狀態"}),a.jsxs(qe,{value:i.status,onValueChange:m=>s({...i,status:m}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"pending",className:"text-white",children:"待支付"}),a.jsx(se,{value:"partial",className:"text-white",children:"部分支付"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"})]})]})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(Q,{children:"領據上傳"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{type:"button",variant:"outline",onClick:()=>document.getElementById("receipt-upload").click(),className:"bg-gray-800 border-gray-700 hover:bg-gray-700",disabled:o,children:[o?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),o?"上傳中...":"上傳領據"]}),a.jsx(ne,{id:"receipt-upload",type:"file",accept:".pdf,.jpg,.jpeg,.png",className:"hidden",onChange:async m=>{const p=m.target.files[0];if(p)try{l(!0);const{file_url:x}=await ee.integrations.Core.UploadFile({file:p});s(y=>({...y,receipt_file_url:x}
786))}catch{alert("領據上傳失敗")}finally{l(!1)}}}),i.receipt_file_url&&a.jsx("a",{href:i.receipt_file_url,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline text-sm",children:"查看已上傳領據"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:i.notes,onChange:m=>s({...i,notes:m.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-20"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:n,className:"bg-red-900 text-white hover:bg-red-800 border-red-700",children:"取消"}),a.jsx(te,{type:"submit",disabled:f.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:f.isPending?"儲存中...":"儲存"})]})]})]})})}function Uve({payment:e,onClose:t,onEdit:r}){const n=at(),i=Ye({mutationFn:async()=>await ee.entities.InstructorPayment.delete(e.id),onSuccess:()=>{n.invalidateQueries(["instructor_payments"]),alert("刪除成功!"),t()}}),s=()=>{confirm("確定要刪除此講師費付款記錄嗎?")&&i.mutate()},o=c=>({pending:"待支付",partial:"部分支付",completed:"已完成"})[c]||c,l=c=>c==="course"?"課程專案":"企業培訓專案";return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-3xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"講師費付款詳情"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Uf,{className:"w-5 h-5 cyber-text"}),a.jsx("h3",{className:"text-lg font-semibold text-white",children:"講師資訊"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"講師姓名:"}),a.jsx("span",{className:"text-white",children:e.instructor_name})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"Email:"}),a.jsx("span",{className:"text-white",children:e.instructor_email||"-"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"電話:"}),a.jsx("span",{className:"text-white",children:e.instructor_phone||"-"})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(Vs,{className:"w-5 h-5 cyber-text"}),a.jsx("h3",{className:"text-lg font-semibold text-white",children:"關聯專案"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"專案類型:"}),a.jsx("span",{className:"text-white",children:l(e.related_type)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"專案名稱:"}),a.jsx("span",{className:"text-white",children:e.course_name||e.training_name||"-"})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx(ut,{className:"w-5 h-5 cyber-text"}),a.jsx("h3",{className:"text-lg font-semibold text-white",children:"付款資訊"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400",children:"總金額"}),a.jsxs("p",{className:"text-xl font-bold text-[#00FFFF]",children:["NT$ ",(e.total_payment_amount||0).toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400",children:"已付金額"}),a.jsxs("p",{className:"text-xl font-bold text-green-400",children:["NT$ ",(e.paid_amount||0).toLocaleStr
786ing()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400",children:"未付金額"}),a.jsxs("p",{className:"text-xl font-bold text-red-400",children:["NT$ ",(e.unpaid_amount||0).toLocaleString()]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"付款日期:"}),a.jsx("span",{className:"text-white",children:e.payment_date||"-"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"付款方式:"}),a.jsx("span",{className:"text-white",children:e.payment_method||"-"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"銀行帳號:"}),a.jsx("span",{className:"text-white",children:e.bank_account||"-"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"付款狀態:"}),a.jsx("span",{className:"text-white",children:o(e.status)})]})]})]}),e.receipt_file_url&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"領據文件"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("a",{href:e.receipt_file_url,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline flex items-center gap-2",children:[a.jsx(Et,{className:"w-4 h-4"}),"查看領據"]}),e.receipt_file_url.toLowerCase().includes(".pdf")?a.jsx("div",{className:"mt-4 border border-gray-700 rounded-lg overflow-hidden",style:{height:"500px"},children:a.jsx("iframe",{src:`${e.receipt_file_url}#toolbar=0&navpanes=0&scrollbar=1`,className:"w-full h-full",title:"Receipt Preview"})}):a.jsx("div",{className:"mt-4 border border-gray-700 rounded-lg overflow-hidden",children:a.jsx("img",{src:e.receipt_file_url,alt:"領據",className:"w-full h-auto"})})]})]}),e.notes&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"備註"}),a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.notes})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsxs(te,{variant:"outline",onClick:s,disabled:i.isPending,className:"bg-red-900 text-white hover:bg-red-800 border-red-700",children:[a.jsx(Qt,{className:"w-4 h-4 mr-2"}),"刪除"]}),a.jsxs(te,{onClick:r,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(qt,{className:"w-4 h-4 mr-2"}),"編輯"]})]})]})]})})}function Hve(){const[e,t]=I.useState(""),[r,n]=I.useState("all"),[i,s]=I.useState("all"),[o,l]=I.useState(!1),[c,f]=I.useState(null),[h,d]=I.useState(null),{data:m=[],isLoading:p}=Te({queryKey:["instructor_payments"],queryFn:()=>ee.entities.InstructorPayment.list("-created_date")}),{data:x=[]}=Te({queryKey:["courses"],queryFn:()=>ee.entities.Course.list()}),{data:y=[]}=Te({queryKey:["corporate_trainings"],queryFn:()=>ee.entities.CorporateTraining.list()}),v=m.filter(k=>{var A,P,E;const C=r==="all"||k.status===r,O=i==="all"||k.related_type===i,R=!e||((A=k.instructor_name)==null?void 0:A.toLowerCase().includes(e.toLowerCase()))||((P=k.course_name)==null?void 0:P.toLowerCase().includes(e.toLowerCase()))||((E=k.training_name)==null?void 0:E.toLowerCase().includes(e.toLowerCase()));return C&&O&&R}),b=v.reduce((k,C)=>k+(C.total_payment_amount||0),0),w=v.reduce((k,C)=>k+(C.paid_amount||0),0),_=v.reduce((k,C)=>k+(C.unpaid_amount||0),0),N=k=>{const C={pending:{label:"待支付",color:"#FFD700"},partial:{label:"部分支付",color:"#FF8C00"},completed:{label:"已完成",color:"#00FF00"}},O=C[k]||C.pending;return a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:O.color+"33",color:O.color,border:`1px solid ${O.color}`},children:O.label})},S=k=>{const O={course:{label:"課程專案",color:"#00FFFF"},corporate_training:{label:"企業培訓",color:"#00FF00"}}[k]||{label:"未知",color:"#808080"};return a.jsx("span",{className:"px-2 py-1 rounded text-xs font-semibold",style:{backgroundColor:O.color+"33",color:O.color},children:O.label})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ut,{className:"w-8 h-8 cyber-text"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"講師費付款管理"})]}),a.jsxs(te,{onClick:()=>{f(null),l(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增講師費付款"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"講師費總金額"}),a.jsxs("p",{className:"text-2xl font-bold cyber-text",children:["NT$ ",b.toLocaleStr
786ing()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已付金額"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",w.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未付金額"}),a.jsxs("p",{className:"text-2xl font-bold text-red-400",children:["NT$ ",_.toLocaleString()]})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋講師姓名、專案...",value:e,onChange:k=>t(k.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(qe,{value:i,onValueChange:s,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"專案類型"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有類型"}),a.jsx(se,{value:"course",className:"text-white",children:"課程專案"}),a.jsx(se,{value:"corporate_training",className:"text-white",children:"企業培訓"})]})]}),a.jsxs(qe,{value:r,onValueChange:n,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"付款狀態"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有狀態"}),a.jsx(se,{value:"pending",className:"text-white",children:"待支付"}),a.jsx(se,{value:"partial",className:"text-white",children:"部分支付"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"})]})]}),a.jsx(te,{variant:"outline",onClick:()=>{t(""),n("all"),s("all")},className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"清除篩選"})]})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h2",{className:"text-xl font-bold text-white",children:"付款記錄列表"}),p?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):v.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(ut,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無講師費付款資料"})]}):a.jsx("div",{className:"space-y-3",children:v.map(k=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:k.instructor_name}),N(k.status),S(k.related_type)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3 text-sm",children:[a.jsxs("div",{className:"text-gray-300",children:[k.related_type==="course"?"課程:":"企業培訓:",k.course_name||k.training_name||"-"]}),a.jsxs("div",{className:"text-gray-300",children:["Email: ",k.instructor_email||"-"]}),a.jsxs("div",{className:"text-[#00FFFF] font-semibold",children:["總金額: NT$ ",(k.total_payment_amount||0).toLocaleString()]}),a.jsxs("div",{className:"text-green-400",children:["已付: NT$ ",(k.paid_amount||0).toLocaleString()]}),a.jsxs("div",{className:"text-red-400",children:["未付: NT$ ",(k.unpaid_amount||0).toLocaleString()]}),k.payment_date&&a.jsxs("div",{className:"text-gray-300",children:["付款日期: ",k.payment_date]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>d(k),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"詳情"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{f(k),l(!0)},className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:a.jsx(qt,{className:"w-4 h-4"})})]})]})},k.id))})]}),o&&a.jsx(zve,{payment:c,courses:x,trainings:y,onClose:()=>{l(!1),f(null)}}),h&&!o&&a.jsx(Uve,{payment:h,onClose:()=>d(null),onEdit:()=>{f(h),l(!0),d(null)}})]})}function Vve({invoice:e,onClose:t}){const[r,n]=I.useState({invoice_number:"",invoice_type:"other",related_id:"",related_name:"",customer_name:"",customer_tax_id:"",issue_date:new Date().toISOString().split("T")[0],total_amount:0,tax_amount:0,untaxed_amount:0,items:[],status:"draft",notes:"",file_url:"",...e}),[i,s]=I.useState(!0),[o,l]=I.useState(!1),c=at(),{data:f=[]}=Te({queryKey:["contracts"],queryFn:()=>ee.entities.Contract.list()}),{data:h=[]}=Te({queryKey:["courses"],queryFn:()=>ee.entities.Course.list()}),d=Ye({mutationFn:y=>e?ee.entities.Invoice.update(e.id,y):ee.entities.Invoice.create(y),onSuccess:()=>{c.invalidateQueries(["invoice_management"]),alert("✅ 發票已å
786„²å­˜"),t()}}),m=async y=>{const v=y.target.files[0];if(v)try{l(!0);const{file_url:b}=await ee.integrations.Core.UploadFile({file:v});n({...r,file_url:b})}catch(b){console.error(b),alert("上傳失敗")}finally{l(!1)}},p=(y,v)=>{if(n({...r,invoice_type:y,related_id:v}),y==="software_project"){const b=f.find(w=>w.id===v);b&&n(w=>({...w,related_name:b.project_name,customer_name:b.customer_name,total_amount:b.total_amount}))}else if(y==="course_project"){const b=h.find(w=>w.id===v);b&&n(w=>({...w,related_name:b.course_name,total_amount:b.total_revenue}))}},x=y=>{const v=Math.round(y*.05),b=y-v;n(w=>({...w,total_amount:y,tax_amount:v,untaxed_amount:b}))};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯發票":"新增發票"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:y=>{y.preventDefault(),d.mutate(r)},className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"發票號碼 *"}),a.jsx(ne,{required:!0,value:r.invoice_number,onChange:y=>n({...r,invoice_number:y.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"開立日期 *"}),a.jsx(ne,{type:"date",required:!0,value:r.issue_date,onChange:y=>n({...r,issue_date:y.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"發票類型"}),a.jsxs(qe,{value:r.invoice_type,onValueChange:y=>{n({...r,invoice_type:y,related_id:"",related_name:""}),s(y==="other")},children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"other",className:"text-white",children:"獨立發票"}),a.jsx(se,{value:"software_project",className:"text-white",children:"軟體專案"}),a.jsx(se,{value:"course_project",className:"text-white",children:"課程專案"}),a.jsx(se,{value:"online_course",className:"text-white",children:"線上課程"})]})]})]}),!i&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯專案(可選)"}),a.jsxs(qe,{value:r.related_id,onValueChange:y=>p(r.invoice_type,y),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇專案"})}),a.jsx($e,{className:"bg-black border-gray-700",children:r.invoice_type==="software_project"?f.map(y=>a.jsx(se,{value:y.id,className:"text-white",children:y.project_name},y.id)):h.map(y=>a.jsx(se,{value:y.id,className:"text-white",children:y.course_name},y.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶名稱 *"}),a.jsx(ne,{required:!0,value:r.customer_name,onChange:y=>n({...r,customer_name:y.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶統編"}),a.jsx(ne,{value:r.customer_tax_id,onChange:y=>n({...r,customer_tax_id:y.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"含稅總金額 *"}),a.jsx(ne,{type:"number",required:!0,value:r.total_amount,onChange:y=>x(parseFloat(y.target.value)||0),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"稅額 (5%)"}),a.jsx(ne,{type:"number",value:r.tax_amount,readOnly:!0,className:"bg-gray-900 border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"狀態"}),a.jsxs(qe,{value:r.status,onValueChange:y=>n({...r,status:y}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"draft",className:"text-white",children:"草稿"}),a.jsx(se,{value:"issued",className:"text-white",children:"已開立"}),a.jsx(se,{value:"voided",className:"text-white",children:"作廢"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"發票檔案"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ne,{type:"file",onChange:m,disabled:o,className:"bg-black border-gray-700"}),o&&a.jsx(Ht,{className:"w-5 h-5 animate-spin text-[#00FFFF]"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:r.notes,onChange:y=>n({...r,notes:y.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-24"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-gray-800 text-white border-gray-600",children:"取消"}),a.jsx(te,{type:"submit",disabled:d.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:d.isPending?"儲存中...":"儲存"})]})]})]})})}
786function Wve(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState(""),c=at(),{data:f=[],isLoading:h}=Te({queryKey:["invoice_management"],queryFn:()=>ee.entities.Invoice.list("-created_date")}),d=Ye({mutationFn:v=>ee.entities.Invoice.delete(v),onSuccess:()=>{c.invalidateQueries(["invoice_management"]),alert("✅ 發票已刪除")}}),m=v=>{window.confirm(`確定要刪除發票「${v.invoice_number}」嗎?`)&&d.mutate(v.id)},p=f.filter(v=>{var b,w,_;return!o||((b=v.invoice_number)==null?void 0:b.toLowerCase().includes(o.toLowerCase()))||((w=v.customer_name)==null?void 0:w.toLowerCase().includes(o.toLowerCase()))||((_=v.related_name)==null?void 0:_.toLowerCase().includes(o.toLowerCase()))}),x=v=>{const b={draft:{label:"草稿",color:"#808080"},issued:{label:"已開立",color:"#00FF00"},voided:{label:"作廢",color:"#FF4444"}},{label:w,color:_}=b[v]||b.draft;return a.jsx("span",{className:"px-2 py-1 rounded text-xs font-semibold border",style:{borderColor:_,color:_,backgroundColor:`${_}20`},children:w})},y=v=>{const b={software_project:{label:"軟體專案",color:"#00FFFF"},course_project:{label:"課程專案",color:"#FFD700"},online_course:{label:"線上課程",color:"#FF8C00"},other:{label:"其他",color:"#808080"}},{label:w,color:_}=b[v]||b.other;return a.jsx("span",{className:"px-2 py-1 rounded text-xs font-semibold",style:{color:_,backgroundColor:`${_}20`},children:w})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"發票管理"}),a.jsxs(te,{onClick:()=>{s(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增發票"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋發票號碼、客戶名稱、專案...",value:o,onChange:v=>l(v.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]})}),a.jsx("div",{className:"grid grid-cols-1 gap-4",children:h?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):p.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(Et,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無發票資料"})]}):p.map(v=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:v.invoice_number}),x(v.status),y(v.invoice_type)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{className:"text-gray-300",children:["客戶:",v.customer_name]}),v.related_name&&a.jsxs("div",{className:"text-gray-300",children:["關聯:",v.related_name]}),a.jsxs("div",{className:"text-gray-300",children:["開立日期:",v.issue_date]}),a.jsxs("div",{className:"text-[#00FFFF]",children:["金額:NT$ ",(v.total_amount||0).toLocaleString()]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>n(v),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"詳情"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{s(v),t(!0)},className:"border-gray-600 hover:bg-gray-800",children:a.jsx(qt,{className:"w-4 h-4 text-black"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>m(v),className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},v.id))}),e&&a.jsx(Vve,{invoice:i,onClose:()=>{t(!1),s(null)}}),r&&a.jsx(c8,{invoice:r,onClose:()=>n(null),onEdit:()=>{s(r),t(!0),n(null)}})]})}function Kve(){const[e]=Bg(),t=e.get("id"),[r,n]=I.useState(!1),[i,s]=I.useState(""),[o,l]=I.useState(""),{data:c,isLoading:f}=Te({queryKey:["meeting",t],queryFn:async()=>t?(await ee.entities.Meeting.list()).find(m=>m.id===t):null,enabled:!!t}),h=Ye({mutationFn:async({status:d})=>{if(!c)return;const m=c.participants||[],p=m.findIndex(y=>y.email===o);let x;p>=0?(x=[...m],x[p]={name:i,email:o,status:d}):x=[...m,{name:i,email:o,status:d}],await ee.entities.Meeting.update(c.id,{participants:x})},onSuccess:()=>{n(!0)}});return f?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx("div",{className:"text-[#00FFFF] text-lg",children:"載入中..."})}):c?r?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-8 max-w-md w-full text-center space-y-4",children:[a.jsx(xr,{className:"w-16 h-16 text-green-400 mx-auto"}),a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"回覆已送出"}),a.jsx("p",{className:"text-gray-300",children:"感謝您的回覆,會議主持人將會收到您的確認訊息。"})]})}):a.jsx("div",{className:"min-h-screen bg-black py-12 px-4",children:a.jsx("div",{className:"max-w-2xl mx-auto",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden",children:[a.jsxs("div",{className:"bg-gradient-to-r from-[#00FFFF]/20 to-[#0088FF]/20 p-6 border-b border-gray-700",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text mb-2",children:"會議邀請"}),a.jsx("p",{className:"text-gray-300",children:"您已受邀參加以下會議"})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議主題"}),a.jsx("h2",{className:"text-2xl font-bold text-white mt-1",children:c.meeting_title})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"開始時間"}),a.jsxs("div",{className:"text-white mt-1 flex items-center gap-2",children:[a.jsx(Vs,{className:"w-4 h-4 text-[#00FFFF]"}
786),new Date(c.start_time).toLocaleString("zh-TW")]})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"結束時間"}),a.jsx("div",{className:"text-white mt-1",children:new Date(c.end_time).toLocaleString("zh-TW")})]})]}),c.organizer&&a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"主持人"}),a.jsx("div",{className:"text-white mt-1",children:c.organizer})]}),c.meeting_type==="online"&&c.meeting_link&&a.jsxs("div",{className:"bg-blue-900/30 border border-blue-700 rounded-lg p-4",children:[a.jsxs(Q,{className:"text-blue-300 flex items-center gap-2",children:[a.jsx(wp,{className:"w-4 h-4"}),"線上會議連結"]}),a.jsxs("a",{href:c.meeting_link,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline flex items-center gap-2 mt-2",children:[a.jsx(il,{className:"w-4 h-4"}),c.meeting_platform?`開啟 ${c.meeting_platform}`:"開啟會議室"]})]}),c.location&&a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議地點"}),a.jsxs("div",{className:"text-white mt-1 flex items-center gap-2",children:[a.jsx(Uo,{className:"w-4 h-4 text-[#FFD700]"}),c.location]})]}),c.agenda&&a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-400",children:"會議議程"}),a.jsx("div",{className:"text-white mt-1 bg-gray-900 p-4 rounded border border-gray-700 whitespace-pre-wrap",children:c.agenda})]}),a.jsxs("div",{className:"border-t border-gray-700 pt-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:"請確認您的出席狀態"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx(Q,{children:"姓名 *"}),a.jsx("input",{type:"text",required:!0,value:i,onChange:d=>s(d.target.value),className:"w-full px-4 py-2 bg-black border border-gray-700 rounded text-white",placeholder:"請輸入您的姓名"})]}),a.jsxs("div",{children:[a.jsx(Q,{children:"Email *"}),a.jsx("input",{type:"email",required:!0,value:o,onChange:d=>l(d.target.value),className:"w-full px-4 py-2 bg-black border border-gray-700 rounded text-white",placeholder:"請輸入您的 Email"})]})]}),a.jsxs("div",{className:"flex gap-3 pt-2",children:[a.jsx(te,{onClick:()=>h.mutate({status:"confirmed"}),disabled:!i||!o||h.isPending,className:"flex-1 bg-green-600 hover:bg-green-700 text-white font-semibold",children:"✓ 我會參加"}),a.jsx(te,{onClick:()=>h.mutate({status:"declined"}),disabled:!i||!o||h.isPending,variant:"outline",className:"flex-1 bg-red-900/50 border-red-700 text-red-300 hover:bg-red-900",children:"✗ 無法參加"})]})]})]})]})})}):a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center p-4",children:a.jsxs("div",{className:"text-center space-y-4",children:[a.jsx("div",{className:"text-red-400 text-xl",children:"找不到此會議"}),a.jsx("p",{className:"text-gray-400",children:"邀請連結可能已失效或會議已刪除"})]})})}function Gve({meeting:e,onClose:t}){const[r,n]=I.useState({meeting_title:"",meeting_type:"online",meeting_link:"",meeting_platform:"zoom",location:"",start_time:"",end_time:"",organizer:"",participants:[],agenda:"",meeting_notes:"",action_items:[],attachments:[],status:"scheduled",...e}),i=at(),s=Ye({mutationFn:async h=>{let d;if(e)d=await ee.entities.Meeting.update(e.id,h);else if(d=await ee.entities.Meeting.create(h),h.participants&&h.participants.length>0){const m=`${window.location.origin}${window.location.pathname.replace("/app","")}?page=MeetingInvite&id=${d.id}`;for(const p of h.participants){if(!p.email)continue;const x=`
787您好,${p.name}:
788
789您已被邀請參加以下會議:
790
791會議主題:${h.meeting_title}
792開始時間:${new Date(h.start_time).toLocaleString("zh-TW")}
793結束時間:${new Date(h.end_time).toLocaleString("zh-TW")}
794${h.meeting_link?`會議連結:${h.meeting_link}`:""}
795${h.location?`會議地點:${h.location}`:""}
796
797邀請連結:${m}
798
799期待您的參與!
800            `;try{await ee.integrations.Core.SendEmail({to:p.email,subject:`會議邀請:${h.meeting_title}`,body:x})}catch(y){console.error("Failed to send invite to",p.email,y)}}}return d},onSuccess:()=>{i.invalidateQueries(["meetings"]),alert("儲存成功!"),t()}}),o=h=>{h.preventDefault(),s.mutate(r)},l=()=>{n({...r,participants:[...r.participants,{name:"",email:"",status:"invited"}]})},c=(h,d,m)=>{const p=[...r.participants];p[h]={...p[h],[d]:m},n({...r,participants:p})},f=h=>{const d=[...r.participants];d.splice(h,1),n({...r,participants:d})};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯會議":"新增會議"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:o,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"會議主題 *"}),a.jsx(ne,{required:!0,value:r.meeting_title,onChange:h=>n({...r,meeting_title:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"會議類型"}),a.jsxs(qe,{value:r.meeting_type,onValueChange:h=>n({...r,meeting_type:h}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"online",className:"text-white",children:"線上會議"}),a.jsx(se,{value:"offline",className:"text-white",children:"實體會議"}),a.jsx(se,{value:"hybrid",className:"text-white",children:"混合會議"})]})]})]})]}),(r.meeting_type==="online"||r.meeting_type==="hybrid")&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"會議平台"}),a.jsxs(qe,{value:r.meeting_platform,onValueChange:h=>n({...r,meeting_platform:h}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"zoom",className:"text-white",children:"Zoom"}),a.jsx(se,{value:"google_meet",className:"text-white",children:"Google Meet"}),a.jsx(se,{value:"teams",className:"text-white",children:"Microsoft Teams"}),a.jsx(se,{value:"other",className:"text-white",children:"其他"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"線上會議連結"}),a.jsx(ne,{value:r.meeting_link,onChange:h=>n({...r,meeting_link:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]",placeholder:"https://zoom.us/..."})]})]}),(r.meeting_type==="offline"||r.meeting_type==="hybrid")&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"會議地點"}),a.jsx(ne,{value:r.location,onChange:h=>n({...r,location:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"開始時間 *"}),a.jsx(ne,{required:!0,type:"datetime-local",value:r.start_time,onChange:h=>n({...r,start_time:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"結束時間 *"}),a.jsx(ne,{required:!0,type:"datetime-local",value:r.end_time,onChange:h=>n({...r,end_time:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"主持人"}),a.jsx(ne,{value:r.organizer,onChange:h=>n({...r,organizer:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"會議議程"}),a.jsx(Pt,{value:r.agenda,onChange:h=>n({...r,agenda:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] h-24",placeholder:"輸入會議議程..."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Q,{children:"參與者"}),a.jsxs(te,{type:"button",size:"sm",onClick:l,variant:"outline",className:"bg-gray-800 border-gray-600",children:[a.jsx(Ct,{className:"w-4 h-4 mr-1"}),"新增"]})]}),a.jsx("div",{className:"space-y-2",children:r.participants.map((h,d)=>a.jsxs("div",{className:"flex gap-2 items-center bg-gray-900 p-2 rounded",children:[a.jsx(ne,{placeholder:"姓名",value:h.name,onChange:m=>c(d,"name",m.target.value),className:"bg-black border-gray-700 h-8 text-sm"}),a.jsx(ne,{placeholder:"Email",value:h.email,onChange:m=>c(d,"email",m.target.value),className:"bg-black border-gray-700 h-8 text-sm"}),a.jsx(te,{type:"button",size:"sm",variant:"ghost",onClick:()=>f(d),className:"text-red-400 hover:text-red-300",children:a.jsx(Qt,{className:"w-4 h-4"})})]},d))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"會議狀態"}),a.jsxs(qe,{value:r.status,onValueChange:h=>n({...r,status:h}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"scheduled",className:"text-white",children:"已排程"}),a.jsx(se,{value:"in_progress",className:"text-white",children:"進行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已取消"})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-700",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-gray-800 text-white border-gray-600 hover:bg-gray-700",children:"取消"}),a.jsxs(te,{type:"submit",disabled:s.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[s.isPending?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):null,s.isPending?"儲存中...":"儲存"]}
800)]})]})]})})}function Yve(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState(""),[c,f]=I.useState("all"),h=at(),{data:d=[],isLoading:m}=Te({queryKey:["meetings"],queryFn:()=>ee.entities.Meeting.list("-created_date")}),p=Ye({mutationFn:b=>ee.entities.Meeting.delete(b),onSuccess:()=>{h.invalidateQueries(["meetings"])}}),x=d.filter(b=>{var N,S;const w=!o||((N=b.meeting_title)==null?void 0:N.toLowerCase().includes(o.toLowerCase()))||((S=b.organizer)==null?void 0:S.toLowerCase().includes(o.toLowerCase())),_=c==="all"||b.status===c;return w&&_}),y=b=>{const w={scheduled:{label:"已排程",color:"#00FFFF"},in_progress:{label:"進行中",color:"#FFD700"},completed:{label:"已完成",color:"#00FF00"},cancelled:{label:"已取消",color:"#FF4444"}},{label:_,color:N}=w[b]||w.scheduled;return a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:`${N}33`,color:N,border:`1px solid ${N}`},children:_})},v=b=>b==="online"?a.jsx(wp,{className:"w-5 h-5 text-[#00FFFF]"}):b==="offline"?a.jsx(Uo,{className:"w-5 h-5 text-[#FFD700]"}):a.jsx(wp,{className:"w-5 h-5 text-purple-400"});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"會議管理"}),a.jsxs(te,{onClick:()=>{s(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增會議"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"總會議數"}),a.jsx("p",{className:"text-2xl font-bold cyber-text",children:d.length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已排程"}),a.jsx("p",{className:"text-2xl font-bold text-[#00FFFF]",children:d.filter(b=>b.status==="scheduled").length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"進行中"}),a.jsx("p",{className:"text-2xl font-bold text-[#FFD700]",children:d.filter(b=>b.status==="in_progress").length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已完成"}),a.jsx("p",{className:"text-2xl font-bold text-green-400",children:d.filter(b=>b.status==="completed").length})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋會議主題或主持人...",value:o,onChange:b=>l(b.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("select",{value:c,onChange:b=>f(b.target.value),className:"px-4 py-2 bg-black border border-gray-700 rounded text-white focus:border-[#00FFFF] focus:outline-none",children:[a.jsx("option",{value:"all",children:"所有狀態"}),a.jsx("option",{value:"scheduled",children:"已排程"}),a.jsx("option",{value:"in_progress",children:"進行中"}),a.jsx("option",{value:"completed",children:"已完成"}),a.jsx("option",{value:"cancelled",children:"已取消"})]})]})}),a.jsx("div",{className:"grid grid-cols-1 gap-4",children:m?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):x.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(Vs,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無會議資料"})]}):x.map(b=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[v(b.meeting_type),a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:b.meeting_title}),y(b.status)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{className:"text-gray-300 flex items-center gap-2",children:[a.jsx(Vs,{className:"w-4 h-4 text-[#00FFFF]"}
800),new Date(b.start_time).toLocaleString("zh-TW")]}),b.organizer&&a.jsxs("div",{className:"text-gray-300",children:["主持人:",b.organizer]}),b.meeting_type==="online"&&b.meeting_link&&a.jsx("div",{className:"col-span-2",children:a.jsxs("a",{href:b.meeting_link,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline flex items-center gap-1",children:[a.jsx(il,{className:"w-4 h-4"}),b.meeting_platform?`${b.meeting_platform} 會議室`:"線上會議連結"]})}),b.location&&a.jsxs("div",{className:"text-gray-300 flex items-center gap-2",children:[a.jsx(Uo,{className:"w-4 h-4 text-[#FFD700]"}),b.location]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>n(b),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"詳情"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{s(b),t(!0)},className:"border-gray-600 hover:bg-gray-800",children:a.jsx(qt,{className:"w-4 h-4 text-black"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{window.confirm("確定要刪除此會議嗎?")&&p.mutate(b.id)},className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},b.id))}),e&&a.jsx(Gve,{meeting:i,onClose:()=>{t(!1),s(null)}}),r&&a.jsx($6,{meeting:r,onClose:()=>n(null),onEdit:()=>{s(r),t(!0),n(null)}})]})}function Qve(){const e=at(),{data:t=[],isLoading:r}=Te({queryKey:["notifications"],queryFn:()=>ee.entities.Notification.list("-created_at",50)}),n=Ye({mutationFn:c=>ee.entities.Notification.update(c,{is_read:!0}),onSuccess:()=>e.invalidateQueries(["notifications"])}),i=Ye({mutationFn:c=>ee.entities.Notification.delete(c),onSuccess:()=>e.invalidateQueries(["notifications"])}),s=Ye({mutationFn:async()=>{const c=t.filter(f=>!f.is_read);await Promise.all(c.map(f=>ee.entities.Notification.update(f.id,{is_read:!0})))},onSuccess:()=>e.invalidateQueries(["notifications"])}),o=Ye({mutationFn:async()=>{await Promise.all(t.map(c=>ee.entities.Notification.delete(c.id)))},onSuccess:()=>e.invalidateQueries(["notifications"])}),l=c=>{switch(c){case"success":return a.jsx(xr,{className:"w-5 h-5 text-green-400"});case"warning":return a.jsx(WN,{className:"w-5 h-5 text-yellow-400"});case"error":return a.jsx(oi,{className:"w-5 h-5 text-red-400"});default:return a.jsx(sU,{className:"w-5 h-5 text-[#00FFFF]"})}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(vp,{className:"w-8 h-8 text-[#00FFFF]"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"通知中心"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(te,{variant:"outline",onClick:()=>s.mutate(),className:"bg-gray-800 border-gray-700 hover:bg-gray-700 text-white",children:[a.jsx(xp,{className:"w-4 h-4 mr-2"}),"全部已讀"]}),a.jsxs(te,{variant:"outline",onClick:()=>o.mutate(),className:"bg-red-900/20 border-red-900 text-red-400 hover:bg-red-900/40",children:[a.jsx(Qt,{className:"w-4 h-4 mr-2"}),"清除全部"]})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 min-h-[60vh]",children:r?a.jsx("div",{className:"text-center text-gray-400 py-8",children:"載入中..."}):t.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-gray-500",children:[a.jsx(vp,{className:"w-12 h-12 mb-4 opacity-20"}),a.jsx("p",{children:"目前沒有通知"})]}):a.jsx("div",{className:"space-y-4",children:t.map(c=>a.jsxs("div",{className:`flex items-start gap-4 p-4 rounded-lg border transition-all ${c.is_read?"bg-gray-900/30 border-gray-800 opacity-70":"bg-gray-900/80 border-[#00FFFF]/30 shadow-[0_0_10px_rgba(0,255,255,0.1)]"}`,children:[a.jsx("div",{className:"mt-1",children:l(c.type)}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h3",{className:`font-semibold ${c.is_read?"text-gray-400":"text-white"}`,children:c.title}),a.jsx("span",{className:"text-xs text-gray-500",children:new Date(c.created_at).toLocaleStr
800ing()})]}),a.jsx("p",{className:"text-sm text-gray-300 mb-2",children:c.message}),c.link&&a.jsxs(qi,{to:c.link,className:"text-xs text-[#00FFFF] hover:underline flex items-center gap-1 mb-2 w-fit",children:["查看詳情 ",a.jsx(il,{className:"w-3 h-3"})]})]}),a.jsxs("div",{className:"flex flex-col gap-2",children:[!c.is_read&&a.jsx("button",{onClick:()=>n.mutate(c.id),className:"p-1.5 hover:bg-gray-700 rounded text-gray-400 hover:text-white",title:"標記為已讀",children:a.jsx(xp,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>i.mutate(c.id),className:"p-1.5 hover:bg-red-900/30 rounded text-gray-500 hover:text-red-400",title:"刪除",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]},c.id))})})]})}function Xve({sale:e,onClose:t}){const[r,n]=I.useState({course_name:"",student_name:"",student_email:"",student_phone:"",login_password:"",platform_status:"not_activated",purchase_date:new Date().toISOString().split("T")[0],purchase_amount:"",payment_method:"",payment_status:"completed",notes:"",...e}),i=at(),s=Ye({mutationFn:l=>e?ee.entities.OnlineCourseSale.update(e.id,l):ee.entities.OnlineCourseSale.create(l),onSuccess:()=>{i.invalidateQueries(["onlineCourseSales"]),alert("儲存成功!"),t()}}),o=l=>{l.preventDefault(),s.mutate(r)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯銷售紀錄":"新增銷售紀錄"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:o,className:"p-6 space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"課程名稱 *"}),a.jsx(ne,{required:!0,value:r.course_name,onChange:l=>n({...r,course_name:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]",placeholder:"例如:Python 進階程式設計"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"學員姓名 *"}),a.jsx(ne,{required:!0,value:r.student_name,onChange:l=>n({...r,student_name:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"學員Email *"}),a.jsx(ne,{required:!0,type:"email",value:r.student_email,onChange:l=>n({...r,student_email:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"學員電話"}),a.jsx(ne,{value:r.student_phone,onChange:l=>n({...r,student_phone:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"登入密碼"}),a.jsx(ne,{value:r.login_password,onChange:l=>n({...r,login_password:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"平台開通狀態"}),a.jsxs(qe,{value:r.platform_status,onValueChange:l=>n({...r,platform_status:l}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"not_activated",className:"text-white",children:"未開通"}),a.jsx(se,{value:"activated",className:"text-white",children:"已開通"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"購買日期 *"}),a.jsx(ne,{required:!0,type:"date",value:r.purchase_date,onChange:l=>n({...r,purchase_date:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"購買金額 *"}),a.jsx(ne,{required:!0,type:"number",value:r.purchase_amount,onChange:l=>n({...r,purchase_amount:parseFloat(l.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"付款方式"}),a.jsx(ne,{value:r.payment_method,onChange:l=>n({...r,payment_method:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]",placeholder:"ä¾
800‹å¦‚:信用卡、ATM轉帳"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"付款狀態"}),a.jsxs(qe,{value:r.payment_status,onValueChange:l=>n({...r,payment_status:l}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"completed",className:"text-white",children:"已完成"}),a.jsx(se,{value:"pending",className:"text-white",children:"待付款"}),a.jsx(se,{value:"refunded",className:"text-white",children:"已退款"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:r.notes,onChange:l=>n({...r,notes:l.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] h-20"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-[#8B0000] text-white border-[#8B0000] hover:bg-[#660000]",children:"取消"}),a.jsxs(te,{type:"submit",disabled:s.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[s.isPending?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):null,s.isPending?"儲存中...":"儲存"]})]})]})]})})}function Zve(){const[e,t]=I.useState(""),[r,n]=I.useState(""),[i,s]=I.useState(""),[o,l]=I.useState(null),[c,f]=I.useState(!1),[h,d]=I.useState(null),m=at(),{data:p=[],isLoading:x}=Te({queryKey:["onlineCourseSales"],queryFn:()=>ee.entities.OnlineCourseSale.list("-purchase_date")}),y=Ye({mutationFn:S=>ee.entities.OnlineCourseSale.delete(S),onSuccess:()=>m.invalidateQueries(["onlineCourseSales"])}),v=I.useMemo(()=>{const S={};return p.forEach(k=>{S[k.course_name]||(S[k.course_name]={course_name:k.course_name,total_sales:0,total_amount:0,buyers:[]}),S[k.course_name].total_sales+=1,S[k.course_name].total_amount+=k.purchase_amount||0,S[k.course_name].buyers.push(k)}),Object.values(S).filter(k=>!e||k.course_name.toLowerCase().includes(e.toLowerCase()))},[p,e]),b=I.useMemo(()=>o?p.filter(S=>{if(S.course_name!==o)return!1;let k=!0;return r&&(k=new Date(S.purchase_date)>=new Date(r)),i&&k&&(k=new Date(S.purchase_date)<=new Date(i)),k}):[],[p,o,r,i]),w=p.length,_=p.reduce((S,k)=>S+(k.purchase_amount||0),0),N=()=>{const S=o?b:p,k=["購買日期","課程名稱","學員姓名","Email","電話","金額","付款方式","付款狀態"],C=S.map(E=>[E.purchase_date,E.course_name,E.student_name,E.student_email,E.student_phone||"",E.purchase_amount,E.payment_method||"",E.payment_status==="completed"?"已完成":E.payment_status==="pending"?"待付款":"已退款"].map(T=>`"${String(T).replace(/"/g,'""')}"`).join(",")),O="\uFEFF"+[k.join(","),...C].join(`
801`),R=new Blob([O],{type:"text/csv;charset=utf-8;"}),A=URL.createObjectURL(R),P=document.createElement("a");P.href=A,P.setAttribute("download",`OnlineCourseSales_${new Date().toISOString().slice(0,10)}.csv`),document.body.appendChild(P),P.click(),document.body.removeChild(P)};return x?a.jsx("div",{className:"p-8 text-center text-gray-400",children:"載入中..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[o&&a.jsxs(te,{variant:"ghost",onClick:()=>l(null),className:"text-gray-400 hover:text-white",children:[a.jsx(zf,{className:"w-5 h-5 mr-2"}),"返回課程列表"]}),a.jsx(CL,{className:"w-8 h-8 cyber-text"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:o?`${o} - 購買者清單`:"線上課程銷售管理"})]}),a.jsxs(te,{onClick:()=>{d(null),f(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增銷售紀錄"]})]}),!o&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 mb-1",children:"總銷售數量"}),a.jsxs("p",{className:"text-3xl font-bold text-[#00FFFF]",children:[w," ",a.jsx("span",{className:"text-sm text-gray-500",children:"筆"})]})]}),a.jsx(MU,{className:"w-12 h-12 text-[#00FFFF] opacity-20"})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 mb-1",children:"總銷售金額"}),a.jsxs("p",{className:"text-3xl font-bold text-[#00FFFF]",children:["NT$ ",_.toLocaleStr
801ing()]})]}),a.jsx(ut,{className:"w-12 h-12 text-[#00FFFF] opacity-20"})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:o?a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ne,{type:"date",value:r,onChange:S=>n(S.target.value),className:"bg-black border-gray-700",placeholder:"開始日期"}),a.jsx("span",{className:"text-gray-400 self-center",children:"-"}),a.jsx(ne,{type:"date",value:i,onChange:S=>s(S.target.value),className:"bg-black border-gray-700",placeholder:"結束日期"})]}),a.jsxs(te,{variant:"outline",onClick:()=>{n(""),s("")},className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(jj,{className:"w-4 h-4 mr-2"}),"重置篩選"]}),a.jsxs(te,{variant:"outline",onClick:N,className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(li,{className:"w-4 h-4 mr-2"}),"匯出此課程"]})]}):a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋課程名稱...",value:e,onChange:S=>t(S.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(te,{variant:"outline",onClick:N,className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(li,{className:"w-4 h-4 mr-2"}),"匯出全部"]})]})}),!o&&a.jsx("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{className:"border-gray-700 hover:bg-transparent",children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"課程名稱"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"總銷售量"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"總銷售額"}),a.jsx(Le,{className:"text-[#00FFFF] text-center",children:"操作"})]})}),a.jsx(Jn,{children:v.length===0?a.jsx(Dt,{children:a.jsx(Me,{colSpan:4,className:"text-center py-8 text-gray-500",children:"無銷售資料"})}):v.map((S,k)=>a.jsxs(Dt,{className:"border-gray-700 hover:bg-gray-900/50",children:[a.jsx(Me,{className:"font-medium text-white",children:S.course_name}),a.jsxs(Me,{className:"text-right text-gray-300",children:[S.total_sales," 筆"]}),a.jsxs(Me,{className:"text-right text-[#00FFFF] font-mono text-lg",children:["NT$ ",S.total_amount.toLocaleString()]}),a.jsx(Me,{className:"text-center",children:a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>l(S.course_name),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(Xr,{className:"w-4 h-4 mr-2"}),"購買者 (",S.total_sales,")"]})})]},k))})]})}),o&&a.jsx("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{className:"border-gray-700 hover:bg-transparent",children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"購買日期"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"學員姓名"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"Email"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"電話"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"登入密碼"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"平台開通"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"購買金額"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"付款狀態"}),a.jsx(Le,{className:"text-[#00FFFF] text-center",children:"操作"})]})}),a.jsx(Jn,{children:b.length===0?a.jsx(Dt,{children:a.jsx(Me,{colSpan:9,className:"text-center py-8 text-gray-500",children:"無購買者資料"})}):b.map(S=>a.jsxs(Dt,{className:"border-gray-700 hover:bg-gray-900/50",children:[a.jsx(Me,{className:"text-gray-300",children:S.purchase_date}),a.jsx(Me,{className:"font-medium text-white",children:S.student_name}),a.jsx(Me,{className:"text-gray-300",children:S.student_email}),a.jsx(Me,{className:"text-gray-300",children:S.student_phone||"-"}),a.jsx(Me,{className:"text-gray-300",children:S.login_password||"-"}),a.jsx(Me,{children:a.jsx("span",{className:`px-2 py-1 rounded text-xs ${S.platform_status==="activated"?"bg-green-900 text-green-300":"bg-yellow-900 text-yellow-300"}`,children:S.platform_status==="activated"?"已開通":"未開通"})}),a.jsxs(Me,{className:"text-right text-[#00FFFF] font-mono",children:["NT$ ",(S.purchase_amount||0).toLocaleStr
801ing()]}),a.jsx(Me,{children:a.jsx("span",{className:`px-2 py-1 rounded text-xs ${S.payment_status==="completed"?"bg-green-900 text-green-300":S.payment_status==="pending"?"bg-yellow-900 text-yellow-300":"bg-red-900 text-red-300"}`,children:S.payment_status==="completed"?"已完成":S.payment_status==="pending"?"待付款":"已退款"})}),a.jsx(Me,{className:"text-center",children:a.jsxs("div",{className:"flex gap-2 justify-center",children:[a.jsx(te,{variant:"ghost",size:"sm",onClick:()=>{d(S),f(!0)},className:"text-[#00FFFF] hover:text-[#00CCCC] hover:bg-gray-800",children:a.jsx(qt,{className:"w-4 h-4"})}),a.jsx(te,{variant:"ghost",size:"sm",onClick:()=>{confirm("確定刪除此銷售記錄?")&&y.mutate(S.id)},className:"text-red-400 hover:text-red-300 hover:bg-red-900/20",children:a.jsx(Qt,{className:"w-4 h-4"})})]})})]},S.id))})]})}),c&&a.jsx(Xve,{sale:h,onClose:()=>{f(!1),d(null)}})]})}function Jve({onConfirm:e,onCancel:t}){const r=I.useRef(null),[n,i]=I.useState(!1),[s,o]=I.useState(!0);I.useEffect(()=>{const m=r.current;if(m){const p=m.getContext("2d");p.lineWidth=3,p.lineCap="round",p.strokeStyle="#000000"}},[]);const l=m=>{i(!0),o(!1);const p=r.current,x=p.getContext("2d"),y=p.getBoundingClientRect(),v=(m.clientX||m.touches[0].clientX)-y.left,b=(m.clientY||m.touches[0].clientY)-y.top;x.beginPath(),x.moveTo(v,b)},c=m=>{if(!n)return;m.preventDefault();const p=r.current,x=p.getContext("2d"),y=p.getBoundingClientRect(),v=(m.clientX||m.touches[0].clientX)-y.left,b=(m.clientY||m.touches[0].clientY)-y.top;x.lineTo(v,b),x.stroke()},f=()=>{i(!1)},h=()=>{const m=r.current;m.getContext("2d").clearRect(0,0,m.width,m.height),o(!0)},d=()=>{if(s){alert("請先簽名");return}const m=r.current;e(m.toDataURL())};return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"border-2 border-dashed border-gray-600 rounded-lg bg-white overflow-hidden touch-none",children:a.jsx("canvas",{ref:r,width:600,height:300,className:"w-full h-[200px] md:h-[300px] cursor-crosshair",onMouseDown:l,onMouseMove:c,onMouseUp:f,onMouseLeave:f,onTouchStart:l,onTouchMove:c,onTouchEnd:f})}),a.jsxs("div",{className:"flex gap-2 justify-end",children:[a.jsxs(te,{variant:"outline",onClick:h,className:"border-gray-600 text-gray-300 hover:bg-gray-800",children:[a.jsx(SU,{className:"w-4 h-4 mr-2"}),"清除"]}),t&&a.jsx(te,{variant:"outline",onClick:t,className:"border-red-600 text-red-400 hover:bg-red-900/20",children:"取消"}),a.jsxs(te,{onClick:d,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(xp,{className:"w-4 h-4 mr-2"}),"確認簽名"]})]})]})}function NM({onSelect:e,type:t="personal"}){const[r,n]=I.useState([]),[i,s]=I.useState(!1),o=`base44_stamps_${t}`;I.useEffect(()=>{const f=localStorage.getItem(o);if(f)try{n(JSON.parse(f))}catch(h){console.error("Failed to parse stamps",h)}},[t]);const l=async f=>{const h=f.target.files[0];if(h)try{s(!0);const{file_url:d}=await ee.integrations.Core.UploadFile({file:h}),p=[{id:Date.now(),url:d,name:h.name,date:new Date().toISOString()},...r];n(p),localStorage.setItem(o,JSON.stringify(p)),e(d)}catch(d){console.error("Upload failed",d),alert("上傳失敗")}finally{s(!1)}},c=(f,h)=>{h.stopPropagation();const d=r.filter(m=>m.id!==f);n(d),localStorage.setItem(o,JSON.stringify(d))};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[a.jsxs("label",{className:"cursor-pointer flex flex-col items-center justify-center h-24 border-2 border-dashed border-gray-600 rounded-lg hover:border-[#00FFFF] transition-colors bg-gray-900/50",children:[a.jsx(Hr,{className:"w-6 h-6 text-gray-400 mb-2"}),a.jsx("span",{className:"text-xs text-gray-400",children:i?"上傳中...":"上傳新印章"}),a.jsx("input",{type:"file",accept:"image/*",onChange:l,className:"hidden"})]}),r.map(f=>a.jsxs("div",{onClick:()=>e(f.url),className:"relative group cursor-pointer h-24 border border-gray-700 rounded-lg bg-white/5 p-2 flex items-center justify-center hover:border-[#00FFFF]",children:[a.jsx("img",{src:f.url,alt:"Stamp",className:"max-w-full max-h-full object-contain"}),a.jsx("button",{onClick:h=>c(f.id,h),className:"absolute top-1 right-1 p-1 bg-red-900/80 rounded-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-800",children:a.jsx(Qt,{className:"w-3 h-3 text-white"})})]},f.id))]}),r.length===0&&a.jsx("p",{className:"text-center text-gray-500 text-sm",children:"尚無儲存的印章"})]})}function e0e(){var H;
801const[e,t]=I.useState(null),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState(""),[c,f]=I.useState(!1),[h,d]=I.useState(null),[m,p]=I.useState(null),[x,y]=I.useState(null),[v,b]=I.useState({}),[w,_]=I.useState({x:50,y:50}),[N,S]=I.useState("draw"),[k,C]=I.useState(null);I.useEffect(()=>{const K=new URLSearchParams(window.location.search),q=K.get("id"),L=K.get("contract_id"),V=K.get("signer");q&&t(q),L&&n(L),V&&s(decodeURIComponent(V)),ee.auth.me().then(z=>C(z)).catch(()=>{})},[]);const{data:O,refetch:R}=Te({queryKey:["esignature",e],queryFn:()=>ee.entities.ESignature.list(),enabled:!!e,select:K=>K.find(q=>q.id===e)}),A=r||(O==null?void 0:O.contract_id),{data:P,isLoading:E}=Te({queryKey:["contract",A],queryFn:()=>ee.entities.Contract.list(),enabled:!!A,select:K=>K.find(q=>q.id===A)}),T=e?(H=O==null?void 0:O.signers)==null?void 0:H.find(K=>K.signer_email===i):{signer_name:(k==null?void 0:k.full_name)||"Guest",signer_email:(k==null?void 0:k.email)||"[email protected]",status:"pending"},$=e&&O||r&&P,D=e&&(T==null?void 0:T.status)==="signed",W=(K,q)=>{const L=document.createElement("canvas"),V=L.getContext("2d");V.font='bold 24px "Microsoft JhengHei", sans-serif';const z=V.measureText(K).width+20;L.width=z,L.height=40,V.fillStyle="transparent",V.fillRect(0,0,L.width,L.height),V.font='bold 24px "Microsoft JhengHei", sans-serif',V.fillStyle="#000000",V.textAlign="center",V.textBaseline="middle",V.fillText(K,L.width/2,L.height/2),b(Z=>({...Z,[q]:L.toDataURL()}))},U=Ye({mutationFn:async()=>{if(!h&&!m&&!x)throw new Error("請至少提供簽名或印章");const K={signature:h,company_stamp:m,personal_stamp:x,text_fields:v,stamp_position:w,signed_at:new Date().toISOString()};if(e&&O){const q=O.signers.map(V=>V.signer_email===i?{...V,status:"signed",signature_date:new Date().toISOString(),signed_document_url:P.file_url,signature_data:K,ip_address:"Client IP"}:V),L=q.every(V=>V.status==="signed");await ee.entities.ESignature.update(e,{signers:q,status:L?"completed":"in_progress",audit_trail:[...O.audit_trail||[],{timestamp:new Date().toISOString(),action:"SIGN",actor:T.signer_name,details:"完成電子簽署",ip_address:"Client IP"}],...L&&{completed_date:new Date().toISOString()}})}else r&&(await ee.entities.ESignature.create({contract_id:r,contract_number:P.contract_number,project_name:P.project_name,workflow_type:"parallel",status:"completed",created_date:new Date().toISOString(),completed_date:new Date().toISOString(),signers:[{signer_name:(k==null?void 0:k.full_name)||"Direct Signer",signer_email:k==null?void 0:k.email,signer_role:"Signer",status:"signed",signature_date:new Date().toISOString(),signature_data:K,ip_address:"Client IP"}],audit_trail:[{timestamp:new Date().toISOString(),action:"DIRECT_SIGN",actor:k==null?void 0:k.full_name,details:"直接啟動簽名板完成簽署"}]}),await ee.entities.Contract.update(r,{status:"active"}))},onSuccess:()=>{alert("✅ 簽署完成!合約已生效。"),e?R():window.history.back()},onError:K=>alert(K.message)});return E?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:a.jsx(Ht,{className:"w-8 h-8 animate-spin text-[#00FFFF]"})}):$?D?a.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center p-4 text-center",children:a.jsxs("div",{children:[a.jsx(xr,{className:"w-16 h-16 text-green-500 mx-auto mb-4"}),a.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"已完成簽署"}),a.jsx("p",{className:"text-gray-400",children:"感謝您的配合"})]})}):a.jsxs("div",{className:"min-h-screen bg-black flex flex-col md:flex-row overflow-hidden",children:[a.jsxs("div",{className:"w-full md:w-3/5 h-[50vh] md:h-screen bg-gray-900 border-r border-gray-800 flex flex-col relative",children:[a.jsxs("div",{className:"p-4 border-b border-gray-800 flex items-center justify-between bg-black z-20",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Et,{className:"w-5 h-5 text-[#00FFFF]"}),a.jsx("span",{className:"text-white font-bold",children:"合約簽名套印區"})]}),a.jsx("div",{className:"flex gap-2",children:(P==null?void 0:P.file_url)&&a.jsxs("a",{href:P.file_url,download:!0,className:"text-sm text-gray-400 flex items-center hover:text-white",children:[a.jsx(il,{className:"w-4 h-4 mr-1"}),"下載合約"]})})]}),a.jsx("div",{className:"flex-1 relative bg-[#1a1a1a] overflow-auto flex items-center justify-center p-8",children:a.jsxs("div",{className:"relative w-full max-w-4xl aspect-[1/1.414] bg-white shadow-2xl rounded-lg",children:[(P==null?void 0:P.file_url)&&(P.file_url.toLowerCase().includes(".pdf")?a.jsx("div",{className:"absolute inset-0 opacity-30 pointer-events-none",children:a.jsx("iframe",{src:`${P.file_url}#toolbar=0&navpanes=0&scrollbar=0&view=FitH`,className:"w-full h-full border-0",title:"Contract Backgroun
801d"})}):a.jsx("div",{className:"absolute inset-0",children:a.jsx("img",{src:P.file_url,alt:"Contract",className:"w-full h-full object-cover opacity-30 pointer-events-none"})})),(h||m||x||v.name||v.date)&&a.jsxs("div",{className:"absolute p-3 border-2 border-dashed border-[#00FFFF] bg-white/90 backdrop-blur-sm rounded-lg cursor-move hover:bg-white hover:shadow-xl transition-all",style:{top:`${w.y}%`,left:`${w.x}%`,transform:"translate(-50%, -50%)"},draggable:!0,onDragEnd:K=>{const q=K.target.parentElement.getBoundingClientRect(),L=Math.min(Math.max((K.clientX-q.left)/q.width*100,0),100),V=Math.min(Math.max((K.clientY-q.top)/q.height*100,0),100);_({x:L,y:V})},children:[a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[h&&a.jsx("div",{className:"border-b border-gray-300 pb-2",children:a.jsx("img",{src:h,className:"h-20 object-contain",alt:"Signature"})}),a.jsxs("div",{className:"flex gap-3",children:[m&&a.jsx("img",{src:m,className:"h-20 object-contain",alt:"Company Stamp"}),x&&a.jsx("img",{src:x,className:"h-20 object-contain",alt:"Personal Stamp"})]}),a.jsxs("div",{className:"flex gap-2",children:[v.name&&a.jsx("span",{className:"text-lg font-bold text-gray-900 bg-white/80 px-3 py-1 rounded",children:T.signer_name||(k==null?void 0:k.full_name)}),v.date&&a.jsx("span",{className:"text-sm text-gray-700 bg-white/80 px-2 py-1 rounded",children:new Date().toLocaleDateString()})]})]}),a.jsx("div",{className:"absolute -top-8 left-1/2 -translate-x-1/2 text-xs text-black bg-[#00FFFF] px-3 py-1 rounded font-bold whitespace-nowrap shadow-lg",children:"拖曳調整簽名位置"})]}),!(h||m||x||v.name||v.date)&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsxs("div",{className:"text-center text-gray-400 bg-black/50 p-8 rounded-lg",children:[a.jsx(Et,{className:"w-12 h-12 mx-auto mb-3 text-[#00FFFF]"}),a.jsx("p",{className:"text-lg font-semibold",children:"請使用右側工具完成簽名"}),a.jsx("p",{className:"text-sm mt-2",children:"簽名後將顯示在此處並可拖曳調整位置"})]})})]})})]}),a.jsxs("div",{className:"w-full md:w-2/5 h-[50vh] md:h-screen flex flex-col bg-black border-l border-gray-800",children:[a.jsxs("div",{className:"p-6 border-b border-gray-800",children:[a.jsx("h1",{className:"text-2xl font-bold cyber-text mb-1",children:"線上簽署"}),a.jsxs("p",{className:"text-gray-400 text-sm",children:["簽署人:",T.signer_name||(k==null?void 0:k.full_name)]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-8",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("h3",{className:"text-sm font-medium text-gray-400 uppercase tracking-wider flex items-center gap-2",children:[a.jsx(Vs,{className:"w-4 h-4"})," 快速填寫"]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs(te,{variant:"outline",className:`justify-start border-gray-600 bg-gray-700 text-white hover:bg-gray-600 ${v.name?"ring-2 ring-[#00FFFF]":""}`,onClick:()=>W(T.signer_name||(k==null?void 0:k.full_name),"name"),children:[a.jsx(Uf,{className:"w-4 h-4 mr-2 text-white"}),"填入姓名"]}),a.jsxs(te,{variant:"outline",className:`justify-start border-gray-600 bg-gray-700 text-white hover:bg-gray-600 ${v.date?"ring-2 ring-[#00FFFF]":""}`,onClick:()=>W(new Date().toLocaleDateString(),"date"),children:[a.jsx(Vs,{className:"w-4 h-4 mr-2 text-white"}),"填入日期"]})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("h3",{className:"text-sm font-medium text-gray-400 uppercase tracking-wider",children:"簽名與印章"}),a.jsxs(P8,{value:N,onValueChange:S,className:"w-full",children:[a.jsxs(Fk,{className:"grid grid-cols-2 bg-gray-900",children:[a.jsx(fc,{value:"draw",children:"手繪簽名"}),a.jsx(fc,{value:"stamp",children:"公司/個人印章"})]}),a.jsxs(Rg,{value:"draw",className:"mt-4 space-y-4",children:[a.jsx("div",{className:"bg-white rounded-lg p-1 border-2 border-transparent focus-within:border-[#00FFFF]",children:a.jsx(Jve,{onConfirm:K=>{d(K)}})}),h&&a.jsxs("div",{className:"flex items-center gap-2 text-[#00FFFF] bg-[#00FFFF]/10 p-3 rounded border border-[#00FFFF]/30",children:[a.jsx(xr,{className:"w-5 h-5"}),a.jsx("span",{children:"簽名已就緒"}),a.jsx(te,{size:"sm",variant:"ghost",onClick:()=>d(null),className:"ml-auto h-6 text-red-400 hover:text-red-300",children:"清除"})]})]}),a.jsxs(Rg,{value:"stamp",className:"mt-4 space-y-6",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-300 mb-2 block",children:"個人印章 (Personal)"}),a.jsx(NM,{type:"personal",onSelect:y}),x&&a.jsxs("div",{className:"mt-2 text-[#00FFFF] text-sm flex items-center",children:[a.jsx(xr,{className:"w-3 h-3 mr-1"})," 已選取個人章"]})]}),a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-300 mb-2 block",children:"公司印章 (Company)"}),a.jsx(NM,{type:"company",onSelect:p}),m&&a.jsxs("div",{className:"mt-2 text-[#00FFFF] text-sm flex items-center",children:[a.jsx(xr,{className:"w-3 h-3 mr-1"})," 已選取公司章"]})]})]})]})]})]}),a.jsxs("div",{className:"p-6 border-t border-gray-800 bg-gray-900/50 space-y-3",children:[a.jsxs(te,{onClick:()=>U.mutate(),disabled:U.isPending||!h&&!m&&!x,className:"w-full bg-[#00FFFF] text-black hover:bg-[#00CCCC] h-12 text-lg font-bold shadow-[0_0_15px_rgba(0,255,255,0.3)] hover:shadow-[0_0_25px_rgba(0,255,255,0.5)] transition-all",children:[U.isPending?a.jsx(Ht,{className:"w-5 h-5 animate-spin"}):a.jsx(xr,{className:"w-5 h-5 mr-2"}
801),"確認簽署合約"]}),e&&a.jsxs(te,{onClick:()=>f(!0),variant:"outline",className:"w-full border-red-900 text-red-500 hover:bg-red-900/20",children:[a.jsx($s,{className:"w-4 h-4 mr-2"}),"拒絕簽署"]})]})]}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded-lg max-w-md w-full p-6 space-y-4",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"拒絕原因"}),a.jsx(Pt,{value:o,onChange:K=>l(K.target.value),className:"bg-black border-gray-700 text-white",placeholder:"請輸入拒絕理由..."}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx(te,{onClick:()=>f(!1),variant:"ghost",className:"flex-1 text-gray-400",children:"取消"}),a.jsx(te,{onClick:()=>{},className:"flex-1 bg-red-600 hover:bg-red-700 text-white",children:"確認拒絕"})]})]})})]}):a.jsxs("div",{className:"min-h-screen bg-black flex items-center justify-center text-white flex-col gap-4",children:[a.jsx($s,{className:"w-12 h-12 text-red-500"}),a.jsx("p",{className:"text-lg",children:"連結無效或參數缺失"}),a.jsx(te,{onClick:()=>window.history.back(),variant:"outline",children:"返回"})]})}function t0e({order:e,quotes:t,onClose:r}){const[n,i]=I.useState({order_number:`ORD-${Date.now()}`,quote_id:"",quote_number:"",project_name:"",customer_name:"",total_amount:0,order_date:new Date().toISOString().split("T")[0],delivery_date:"",status:"pending",systems:[],notes:"",file_url:"",...e}),[s,o]=I.useState(!1),l=at(),c=Ye({mutationFn:p=>e?ee.entities.Order.update(e.id,p):ee.entities.Order.create(p),onSuccess:p=>{l.invalidateQueries(["orders"]);const x=e?"訂單已更新":"新訂單建立";let y="";e?p.status!==e.status?y=`訂單 ${p.order_number} 狀態已變更為 ${p.status}。`:y=`訂單 ${p.order_number} 資料已更新。`:y=`已建立新訂單 ${p.order_number},客戶:${p.customer_name}。`,ee.entities.Notification.create({title:x,message:y,type:"info",link:"/Orders",created_at:new Date().toISOString()}).catch(console.error),alert("儲存成功!"),r()}}),f=p=>{const x=t.find(y=>y.id===p);x&&i(y=>({...y,quote_id:p,quote_number:x.quote_number,project_name:x.project_name,customer_name:x.customer_name,total_amount:x.total_amount,systems:x.systems||[]}))},h=async p=>{const x=p.target.files[0];if(x)try{o(!0);const{file_url:y}=await ee.integrations.Core.UploadFile({file:x});i(v=>({...v,file_url:y}))}catch(y){console.error("Upload failed:",y),alert("上傳失敗,請重試")}finally{o(!1)}},d=p=>{p.preventDefault(),c.mutate(n)},m=t.filter(p=>p.status==="accepted");return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯訂單":"新增訂單"}),a.jsx("button",{onClick:r,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:d,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"訂單編號 *"}),a.jsx(ne,{required:!0,value:n.order_number,onChange:p=>i({...n,order_number:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"選擇報價單(已接受)"}),a.jsxs(qe,{value:n.quote_id,onValueChange:f,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"從已接受的報價單帶入"})}),a.jsx($e,{className:"bg-black border-gray-700",children:m.map(p=>a.jsxs(se,{value:p.id,className:"text-white",children:[p.quote_number," - ",p.project_name]},p.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"專案名稱 *"}),a.jsx(ne,{required:!0,value:n.project_name,onChange:p=>i({...n,project_name:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶名稱 *"}),a.jsx(ne,{required:!0,value:n.customer_name,onChange:p=>i({...n,customer_name:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"訂單金額 *"}),a.jsx(ne,{type:"number",required:!0,value:n.total_amount,onChange:p=>i({...n,total_amount:parseFloat(p.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"訂單日期 *"}),a.jsx(ne,{type:"date",required:!0,value:n.order_date,onChange:p=>i({...n,order_date:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"預計交付日期"}),a.jsx(ne,{type:"date",value:n.delivery_date,onChange:p=>i({...n,delivery_date:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"訂單狀態"}),a.jsxs(qe,{value:n.status,onValueChange:p=>i({...n,status:p}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"pending",className:"text-white",children:"待確認"}),a.jsx(se,{value:"confirmed",className:"text-white",children:"已確認"}),a.jsx(se,{value:"in_progress",className:"text-white",children:"進行中"}),a.jsx(se,{value:"delivered",className:"text-white",children:"已交付"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已取消"})]})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:n.notes,onChange:p=>i({...n,notes:p.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-24"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"訂單 PDF 附件"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{type:"button",variant:"outline",onClick:()=>document.getElementById("order-file-upload").click(),className:"bg-gray-800 border-gray-700 hover:bg-gray-700",disabled:s,children:[s?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),s?"上傳中...":"上傳 PDF"]}),a.jsx(ne,{id:"order-file-upload",type:"file",accept:".pdf",className:"hidden",onChange:h}),n.file_url&&a.jsxs("span",{className:"text-sm text-[#00FFFF] flex items-center",children:[a.jsx("a",{href:n.file_url,target:"_blank",rel:"noreferrer",className:"hover:underline",children:"已上傳檔案 (點擊查看)"}),a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>i(p=>({...p,file_url:""})),className:"text-red-500 hover:text-red-400 ml-2",children:a.jsx(vt,{className:"w-4 h-4"})})]})]})]}),n.systems&&n.systems.length>0&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-3",children:"訂單項目(從報價單帶入)"}),a.jsx("div",{className:"text-sm text-gray-400 space-y-2",children:n.systems.map((p,x)=>{var y;return a.jsxs("div",{className:"border-l-2 border-[#00FFFF] pl-3",children:[a.jsx("p",{className:"font-semibold text-[#00FFFF]",children:p.system_name}),(y=p.modules)==null?void 0:y.map((v,b)=>a.jsxs("p",{className:"ml-3 text-gray-300",children:["• ",v.module_name," - NT$ ",((v.amount||0)*(v.quantity||1)).toLocaleStr
801ing()]},b))]},x)})})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:r,className:"bg-[#8B0000] text-white border-[#8B0000] hover:bg-[#660000]",children:"取消"}),a.jsx(te,{type:"submit",disabled:c.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:c.isPending?"儲存中...":"儲存"})]})]})]})})}function r0e({order:e,onClose:t,onEdit:r}){const[n,i]=I.useState(!1),s=l=>({pending:"待確認",confirmed:"已確認",in_progress:"進行中",delivered:"已交付",completed:"已完成",cancelled:"已取消"})[l]||l,o=async()=>{let l={};try{const f=await ee.entities.CompanySetting.list();f.length>0&&(l=f[0])}catch(f){console.error("Failed to load settings:",f)}const c=window.open("","_blank");c.document.write(`
802      <html>
803        <head>
804          <title>訂單 - ${e.order_number}</title>
805          <meta charset="UTF-8">
806          <style>
807            @page { size: A4; margin: 10mm; }
808            * { margin: 0; padding: 0; box-sizing: border-box; }
809            body { 
810              font-family: "Microsoft JhengHei", "Heiti TC", sans-serif; 
811              color: #000;
812              font-size: 10pt;
813              line-height: 1.3;
814            }
815            .container {
816              width: 100%;
817              max-width: 210mm;
818              margin: 0 auto;
819            }
820            .header-top { 
821              display: flex;
822              justify-content: space-between;
823              align-items: flex-end;
824              border-bottom: 2px solid #000;
825              padding-bottom: 10px;
826              margin-bottom: 20px;
827            }
828            .company-info h1 {
829              font-size: 24pt;
830              font-weight: bold;
831              margin-bottom: 5px;
832              color: #000;
833            }
834            .company-info p {
835              font-size: 9pt;
836              color: #555;
837            }
838            .doc-title {
839              text-align: right;
840            }
841            .doc-title h2 {
842              font-size: 20pt;
843              letter-spacing: 5px;
844              margin-bottom: 5px;
845              background-color: #000;
846              color: #fff;
847              padding: 5px 15px;
848              display: inline-block;
849            }
850            .info-grid {
851              display: grid;
852              grid-template-columns: 1fr 1fr;
853              gap: 20px;
854              margin-bottom: 20px;
855            }
856            .info-box {
857              border: 1px solid #000;
858              padding: 10px;
859            }
860            .info-box h3 {
861              font-size: 11pt;
862              border-bottom: 1px solid #ccc;
863              padding-bottom: 5px;
864              margin-bottom: 5px;
865              background-color: #f0f0f0;
866              padding: 5px;
867            }
868            .info-row {
869              display: flex;
870              margin-bottom: 4px;
871            }
872            .label {
873              width: 80px;
874              color: #666;
875            }
876            .value {
877              flex: 1;
878              font-weight: 500;
879            }
880            table.items-table {
881              width: 100%;
882              border-collapse: collapse;
883              margin-bottom: 20px;
884            }
885            table.items-table th {
886              background-color: #000;
887              color: #fff;
888              padding: 8px;
889              text-align: left;
890              font-size: 10pt;
891            }
892            table.items-table td {
893              border-bottom: 1px solid #ddd;
894              padding: 8px;
895              vertical-align: top;
896            }
897            .amount-col { text-align: right; }
898            .center-col { text-align: center; }
899            .total-section {
900              display: flex;
901              justify-content: flex-end;
902              margin-bottom: 30px;
903            }
904            .total-box {
905              width: 300px;
906            }
907            .total-row {
908              display: flex;
909              justify-content: space-between;
910              padding: 5px 0;
911              border-bottom: 1px solid #ddd;
912            }
913            .grand-total {
914              font-size: 14pt;
915              font-weight: bold;
916              border-bottom: 2px solid #000;
917              border-top: 2px solid #000;
918              margin-top: 5px;
919              padding: 10px 0;
920            }
921            .terms-section {
922              margin-bottom: 40px;
923              font-size: 9pt;
924            }
925            .signature-section {
926              display: grid;
927              grid-template-columns: 1fr 1fr;
928              gap: 40px;
929              margin-top: 50px;
930            }
931            .signature-box {
932              border-top: 1px solid #000;
933              padding-top: 10px;
934              text-align: center;
935            }
936            .footer {
937              text-align: center;
938              font-size: 8pt;
939              color: #999;
940              margin-top: 50px;
941              border-top: 1px solid #eee;
942              padding-top: 10px;
943            }
944          </style>
945        </head>
946        <body>
947          <div class="container">
948            <div class="header-top">
949              <div class="company-info">
950                ${l.company_logo_url?`<img src="${l.company_logo_url}" alt="LOGO" style="height: 50px; margin-bottom: 10px;" />`:""}
951                <h1>${l.company_name||"無限未來有限公司"}</h1>
952                <p>
953                  統一編號:${l.tax_id||""} | 
954                  電話:${l.phone||""} | 
955                  Email:${l.email||""}<br/>
956                  地址:${l.address||""}
957                </p>
958              </div>
959              <div class="doc-title">
960                <h2>ORDER</h2>
961                <div style="font-size: 11pt;">銷售訂單</div>
962              </div>
963            </div>
964
965            <div class="info-grid">
966              <div class="info-box">
967                <h3>客戶資料 (Bill To)</h3>
968                <div class="info-row"><span class="label">客戶名稱:</span><span class="value">${e.customer_name||""}</span></div>
969                <div class="info-row"><span class="label">訂單狀態:</span><span class="value">${s(e.status)}</span></div>
970              </div>
971              <div class="info-box">
972                <h3>訂單資訊 (Info)</h3>
973                <div class="info-row"><span class="label">訂單編號:</span><span class="value">${e.order_number||""}</span></div>
974                <div class="info-row"><span class="label">訂單日期:</span><span class="value">${e.order_date||""}</span></div>
975                <div class="info-row"><span class="label">交付日期:</span><span class="value">${e.delivery_date||"-"}</span></div>
976                <div class="info-row"><span class="label">專案名稱:</span><span class="value">${e.project_name||""}</span></div>
977              </div>
978            </div>
979
980            <table class="items-table">
981              <thead>
982                <tr>
983                  <th style="width: 50px;">#</th>
984                  <th>項目名稱 / 描述</th>
985                  <th class="center-col" style="width: 60px;">數量</th>
986                  <th class="amount-col" style="width: 120px;">單價</th>
987                  <th class="amount-col" style="width: 120px;">金額</th>
988                </tr>
989              </thead>
990              <tbody>
991                ${(e.systems||[]).map((f,h)=>f.modules.map((d,m)=>`
992                    <tr>
993                      <td>${h+1}.${m+1}</td>
994                      <td>
995                        <strong>${f.system_name} - ${d.module_name}</strong><br/>
996                        <span style="font-size: 8pt; color: #666;">
997                           ${(d.features||[]).join(" / ")}
998                        </span>
999                      </td>
1000                      <td class="center-col">${d.quantity||1}</td>
1001                      <td class="amount-col">${(d.amount||0).toLocaleString()}</td>
1002                      <td class="amount-col">${((d.amount||0)*(d.quantity||1)).toLocaleString()}</td>
1003                    </tr>
1004                  `).join("")).join("")}
1005              </tbody>
1006            </table>
1007
1008            <div class="total-section">
1009              <div class="total-box">
1010                <div class="total-row">
1011                  <span>合計 (Subtotal):</span>
1012                  <span>NT$ ${Math.round((e.total_amount||0)/1.05).toLocaleString()}</span>
1013                </div>
1014                <div class="total-row">
1015                  <span>稅額 (Tax 5%):</span>
1016                  <span>NT$ ${(e.total_amount-Math.round(e.total_amount/1.05)).toLocaleString()}</span>
1017                </div>
1018                <div class="total-row grand-total">
1019                  <span>總計 (Total):</span>
1020                  <span>NT$ ${(e.total_amount||0).toLocaleString()}</span>
1021                </div>
1022              </div>
1023            </div>
1024
1025            <div class="terms-section">
1026              <h3>備註條款 (Notes)</h3>
1027              <div style="border: 1px solid #ddd; padding: 10px; margin-top: 5px; color: #555;">
1028                 ${e.notes?e.notes.replace(/\n/g,"<br/>"):"感謝您的訂購。"}
1029              </div>
1030            </div>
1031
1032            <div class="signature-section">
1033              <div class="signature-box">
1034                <p>客戶簽收 (Received By)</p>
1035                <div style="height: 60px;"></div>
1036                <p>日期 (Date)</p>
1037              </div>
1038              <div class="signature-box">
1039                <p>公司簽署 (Authorized By)</p>
1040                <div style="height: 60px;">
1041                  ${l.company_name?`<span style="font-family: 'Times New Roman'; font-size: 14pt; font-style: italic;">${l.company_name}</span>`:""}
1042                </div>
1043                <p>日期 (Date)</p>
1044              </div>
1045            </div>
1046
1047            <div class="footer">
1048              Generated by Infinite Future Management System
1049            </div>
1050          </div>
1051        </body>
1052      </html>
1053    `),c.document.close(),c.print()};return a.jsxs("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"訂單詳情"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",onClick:o,className:"bg-[#4a4a4a] text-white border-[#4a4a4a] hover:bg-[#3a3a3a]",children:[a.jsx($g,{className:"w-4 h-4 mr-2"}),"列印訂單"]}),a.jsxs(te,{variant:"outline",onClick:()=>r(e),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(qt,{className:"w-4 h-4 mr-2 text-black"}),"編輯"]}),e.file_url&&a.jsxs(te,{variant:"outline",onClick:()=>i(!0),className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"}),"預覽附件"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"訂單編號"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:e.order_number})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"專案名稱"}),a.jsx("p",{className:"text-gray-200",children:e.project_name})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"客戶名稱"}),a.jsx("p",{className:"text-gray-200",children:e.customer_name})]}),e.quote_number&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"關聯報價單"}),a.jsx("p",{className:"text-[#00FFFF]",children:e.quote_number})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"訂單金額"}),a.jsxs("p",{className:"text-2xl font-bold text-[#00FFFF]",children:["NT$ ",(e.total_amount||0).toLocaleStr
1053ing()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"訂單日期"}),a.jsx("p",{className:"text-gray-200",children:e.order_date})]}),e.delivery_date&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"預計交付日期"}),a.jsx("p",{className:"text-gray-200",children:e.delivery_date})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"訂單狀態"}),a.jsx("p",{className:"text-gray-200",children:s(e.status)})]})]})]}),e.systems&&e.systems.length>0&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"訂單項目明細"}),a.jsx("div",{className:"space-y-4",children:e.systems.map((l,c)=>{var f;return a.jsxs("div",{className:"border-l-4 border-[#00FFFF] pl-4",children:[a.jsx("h4",{className:"font-semibold text-[#00FFFF] mb-2",children:l.system_name}),(f=l.modules)==null?void 0:f.map((h,d)=>a.jsxs("div",{className:"ml-4 mb-3 bg-gray-900/50 p-3 rounded",children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsx("span",{className:"font-medium text-gray-200",children:h.module_name}),a.jsxs("span",{className:"text-[#00FFFF]",children:["NT$ ",((h.amount||0)*(h.quantity||1)).toLocaleString()]})]}),a.jsxs("div",{className:"text-sm text-gray-400",children:["數量:",h.quantity||1," × NT$ ",(h.amount||0).toLocaleString()]}),h.features&&h.features.length>0&&a.jsx("div",{className:"mt-2 ml-2 text-xs text-gray-500",children:h.features.map((m,p)=>a.jsxs("div",{children:["• ",m]},p))})]},d))]},c)})})]}),e.notes&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-3",children:"備註"}),a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.notes})]})]})]}),n&&e.file_url&&a.jsx($a,{fileUrl:e.file_url,fileName:`訂單 - ${e.order_number}`,onClose:()=>i(!1)})]})}function n0e(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState(""),[c,f]=I.useState("all"),h=at(),{data:d=[],isLoading:m}=Te({queryKey:["orders"],queryFn:()=>ee.entities.Order.list("-created_date")}),{data:p=[]}=Te({queryKey:["quotes"],queryFn:()=>ee.entities.Quote.list()}),x=Ye({mutationFn:b=>ee.entities.Order.delete(b),onSuccess:()=>{h.invalidateQueries(["orders"])}}),y=d.filter(b=>{var N,S,k;const w=((N=b.order_number)==null?void 0:N.toLowerCase().includes(o.toLowerCase()))||((S=b.project_name)==null?void 0:S.toLowerCase().includes(o.toLowerCase()))||((k=b.customer_name)==null?void 0:k.toLowerCase().includes(o.toLowerCase())),_=c==="all"||b.status===c;return w&&_}),v=b=>{const w={pending:{label:"待確認",color:"bg-yellow-900 text-yellow-200"},confirmed:{label:"已確認",color:"bg-blue-900 text-blue-200"},in_progress:{label:"進行中",color:"bg-[#00FFFF] text-black"},delivered:{label:"已交付",color:"bg-green-900 text-green-200"},completed:{label:"已完成",color:"bg-gray-700 text-gray-200"},cancelled:{label:"已取消",color:"bg-red-900 text-red-200"}};return w[b]||w.pending};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"訂單管理"}),a.jsxs(te,{onClick:()=>{s(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"新增訂單"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"訂單總數量"}),a.jsx("h3",{className:"text-3xl font-bold cyber-text",children:y.length})]}),a.jsx(Et,{className:"w-10 h-10 text-[#00FFFF] opacity-50"})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"訂單總金額"}),a.jsxs("h3",{className:"text-3xl font-bold text-[#00FFFF]",children:["NT$ ",y.reduce((b,w)=>
1053b+(w.total_amount||0),0).toLocaleString()]})]}),a.jsx(ut,{className:"w-10 h-10 text-[#00FFFF] opacity-50"})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 flex flex-col md:flex-row gap-4",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx(ne,{placeholder:"搜尋訂單編號、專案名稱或客戶...",value:o,onChange:b=>l(b.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("select",{value:c,onChange:b=>f(b.target.value),className:"px-4 py-2 bg-black border border-gray-700 rounded text-white focus:border-[#00FFFF] focus:outline-none",children:[a.jsx("option",{value:"all",children:"所有狀態"}),a.jsx("option",{value:"pending",children:"待確認"}),a.jsx("option",{value:"confirmed",children:"已確認"}),a.jsx("option",{value:"in_progress",children:"進行中"}),a.jsx("option",{value:"delivered",children:"已交付"}),a.jsx("option",{value:"completed",children:"已完成"}),a.jsx("option",{value:"cancelled",children:"已取消"})]})]}),a.jsx("div",{className:"space-y-4",children:m?a.jsx("div",{className:"text-center py-8 text-gray-400",children:"載入中..."}):y.length===0?a.jsx("div",{className:"text-center py-8 text-gray-400",children:o||c!=="all"?"沒有符合條件的訂單":"尚無訂單資料"}):y.map(b=>{const w=v(b.status);return a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:b.project_name}),a.jsx("span",{className:`px-3 py-1 rounded text-xs font-medium ${w.color}`,children:w.label})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"訂單編號:"}),a.jsx("span",{className:"text-gray-200",children:b.order_number})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"客戶名稱:"}),a.jsx("span",{className:"text-gray-200",children:b.customer_name})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"訂單日期:"}),a.jsx("span",{className:"text-gray-200",children:b.order_date})]}),b.quote_number&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"報價單號:"}),a.jsx("span",{className:"text-[#00FFFF]",children:b.quote_number})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"訂單金額:"}),a.jsxs("span",{className:"text-[#00FFFF] font-semibold",children:["NT$ ",(b.total_amount||0).toLocaleString()]})]}),b.delivery_date&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"預計交付:"}),a.jsx("span",{className:"text-gray-200",children:b.delivery_date})]})]})]}),a.jsxs("div",{className:"flex gap-2 ml-4",children:[a.jsx(te,{variant:"outline",size:"sm",onClick:()=>n(b),className:"bg-[#4a4a4a] text-white border-[#4a4a4a] hover:bg-[#3a3a3a]",children:a.jsx(cr,{className:"w-4 h-4"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{s(b),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:a.jsx(qt,{className:"w-4 h-4 text-black"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{confirm("確定要刪除此訂單嗎?")&&x.mutate(b.id)},className:"border-red-600 text-red-400 hover:bg-red-900/20",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},b.id)})}),e&&a.jsx(t0e,{order:i,quotes:p,onClose:()=>{t(!1),s(null)}}),r&&a.jsx(r0e,{order:r,onClose:()=>n(null),onEdit:b=>{n(null),s(b),t(!0)}})]})}function SM({payroll:e,contracts:t,employees:r,onClose:n}){const[i,s]=I.useState({employee_id:"",employee_name:"",contract_id:"",project_name:"",total_payroll_amount:"",paid_amount:0,unpaid_amount:"",payment_percentage:"",compensation_document_url:"",status:"pending",...e}),[o,l]=I.useState(!1),c=at();I.useEffect(()=>{const x=(i.total_payroll_amount||0)-(i.paid_amount||0);s(y=>({...y,unpaid_amount:x}))},[i.total_payroll_amount,i.paid_amount]);const f=Ye({mutationFn:x=>e?ee.entities.Payroll.update(e.id,x):ee.entities.Payroll.create(x),onSuccess:()=>{c.invalidateQueries(["payrolls"]),alert("儲存成功!"),n()}}),h=x=>{const y=r.find(v=>v.id===x);y&&s(v=>({...v,employee_id:x,employee_name:y.full_name}))},d=x=>{const y=t.find(v=>v.id===x);y&&s(v=>({...v,contract_id:x,project_name:y.project_name}))},m=async x=>{const y=x.target.files[0];if(y)try{l(!0);const{file_url:v}=await ee.integrations.Core.UploadFile({file:y});s(b=>({...b,compensation_document_url:v})),alert("上傳成功!")}catch(v){console.error("Upload failed:",v),alert("上傳失敗,請重試")}finally{l(!1)}},p=x=>{x.preventDefault(),f.mutate(i)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯薪酬":"新增薪酬項目"}),a.jsx("button",{onClick:n,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:p,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"員工 *"}),a.jsxs(qe,{value:i.employee_id,onValueChange:h,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇員工"})}),a.jsx($e,{className:"bg-black border-gray-700",children:r.map(x=>a.jsxs(se,{value:x.id,className:"text-white",children:[x.full_name," 
1053(",x.department||"未設定部門",")"]},x.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯專案(選填)"}),a.jsxs(qe,{value:i.contract_id,onValueChange:d,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇專案"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"none",className:"text-white",children:"不關聯專案"}),t.map(x=>a.jsx(se,{value:x.id,className:"text-white",children:x.project_name},x.id))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"薪酬總金額 *"}),a.jsx(ne,{type:"number",required:!0,value:i.total_payroll_amount,onChange:x=>s({...i,total_payroll_amount:x.target.value===""?0:parseFloat(x.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"已支付金額"}),a.jsx(ne,{type:"number",value:i.paid_amount,onChange:x=>s({...i,paid_amount:x.target.value===""?0:parseFloat(x.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"未支付金額"}),a.jsx(ne,{type:"number",value:i.unpaid_amount,readOnly:!0,className:"bg-gray-900 border-gray-700 text-yellow-400 font-semibold"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"支付比例 %(選填)"}),a.jsx(ne,{type:"number",value:i.payment_percentage,onChange:x=>s({...i,payment_percentage:x.target.value===""?0:parseFloat(x.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"狀態"}),a.jsxs(qe,{value:i.status,onValueChange:x=>s({...i,status:x}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"pending",className:"text-white",children:"待支付"}),a.jsx(se,{value:"partial",className:"text-white",children:"部分支付"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"})]})]})]})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2 border-t border-gray-700 pt-4",children:[a.jsx(Q,{children:"勞務報酬單附件 (PDF)"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{type:"button",variant:"outline",onClick:()=>document.getElementById("compensation-doc-upload").click(),className:"bg-gray-800 border-gray-700 hover:bg-gray-700",disabled:o,children:[o?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),o?"上傳中...":"上傳附件"]}),a.jsx(ne,{id:"compensation-doc-upload",type:"file",accept:".pdf",className:"hidden",onChange:m}),i.compensation_document_url&&a.jsxs("span",{className:"text-sm text-[#00FFFF] flex items-center gap-2",children:[a.jsx(Et,{className:"w-4 h-4"}),a.jsx("a",{href:i.compensation_document_url,target:"_blank",rel:"noreferrer",className:"hover:underline",children:"已上傳 (點擊查看)"}),a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>s(x=>({...x,compensation_document_url:""})),className:"text-red-500 hover:text-red-400",children:a.jsx(vt,{className:"w-4 h-4"})})]})]}),a.jsx("p",{className:"text-xs text-gray-500",children:"上傳勞務報酬單或相關證明文件"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:n,className:"bg-[#8B0000] text-white border-[#8B0000] hover:bg-[#660000]",children:"取消"}),a.jsx(te,{type:"submit",disabled:f.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:f.isPending?"儲存中...":"儲存"})]})]})]})})}function a0e({payroll:e,onClose:t,onEdit:r}){const[n,i]=I.useState(!1),[s,o]=I.useState({amount:"",payment_date:new Date().toISOString().split("T")[0],payment_method:"",notes:""}),l=at(),c=Ye({mutationFn:async m=>{const p=[...e.payment_records||[],m],x=(e.paid_amount||0)+parseFloat(m.amount),y=(e.total_payroll_amount||0)-x;return ee.entities.Payroll.update(e.id,{payment_records:p,paid_amount:x,unpaid_amount:y,status:y<=0?"completed":"partial"})},onSuccess:()=>
1053{l.invalidateQueries(["payrolls"]),i(!1),o({amount:"",payment_date:new Date().toISOString().split("T")[0],payment_method:"",notes:""})}}),f=m=>{m.preventDefault(),c.mutate(s)},h=m=>({pending:"待支付",partial:"部分支付",completed:"已完成"})[m]||m,d=e.total_payroll_amount>0?e.paid_amount/e.total_payroll_amount*100:0;return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"薪酬詳情"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",onClick:r,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(qt,{className:"w-4 h-4 mr-2 text-black"}),"編輯"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"員工姓名"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:e.employee_name})]}),e.project_name&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"關聯專案"}),a.jsx("p",{className:"text-gray-200",children:e.project_name})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"狀態"}),a.jsx("p",{className:"text-gray-200",children:h(e.status)})]}),e.payment_percentage&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"支付比例"}),a.jsxs("p",{className:"text-gray-200",children:[e.payment_percentage,"%"]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"薪酬總金額"}),a.jsxs("p",{className:"text-2xl font-bold text-[#00FFFF]",children:["NT$ ",(e.total_payroll_amount||0).toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已支付金額"}),a.jsxs("p",{className:"text-xl font-semibold text-green-400",children:["NT$ ",(e.paid_amount||0).toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未支付金額"}),a.jsxs("p",{className:"text-xl font-semibold text-yellow-400",children:["NT$ ",(e.unpaid_amount||0).toLocaleString()]})]})]})]}),e.compensation_document_url&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx(Q,{className:"text-gray-400 mb-2 block",children:"勞務報酬單附件"}),a.jsxs("a",{href:e.compensation_document_url,target:"_blank",rel:"noreferrer",className:"text-[#00FFFF] hover:underline flex items-center gap-2",children:[a.jsx(Et,{className:"w-5 h-5"}),"查看勞務報酬單"]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 space-y-3",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"支付進度"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-400",children:"完成度"}),a.jsxs("span",{className:"cyber-text font-semibold",children:[d.toFixed(1),"%"]})]}),a.jsx("div",{className:"w-full bg-gray-800 rounded-full h-5 overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500 flex items-center justify-end px-2",style:{width:`${d}%`,background:d>=100?"linear-gradient(90deg, #00FF00 0%, #00CC00 100%)":"linear-gradient(90deg, #00FFFF 0%, #0088FF 100%)",boxShadow:d>=100?"0 0 20px rgba(0, 255, 0, 0.6)":"0 0 20px rgba(0, 255, 255, 0.6)"},children:d>10&&a.jsxs("span",{className:"text-xs font-bold text-black",children:[d.toFixed(1),"%"]})})})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"支付紀錄"}),e.status!=="completed"&&a.jsxs(te,{onClick:()=>i(!n),size:"sm",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"新增支付"]})]}),n&&a.jsxs("form",{onSubmit:f,className:"cyber-bg border border-gray-700 rounded-lg p-4 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"支付金額 *"}),a.jsx(ne,{type:"number",required:!0,value:s.amount,onChange:m=>o({...s,amount:m.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"支付日期 *"}),a.jsx(ne,{type:"date",required:!0,value:s.payment_date,onChange:m=>o({...s,payment_date:m.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"支付方式"}),a.jsx(ne,{value:s.payment_method,onChange:m=>o({...s,payment_method:m.target.value}
1053),placeholder:"例:銀行轉帳、現金...",className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(ne,{value:s.notes,onChange:m=>o({...s,notes:m.target.value}),className:"bg-black border-gray-700"})]})]}),a.jsxs("div",{className:"flex justify-end gap-2",children:[a.jsx(te,{type:"button",variant:"outline",onClick:()=>i(!1),className:"border-gray-600",children:"取消"}),a.jsx(te,{type:"submit",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:"確認支付"})]})]}),a.jsx("div",{className:"space-y-3",children:e.payment_records&&e.payment_records.length>0?e.payment_records.map((m,p)=>{var x;return a.jsx("div",{className:"border border-gray-700 rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400",children:"支付金額"}),a.jsxs("p",{className:"font-semibold text-green-400",children:["NT$ ",(x=m.amount)==null?void 0:x.toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400",children:"支付日期"}),a.jsx("p",{className:"text-gray-200",children:m.payment_date})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400",children:"支付方式"}),a.jsx("p",{className:"text-gray-200",children:m.payment_method||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400",children:"備註"}),a.jsx("p",{className:"text-gray-200",children:m.notes||"-"})]})]})},p)}):a.jsx("div",{className:"text-center py-8 text-gray-400",children:"尚無支付紀錄"})})]})]})]})})}function i0e(){const[e,t]=I.useState(null),[r,n]=I.useState(!1),[i,s]=I.useState(null),[o,l]=I.useState(null),[c,f]=I.useState(""),[h,d]=I.useState("all");at();const{data:m=[],isLoading:p}=Te({queryKey:["payrolls"],queryFn:()=>ee.entities.Payroll.list("-created_date")}),{data:x=[]}=Te({queryKey:["contracts"],queryFn:()=>ee.entities.Contract.list()}),{data:y=[]}=Te({queryKey:["employees"],queryFn:()=>ee.entities.Employee.list()}),v={};m.forEach(S=>{const k=S.contract_id||S.project_name||"未分類專案";v[k]||(v[k]={contract_id:S.contract_id,project_name:S.project_name||"未分類專案",payrolls:[],total_amount:0,total_paid:0,total_unpaid:0}),v[k].payrolls.push(S),v[k].total_amount+=S.total_payroll_amount||0,v[k].total_paid+=S.paid_amount||0,v[k].total_unpaid+=S.unpaid_amount||0});const w=Object.values(v).filter(S=>{var C;return!c||((C=S.project_name)==null?void 0:C.toLowerCase().includes(c.toLowerCase()))}),_=e?m.filter(S=>{var R;const k=S.contract_id===e.contract_id||S.project_name===e.project_name,C=h==="all"||S.status===h,O=!c||((R=S.employee_name)==null?void 0:R.toLowerCase().includes(c.toLowerCase()));return k&&C&&O}):[],N=S=>{const k={pending:{label:"待支付",color:"#FFD700"},partial:{label:"部分支付",color:"#00FFFF"},completed:{label:"已完成",color:"#00FF00"}},C=k[S]||k.pending;return a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:C.color+"33",color:C.color,border:`1px solid ${C.color}`},children:C.label})};return e?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(te,{variant:"outline",onClick:()=>t(null),className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:"← 返回專案列表"}),a.jsxs("h1",{className:"text-3xl font-bold cyber-text",children:[e.project_name," - 員工薪酬"]})]}),a.jsxs(te,{onClick:()=>{l(null),n(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增薪酬項目"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"員工總數"}),a.jsx("p",{className:"text-2xl font-bold text-[#00FFFF]",children:e.payrolls.length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"薪酬總額"}),a.jsxs("p",{className:"text-2xl font-bold text-white",children:["NT$ ",e.total_amount.toLocaleStr
1053ing()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已支付總額"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",e.total_paid.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未支付總額"}),a.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["NT$ ",e.total_unpaid.toLocaleString()]})]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋員工姓名...",value:c,onChange:S=>f(S.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(qe,{value:h,onValueChange:d,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"狀態篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有狀態"}),a.jsx(se,{value:"pending",className:"text-white",children:"待支付"}),a.jsx(se,{value:"partial",className:"text-white",children:"部分支付"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"})]})]}),a.jsx(te,{variant:"outline",onClick:()=>{f(""),d("all")},className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"清除篩選"})]})}),a.jsx("div",{className:"space-y-4",children:_.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(Rd,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"此專案尚無員工薪酬資料"})]}):_.map(S=>{const k=S.total_payroll_amount>0?S.paid_amount/S.total_payroll_amount*100:0;return a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-3",children:[a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:S.employee_name}),N(S.status)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{className:"text-[#00FFFF] font-semibold",children:["薪酬總額:NT$ ",(S.total_payroll_amount||0).toLocaleString()]}),a.jsxs("div",{className:"text-green-400",children:["已支付:NT$ ",(S.paid_amount||0).toLocaleString()]}),a.jsxs("div",{className:"text-yellow-400 font-semibold",children:["未支付:NT$ ",(S.unpaid_amount||0).toLocaleString()]}),S.payment_percentage&&a.jsxs("div",{className:"text-gray-300",children:["支付比例:",S.payment_percentage,"%"]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>s(S),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"詳情"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{l(S),n(!0)},className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:a.jsx(qt,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-400",children:"支付進度"}),a.jsxs("span",{className:"cyber-text font-semibold",children:[k.toFixed(1),"%"]})]}),a.jsx("div",{className:"w-full bg-gray-800 rounded-full h-4 overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${k}%`,background:k>=100?"linear-gradient(90deg, #00FF00 0%, #00CC00 100%)":"linear-gradient(90deg, #00FFFF 0%, #0088FF 100%)",boxShadow:k>=100?"0 0 15px rgba(0, 255, 0, 0.5)":"0 0 15px rgba(0, 255, 255, 0.5)"}})})]})]})},S.id)})}),r&&a.jsx(SM,{payroll:o,contracts:x,employees:y,onClose:()=>{n(!1),l(null)}}),i&&!r&&a.jsx(a0e,{payroll:i,onClose:()=>s(null),onEdit:()=>{l(i),n(!0),s(null)}})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"薪酬管理"}),a.jsxs(te,{onClick:()=>{l(null),n(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增薪酬項目"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋專案名稱...",value:c,onChange:S=>f(S.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]})}),a.jsx("div",{className:"space-y-4",children:p?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):w.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(Rd,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無專案薪酬資料"})]}):w.map((S,k)=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all cursor-pointer",onClick:()=>t(S),children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-xl font-semibold cyber-text mb-3",children:S.project_name}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400 mb-1",children:"員工數"}),a.jsx("p",{className:"text-lg font-bold text-[#00FFFF]",children:S.payrolls.length})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400 mb-1",children:"薪酬總額"}),a.jsxs("p",{className:"text-lg font-bold text-white",children:["NT$ ",S.total_amount.toLocaleStr
vendor: 5,150 bytes, line 1053
1053ing()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400 mb-1",children:"已支付"}),a.jsxs("p",{className:"text-lg font-bold text-green-400",children:["NT$ ",S.total_paid.toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-3",children:[a.jsx("p",{className:"text-xs text-gray-400 mb-1",children:"未支付"}),a.jsxs("p",{className:"text-lg font-bold text-yellow-400",children:["NT$ ",S.total_unpaid.toLocaleString()]})]})]})]}),a.jsxs(te,{size:"sm",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"}),"查看員工詳情"]})]})},k))}),r&&a.jsx(SM,{payroll:o,contracts:x,employees:y,onClose:()=>{n(!1),l(null)}})]})}function s0e(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const o0e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l0e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,c0e={};function kM(e,t){return(c0e.jsx?l0e:o0e).test(e)}const u0e=/[ \t\n\f\r]/g;function d0e(e){return typeof e=="object"?e.type==="text"?CM(e.value):!1:CM(e)}function CM(e){return e.replace(u0e,"")===""}class fh{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}fh.prototype.normal={};fh.prototype.property={};fh.prototype.space=void 0;function T8(e,t){const r={},n={};for(const i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new fh(r,n,t)}function AN(e){return e.toLowerCase()}class An{constructor(t,r){this.attribute=r,this.property=t}}An.prototype.attribute="";An.prototype.booleanish=!1;An.prototype.boolean=!1;An.prototype.commaOrSpaceSeparated=!1;An.prototype.commaSeparated=!1;An.prototype.defined=!1;An.prototype.mustUseProperty=!1;An.prototype.number=!1;An.prototype.overloadedBoolean=!1;An.prototype.property="";An.prototype.spaceSeparated=!1;An.prototype.space=void 0;let f0e=0;const bt=pl(),jr=pl(),RN=pl(),Fe=pl(),Jt=pl(),hc=pl(),qn=pl();function pl(){return 2**++f0e}const IN=Object.freeze(Object.defineProperty({__proto__:null,boolean:bt,booleanish:jr,commaOrSpaceSeparated:qn,commaSeparated:hc,number:Fe,overloadedBoolean:RN,spaceSeparated:Jt},Symbol.toStringTag,{value:"Module"})),uj=Object.keys(IN);class Ok extends An{constructor(t,r,n,i){let s=-1;if(super(t,r),FM(this,"space",i),typeof n=="number")for(;++s<uj.length;){const o=uj[s];FM(this,uj[s],(n&IN[o])===IN[o])}}}Ok.prototype.defined=!0;function FM(e,t,r){r&&(e[t]=r)}function bu(e){const t={},r={};for(const[n,i]of Object.entries(e.properties)){const s=new Ok(n,e.transform(e.attributes||{},n),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),t[n]=s,r[AN(n)]=n,r[AN(s.attribute)]=n}return new fh(t,r,e.space)}const A8=bu({properties:{ariaActiveDescendant:null,ariaAtomic:jr,ariaAutoComplete:null,ariaBusy:jr,ariaChecked:jr,ariaColCount:Fe,ariaColIndex:Fe,ariaColSpan:Fe,ariaControls:Jt,ariaCurrent:null,ariaDescribedBy:Jt,ariaDetails:null,ariaDisabled:jr,ariaDropEffect:Jt,ariaErrorMessage:null,ariaExpanded:jr,ariaFlowTo:Jt,ariaGrabbed:jr,ariaHasPopup:null,ariaHidden:jr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Jt,ariaLevel:Fe,ariaLive:null,ariaModal:jr,ariaMultiLine:jr,ariaMultiSelectable:jr,ariaOrientation:null,ariaOwns:Jt,ariaPlaceholder:null,ariaPosInSet:Fe,ariaPressed:jr,ariaReadOnly:jr,ariaRelevant:null,ariaRequired:jr,ariaRoleDescription:Jt,ariaRowCount:Fe,ariaRowIndex:Fe,ariaRowSpan:Fe,ariaSelected:jr,ariaSetSize:Fe,ariaSort:null,ariaValueMax:Fe,ariaValueMin:Fe,ariaValueNow:Fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function R8(e,t){return t in e?e[t]:t}function I8(e,t){return R8(e,t.toLowerCase())}const h0e=bu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:hc,acceptCharset:Jt,accessKey:Jt,action:null,allow:null,allowFullScreen:bt,allowPaymentRequest:bt,allowUserMedia:bt,alt:null,as:null,async:bt,autoCapitalize:null,autoComplete:Jt,autoFocus:bt,autoPlay:bt,blocking:Jt,capture:null,charSet:null,checked:bt,cite:null,className:Jt,cols:Fe,colSpan:null,content:null,contentEditable:jr,controls:bt,controlsList:Jt,coords:Fe|hc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:bt,defer:bt,dir:null,dirName:null,disabled:bt,download:RN,draggable:jr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:bt,formTarget:null,headers:Jt,height:Fe,hidden:RN,high:Fe,href:null,hrefLang:null,htmlFor:Jt,httpEquiv:Jt,id:null,imageSizes:null,imageSrcSet:null,inert:bt,inputMode:null,integrity:null,is:null,isMap:bt,itemId:null,itemProp:Jt,itemRef:Jt,itemScope:bt,itemType:Jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:bt,low:Fe,manifest:null,max:null,maxLength:Fe,media:null,method:null,min:null,minLength:Fe,multiple:bt,muted:bt,name:null,nonce:null,noModule:bt,noValidate:bt,onAbort:null,onAfterPrint:null,onAuxCl
1053ick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:bt,optimum:Fe,pattern:null,ping:Jt,placeholder:null,playsInline:bt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:bt,referrerPolicy:null,rel:Jt,required:bt,reversed:bt,rows:Fe,rowSpan:Fe,sandbox:Jt,scope:null,scoped:bt,seamless:bt,selected:bt,shadowRootClonable:bt,shadowRootDelegatesFocus:bt,shadowRootMode:null,shape:null,size:Fe,sizes:null,slot:null,span:Fe,spellCheck:jr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Fe,step:null,style:null,tabIndex:Fe,target:null,title:null,translate:null,type:null,typeMustMatch:bt,useMap:null,value:jr,width:Fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Jt,axis:null,background:null,bgColor:null,border:Fe,borderColor:null,bottomMargin:Fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:bt,declare:bt,event:null,face:null,frame:null,frameBorder:null,hSpace:Fe,leftMargin:Fe,link:null,longDesc:null,lowSrc:null,marginHeight:Fe,marginWidth:Fe,noResize:bt,noHref:bt,noShade:bt,noWrap:bt,object:null,profile:null,prompt:null,rev:null,rightMargin:Fe,rules:null,scheme:null,scrolling:jr,standby:null,summary:null,text:null,topMargin:Fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:bt,disableRemotePlayback:bt,prefix:null,property:null,results:Fe,security:null,unselectable:null},space:"html",transform:I8}),m0e=bu({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav
1053-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:qn,accentHeight:Fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Fe,amplitude:Fe,arabicForm:null,ascent:Fe,attributeName:null,attributeType:null,azimuth:Fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Fe,by:null,calcMode:null,capHeight:Fe,className:Jt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Fe,diffuseConstant:Fe,direction:null,display:null,dur:null,divisor:Fe,dominantBaseline:null,download:bt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Fe,enableBackground:null,end:null,event:null,exponent:Fe,externalResourcesRequired:null,fill:null,fillOpacity:Fe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:hc,g2:hc,glyphName:hc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Fe,horizOriginX:Fe,horizOriginY:Fe,id:null,ideographic:Fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Fe,k:Fe,k1:Fe,k2:Fe,k3:Fe,k4:Fe,kernelMatrix:qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Fe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Fe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
vendor: 5,165 bytes, lines 1053-1054
1053Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Fe,overlineThickness:Fe,paintOrder:null,panose1:null,path:null,pathLength:Fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Fe,pointsAtY:Fe,pointsAtZ:Fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:qn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:qn,rev:qn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:qn,requiredFeatures:qn,requiredFonts:qn,requiredFormats:qn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Fe,specularExponent:Fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Fe,strikethroughThickness:Fe,string:null,stroke:null,strokeDashArray:qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Fe,strokeOpacity:Fe,strokeWidth:null,style:null,surfaceScale:Fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:qn,tabIndex:Fe,tableValues:null,target:null,targetX:Fe,targetY:Fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:qn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Fe,underlineThickness:Fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Fe,values:null,vAlphabetic:Fe,vMathematical:Fe,vectorEffect:null,vHanging:Fe,vIdeographic:Fe,version:null,vertAdvY:Fe,vertOriginX:Fe,vertOriginY:Fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:R8}),M8=bu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),L8=bu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:I8}),D8=bu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),p0e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},g0e=/[A-Z]/g,OM=/-[a-z]/g,y0e=/^data[-\w.:]+$/i;function v0e(e,t){const r=AN(t);let n=t,i=An;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&y0e.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(OM,b0e);n="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!OM.test(s)){let o=s.replace(g0e,x0e);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Ok}return new i(n,t)}function x0e(e){return"-"+e.toLowerCase()}function b0e(e){return e.charAt(1).toUpperCase()}const w0e=T8([A8,h0e,M8,L8,D8],"html"),Ek=T8([A8,m0e,M8,L8,D8],"svg");function _0e(e){return e.join(" ").trim()}var Zl={},dj,EM;function j0e(){if(EM)return dj;EM=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
1054`,f="/",h="*",d="",m="comment",p="declaration";dj=function(y,v){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];v=v||{};var b=1,w=1;function _(T){var $=T.match(t);$&&(b+=$.length);var D=T.lastIndexOf(c);w=~D?T.length-D:w+T.length}function N(){var T={line:b,column:w};return function($){return $.position=new S(T),O(),$}}function S(T){this.start=T,this.end={line:b,column:w},this.source=v.source}S.prototype.content=y;function k(T){var $=new Error(v.source+":"+b+":"+w+": "+T);if($.reason=T,$.filename=v.source,$.line=b,$.column=w,$.source=y,!v.silent)throw $}function C(T){var $=T.exec(y);if($){var D=$[0];return _(D),y=y.slice(D.length),$}}function O(){C(r)}function R(T){var $;for(T=T||[];$=A();)$!==!1&&T.push($);return T}function A(){var T=N();if(!(f!=y.charAt(0)||h!=y.charAt(1))){for(var $=2;d!=y.charAt($)&&(h!=y.charAt($)||f!=y.charAt($+1));)++$;if($+=2,d===y.charAt($-1))return k("End of comment missing");var D=y.slice(2,$-2);return w+=2,_(D),y=y.slice($),w+=2,T({type:m,comment:D})}}function P(){var T=N(),$=C(n);if($){if(A(),!C(i))return k("property missing ':'");var D=C(s),W=T({type:p,property:x($[0].replace(e,d)),value:D?x(D[0].replace(e,d)):d});return C(o),W}}function E(){var T=[];R(T);for(var $;$=P();
vendor: 3,952 bytes, line 1054
1054)$!==!1&&(T.push($),R(T));return T}return O(),E()};function x(y){return y?y.replace(l,d):d}return dj}var PM;function N0e(){if(PM)return Zl;PM=1;var e=Zl&&Zl.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.default=r;var t=e(j0e());function r(n,i){var s=null;if(!n||typeof n!="string")return s;var o=(0,t.default)(n),l=typeof i=="function";return o.forEach(function(c){if(c.type==="declaration"){var f=c.property,h=c.value;l?i(f,h,c):h&&(s=s||{},s[f]=h)}}),s}return Zl}var _d={},TM;function S0e(){if(TM)return _d;TM=1,Object.defineProperty(_d,"__esModule",{value:!0}),_d.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(f){return!f||r.test(f)||e.test(f)},o=function(f,h){return h.toUpperCase()},l=function(f,h){return"".concat(h,"-")},c=function(f,h){return h===void 0&&(h={}),s(f)?f:(f=f.toLowerCase(),h.reactCompat?f=f.replace(i,l):f=f.replace(n,l),f.replace(t,o))};return _d.camelCase=c,_d}var jd,AM;function k0e(){if(AM)return jd;AM=1;var e=jd&&jd.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(N0e()),r=S0e();function n(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(o[(0,r.camelCase)(l,s)]=c)}),o}return n.default=n,jd=n,jd}var C0e=k0e();const F0e=Ft(C0e),$8=q8("end"),Pk=q8("start");function q8(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function O0e(e){const t=Pk(e),r=$8(e);if(t&&r)return{start:t,end:r}}function zd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?RM(e.position):"start"in e||"end"in e?RM(e):"line"in e||"column"in e?MN(e):""}function MN(e){return IM(e&&e.line)+":"+IM(e&&e.column)}function RM(e){return MN(e&&e.start)+"-"+MN(e&&e.end)}function IM(e){return e&&typeof e=="number"?e:1}class un extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",s={},o=!1;if(r&&("line"in r&&"column"in r?s={place:r}:"start"in r&&"end"in r?s={place:r}:"type"in r?s={ancestors:[r],place:r.position}:s={...r}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof n=="string"){const c=n.indexOf(":");c===-1?s.ruleId=n:(s.source=n.slice(0,c),s.ruleId=n.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=zd(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}un.prototype.file="";un.prototype.name="";un.prototype.reason="";un.prototype.message="";un.prototype.stack="";un.prototype.column=void 0;un.prototype.line=void 0;un.prototype.ancestors=void 0;un.prototype.cause=void 0;un.prototype.fatal=void 0;un.prototype.place=void 0;un.prototype.ruleId=void 0;un.prototype.source=void 0;const Tk={}.hasOwnProperty,E0e=new Map,P0e=/[A-Z]/g,T0e=new Set(["table","tbody","thead","tfoot","tr"]),A0e=new Set(["td","th"]),B8="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function R0e(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=z0e(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 9,581 bytes, line 1054
1054if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=B0e(r,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ek:w0e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=z8(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function z8(e,t,r){if(t.type==="element")return I0e(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return M0e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return D0e(e,t,r);if(t.type==="mdxjsEsm")return L0e(e,t);if(t.type==="root")return $0e(e,t,r);if(t.type==="text")return q0e(e,t)}function I0e(e,t,r){const n=e.schema;let i=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=Ek,e.schema=i),e.ancestors.push(t);const s=H8(e,t.tagName,!1),o=U0e(e,t);let l=Rk(e,t);return T0e.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!d0e(c):!0})),U8(e,o,s,t),Ak(o,l),e.ancestors.pop(),e.schema=n,e.create(t,s,o,r)}function M0e(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Mf(e,t.position)}function L0e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Mf(e,t.position)}function D0e(e,t,r){const n=e.schema;let i=n;t.name==="svg"&&n.space==="html"&&(i=Ek,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:H8(e,t.name,!0),o=H0e(e,t),l=Rk(e,t);return U8(e,o,s,t),Ak(o,l),e.ancestors.pop(),e.schema=n,e.create(t,s,o,r)}function $0e(e,t,r){const n={};return Ak(n,Rk(e,t)),e.create(t,e.Fragment,n,r)}function q0e(e,t){return t.value}function U8(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function Ak(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function B0e(e,t,r){return n;function n(i,s,o,l){const f=Array.isArray(o.children)?r:t;return l?f(s,o,l):f(s,o)}}function z0e(e,t){return r;function r(n,i,s,o){const l=Array.isArray(s.children),c=Pk(n);return t(i,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function U0e(e,t){const r={};let n,i;for(i in t.properties)if(i!=="children"&&Tk.call(t.properties,i)){const s=V0e(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&A0e.has(t.tagName)?n=l:r[o]=l}}if(n){const s=r.style||(r.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function H0e(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const s=n.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else Mf(e,t.position);else{const i=n.name;let s;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const l=n.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else Mf(e,t.position);else s=n.value===null?!0:n.value;r[i]=s}return r}function Rk(e,t){const r=[];let n=-1;const i=e.passKeys?new Map:E0e;for(;++n<t.children.length;){const s=t.children[n];let o;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const f=i.get(c)||0;o=c+"-"+f,i.set(c,f+1)}}const l=z8(e,s,o);l!==void 0&&r.push(l)}return r}function V0e(e,t,r){const n=v0e(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?s0e(r):_0e(r)),n.property==="style"){let i=typeof r=="object"?r:W0e(e,String(r));return e.stylePropertyNameCase==="css"&&(i=K0e(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&n.space?p0e[n.property]||n.property:n.attribute,r]}}function W0e(e,t){try{return F0e(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,i=new un("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=B8+"#cannot-parse-style-attribute",i}}function H8(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const l=kM(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}n=o}else n=kM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const i=n.value;return Tk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);Mf(e)}function Mf(e,t){const r=new un("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=B8+"#cannot-handle-mdx-estrees-without-createevaluater",r}function K0e(e){const t={};let r;for(r in e)Tk.call(e,r)&&(t[G0e(r)]=e[r]);return t}function G0e(e){let t=e.replace(P0e,Y0e);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Y0e(e){return"-"+e.toLowerCase()}const fj={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Q0e={};function X0e(e,t){const r=Q0e,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return V8(e,n,i)}function V8(e,t,r){if(Z0e(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return MM(e.children,t,r)}return Array.isArray(e)?MM(e,t,r):""}function MM(e,t,r){const n=[];let i=-1;for(;++i<e.length;)n[i]=V8(e[i],t,r);return n.join("")}function Z0e(e){return!!(e&&typeof e=="object")}const LM=document.createElement("i");function Ik(e){const t="&"+e+";";LM.innerHTML=t;const r=LM.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function pi(e,t,r,n){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(t,r),e.splice(...o);else for(r&&e.splice(t,r);s<n.length;)o=n.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function ha(e,t){return e.length>0?(pi(e,e.length,0,t),e):t}const DM={}.hasOwnProperty;function J0e(e){const t={};let r=-1;for(;++r<e.length;)exe(t,e[r]);return t}function exe(e,t){let r;for(r in t){const i=(DM.call(e,r)?e[r]:void 0)||(e[r]={}),s=t[r];let o;if(s)for(o in s){DM.call(i,o)||(i[o]=[]);const l=s[o];txe(i[o],Array.isArray(l)?l:l?[l]:[])}}}function txe(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);pi(e,0,0,n)}function W8(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function mc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ei=to(/[A-Za-z]/),Wn=to(/[\dA-Za-z]/),rxe=to(/[#-'*+\--9=?A-Z^-~]/);function LN(e){return e!==null&&(e<32||e===127)}const DN=to(/\d/),nxe=to(/[\dA-Fa-f]/),axe=to(/[!-/:-@[-`{-~]/);function mt(e){return e!==null&&e<-2}function Pn(e){return e!==null&&(e<0||e===32)}function It(e){return e===-2||e===-1||e===32}const ixe=to(new RegExp("\\p{P}|\\p{S}","u")),sxe=to(/\s/);function to(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function wu(e){const t=[];let r=-1,n=0,i=0;for(;++r<e.length;){const s=e.charCodeAt(r);let o="";if(s===37&&Wn(e.charCodeAt(r+1))&&Wn(e.charCodeAt(r+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(r+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(n,r),encodeURIComponent(o)),n=r+i+1,o=""),i&&(r+=i,i=0)}return t.join("")+e.slice(n)}function rr(e,t,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return It(c)?(e.enter(r),l(c)):t(c)}function l(c){return It(c)&&s++<i?(e.consume(c),l):(e.exit(r),t(c))}}const oxe={tokenize:lxe};function lxe(e){const t=e.attempt(this.parser.constructs.contentInitial,n,i);let r;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),rr(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),s(l)}function s(l){const c=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=c),r=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return mt(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),o)}}const cxe={tokenize:uxe},$M={tokenize:dxe};function uxe(e){const t=this,r=[];let n=0,i,s,o;return l;function l(_){if(n<r.length){const N=r[n];return t.containerState=N[1],e.attempt(N[0].continuation,c,f)(_)}return f(_)}function c(_){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&w();const N=t.events.length;let S=N,k;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){k=t.events[S][1].end;break}
vendor: 7,691 bytes, line 1054
1054b(n);let C=N;for(;C<t.events.length;)t.events[C][1].end={...k},C++;return pi(t.events,S+1,0,t.events.slice(N)),t.events.length=C,f(_)}return l(_)}function f(_){if(n===r.length){if(!i)return m(_);if(i.currentConstruct&&i.currentConstruct.concrete)return x(_);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($M,h,d)(_)}function h(_){return i&&w(),b(n),m(_)}function d(_){return t.parser.lazy[t.now().line]=n!==r.length,o=t.now().offset,x(_)}function m(_){return t.containerState={},e.attempt($M,p,x)(_)}function p(_){return n++,r.push([t.currentConstruct,t.containerState]),m(_)}function x(_){if(_===null){i&&w(),b(0),e.consume(_);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),y(_)}function y(_){if(_===null){v(e.exit("chunkFlow"),!0),b(0),e.consume(_);return}return mt(_)?(e.consume(_),v(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(_),y)}function v(_,N){const S=t.sliceStream(_);if(N&&S.push(null),_.previous=s,s&&(s.next=_),s=_,i.defineSkip(_.start),i.write(S),t.parser.lazy[_.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const C=t.events.length;let O=C,R,A;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(R){A=t.events[O][1].end;break}R=!0}for(b(n),k=C;k<t.events.length;)t.events[k][1].end={...A},k++;pi(t.events,O+1,0,t.events.slice(C)),t.events.length=k}}function b(_){let N=r.length;for(;N-- >_;){const S=r[N];t.containerState=S[1],S[0].exit.call(t,e)}r.length=_}function w(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function dxe(e,t,r){return rr(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qM(e){if(e===null||Pn(e)||sxe(e))return 1;if(ixe(e))return 2}function Mk(e,t,r){const n=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!n.includes(s)&&(t=s(t,r),n.push(s))}return t}const $N={name:"attention",resolveAll:fxe,tokenize:hxe};function fxe(e,t){let r=-1,n,i,s,o,l,c,f,h;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;c=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const d={...e[n][1].end},m={...e[r][1].start};BM(d,-c),BM(m,c),o={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:m},s={type:c>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[n][1].end={...o.start},e[r][1].start={...l.end},f=[],e[n][1].end.offset-e[n][1].start.offset&&(f=ha(f,[["enter",e[n][1],t],["exit",e[n][1],t]])),f=ha(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),f=ha(f,Mk(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),f=ha(f,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[r][1].end.offset-e[r][1].start.offset?(h=2,f=ha(f,[["enter",e[r][1],t],["exit",e[r][1],t]])):h=0,pi(e,n-1,r-n+3,f),r=n+f.length-h-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function hxe(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=qM(n);let s;return o;function o(c){return s=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===s)return e.consume(c),l;const f=e.exit("attentionSequence"),h=qM(c),d=!h||h===2&&i||r.includes(c),m=!i||i===2&&h||r.includes(n);return f._open=!!(s===42?d:d&&(i||!m)),f._close=!!(s===42?m:m&&(h||!d)),t(c)}}function BM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const mxe={name:"autolink",tokenize:pxe};function pxe(e,t,r){let n=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return ei(p)?(e.consume(p),o):p===64?r(p):f(p)}function o(p){return p===43||p===45||p===46||Wn(p)?(n=1,l(p)):f(p)}function l(p){return p===58?(e.consume(p),n=0,c):(p===43||p===45||p===46||Wn(p))&&n++<32?(e.consume(p),l):(n=0,f(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||LN(p)?r(p):(e.consume(p),c)}function f(p){return p===64?(e.consume(p),h):rxe(p)?(e.consume(p),f):r(p)}function h(p){return Wn(p)?d(p):r(p)}function d(p){return p===46?(e.consume(p),n=0,h):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||Wn(p))&&n++<63){const x=p===45?m:d;return e.consume(p),x}return r(p)}}const qy={partial:!0,tokenize:gxe};function gxe(e,t,r){return n;function n(s){return It(s)?rr(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||mt(s)?t(s):r(s)}}const K8={continuation:{tokenize:vxe},exit:xxe,name:"blockQuote",tokenize:yxe};function yxe(e,t,r){const n=this;return i;function i(o){if(o===62){const l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return r(o)}function s(o){return It(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function vxe(e,t,r){const n=this;return i;function i(o){return It(o)?rr(e,s,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(K8,t,r)(o)}}function xxe(e){e.exit("blockQuote")}const G8={name:"characterEscape",tokenize:bxe};function bxe(e,t,r){return n;function n(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return axe(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(s)}}const Y8={name:"characterReference",tokenize:wxe};function wxe(e,t,r){const n=this;let i=0,s,o;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),s=31,o=Wn,h(d))}function f(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=nxe,h):(e.enter("characterReferenceValue"),s=7,o=DN,h(d))}function h(d){if(d===59&&i){const m=e.exit("characterReferenceValue");return o===Wn&&!Ik(n.sliceSerialize(m))?r(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),h):r(d)}}const zM={partial:!0,tokenize:jxe},UM={concrete:!0,name:"codeFenced",tokenize:_xe};function _xe(e,t,r){const n=this,i={partial:!0,tokenize:S};let s=0,o=0,l;return c;function c(k){return f(k)}function f(k){const C=n.events[n.events.length-1];return s=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,l=k,e.enter("co
1054deFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(k)}function h(k){return k===l?(o++,e.consume(k),h):o<3?r(k):(e.exit("codeFencedFenceSequence"),It(k)?rr(e,d,"whitespace")(k):d(k))}function d(k){return k===null||mt(k)?(e.exit("codeFencedFence"),n.interrupt?t(k):e.check(zM,y,N)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||mt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):It(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rr(e,p,"whitespace")(k)):k===96&&k===l?r(k):(e.consume(k),m)}function p(k){return k===null||mt(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===null||mt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===l?r(k):(e.consume(k),x)}function y(k){return e.attempt(i,N,v)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),b}function b(k){return s>0&&It(k)?rr(e,w,"linePrefix",s+1)(k):w(k)}function w(k){return k===null||mt(k)?e.check(zM,y,N)(k):(e.enter("codeFlowValue"),_(k))}function _(k){return k===null||mt(k)?(e.exit("codeFlowValue"),w(k)):(e.consume(k),_)}function N(k){return e.exit("codeFenced"),t(k)}function S(k,C,O){let R=0;return A;function A(D){return k.enter("lineEnding"),k.consume(D),k.exit("lineEnding"),P}function P(D){return k.enter("codeFencedFence"),It(D)?rr(k,E,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):E(D)}function E(D){return D===l?(k.enter("codeFencedFenceSequence"),T(D)):O(D)}function T(D){return D===l?(R++,k.consume(D),T):R>=o?(k.exit("codeFencedFenceSequence"),It(D)?rr(k,$,"whitespace")(D):$(D)):O(D)}function $(D){return D===null||mt(D)?(k.exit("codeFencedFence"),C(D)):O(D)}}}function jxe(e,t,r){const n=this;return i;function i(o){return o===null?r(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return n.parser.lazy[n.now().line]?r(o):t(o)}}const hj={name:"codeIndented",tokenize:Sxe},Nxe={partial:!0,tokenize:kxe};function Sxe(e,t,r){const n=this;return i;function i(f){return e.enter("codeIndented"),rr(e,s,"linePrefix",5)(f)}function s(f){const h=n.events[n.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(f):r(f)}function o(f){return f===null?c(f):mt(f)?e.attempt(Nxe,o,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||mt(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),t(f)}}function kxe(e,t,r){const n=this;return i;function i(o){return n.parser.lazy[n.now().line]?r(o):mt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):rr(e,s,"linePrefix",5)(o)}function s(o){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):mt(o)?i(o):r(o)}}const Cxe={name:"codeText",previous:Oxe,resolve:Fxe,tokenize:Exe};function Fxe(e){let t=e.length-4,r=3,n,i;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)i===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(i=n):(n===t||e[n][1].type==="lineEnding")&&(e[i][1].type="codeTextData",n!==i+2&&(e[i][1].end=e[n-1][1].end,e.splice(i+2,n-i-2),t-=n-i-2,n=i+2),i=void 0);return e}function Oxe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Exe(e,t,r){let n=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),n++,l):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?r(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(s=e.enter("codeTextSequence"),i=0,h(d)):mt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(d))}function f(d){return d===null||d===32||d===96||mt(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),f)}function h(d){return d===96?(e.consume(d),i++,h):i===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",f(d))}}class Pxe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const i=r||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&Nd(this.left,n),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Nd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Nd(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Nd(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Nd(this.left,r.reverse())}}}function Nd(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function Q8(e){const t={};let r=-1,n,i,s,o,l,c,f;const h=new Pxe(e);for(;++r<h.length;){for(;r in t;)r=t[r];if(n=h.get(r),r&&n[1].type==="chunkFlow"&&h.get(r-1)[1].type==="listItemPrefix"&&(c=n[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,Txe(h,r)),r=t[r],f=!0);else if(n[1]._container){for(s=r,i=void 0;s--;)if(o=h.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(n[1].end={...h.get(i)[1].start},l=h.slice(i,r),l.unshift(n),h.splice(i,r-i+1,l))}}return pi(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!f}function Txe(e,t){const r=e.get(t)[1],n=e.get(t)[2];let i=t-1;const s=[];let o=r._tokenizer;o||(o=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],f={};let h,d,m=-1,p=r,x=0,y=0;const v=[y];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(h=n.sliceStream(p),p.next||h.push(null),d&&o.defineSki
vendor: 18,631 bytes, line 1054
1054p(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(h),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=r;++m<l.length;)l[m][0]==="exit"&&l[m-1][0]==="enter"&&l[m][1].type===l[m-1][1].type&&l[m][1].start.line!==l[m][1].end.line&&(y=m+1,v.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),m=v.length;m--;){const b=l.slice(v[m],v[m+1]),w=s.pop();c.push([w,w+b.length-1]),e.splice(w,2,b)}for(c.reverse(),m=-1;++m<c.length;)f[x+c[m][0]]=x+c[m][1],x+=c[m][1]-c[m][0]-1;return f}const Axe={resolve:Ixe,tokenize:Mxe},Rxe={partial:!0,tokenize:Lxe};function Ixe(e){return Q8(e),e}function Mxe(e,t){let r;return n;function n(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):mt(l)?e.check(Rxe,o,s)(l):(e.consume(l),i)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function Lxe(e,t,r){const n=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),rr(e,s,"linePrefix")}function s(o){if(o===null||mt(o))return r(o);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(n.parser.constructs.flow,r,t)(o)}}function X8(e,t,r,n,i,s,o,l,c){const f=c||Number.POSITIVE_INFINITY;let h=0;return d;function d(b){return b===60?(e.enter(n),e.enter(i),e.enter(s),e.consume(b),e.exit(s),m):b===null||b===32||b===41||LN(b)?r(b):(e.enter(n),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),y(b))}function m(b){return b===62?(e.enter(s),e.consume(b),e.exit(s),e.exit(i),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(l),m(b)):b===null||b===60||mt(b)?r(b):(e.consume(b),b===92?x:p)}function x(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function y(b){return!h&&(b===null||b===41||Pn(b))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(n),t(b)):h<f&&b===40?(e.consume(b),h++,y):b===41?(e.consume(b),h--,y):b===null||b===32||b===40||LN(b)?r(b):(e.consume(b),b===92?v:y)}function v(b){return b===40||b===41||b===92?(e.consume(b),y):y(b)}}function Z8(e,t,r,n,i,s){const o=this;let l=0,c;return f;function f(p){return e.enter(n),e.enter(i),e.consume(p),e.exit(i),e.enter(s),h}function h(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?r(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(n),t):mt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||mt(p)||l++>999?(e.exit("chunkString"),h(p)):(e.consume(p),c||(c=!It(p)),p===92?m:d)}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function J8(e,t,r,n,i,s){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(n),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,c):r(m)}function c(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(n),t):(e.enter(s),f(m))}function f(m){return m===o?(e.exit(s),c(o)):m===null?r(m):mt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),rr(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===o||m===null||mt(m)?(e.exit("chunkString"),f(m)):(e.consume(m),m===92?d:h)}function d(m){return m===o||m===92?(e.consume(m),h):h(m)}}function Ud(e,t){let r;return n;function n(i){return mt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),r=!0,n):It(i)?rr(e,n,r?"linePrefix":"lineSuffix")(i):t(i)}}const Dxe={name:"definition",tokenize:qxe},$xe={partial:!0,tokenize:Bxe};function qxe(e,t,r){const n=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return Z8.call(n,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=mc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):r(p)}function c(p){return Pn(p)?Ud(e,f)(p):f(p)}function f(p){return X8(e,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return e.attempt($xe,d,d)(p)}function d(p){return It(p)?rr(e,m,"whitespace")(p):m(p)}function m(p){return p===null||mt(p)?(e.exit("definition"),n.parser.defined.push(i),t(p)):r(p)}}function Bxe(e,t,r){return n;function n(l){return Pn(l)?Ud(e,i)(l):r(l)}function i(l){return J8(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return It(l)?rr(e,o,"whitespace")(l):o(l)}function o(l){return l===null||mt(l)?t(l):r(l)}}const zxe={name:"hardBreakEscape",tokenize:Uxe};function Uxe(e,t,r){return n;function n(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return mt(s)?(e.exit("hardBreakEscape"),t(s)):r(s)}}const Hxe={name:"headingAtx",resolve:Vxe,tokenize:Wxe};function Vxe(e,t){let r=e.length-2,n=3,i,s;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},s={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},pi(e,n,r-n+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Wxe(e,t,r){let n=0;return i;function i(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&n++<6?(e.consume(h),o):h===null||Pn(h)?(e.exit("atxHeadingSequence"),l(h)):r(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||mt(h)?(e.exit("atxHeading"),t(h)):It(h)?rr(e,l,"whitespace")(h):(e.enter("atxHeadingText"),f(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),l(h))}function f(h){return h===null||h===35||Pn(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),f)}}const Kxe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],HM=["pre","script","style","textarea"],Gxe={concrete:!0,name:"htmlFlow",resolveTo:Xxe,tokenize:Zxe},Yxe={partial:!0,tokenize:ebe},Qxe={partial:!0,tokenize:Jxe};function Xxe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Zxe(e,t,r){const n=this;let i,s,o,l,c;return f;function f(z){return h(z)}function h(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),d}function d(z){return z===33?(e.consume(z),m):z===47?(e.consume(z),s=!0,y):z===63?(e.consume(z),i=3,n.interrupt?t:q):ei(z)?(e.consume(z),o=String.fromCharCode(z),v):r(z)}function m(z){return z===45?(e.consume(z),i=2,p):z===91?(e.consume(z),i=5,l=0,x):ei(z)?(e.consume(z),i=4,n.interrupt?t:q):r(z)}function p(z){return z===45?(e.consume(z),n.interrupt?t:q):r(z)}function x(z){const Z="CDATA[";return z===Z.charCodeAt(l++)?(e.consume(z),l===Z.length?n.interrupt?t:E:x):r(z)}function y(z){return ei(z)?(e.consume(z),o=String.fromCharCode(z),v):r(z)}function v(z){if(z===null||z===47||z===62||Pn(z)){const Z=z===47,re=o.toLowerCase();return!Z&&!s&&HM.includes(re)?(i=1,n.interrupt?t(z):E(z)):Kxe.includes(o.toLowerCase())?(i=6,Z?(e.consume(z),b):n.interrupt?t(z):E(z)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(z):s?w(z):_(z))}return z===45||Wn(z)?(e.consume(z),o+=String.fromCharCode(z),v):r(z)}function b(z){return z===62?(e.consume(z),n.interrupt?t:E):r(z)}function w(z){return It(z)?(e.consume(z),w):A(z)}function _(z){return z===47?(e.consume(z),A):z===58||z===95||ei(z)?(e.consume(z),N):It(z)?(e.consume(z),_):A(z)}function N(z){return z===45||z===46||z===58||z===95||Wn(z)?(e.consume(z),N):S(z)}function S(z){return z===61?(e.consume(z),k):It(z)?(e.consume(z),S):_(z)}function k(z){return z===null||z===60||z===61||z===62||z===96?r(z):z===34||z===39?(e.consume(z),c=z,C):It(z)?(e.consume(z),k):O(z)}function C(z){return z===c?(e.consume(z),c=null,R):z===null||mt(z)?r(z):(e.consume(z),C)}function O(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Pn(z)?S(z):(e.consume(z),O)}function R(z){return z===47||z===62||It(z)?_(z):r(z)}function A(z){return z===62?(e.consume(z),P):r(z)}function P(z){return z===null||mt(z)?E(z):It(z)?(e.consume(z),P):r(z)}function E(z){return z===45&&i===2?(e.consume(z),W):z===60&&i===1?(e.consume(z),U):z===62&&i===4?(e.consume(z),L):z===63&&i===3?(e.consume(z),q):z===93&&i===5?(e.consume(z),K):mt(z)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Yxe,V,T)(z)):z===null||mt(z)?(e.exit("htmlFlowData"),T(z)):(e.consume(z),E)}function T(z){return e.check(Qxe,$,V)(z)}function $(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),D}function D(z){return z===null||mt(z)?T(z):(e.enter("htmlFlowData"),E(z))}function W(z){return z===45?(e.consume(z),q):E(z)}function U(z){return z===47?(e.consume(z),o="",H):E(z)}function H(z){if(z===62){const Z=o.toLowerCase();return HM.includes(Z)?(e.consume(z),L):E(z)}return ei(z)&&o.length<8?(e.consume(z),o+=String.fromCharCode(z),H):E(z)}function K(z){return z===93?(e.consume(z),q):E(z)}function q(z){return z===62?(e.consume(z),L):z===45&&i===2?(e.consume(z),q):E(z)}function L(z){return z===null||mt(z)?(e.exit("htmlFlowData"),V(z)):(e.consume(z),L)}function V(z){return e.exit("htmlFlow"),t(z)}}function Jxe(e,t,r){const n=this;return i;function i(o){return mt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):r(o)}function s(o){return n.parser.lazy[n.now().line]?r(o):t(o)}}function ebe(e,t,r){return n;function n(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(qy,t,r)}}const tbe={name:"htmlText",tokenize:rbe};function rbe(e,t,r){const n=this;let i,s,o;return l;function l(q){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(q),c}function c(q){return q===33?(e.consume(q),f):q===47?(e.consume(q),S):q===63?(e.consume(q),_):ei(q)?(e.consume(q),O):r(q)}function f(q){return q===45?(e.consume(q),h):q===91?(e.consume(q),s=0,x):ei(q)?(e.consume(q),w):r(q)}function h(q){return q===45?(e.consume(q),p):r(q)}function d(q){return q===null?r(q):q===45?(e.consume(q),m):mt(q)?(o=d,U(q)):(e.consume(q),d)}function m(q){return q===45?(e.consume(q),p):d(q)}function p(q){return q===62?W(q):q===45?m(q):d(q)}function x(q){const L="CDATA[";return q===L.charCodeAt(s++)?(e.consume(q),s===L.length?y:x):r(q)}function y(q){return q===null?r(q):q===93?(e.consume(q),v):mt(q)?(o=y,U(q)):(e.consume(q),y)}function v(q){return q===93?(e.consume(q),b):y(q)}function b(q){return q===62?W(q):q===93?(e.consume(q),b):y(q)}function w(q){return q===null||q===62?W(q):mt(q)?(o=w,U(q)):(e.consume(q),w)}function _(q){return q===null?r(q):q===63?(e.consume(q),N):mt(q)?(o=_,U(q)):(e.consume(q),_)}function N(q){return q===62?W(q):_(q)}function S(q){return ei(q)?(e.consume(q),k):r(q)}function k(q){return q===45||Wn(q)?(e.consume(q),k):C(q)}function C(q){return mt(q)?(o=C,U(q)):It(q)?(e.consume(q),C):W(q)}function O(q){return q===45||Wn(q)?(e.consume(q),O):q===47||q===62||Pn(q)?R(q):r(q)}function R(q){return q===47?(e.consume(q),W):q===58||q===95||ei(q)?(e.consume(q),A):mt(q)?(o=R,U(q)):It(q)?(e.consume(q),R):W(q)}function A(q){return q===45||q===46||q===58||q===95||Wn(q)?(e.consume(q),A):P(q)}function P(q){return q===61?(e.consume(q),E):mt(q)?(o=P,U(q)):It(q)?(e.consume(q),P):R(q)}function E(q){return q===null||q===60||q===61||q===62||q===96?r(q):q===34||q===39?(e.consume(q),i=q,T):mt(q)?(o=E,U(q)):It(q)?(e.consume(q),E):(e.consume(q),$)}function T(q){return q===i?(e.consume(q),i=void 0,D):q===null?r(q):mt(q)?(o=T,U(q)):(e.consume(q),T)}function $(q){return q===null||q===34||q===39||q===60||q===61||q===96?r(q):q===47||q===62||Pn(q)?R(q):(e.consume(q),$)}function D(q){return q===47||q===62||Pn(q)?R(q):r(q)}function W(q){return q===62?(e.consume(q),e.exit("htmlTextData"),e.exit("htmlText"),t):r(q)}function U(q){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),H}function H(q){return It(q)?rr(e,K,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):K(q)}function K(q){return e.enter("htmlTextData"),o(q)}}const Lk={name:"labelEnd",resolveAll:sbe,resolveTo:obe,tokenize:lbe},nbe={tokenize:cbe},abe={tokenize:ube},ibe={tokenize:dbe};function sbe(e){let t=-1;const r=[];for(;++t<e.length;){const n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const i=n.type==="labelImage"?4:2;n.type="data",t+=i}}return e.length!==r.length&&pi(e,0,e.length,r),e}function obe(e,t){let r=e.length,n=0,i,s,o,l;for(;r--;)if(i=e[r][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(o=r);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},h={type:"labelText",start:{...e[s+n+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",f,t]],l=ha(l,e.slice(s+1,s+n+3)),l=ha(l,[["enter",h,t]]),l=ha(l,Mk(t.parser.constructs.insideSpan.null,e.slice(s+n+4,o-3),t)),l=ha(l,[["exit",h,t],e[o-2],e[o-1],["exit",f,t]]),l=ha(l,e.slice(o+1)),l=ha(l,[["exit",c,t]]),pi(e,s,e.length,l),e}function lbe(e,t,r){const n=this;let i=n.events.length,s,o;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){s=n.events[i][1];break}return l;function l(m){return s?s._inactive?d(m):(o=n.parser.defined.includes(mc(n.sliceSerialize({start:s.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),c):r(m)}function c(m){return m===40?e.attempt(nbe,h,o?h:d)(m):m===91?e.attempt(abe,h,o?f:d)(m):o?h(m):d(m)}function f(m){return e.attempt(ibe,h,d)(m)}function h(m){return t(m)}function d(m){return s._balanced=!0,r(m)}}function cbe(e,t,r){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Pn(d)?Ud(e,s)(d):s(d)}function s(d){return d===41?h(d):X8(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Pn(d)?Ud(e,c)(d):h(d)}function l(d){return r(d)}function c(d){return d===34||d===39||d===40?J8(e,f,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function f(d){return Pn(d)?Ud(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):r(d)}}function ube(e,t,r){const n=this;return i;function i(l){return Z8.call(n,e,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return n.parser.defined.includes(mc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function o(l){return r(l)}}function dbe(e,t,r){return n;function n(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):r(s)}}const fbe={name:"labelStartImage",resolveAll:Lk.resolveAll,tokenize:hbe};function hbe(e,t,r){const n=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):r(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(l):t(l)}}const mbe={name:"labelStartLink",resolveAll:Lk.resolveAll,tokenize:pbe};function pbe(e,t,r){const n=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(o):t(o)}}const mj={name:"lineEnding",tokenize:gbe};function gbe(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),rr(e,t,"linePrefix")}}const yp={name:"thematicBreak",tokenize:ybe};function ybe(e,t,r){let n=0,i;return s;function s(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,l(f)}function l(f){return f===i?(e.enter("thematicBreakSequence"),c(f)):n>=3&&(f===null||mt(f))?(e.exit("thematicBreak"),t(f)):r(f)}function c(f){return f===i?(e.consume(f),n++,c):(e.exit("thematicBreakSequence"),It(f)?rr(e,l,"whitespace")(f):l(f))}}const Sn={continuation:{tokenize:wbe},exit:jbe,name:"list",tokenize:bbe},vbe={partial:!0,tokenize:Nbe},xbe={partial:!0,tokenize:_be};function bbe(e,t,r){const n=this,i=n.events[n.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(p){const x=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:DN(p)){if(n.containerState.type||(n.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(yp,r,f)(p):f(p);if(!n.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return r(p)}function c(p){return DN(p)&&++o<10?(e.consume(p),c):(!n.interrupt||o<2)&&(n.containerState.marker?p===n.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),f(p)):r(p)}function f(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||p,e.check(qy,n.interrupt?r:h,e.attempt(vbe,m,d))}
vendor: 5,407 bytes, line 1054
1054function h(p){return n.containerState.initialBlankLine=!0,s++,m(p)}function d(p){return It(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):r(p)}function m(p){return n.containerState.size=s+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function wbe(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(qy,i,s);function i(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,rr(e,t,"listItemIndent",n.containerState.size+1)(l)}function s(l){return n.containerState.furtherBlankLines||!It(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(xbe,t,o)(l))}function o(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,rr(e,e.attempt(Sn,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function _be(e,t,r){const n=this;return rr(e,i,"listItemIndent",n.containerState.size+1);function i(s){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?t(s):r(s)}}function jbe(e){e.exit(this.containerState.type)}function Nbe(e,t,r){const n=this;return rr(e,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=n.events[n.events.length-1];return!It(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):r(s)}}const VM={name:"setextUnderline",resolveTo:Sbe,tokenize:kbe};function Sbe(e,t){let r=e.length,n,i,s;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(i=r)}else e[r][1].type==="content"&&e.splice(r,1),!s&&e[r][1].type==="definition"&&(s=r);const o={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[n][1],t]),e[n][1].end={...e[s][1].end}):e[n][1]=o,e.push(["exit",o,t]),e}function kbe(e,t,r){const n=this;let i;return s;function s(f){let h=n.events.length,d;for(;h--;)if(n.events[h][1].type!=="lineEnding"&&n.events[h][1].type!=="linePrefix"&&n.events[h][1].type!=="content"){d=n.events[h][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),i=f,o(f)):r(f)}function o(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===i?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),It(f)?rr(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||mt(f)?(e.exit("setextHeadingLine"),t(f)):r(f)}}const Cbe={tokenize:Fbe};function Fbe(e){const t=this,r=e.attempt(qy,n,e.attempt(this.parser.constructs.flowInitial,i,rr(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Axe,i)),"linePrefix")));return r;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const Obe={resolveAll:tB()},Ebe=eB("string"),Pbe=eB("text");function eB(e){return{resolveAll:tB(e==="text"?Tbe:void 0),tokenize:t};function t(r){const n=this,i=this.parser.constructs[e],s=r.attempt(i,o,l);return o;function o(h){return f(h)?s(h):l(h)}function l(h){if(h===null){r.consume(h);return}return r.enter("data"),r.consume(h),c}function c(h){return f(h)?(r.exit("data"),s(h)):(r.consume(h),c)}function f(h){if(h===null)return!0;const d=i[h];let m=-1;if(d)for(;++m<d.length;){const p=d[m];if(!p.previous||p.previous.call(n,n.previous))return!0}return!1}}}function tB(e){return t;function t(r,n){let i=-1,s;for(;++i<=r.length;)s===void 0?r[i]&&r[i][1].type==="data"&&(s=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==s+2&&(r[s][1].end=r[i-1][1].end,r.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(r,n):r}}function Tbe(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const n=e[r-1][1],i=t.sliceStream(n);let s=i.length,o=-1,l=0,c;for(;s--;){const f=i[s];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(f===-2)c=!0,l++;else if(f!==-1){s++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){const f={type:r===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:n.start._bufferIndex+o,_index:n.start._index+s,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...f.start},n.start.offset===n.end.offset?Object.assign(n,f):(e.splice(r,0,["enter",f,t],["exit",f,t]),r+=2)}r++}return e}const Abe={42:Sn,43:Sn,45:Sn,48:Sn,49:Sn,50:Sn,51:Sn,52:Sn,53:Sn,54:Sn,55:Sn,56:Sn,57:Sn,62:K8},Rbe={91:Dxe},Ibe={[-2]:hj,[-1]:hj,32:hj},Mbe={35:Hxe,42:yp,45:[VM,yp],60:Gxe,61:VM,95:yp,96:UM,126:UM},Lbe={38:Y8,92:G8},Dbe={[-5]:mj,[-4]:mj,[-3]:mj,33:fbe,38:Y8,42:$N,60:[mxe,tbe],91:mbe,92:[zxe,G8],93:Lk,95:$N,96:Cxe},$be={null:[$N,Obe]},qbe={null:[42,95]},Bbe={null:[]},zbe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:qbe,contentInitial:Rbe,disable:Bbe,document:Abe,flow:Mbe,flowInitial:Ibe,insideSpan:$be,string:Lbe,text:Dbe},Symbol.toStringTag,{value:"Module"}));function Ube(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,c
vendor: 19,068 bytes, lines 1054-1059
1054olumn:r&&r.column||1,offset:r&&r.offset||0};const i={},s=[];let o=[],l=[];const c={attempt:C(S),check:C(k),consume:w,enter:_,exit:N,interrupt:C(k,{interrupt:!0})},f={code:null,containerState:{},defineSkip:y,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:p,write:d};let h=t.tokenize.call(f,c);return t.resolveAll&&s.push(t),f;function d(P){return o=ha(o,P),v(),o[o.length-1]!==null?[]:(O(t,0),f.events=Mk(s,f.events,f),f.events)}function m(P,E){return Vbe(p(P),E)}function p(P){return Hbe(o,P)}function x(){const{_bufferIndex:P,_index:E,line:T,column:$,offset:D}=n;return{_bufferIndex:P,_index:E,line:T,column:$,offset:D}}function y(P){i[P.line]=P.column,A()}function v(){let P;for(;n._index<o.length;){const E=o[n._index];if(typeof E=="string")for(P=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===P&&n._bufferIndex<E.length;)b(E.charCodeAt(n._bufferIndex));else b(E)}}function b(P){h=h(P)}function w(P){mt(P)?(n.line++,n.column=1,n.offset+=P===-3?2:1,A()):P!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===o[n._index].length&&(n._bufferIndex=-1,n._index++)),f.previous=P}function _(P,E){const T=E||{};return T.type=P,T.start=x(),f.events.push(["enter",T,f]),l.push(T),T}function N(P){const E=l.pop();return E.end=x(),f.events.push(["exit",E,f]),E}function S(P,E){O(P,E.from)}function k(P,E){E.restore()}function C(P,E){return T;function T($,D,W){let U,H,K,q;return Array.isArray($)?V($):"tokenize"in $?V([$]):L($);function L(G){return X;function X(ie){const J=ie!==null&&G[ie],ue=ie!==null&&G.null,ge=[...Array.isArray(J)?J:J?[J]:[],...Array.isArray(ue)?ue:ue?[ue]:[]];return V(ge)(ie)}}function V(G){return U=G,H=0,G.length===0?W:z(G[H])}function z(G){return X;function X(ie){return q=R(),K=G,G.partial||(f.currentConstruct=G),G.name&&f.parser.constructs.disable.null.includes(G.name)?re():G.tokenize.call(E?Object.assign(Object.create(f),E):f,c,Z,re)(ie)}}function Z(G){return P(K,q),D}function re(G){return q.restore(),++H<U.length?z(U[H]):W}}}function O(P,E){P.resolveAll&&!s.includes(P)&&s.push(P),P.resolve&&pi(f.events,E,f.events.length-E,P.resolve(f.events.slice(E),f)),P.resolveTo&&(f.events=P.resolveTo(f.events,f))}function R(){const P=x(),E=f.previous,T=f.currentConstruct,$=f.events.length,D=Array.from(l);return{from:$,restore:W};function W(){n=P,f.previous=E,f.currentConstruct=T,f.events.length=$,l=D,A()}}function A(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function Hbe(e,t){const r=t.start._index,n=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(r===i)o=[e[r].slice(n,s)];else{if(o=e.slice(r,i),n>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(n):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function Vbe(e,t){let r=-1;const n=[];let i;for(;++r<e.length;){const s=e[r];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
1055`;break}case-3:{o=`\r
1056`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,n.push(o)}return n.join("")}function Wbe(e){const n={constructs:J0e([zbe,...(e||{}).extensions||[]]),content:i(oxe),defined:[],document:i(cxe),flow:i(Cbe),lazy:{},string:i(Ebe),text:i(Pbe)};return n;function i(s){return o;function o(l){return Ube(n,s,l)}}}function Kbe(e){for(;!Q8(e););return e}const WM=/[\0\t\n\r]/g;function Gbe(){let e=1,t="",r=!0,n;return i;function i(s,o,l){const c=[];let f,h,d,m,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",r&&(s.charCodeAt(0)===65279&&d++,r=void 0);d<s.length;){if(WM.lastIndex=d,f=WM.exec(s),m=f&&f.index!==void 0?f.index:s.length,p=s.charCodeAt(m),!f){t=s.slice(d);break}if(p===10&&d===m&&n)c.push(-3),n=void 0;else switch(n&&(c.push(-5),n=void 0),d<m&&(c.push(s.slice(d,m)),e+=m-d),p){case 0:{c.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,c.push(-2);e++<h;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:n=!0,e=1}d=m+1}return l&&(n&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Ybe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qbe(e){return e.replace(Ybe,Xbe)}function Xbe(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const i=r.charCodeAt(1),s=i===120||i===88;return W8(r.slice(s?2:1),s?16:10)}return Ik(r)||e}const rB={}.hasOwnProperty;function Zbe(e,t,r){return typeof t!="string"&&(r=t,t=void 0),Jbe(r)(Kbe(Wbe(r).document().write(Gbe()(e,t,!0))))}function Jbe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(xe),autolinkProtocol:R,autolinkEmail:R,atxHeading:s(Ve),blockQuote:s(ue),characterEscape:R,characterReference:R,codeFenced:s(ge),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(ge,o),codeText:s(fe,o),codeTextData:R,data:R,codeFlowValue:R,definition:s(Ee),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Oe),hardBreakEscape:s(Ae),hardBreakTrailing:s(Ae),htmlFlow:s(tt,o),htmlFlowData:R,htmlText:s(tt,o),htmlTextData:R,image:s(ye),label:o,link:s(xe),listItem:s(Re),listItemValue:m,listOrdered:s(Ce,d),listUnordered:s(Ce),paragraph:s(_e),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Ve),strong:s(dt),thematicBreak:s(gt)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:J,autolinkProtocol:ie,blockQuote:c(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:G,characterReference:X,codeFenced:c(v),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:A,codeIndented:c(b),codeText:c(D),codeTextData:A,data:A,definition:c(),definitionDestinationString:N,definitionLabelString:w,definitionTitleString:_,emphasis:c(),hardBreakEscape:c(E),hardBreakTrailing:c(E),htmlFlow:c(T),htmlFlowData:A,htmlText:c($),htmlTextData:A,image:c(U),label:K,labelText:H,lineEnding:P,link:c(W),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:q,resourceTitleString:L,resource:V,setextHeading:c(O),setextHeadingLineSequence:C,setextHeadingText:k,strong:c(),thematicBreak:c()}};nB(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(be){let ke={type:"root",children:[]};const He={stack:[ke],tokenStack:[],config:t,enter:l,exit:f,buffer:o,resume:h,data:r},wt=[];let it=-1;for(;++it<be.length;)if(be[it][1].type==="listOrdered"||be[it][1].type==="listUnordered")if(be[it][0]==="enter")wt.push(it);else{const Xt=wt.pop();it=i(be,Xt,it)}for(it=-1;++it<be.length;){const Xt=t[be[it][0]];rB.call(Xt,be[it][1].type)&&Xt[be[it][1].type].call(Object.assign({sliceSerialize:be[it][2].sliceSerialize},He),be[it][1])}if(He.tokenStack.length>0){const Xt=He.tokenStack[He.tokenStack.length-1];(Xt[1]||KM).call(He,void 0,Xt[0])}for(ke.position={start:js(be.length>0?be[0][1].start:{line:1,column:1,offset:0}),end:js(be.length>0?be[be.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it<t.transforms.length;)ke=t.transforms[it](ke)||ke;return ke}function i(be,ke,He){let wt=ke-1,it=-1,Xt=!1,xi,ea,ts,ro;for(;++wt<=He;){const Wr=be[wt];switch(Wr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wr[0]==="enter"?it++:it--,ro=void 0;break}case"lineEndingBlank":{Wr[0]==="enter"&&(xi&&!ro&&!it&&!ts&&(ts=wt),ro=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ro=void 0}if(!it&&Wr[0]==="enter"&&Wr[1].type==="listItemPrefix"||it===-1&&Wr[0]==="exit"&&(Wr[1].type==="listUnordered"||Wr[1].type==="listOrdered")){if(xi){let Ua=wt;for(ea=void 0;Ua--;){const Rn=be[Ua];if(Rn[1].type==="lineEnding"||Rn[1].type==="lineEndingBlank"){if(Rn[0]==="exit")continue;ea&&(be[ea][1].type="lineEndingBlank",Xt=!0),Rn[1].type="lineEnding",ea=Ua}else if(!(Rn[1].type==="linePrefix"||Rn[1].type==="blockQuotePrefix"||Rn[1].type==="blockQuotePrefixWhitespace"||Rn[1].type==="blockQuoteMarker"||Rn[1].type==="listItemIndent"))break}ts&&(!ea||ts<ea)&&(xi._spread=!0),xi.end=Object.assign({},ea?be[ea][1].start:Wr[1].end),be.splice(ea||wt,0,["exit",xi,Wr[2]]),wt++,He++}if(Wr[1].type==="listItemPrefix"){const Ua={type:"listItem",_spread:!1,start:Object.assign({},Wr[1].start),end:void 0};xi=Ua,be.splice(wt,0,["enter",Ua,Wr[2]]),wt++,He++,ts=void 0,ro=!0}}}return be[ke][1]._spread=Xt,He}function s(be,ke){return He;function He(wt){l.call(this,be(wt),wt),ke&&ke.call(this,wt)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(be,ke,He){this.stack[this.stack.length-1].children.push(be),this.stack.push(be),this.tokenStack.push([ke,He||void 0]),be.position={start:js(ke.start),end:void 0}}function c(be){return ke;function ke(He){be&&be.call(this,He),f.call(this,He)}}function f(be,ke){const He=this.stack.pop(),wt=this.tokenStack.pop();if(wt)wt[0].type!==be.type&&(ke?ke.call(this,be,wt[0]):(wt[1]||KM).call(this,be,wt[0]));else throw new Error("Cannot close `"+be.type+"` ("+zd({start:be.start,end:be.end})+"): it’s not open");He.position.end=js(be.end)}function h(){return X0e(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function m(be){if(this.data.expectingFirstListItemValue){const ke=this.stack[this.stack.length-2];ke.start=Number.parseInt(this.sliceSerialize(be),10),this.data.expectingFirstListItemValue=void 0}}function p(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.lang=be}function x(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.meta=be}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.value=be.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.value=be.replace(/(\r?\n|\r)$/g,"")}function w(be){const ke=this.resume(),He=this.stack[this.stack.length-1];He.label=ke,He.identifier=mc(this.sliceSerialize(be)).toLowerCase()}function _(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.title=be}function N(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.url=be}function S(be){const ke=this.stack[this.stack.length-1];if(!ke.depth){const He=this.sliceSerialize(be).length;ke.depth=He}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function C(be){const ke=this.stack[this.stack.length-1];ke.depth=this.sliceSerialize(be).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function R(be){const He=this.stack[this.stack.length-1].children;let wt=He[He.length-1];(!wt||wt.type!=="text")&&(wt=pt(),wt.position={start:js(be.start),end:void 0},He.push(wt)),this.stack.push(wt)}function A(be){const ke=this.stack.pop();ke.value+=this.sliceSerialize(be),ke.position.end=js(be.end)}function P(be){const ke=this.stack[this.stack.length-1];if(this.data.atHardBreak){const He=ke.children[ke.children.length-1];He.position.end=js(be.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ke.type)&&(R.call(this,be),A.call(this,be))}function E(){this.data.atHardBreak=!0}function T(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.value=be}function $(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.value=be}function D(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.value=be}function W(){const be=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";be.type+="Reference",be.referenceType=ke,delete be.url,delete be.title}else delete be.identifier,delete be.label;this.data.referenceType=void 0}function U(){const be=this.stack[this.stack.length-1];if(this.data.inReference){const ke=this.data.referenceType||"shortcut";be.type+="Reference",be.referenceType=ke,delete be.url,delete be.title}else delete be.identifier,delete be.label;this.data.referenceType=void 0}function H(be){const ke=this.sliceSerialize(be),He=this.stack[this.stack.length-2];He.label=Qbe(ke),He.identifier=mc(ke).toLowerCase()}function K(){const be=this.stack[this.stack.length-1],ke=this.resume(),He=this.stack[this.stack.length-1];if(this.data.inReference=!0,He.type==="link"){const wt=be.children;He.children=wt}else He.alt=ke}function q(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.url=be}function L(){const be=this.resume(),ke=this.stack[this.stack.length-1];ke.title=be}function V(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function Z(be){const ke=this.resume(),He=this.stack[this.stack.length-1];He.label=ke,He.identifier=mc(this.sliceSerialize(be)).toLowerCase(),this.data.referenceType="full"}function re(be){this.data.characterReferenceType=be.type}function G(be){const ke=this.sliceSerialize(be),He=this.data.characterReferenceType;let wt;He?(wt=W8(ke,He==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):wt=Ik(ke);const it=this.stack[this.stack.length-1];it.value+=wt}function X(be){const ke=this.stack.pop();ke.position.end=js(be.end)}function ie(be){A.call(this,be);const ke=this.stack[this.stack.length-1];ke.url=this.sliceSerialize(be)}function J(be){A.call(this,be);const ke=this.stack[this.stack.length-1];ke.url="mailto:"+this.sliceSerialize(be)}function ue(){return{type:"blockquote",children:[]}}function ge(){return{type:"code",lang:null,meta:null,value:""}}function fe(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function Ae(){return{type:"break"}}function tt(){return{type:"html",value:""}}function ye(){return{type:"image",title:null,url:"",alt:null}}function xe(){return{type:"link",title:null,url:"",children:[]}}function Ce(be){return{type:"list",ordered:be.type==="listOrdered",start:null,spread:be._spread,children:[]}}function Re(be){return{type:"listItem",spread:be._spread,checked:null,children:[]}}function _e(){return{type:"paragraph",children:[]}}function dt(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function gt(){return{type:"thematicBreak"}}}function js(e){return{line:e.line,column:e.column,offset:e.offset}}function nB(e,t){let r=-1;for(;++r<t.length;){const n=t[r];Array.isArray(n)?nB(e,n):ewe(e,n)}}function ewe(e,t){let r;for(r in t)if(rB.call(t,r))switch(r){case"canContainEols":{const n=t[r];n&&e[r].push(...n);break}case"transforms":{const n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{const n=t[r];n&&Object.assign(e[r],n);break}}}function KM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+zd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+zd({start:t.start,end:t.end})+") is still open")}function twe(e){const t=this;t.parser=r;function r(n){return Zbe(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function rwe(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function nwe(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
1057`}]}function awe(e,t){const r=t.value?t.value+`
1058`:"",n={};t.lang&&(n.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function iwe(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function swe(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function owe(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=String(t.identifier).toUpperCase(),i=wu(n.toLowerCase()),s=e.footnoteOrder.indexOf(n);let o,l=e.footnoteCounts.get(n);l===void 0?(l=0,e.footnoteOrder.push(n),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(n,l);const c={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function lwe(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function cwe(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function aB(e,t){const r=t.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+n}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=n:i.push({type:"text",value:n}),i}function uwe(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return aB(e,t);const i={src:wu(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function dwe(e,t){const r={src:wu(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)}function fwe(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)}function hwe(e,t){const r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return aB(e,t);const i={href:wu(n.url||"")};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function mwe(e,t){const r={href:wu(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pwe(e,t,r){const n=e.all(t),i=r?gwe(r):iB(t),s={},o=[];if(typeof t.checked=="boolean"){const h=n[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},n.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<n.length;){const h=n[l];(i||l!==0||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
1059`}
vendor: 4,838 bytes, lines 1059-1060
1059),h.type==="element"&&h.tagName==="p"&&!i?o.push(...h.children):o.push(h)}const c=n[n.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
1060`});const f={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,f),e.applyData(t,f)}function gwe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let n=-1;for(;!t&&++n<r.length;)t=iB(r[n])}return t}function iB(e){const t=e.spread;return t??e.children.length>1}function ywe(e,t){const r={},n=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++i<n.length;){const o=n[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,s),e.applyData(t,s)}function vwe(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xwe(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function bwe(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function wwe(e,t){const r=e.all(t),n=r.shift(),i=[];if(n){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],o),i.push(o)}if(r.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},l=Pk(t.children[1]),c=$8(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function _we(e,t,r){const n=r?r.children:void 0,s=(n?n.indexOf(t):1)===0?"th":"td",o=r&&r.type==="table"?r.align:void 0,l=o?o.length:t.children.length;let c=-1;const f=[];for(;++c<l;){const d=t.children[c],m={},p=o?o[c]:void 0;p&&(m.align=p);let x={type:"element",tagName:s,properties:m,children:[]};d&&(x.children=e.all(d),e.patch(d,x),x=e.applyData(d,x)),f.push(x)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,h),e.applyData(t,h)}function jwe(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const GM=9,YM=32;function Nwe(e){const t=String(e),r=/\r?\n|\r/g;let n=r.exec(t),i=0;const s=[];for(;n;)s.push(QM(t.slice(i,n.index),i>0,!0),n[0]),i=n.index+n[0].length,n=r.exec(t);return s.push(QM(t.slice(i),i>0,!1)),s.join("")}function QM(e,t,r){let n=0,i=e.length;if(t){let s=e.codePointAt(n);for(;s===GM||s===YM;)n++,s=e.codePointAt(n)}if(r){let s=e.codePointAt(i-1);for(;s===GM||s===YM;)i--,s=e.codePointAt(i-1)}return i>n?e.slice(n,i):""}function Swe(e,t){const r={type:"text",value:Nwe(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function kwe(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const Cwe={blockquote:rwe,break:nwe,code:awe,delete:iwe,emphasis:swe,footnoteReference:owe,heading:lwe,html:cwe,imageReference:uwe,image:dwe,inlineCode:fwe,linkReference:hwe,link:mwe,listItem:pwe,list:ywe,paragraph:vwe,root:xwe,strong:bwe,table:wwe,tableCell:jwe,tableRow:_we,text:Swe,thematicBreak:kwe,toml:Xm,yaml:Xm,definition:Xm,footnoteDefinition:Xm};function Xm(){}const sB=-1,By=0,Hd=1,Ig=2,Dk=3,$k=4,qk=5,Bk=6,oB=7,lB=8,XM=typeof self=="object"?self:globalThis,Fwe=(e,t)=>{const r=(i,s)=>(e.set(s,i),i),n=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case By:case sB:return r(o,i);case Hd:{const l=r([],i);for(const c of o)l.push(n(c));return l}case Ig:{const l=r({},i);for(const[c,f]of o)l[n(c)]=n(f);return l}case Dk:return r(new Date(o),i);case $k:{const{source:l,flags:c}=o;return r(new RegExp(l,c),i)}case qk:{const l=r(new Map,i);for(const[c,f]of o)l.set(n(c),n(f));return l}case Bk:{const l=r(new Set,i);for(const c of o)l.add(n(c));return l}case oB:{const{name:l,message:c}=o;return r(new XM[l](c),i)}case lB:return r(BigInt(o),i);case"BigInt":return r(Object(BigInt(o)),i);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return r(new DataView(l),o)}}return r(new XM[s](o),i)};return n},ZM=e=>Fwe(new Map,e)(0),Jl="",{toString:Owe}={},{keys:Ewe}=Object,Sd=e=>{const t=typeof e;if(t!=="object"||!e)return[By,t];const r=Owe.call(e).slice(8,-1);switch(r){case"Array":return[Hd,Jl];case"Object":return[Ig,Jl];case"Date":return[Dk,Jl];case"RegExp":return[$k,Jl];case"Map":return[qk,Jl];case"Set":return[Bk,Jl];case"DataView":return[Hd,r]}return r.includes("Array")?[Hd,r]:r.includes("Error")?[oB,r]:[Ig,r]},Zm=([e,t])=>e===By&&(t==="function"||t==="symbol"),Pwe=(e,t,r,n)=>{const i=(o,l)=>{const c=n.push(o)-1;return r.set(l,c),c},s=o=>
vendor: 6,518 bytes, lines 1060-1062
1060{if(r.has(o))return r.get(o);let[l,c]=Sd(o);switch(l){case By:{let h=o;switch(c){case"bigint":l=lB,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return i([sB],o)}return i([l,h],o)}case Hd:{if(c){let m=o;return c==="DataView"?m=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(m=new Uint8Array(o)),i([c,[...m]],o)}const h=[],d=i([l,h],o);for(const m of o)h.push(s(m));return d}case Ig:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const h=[],d=i([l,h],o);for(const m of Ewe(o))(e||!Zm(Sd(o[m])))&&h.push([s(m),s(o[m])]);return d}case Dk:return i([l,o.toISOString()],o);case $k:{const{source:h,flags:d}=o;return i([l,{source:h,flags:d}],o)}case qk:{const h=[],d=i([l,h],o);for(const[m,p]of o)(e||!(Zm(Sd(m))||Zm(Sd(p))))&&h.push([s(m),s(p)]);return d}case Bk:{const h=[],d=i([l,h],o);for(const m of o)(e||!Zm(Sd(m)))&&h.push(s(m));return d}}const{message:f}=o;return i([l,{name:c,message:f}],o)};return s},JM=(e,{json:t,lossy:r}={})=>{const n=[];return Pwe(!(t||r),!!t,new Map,n)(e),n},Mg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ZM(JM(e,t)):structuredClone(e):(e,t)=>ZM(JM(e,t));function Twe(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function Awe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Rwe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||Twe,n=e.options.footnoteBackLabel||Awe,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[c]);if(!f)continue;const h=e.all(f),d=String(f.identifier).toUpperCase(),m=wu(d.toLowerCase());let p=0;const x=[],y=e.footnoteCounts.get(d);for(;y!==void 0&&++p<=y;){x.length>0&&x.push({type:"text",value:" "});let w=typeof r=="string"?r:r(c,p);typeof w=="string"&&(w={type:"text",value:w}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(c,p),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=h[h.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else h.push(...x);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(h,!0)};e.patch(f,b),l.push(b)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Mg(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
1061`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
1062`}]}}const cB=(function(e){if(e==null)return Dwe;if(typeof e=="function")return zy(e);if(typeof e=="object")return Array.isArray(e)?Iwe(e):Mwe(e);if(typeof e=="string")return Lwe(e);throw new Error("Expected function, string, or object as test")});function Iwe(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=cB(e[r]);return zy(n);function n(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Mwe(e){const t=e;return zy(r);function r(n){const i=n;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function Lwe(e){return zy(t);function t(r){return r&&r.type===e}}function zy(e){return t;function t(r,n,i){return!!($we(r)&&e.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function Dwe(){return!0}function $we(e){return e!==null&&typeof e=="object"&&"type"in e}const uB=[],qwe=!0,eL=!1,Bwe="skip";function zwe(e,t,r,n){let i;typeof t=="function"&&typeof r!="function"?(n=r,r=t):i=t;const s=cB(i),o=n?-1:1;l(e,void 0,[])();function l(c,f,h){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return m;function m(){let p=uB,x,y,v;if((!t||s(c,f,h[h.length-1]||void 0))&&(p=Uwe(r(c,h)),p[0]===eL))return p;if("children"in c&&c.children){const b=c;if(b.children&&p[0]!==Bwe)for(y=(n?b.children.length:-1)+o,v=h.concat(b);y>-1&&y<b.children.length;){const w=b.children[y];if(x=l(w,y,v)(),x[0]===eL)return x;y=typeof x[1]=="number"?x[1]:y+o}}return p}}}function Uwe(e){return Array.isArray(e)?e:typeof e=="number"?[qwe,e]:e==null?uB:[e]}function dB(e,t,r,n){let i,s,o;typeof t=="function"&&typeof r!="function"?(s=void 0,o=t,i=r):(s=t,o=r,i=n),zwe(e,s,l,i);function l(c,f){const h=f[f.length-1],d=h?h.children.indexOf(c):void 0;return o(c,d,h)}}const qN={}.hasOwnProperty,Hwe={};function Vwe(e,t){const r=t||Hwe,n=new Map,i=new Map,s=new Map,o={...Cwe,...r.handlers},l={all:f,applyData:Kwe,definitionById:n,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:c,options:r,patch:Wwe,wrap:Ywe};return dB(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?n:i,m=String(h.identifier).toUpperCase();d.has(m)||d.set(m,h)}}),l;function c(h,d){const m=h.type,p=l.handlers[m];if(qN.call(l.handlers,m)&&p)return p(l,h,d);if(l.options.passThrough&&l.options.passThrough.includes(m)){if("children"in h){const{children:y,...v}=h,b=Mg(v);return b.children=l.all(h),b}return Mg(h)}return(l.options.unknownHandler||Gwe)(l,h,d)}function f(h){const d=[];if("children"in h){const m=h.children;let p=-1;for(;++p<m.length;){const x=l.one(m[p],h);if(x){if(p&&m[p-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=tL(x.value)),!Array.isArray(x)&&x.type==="element")){const y=x.children[0];y&&y.type==="text"&&(y.value=tL(y.value))}Array.isArray(x)?d.push(...x):d.push(x)}}}return d}}function Wwe(e,t){e.position&&(t.position=O0e(e))}function Kwe(e,t){let r=t;if(e&&e.data){const n=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const o="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:o}}r.type==="element"&&s&&Object.assign(r.properties,Mg(s)),"children"in r&&r.children&&i!==null&&i!==void 0&&(r.children=i)}return r}function Gwe(e,t){const r=t.data||{}
vendor: 5,310 bytes, lines 1062-1066
1062,n="value"in t&&!(qN.call(r,"hProperties")||qN.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ywe(e,t){const r=[];let n=-1;for(t&&r.push({type:"text",value:`
1063`});++n<e.length;)n&&r.push({type:"text",value:`
1064`}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
1065`}),r}function tL(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function rL(e,t){const r=Vwe(e,t),n=r.one(e,void 0),i=Rwe(r),s=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
1066`},i),s}function Qwe(e,t){return e&&"run"in e?async function(r,n){const i=rL(r,{file:n,...t});await e.run(i,n)}:function(r,n){return rL(r,{file:n,...e||t})}}function nL(e){if(e)throw e}var pj,aL;function Xwe(){if(aL)return pj;aL=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},s=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var h=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!h&&!d)return!1;var m;for(m in f);return typeof m>"u"||e.call(f,m)},o=function(f,h){r&&h.name==="__proto__"?r(f,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):f[h.name]=h.newValue},l=function(f,h){if(h==="__proto__")if(e.call(f,h)){if(n)return n(f,h).value}else return;return f[h]};return pj=function c(){var f,h,d,m,p,x,y=arguments[0],v=1,b=arguments.length,w=!1;for(typeof y=="boolean"&&(w=y,y=arguments[1]||{},v=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});v<b;++v)if(f=arguments[v],f!=null)for(h in f)d=l(y,h),m=l(f,h),y!==m&&(w&&m&&(s(m)||(p=i(m)))?(p?(p=!1,x=d&&i(d)?d:[]):x=d&&s(d)?d:{},o(y,{name:h,newValue:c(w,x,m)})):typeof m<"u"&&o(y,{name:h,newValue:m}));return y},pj}var Zwe=Xwe();const gj=Ft(Zwe);function BN(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)}function Jwe(){const e=[],t={run:r,use:n};return t;function r(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(c,...f){const h=e[++s];let d=-1;if(c){o(c);return}for(;++d<i.length;)(f[d]===null||f[d]===void 0)&&(f[d]=i[d]);i=f,h?e_e(h,l)(...f):o(null,...f)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function e_e(e,t){let r;return n;function n(...o){const l=e.length>o.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(f){const h=f;if(l&&r)throw h;return i(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,i):c instanceof Error?i(c):s(c))}function i(o,...l){r||(r=!0,t(o,...l))}function s(o){i(null,o)}}const Ya={basename:t_e,dirname:r_e,extname:n_e,join:a_e,sep:"/"};function t_e(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');hh(e);let r=0,n=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){r=i+1;break}}else n<0&&(s=!0,n=i+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){r=i+1;break}}else o<0&&(s=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(n=i):(l=-1,n=o));return r===n?n=o:n<0&&(n=e.length),e.slice(r,n)}function r_e(e){if(hh(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function n_e(e){hh(e);let t=e.length,r=-1,n=0,i=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){n=t+1;break}continue}r<0&&(o=!0,r=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||r<0||s===0||s===1&&i===r-1&&i===n+1?"":e.slice(i,r)}function a_e(...e){let t=-1,r;for(;++t<e.length;)hh(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":i_e(r)}function i_e(e){hh(e);const t=e.codePointAt(0)===47;let r=s_e(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function s_e(e,t){let r="",n=0,i=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(c=r.lastIndexOf("/"),c!==r.length-1){c<0?(r="",n=0):(r=r.slice(0,c),n=r.length-1-r.lastIndexOf("/")),i=o,s=0;continue}}else if(r.length>0){r="",n=0,i=o,s=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(i+1,o):r=e.slice(i+1,o),n=o-i-1;i=o,s=0}else l===46&&s>-1?s++:s=-1}return r}function hh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const o_e={cwd:l_e};function l_e(){return"/"}function zN(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}
vendor: 10,137 bytes, line 1066
1066function c_e(e){if(typeof e=="string")e=new URL(e);else if(!zN(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return u_e(e)}function u_e(e){if(e.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const n=t.codePointAt(r+2);if(n===70||n===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const yj=["history","path","basename","stem","extname","dirname"];class fB{constructor(t){let r;t?zN(t)?r={path:t}:typeof t=="string"||d_e(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":o_e.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<yj.length;){const s=yj[n];s in r&&r[s]!==void 0&&r[s]!==null&&(this[s]=s==="history"?[...r[s]]:r[s])}let i;for(i in r)yj.includes(i)||(this[i]=r[i])}get basename(){return typeof this.path=="string"?Ya.basename(this.path):void 0}set basename(t){xj(t,"basename"),vj(t,"basename"),this.path=Ya.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ya.dirname(this.path):void 0}set dirname(t){iL(this.basename,"dirname"),this.path=Ya.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ya.extname(this.path):void 0}set extname(t){if(vj(t,"extname"),iL(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ya.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){zN(t)&&(t=c_e(t)),xj(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ya.basename(this.path,this.extname):void 0}set stem(t){xj(t,"stem"),vj(t,"stem"),this.path=Ya.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){const i=this.message(t,r,n);throw i.fatal=!0,i}info(t,r,n){const i=this.message(t,r,n);return i.fatal=void 0,i}message(t,r,n){const i=new un(t,r,n);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function vj(e,t){if(e&&e.includes(Ya.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ya.sep+"`")}function xj(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function iL(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function d_e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const f_e=(function(e){const n=this.constructor.prototype,i=n[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,n),s}),h_e={}.hasOwnProperty;class zk extends f_e{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Jwe()}copy(){const t=new zk;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];t.use(...n)}return t.data(gj(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(_j("data",this.frozen),this.namespace[t]=r,this):h_e.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_j("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const i=r.call(t,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Jm(t),n=this.parser||this.Parser;return bj("parse",n),n(String(r),r)}process(t,r){const n=this;return this.freeze(),bj("process",this.parser||this.Parser),wj("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(s,o){const l=Jm(t),c=n.parse(l);n.run(c,l,function(h,d,m){if(h||!d||!m)return f(h);const p=d,x=n.stringify(p,m);g_e(x)?m.value=x:m.result=x,f(h,m)});function f(h,d){h||!d?o(h):s?s(d):r(void 0,d)}}}processSync(t){let r=!1,n;return this.freeze(),bj("processSync",this.parser||this.Parser),wj("processSync",this.compiler||this.Compiler),this.process(t,i),oL("processSync","process",r),n;function i(s,o){r=!0,nL(s),n=o}}run(t,r,n){sL(t),this.freeze();const i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?s(void 0,n):new Promise(s);function s(o,l){const c=Jm(r);i.run(t,c,f);function f(h,d,m){const p=d||t;h?l(h):o?o(p):n(void 0,p,m)}}}runSync(t,r){let n=!1,i;return this.run(t,r,s),oL("runSync","run",n),i;function s(o,l){nL(o),i=l,n=!0}}stringify(t,r){this.freeze();const n=Jm(r),i=this.compiler||this.Compiler;return wj("stringify",i),sL(t),i(t,n)}use(t,...r){const n=this.attachers,i=this.namespace;if(_j("use",this.frozen),t!=null)if(typeof t=="function")c(t,r);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(f){if(typeof f=="function")c(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[h,...d]=f;c(h,d)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(f.plugins),f.settings&&(i.settings=gj(!0,i.settings,f.settings))}function l(f){let h=-1;if(f!=null)if(Array.isArray(f))for(;++h<f.length;){const d=f[h];s(d)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,h){let d=-1,m=-1;for(;++d<n.length;)if(n[d][0]===f){m=d;break}if(m===-1)n.push([f,...h]);else if(h.length>0){let[p,...x]=h;const y=n[m][1];BN(y)&&BN(p)&&(p=gj(!0,y,p)),n[m]=[f,p,...x]}}}}const m_e=new zk().freeze();function bj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function wj(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _j(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function sL(e){if(!BN(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function oL(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jm(e){return p_e(e)?e:new fB(e)}function p_e(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function g_e(e){return typeof e=="string"||y_e(e)}function y_e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const v_e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lL=[],cL={allowDangerousHtml:!0},x_e=/^(https?|ircs?|mailto|xmpp)$/i,b_e=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function w_e(e){const t=__e(e),r=j_e(e);return N_e(t.runSync(t.parse(r),r),e)}function __e(e){const t=e.rehypePlugins||lL,r=e.remarkPlugins||lL,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cL}:cL;return m_e().use(twe).use(r).use(Qwe,n).use(t)}function j_e(e){const t=e.children||"",r=new fB;return typeof t=="string"&&(r.value=t),r}function N_e(e,t){const r=t.allowedElements,n=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||S_e;for(const h of b_e)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+v_e+h.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),dB(e,f),R0e(e,{Fragment:a.Fragment,components:i,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function f(h,d,m){if(h.type==="raw"&&m&&typeof d=="number")return o?m.children.splice(d,1):m.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let p;for(p in fj)if(Object.hasOwn(fj,p)&&Object.hasOwn(h.properties,p)){const x=h.properties[p],y=fj[p];(y===null||y.includes(h.tagName))&&(h.properties[p]=c(String(x||""),p,h))}}if(h.type==="element"){let p=r?!r.includes(h.tagName):s?s.includes(h.tagName):!1;if(!p&&n&&typeof d=="number"&&(p=!n(h,d,m)),p&&m&&typeof d=="number")return l&&h.children?m.children.splice(d,1,...h.children):m.children.splice(d,1),d}}}function S_e(e){const t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||r!==-1&&t>r||n!==-1&&t>n||x_e.test(e.slice(0,t))?e:""}function k_e(){const[e]=Bg(),t=e.get("formId"),[r,n]=I.useState(!1),[i,s]=I.useState({applicant_name:"",applicant_email:"",ph
1066one_number:"",line_id:"",mailing_address:"",company_school_name:"",title_department:"",company_tax_id:"",coding_experience:"",course_info_source:"",pre_course_questions:"",preferred_payment_method:"",remarks:"",terms_agreed:!1,custom_field_responses:{}}),{data:o,isLoading:l}=Te({queryKey:["publicForm",t],queryFn:async()=>t?(await ee.entities.CourseForm.list()).find(d=>d.id===t):null,enabled:!!t}),c=Ye({mutationFn:h=>ee.entities.CourseRegistration.create({...h,form_id:t,course_id:o==null?void 0:o.course_id,registration_date:new Date().toISOString(),status:"pending"}),onSuccess:async h=>{n(!0);try{const d=await ee.entities.Course.list().then(m=>m.find(p=>p.id===o.course_id));if(d){const m=o.tier||"standard",p={};m==="standard"&&(p.standard_enrolled=(d.standard_enrolled||0)+1),m==="early_bird"&&(p.early_bird_enrolled=(d.early_bird_enrolled||0)+1),m==="late_bird"&&(p.late_bird_enrolled=(d.late_bird_enrolled||0)+1),p.total_enrolled=(d.total_enrolled||0)+1;const x=m==="standard"?p.standard_enrolled:d.standard_enrolled||0,y=m==="early_bird"?p.early_bird_enrolled:d.early_bird_enrolled||0,v=m==="late_bird"?p.late_bird_enrolled:d.late_bird_enrolled||0;p.total_revenue=x*(d.standard_price||0)+y*(d.early_bird_price||0)+v*(d.late_bird_price||0),p.net_profit=p.total_revenue-(d.total_cost||0),await ee.entities.Course.update(d.id,p)}}catch(d){console.error("Failed to update course enrollment count",d)}if(o!=null&&o.email_template_subject&&(o!=null&&o.email_template_body)){const d=o.email_template_subject.replace("{{course_name}}",o.title),m=o.email_template_body.replace("{{applicant_name}}",h.applicant_name).replace("{{course_name}}",o.title);ee.integrations.Core.SendEmail({to:h.applicant_email,subject:d,body:m}).catch(p=>console.error("Failed to send confirmation email",p))}try{const m=(await ee.entities.User.list()).filter(p=>p.role==="admin");for(const p of m)p.email&&await ee.integrations.Core.SendEmail({to:p.email,subject:`【新報名通知】${o.title} - ${h.applicant_name}`,body:`
1067親愛的 ${p.full_name} 您好,
1068
1069收到新的課程報名資料:
1070
1071課程名稱:${o.title}
1072學員姓名:${h.applicant_name}
1073Email:${h.applicant_email}
1074手機:${h.phone_number}
1075LINE ID:${h.line_id||"未提供"}
1076報名時間:${new Date().toLocaleString("zh-TW")}
1077
1078請登入系統查看詳細資訊。
1079
1080無限未來管理系統
1081              `}).catch(x=>console.error("Failed to send email to admin:",p.email,x))}catch(d){console.error("Failed to notify admin via email",d)}try{await ee.entities.Notification.create({title:"新課程報名",message:`${h.applicant_name} 已報名課程:${o.title}`,type:"info",link:`${Ur("CourseRegistrationManagement")}?courseId=${o.course_id}`,is_read:!1,created_at:new Date().toISOString()})}catch(d){console.error("Failed to create system notification",d)}if(h.line_id)try{const d=`【報名成功通知】
1082
1083親愛的 ${h.applicant_name} 您好,
1084
1085感謝您報名 ${o.title}。
1086
1087我們已收到您的報名資訊,將盡快與您聯繫。
1088
1089如有任何問題,歡迎隨時聯繫我們。
1090
1091無限未來管理系統 團隊 敬上`;await ee.functions.sendLineNotification({lineId:h.line_id,message:d})}catch(d){console.error("Failed to send LINE notification:",d)}o!=null&&o.deposit_payment_link&&setTimeout(()=>{let d=o.deposit_payment_link?o.deposit_payment_link.trim():"";if(d){/^https?:\/\//i.test(d)||(d="https://"+d);try{const m=new URL(d);window.location.href=m.href}catch{console.error("Invalid URL:",d),alert("付款連結設定有誤,無法自動跳轉。請聯繫管理員或是直接關閉此頁面。")}}},2e3)}}),f=h=>{if(h.preventDefault(),!i.terms_agreed){alert("請詳閱並同意服務條款");return}c.mutate(i)};return l?a.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:"載入中..."}):!o||!o.is_active?a.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center text-gray-500",children:"表單不存在或已關閉"}):r?a.jsx("div",{className:"min-h-screen bg-gray-50 flex flex-col items-center justify-center p-4",children:a.jsxs("div",{className:"bg-white rounded-xl shadow-lg p-8 max-w-md w-full text-center space-y-4",children:[a.jsx(xr,{className:"w-16 h-16 text-green-500 mx-auto"}),a.jsx("h2",{className:"text-2xl font-bold text-gray-800",children:"報名成功!"}),a.jsx("p",{className:"text-gray-600",children:"感謝您的報名,我們將盡快與您聯繫。"}),o.deposit_payment_link&&a.jsxs("div",{className:"mt-4 p-4 bg-blue-50 rounded-lg",children:[a.jsx("p",{className:"text-sm text-blue-800 mb-2",children:"正在前往付款頁面..."}),a.jsx(Ht,{className:"w-6 h-6 text-blue-600 animate-spin mx-auto"}),a.jsxs("p",{className:"text-xs text-gray-400 mt-2",children:["若未自動跳轉,請",a.jsx("a",{href:o.deposit_payment_link,
1091className:"underline text-blue-600",children:"點擊此處"})]})]})]})}):a.jsx("div",{className:"min-h-screen bg-gray-100 py-12 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"max-w-3xl mx-auto bg-white rounded-xl shadow-xl overflow-hidden",children:[o.image_url&&a.jsx("div",{className:"h-48 sm:h-64 w-full overflow-hidden",children:a.jsx("img",{src:o.image_url,alt:o.title,className:"w-full h-full object-cover"})}),a.jsxs("div",{className:"p-8 space-y-8",children:[a.jsxs("div",{className:"text-center space-y-4 border-b pb-8",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:o.title}),a.jsxs("p",{className:"text-xl text-blue-600 font-semibold",children:["報名費用:NT$ ",(o.registration_fee||0).toLocaleString()]}),a.jsx("div",{className:"prose max-w-none text-gray-600 text-left mx-auto whitespace-pre-wrap bg-gray-50 p-4 rounded-lg",children:o.description}),o.registration_notes&&a.jsxs("div",{className:"bg-yellow-50 border-l-4 border-yellow-400 p-4 text-left text-sm text-yellow-800",children:[a.jsx("p",{className:"font-bold mb-1",children:"注意事項:"}),a.jsx("div",{className:"prose max-w-none",dangerouslySetInnerHTML:{__html:o.registration_notes}})]})]}),a.jsxs("form",{onSubmit:f,className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-gray-700",children:"姓名 *"}),a.jsx(ne,{required:!0,value:i.applicant_name,onChange:h=>s({...i,applicant_name:h.target.value}),className:"bg-white border-gray-300 text-gray-900"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-gray-700",children:"Email *"}),a.jsx(ne,{required:!0,type:"email",value:i.applicant_email,onChange:h=>s({...i,applicant_email:h.target.value}),className:"bg-white border-gray-300 text-gray-900"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-gray-700",children:"手機號碼 *"}),a.jsx(ne,{required:!0,value:i.phone_number,onChange:h=>s({...i,phone_number:h.target.value}),className:"bg-white border-gray-300 text-gray-900"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{className:"text-gray-700",children:["LINE ID ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx(ne,{required:!0,value:i.line_id,onChange:h=>s({...i,line_id:h.target.value}),className:"bg-white border-gray-300 text-gray-900",placeholder:"請輸入您的LINE ID"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{className:"text-gray-700",children:["通訊地址 ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx(ne,{required:!0,value:i.mailing_address,onChange:h=>s({...i,mailing_address:h.target.value}),className:"bg-white border-gray-300 text-gray-900"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{className:"text-gray-700",children:["公司/學校名稱 ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx(ne,{required:!0,value:i.company_school_name,onChange:h=>s({...i,company_school_name:h.target.value}),className:"bg-white border-gray-300 text-gray-900"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{className:"text-gray-700",children:["職稱/系所 ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx(ne,{required:!0,value:i.title_department,onChange:h=>s({...i,title_department:h.target.value}),className:"bg-white border-gray-300 text-gray-900"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-gray-700",children:"公司統一編號"}),a.jsx(ne,{value:i.company_tax_id,onChange:h=>s({...i,company_tax_id:h.target.value}),className:"bg-white border-gray-300 text-gray-900",placeholder:"如需開立統編請填寫"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-gray-700",children:"有學習過哪些程式語言?並舉例曾完成過的專案名稱"}),a.jsx(Pt,{value:i.coding_experience,onChange:h=>s({...i,coding_experience:h.target.value}),className:"bg-white border-gray-300 text-gray-900",placeholder:"例如:Python, Government Open Data Scraper; 若無請填 None"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{className:"text-gray-700",children:["課程資訊來源 ",a.jsx("span",{className:"text-red-500",children:"*"})]}
1091),a.jsxs("select",{required:!0,value:i.course_info_source,onChange:h=>s({...i,course_info_source:h.target.value}),className:"w-full p-2 border border-gray-300 rounded-md bg-white text-gray-900",children:[a.jsx("option",{value:"",children:"請選擇"}),a.jsx("option",{value:"FB",children:"FB"}),a.jsx("option",{value:"IG",children:"IG"}),a.jsx("option",{value:"GOOGLE",children:"GOOGLE"}),a.jsx("option",{value:"LINE",children:"LINE"}),a.jsx("option",{value:"巨匠電腦",children:"巨匠電腦"}),a.jsx("option",{value:"親友推薦",children:"親友推薦"}),a.jsx("option",{value:"其他",children:"其他"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-gray-700",children:"請問有什麼問題想於課前詢問老師?"}),a.jsx(Pt,{value:i.pre_course_questions,onChange:h=>s({...i,pre_course_questions:h.target.value}),className:"bg-white border-gray-300 text-gray-900"})]}),(o==null?void 0:o.payment_method_options)&&o.payment_method_options.length>0&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{className:"text-gray-700",children:["您希望的分期與付款方式 ",a.jsx("span",{className:"text-red-500",children:"*"})]}),a.jsx("div",{className:"space-y-2 bg-gray-50 p-4 rounded border border-gray-200",children:o.payment_method_options.map(h=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"radio",name:"payment",id:h,value:h,required:!0,checked:i.preferred_payment_method===h,onChange:d=>s({...i,preferred_payment_method:d.target.value}),className:"text-blue-600 focus:ring-blue-500"}),a.jsx("label",{htmlFor:h,className:"text-gray-700 text-sm",children:h})]},h))})]}),o.custom_fields&&o.custom_fields.length>0&&a.jsxs("div",{className:"border-t border-gray-200 pt-6 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-800",children:"其他資訊"}),o.custom_fields.map((h,d)=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs(Q,{className:"text-gray-700",children:[h.label," ",h.required&&"*"]}),h.type==="textarea"?a.jsx(Pt,{required:h.required,value:i.custom_field_responses[h.label]||"",onChange:m=>s({...i,custom_field_responses:{...i.custom_field_responses,[h.label]:m.target.value}}),className:"bg-white border-gray-300 text-gray-900"}):h.type==="select"?a.jsxs("select",{required:h.required,value:i.custom_field_responses[h.label]||"",onChange:m=>s({...i,custom_field_responses:{...i.custom_field_responses,[h.label]:m.target.value}}),className:"w-full p-2 border border-gray-300 rounded-md bg-white text-gray-900",children:[a.jsx("option",{value:"",children:"請選擇"}),h.options.split(",").map(m=>a.jsx("option",{value:m.trim(),children:m.trim()},m.trim()))]}):a.jsx(ne,{type:h.type,required:h.required,value:i.custom_field_responses[h.label]||"",onChange:m=>s({...i,custom_field_responses:{...i.custom_field_responses,[h.label]:m.target.value}}),className:"bg-white border-gray-300 text-gray-900"})]},d))]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{className:"text-gray-700",children:"備註"}),a.jsx(Pt,{value:i.remarks,onChange:h=>s({...i,remarks:h.target.value}),className:"bg-white border-gray-300 text-gray-900"})]}),a.jsxs("div",{className:"border-t border-gray-200 pt-6",children:[a.jsxs("div",{className:"bg-gray-50 p-4 rounded text-sm text-gray-600 h-48 overflow-y-auto mb-4 border border-gray-200",children:[a.jsx("h4",{className:"font-bold mb-2",children:"服務條款"}),a.jsx("div",{className:"prose max-w-none",dangerouslySetInnerHTML:{__html:o.terms_of_service||"尚無服務條款"}})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"checkbox",id:"terms",checked:i.terms_agreed,onChange:h=>s({...i,terms_agreed:h.target.checked}),className:"w-4 h-4 text-blue-600 rounded border-gray-300 focus:ring-blue-500"}),a.jsx("label",{htmlFor:"terms",className:"text-gray-700 font-medium",children:"我已詳閱並同意上述服務條款"})]})]}),a.jsx(te,{type:"submit",disabled:c.isPending,className:"w-full h-12 text-lg font-bold bg-blue-600 hover:bg-blue-700 text-white shadow-lg transition-all transform hover:scale-[1.01]",children:c.isPending?"處理中...":"下一步 支付訂金"})]})]})]})})}function C_e({quote:e,customers:t,onClose:r}){const[n,i]=I.useState({quote_number:`QT-${Date.now()}`,project_name:"",customer_name:"",contact_person:"",contact_phone:"",contact_email:"",quote_contact_person:"",quote_contact_phone:"",bank_info:"",quote_date:new Date().toISOString().split("T")[0],valid_until:"",systems:[],total_amount:0,status:"draft",notes:"",file_url:"",...e}),[s,o]=I.useState(!1),l=at();I.useEffect(()=>{const S=n.systems.reduce((k,C)=>k+C.modules.reduce((O,R)=>O+(R.amount||0)*(R.quantity||1),0),0);i(k=>({...k,total_amount:S}))},[n.systems]);const c=Ye({mutationFn:S=>e?ee.entities.Quote.update(e.id,S):ee.entities.Quote.create(S),onSuccess:()=>
1091{l.invalidateQueries(["quotes"]),alert("儲存成功!"),r()}}),f=S=>{const k=t.find(C=>C.customer_name===S);i(k?C=>({...C,customer_name:S,contact_person:k.contact_person||"",contact_phone:k.phone||"",contact_email:k.email||""}):C=>({...C,customer_name:S}))},h=()=>{i({...n,systems:[...n.systems,{system_name:"",modules:[]}]})},d=S=>{i({...n,systems:n.systems.filter((k,C)=>C!==S)})},m=(S,k,C)=>{const O=[...n.systems];O[S][k]=C,i({...n,systems:O})},p=S=>{const k=[...n.systems];k[S].modules.push({module_name:"",amount:0,quantity:1,features:[]}),i({...n,systems:k})},x=(S,k)=>{const C=[...n.systems];C[S].modules=C[S].modules.filter((O,R)=>R!==k),i({...n,systems:C})},y=(S,k,C,O)=>{const R=[...n.systems];R[S].modules[k][C]=O,i({...n,systems:R})},v=(S,k)=>{const C=[...n.systems];C[S].modules[k].features.push(""),i({...n,systems:C})},b=(S,k,C)=>{const O=[...n.systems];O[S].modules[k].features=O[S].modules[k].features.filter((R,A)=>A!==C),i({...n,systems:O})},w=(S,k,C,O)=>{const R=[...n.systems];R[S].modules[k].features[C]=O,i({...n,systems:R})},_=async S=>{const k=S.target.files[0];if(k)try{o(!0);const{file_url:C}=await ee.integrations.Core.UploadFile({file:k});if(i(O=>({...O,file_url:C})),k.type==="application/pdf"){const O=await ee.integrations.Core.ExtractDataFromUploadedFile({file_url:C,json_schema:{type:"object",properties:{project_name:{type:"string",description:"專案名稱"},quote_number:{type:"string",description:"報價單編號"},customer_name:{type:"string",description:"客戶名稱"},contact_person:{type:"string",description:"聯絡人"},total_amount:{type:"number",description:"總金額"},items:{type:"array",items:{type:"object",properties:{description:{type:"string",description:"品項名稱或描述"},quantity:{type:"number",description:"數量"},unit_price:{type:"number",description:"單價"},amount:{type:"number",description:"小計"}}}}}}});if(O.status==="success"&&O.output){const R=O.output,A=[];if(R.items&&Array.isArray(R.items)){const P=R.items.map(E=>({module_name:E.description||"未命名項目",amount:E.unit_price||0,quantity:E.quantity||1,features:[]}));P.length>0&&A.push({system_name:"匯入項目",modules:P})}i(P=>({...P,project_name:R.project_name||P.project_name,quote_number:R.quote_number||P.quote_number,customer_name:R.customer_name||P.customer_name,contact_person:R.contact_person||P.contact_person,total_amount:R.total_amount||P.total_amount,systems:A.length>0?A:P.systems})),alert("OCR 辨識成功!已自動帶入相關資料。")}}}catch(C){console.error("Upload/OCR failed:",C),alert("上傳或辨識失敗,請重試")}finally{o(!1)}},N=S=>{S.preventDefault(),c.mutate(n)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-6xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯報價單":"新增報價單"}),a.jsx("button",{onClick:r,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:N,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"報價單編號 *"}),a.jsx(ne,{required:!0,value:n.quote_number,onChange:S=>i({...n,quote_number:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"專案名稱 *"}),a.jsx(ne,{required:!0,value:n.project_name,onChange:S=>i({...n,project_name:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶名稱"}),a.jsxs(qe,{value:n.customer_name,onValueChange:f,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇客戶"})}),a.jsx($e,{className:"bg-black border-gray-700",children:t.map(S=>a.jsx(se,{value:S.customer_name,className:"text-white",children:S.customer_name},S.id))})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"客戶聯絡資訊"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"客戶聯絡人"}),a.jsx(ne,{value:n.contact_person,onChange:S=>i({...n,contact_person:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"聯絡人電話"}),a.jsx(ne,{value:n.contact_phone,onChange:S=>i({...n,contact_phone:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"聯絡人信箱"}),a.jsx(ne,{type:"email",value:n.contact_email,onChange:S=>i({...n,contact_email:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"報價聯絡資訊"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"報價聯絡人"}),a.jsx(ne,{value:n.quote_contact_person,onChange:S=>i({...n,quote_contact_person:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"報價聯絡人電話"}),a.jsx(ne,{value:n.quote_contact_phone,onChange:S=>i({...n,quote_contact_phone:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:"報價項目(三層架構)"}),a.jsxs(te,{type:"button",onClick:h,size:"sm",className:"bg-[#00FFFF] text-black",children:[a.jsx(Ct,{className:"w-4 h-4 mr-1"})," 新增系統"]})]}),n.systems.map((S,k)=>a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{placeholder:"系統名稱(第一層)",value:S.system_name,onChange:C=>m(k,"system_name",C.target.value),className:"bg-black border-gray-700 flex-1"}),a.jsxs(te,{type:"button",size:"sm",onClick:()=>p(k),className:"bg-gray-700",children:[a.jsx(Ct,{className:"w-4 h-4 mr-1"})," 模組"]}),a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>d(k),className:"text-red-500",children:a.jsx(Qt,{className:"w-4 h-4"})})]}),S.modules.map((C,O)=>a.jsxs("div",{className:"ml-6 bg-gray-900/50 p-3 rounded border border-gray-800 space-y-2",children:[a.jsxs("div",{className:"grid grid-cols-12 gap-2 items-center",children:[a.jsx("div",{className:"col-span-5",children:a.jsx(ne,{placeholder:"系統模組(第二層)",value:C.module_name,onChange:R=>y(k,O,"module_name",R.target.value),className:"bg-black border-gray-700"})}),a.jsx("div",{className:"col-span-2",children:a.jsx(ne,{type:"number",placeholder:"金額",value:C.amount,onChange:R=>y(k,O,"amount",parseFloat(R.target.value)||0),className:"bg-black border-gray-700"})}),a.jsx("div",{className:"col-span-2",children:a.jsx(ne,{type:"number",placeholder:"數量",value:C.quantity,onChange:R=>y(k,O,"quantity",parseInt(R.target.value)||1),className:"bg-black border-gray-700"})}),a.jsxs("div",{className:"col-span-2 text-right text-[#00FFFF] font-mono",children:["$",((C.amount||0)*(C.quantity||1)).toLocaleStr
1091ing()]}),a.jsxs("div",{className:"col-span-1 flex gap-1",children:[a.jsx(te,{type:"button",size:"sm",onClick:()=>v(k,O),className:"bg-gray-600",children:a.jsx(Ct,{className:"w-3 h-3"})}),a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>x(k,O),className:"text-red-500",children:a.jsx(Qt,{className:"w-3 h-3"})})]})]}),C.features&&C.features.length>0&&a.jsx("div",{className:"ml-4 space-y-1",children:C.features.map((R,A)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-gray-500",children:"└─"}),a.jsx(ne,{placeholder:"功能項目(第三層)",value:R,onChange:P=>w(k,O,A,P.target.value),className:"bg-black border-gray-700 text-sm flex-1"}),a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(k,O,A),className:"text-red-500",children:a.jsx(vt,{className:"w-3 h-3"})})]},A))})]},O))]},k)),a.jsx("div",{className:"flex justify-end pt-4 border-t border-gray-800",children:a.jsxs("div",{className:"text-xl font-bold text-[#00FFFF]",children:["總金額:NT$ ",(n.total_amount||0).toLocaleString()]})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"報價日期"}),a.jsx(ne,{type:"date",value:n.quote_date,onChange:S=>i({...n,quote_date:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"有效期限"}),a.jsx(ne,{type:"date",value:n.valid_until,onChange:S=>i({...n,valid_until:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"狀態"}),a.jsxs(qe,{value:n.status,onValueChange:S=>i({...n,status:S}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"draft",className:"text-white",children:"草稿"}),a.jsx(se,{value:"sent",className:"text-white",children:"已發送"}),a.jsx(se,{value:"accepted",className:"text-white",children:"已接受"}),a.jsx(se,{value:"rejected",className:"text-white",children:"已拒絕"})]})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"匯款資訊"}),a.jsx(Pt,{value:n.bank_info,onChange:S=>i({...n,bank_info:S.target.value}),placeholder:"請輸入匯款資訊(銀行名稱、帳號等)",className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-20"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:n.notes,onChange:S=>i({...n,notes:S.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-20"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"報價單 PDF 附件"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{type:"button",variant:"outline",onClick:()=>document.getElementById("quote-file-upload").click(),className:"bg-gray-800 border-gray-700 hover:bg-gray-700",disabled:s,children:[s?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),s?"上傳中...":"上傳 PDF"]}),a.jsx(ne,{id:"quote-file-upload",type:"file",accept:".pdf",className:"hidden",onChange:_}),n.file_url&&a.jsxs("span",{className:"text-sm text-[#00FFFF] flex items-center",children:[a.jsx("a",{href:n.file_url,target:"_blank",rel:"noreferrer",className:"hover:underline",children:"已上傳檔案 (點擊查看)"}),a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>i(S=>({...S,file_url:""})),className:"text-red-500 hover:text-red-400 ml-2",children:a.jsx(vt,{className:"w-4 h-4"})})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:r,className:"bg-[#8B0000] text-white border-[#8B0000]",children:"取消"}),a.jsx(te,{type:"submit",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:"儲存"})]})]})]})})}function F_e({quote:e,onClose:t}){const r=at(),[n,i]=I.useState(!1),[s,o]=I.useState(!1),[l,c]=I.useState(e.contact_email||""),f=Ye({mutationFn:async()=>{const m={order_number:`ORD-${Date.now()}`,quote_id:e.id,quote_number:e.quote_number,project_name:e.project_name,customer_name:e.customer_name,total_amount:e.total_amount,order_date:new Date().toISOString().split("T")[0],status:"pending",systems:e.systems||[],notes:`由報價單 ${e.quote_number} 轉換而來`};return ee.entities.Order.create(m)},onSuccess:()=>{r.invalidateQueries(["orders"]),alert("✅ 訂單已成功建立!"),t()}}),h=Ye({mutationFn:async m=>{var v;if(!e.file_url)throw new Error("無報價單檔案可發送");const x=((v=(await ee.entities.CompanySetting.list())[0])==null?void 0:v.company_name)||"無限未來有限公司",y=`您好,
1092
1093附件為貴公司的專案報價單:
1094
1095專案名稱:${e.project_name}
1096報價單號:${e.quote_number}
1097報價金額:NT$ ${(e.total_amount||0).toLocaleString()}
1098報價日期:${e.quote_date}
1099有效期限:${e.valid_until}
1100
1101報價單下載連結:${e.file_url}
1102
1103請查閱附件檔案。如有任何疑問,請隨時與我們聯繫。
1104
1105此致
1106${x}`;await ee.integrations.Core.SendEmail({to:m,subject:`報價單 - ${e.project_name} (${e.quote_number})`,body:y})},onSuccess:()=>{alert("✅ 報價單已成功發送!"),o(!1)},onError:m=>alert("發送失敗: "+m.message)}),d=async()=>{let m={};try{const x=await ee.entities.CompanySetting.list();x.length>0&&(m=x[0])}catch(x){console.error("Failed to load settings:",x)}const p=window.open("","_blank");p.document.write(`
1107      <html>
1108        <head>
1109          <title>報價單 - ${e.quote_number}</title>
1110          <meta charset="UTF-8">
1111          <style>
1112            @page { size: A4; margin: 10mm; }
1113            * { margin: 0; padding: 0; box-sizing: border-box; }
1114            body { 
1115              font-family: "Microsoft JhengHei", "Heiti TC", sans-serif; 
1116              color: #000;
1117              font-size: 10pt;
1118              line-height: 1.3;
1119            }
1120            .container {
1121              width: 100%;
1122              max-width: 210mm;
1123              margin: 0 auto;
1124            }
1125            .header-top { 
1126              display: flex;
1127              justify-content: space-between;
1128              align-items: flex-end;
1129              border-bottom: 2px solid #000;
1130              padding-bottom: 10px;
1131              margin-bottom: 20px;
1132            }
1133            .company-info h1 {
1134              font-size: 24pt;
1135              font-weight: bold;
1136              margin-bottom: 5px;
1137              color: #000;
1138            }
1139            .company-info p {
1140              font-size: 9pt;
1141              color: #555;
1142            }
1143            .doc-title {
1144              text-align: right;
1145            }
1146            .doc-title h2 {
1147              font-size: 20pt;
1148              letter-spacing: 5px;
1149              margin-bottom: 5px;
1150              background-color: #000;
1151              color: #fff;
1152              padding: 5px 15px;
1153              display: inline-block;
1154            }
1155            .info-grid {
1156              display: grid;
1157              grid-template-columns: 1fr 1fr;
1158              gap: 20px;
1159              margin-bottom: 20px;
1160            }
1161            .info-box {
1162              border: 1px solid #000;
1163              padding: 10px;
1164            }
1165            .info-box h3 {
1166              font-size: 11pt;
1167              border-bottom: 1px solid #ccc;
1168              padding-bottom: 5px;
1169              margin-bottom: 5px;
1170              background-color: #f0f0f0;
1171              padding: 5px;
1172            }
1173            .info-row {
1174              display: flex;
1175              margin-bottom: 4px;
1176            }
1177            .label {
1178              width: 80px;
1179              color: #666;
1180            }
1181            .value {
1182              flex: 1;
1183              font-weight: 500;
1184            }
1185            table.items-table {
1186              width: 100%;
1187              border-collapse: collapse;
1188              margin-bottom: 20px;
1189            }
1190            table.items-table th {
1191              background-color: #000;
1192              color: #fff;
1193              padding: 8px;
1194              text-align: left;
1195              font-size: 10pt;
1196            }
1197            table.items-table td {
1198              border-bottom: 1px solid #ddd;
1199              padding: 8px;
1200              vertical-align: top;
1201            }
1202            .amount-col { text-align: right; }
1203            .center-col { text-align: center; }
1204            .total-section {
1205              display: flex;
1206              justify-content: flex-end;
1207              margin-bottom: 30px;
1208            }
1209            .total-box {
1210              width: 300px;
1211            }
1212            .total-row {
1213              display: flex;
1214              justify-content: space-between;
1215              padding: 5px 0;
1216              border-bottom: 1px solid #ddd;
1217            }
1218            .grand-total {
1219              font-size: 14pt;
1220              font-weight: bold;
1221              border-bottom: 2px solid #000;
1222              border-top: 2px solid #000;
1223              margin-top: 5px;
1224              padding: 10px 0;
1225            }
1226            .terms-section {
1227              margin-bottom: 40px;
1228              font-size: 9pt;
1229            }
1230            .signature-section {
1231              display: grid;
1232              grid-template-columns: 1fr 1fr;
1233              gap: 40px;
1234              margin-top: 50px;
1235            }
1236            .signature-box {
1237              border-top: 1px solid #000;
1238              padding-top: 10px;
1239              text-align: center;
1240            }
1241            .footer {
1242              text-align: center;
1243              font-size: 8pt;
1244              color: #999;
1245              margin-top: 50px;
1246              border-top: 1px solid #eee;
1247              padding-top: 10px;
1248            }
1249          </style>
1250        </head>
1251        <body>
1252          <div class="container">
1253            <div class="header-top">
1254              <div class="company-info">
1255                ${m.company_logo_url?`<img src="${m.company_logo_url}" alt="LOGO" style="height: 50px; margin-bottom: 10px;" />`:""}
1256                <h1>${m.company_name||"無限未來有限公司"}</h1>
1257                <p>
1258                  統一編號:${m.tax_id||""} | 
1259                  電話:${m.phone||""} | 
1260                  Email:${m.email||""}<br/>
1261                  地址:${m.address||""}
1262                </p>
1263              </div>
1264              <div class="doc-title">
1265                <h2>QUOTATION</h2>
1266                <div style="font-size: 11pt;">報價單</div>
1267              </div>
1268            </div>
1269
1270            <div class="info-grid">
1271              <div class="info-box">
1272                <h3>客戶資料 (Bill To)</h3>
1273                <div class="info-row"><span class="label">客戶名稱:</span><span class="value">${e.customer_name||""}</span></div>
1274                <div class="info-row"><span class="label">聯絡人:</span><span class="value">${e.contact_person||""}</span></div>
1275                <div class="info-row"><span class="label">電話:</span><span class="value">${e.contact_phone||""}</span></div>
1276                <div class="info-row"><span class="label">Email:</span><span class="value">${e.contact_email||""}</span></div>
1277              </div>
1278              <div class="info-box">
1279                <h3>報價單資訊 (Info)</h3>
1280                <div class="info-row"><span class="label">報價單號:</span><span class="value">${e.quote_number||""}</span></div>
1281                <div class="info-row"><span class="label">報價日期:</span><span class="value">${e.quote_date||""}</span></div>
1282                <div class="info-row"><span class="label">有效期限:</span><span class="value">${e.valid_until||"30天"}</span></div>
1283                <div class="info-row"><span class="label">專案名稱:</span><span class="value">${e.project_name||""}</span></div>
1284              </div>
1285            </div>
1286
1287            <table class="items-table">
1288              <thead>
1289                <tr>
1290                  <th style="width: 50px;">#</th>
1291                  <th>項目名稱 / 描述</th>
1292                  <th class="center-col" style="width: 60px;">數量</th>
1293                  <th class="amount-col" style="width: 120px;">單價</th>
1294                  <th class="amount-col" style="width: 120px;">金額</th>
1295                </tr>
1296              </thead>
1297              <tbody>
1298                ${(e.systems||[]).map((x,y)=>x.modules.map((v,b)=>`
1299                    <tr>
1300                      <td>${y+1}.${b+1}</td>
1301                      <td>
1302                        <strong>${x.system_name} - ${v.module_name}</strong><br/>
1303                        <span style="font-size: 8pt; color: #666;">
1304                           ${(v.features||[]).join(" / ")}
1305                        </span>
1306                      </td>
1307                      <td class="center-col">${v.quantity||1}</td>
1308                      <td class="amount-col">${(v.amount||0).toLocaleString()}</td>
1309                      <td class="amount-col">${((v.amount||0)*(v.quantity||1)).toLocaleString()}</td>
1310                    </tr>
1311                  `).join("")).join("")}
1312              </tbody>
1313            </table>
1314
1315            <div class="total-section">
1316              <div class="total-box">
1317                <div class="total-row">
1318                  <span>合計 (Subtotal):</span>
1319                  <span>NT$ ${Math.round((e.total_amount||0)/1.05).toLocaleString()}</span>
1320                </div>
1321                <div class="total-row">
1322                  <span>稅額 (Tax 5%):</span>
1323                  <span>NT$ ${(e.total_amount-Math.round(e.total_amount/1.05)).toLocaleString()}</span>
1324                </div>
1325                <div class="total-row grand-total">
1326                  <span>總計 (Total):</span>
1327                  <span>NT$ ${(e.total_amount||0).toLocaleString()}</span>
1328                </div>
1329              </div>
1330            </div>
1331
1332            <div class="terms-section">
1333              <h3>備註條款 (Terms & Conditions)</h3>
1334              <div style="border: 1px solid #ddd; padding: 10px; margin-top: 5px; color: #555;">
1335                 ${e.notes?e.notes.replace(/\n/g,"<br/>"):"1. 以上報價含稅。<br/>2. 報價有效期30天。"}
1336                 <br/><br/>
1337                 <strong>匯款資訊:</strong><br/>
1338                 ${e.bank_info||`銀行:玉山銀行 (808) | 帳號:0347-940-019360 | 戶名:${m.company_name}`}
1339              </div>
1340            </div>
1341
1342            <div class="signature-section">
1343              <div class="signature-box">
1344                <p>客戶簽署 (Accepted By)</p>
1345                <div style="height: 60px;"></div>
1346                <p>日期 (Date)</p>
1347              </div>
1348              <div class="signature-box">
1349                <p>公司簽署 (Authorized By)</p>
1350                <div style="height: 60px;">
1351                  ${m.company_name?`<span style="font-family: 'Times New Roman'; font-size: 14pt; font-style: italic;">${m.company_name}</span>`:""}
1352                </div>
1353                <p>日期 (Date)</p>
1354              </div>
1355            </div>
1356
1357            <div class="footer">
1358              Generated by Infinite Future Management System
1359            </div>
1360          </div>
1361        </body>
1362      </html>
1363    `),p.document.close(),p.print()};return a.jsxs("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-5xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"報價單詳情"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(te,{onClick:()=>o(!0),disabled:!e.file_url,variant:"outline",className:"bg-blue-900 text-white hover:bg-blue-800 border-blue-700",children:[a.jsx(Wi,{className:"w-4 h-4 mr-2"}),"發送報價"]}),a.jsxs(te,{onClick:()=>f.mutate(),disabled:f.isPending,variant:"outline",className:"bg-green-900 text-white hover:bg-green-800 border-green-700",children:[a.jsx(Et,{className:"w-4 h-4 mr-2"}),f.isPending?"轉換中...":"轉訂單"]}),a.jsxs(te,{onClick:d,variant:"outline",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx($g,{className:"w-4 h-4 mr-2"}),"列印報價單"]}),e.file_url&&a.jsxs(te,{onClick:()=>i(!0),variant:"outline",className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"}),"預覽附件"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"報價單號"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:e.quote_number})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"專案名稱"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:e.project_name})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"客戶名稱"}),a.jsx("p",{className:"text-gray-200",children:e.customer_name})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"聯絡人"}),a.jsx("p",{className:"text-gray-200",children:e.contact_person})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"報價日期"}),a.jsx("p",{className:"text-gray-200",children:e.quote_date})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"總金額"}),a.jsxs("p",{className:"text-2xl font-bold text-[#00FFFF]",children:["NT$ ",(e.total_amount||0).toLocaleStr
1363ing()]})]})]}),e.systems&&e.systems.length>0&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"報價項目"}),a.jsx("div",{className:"space-y-4",children:e.systems.map((m,p)=>a.jsxs("div",{className:"border-l-4 border-[#00FFFF] pl-4",children:[a.jsx("h4",{className:"font-semibold text-[#00FFFF] mb-2",children:m.system_name}),m.modules.map((x,y)=>a.jsxs("div",{className:"ml-4 mb-3 bg-gray-900/50 p-3 rounded",children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsx("span",{className:"font-medium text-gray-200",children:x.module_name}),a.jsxs("span",{className:"text-[#00FFFF]",children:["NT$ ",((x.amount||0)*(x.quantity||1)).toLocaleString()]})]}),a.jsxs("div",{className:"text-sm text-gray-400",children:["數量:",x.quantity||1," × NT$ ",(x.amount||0).toLocaleString()]}),x.features&&x.features.length>0&&a.jsx("div",{className:"mt-2 ml-2 text-xs text-gray-500",children:x.features.map((v,b)=>a.jsxs("div",{children:["• ",v]},b))})]},y))]},p))})]}),e.notes&&a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-400 mb-2",children:"備註"}),a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.notes})]})]})]}),n&&e.file_url&&a.jsx($a,{fileUrl:e.file_url,fileName:`報價單 - ${e.quote_number}`,onClose:()=>i(!1)}),s&&a.jsx("div",{className:"fixed inset-0 bg-black/90 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-md w-full p-6",children:[a.jsx("h3",{className:"text-xl font-bold cyber-text mb-4",children:"發送報價單"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx(Q,{className:"text-gray-300",children:"收件人Email"}),a.jsx(ne,{type:"email",value:l,onChange:m=>c(m.target.value),placeholder:"輸入收件人Email",className:"bg-black border-gray-700 mt-2"})]}),a.jsxs("div",{className:"text-sm text-gray-400",children:[a.jsxs("p",{children:["報價單號:",e.quote_number]}),a.jsxs("p",{children:["專案:",e.project_name]}),a.jsxs("p",{children:["金額:NT$ ",(e.total_amount||0).toLocaleString()]})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[a.jsx(te,{variant:"outline",onClick:()=>o(!1),className:"bg-gray-800 text-white border-gray-600",children:"取消"}),a.jsxs(te,{onClick:()=>h.mutate(l),disabled:!l||h.isPending,className:"bg-blue-900 text-white hover:bg-blue-800",children:[a.jsx(Wi,{className:"w-4 h-4 mr-2"}),h.isPending?"發送中...":"發送"]})]})]})]})})]})}function O_e(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState(""),c=at(),{data:f=[],isLoading:h}=Te({queryKey:["quotes"],queryFn:()=>ee.entities.Quote.list("-created_date")}),{data:d=[]}=Te({queryKey:["customers"],queryFn:()=>ee.entities.Customer.list()}),m=Ye({mutationFn:v=>ee.entities.Quote.delete(v),onSuccess:()=>{c.invalidateQueries(["quotes"])}}),p=v=>{window.confirm(`確定要刪除報價單「${v.quote_number}」嗎?`)&&m.mutate(v.id)},x=f.filter(v=>{var b,w,_;return!o||((b=v.project_name)==null?void 0:b.toLowerCase().includes(o.toLowerCase()))||((w=v.quote_number)==null?void 0:w.toLowerCase().includes(o.toLowerCase()))||((_=v.customer_name)==null?void 0:_.toLowerCase().includes(o.toLowerCase()))}),y=v=>{const b={draft:{label:"草稿",color:"#808080"},sent:{label:"已發送",color:"#00FFFF"},accepted:{label:"已接受",color:"#00FF00"},rejected:{label:"已拒絕",color:"#FF4444"}},{label:w,color:_}=b[v]||b.draft;return a.jsx("span",{className:"px-2 py-1 rounded text-xs font-semibold border",style:{borderColor:_,color:_,backgroundColor:`${_}20`},children:w})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"報價管理"}),a.jsxs(te,{onClick:()=>{s(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增報價單"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋報價單編號、專案名稱、客戶...",value:o,onChange:v=>l(v.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]})}),a.jsx("div",{className:"grid grid-cols-1 gap-4",children:h?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):x.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(Et,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無報價單資料"})]}):x.map(v=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsx("h3",{className:"text-xl font-semibold cyber-text",children:v.project_name}),y(v.status)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{className:"text-gray-300",children:["報價單號:",v.quote_number]}),a.jsxs("div",{className:"text-gray-300",children:["客戶名稱:",v.customer_name]}),a.jsxs("div",{className:"text-gray-300",children:["報價日期:",v.quote_date]}),a.jsxs("div",{className:"text-[#00FFFF]",children:["總金額:NT$ ",(v.total_amount||0).toLocaleStr
1363ing()]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>n(v),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"預覽"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{s(v),t(!0)},className:"border-gray-600 hover:bg-gray-800",children:a.jsx(qt,{className:"w-4 h-4 text-black"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>p(v),className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},v.id))}),e&&a.jsx(C_e,{quote:i,customers:d,onClose:()=>{t(!1),s(null)}}),r&&a.jsx(F_e,{quote:r,onClose:()=>n(null)})]})}function E_e(){const{data:e=[]}=Te({queryKey:["contracts"],queryFn:()=>ee.entities.Contract.list()}),{data:t=[]}=Te({queryKey:["software_invoices"],queryFn:()=>ee.entities.SoftwareInvoice.list()}),{data:r=[]}=Te({queryKey:["contract_costs"],queryFn:()=>ee.entities.ContractCost.list()}),n=e.map(s=>{const o=t.filter(m=>m.contract_id===s.id),l=r.filter(m=>m.contract_id===s.id&&m.payment_status==="paid"),c=o.reduce((m,p)=>m+(p.received_amount||0),0),f=l.reduce((m,p)=>m+(p.cost_amount||0),0),h=c-f,d=c>0?(h/c*100).toFixed(2):0;return{project_name:s.project_name,contract_number:s.contract_number,contract_amount:s.total_amount||0,revenue:c,cost:f,profit:h,profitMargin:d}}).sort((s,o)=>o.profit-s.profit),i=()=>{const s=["專案名稱","合約編號","合約金額","已收營收","已付成本","利潤","利潤率(%)"],o=n.map(h=>[h.project_name,h.contract_number,h.contract_amount,h.revenue,h.cost,h.profit,h.profitMargin]),l=[s,...o].map(h=>h.join(",")).join(`
1364`),c=new Blob(["\uFEFF"+l],{type:"text/csv;charset=utf-8;"}),f=document.createElement("a");f.href=URL.createObjectURL(c),f.download=`專案獲利能力報告_${new Date().toISOString().split("T")[0]}.csv`,f.click()};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-xl font-bold cyber-text",children:"專案獲利能力分析"}),a.jsxs(te,{onClick:i,variant:"outline",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(li,{className:"w-4 h-4 mr-2"}),"匯出CSV"]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"專案名稱"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"合約編號"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"合約金額"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"已收營收"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"已付成本"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"利潤"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"利潤率"})]})}),a.jsx(Jn,{children:n.map((s,o)=>a.jsxs(Dt,{children:[a.jsx(Me,{className:"font-medium text-gray-200",children:s.project_name}),a.jsx(Me,{className:"text-gray-300",children:s.contract_number}),a.jsxs(Me,{className:"text-right text-gray-300",children:["NT$ ",s.contract_amount.toLocaleString()]}),a.jsxs(Me,{className:"text-right text-green-400",children:["NT$ ",s.revenue.toLocaleString()]}),a.jsxs(Me,{className:"text-right text-red-400",children:["NT$ ",s.cost.toLocaleString()]}),a.jsx(Me,{className:`text-right font-semibold ${s.profit>=0?"text-green-400":"text-red-400"}`,children:a.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.profit>=0?a.jsx(sl,{className:"w-4 h-4"}):a.jsx(EL,{className:"w-4 h-4"}),"NT$ ",s.profit.toLocaleString()]})}),a.jsxs(Me,{className:`text-right font-semibold ${parseFloat(s.profitMargin)>=0?"text-green-400":"text-red-400"}`,children:[s.profitMargin,"%"]})]},o))})]})})]})}function P_e(){const{data:e=[]}=Te({queryKey:["invoices"],queryFn:()=>ee.entities.Invoice.list()}),t=e.filter(i=>i.outstanding_amount>0&&i.status!=="cancelled").map(i=>{const s=i.due_date?new Date(i.due_date):null,l=s?Math.floor((new Date-s)/(1e3*60*60*24)):0;let c="未設定到期日";return s&&(l<=0?c="未逾期":l<=30?c="1-30天":l<=60?c="31-60天":l<=90?c="61-90天":c="90天以上"),{...i,daysPastDue:l,agingCategory:c}}).sort((i,s)=>s.daysPastDue-i.daysPastDue),r=()=>{const i=["請款單編號","專案名稱","未收金額","到期日","逾期天數","帳齡類別"],s=t.map(f=>[f.invoice_number,f.project_name,f.outstanding_amount,f.due_date||"-",f.daysPastDue>0?f.daysPastDue:0,f.agingCategory]),o=[i,...s].map(f=>f.join(",")).join(`
1365`),l=new Blob(["\uFEFF"+o],{type:"text/csv;charset=utf-8;"}),c=document.createElement("a");c.href=URL.createObjectURL(l),c.download=`未付款項帳齡報告_${new Date().toISOString().split("T")[0]}.csv`,c.click()},n=i=>{switch(i){case"未逾期":return"text-green-400";case"1-30天":return"text-yellow-400";case"31-60天":return"text-orange-400";case"61-90天":return"text-red-400";case"90天以上":return"text-red-600";default:return"text-gray-400"}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-xl font-bold cyber-text",children:"未付款項帳齡分析"}),a.jsxs(te,{onClick:r,variant:"outline",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(li,{className:"w-4 h-4 mr-2"}),"匯出CSV"]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"請款單編號"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"專案名稱"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"未收金額"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"到期日"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"逾期天數"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"帳齡類別"})]})}),a.jsx(Jn,{children:t.map(i=>a.jsxs(Dt,{children:[a.jsx(Me,{className:"font-medium text-gray-200",children:i.invoice_number}),a.jsx(Me,{className:"text-gray-300",children:i.project_name}),a.jsxs(Me,{className:"text-right text-red-400 font-semibold",children:["NT$ ",i.outstanding_amount.toLocaleString()]}),a.jsx(Me,{className:"text-gray-300",children:i.due_date||"-"}),a.jsx(Me,{className:"text-right text-gray-300",children:i.daysPastDue>0?a.jsxs("span",{className:"flex items-center justify-end gap-1",children:[a.jsx(WN,{className:"w-4 h-4 text-yellow-400"}),i.daysPastDue]}):"-"}),a.jsx(Me,{className:`font-semibold ${n(i.agingCategory)}`,children:i.agingCategory})]},i.id))})]})})]})}function T_e(){const{data:e=[]}=Te({queryKey:["contracts"],queryFn:()=>ee.entities.Contract.list()}),t=e.reduce((o,l)=>(o[l.status]=(o[l.status]||0)+1,o),{}),r={draft:"草稿",pending:"待簽約",active:"執行中",completed:"已完成",terminated:"已終止"},n={draft:"#808080",pending:"#FFD700",active:"#00FFFF",completed:"#00FF00",terminated:"#FF4444"},i=Object.entries(t).map(([o,l])=>({name:r[o]||o,value:l,color:n[o]||"#808080"})),s=()=>{const o=["合約編號","專案名稱","客戶名稱","合約金額","簽約日期","狀態"],l=e.map(d=>[d.contract_number,d.project_name,d.customer_name,d.total_amount,d.signing_date,r[d.status]||d.status]),c=[o,...l].map(d=>d.join(",")).join(`
1366`),f=new Blob(["\uFEFF"+c],{type:"text/csv;charset=utf-8;"}),h=document.createElement("a");h.href=URL.createObjectURL(f),h.download=`合約狀態摘要報告_${new Date().toISOString().split("T")[0]}.csv`,h.click()};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-xl font-bold cyber-text",children:"合約狀態摘要"}),a.jsxs(te,{onClick:s,variant:"outline",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(li,{className:"w-4 h-4 mr-2"}),"匯出CSV"]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"狀態分布圖"}),a.jsx(En,{width:"100%",height:300,children:a.jsxs(Hs,{children:[a.jsx(ln,{data:i,cx:"50%",cy:"50%",labelLine:!1,label:({name:o,value:l})=>`${o}: ${l}`,outerRadius:100,fill:"#8884d8",dataKey:"value",children:i.map((o,l)=>a.jsx(Ma,{fill:o.color},`cell-${l}`))}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF",borderRadius:"8px",color:"#FFFFFF"}})]})})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"狀態統計"}),a.jsx("div",{className:"space-y-3",children:Object.entries(t).map(([o,l])=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-900 rounded",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:n[o]}}),a.jsx("span",{className:"text-gray-200",children:r[o]||o})]}),a.jsx("span",{className:"text-xl font-bold",style:{color:n[o]},children:l})]},o))})]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"合約編號"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"專案名稱"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"客戶名稱"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"合約金額"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"簽約日期"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"狀態"})]})}),a.jsx(Jn,{children:e.map(o=>{var l;return a.jsxs(Dt,{children:[a.jsx(Me,{className:"font-medium text-gray-200",children:o.contract_number}),a.jsx(Me,{className:"text-gray-300",children:o.project_name}),a.jsx(Me,{className:"text-gray-300",children:o.customer_name}),a.jsxs(Me,{className:"text-right text-gray-300",children:["NT$ ",(l=o.total_amount)==null?void 0:l.toLocaleStr
1366ing()]}),a.jsx(Me,{className:"text-gray-300",children:o.signing_date}),a.jsx(Me,{children:a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:n[o.status]+"33",color:n[o.status],border:`1px solid ${n[o.status]}`},children:r[o.status]||o.status})})]},o.id)})})]})})]})}function A_e(){const{data:e=[]}=Te({queryKey:["employees"],queryFn:()=>ee.entities.User.list()}),{data:t=[]}=Te({queryKey:["tasks"],queryFn:()=>ee.entities.Task.list()}),r=e.map(i=>{const s=t.filter(h=>h.assigned_to===i.email),o=s.filter(h=>h.status==="completed"),l=s.filter(h=>h.status==="in_progress"),c=s.filter(h=>h.status==="todo"),f=s.length>0?(o.length/s.length*100).toFixed(2):0;return{name:i.full_name,email:i.email,department:i.department||"-",totalTasks:s.length,completed:o.length,inProgress:l.length,todo:c.length,completionRate:f}}).sort((i,s)=>s.completed-i.completed),n=()=>{const i=["姓名","Email","部門","總任務數","已完成","進行中","待辦","完成率(%)"],s=r.map(f=>[f.name,f.email,f.department,f.totalTasks,f.completed,f.inProgress,f.todo,f.completionRate]),o=[i,...s].map(f=>f.join(",")).join(`
1367`),l=new Blob(["\uFEFF"+o],{type:"text/csv;charset=utf-8;"}),c=document.createElement("a");c.href=URL.createObjectURL(l),c.download=`員工績效報告_${new Date().toISOString().split("T")[0]}.csv`,c.click()};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-xl font-bold cyber-text",children:"員工績效分析"}),a.jsxs(te,{onClick:n,variant:"outline",className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(li,{className:"w-4 h-4 mr-2"}),"匯出CSV"]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"姓名"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"Email"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"部門"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"總任務數"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"已完成"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"進行中"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"待辦"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"完成率"})]})}),a.jsx(Jn,{children:r.map((i,s)=>a.jsxs(Dt,{children:[a.jsx(Me,{className:"font-medium text-gray-200",children:i.name}),a.jsx(Me,{className:"text-gray-300",children:i.email}),a.jsx(Me,{className:"text-gray-300",children:i.department}),a.jsx(Me,{className:"text-right text-gray-300",children:i.totalTasks}),a.jsx(Me,{className:"text-right text-green-400 font-semibold",children:a.jsxs("div",{className:"flex items-center justify-end gap-1",children:[a.jsx(xr,{className:"w-4 h-4"}),i.completed]})}),a.jsx(Me,{className:"text-right text-blue-400",children:i.inProgress}),a.jsx(Me,{className:"text-right text-gray-400",children:i.todo}),a.jsxs(Me,{className:`text-right font-semibold ${parseFloat(i.completionRate)>=80?"text-green-400":parseFloat(i.completionRate)>=50?"text-yellow-400":"text-red-400"}`,children:[i.completionRate,"%"]})]},s))})]})})]})}function R_e(){const[e,t]=I.useState("profitability"),r=[{id:"profitability",name:"專案獲利能力報告",icon:sl,color:"#00FFFF"},{id:"outstanding",name:"未付款項帳齡報告",icon:ut,color:"#FF6347"},{id:"contract",name:"合約狀態摘要報告",icon:kL,color:"#FFD700"},{id:"employee",name:"員工績效報告",icon:Xr,color:"#00FF00"}];return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"報告中心"})}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:r.map(n=>{const i=n.icon;return a.jsxs("button",{onClick:()=>t(n.id),className:`cyber-bg cyber-border rounded-lg p-6 text-left hover-glow transition-all ${e===n.id?"border-[#00FFFF]":""}`,children:[a.jsx(i,{className:"w-8 h-8 mb-3",style:{color:n.color}}),a.jsx("h3",{className:"text-lg font-semibold text-gray-200",children:n.name})]},n.id)})}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[e==="profitability"&&a.jsx(E_e,{}),e==="outstanding"&&a.jsx(P_e,{}),e==="contract"&&a.jsx(T_e,{}),e==="employee"&&a.jsx(A_e,{})]})]})}function I_e({payment:e,onClose:t}){const[r,n]=I.useState({employee_id:"",employee_name:"",payment_date:new Date().toISOString().split("T")[0],amount:"",status:"pending",proof_file:"",notes:"",...e}),[i,s]=I.useState(!1),o=at(),{data:l=[]}=Te({queryKey:["employees"],queryFn:()=>ee.entities.Employee.list()}),c=Ye({mutationFn:m=>e?ee.entities.SalaryPayment.update(e.id,m):ee.entities.SalaryPayment.create(m),onSuccess:()=>{o.invalidateQueries(["salaryPayments"]),alert("儲存成功!"),t()}}),f=m=>{const p=l.find(x=>x.id===m);n({...r,employee_id:m,employee_name:(p==null?void 0:p.full_name)||""})},h=async m=>{const p=m.target.files[0];if(p)try{s(!0);const{file_url:x}=await ee.integrations.Core.UploadFile({file:p});n({...r,proof_file:x})}catch{alert("上傳失敗")}finally{s(!1)}},d=m=>{m.preventDefault(),c.mutate(r)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-lg w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsxs("h2",{className:"text-2xl font-bold cyber-text",children:[e?"編輯":"新增","支領紀錄"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:d,className:"p-6 space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"員工 *"}),a.jsxs(qe,{value:r.employee_id,onValueChange:f,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇員工"})}),a.jsx($e,{className:"bg-black border-gray-700",children:l.map(m=>a.jsx(se,{value:m.id,className:"text-white",children:m.full_name},m.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"發放日期 *"}),a.jsx(ne,{type:"date",required:!0,value:r.payment_date,onChange:m=>n({...r,payment_date:m.target.value}),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"實發金額 *"}),a.jsx(ne,{type:"number",required:!0,value:r.amount,onChange:m=>n({...r,amount:parseFloat(m.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"狀態"}),a.jsxs(qe,{value:r.status,onValueChange:m=>n({...r,status:m}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"pending",className:"text-white",children:"待發放"}),a.jsx(se,{value:"paid",className:"text-white",children:"已發放"}),a.jsx(se,{value:"confirmed",className:"text-white",children:"已簽收"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"簽收證明 / 單據"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("input",{type:"file",id:"proof-upload",onChange:h,className:"hidden",accept:"image/*,.pdf"}),a.jsxs("label",{htmlFor:"proof-upload",className:"flex items-center gap-2 px-4 py-2 bg-gray-800 border border-gray-600 rounded cursor-pointer hover:bg-gray-700",children:[a.jsx(Hr,{className:"w-4 h-4"}),i?"上傳中...":"上傳證明"]}),r.proof_file&&a.jsxs("span",{className:"text-green-400 flex items-center text-sm",children:[a.jsx(xr,{className:"w-4 h-4 mr-1"})," 已上傳"]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"備註"}),a.jsx(Pt,{value:r.notes,onChange:m=>n({...r,notes:m.target.value}),className:"bg-black border-gray-700 h-20"})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-[#8B0000] text-white border-[#8B0000] hover:bg-[#660000]",children:"取消"}),a.jsx(te,{type:"submit",disabled:c.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:c.isPending?a.jsx(Ht,{className:"w-4 h-4 animate-spin"}):"儲存"})]})]})]})})}function M_e(){var O;
1367const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState(null),[c,f]=I.useState(""),[h,d]=I.useState(""),[m,p]=I.useState(""),[x,y]=I.useState(new Date().getFullYear().toString()),v=at(),{data:b=[],isLoading:w}=Te({queryKey:["salaryPayments"],queryFn:()=>ee.entities.SalaryPayment.list("-payment_date")}),_=Ye({mutationFn:R=>ee.entities.SalaryPayment.delete(R),onSuccess:()=>v.invalidateQueries(["salaryPayments"])}),N=R=>{const A={pending:"bg-gray-700 text-gray-200 border-gray-600",paid:"bg-blue-900 text-blue-200 border-blue-700",confirmed:"bg-green-900 text-green-200 border-green-700"},P={pending:"待發放",paid:"已發放",confirmed:"已簽收"};return a.jsx("span",{className:`px-2 py-1 rounded text-xs border ${A[R]||A.pending}`,children:P[R]||R})},S=b.reduce((R,A)=>{if(!A.payment_date)return R;const P=new Date(A.payment_date),E=!x||P.getFullYear().toString()===x;let T=!0;return c&&(T=P>=new Date(c)),h&&T&&(T=P<=new Date(h)),!E||!T||(R[A.employee_id]||(R[A.employee_id]={id:A.employee_id,name:A.employee_name,totalAmount:0,count:0}),R[A.employee_id].totalAmount+=A.amount||0,R[A.employee_id].count+=1),R},{}),k=Object.values(S).filter(R=>{var A;return!m||((A=R.name)==null?void 0:A.toLowerCase().includes(m.toLowerCase()))}),C=b.filter(R=>{if(R.employee_id!==o||!R.payment_date)return!1;const A=new Date(R.payment_date);let P=!0;c&&(P=A>=new Date(c)),h&&P&&(P=A<=new Date(h));const E=!x||A.getFullYear().toString()===x;return P&&E});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"薪資支領管理"}),a.jsxs(te,{onClick:()=>{n(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增支領紀錄"]})]}),!o&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 grid grid-cols-1 md:grid-cols-4 gap-4 items-end",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"搜尋員工姓名"}),a.jsx(ne,{placeholder:"輸入姓名...",value:m,onChange:R=>p(R.target.value),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"年度篩選"}),a.jsx(ne,{type:"number",placeholder:"YYYY",value:x,onChange:R=>y(R.target.value),className:"bg-black border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"日期範圍"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{type:"date",value:c,onChange:R=>f(R.target.value),className:"bg-black border-gray-700"}),a.jsx("span",{className:"text-gray-400",children:"-"}),a.jsx(ne,{type:"date",value:h,onChange:R=>d(R.target.value),className:"bg-black border-gray-700"})]})]}),a.jsxs(te,{variant:"outline",onClick:()=>{p(""),y(new Date().getFullYear().toString()),f(""),d("")},className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:[a.jsx(jj,{className:"w-4 h-4 mr-2"})," 重置"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden mt-4",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"員工姓名"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"支領總次數"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"實發總金額"}),a.jsx(Le,{className:"text-[#00FFFF] text-center",children:"操作"})]})}),a.jsx(Jn,{children:k.length===0?a.jsx(Dt,{children:a.jsx(Me,{colSpan:4,className:"text-center text-gray-500 py-8",children:"查無員工資料"})}):k.map(R=>a.jsxs(Dt,{children:[a.jsx(Me,{className:"font-medium text-gray-200",children:R.name}),a.jsx(Me,{className:"text-right text-gray-300",children:R.count}),a.jsxs(Me,{className:"text-right font-bold text-[#00FFFF]",children:["NT$ ",R.totalAmount.toLocaleString()]}),a.jsx(Me,{className:"text-center",children:a.jsxs(te,{size:"sm",onClick:()=>l(R.id),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-0",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"})," 查看詳情"]})})]},R.id))})]})})]}),o&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{variant:"ghost",onClick:()=>l(null),className:"text-gray-400 hover:text-white hover:bg-gray-800",children:[a.jsx(zf,{className:"w-4 h-4 mr-2"})," 返回員工列表"]}
1367),a.jsxs("h2",{className:"text-xl font-semibold text-white",children:[(O=S[o])==null?void 0:O.name," - 支領明細"]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 grid grid-cols-1 md:grid-cols-3 gap-4 items-end",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"年度"}),a.jsx(ne,{type:"number",value:x,onChange:R=>y(R.target.value),className:"bg-black border-gray-700",placeholder:"YYYY"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"日期範圍"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ne,{type:"date",value:c,onChange:R=>f(R.target.value),className:"bg-black border-gray-700"}),a.jsx("span",{className:"text-gray-400",children:"-"}),a.jsx(ne,{type:"date",value:h,onChange:R=>d(R.target.value),className:"bg-black border-gray-700"})]})]}),a.jsxs(te,{variant:"outline",onClick:()=>{f(""),d(""),y("")},className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:[a.jsx(jj,{className:"w-4 h-4 mr-2"})," 重置篩選"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"發放日期"}),a.jsx(Le,{className:"text-[#00FFFF] text-right",children:"實發金額"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"狀態"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"簽收證明"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"備註"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"操作"})]})}),a.jsx(Jn,{children:C.length===0?a.jsx(Dt,{children:a.jsx(Me,{colSpan:6,className:"text-center text-gray-500 py-8",children:"無相關紀錄"})}):C.map(R=>a.jsxs(Dt,{children:[a.jsx(Me,{className:"text-gray-300",children:R.payment_date}),a.jsxs(Me,{className:"text-right font-bold text-[#00FFFF]",children:["NT$ ",(R.amount||0).toLocaleString()]}),a.jsx(Me,{children:N(R.status)}),a.jsx(Me,{children:R.proof_file?a.jsx(te,{variant:"ghost",size:"sm",onClick:()=>s({url:R.proof_file,name:"簽收證明"}),className:"text-blue-400 hover:text-blue-300 hover:bg-blue-900/20",children:"查看證明"}):a.jsx("span",{className:"text-gray-600 text-sm",children:"無證明"})}),a.jsx(Me,{className:"text-gray-400 text-sm max-w-[200px] truncate",children:R.notes||"-"}),a.jsx(Me,{children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(te,{size:"sm",variant:"outline",onClick:()=>{n(R),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:a.jsx(qt,{className:"w-4 h-4"})}),a.jsx(te,{size:"sm",variant:"outline",onClick:()=>{window.confirm("確定刪除?")&&_.mutate(R.id)},className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})})]},R.id))})]})})]}),e&&a.jsx(I_e,{payment:r,onClose:()=>{t(!1),n(null)}}),i&&a.jsx($a,{fileUrl:i.url,fileName:i.name,onClose:()=>s(null)})]})}function L_e({invoice:e,contracts:t,onClose:r}){const[n,i]=I.useState(()=>e?{invoice_number:e.invoice_number||"",contract_id:e.contract_id||"",contract_number:e.contract_number||"",project_name:e.project_name||"",milestone_id:e.milestone_id||"",milestone_name:e.milestone_name||"",invoice_amount:e.invoice_amount||"",received_amount:e.received_amount||0,outstanding_amount:e.outstanding_amount||0,invoice_date:e.invoice_date||new Date().toISOString().split("T")[0],due_date:e.due_date||"",requestor_name:e.requestor_name||"",vendor_name:e.vendor_name||"",payment_method:e.payment_method||"",purpose:e.purpose||"",invoice_link:e.invoice_link||"",bank_passbook_url:e.bank_passbook_url||"",bank_account_info:e.bank_account_info||"",file_url:e.file_url||"",status:e.status||"draft",payment_records:e.payment_records||[]}:{invoice_number:"",contract_id:"",contract_number:"",project_name:"",milestone_id:"",milestone_name:"",invoice_amount:"",received_amount:0,outstanding_amount:"",invoice_date:new Date().toISOString().split("T")[0],due_date:"",requestor_name:"",vendor_name:"",payment_method:"",purpose:"",invoice_link:"",bank_passbook_url:"",bank_account_info:"",file_url:"",status:"draft",payment_records:[]}),[s,o]=I.useState(!1),[l,c]=I.useState(!1),[f,h]=I.useState([]),d=at
1367();I.useEffect(()=>{const _=(n.invoice_amount||0)-(n.received_amount||0);i(N=>({...N,outstanding_amount:_}))},[n.invoice_amount,n.received_amount]),I.useEffect(()=>{n.contract_id&&m(n.contract_id)},[n.contract_id]);const m=async _=>{try{const S=(await ee.entities.Milestone.list()).filter(k=>k.contract_id===_);h(S)}catch(N){console.error("Failed to load milestones:",N)}},p=Ye({mutationFn:async _=>{const N={invoice_number:_.invoice_number,contract_id:_.contract_id||"",contract_number:_.contract_number||"",project_name:_.project_name||"",milestone_id:_.milestone_id||"",milestone_name:_.milestone_name||"",invoice_amount:parseFloat(_.invoice_amount)||0,tax_amount:Math.round((parseFloat(_.invoice_amount)||0)*.05/1.05),untaxed_amount:Math.round((parseFloat(_.invoice_amount)||0)/1.05),received_amount:parseFloat(_.received_amount)||0,outstanding_amount:parseFloat(_.outstanding_amount)||0,invoice_date:_.invoice_date,due_date:_.due_date||"",requestor_name:_.requestor_name||"",vendor_name:_.vendor_name||"",payment_method:_.payment_method||"",purpose:_.purpose||"",invoice_link:_.invoice_link||"",bank_passbook_url:_.bank_passbook_url||"",bank_account_info:_.bank_account_info||"",file_url:_.file_url||"",status:_.status||"draft",payment_records:_.payment_records||[]};return e&&e.id?(console.log("Updating invoice:",e.id,N),await ee.entities.SoftwareInvoice.update(e.id,N)):(console.log("Creating new invoice:",N),await ee.entities.SoftwareInvoice.create(N))},onSuccess:async _=>{var k;await d.invalidateQueries(["software_invoices"]);const N=e?"請款單已更新":"新請款單建立",S=e?`請款單 ${_.invoice_number} 已更新。`:`已建立新的請款單 ${_.invoice_number},金額 NT$ ${(k=_.invoice_amount)==null?void 0:k.toLocaleString()}。`;try{await ee.entities.Notification.create({title:N,message:S,type:"success",link:"/SoftwareProjectInvoicing",created_at:new Date().toISOString()})}catch(C){console.error("Failed to create notification:",C)}alert("儲存成功!"),r()},onError:_=>{console.error("Save failed:",_),alert("儲存失敗:"+(_.message||"未知錯誤"))}}),x=_=>{const N=t.find(S=>S.id===_);N&&(i(S=>({...S,contract_id:_,contract_number:N.contract_number,project_name:N.project_name,vendor_name:N.customer_name||"",milestone_id:"",milestone_name:""})),m(_))},y=_=>{if(!_||_===""){i(S=>({...S,milestone_id:"",milestone_name:""}));return}const N=f.find(S=>S.id===_);N&&i(S=>({...S,milestone_id:_,milestone_name:N.milestone_name,invoice_amount:N.billing_amount||S.invoice_amount}))},v=async _=>{const N=_.target.files[0];if(N)try{o(!0);const{file_url:S}=await ee.integrations.Core.UploadFile({file:N});i(k=>({...k,bank_passbook_url:S}))}catch(S){console.error("Upload failed:",S),alert("存摺上傳失敗,請重試")}finally{o(!1)}},b=async _=>{const N=_.target.files[0];if(N)try{c(!0);const{file_url:S}=await ee.integrations.Core.UploadFile({file:N});i(k=>({...k,file_url:S}))}catch(S){console.error("Upload failed:",S),alert("請款單上傳失敗,請重試")}finally{c(!1)}},w=_=>{_.preventDefault(),p.mutate(n)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-3xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯請款單":"新增請款單"}),a.jsx("button",{onClick:r,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:w,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款單編號 *"}),a.jsx(ne,{required:!0,value:n.invoice_number,onChange:_=>i({...n,invoice_number:_.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯合約 *"}),a.jsxs(qe,{value:n.contract_id,onValueChange:x,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇合約"})}),a.jsx($e,{className:"bg-black border-gray-700",children:t.map(_=>a.jsxs(se,{value:_.id,className:"text-white",children:[_.contract_number," - ",_.project_name]},_.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"專案名稱"}),a.jsx(ne,{value:n.project_name,readOnly:!0,className:"bg-gray-900 border-gray-700"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯里程碑(選填)"}),a.jsxs(qe,{value:n.milestone_id,onValueChange:y,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇里程碑"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:null,className:"text-white",children:"無關聯里程碑"}),f.map(_=>a.jsx(se,{value:_.id,className:"text-white",children:_.milestone_name},_.id))]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款人姓名"}),a.jsx(ne,{value:n.requestor_name,onChange:_=>i({...n,requestor_name:_.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款廠商"}),a.jsx(ne,{value:n.vendor_name,onChange:_=>i({...n,vendor_name:_.target.value}),placeholder:"若有關聯合約,可自動帶入客戶名稱",className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"付款方式"}),a.jsxs(qe,{value:n.payment_method,onValueChange:_=>i({...n,payment_method:_}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇付款方式"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"轉帳",className:"text-white",children:"轉帳"}),a.jsx(se,{value:"匯款",className:"text-white",children:"匯款"}),a.jsx(se,{value:"支票",className:"text-white",children:"支票"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款目的"}),a.jsx(ne,{value:n.purpose,onChange:_=>i({...n,purpose:_.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"電子發票連結"}),a.jsx(ne,{value:n.invoice_link,onChange:_=>i({...n,invoice_link:_.target.value}),placeholder:"https://...",className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2 md:col-span-2",children:[a.jsx(Q,{children:"匯款帳號資訊"}),a.jsx(Pt,{value:n.bank_account_info||"",onChange:_=>i({...n,bank_account_info:_.target.value}),placeholder:`請輸入匯款帳號資訊
1368例如:
1369戶名:無限未來有限公司
1370金融機構代碼:808
1371玉山銀行 北高雄分行
1372活存帳號:0347-940-019360`,className:"bg-black border-gray-700 focus:border-[#00FFFF] min-h-[120px]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款單 PDF (數位副本)"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{type:"button",variant:"outline",onClick:()=>document.getElementById("invoice-file-upload").click(),className:"bg-gray-800 border-gray-700 hover:bg-gray-700",disabled:l,children:[l?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),l?"上傳中...":"上傳 PDF"]}),a.jsx(ne,{id:"invoice-file-upload",type:"file",accept:".pdf",className:"hidden",onChange:b}),n.file_url&&a.jsxs("span",{className:"text-sm text-[#00FFFF] flex items-center",children:[a.jsx("a",{href:n.file_url,target:"_blank",rel:"noreferrer",className:"hover:underline",children:"已上傳 (點擊查看)"}),a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>i(_=>({..._,file_url:""})),className:"text-red-500 hover:text-red-400 ml-2",children:a.jsx(vt,{className:"w-4 h-4"})})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"銀行存摺影本 (JPG/PNG)"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(te,{type:"button",variant:"outline",onClick:()=>document.getElementById("passbook-upload").click(),className:"bg-gray-800 border-gray-700 hover:bg-gray-700",disabled:s,children:[s?a.jsx(Ht,{className:"w-4 h-4 animate-spin mr-2"}):a.jsx(Hr,{className:"w-4 h-4 mr-2"}),s?"上傳中...":"上傳存摺"]}),a.jsx(ne,{id:"passbook-upload",type:"file",accept:"image/jpeg,image/png",className:"hidden",onChange:v}),n.bank_passbook_url&&a.jsxs("span",{className:"text-sm text-[#00FFFF] flex items-center",children:[a.jsx("a",{href:n.bank_passbook_url,target:"_blank",rel:"noreferrer",className:"hover:underline",children:"已上傳 (點擊查看)"}),a.jsx(te,{type:"button",variant:"ghost",size:"sm",onClick:()=>i(_=>({..._,bank_passbook_url:""})),className:"text-red-500 hover:text-red-400 ml-2",children:a.jsx(vt,{className:"w-4 h-4"})})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款金額 *"}),a.jsx(ne,{type:"number",required:!0,value:n.invoice_amount,onChange:_=>i({...n,invoice_amount:parseFloat(_.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"請款日期 *"}),a.jsx(ne,{type:"date",required:!0,value:n.invoice_date,onChange:_=>i({...n,invoice_date:_.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"到期日"}),a.jsx(ne,{type:"date",value:n.due_date,onChange:_=>i({...n,due_date:_.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"已收金額"}),a.jsx(ne,{type:"number",value:n.received_amount,onChange:_=>i({...n,received_amount:parseFloat(_.target.value)||0}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"未收金額"}),a.jsx(ne,{type:"number",value:n.outstanding_amount,readOnly:!0,className:"bg-gray-900 border-gray-700 text-red-400 font-semibold"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"狀態"}),a.jsxs(qe,{value:n.status,onValueChange:_=>i({...n,status:_}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"draft",className:"text-white",children:"草稿"}),a.jsx(se,{value:"pending",className:"text-white",children:"待審核"}),a.jsx(se,{value:"sent",className:"text-white",children:"已發送"}),a.jsx(se,{value:"paid",className:"text-white",children:"已結清"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已作廢"})]})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:r,className:"bg-red-900 text-white hover:bg-red-800 border-red-700",children:"取消"}),a.jsx(te,{type:"submit",disabled:p.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:p.isPending?"儲存中...":"儲存"})]})]})]})})}function D_e({invoice:e,onClose:t,onEdit:r}){const[n,i]=I.useState(!1),[s,o]=I.useState(!1),[l,c]=I.useState({amount:"",payment_date:new Date().toISOString().split("T")[0],payment_method:"",notes:""}),f=at(),h=async()=>{let p={};try{const y=await ee.entities.CompanySetting.list();y.length>0&&(p=y[0])}catch(y){console.error("Failed to load settings:",y)}const x=window.open("","_blank");x.document.write(`
1373      <html>
1374        <head>
1375          <title>請款單</title>
1376          <meta charset="UTF-8">
1377          <style>
1378            * { margin: 0; padding: 0; box-sizing: border-box; }
1379            body { font-family: "Microsoft JhengHei", Arial, sans-serif; padding: 0; color: #333; background: white; }
1380            .header { background: #000; color: #fff; padding: 12px 20px; display: flex; align-items: center; }
1381            .logo { font-size: 16px; font-weight: bold; display: flex; align-items: center; gap: 8px; }
1382            h1 { text-align: center; font-size: 24px; margin: 30px 0 20px 0; color: #333; }
1383            .content-wrapper { padding: 0 40px 40px 40px; max-width: 800px; margin: 0 auto; }
1384            .info-section { border: 1px solid #333; margin-bottom: 20px; }
1385            .info-row { display: flex; border-bottom: 1px solid #333; }
1386            .info-row:last-child { border-bottom: none; }
1387            .info-cell { padding: 10px 12px; flex: 1; border-right: 1px solid #333; font-size: 13px; }
1388            .info-cell:last-child { border-right: none; }
1389            .info-label { background: #f5f5f5; font-weight: bold; min-width: 100px; flex: 0 0 100px; }
1390            table { width: 100%; border-collapse: collapse; margin: 20px 0; border: 1px solid #333; }
1391            th, td { border: 1px solid #333; padding: 10px 8px; text-align: center; font-size: 13px; vertical-align: middle; }
1392            th { background: #e0e0e0; font-weight: bold; }
1393            .item-desc { text-align: left; padding-left: 12px; }
1394            .amount { text-align: right; padding-right: 12px; }
1395            .total-row { background: #f5f5f5; font-weight: bold; }
1396            .footer-section { margin-top: 20px; border: 1px solid #333; }
1397            .footer-title { background: #e0e0e0; padding: 10px; font-weight: bold; text-align: center; font-size: 14px; border-bottom: 1px solid #333; }
1398            .footer-content { padding: 15px; line-height: 1.8; font-size: 13px; white-space: pre-line; }
1399            .footer-content a { color: #0066cc; text-decoration: underline; word-break: break-all; }
1400            .passbook-img { max-width: 500px; height: auto; border: 1px solid #ddd; margin: 10px auto; display: block; }
1401            .page-break { page-break-before: always; }
1402            @media print { 
1403              body { padding: 0; } 
1404              .header { background: #000 !important; -webkit-print-color-adjust: exact; color: #fff !important; } 
1405              th, .total-row { -webkit-print-color-adjust: exact; }
1406            }
1407          </style>
1408        </head>
1409        <body>
1410          <div class="header">
1411            <div class="logo">
1412              ${p.company_logo_url?`<img src="${p.company_logo_url}" alt="LOGO" style="width: 28px; height: 28px; object-fit: contain; background: white; padding: 2px; border-radius: 3px;" />`:""}
1413              <span>${p.company_name||"無限未來有限公司"}</span>
1414            </div>
1415          </div>
1416          <div class="content-wrapper">
1417            <h1>請款單</h1>
1418            <div class="info-section">
1419              <div class="info-row">
1420                <div class="info-cell info-label">請款人姓名</div>
1421                <div class="info-cell">${e.requestor_name||e.created_by||""}</div>
1422                <div class="info-cell info-label">請款廠商</div>
1423                <div class="info-cell">${e.vendor_name||""}</div>
1424              </div>
1425              <div class="info-row">
1426                <div class="info-cell info-label">請款日期</div>
1427                <div class="info-cell">${e.invoice_date}</div>
1428                <div class="info-cell info-label">付款方式</div>
1429                <div class="info-cell">${e.payment_method||"匯款"}</div>
1430              </div>
1431              <div class="info-row">
1432                <div class="info-cell info-label">請款目的</div>
1433                <div class="info-cell" style="flex: 3;">${e.purpose||"文付+輔設 - 里程碑款項"}</div>
1434              </div>
1435            </div>
1436            <table>
1437              <thead>
1438                <tr>
1439                  <th style="width: 45%">請款明細</th>
1440                  <th style="width: 10%">數量</th>
1441                  <th style="width: 15%">金額</th>
1442                  <th style="width: 12%">稅額</th>
1443                  <th style="width: 15%">含稅總價</th>
1444                  <th style="width: 8%">備註</th>
1445                </tr>
1446              </thead>
1447              <tbody>
1448                <tr>
1449                  <td class="item-desc">${e.project_name||""}<br/>${e.milestone_name?`<small style="color: #666;">${e.milestone_name}</small><br/>`:""}${e.contract_number?`<small style="color: #666;">${e.contract_number}</small>`:""}</td>
1450                  <td>1</td>
1451                  <td class="amount">${Math.round(e.untaxed_amount||0).toLocaleString()}</td>
1452                  <td class="amount">${Math.round(e.tax_amount||0).toLocaleString()}</td>
1453                  <td class="amount">${Math.round(e.invoice_amount||0).toLocaleString()}</td>
1454                  <td></td>
1455                </tr>
1456                <tr class="total-row">
1457                  <td colspan="4" style="text-align: right; padding-right: 20px;">合計</td>
1458                  <td class="amount">
1458${Math.round(e.invoice_amount||0).toLocaleString()}</td>
1459                  <td></td>
1460                </tr>
1461              </tbody>
1462            </table>
1463
1464            ${e.invoice_link?`
1465            <div class="footer-section">
1466              <div class="footer-title">三聯式電子發票連結</div>
1467              <div class="footer-content" style="text-align: center;">
1468                <a href="${e.invoice_link}" target="_blank">${e.invoice_link}</a>
1469              </div>
1470            </div>
1471            `:""}
1472
1473            <div class="footer-section" style="margin-top: ${e.invoice_link?"20px":"0"};">
1474              <div class="footer-title">匯款帳號</div>
1475              <div class="footer-content">
1476                ${e.bank_account_info?e.bank_account_info:`戶名:${p.company_name||"無限未來有限公司"}
1477金融機構代碼:808
1478玉山銀行 北高雄分行
1479活存帳號:0347-940-019360`}
1480              </div>
1481            </div>
1482          </div>
1483
1484          ${e.bank_passbook_url?`
1485          <div class="page-break"></div>
1486          <div class="header">
1487            <div class="logo">
1488              ${p.company_logo_url?`<img src="${p.company_logo_url}" alt="LOGO" style="width: 28px; height: 28px; object-fit: contain; background: white; padding: 2px; border-radius: 3px;" />`:""}
1489              <span>${p.company_name||"無限未來有限公司"}</span>
1490            </div>
1491          </div>
1492          <div class="content-wrapper">
1493            <h1>銀行存摺影本</h1>
1494            <div class="footer-section">
1495              <div class="footer-content" style="text-align: center; padding: 40px 20px;">
1496                <img src="${e.bank_passbook_url}" alt="銀行存摺" class="passbook-img" />
1497              </div>
1498            </div>
1499          </div>
1500          `:""}
1501        </body>
1502      </html>
1503    `),x.document.close(),x.print()},d=Ye({mutationFn:async p=>{const x=(e==null?void 0:e.invoice_amount)||0,y=await ee.entities.SoftwareInvoice.update(e.id,{status:p,received_amount:x,outstanding_amount:0});if(p==="paid"&&e.milestone_id)try{await ee.entities.Milestone.update(e.milestone_id,{payment_status:"paid"})}catch(v){console.error("Failed to update milestone payment status:",v)}return y},onSuccess:()=>{f.invalidateQueries(["software_invoices"]),f.invalidateQueries(["milestones"]),alert("狀態更新成功!"),t()}}),m=p=>({draft:"草稿",pending:"待審核",sent:"已發送",paid:"已結清",cancelled:"已作廢"})[p]||p;return a.jsxs("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:"請款單詳情"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",onClick:h,className:"bg-gray-800 text-white border-gray-600 hover:bg-gray-700",children:[a.jsx($g,{className:"w-4 h-4 mr-2"}),"列印請款單"]}),a.jsxs(te,{variant:"outline",onClick:r,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(qt,{className:"w-4 h-4 mr-2 text-black"}),"編輯"]}),e.file_url&&a.jsxs(te,{variant:"outline",onClick:()=>i(!0),className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:[a.jsx(cr,{className:"w-4 h-4 mr-2"}),"查看附件"]}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"請款單編號"}),a.jsx("p",{className:"text-lg font-semibold cyber-text",children:(e==null?void 0:e.invoice_number)||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"專案名稱"}),a.jsx("p",{className:"text-gray-200",children:(e==null?void 0:e.project_name)||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"合約編號"}),a.jsx("p",{className:"text-gray-200",children:(e==null?void 0:e.contract_number)||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"關聯里程碑"}),a.jsx("p",{className:"text-gray-200",children:(e==null?void 0:e.milestone_name)||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"請款人"}),a.jsx("p",{className:"text-gray-200",children:(e==null?void 0:e.requestor_name)||"-"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"狀態"}),a.jsx("p",{className:"text-gray-200",children:m(e==null?void 0:e.status)})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"請款金額"}),a.jsxs("p",{className:"text-2xl font-bold text-[#00FFFF]",children:["NT$ ",((e==null?void 0:e.invoice_amount)||0).toLocaleStr
1503ing()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已收金額"}),a.jsxs("p",{className:"text-xl font-semibold text-green-400",children:["NT$ ",((e==null?void 0:e.received_amount)||0).toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未收金額"}),a.jsxs("p",{className:"text-xl font-semibold text-red-400",children:["NT$ ",((e==null?void 0:e.outstanding_amount)||0).toLocaleString()]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"請款日期"}),a.jsx("p",{className:"text-gray-200",children:(e==null?void 0:e.invoice_date)||"-"})]}),(e==null?void 0:e.due_date)&&a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"到期日"}),a.jsx("p",{className:"text-gray-200",children:e.due_date})]})]})]}),(e==null?void 0:e.status)!=="paid"&&(e==null?void 0:e.status)!=="cancelled"&&a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs(te,{onClick:()=>{confirm("確認此請款單已全額收款?")&&d.mutate("paid")},disabled:d.isPending,className:"bg-green-900 text-white hover:bg-green-800 border-green-700",children:[a.jsx(Ct,{className:"w-4 h-4 mr-2"}),"標記為已結清"]})})]})]}),n&&(e==null?void 0:e.file_url)&&a.jsx($a,{fileUrl:e.file_url,fileName:`請款單 - ${(e==null?void 0:e.invoice_number)||"請款單"}`,onClose:()=>i(!1)})]})}function $_e(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState(null),[o,l]=I.useState(""),[c,f]=I.useState("all"),[h,d]=I.useState("all"),[m,p]=I.useState(""),[x,y]=I.useState(""),[v,b]=I.useState("all"),w=at();oe.useEffect(()=>{if(new URLSearchParams(window.location.search).get("action")==="create"){const H=sessionStorage.getItem("newInvoiceData");if(H)try{const K=JSON.parse(H);s(K),t(!0),sessionStorage.removeItem("newInvoiceData"),window.history.replaceState({},"",window.location.pathname)}catch(K){console.error("Failed to parse invoice data:",K),sessionStorage.removeItem("newInvoiceData")}}},[]);const{data:_=[],isLoading:N}=Te({queryKey:["software_invoices"],queryFn:async()=>await ee.entities.SoftwareInvoice.list("-created_date")}),{data:S=[]}=Te({queryKey:["contracts"],queryFn:()=>ee.entities.Contract.list()}),k=Ye({mutationFn:async U=>await ee.entities.SoftwareInvoice.delete(U),onSuccess:async()=>{await w.invalidateQueries(["software_invoices"]),alert("刪除成功!")},onError:U=>{console.error("Delete failed:",U),alert("刪除失敗:"+(U.message||"未知錯誤"))}}),C=_.filter(U=>{var re;const H=c==="all"||(U==null?void 0:U.status)===c,K=(U==null?void 0:U.project_name)||"",q=h==="all"||K===h,L=(U==null?void 0:U.contract_number)||"",V=!o||((re=U==null?void 0:U.invoice_number)==null?void 0:re.toLowerCase().includes(o.toLowerCase()))||K.toLowerCase().includes(o.toLowerCase())||L.toLowerCase().includes(o.toLowerCase()),z=U==null?void 0:U.invoice_date;let Z=!0;return z?(m&&new Date(z)<new Date(m)&&(Z=!1),x&&new Date(z)>new Date(x)&&(Z=!1),v!=="all"&&new Date(z).getFullYear().toString()!==v&&(Z=!1)):(m||x||v!=="all")&&(Z=!1),H&&q&&V&&Z}),O=[...new Set(_.map(U=>U==null?void 0:U.project_name).filter(Boolean))],R=[...new Set(_.map(U=>U!=null&&U.invoice_date?new Date(U.invoice_date).getFullYear():null).filter(Boolean))].sort((U,H)=>H-U),A=C.reduce((U,H)=>U+((H==null?void 0:H.invoice_amount)||0),0),P=C.reduce((U,H)=>U+((H==null?void 0:H.received_amount)||0),0),E=C.reduce((U,H)=>U+((H==null?void 0:H.outstanding_amount)||0),0),T=U=>{const H={draft:{label:"草稿",color:"#808080"},pending:{label:"待審核",color:"#FFD700"},sent:{label:"已發送",color:"#00FFFF"},paid:{label:"已結清",color:"#00FF00"},cancelled:{label:"已作廢",color:"#FF4444"}},K=H[U]||H.draft;return a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:K.color+"33",color:K.color,border:`1px solid ${K.color}`},children:K.label})},$=[{name:"已請款",value:A},{name:"已收款",value:P},{name:"未收款",value:E}].filter(U=>U.value>0),D=[{name:"已請款",amount:A},{name:"已收款",amount:P},{name:"未收款",amount:E}],W=["#00FFFF","#00FF00","#FF4444"];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ut,{className:"w-8 h-8 cyber-text"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"軟體專案請款"})]}),a.jsxs(te,{onClick:()=>{s(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增請款單"]}
1503)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(ut,{className:"w-8 h-8 text-[#00FFFF]"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已請款金額"}),a.jsxs("p",{className:"text-2xl font-bold cyber-text",children:["NT$ ",(A||0).toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(ut,{className:"w-8 h-8 text-green-400"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"已收款金額"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:["NT$ ",(P||0).toLocaleString()]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx(ut,{className:"w-8 h-8 text-red-400"})}),a.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"未收款金額"}),a.jsxs("p",{className:"text-2xl font-bold text-red-400",children:["NT$ ",(E||0).toLocaleString()]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-4 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋請款單編號、專案...",value:o,onChange:U=>l(U.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(qe,{value:h,onValueChange:d,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"專案篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有專案"}),O.map(U=>a.jsx(se,{value:U,className:"text-white",children:U},U))]})]}),a.jsxs(qe,{value:c,onValueChange:f,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"狀態篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有狀態"}),a.jsx(se,{value:"draft",className:"text-white",children:"草稿"}),a.jsx(se,{value:"pending",className:"text-white",children:"待審核"}),a.jsx(se,{value:"sent",className:"text-white",children:"已發送"}),a.jsx(se,{value:"paid",className:"text-white",children:"已結清"}),a.jsx(se,{value:"cancelled",className:"text-white",children:"已作廢"})]})]}),a.jsxs(qe,{value:v,onValueChange:b,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"年度篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有年度"}),R.map(U=>a.jsxs(se,{value:U.toString(),className:"text-white",children:[U," 年"]},U))]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-gray-400",children:"日期範圍:"}),a.jsx(ne,{type:"date",value:m,onChange:U=>p(U.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]",placeholder:"開始日期"}),a.jsx("span",{className:"text-gray-400",children:"-"}),a.jsx(ne,{type:"date",value:x,onChange:U=>y(U.target.value),className:"bg-black border-gray-700 focus:border-[#00FFFF]",placeholder:"結束日期"})]}),a.jsx(te,{variant:"outline",onClick:()=>{l(""),f("all"),d("all"),p(""),y(""),b("all")},className:"bg-gray-800 border-gray-700 text-white hover:bg-gray-700",children:"清除所有篩選"})]})]}),C.length>0&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"金額分布"}),a.jsx(En,{width:"100%",height:300,children:a.jsxs(oh,{data:D,children:[a.jsx(el,{strokeDasharray:"3 3",stroke:"#333"}),a.jsx(fi,{dataKey:"name",stroke:"#888"}),a.jsx(hi,{stroke:"#888"}),a.jsx(fr,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid #00FFFF"},formatter:U=>
1503`NT$ ${U.toLocaleString()}`}),a.jsx(zi,{}),a.jsx(Qn,{dataKey:"amount",fill:"#00FFFF",name:"金額 (NT$)"})]})})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text mb-4",children:"請款狀態比例"}),a.jsx(En,{width:"100%",height:300,children:a.jsxs(Hs,{children:[a.jsx(ln,{data:$,cx:"50%",cy:"50%",labelLine:!1,label:({name:U,percent:H,value:K})=>`${U} ${(H*100).toFixed(0)}% (NT$ ${K.toLocaleString()})`,outerRadius:80,fill:"#8884d8",dataKey:"value",children:$.map((U,H)=>a.jsx(Ma,{fill:W[H%W.length]},`cell-${H}`))}),a.jsx(fr,{formatter:U=>`NT$ ${U.toLocaleString()}`})]})})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h2",{className:"text-xl font-bold text-white",children:"請款單列表"}),N?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):C.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(ut,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無請款單資料"})]}):a.jsx("div",{className:"space-y-3",children:C.map(U=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow transition-all",children:a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex-1 space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:(U==null?void 0:U.invoice_number)||"-"}),T(U==null?void 0:U.status)]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-3 text-sm",children:[a.jsxs("div",{className:"text-gray-300",children:["專案:",(U==null?void 0:U.project_name)||"-"]}),a.jsxs("div",{className:"text-gray-300",children:["里程碑:",(U==null?void 0:U.milestone_name)||"-"]}),a.jsxs("div",{className:"text-gray-300",children:["請款日期:",(U==null?void 0:U.invoice_date)||"-"]}),a.jsxs("div",{className:"text-[#00FFFF] font-semibold",children:["請款:NT$ ",((U==null?void 0:U.invoice_amount)||0).toLocaleString()]}),a.jsxs("div",{className:"text-green-400",children:["已收:NT$ ",((U==null?void 0:U.received_amount)||0).toLocaleString()]}),a.jsxs("div",{className:"text-red-400 font-semibold",children:["未收:NT$ ",((U==null?void 0:U.outstanding_amount)||0).toLocaleString()]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(te,{variant:"outline",size:"sm",onClick:()=>n(U),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:[a.jsx(cr,{className:"w-4 h-4 mr-1"}),"詳情"]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{s(U),t(!0)},className:"bg-gray-800 text-white hover:bg-gray-700 border-gray-600",children:a.jsx(qt,{className:"w-4 h-4"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{window.confirm("確定要刪除此請款單嗎?此操作無法復原。")&&k.mutate(U.id)},className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},U.id))})]}),e&&a.jsx(L_e,{invoice:i,contracts:S,onClose:()=>{t(!1),s(null)}}),r&&!e&&a.jsx(D_e,{invoice:r,onClose:()=>n(null),onEdit:()=>{s(r),t(!0),n(null)}})]})}const q_e=Dg("inline-flex items-center rounded-md 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function B_e({className:e,variant:t,...r}){return a.jsx("div",{className:Vt(q_e({variant:t}),e),...r})}function z_e(){const[e,t]=I.useState(""),r=at(),{data:n=[],isLoading:i}=Te({queryKey:["users"],queryFn:()=>ee.entities.User.list()}),s=Ye({mutationFn:({id:c,role:f})=>ee.entities.User.update(c,{system_role:f}),onSuccess:()=>{r.invalidateQueries(["users"])}}),o=n.filter(c=>{var f,h;return((f=c.full_name)==null?void 0:f.toLowerCase().includes(e.toLowerCase()))||((h=c.email)==null?void 0:h.toLowerCase().includes(e.toLowerCase()))}),l=c=>{const f={admin:"bg-red-900 text-red-200 border-red-700",editor:"bg-blue-900 text-blue-200 border-blue-700",reader:"bg-gray-700 text-gray-200 border-gray-600"},h={admin:"系統管理者",editor:"編輯者",reader:"閱讀者"};return a.jsx(B_e,{className:`${f[c]||f.reader}
1503 border`,children:h[c]||h.reader})};return i?a.jsx("div",{className:"p-8 text-center text-gray-400",children:"載入中..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(OL,{className:"w-8 h-8 cyber-text"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"系統帳戶與權限管理"})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"relative max-w-md",children:[a.jsx(hr,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx(ne,{placeholder:"搜尋姓名或 Email...",value:e,onChange:c=>t(c.target.value),className:"pl-10 bg-black border-gray-700 focus:border-[#00FFFF]"})]})}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg overflow-hidden",children:a.jsxs(Xn,{children:[a.jsx(Zn,{children:a.jsxs(Dt,{className:"border-gray-700 hover:bg-transparent",children:[a.jsx(Le,{className:"text-[#00FFFF]",children:"姓名"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"Email"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"目前角色"}),a.jsx(Le,{className:"text-[#00FFFF]",children:"權限設定"})]})}),a.jsx(Jn,{children:o.map(c=>a.jsxs(Dt,{className:"border-gray-700 hover:bg-gray-900/50",children:[a.jsxs(Me,{className:"font-medium text-white flex items-center gap-2",children:[a.jsx(Uf,{className:"w-4 h-4 text-gray-400"}),c.full_name]}),a.jsx(Me,{className:"text-gray-300",children:c.email}),a.jsx(Me,{children:l(c.system_role||(c.role==="admin"?"admin":"reader"))}),a.jsx(Me,{children:a.jsxs(qe,{value:c.system_role||(c.role==="admin"?"admin":"reader"),onValueChange:f=>s.mutate({id:c.id,role:f}),children:[a.jsx(De,{className:"w-[180px] bg-black border-gray-700 h-8",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"admin",className:"text-white",children:"系統管理者 (Admin)"}),a.jsx(se,{value:"editor",className:"text-white",children:"編輯者 (Editor)"}),a.jsx(se,{value:"reader",className:"text-white",children:"閱讀者 (Reader)"})]})]})})]},c.id))})]})})]})}function U_e(){const[e,t]=I.useState({company_name:"",tax_id:"",address:"",phone:"",email:"",company_logo_url:"",notification_days:7}),[r,n]=I.useState(!1),i=at(),{data:s=[],isLoading:o}=Te({queryKey:["company-settings"],queryFn:()=>ee.entities.CompanySetting.list()});I.useEffect(()=>{s.length>0&&t(s[0])},[s]);const l=Ye({mutationFn:h=>s.length>0?ee.entities.CompanySetting.update(s[0].id,h):ee.entities.CompanySetting.create(h),onSuccess:()=>{i.invalidateQueries(["company-settings"]),alert("儲存成功!")}}),c=async h=>{const d=h.target.files[0];if(d)try{n(!0);const{file_url:m}=await ee.integrations.Core.UploadFile({file:d});t(p=>({...p,company_logo_url:m}))}catch(m){console.error("Logo upload error:",m),alert("LOGO上傳失敗")}finally{n(!1)}},f=h=>{h.preventDefault(),l.mutate(e)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(FL,{className:"w-8 h-8 cyber-text"}),a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"系統設定"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx(Az,{className:"w-6 h-6 text-[#00FFFF]"}),a.jsx("h2",{className:"text-xl font-semibold cyber-text",children:"公司基本資料"})]}),o?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):a.jsxs("form",{onSubmit:f,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"企業LOGO"}),a.jsxs("div",{className:"flex items-center gap-4",children:[e.company_logo_url&&a.jsx("div",{className:"w-24 h-24 border border-gray-700 rounded-lg overflow-hidden bg-white flex items-center justify-center",children:a.jsx("img",{src:e.company_logo_url,alt:"公司LOGO",className:"max-w-full max-h-full object-contain"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("input",{type:"file",accept:"image/*",onChange:c,className:"hidden",id:"logo-upload"}),a.jsx("label",{htmlFor:"logo-upload",className:"flex items-center gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-700 rounded cursor-pointer border border-gray-600 text-sm",children:r?a.jsx(a.Fragment,{children:"上傳中..."}):a.jsxs(a.Fragment,{children:[a.jsx(Hr,{className:"w-4 h-4"}),"上傳LOGO"]})}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"建議尺寸:200x200px,支援PNG/JPG格式"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"公司名稱 *"}),a.jsx(ne,{required:!0,value:e.company_name,onChange:h=>t({...e,company_name:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"統一編號"}),a.jsx(ne,{value:e.tax_id,onChange:h=>t({...e,tax_id:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"公司地址"}),a.jsx(ne,{value:e.address,onChange:h=>t({...e,address:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"聯絡電話"}),a.jsx(ne,{value:e.phone,onChange:h=>t({...e,phone:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"公司 Email"}),a.jsx(ne,{type:"email",value:e.email,onChange:h=>t({...e,email:h.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs(te,{type:"submit",disabled:l.isPending,className:"w-full bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Vd,{className:"w-4 h-4 mr-2"}),l.isPending?"儲存中...":"儲存公司資料"]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx(oi,{className:"w-6 h-6 text-[#00FFFF]"}),a.jsx("h2",{className:"text-xl font-semibold cyber-text",children:"系統參數"})]}),a.jsxs("form",{onSubmit:f,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"交付提
1503醒天數"}),a.jsx(ne,{type:"number",min:"1",value:e.notification_days,onChange:h=>t({...e,notification_days:parseInt(h.target.value)}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"}),a.jsx("p",{className:"text-xs text-gray-400",children:"系統會在里程碑預計交付日期前 N 天自動發送提醒通知"})]}),a.jsxs(te,{type:"submit",disabled:l.isPending,className:"w-full bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Vd,{className:"w-4 h-4 mr-2"}),l.isPending?"儲存中...":"儲存系統參數"]})]}),a.jsxs("div",{className:"mt-8 pt-6 border-t border-gray-700",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-400 mb-3",children:"系統資訊"}),a.jsxs("div",{className:"space-y-2 text-sm text-gray-500",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"系統名稱:"}),a.jsx("span",{className:"cyber-text",children:"無限未來管理系統"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"版本:"}),a.jsx("span",{className:"text-gray-300",children:"v1.0.0"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"平台:"}),a.jsx("span",{className:"text-gray-300",children:"Base44"})]})]})]})]})]}),a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg p-6",children:[a.jsx("h2",{className:"text-xl font-semibold cyber-text mb-4",children:"系統功能說明"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"border border-gray-700 rounded-lg p-4",children:[a.jsx("h3",{className:"font-semibold text-[#00FFFF] mb-2",children:"合約管理 (M1-M2)"}),a.jsxs("ul",{className:"text-sm text-gray-400 space-y-1",children:[a.jsx("li",{children:"• 合約 CRUD 操作"}),a.jsx("li",{children:"• OCR 文件智能提取"}),a.jsx("li",{children:"• 里程碑管理"}),a.jsx("li",{children:"• 交付驗收追蹤"})]})]}),a.jsxs("div",{className:"border border-gray-700 rounded-lg p-4",children:[a.jsx("h3",{className:"font-semibold text-[#00FFFF] mb-2",children:"財務管理 (M3)"}),a.jsxs("ul",{className:"text-sm text-gray-400 space-y-1",children:[a.jsx("li",{children:"• 請款單管理"}),a.jsx("li",{children:"• 收款記錄"}),a.jsx("li",{children:"• 應收帳齡分析"}),a.jsx("li",{children:"• 財務報表視覺化"})]})]}),a.jsxs("div",{className:"border border-gray-700 rounded-lg p-4",children:[a.jsx("h3",{className:"font-semibold text-[#00FFFF] mb-2",children:"客戶/員工 (M4-M5)"}),a.jsxs("ul",{className:"text-sm text-gray-400 space-y-1",children:[a.jsx("li",{children:"• 客戶資料管理"}),a.jsx("li",{children:"• 員工資料管理"}),a.jsx("li",{children:"• 權限角色控制"})]})]}),a.jsxs("div",{className:"border border-gray-700 rounded-lg p-4",children:[a.jsx("h3",{className:"font-semibold text-[#00FFFF] mb-2",children:"薪酬管理 (M8)"}),a.jsxs("ul",{className:"text-sm text-gray-400 space-y-1",children:[a.jsx("li",{children:"• 薪酬項目管理"}),a.jsx("li",{children:"• 支付進度追蹤"}),a.jsx("li",{children:"• 支付記錄"}),a.jsx("li",{children:"• 視覺化進度條"})]})]})]})]})]})}function H_e({task:e,onClose:t}){const[r,n]=I.useState({title:"",description:"",assigned_to:"",assigned_to_name:"",related_type:"general",related_id:"",related_name:"",due_date:"",status:"todo",priority:"medium",...e}),i=at(),{data:s=[]}=Te({queryKey:["employees"],queryFn:()=>ee.entities.User.list()}),{data:o=[]}=Te({queryKey:["contracts"],queryFn:()=>ee.entities.Contract.list()}),l=Ye({mutationFn:d=>e?ee.entities.Task.update(e.id,d):ee.entities.Task.create(d),onSuccess:d=>{i.invalidateQueries(["tasks"]);const m=!e,p=m?"新任務指派":"任務已更新",x=m?`已指派任務 "${d.title}" 給 ${d.assigned_to_name||d.assigned_to},截止日:${d.due_date}。`:`任務 "${d.title}" 已更新。`;ee.entities.Notification.create({title:p,message:x,type:"warning",link:"/Tasks",created_at:new Date().toISOString()}).catch(console.error),alert("儲存成功!"),t()}}),c=d=>{const m=s.find(p=>p.email===d);n({...r,assigned_to:d,assigned_to_name:m?m.full_name:""})},f=d=>{const m=o.find(p=>p.id===d);n({...r,related_id:d,related_name:m?m.project_name:""})},h=d=>{d.preventDefault(),l.mutate(r)};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"cyber-bg cyber-border rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 cyber-bg border-b border-gray-700 p-6 flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold cyber-text",children:e?"編輯任務":"新增任務"}),a.jsx("button",{onClick:t,className:"hover:bg-gray-800 p-2 rounded",children:a.jsx(vt,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:h,className:"p-6 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"任務標題 *"}),a.jsx(ne,{required:!0,value:r.title,onChange:d=>n({...r,title:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"任務描述"}),a.jsx(Pt,{value:r.description,onChange:d=>n({...r,description:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF] h-24"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"指派給"}),a.jsxs(qe,{value:r.assigned_to,onValueChange:c,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇員工"})}),a.jsx($e,{className:"bg-black border-gray-700",children:s.map(d=>a.jsxs(se,{value:d.email,className:"text-white",children:[d.full_name," 
1503(",d.email,")"]},d.id))})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"截止日期 *"}),a.jsx(ne,{type:"date",required:!0,value:r.due_date,onChange:d=>n({...r,due_date:d.target.value}),className:"bg-black border-gray-700 focus:border-[#00FFFF]"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"優先級"}),a.jsxs(qe,{value:r.priority,onValueChange:d=>n({...r,priority:d}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"low",className:"text-white",children:"低"}),a.jsx(se,{value:"medium",className:"text-white",children:"中"}),a.jsx(se,{value:"high",className:"text-white",children:"高"}),a.jsx(se,{value:"urgent",className:"text-white",children:"緊急"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"狀態"}),a.jsxs(qe,{value:r.status,onValueChange:d=>n({...r,status:d}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"todo",className:"text-white",children:"待辦"}),a.jsx(se,{value:"in_progress",className:"text-white",children:"進行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯類型"}),a.jsxs(qe,{value:r.related_type,onValueChange:d=>n({...r,related_type:d}),children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"general",className:"text-white",children:"一般"}),a.jsx(se,{value:"contract",className:"text-white",children:"合約"}),a.jsx(se,{value:"invoice",className:"text-white",children:"請款單"}),a.jsx(se,{value:"employee",className:"text-white",children:"員工"})]})]})]}),r.related_type==="contract"&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Q,{children:"關聯合約"}),a.jsxs(qe,{value:r.related_id,onValueChange:f,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"選擇合約"})}),a.jsx($e,{className:"bg-black border-gray-700",children:o.map(d=>a.jsxs(se,{value:d.id,className:"text-white",children:[d.contract_number," - ",d.project_name]},d.id))})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[a.jsx(te,{type:"button",variant:"outline",onClick:t,className:"bg-[#8B0000] text-white border-[#8B0000] hover:bg-[#660000]",children:"取消"}),a.jsx(te,{type:"submit",disabled:l.isPending,className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:l.isPending?"儲存中...":"儲存"})]})]})]})})}function V_e(){const[e,t]=I.useState(!1),[r,n]=I.useState(null),[i,s]=I.useState("all"),[o,l]=I.useState("all"),c=at(),{data:f=[],isLoading:h}=Te({queryKey:["tasks"],queryFn:()=>ee.entities.Task.list("-created_date")}),d=Ye({mutationFn:b=>ee.entities.Task.delete(b),onSuccess:()=>{c.invalidateQueries(["tasks"])}}),m=Ye({mutationFn:({id:b,data:w})=>ee.entities.Task.update(b,w),onSuccess:()=>{c.invalidateQueries(["tasks"])}}),p=f.filter(b=>{const w=i==="all"||b.status===i,_=o==="all"||b.priority===o;return w&&_}),x=b=>{switch(b){case"completed":return a.jsx(xr,{className:"w-5 h-5 text-green-400"});case"in_progress":return a.jsx(Ra,{className:"w-5 h-5 text-blue-400"});default:return a.jsx(oi,{className:"w-5 h-5 text-gray-400"})}},y=b=>{switch(b){case"urgent":return"#FF0000";case"high":return"#FF6347";case"medium":return"#FFD700";default:return"#808080"}},v=(b,w)=>{m.mutate({id:b.id,data:{...b,status:w,completed_date:w==="completed"?new Date().toISOString():null}})};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-3xl font-bold cyber-text",children:"任務管理"}),a.jsxs(te,{onClick:()=>{n(null),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] font-semibold",children:[a.jsx(Ct,{className:"w-5 h-5 mr-2"}),"新增任務"]})]}),a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-4",children:a.jsxs("div",{className:"flex gap-4",children:[a.jsxs(qe,{value:i,onValueChange:s,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"狀態篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有狀態"}),a.jsx(se,{value:"todo",className:"text-white",children:"待辦"}),a.jsx(se,{value:"in_progress",className:"text-white",children:"進行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"})]})]}),a.jsxs(qe,{value:o,onValueChange:l,children:[a.jsx(De,{className:"bg-black border-gray-700",children:a.jsx(Be,{placeholder:"優先級篩選"})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"all",className:"text-white",children:"所有優先級"}),a.jsx(se,{value:"urgent",className:"text-white",children:"緊急"}),a.jsx(se,{value:"high",className:"text-white",children:"高"}),a.jsx(se,{value:"medium",className:"text-white",children:"中"}),a.jsx(se,{value:"low",className:"text-white",children:"低"})]})]})]})}),a.jsx("div",{className:"grid grid-cols-1 gap-4",children:h?a.jsx("div",{className:"text-center py-12 text-gray-400",children:"載入中..."}):p.length===0?a.jsxs("div",{className:"text-center py-12 cyber-bg cyber-border rounded-lg",children:[a.jsx(oi,{className:"w-16 h-16 mx-auto mb-4 text-gray-600"}),a.jsx("p",{className:"text-gray-400",children:"尚無任務"})]}):p.map(b=>a.jsx("div",{className:"cyber-bg cyber-border rounded-lg p-6 hover-glow",children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{className:"flex items-start gap-4 flex-1",children:[x(b.status),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("h3",{className:"text-lg font-semibold cyber-text",children:b.title}),a.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-semibold",style:{backgroundColor:y(b.priority)+"33",color:y(b.priority),border:`1px solid ${y(b.priority)}`},children:b.priority==="urgent"?"緊急":b.priority==="high"?"高":b.priority==="medium"?"中":"低"})]}),b.description&&a.jsx("p",{className:"text-gray-400 text-sm mb-3",children:b.description}),a.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-gray-400",children:[b.assigned_to_name&&a.jsxs("span",{children:["指派給:",b.assigned_to_name]}),b.due_date&&a.jsxs("span",{children:["截止日期:",b.due_date]}),b.related_name&&a.jsxs("span",{children:["關聯:",b.related_name]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(qe,{value:b.status,onValueChange:w=>v(b,w),children:[a.jsx(De,{className:"bg-black border-gray-700 w-32",children:a.jsx(Be,{})}),a.jsxs($e,{className:"bg-black border-gray-700",children:[a.jsx(se,{value:"todo",className:"text-white",children:"待辦"}),a.jsx(se,{value:"in_progress",className:"text-white",children:"進行中"}),a.jsx(se,{value:"completed",className:"text-white",children:"已完成"})]})]}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{n(b),t(!0)},className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC] border-[#00FFFF]",children:a.jsx(qt,{className:"w-4 h-4"})}),a.jsx(te,{variant:"outline",size:"sm",onClick:()=>{window.confirm("確定要刪除此任務嗎?")&&d.mutate(b.id)},className:"bg-red-900 border-red-600 text-white hover:bg-red-800",children:a.jsx(Qt,{className:"w-4 h-4"})})]})]})},b.id))}),e&&a.jsx(H_e,{task:r,onClose:()=>{t(!1),n(null)}})]})}
1503function W_e(){const[e,t]=I.useState(!1),[r,n]=I.useState([{role:"assistant",content:"您好!我是您的 AI 智能助理。我可以協助您查詢系統資料或導引頁面。請問有什麼可以幫您的?"}]),[i,s]=I.useState(""),[o,l]=I.useState(!1),[c,f]=I.useState(null),h=I.useRef(null);I.useEffect(()=>{e&&!c&&m()},[e]),I.useEffect(()=>{d()},[r]);const d=()=>{var y;(y=h.current)==null||y.scrollIntoView({behavior:"smooth"})},m=async()=>{try{const[y,v,b,w,_,N,S,k,C,O,R,A,P,E,T,$]=await Promise.all([ee.entities.Contract.list("-created_date",20),ee.entities.Order.list("-created_date",20),ee.entities.Customer.list("-created_date",50),ee.entities.Task.list("-created_date",20),ee.entities.Quote.list("-created_date",20),ee.entities.Course.list("-created_date",20),ee.entities.Payroll.list("-created_date",20),ee.entities.SalaryPayment.list("-payment_date",20),ee.entities.User.list(),ee.entities.Invoice.list("-created_date",20),ee.entities.BusinessCard.list("-created_date",30).catch(()=>[]),ee.entities.CompanyDocument.list("-created_date",20).catch(()=>[]),ee.entities.Meeting.list("-created_date",20).catch(()=>[]),ee.entities.SoftwareInvoice.list("-created_date",20).catch(()=>[]),ee.entities.OnlineCourseSale.list("-created_date",20).catch(()=>[]),ee.entities.CourseRegistration.list("-created_date",30).catch(()=>[])]);f({contracts:y.map(D=>({id:D.id,number:D.contract_number,project:D.project_name,customer:D.customer_name,amount:D.total_amount,status:D.status,date:D.signing_date})),orders:v.map(D=>({id:D.id,number:D.order_number,project:D.project_name,customer:D.customer_name,amount:D.total_amount,status:D.status,date:D.order_date})),customers:b.map(D=>({id:D.id,name:D.customer_name,code:D.customer_code,contact:D.contact_person,phone:D.phone,email:D.email,address:D.address,tax_id:D.tax_id})),tasks:w.map(D=>({id:D.id,title:D.title,assigned_to:D.assigned_to_name||D.assigned_to,due:D.due_date,status:D.status})),quotes:_.map(D=>({id:D.id,number:D.quote_number,project:D.project_name,customer:D.customer_name,amount:D.total_amount,status:D.status,date:D.quote_date})),courses:N.map(D=>({id:D.id,name:D.course_name,type:D.course_type,enrolled:D.total_enrolled,revenue:D.total_revenue,cost:D.total_cost,profit:D.net_profit,status:D.status})),payrolls:S.map(D=>({id:D.id,employee:D.employee_name,project:D.project_name,amount:D.total_payroll_amount,paid:D.paid_amount,unpaid:D.unpaid_amount,status:D.status})),salaryPayments:k.map(D=>({id:D.id,employee:D.employee_name,amount:D.amount,date:D.payment_date,status:D.status})),employees:C.map(D=>({id:D.id,name:D.full_name,email:D.email,department:D.department,position:D.position,role:D.role})),invoices:O.map(D=>({id:D.id,number:D.invoice_number,type:D.invoice_type,project:D.related_name,customer:D.customer_name,amount:D.total_amount,status:D.status,date:D.issue_date})),businessCards:R.map(D=>({id:D.id,name:D.full_name,title:D.title,company:D.company_name,phone:D.phone,email:D.email})),companyDocs:A.map(D=>({id:D.id,name:D.document_name,type:D.document_type,date:D.upload_date})),meetings:P.map(D=>({id:D.id,title:D.meeting_title,type:D.meeting_type,organizer:D.organizer,start:D.start_time,status:D.status})),softwareInvoices:E.map(D=>({id:D.id,number:D.invoice_number,project:D.project_name,milestone:D.milestone_name,amount:D.invoice_amount,received:D.received_amount,outstanding:D.outstanding_amount,status:D.status})),onlineCourseSales:T.map(D=>({id:D.id,course:D.course_name,student:D.student_name,email:D.student_email,amount:D.purchase_amount,date:D.purchase_date,status:D.payment_status})),courseRegistrations:$.map(D=>({id:D.id,course:D.course_id,name:D.applicant_name,email:D.applicant_email,phone:D.phone_number,amount:D.payment_amount,status:D.payment_status})),dashboardStats:{totalContractValue:y.reduce((D,W)=>D+(W.total_amount||0),0),totalInvoiced:O.reduce((D,W)=>D+(W.total_amount||0),0),activeOrders:v.filter(D=>D.status==="in_progress").length,totalCustomers:b.length,activeEmployees:C.filter(D=>D.status==="active").length}})}catch(y){console.error("Failed to load context for AI",y)}},p=async y=>
1503{try{const{action:v,entity:b,id:w,data:_}=y;if(v==="create"){if(!ee.entities[b])throw new Error(`Entity ${b} not found`);return await ee.entities[b].create(_),await ee.entities.Notification.create({title:"AI 操作成功",message:`已成功建立 ${b}: ${JSON.stringify(_).substring(0,50)}...`,type:"success",created_at:new Date().toISOString()}),`✅ 成功建立 ${b}。`}if(v==="update"){if(!ee.entities[b])throw new Error(`Entity ${b} not found`);return await ee.entities[b].update(w,_),await ee.entities.Notification.create({title:"AI 操作成功",message:`已成功更新 ${b} (ID: ${w})`,type:"success",created_at:new Date().toISOString()}),`✅ 成功更新 ${b}。`}return"未知操作。"}catch(v){return console.error("Action Error:",v),`❌ 操作失敗: ${v.message}`}},x=async()=>{if(!i.trim())return;const y=i;n(v=>[...v,{role:"user",content:y}]),s(""),l(!0);try{const v=`
1504        你是一個企業管理系統的 AI 智能助理,擁有跨模組精準查詢能力。
1505        你的任務是協助使用者查詢資料、導航頁面,或執行資料管理操作 (CRUD)。
1506        
1507        目前系統的全方位資料摘要(包含完整關鍵欄位):
1508        - 【合約管理】 (Contracts): ${JSON.stringify((c==null?void 0:c.contracts)||[])}
1509        - 【訂單管理】 (Orders): ${JSON.stringify((c==null?void 0:c.orders)||[])}
1510        - 【報價管理】 (Quotes): ${JSON.stringify((c==null?void 0:c.quotes)||[])}
1511        - 【發票管理】 (Invoices): ${JSON.stringify((c==null?void 0:c.invoices)||[])}
1512        - 【軟體專案請款】 (Software Invoices): ${JSON.stringify((c==null?void 0:c.softw
1512areInvoices)||[])}
1513        - 【客戶管理】 (Customers - 含統編/地址): ${JSON.stringify((c==null?void 0:c.customers)||[])}
1514        - 【名片管理】 (Business Cards): ${JSON.stringify((c==null?void 0:c.businessCards)||[])}
1515        - 【公司文件管理】 (Company Documents): ${JSON.stringify((c==null?void 0:c.companyDocs)||[])}
1516        - 【會議管理】 (Meetings): ${JSON.stringify((c==null?void 0:c.meetings)||[])}
1517        - 【員工管理】 (Employees): ${JSON.stringify((c==null?void 0:c.employees)||[])}
1518        - 【課程專案管理】 (Courses): ${JSON.stringify((c==null?void 0:c.courses)||[])}
1519        - 【線上課程銷售】 (Online Sales): ${JSON.stringify((c==null?void 0:c.onlineCourseSales)||[])}
1520        - 【課程報名】 (Registrations): ${JSON.stringify((c==null?void 0:c.courseRegistrations)||[])}
1521        - 【薪酬管理】 (Payrolls): ${JSON.stringify((c==null?void 0:c.payrolls)||[])}
1522        - 【薪資支領】 (Salary Payments): ${JSON.stringify((c==null?void 0:c.salaryPayments)||[])}
1523        - 【任務管理】 (Tasks): ${JSON.stringify((c==null?void 0:c.tasks)||[])}
1524        - 【儀表板統計】: ${JSON.stringify((c==null?void 0:c.dashboardStats)||{})}
1525
1526        你的核心任務:
1527        1. 【精準跨模組資料查詢】: 
1528           - 根據使用者問題,從上述所有模組資料中提取精確答案
1529           - 客戶查詢特別注意:統一編號 (tax_id)、地址 (address)、聯絡人等完整資訊
1530           - 支援模糊搜尋:客戶名稱、專案名稱、員工姓名等
1531           - 支援金額計算:總計、平均值、統計分析等
1532           - 若資料不在摘要中,明確引導使用者至相關頁面
1533           
1534        2. 【精確頁面導航】: 
1535           - 合約管理: /Contracts
1536           - 訂單管理: /Orders
1537           - 報價管理: /Quotes
1538           - 發票管理: /InvoiceManagement
1539           - 軟體專案請款: /SoftwareProjectInvoicing
1540           - 客戶管理: /Customers
1541           - 名片管理: /BusinessCards
1542           - 公司文件管理: /CompanyDocuments
1543           - 會議管理: /Meetings
1544           - 員工管理: /Employees
1545           - 課程專案管理: /Courses
1546           - 線上課程銷售: /OnlineCourseSales
1547           - 薪酬管理: /Payroll
1548           - 薪資支領: /SalaryPayments
1549           - 任務管理: /Tasks
1550           - 員工績效: /EmployeePerformance
1551           - 系統日曆: /Calendar
1552           - 系統儀表板: /Dashboard
1553           
1554        3. 【資料管理 (CRUD)】: 若使用者要求操作,回傳純 JSON(不要 Markdown 格式)
1555           支援 Entity: Task, Order, Customer, Contract, Quote, Invoice, BusinessCard, Course, Meeting, Employee.
1556           - 建立: { "action": "create", "entity": "EntityName", "data": { ... } }
1557           - 更新: { "action": "update", "entity": "EntityName", "id": "TargetID", "data": { ... } }
1558
1559        回答原則:
1560        - 用繁體中文,專業且友善
1561        - 查詢回答需"精準"且"結構化",包含相關數據與來源模組
1562        - 使用 Markdown 連結格式導航,如 [前往客戶管理](/Customers)
1563        - 多筆結果時,整理為清單格式
1564        - 簡潔有力,避免冗長說明
1565
1566        請以專業高效的方式協助使用者。
1567      `,b=await ee.integrations.Core.InvokeLLM({prompt:`${v}
1568
1569使用者問: ${y}`,add_context_from_internet:!1});try{const w=b.replace(/```json/g,"").replace(/```/g,"").trim();if(w.startsWith("{")&&w.endsWith("}")){const _=JSON.parse(w);if(_.action){const N=await p(_);n(S=>[...S,{role:"assistant",content:N}]),m();return}}}catch{}n(w=>[...w,{role:"assistant",content:b}])}catch(v){console.error("AI Error:",v),n(b=>[...b,{role:"assistant",content:"抱歉,我現在無法連接到伺服器,請稍後再試。"}])}finally{l(!1)}};return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>t(!0),className:`fixed bottom-6 right-6 z-50 p-4 rounded-full bg-[#00FFFF] text-black shadow-[0_0_20px_rgba(0,255,255,0.5)] hover:bg-[#00CCCC] transition-all duration-300 ${e?"scale-0 opacity-0":"scale-100 opacity-100"}`,children:a.jsx(B2,{className:"w-8 h-8"})}),a.jsxs("div",{className:`fixed bottom-6 right-6 z-50 w-96 h-[500px] flex flex-col cyber-bg cyber-border rounded-lg shadow-2xl transition-all duration-300 transform origin-bottom-right ${e?"scale-100 opacity-100":"scale-0 opacity-0 pointer-events-none"}`,children:[a.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-700 bg-gray-900 rounded-t-lg",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(B2,{className:"w-5 h-5 text-[#00FFFF]"}),a.jsx("h3",{className:"font-bold cyber-text",children:"AI 智能助理"})]}),a.jsx("button",{onClick:()=>t(!1),className:"text-gray-400 hover:text-white",children:a.jsx(vU,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 bg-black/50",children:[r.map((y,v)=>a.jsx("div",{className:`flex ${y.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[85%] rounded-lg p-3 text-sm leading-relaxed ${y.role==="user"?"bg-[#00FFFF] text-black font-medium":"bg-gray-800 text-gray-200 border border-gray-700"}`,children:a.jsx(w_e,{components:{a:({node:b,...w})=>a.jsx("a",{...w,className:"text-blue-400 hover:underline",target:"_self"})},children:y.content})})},v)),o&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-gray-800 rounded-lg p-3 border border-gray-700",children:a.jsx(Ht,{className:"w-5 h-5 text-[#00FFFF] animate-spin"})})}),a.jsx("div",{ref:h})]}),a.jsx("div",{className:"p-4 border-t border-gray-700 bg-gray-900 rounded-b-lg",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx(ne,{value:i,onChange:y=>s(y.target.value),onKeyDown:y=>y.key==="Enter"&&!y.shiftKey&&x(),placeholder:"輸入問題或關鍵字...",className:"bg-black border-gray-700 focus:border-[#00FFFF] text-white"}),a.jsx(te,{onClick:x,disabled:o||!i.trim(),className:"bg-[#00FFFF] text-black hover:bg-[#00CCCC]",children:a.jsx(Wi,{className:"w-4 h-4"})})]})})]})]})}function K_e({children:e,currentPageName:t}){const[r,n]=I.useState(null),[i,s]=I.useState(!0),[o,l]=I.useState(!1),[c,f]=I.use
1569State(null),[h,d]=I.useState({軟體專案管理:!0,課程專案管理:!0,薪酬管理:!0,系統管理:!0,一般:!0}),m=C=>{d(O=>({...O,[C]:!O[C]}))},p=async()=>{try{const C=await ee.auth.me();n(C)}catch(C){console.error("Failed to load user:",C)}},x=async()=>{try{const C=await ee.entities.CompanySetting.list();C.length>0&&C[0].company_logo_url&&f(C[0].company_logo_url)}catch(C){console.error("Failed to load company settings:",C)}};I.useEffect(()=>{p(),x()},[]);const{data:y=[]}=Te({queryKey:["notifications","unread"],queryFn:()=>ee.entities.Notification.list(),refetchInterval:3e4}),v=y.filter(C=>!C.is_read).length,b=async()=>{await ee.auth.logout()};if(t==="PublicRegistration")return a.jsx("div",{className:"min-h-screen bg-gray-100",children:e});if(t==="OnlineSign")return a.jsx("div",{className:"min-h-screen bg-black",children:e});const N=[{title:"一般",items:[{name:"Dashboard",icon:Nm,page:"Dashboard",roles:["admin"]},{name:"事件日曆",icon:Nm,page:"Calendar",roles:["admin"]},{name:"客戶管理",icon:Xr,page:"Customers",roles:["admin"]},{name:"名片管理",icon:SL,page:"BusinessCards",roles:["admin"]},{name:"發票管理",icon:Et,page:"InvoiceManagement",roles:["admin"]},{name:"公司文件管理",icon:Et,page:"CompanyDocuments",roles:["admin"]},{name:"會議管理",icon:Nm,page:"Meetings",roles:["admin"]},{name:"LINE AI客服管理系統",icon:gU,externalUrl:"https://lineservdash-yad2nhcr.manus.space/",roles:["admin"],iconColor:"#00B900"},{name:"帳款管理",icon:Rd,page:"AccountsManagement",roles:["admin"],iconColor:"#FFD700"},{name:"全球智匯網",icon:Et,externalUrl:"https://gib.esunbank.com/",roles:["admin"],iconColor:"#0088FF"},{name:"電子發票加值中心",icon:Et,externalUrl:"https://www.giveme.com.tw/pages/invoice/login.jsp",roles:["admin"],iconColor:"#32CD32"},{name:"合約審閱系統",icon:Et,externalUrl:"https://contractrev-nef5ned2.manus.space/",roles:["admin"],iconColor:"#FF8C00"},{name:"AI記帳系統",icon:ut,externalUrl:"https://infinite-future-ledger.lovable.app/auth",roles:["admin"],iconColor:"#10B981"}]},...[{title:"軟體專案管理",items:[{name:"敏捷開發管理",icon:QU,externalUrl:"https://mellow-work-stream.lovable.app/login",roles:["admin"],iconColor:"#FFD700"},{name:"報告中心",icon:Et,page:"Reports",roles:["admin"]},{name:"報價管理",icon:Et,page:"Quotes",roles:["admin"],iconColor:"#00FFFF"},{name:"訂單管理",icon:Et,page:"Orders",roles:["admin"]},{name:"合約管理",icon:Et,page:"Contracts",roles:["admin"]},{name:"線上簽約",icon:wU,page:"ESignature",roles:["admin"]},{name:"任務管理",icon:Nm,page:"Tasks",roles:["admin"]},{name:"軟體專案請款",icon:ut,page:"SoftwareProjectInvoicing",roles:["admin"]}]},{title:"課程專案管理",items:[{name:"課程專案管理",icon:rp,page:"Courses",roles:["admin"]},{name:"企業培訓專案管理",icon:Xr,page:"CorporateTraining",roles:["admin"]},{name:"線上課程銷售管理",icon:CL,page:"OnlineCourseSales",roles:["admin"]},{name:"企業培訓專案請款",icon:ut,page:"CourseProjectInvoicing",roles:["admin"]},{name:"課程專案收款管理",icon:ut,page:"CoursePaymentManagement",roles:["admin"]}]},{title:"薪酬管理",items:[{name:"員工績效管理",icon:Xr,page:"EmployeePerformance",roles:["admin"]},{name:"薪酬管理",icon:Rd,page:"Payroll",roles:["admin"]},{name:"薪資支領",icon:Rd,page:"SalaryPayments",roles:["admin"]},{name:"講師費付款管理",icon:ut,page:"InstructorPayments",roles:["admin"]}]},{title:"系統管理",items:[{name:"系統帳戶管理",icon:Xr,page:"SystemAccountManagement",roles:["admin"]},{name:"員工管理",icon:Xr,page:"Employees",roles:["admin"]},{name:"系統設定",icon:FL,page:"SystemSettings",roles:["admin"]}]}]],S=(r==null?void 0:r.system_role)||(r==null?void 0:r.role);return r&&S!=="admin"&&t!=="PublicRegistration"?(window.location.href=Ur("PublicRegistration"),null):a.jsxs("div",{className:"min-h-screen bg-black text-gray-100",children:[a.jsx("style",{children:`
1570        :root {
1571          --cyber-blue: #00FFFF;
1572          --cyber-blue-glow: rgba(0, 255, 255, 0.3);
1573          --dark-bg: #000000;
1574          --dark-panel: #0a0a0a;
1575          --border-glow: rgba(0, 255, 255, 0.2);
1576        }
1577        
1578        .cyber-border {
1579          border: 1px solid var(--border-glow);
1580          box-shadow: 0 0 10px var(--cyber-blue-glow);
1581        }
1582        
1583        .cyber-text {
1584          color: var(--cyber-blue);
1585          text-shadow: 0 0 10px var(--cyber-blue-glow);
1586        }
1587        
1588        .cyber-bg {
1589          background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
1590        }
1591        
1592        .grid-background {
1593          background-image: 
1594            linear-gradient(var(--border-glow) 1px, transparent 1px),
1595            linear-gradient(90deg, var(--border-glow) 1px, transparent 1px);
1596          background-size: 50px 50px;
1597        }
1598        
1599        .hover-glow:hover {
1600          box-shadow: 0 0 20px var(--cyber-blue-glow);
1601          border-color: var(--cyber-blue);
1602          transition: all 0.3s ease;
1603        }
1604
1605        .nav-link {
1606          transition: all 0.3s ease;
1607        }
1608        
1609        .nav-link:hover {
1610          background: rgba(0, 255, 255, 0.1);
1611          border-left: 3px solid var(--cyber-blue);
1612        }
1613        
1614        .nav-link.active {
1615          background: rgba(0, 255, 255, 0.15);
1616          border-left: 3px solid var(--cyber-blue);
1617        }
1618      `}),a.jsx("div",{className:"fixed top-0 left-0 right-0 h-16 bg-black cyber-border z-50",children:a.jsxs("div",{className:"flex items-center justify-between h-full px-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>s(!i),className:"p-2 hover:bg-gray-900 rounded hidden lg:block",children:a.jsx(q2,{className:"w-6 h-6 cyber-text"})}),a.jsx("button",{onClick:()=>l(!o),className:"p-2 hover:bg-gray-900 rounded lg:hidden",children:o?a.jsx(vt,{className:"w-6 h-6 cyber-text"}):a.jsx(q2,{className:"w-6 h-6 cyber-text"})}),a.jsxs("div",{className:"flex items-center gap-3",children:[c&&a.jsx("div",{className:"w-8 h-8 flex items-center justify-center bg-white rounded overflow-hidden",children:a.jsx("img",{src:c,alt:"公司
1618LOGO",className:"max-w-full max-h-full object-contain"})}),a.jsx("h1",{className:"text-xl font-bold cyber-text tracking-wider",children:"無限未來管理系統"})]})]}),r&&a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(qi,{to:Ur("Notifications"),className:"relative p-2 hover:bg-gray-900 rounded text-gray-300 hover:text-[#00FFFF] transition-colors",children:[a.jsx(vp,{className:"w-6 h-6"}),v>0&&a.jsx("span",{className:"absolute top-1 right-1 w-4 h-4 bg-red-500 text-white text-[10px] font-bold flex items-center justify-center rounded-full",children:v>9?"9+":v})]}),a.jsxs("div",{className:"text-right hidden md:block",children:[a.jsx("div",{className:"text-sm cyber-text",children:r.full_name}),a.jsx("div",{className:"text-xs text-gray-500",children:r.email})]}),a.jsxs("button",{onClick:b,className:"flex items-center gap-2 px-4 py-2 bg-gray-900 hover:bg-gray-800 rounded cyber-border hover-glow",children:[a.jsx(uU,{className:"w-4 h-4"}),a.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]})}),a.jsx("div",{className:`hidden lg:block fixed left-0 top-16 bottom-0 bg-black cyber-border transition-all duration-300 ${i?"w-64":"w-0"} overflow-hidden z-40`,children:a.jsx("nav",{className:"p-4 pb-16 space-y-6 overflow-y-auto max-h-[calc(100vh-4rem)]",children:N.map((C,O)=>{const R=(r==null?void 0:r.system_role)||((r==null?void 0:r.role)==="admin"?"admin":"reader"),A=C.items.filter(E=>!r||E.roles.includes(R));if(A.length===0)return null;const P=h[C.title];return a.jsxs("div",{className:"space-y-1",children:[a.jsxs("button",{onClick:()=>m(C.title),className:"w-full px-4 py-2 flex items-center justify-between text-xs font-semibold text-gray-500 uppercase tracking-wider hover:text-white transition-colors",children:[a.jsx("span",{children:C.title}),a.jsx(bp,{className:`w-4 h-4 transition-transform duration-200 ${P?"transform rotate-180":""}`})]}),a.jsx("div",{className:`space-y-1 overflow-hidden transition-all duration-300 ${P?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"}`,children:A.map((E,T)=>E.externalUrl?a.jsxs("a",{href:E.externalUrl,target:"_blank",rel:"noopener noreferrer",className:"nav-link flex items-center gap-3 px-4 py-2 rounded text-sm text-gray-300 hover:text-white",children:[a.jsx(E.icon,{className:"w-4 h-4 cyber-text",style:E.iconColor?{color:E.iconColor}:{}}),a.jsx("span",{children:E.name})]},T):a.jsxs(qi,{to:Ur(E.page),className:`nav-link flex items-center gap-3 px-4 py-2 rounded text-sm ${t===E.page?"active":"text-gray-300 hover:text-white"}`,children:[a.jsx(E.icon,{className:"w-4 h-4 cyber-text",style:E.iconColor?{color:E.iconColor}:{}}),a.jsx("span",{children:E.name})]},E.page))})]},O)})})}),o&&a.jsx("div",{className:"lg:hidden fixed inset-0 top-16 bg-black cyber-border z-40 overflow-y-auto",children:a.jsx("nav",{className:"p-4 space-y-6",children:N.map((C,O)=>{const R=(r==null?void 0:r.system_role)||((r==null?void 0:r.role)==="admin"?"admin":"reader"),A=C.items.filter(E=>!r||E.roles.includes(R));if(A.length===0)return null;const P=h[C.title];return a.jsxs("div",{className:"space-y-1",children:[a.jsxs("button",{onClick:()=>m(C.title),className:"w-full px-4 py-2 flex items-center justify-between text-xs font-semibold text-gray-500 uppercase tracking-wider hover:text-white transition-colors",children:[a.jsx("span",{children:C.title}),a.jsx(bp,{className:`w-4 h-4 transition-transform duration-200 ${P?"transform rotate-180":""}`})]}),a.jsx("div",{className:`space-y-1 overflow-hidden transition-all duration-300 ${P?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"}`,children:A.map((E,T)=>E.externalUrl?a.jsxs("a",{href:E.externalUrl,target:"_blank",rel:"noopener noreferrer",onClick:()=>l(!1),className:"nav-link flex items-center gap-3 px-4 py-2 rounded text-sm text-gray-300 hover:text-white",children:[a.jsx(E.icon,{className:"w-4 h-4 cyber-text",style:E.iconColor?{color:E.iconColor}:{}}),a.jsx("span",{children:E.name})]},T):a.jsxs(qi,{to:Ur(E.page),onClick:()=>l(!1),className:`nav-link flex items-center gap-3 px-4 py-2 rounded text-sm ${t===E.page?"active":"text-gray-300 hover:text-white"}`,children:[a.jsx(E.icon,{className:"w-4 h-4 cyber-text",style:E.iconColor?{color:E.iconColor}:{}}),a.jsx("span",{children:E.name})]},E.page))})]},O)})})}),a.jsx("div",{className:`transition-all duration-300 pt-16 ${i?"lg:ml-64":"lg:ml-0"}`,children:a.jsx("div",{className:"p-4 md:p-6 lg:p-8 grid-background min-h-[calc(100vh-4rem)]",children:e})}),a.jsx(W_e,{})]})}const G_e={AccountsManagement:pme,BusinessCards:jme,Calendar:qye,CompanyDocuments:Bye,Contracts:Hye,CorporateTraining:Gye,CoursePaymentManagement:Yye,CourseProjectInvoicing:Jye,CourseRegistrationBuilder:ave,CourseRegistrationManagement:Sve,Courses:Eve,Customers:Tve,Dashboard:Ave,ESignature:Lve,EmployeePerformance:Dve,Employees:qve,Home:Bve,Instru
1618ctorPayments:Hve,InvoiceManagement:Wve,MeetingInvite:Kve,Meetings:Yve,Notifications:Qve,OnlineCourseSales:Zve,OnlineSign:e0e,Orders:n0e,Payroll:i0e,PublicRegistration:k_e,Quotes:O_e,Reports:R_e,SalaryPayments:M_e,SoftwareProjectInvoicing:$_e,SystemAccountManagement:z_e,SystemSettings:U_e,Tasks:V_e},hB={mainPage:"Dashboard",Pages:G_e,Layout:K_e};function Y_e(){const e=cl(),{isAuthenticated:t}=o3(),{Pages:r,mainPage:n}=hB,i=n;return I.useEffect(()=>{var s;(s=window.parent)==null||s.postMessage({type:"app_changed_url",url:window.location.href},"*")},[e]),I.useEffect(()=>{const s=e.pathname;let o;if(s==="/"||s==="")o=i;else{const l=s.replace(/^\//,"").split("/")[0];o=Object.keys(r).find(h=>h.toLowerCase()===l.toLowerCase())||null}t&&o&&ee.appLogs.logUserInApp(o).catch(()=>{})},[e,t,r,i]),null}function Q_e({}){var i;const t=cl().pathname.substring(1),{data:r,isFetched:n}=Te({queryKey:["user"],queryFn:async()=>{try{return{user:await ee.auth.me(),isAuthenticated:!0}}catch{return{user:null,isAuthenticated:!1}}}});return a.jsx("div",{className:"min-h-screen flex items-center justify-center p-6 bg-slate-50",children:a.jsx("div",{className:"max-w-md w-full",children:a.jsxs("div",{className:"text-center space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("h1",{className:"text-7xl font-light text-slate-300",children:"404"}),a.jsx("div",{className:"h-0.5 w-16 bg-slate-200 mx-auto"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("h2",{className:"text-2xl font-medium text-slate-800",children:"Page Not Found"}),a.jsxs("p",{className:"text-slate-600 leading-relaxed",children:["The page ",a.jsxs("span",{className:"font-medium text-slate-700",children:['"',t,'"']})," could not be found in this application."]})]}),n&&r.isAuthenticated&&((i=r.user)==null?void 0:i.role)==="admin"&&a.jsx("div",{className:"mt-8 p-4 bg-slate-100 rounded-lg border border-slate-200",children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-orange-100 flex items-center justify-center mt-0.5",children:a.jsx("div",{className:"w-2 h-2 rounded-full bg-orange-400"})}),a.jsxs("div",{className:"text-left space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-slate-700",children:"Admin Note"}),a.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:"This could mean that the AI hasn't implemented this page yet. Ask it to implement it in the chat."})]})]})}),a.jsx("div",{className:"pt-6",children:a.jsxs("button",{onClick:()=>window.location.href="/",className:"inline-flex items-center px-4 py-2 text-sm font-medium text-slate-700 bg-white border border-slate-200 rounded-lg hover:bg-slate-50 hover:border-slate-300 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-slate-500",children:[a.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),"Go Home"]})})]})})})}const X_e=()=>a.jsx("div",{className:"flex flex-col items-center justify-center min-h-screen bg-gradient-to-b from-white to-slate-50",children:a.jsx("div",{className:"max-w-md w-full p-8 bg-white rounded-lg shadow-lg border border-slate-100",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-6 rounded-full bg-orange-100",children:a.jsx("svg",{className:"w-8 h-8 text-orange-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),a.jsx("h1",{className:"text-3xl font-bold text-slate-900 mb-4",children:"Access Restricted"}),a.jsx("p",{className:"text-slate-600 mb-8",children:"You are not registered to use this application. Please contact the app administrator to request access."}),a.jsxs("div",{className:"p-4 bg-slate-50 rounded-md text-sm text-slate-600",children:[a.jsx("p",{children:"If you believe this is an error, you can:"}),a.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[a.jsx("li",{children:"Verify you are logged in with the correct account"}),a.jsx("li",{children:"Contact the app administrator for access"}),a.jsx("li",{children:"Try logging out and back in again"})]})]})]})})}),{Pages:mB,Layout:uL,mainPage:Z_e}=hB,pB=Z_e,J_e=mB[pB],dL=({children:e,currentPageName:t})=>uL?a.jsx(uL,{currentPageName:t,children:e}):a.jsx(a.Fragment,{children:e}),eje=()=>{const{isLoadingAuth:e,isLoadingPublicSettings:t,authError:r,isAuthenticated:n,navigateToLogin:i}=o3();if(t||e)return a.jsx("div",{className:"fixed inset-0 flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-slate-800 rounded-full animate-spin"})});if(r){if(r.type==="user_not_registered")return a.jsx(X_e,{});if(r.type==="auth_required")return i(),null}return a.jsxs(dV,{children:[a.jsx(ap,{path:"/",element:a.jsx(dL,{currentPageName:pB,children:a.jsx(J_e,{})})}),Object.entries(mB).map(([s,o])=>a.jsx(ap,{path:`/${s}`,element:a.jsx(dL,{currentPageName:s,children:a.jsx(o,{})})},s)),a.jsx(ap,{path:"*",element:a.jsx(Q_e,{})})]})};function tje(){return a.jsx(sY,{children:a.jsxs(sH,{client:vH,children:[a.jsxs(xV,{children:[a.jsx(Y_e,{}),a.jsx(eje,{})]}),a.jsx(M9,{}),a.jsx(xH,{})]})})}xz.createRoot(document.getElementById("root")).render(a.jsx(tje,{}));

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.