2026-06-11 19:56:20 +05:30

1679 lines
1.9 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var Dz=Object.defineProperty,Rz=Object.defineProperties;var Fz=Object.getOwnPropertyDescriptors;var km=Object.getOwnPropertySymbols;var iC=Object.prototype.hasOwnProperty,oC=Object.prototype.propertyIsEnumerable;var fc=Math.pow,ub=(e,t,r)=>t in e?Dz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ee=(e,t)=>{for(var r in t||(t={}))iC.call(t,r)&&ub(e,r,t[r]);if(km)for(var r of km(t))oC.call(t,r)&&ub(e,r,t[r]);return e},Se=(e,t)=>Rz(e,Fz(t));var ti=(e,t)=>{var r={};for(var a in e)iC.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&km)for(var a of km(e))t.indexOf(a)<0&&oC.call(e,a)&&(r[a]=e[a]);return r};var Mz=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var xn=(e,t,r)=>ub(e,typeof t!="symbol"?t+"":t,r);var fe=(e,t,r)=>new Promise((a,s)=>{var i=d=>{try{u(r.next(d))}catch(f){s(f)}},l=d=>{try{u(r.throw(d))}catch(f){s(f)}},u=d=>d.done?a(d.value):Promise.resolve(d.value).then(i,l);u((r=r.apply(e,t)).next())});var nbe=Mz(Ge=>{function Lz(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(a,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>a[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var lC=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function zl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var db={exports:{}},pf={};var cC;function Iz(){if(cC)return pf;cC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var u in s)u!=="key"&&(i[u]=s[u])}else i=s;return s=i.ref,{$$typeof:e,type:a,key:l,ref:s!==void 0?s:null,props:i}}return pf.Fragment=t,pf.jsx=r,pf.jsxs=r,pf}var uC;function zz(){return uC||(uC=1,db.exports=Iz()),db.exports}var n=zz(),fb={exports:{}},Nt={};var dC;function Bz(){if(dC)return Nt;dC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),x=Symbol.iterator;function v(oe){return oe===null||typeof oe!="object"?null:(oe=x&&oe[x]||oe["@@iterator"],typeof oe=="function"?oe:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,j={};function k(oe,L,H){this.props=oe,this.context=L,this.refs=j,this.updater=H||b}k.prototype.isReactComponent={},k.prototype.setState=function(oe,L){if(typeof oe!="object"&&typeof oe!="function"&&oe!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,oe,L,"setState")},k.prototype.forceUpdate=function(oe){this.updater.enqueueForceUpdate(this,oe,"forceUpdate")};function C(){}C.prototype=k.prototype;function N(oe,L,H){this.props=oe,this.context=L,this.refs=j,this.updater=H||b}var O=N.prototype=new C;O.constructor=N,w(O,k.prototype),O.isPureReactComponent=!0;var E=Array.isArray;function A(){}var T={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function D(oe,L,H){var K=H.ref;return{$$typeof:e,type:oe,key:L,ref:K!==void 0?K:null,props:H}}function z(oe,L){return D(oe.type,L,oe.props)}function G(oe){return typeof oe=="object"&&oe!==null&&oe.$$typeof===e}function V(oe){var L={"=":"=0",":":"=2"};return"$"+oe.replace(/[=:]/g,function(H){return L[H]})}var ne=/\/+/g;function ge(oe,L){return typeof oe=="object"&&oe!==null&&oe.key!=null?V(""+oe.key):L.toString(36)}function Z(oe){switch(oe.status){case"fulfilled":return oe.value;case"rejected":throw oe.reason;default:switch(typeof oe.status=="string"?oe.then(A,A):(oe.status="pending",oe.then(function(L){oe.status==="pending"&&(oe.status="fulfilled",oe.value=L)},function(L){oe.status==="pending"&&(oe.status="rejected",oe.reason=L)})),oe.status){case"fulfilled":return oe.value;case"rejected":throw oe.reason}}throw oe}function U(oe,L,H,K,Y){var re=typeof oe;(re==="undefined"||re==="boolean")&&(oe=null);var de=!1;if(oe===null)de=!0;else switch(re){case"bigint":case"string":case"number":de=!0;break;case"object":switch(oe.$$typeof){case e:case t:de=!0;break;case p:return de=oe._init,U(de(oe._payload),L,H,K,Y)}}if(de)return Y=Y(oe),de=K===""?"."+ge(oe,0):K,E(Y)?(H="",de!=null&&(H=de.replace(ne,"$&/")+"/"),U(Y,L,H,"",function(he){return he})):Y!=null&&(G(Y)&&(Y=z(Y,H+(Y.key==null||oe&&oe.key===Y.key?"":(""+Y.key).replace(ne,"$&/")+"/")+de)),L.push(Y)),1;de=0;var ie=K===""?".":K+":";if(E(oe))for(var se=0;se<oe.length;se++)K=oe[se],re=ie+ge(K,se),de+=U(K,L,H,re,Y);else if(se=v(oe),typeof se=="function")for(oe=se.call(oe),se=0;!(K=oe.next()).done;)K=K.value,re=ie+ge(K,se++),de+=U(K,L,H,re,Y);else if(re==="object"){if(typeof oe.then=="function")return U(Z(oe),L,H,K,Y);throw L=String(oe),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(oe).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return de}function ce(oe,L,H){if(oe==null)return oe;var K=[],Y=0;return U(oe,K,"","",function(re){return L.call(H,re,Y++)}),K}function xe(oe){if(oe._status===-1){var L=oe._result;L=L(),L.then(function(H){(oe._status===0||oe._status===-1)&&(oe._status=1,oe._result=H)},function(H){(oe._status===0||oe._status===-1)&&(oe._status=2,oe._result=H)}),oe._status===-1&&(oe._status=0,oe._result=L)}if(oe._status===1)return oe._result.default;throw oe._result}var be=typeof reportError=="function"?reportError:function(oe){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof oe=="object"&&oe!==null&&typeof oe.message=="string"?String(oe.message):String(oe),error:oe});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",oe);return}console.error(oe)},me={map:ce,forEach:function(oe,L,H){ce(oe,function(){L.apply(this,arguments)},H)},count:function(oe){var L=0;return ce(oe,function(){L++}),L},toArray:function(oe){return ce(oe,function(L){return L})||[]},only:function(oe){if(!G(oe))throw Error("React.Children.only expected to receive a single React element child.");return oe}};return Nt.Activity=m,Nt.Children=me,Nt.Component=k,Nt.Fragment=r,Nt.Profiler=s,Nt.PureComponent=N,Nt.StrictMode=a,Nt.Suspense=d,Nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Nt.__COMPILER_RUNTIME={__proto__:null,c:function(oe){return T.H.useMemoCache(oe)}},Nt.cache=function(oe){return function(){return oe.apply(null,arguments)}},Nt.cacheSignal=function(){return null},Nt.cloneElement=function(oe,L,H){if(oe==null)throw Error("The argument must be a React element, but you passed "+oe+".");var K=w({},oe.props),Y=oe.key;if(L!=null)for(re in L.key!==void 0&&(Y=""+L.key),L)!P.call(L,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&L.ref===void 0||(K[re]=L[re]);var re=arguments.length-2;if(re===1)K.children=H;else if(1<re){for(var de=Array(re),ie=0;ie<re;ie++)de[ie]=arguments[ie+2];K.children=de}return D(oe.type,Y,K)},Nt.createContext=function(oe){return oe={$$typeof:l,_currentValue:oe,_currentValue2:oe,_threadCount:0,Provider:null,Consumer:null},oe.Provider=oe,oe.Consumer={$$typeof:i,_context:oe},oe},Nt.createElement=function(oe,L,H){var K,Y={},re=null;if(L!=null)for(K in L.key!==void 0&&(re=""+L.key),L)P.call(L,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(Y[K]=L[K]);var de=arguments.length-2;if(de===1)Y.children=H;else if(1<de){for(var ie=Array(de),se=0;se<de;se++)ie[se]=arguments[se+2];Y.children=ie}if(oe&&oe.defaultProps)for(K in de=oe.defaultProps,de)Y[K]===void 0&&(Y[K]=de[K]);return D(oe,re,Y)},Nt.createRef=function(){return{current:null}},Nt.forwardRef=function(oe){return{$$typeof:u,render:oe}},Nt.isValidElement=G,Nt.lazy=function(oe){return{$$typeof:p,_payload:{_status:-1,_result:oe},_init:xe}},Nt.memo=function(oe,L){return{$$typeof:f,type:oe,compare:L===void 0?null:L}},Nt.startTransition=function(oe){var L=T.T,H={};T.T=H;try{var K=oe(),Y=T.S;Y!==null&&Y(H,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(A,be)}catch(re){be(re)}finally{L!==null&&H.types!==null&&(L.types=H.types),T.T=L}},Nt.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Nt.use=function(oe){return T.H.use(oe)},Nt.useActionState=function(oe,L,H){return T.H.useActionState(oe,L,H)},Nt.useCallback=function(oe,L){return T.H.useCallback(oe,L)},Nt.useContext=function(oe){return T.H.useContext(oe)},Nt.useDebugValue=function(){},Nt.useDeferredValue=function(oe,L){return T.H.useDeferredValue(oe,L)},Nt.useEffect=function(oe,L){return T.H.useEffect(oe,L)},Nt.useEffectEvent=function(oe){return T.H.useEffectEvent(oe)},Nt.useId=function(){return T.H.useId()},Nt.useImperativeHandle=function(oe,L,H){return T.H.useImperativeHandle(oe,L,H)},Nt.useInsertionEffect=function(oe,L){return T.H.useInsertionEffect(oe,L)},Nt.useLayoutEffect=function(oe,L){return T.H.useLayoutEffect(oe,L)},Nt.useMemo=function(oe,L){return T.H.useMemo(oe,L)},Nt.useOptimistic=function(oe,L){return T.H.useOptimistic(oe,L)},Nt.useReducer=function(oe,L,H){return T.H.useReducer(oe,L,H)},Nt.useRef=function(oe){return T.H.useRef(oe)},Nt.useState=function(oe){return T.H.useState(oe)},Nt.useSyncExternalStore=function(oe,L,H){return T.H.useSyncExternalStore(oe,L,H)},Nt.useTransition=function(){return T.H.useTransition()},Nt.version="19.2.7",Nt}var fC;function o0(){return fC||(fC=1,fb.exports=Bz()),fb.exports}var y=o0();const _t=zl(y),$z=Lz({__proto__:null,default:_t},[y]);var hb={exports:{}},mf={},pb={exports:{}},mb={};var hC;function Uz(){return hC||(hC=1,(function(e){function t(U,ce){var xe=U.length;U.push(ce);e:for(;0<xe;){var be=xe-1>>>1,me=U[be];if(0<s(me,ce))U[be]=ce,U[xe]=me,xe=be;else break e}}function r(U){return U.length===0?null:U[0]}function a(U){if(U.length===0)return null;var ce=U[0],xe=U.pop();if(xe!==ce){U[0]=xe;e:for(var be=0,me=U.length,oe=me>>>1;be<oe;){var L=2*(be+1)-1,H=U[L],K=L+1,Y=U[K];if(0>s(H,xe))K<me&&0>s(Y,H)?(U[be]=Y,U[K]=xe,be=K):(U[be]=H,U[L]=xe,be=L);else if(K<me&&0>s(Y,xe))U[be]=Y,U[K]=xe,be=K;else break e}}return ce}function s(U,ce){var xe=U.sortIndex-ce.sortIndex;return xe!==0?xe:U.id-ce.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],p=1,m=null,x=3,v=!1,b=!1,w=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate!="undefined"?setImmediate:null;function O(U){for(var ce=r(f);ce!==null;){if(ce.callback===null)a(f);else if(ce.startTime<=U)a(f),ce.sortIndex=ce.expirationTime,t(d,ce);else break;ce=r(f)}}function E(U){if(w=!1,O(U),!b)if(r(d)!==null)b=!0,A||(A=!0,V());else{var ce=r(f);ce!==null&&Z(E,ce.startTime-U)}}var A=!1,T=-1,P=5,D=-1;function z(){return j?!0:!(e.unstable_now()-D<P)}function G(){if(j=!1,A){var U=e.unstable_now();D=U;var ce=!0;try{e:{b=!1,w&&(w=!1,C(T),T=-1),v=!0;var xe=x;try{t:{for(O(U),m=r(d);m!==null&&!(m.expirationTime>U&&z());){var be=m.callback;if(typeof be=="function"){m.callback=null,x=m.priorityLevel;var me=be(m.expirationTime<=U);if(U=e.unstable_now(),typeof me=="function"){m.callback=me,O(U),ce=!0;break t}m===r(d)&&a(d),O(U)}else a(d);m=r(d)}if(m!==null)ce=!0;else{var oe=r(f);oe!==null&&Z(E,oe.startTime-U),ce=!1}}break e}finally{m=null,x=xe,v=!1}ce=void 0}}finally{ce?V():A=!1}}}var V;if(typeof N=="function")V=function(){N(G)};else if(typeof MessageChannel!="undefined"){var ne=new MessageChannel,ge=ne.port2;ne.port1.onmessage=G,V=function(){ge.postMessage(null)}}else V=function(){k(G,0)};function Z(U,ce){T=k(function(){U(e.unstable_now())},ce)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(U){switch(x){case 1:case 2:case 3:var ce=3;break;default:ce=x}var xe=x;x=ce;try{return U()}finally{x=xe}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(U,ce){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var xe=x;x=U;try{return ce()}finally{x=xe}},e.unstable_scheduleCallback=function(U,ce,xe){var be=e.unstable_now();switch(typeof xe=="object"&&xe!==null?(xe=xe.delay,xe=typeof xe=="number"&&0<xe?be+xe:be):xe=be,U){case 1:var me=-1;break;case 2:me=250;break;case 5:me=1073741823;break;case 4:me=1e4;break;default:me=5e3}return me=xe+me,U={id:p++,callback:ce,priorityLevel:U,startTime:xe,expirationTime:me,sortIndex:-1},xe>be?(U.sortIndex=xe,t(f,U),r(d)===null&&U===r(f)&&(w?(C(T),T=-1):w=!0,Z(E,xe-be))):(U.sortIndex=me,t(d,U),b||v||(b=!0,A||(A=!0,V()))),U},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(U){var ce=x;return function(){var xe=x;x=ce;try{return U.apply(this,arguments)}finally{x=xe}}}})(mb)),mb}var pC;function Hz(){return pC||(pC=1,pb.exports=Uz()),pb.exports}var gb={exports:{}},rn={};var mC;function qz(){if(mC)return rn;mC=1;var e=o0();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,rn.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return i(d,f,null,p)},rn.flushSync=function(d){var f=l.T,p=a.p;try{if(l.T=null,a.p=2,d)return d()}finally{l.T=f,a.p=p,a.d.f()}},rn.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,a.d.C(d,f))},rn.prefetchDNS=function(d){typeof d=="string"&&a.d.D(d)},rn.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin),x=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?a.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:x,fetchPriority:v}):p==="script"&&a.d.X(d,{crossOrigin:m,integrity:x,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},rn.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(f.as,f.crossOrigin);a.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&a.d.M(d)},rn.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin);a.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},rn.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=u(f.as,f.crossOrigin);a.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else a.d.m(d)},rn.requestFormReset=function(d){a.d.r(d)},rn.unstable_batchedUpdates=function(d,f){return d(f)},rn.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},rn.useFormStatus=function(){return l.H.useHostTransitionStatus()},rn.version="19.2.7",rn}var gC;function vO(){if(gC)return gb.exports;gC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gb.exports=qz(),gb.exports}var xC;function Wz(){if(xC)return mf;xC=1;var e=Hz(),t=o0(),r=vO();function a(o){var c="https://react.dev/errors/"+o;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var c=o,h=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(h=c.return),o=c.return;while(o)}return c.tag===3?h:null}function l(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function u(o){if(o.tag===31){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function d(o){if(i(o)!==o)throw Error(a(188))}function f(o){var c=o.alternate;if(!c){if(c=i(o),c===null)throw Error(a(188));return c!==o?null:o}for(var h=o,g=c;;){var _=h.return;if(_===null)break;var S=_.alternate;if(S===null){if(g=_.return,g!==null){h=g;continue}break}if(_.child===S.child){for(S=_.child;S;){if(S===h)return d(_),o;if(S===g)return d(_),c;S=S.sibling}throw Error(a(188))}if(h.return!==g.return)h=_,g=S;else{for(var M=!1,J=_.child;J;){if(J===h){M=!0,h=_,g=S;break}if(J===g){M=!0,g=_,h=S;break}J=J.sibling}if(!M){for(J=S.child;J;){if(J===h){M=!0,h=S,g=_;break}if(J===g){M=!0,g=S,h=_;break}J=J.sibling}if(!M)throw Error(a(189))}}if(h.alternate!==g)throw Error(a(190))}if(h.tag!==3)throw Error(a(188));return h.stateNode.current===h?o:c}function p(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o;for(o=o.child;o!==null;){if(c=p(o),c!==null)return c;o=o.sibling}return null}var m=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),N=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function V(o){return o===null||typeof o!="object"?null:(o=G&&o[G]||o["@@iterator"],typeof o=="function"?o:null)}var ne=Symbol.for("react.client.reference");function ge(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===ne?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case w:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case E:return"Suspense";case A:return"SuspenseList";case D:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case N:return o.displayName||"Context";case C:return(o._context.displayName||"Context")+".Consumer";case O:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case T:return c=o.displayName||null,c!==null?c:ge(o.type)||"Memo";case P:c=o._payload,o=o._init;try{return ge(o(c))}catch(h){}}return null}var Z=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},be=[],me=-1;function oe(o){return{current:o}}function L(o){0>me||(o.current=be[me],be[me]=null,me--)}function H(o,c){me++,be[me]=o.current,o.current=c}var K=oe(null),Y=oe(null),re=oe(null),de=oe(null);function ie(o,c){switch(H(re,c),H(Y,o),H(K,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?E3(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=E3(c),o=A3(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}L(K),H(K,o)}function se(){L(K),L(Y),L(re)}function he(o){o.memoizedState!==null&&H(de,o);var c=K.current,h=A3(c,o.type);c!==h&&(H(Y,o),H(K,h))}function _e(o){Y.current===o&&(L(K),L(Y)),de.current===o&&(L(de),uf._currentValue=xe)}var F,X;function R(o){if(F===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);F=c&&c[1]||"",X=-1<h.stack.indexOf(`
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
`+F+o+X}var I=!1;function te(o,c){if(!o||I)return"";I=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(c){var Ve=function(){throw Error()};if(Object.defineProperty(Ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ve,[])}catch(ze){var Ie=ze}Reflect.construct(o,[],Ve)}else{try{Ve.call()}catch(ze){Ie=ze}o.call(Ve.prototype)}}else{try{throw Error()}catch(ze){Ie=ze}(Ve=o())&&typeof Ve.catch=="function"&&Ve.catch(function(){})}}catch(ze){if(ze&&Ie&&typeof ze.stack=="string")return[ze.stack,Ie.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=g.DetermineComponentFrameRoot(),M=S[0],J=S[1];if(M&&J){var we=M.split(`
`),Re=J.split(`
`);for(_=g=0;g<we.length&&!we[g].includes("DetermineComponentFrameRoot");)g++;for(;_<Re.length&&!Re[_].includes("DetermineComponentFrameRoot");)_++;if(g===we.length||_===Re.length)for(g=we.length-1,_=Re.length-1;1<=g&&0<=_&&we[g]!==Re[_];)_--;for(;1<=g&&0<=_;g--,_--)if(we[g]!==Re[_]){if(g!==1||_!==1)do if(g--,_--,0>_||we[g]!==Re[_]){var qe=`
`+we[g].replace(" at new "," at ");return o.displayName&&qe.includes("<anonymous>")&&(qe=qe.replace("<anonymous>",o.displayName)),qe}while(1<=g&&0<=_);break}}}finally{I=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?R(h):""}function q(o,c){switch(o.tag){case 26:case 27:case 5:return R(o.type);case 16:return R("Lazy");case 13:return o.child!==c&&c!==null?R("Suspense Fallback"):R("Suspense");case 19:return R("SuspenseList");case 0:case 15:return te(o.type,!1);case 11:return te(o.type.render,!1);case 1:return te(o.type,!0);case 31:return R("Activity");default:return""}}function B(o){try{var c="",h=null;do c+=q(o,h),h=o,o=o.return;while(o);return c}catch(g){return`
Error generating stack: `+g.message+`
`+g.stack}}var je=Object.prototype.hasOwnProperty,Ce=e.unstable_scheduleCallback,ye=e.unstable_cancelCallback,Ee=e.unstable_shouldYield,Xe=e.unstable_requestPaint,tt=e.unstable_now,ve=e.unstable_getCurrentPriorityLevel,Oe=e.unstable_ImmediatePriority,st=e.unstable_UserBlockingPriority,ct=e.unstable_NormalPriority,ot=e.unstable_LowPriority,Ze=e.unstable_IdlePriority,St=e.log,Ir=e.unstable_setDisableYieldValue,Xr=null,jr=null;function ea(o){if(typeof St=="function"&&Ir(o),jr&&typeof jr.setStrictMode=="function")try{jr.setStrictMode(Xr,o)}catch(c){}}var ma=Math.clz32?Math.clz32:Vl,wu=Math.log,Wl=Math.LN2;function Vl(o){return o>>>=0,o===0?32:31-(wu(o)/Wl|0)|0}var ki=256,Js=262144,Ji=4194304;function mn(o){var c=o&42;if(c!==0)return c;switch(o&-o){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function ws(o,c,h){var g=o.pendingLanes;if(g===0)return 0;var _=0,S=o.suspendedLanes,M=o.pingedLanes;o=o.warmLanes;var J=g&134217727;return J!==0?(g=J&~S,g!==0?_=mn(g):(M&=J,M!==0?_=mn(M):h||(h=J&~o,h!==0&&(_=mn(h))))):(J=g&~S,J!==0?_=mn(J):M!==0?_=mn(M):h||(h=g&~o,h!==0&&(_=mn(h)))),_===0?0:c!==0&&c!==_&&(c&S)===0&&(S=_&-_,h=c&-c,S>=h||S===32&&(h&4194048)!==0)?c:_}function Si(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function ju(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32: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 c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Gl(){var o=Ji;return Ji<<=1,(Ji&62914560)===0&&(Ji=4194304),o}function Yo(o){for(var c=[],h=0;31>h;h++)c.push(o);return c}function Ni(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function _u(o,c,h,g,_,S){var M=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var J=o.entanglements,we=o.expirationTimes,Re=o.hiddenUpdates;for(h=M&~h;0<h;){var qe=31-ma(h),Ve=1<<qe;J[qe]=0,we[qe]=-1;var Ie=Re[qe];if(Ie!==null)for(Re[qe]=null,qe=0;qe<Ie.length;qe++){var ze=Ie[qe];ze!==null&&(ze.lane&=-536870913)}h&=~Ve}g!==0&&Kl(o,g,0),S!==0&&_===0&&o.tag!==0&&(o.suspendedLanes|=S&~(M&~c))}function Kl(o,c,h){o.pendingLanes|=c,o.suspendedLanes&=~c;var g=31-ma(c);o.entangledLanes|=c,o.entanglements[g]=o.entanglements[g]|1073741824|h&261930}function Qi(o,c){var h=o.entangledLanes|=c;for(o=o.entanglements;h;){var g=31-ma(h),_=1<<g;_&c|o[g]&c&&(o[g]|=c),h&=~_}}function Ne(o,c){var h=c&-c;return h=(h&42)!==0?1:Qe(h),(h&(o.suspendedLanes|c))!==0?0:h}function Qe(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function ht(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function W(){var o=ce.p;return o!==0?o:(o=window.event,o===void 0?32:Z3(o.type))}function le(o,c){var h=ce.p;try{return ce.p=o,c()}finally{ce.p=h}}var Q=Math.random().toString(36).slice(2),ae="__reactFiber$"+Q,ue="__reactProps$"+Q,pe="__reactContainer$"+Q,Pe="__reactEvents$"+Q,Ue="__reactListeners$"+Q,Fe="__reactHandles$"+Q,Me="__reactResources$"+Q,Le="__reactMarker$"+Q;function Ye(o){delete o[ae],delete o[ue],delete o[Pe],delete o[Ue],delete o[Fe]}function rt(o){var c=o[ae];if(c)return c;for(var h=o.parentNode;h;){if(c=h[pe]||h[ae]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(o=L3(o);o!==null;){if(h=o[ae])return h;o=L3(o)}return c}o=h,h=o.parentNode}return null}function et(o){if(o=o[ae]||o[pe]){var c=o.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return o}return null}function Je(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o.stateNode;throw Error(a(33))}function it(o){var c=o[Me];return c||(c=o[Me]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function lt(o){o[Le]=!0}var Yt=new Set,or={};function pr(o,c){js(o,c),js(o+"Capture",c)}function js(o,c){for(or[o]=c,o=0;o<c.length;o++)Yt.add(c[o])}var Yl=RegExp("^[: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]*$"),Xo={},Ci={};function S0(o){return je.call(Ci,o)?!0:je.call(Xo,o)?!1:Yl.test(o)?Ci[o]=!0:(Xo[o]=!0,!1)}function Tn(o,c,h){if(S0(c))if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(c);return;case"boolean":var g=c.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){o.removeAttribute(c);return}}o.setAttribute(c,""+h)}}function hp(o,c,h){if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttribute(c,""+h)}}function Zi(o,c,h,g){if(g===null)o.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(c,h,""+g)}}function _s(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function wS(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function NL(o,c,h){var g=Object.getOwnPropertyDescriptor(o.constructor.prototype,c);if(!o.hasOwnProperty(c)&&typeof g!="undefined"&&typeof g.get=="function"&&typeof g.set=="function"){var _=g.get,S=g.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return _.call(this)},set:function(M){h=""+M,S.call(this,M)}}),Object.defineProperty(o,c,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(M){h=""+M},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function av(o){if(!o._valueTracker){var c=wS(o)?"checked":"value";o._valueTracker=NL(o,c,""+o[c])}}function jS(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return o&&(g=wS(o)?o.checked?"true":"false":o.value),o=g,o!==h?(c.setValue(o),!0):!1}function pp(o){if(o=o||(typeof document!="undefined"?document:void 0),typeof o=="undefined")return null;try{return o.activeElement||o.body}catch(c){return o.body}}var CL=/[\n"\\]/g;function ks(o){return o.replace(CL,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function nv(o,c,h,g,_,S,M,J){o.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?o.type=M:o.removeAttribute("type"),c!=null?M==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+_s(c)):o.value!==""+_s(c)&&(o.value=""+_s(c)):M!=="submit"&&M!=="reset"||o.removeAttribute("value"),c!=null?sv(o,M,_s(c)):h!=null?sv(o,M,_s(h)):g!=null&&o.removeAttribute("value"),_==null&&S!=null&&(o.defaultChecked=!!S),_!=null&&(o.checked=_&&typeof _!="function"&&typeof _!="symbol"),J!=null&&typeof J!="function"&&typeof J!="symbol"&&typeof J!="boolean"?o.name=""+_s(J):o.removeAttribute("name")}function _S(o,c,h,g,_,S,M,J){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(o.type=S),c!=null||h!=null){if(!(S!=="submit"&&S!=="reset"||c!=null)){av(o);return}h=h!=null?""+_s(h):"",c=c!=null?""+_s(c):h,J||c===o.value||(o.value=c),o.defaultValue=c}g=g!=null?g:_,g=typeof g!="function"&&typeof g!="symbol"&&!!g,o.checked=J?o.checked:!!g,o.defaultChecked=!!g,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(o.name=M),av(o)}function sv(o,c,h){c==="number"&&pp(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function ku(o,c,h,g){if(o=o.options,c){c={};for(var _=0;_<h.length;_++)c["$"+h[_]]=!0;for(h=0;h<o.length;h++)_=c.hasOwnProperty("$"+o[h].value),o[h].selected!==_&&(o[h].selected=_),_&&g&&(o[h].defaultSelected=!0)}else{for(h=""+_s(h),c=null,_=0;_<o.length;_++){if(o[_].value===h){o[_].selected=!0,g&&(o[_].defaultSelected=!0);return}c!==null||o[_].disabled||(c=o[_])}c!==null&&(c.selected=!0)}}function kS(o,c,h){if(c!=null&&(c=""+_s(c),c!==o.value&&(o.value=c),h==null)){o.defaultValue!==c&&(o.defaultValue=c);return}o.defaultValue=h!=null?""+_s(h):""}function SS(o,c,h,g){if(c==null){if(g!=null){if(h!=null)throw Error(a(92));if(Z(g)){if(1<g.length)throw Error(a(93));g=g[0]}h=g}h==null&&(h=""),c=h}h=_s(c),o.defaultValue=h,g=o.textContent,g===h&&g!==""&&g!==null&&(o.value=g),av(o)}function Su(o,c){if(c){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=c;return}}o.textContent=c}var TL=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function NS(o,c,h){var g=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?o.setProperty(c,""):c==="float"?o.cssFloat="":o[c]="":g?o.setProperty(c,h):typeof h!="number"||h===0||TL.has(c)?c==="float"?o.cssFloat=h:o[c]=(""+h).trim():o[c]=h+"px"}function CS(o,c,h){if(c!=null&&typeof c!="object")throw Error(a(62));if(o=o.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||c!=null&&c.hasOwnProperty(g)||(g.indexOf("--")===0?o.setProperty(g,""):g==="float"?o.cssFloat="":o[g]="");for(var _ in c)g=c[_],c.hasOwnProperty(_)&&h[_]!==g&&NS(o,_,g)}else for(var S in c)c.hasOwnProperty(S)&&NS(o,S,c[S])}function iv(o){if(o.indexOf("-")===-1)return!1;switch(o){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 EL=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),AL=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function mp(o){return AL.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function eo(){}var ov=null;function lv(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Nu=null,Cu=null;function TS(o){var c=et(o);if(c&&(o=c.stateNode)){var h=o[ue]||null;e:switch(o=c.stateNode,c.type){case"input":if(nv(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+ks(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var g=h[c];if(g!==o&&g.form===o.form){var _=g[ue]||null;if(!_)throw Error(a(90));nv(g,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(c=0;c<h.length;c++)g=h[c],g.form===o.form&&jS(g)}break e;case"textarea":kS(o,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&ku(o,!!h.multiple,c,!1)}}}var cv=!1;function ES(o,c,h){if(cv)return o(c,h);cv=!0;try{var g=o(c);return g}finally{if(cv=!1,(Nu!==null||Cu!==null)&&(rm(),Nu&&(c=Nu,o=Cu,Cu=Nu=null,TS(c),o)))for(c=0;c<o.length;c++)TS(o[c])}}function N0(o,c){var h=o.stateNode;if(h===null)return null;var g=h[ue]||null;if(g===null)return null;h=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(a(231,c,typeof h));return h}var to=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),uv=!1;if(to)try{var C0={};Object.defineProperty(C0,"passive",{get:function(){uv=!0}}),window.addEventListener("test",C0,C0),window.removeEventListener("test",C0,C0)}catch(o){uv=!1}var Jo=null,dv=null,gp=null;function AS(){if(gp)return gp;var o,c=dv,h=c.length,g,_="value"in Jo?Jo.value:Jo.textContent,S=_.length;for(o=0;o<h&&c[o]===_[o];o++);var M=h-o;for(g=1;g<=M&&c[h-g]===_[S-g];g++);return gp=_.slice(o,1<g?1-g:void 0)}function xp(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function yp(){return!0}function OS(){return!1}function En(o){function c(h,g,_,S,M){this._reactName=h,this._targetInst=_,this.type=g,this.nativeEvent=S,this.target=M,this.currentTarget=null;for(var J in o)o.hasOwnProperty(J)&&(h=o[J],this[J]=h?h(S):S[J]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?yp:OS,this.isPropagationStopped=OS,this}return m(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=yp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=yp)},persist:function(){},isPersistent:yp}),c}var Xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vp=En(Xl),T0=m({},Xl,{view:0,detail:0}),OL=En(T0),fv,hv,E0,bp=m({},T0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mv,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==E0&&(E0&&o.type==="mousemove"?(fv=o.screenX-E0.screenX,hv=o.screenY-E0.screenY):hv=fv=0,E0=o),fv)},movementY:function(o){return"movementY"in o?o.movementY:hv}}),PS=En(bp),PL=m({},bp,{dataTransfer:0}),DL=En(PL),RL=m({},T0,{relatedTarget:0}),pv=En(RL),FL=m({},Xl,{animationName:0,elapsedTime:0,pseudoElement:0}),ML=En(FL),LL=m({},Xl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),IL=En(LL),zL=m({},Xl,{data:0}),DS=En(zL),BL={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$L={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"},UL={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HL(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=UL[o])?!!c[o]:!1}function mv(){return HL}var qL=m({},T0,{key:function(o){if(o.key){var c=BL[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=xp(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?$L[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mv,charCode:function(o){return o.type==="keypress"?xp(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?xp(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),WL=En(qL),VL=m({},bp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),RS=En(VL),GL=m({},T0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mv}),KL=En(GL),YL=m({},Xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),XL=En(YL),JL=m({},bp,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),QL=En(JL),ZL=m({},Xl,{newState:0,oldState:0}),eI=En(ZL),tI=[9,13,27,32],gv=to&&"CompositionEvent"in window,A0=null;to&&"documentMode"in document&&(A0=document.documentMode);var rI=to&&"TextEvent"in window&&!A0,FS=to&&(!gv||A0&&8<A0&&11>=A0),MS=" ",LS=!1;function IS(o,c){switch(o){case"keyup":return tI.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zS(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Tu=!1;function aI(o,c){switch(o){case"compositionend":return zS(c);case"keypress":return c.which!==32?null:(LS=!0,MS);case"textInput":return o=c.data,o===MS&&LS?null:o;default:return null}}function nI(o,c){if(Tu)return o==="compositionend"||!gv&&IS(o,c)?(o=AS(),gp=dv=Jo=null,Tu=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return FS&&c.locale!=="ko"?null:c.data;default:return null}}var sI={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 BS(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!sI[o.type]:c==="textarea"}function $S(o,c,h,g){Nu?Cu?Cu.push(g):Cu=[g]:Nu=g,c=cm(c,"onChange"),0<c.length&&(h=new vp("onChange","change",null,h,g),o.push({event:h,listeners:c}))}var O0=null,P0=null;function iI(o){_3(o,0)}function wp(o){var c=Je(o);if(jS(c))return o}function US(o,c){if(o==="change")return c}var HS=!1;if(to){var xv;if(to){var yv="oninput"in document;if(!yv){var qS=document.createElement("div");qS.setAttribute("oninput","return;"),yv=typeof qS.oninput=="function"}xv=yv}else xv=!1;HS=xv&&(!document.documentMode||9<document.documentMode)}function WS(){O0&&(O0.detachEvent("onpropertychange",VS),P0=O0=null)}function VS(o){if(o.propertyName==="value"&&wp(P0)){var c=[];$S(c,P0,o,lv(o)),ES(iI,c)}}function oI(o,c,h){o==="focusin"?(WS(),O0=c,P0=h,O0.attachEvent("onpropertychange",VS)):o==="focusout"&&WS()}function lI(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return wp(P0)}function cI(o,c){if(o==="click")return wp(c)}function uI(o,c){if(o==="input"||o==="change")return wp(c)}function dI(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var Xn=typeof Object.is=="function"?Object.is:dI;function D0(o,c){if(Xn(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var h=Object.keys(o),g=Object.keys(c);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var _=h[g];if(!je.call(c,_)||!Xn(o[_],c[_]))return!1}return!0}function GS(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function KS(o,c){var h=GS(o);o=0;for(var g;h;){if(h.nodeType===3){if(g=o+h.textContent.length,o<=c&&g>=c)return{node:h,offset:c-o};o=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=GS(h)}}function YS(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?YS(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function XS(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=pp(o.document);c instanceof o.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch(g){h=!1}if(h)o=c.contentWindow;else break;c=pp(o.document)}return c}function vv(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var fI=to&&"documentMode"in document&&11>=document.documentMode,Eu=null,bv=null,R0=null,wv=!1;function JS(o,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;wv||Eu==null||Eu!==pp(g)||(g=Eu,"selectionStart"in g&&vv(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),R0&&D0(R0,g)||(R0=g,g=cm(bv,"onSelect"),0<g.length&&(c=new vp("onSelect","select",null,c,h),o.push({event:c,listeners:g}),c.target=Eu)))}function Jl(o,c){var h={};return h[o.toLowerCase()]=c.toLowerCase(),h["Webkit"+o]="webkit"+c,h["Moz"+o]="moz"+c,h}var Au={animationend:Jl("Animation","AnimationEnd"),animationiteration:Jl("Animation","AnimationIteration"),animationstart:Jl("Animation","AnimationStart"),transitionrun:Jl("Transition","TransitionRun"),transitionstart:Jl("Transition","TransitionStart"),transitioncancel:Jl("Transition","TransitionCancel"),transitionend:Jl("Transition","TransitionEnd")},jv={},QS={};to&&(QS=document.createElement("div").style,"AnimationEvent"in window||(delete Au.animationend.animation,delete Au.animationiteration.animation,delete Au.animationstart.animation),"TransitionEvent"in window||delete Au.transitionend.transition);function Ql(o){if(jv[o])return jv[o];if(!Au[o])return o;var c=Au[o],h;for(h in c)if(c.hasOwnProperty(h)&&h in QS)return jv[o]=c[h];return o}var ZS=Ql("animationend"),e4=Ql("animationiteration"),t4=Ql("animationstart"),hI=Ql("transitionrun"),pI=Ql("transitionstart"),mI=Ql("transitioncancel"),r4=Ql("transitionend"),a4=new Map,_v="abort auxClick beforeToggle 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(" ");_v.push("scrollEnd");function Qs(o,c){a4.set(o,c),pr(c,[o])}var jp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Ss=[],Ou=0,kv=0;function _p(){for(var o=Ou,c=kv=Ou=0;c<o;){var h=Ss[c];Ss[c++]=null;var g=Ss[c];Ss[c++]=null;var _=Ss[c];Ss[c++]=null;var S=Ss[c];if(Ss[c++]=null,g!==null&&_!==null){var M=g.pending;M===null?_.next=_:(_.next=M.next,M.next=_),g.pending=_}S!==0&&n4(h,_,S)}}function kp(o,c,h,g){Ss[Ou++]=o,Ss[Ou++]=c,Ss[Ou++]=h,Ss[Ou++]=g,kv|=g,o.lanes|=g,o=o.alternate,o!==null&&(o.lanes|=g)}function Sv(o,c,h,g){return kp(o,c,h,g),Sp(o)}function Zl(o,c){return kp(o,null,null,c),Sp(o)}function n4(o,c,h){o.lanes|=h;var g=o.alternate;g!==null&&(g.lanes|=h);for(var _=!1,S=o.return;S!==null;)S.childLanes|=h,g=S.alternate,g!==null&&(g.childLanes|=h),S.tag===22&&(o=S.stateNode,o===null||o._visibility&1||(_=!0)),o=S,S=S.return;return o.tag===3?(S=o.stateNode,_&&c!==null&&(_=31-ma(h),o=S.hiddenUpdates,g=o[_],g===null?o[_]=[c]:g.push(c),c.lane=h|536870912),S):null}function Sp(o){if(50<rf)throw rf=0,R1=null,Error(a(185));for(var c=o.return;c!==null;)o=c,c=o.return;return o.tag===3?o.stateNode:null}var Pu={};function gI(o,c,h,g){this.tag=o,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(o,c,h,g){return new gI(o,c,h,g)}function Nv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function ro(o,c){var h=o.alternate;return h===null?(h=Jn(o.tag,c,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=c,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,c=o.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function s4(o,c){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=c,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,c=h.dependencies,o.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),o}function Np(o,c,h,g,_,S){var M=0;if(g=o,typeof o=="function")Nv(o)&&(M=1);else if(typeof o=="string")M=wz(o,h,K.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case D:return o=Jn(31,h,c,_),o.elementType=D,o.lanes=S,o;case w:return ec(h.children,_,S,c);case j:M=8,_|=24;break;case k:return o=Jn(12,h,c,_|2),o.elementType=k,o.lanes=S,o;case E:return o=Jn(13,h,c,_),o.elementType=E,o.lanes=S,o;case A:return o=Jn(19,h,c,_),o.elementType=A,o.lanes=S,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case N:M=10;break e;case C:M=9;break e;case O:M=11;break e;case T:M=14;break e;case P:M=16,g=null;break e}M=29,h=Error(a(130,o===null?"null":typeof o,"")),g=null}return c=Jn(M,h,c,_),c.elementType=o,c.type=g,c.lanes=S,c}function ec(o,c,h,g){return o=Jn(7,o,g,c),o.lanes=h,o}function Cv(o,c,h){return o=Jn(6,o,null,c),o.lanes=h,o}function i4(o){var c=Jn(18,null,null,0);return c.stateNode=o,c}function Tv(o,c,h){return c=Jn(4,o.children!==null?o.children:[],o.key,c),c.lanes=h,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}var o4=new WeakMap;function Ns(o,c){if(typeof o=="object"&&o!==null){var h=o4.get(o);return h!==void 0?h:(c={value:o,source:c,stack:B(c)},o4.set(o,c),c)}return{value:o,source:c,stack:B(c)}}var Du=[],Ru=0,Cp=null,F0=0,Cs=[],Ts=0,Qo=null,Ti=1,Ei="";function ao(o,c){Du[Ru++]=F0,Du[Ru++]=Cp,Cp=o,F0=c}function l4(o,c,h){Cs[Ts++]=Ti,Cs[Ts++]=Ei,Cs[Ts++]=Qo,Qo=o;var g=Ti;o=Ei;var _=32-ma(g)-1;g&=~(1<<_),h+=1;var S=32-ma(c)+_;if(30<S){var M=_-_%5;S=(g&(1<<M)-1).toString(32),g>>=M,_-=M,Ti=1<<32-ma(c)+_|h<<_|g,Ei=S+o}else Ti=1<<S|h<<_|g,Ei=o}function Ev(o){o.return!==null&&(ao(o,1),l4(o,1,0))}function Av(o){for(;o===Cp;)Cp=Du[--Ru],Du[Ru]=null,F0=Du[--Ru],Du[Ru]=null;for(;o===Qo;)Qo=Cs[--Ts],Cs[Ts]=null,Ei=Cs[--Ts],Cs[Ts]=null,Ti=Cs[--Ts],Cs[Ts]=null}function c4(o,c){Cs[Ts++]=Ti,Cs[Ts++]=Ei,Cs[Ts++]=Qo,Ti=c.id,Ei=c.overflow,Qo=o}var Ia=null,Cr=null,Vt=!1,Zo=null,Es=!1,Ov=Error(a(519));function el(o){var c=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw M0(Ns(c,o)),Ov}function u4(o){var c=o.stateNode,h=o.type,g=o.memoizedProps;switch(c[ae]=o,c[ue]=g,h){case"dialog":Bt("cancel",c),Bt("close",c);break;case"iframe":case"object":case"embed":Bt("load",c);break;case"video":case"audio":for(h=0;h<nf.length;h++)Bt(nf[h],c);break;case"source":Bt("error",c);break;case"img":case"image":case"link":Bt("error",c),Bt("load",c);break;case"details":Bt("toggle",c);break;case"input":Bt("invalid",c),_S(c,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Bt("invalid",c);break;case"textarea":Bt("invalid",c),SS(c,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||g.suppressHydrationWarning===!0||C3(c.textContent,h)?(g.popover!=null&&(Bt("beforetoggle",c),Bt("toggle",c)),g.onScroll!=null&&Bt("scroll",c),g.onScrollEnd!=null&&Bt("scrollend",c),g.onClick!=null&&(c.onclick=eo),c=!0):c=!1,c||el(o,!0)}function d4(o){for(Ia=o.return;Ia;)switch(Ia.tag){case 5:case 31:case 13:Es=!1;return;case 27:case 3:Es=!0;return;default:Ia=Ia.return}}function Fu(o){if(o!==Ia)return!1;if(!Vt)return d4(o),Vt=!0,!1;var c=o.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||Y1(o.type,o.memoizedProps)),h=!h),h&&Cr&&el(o),d4(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(a(317));Cr=M3(o)}else if(c===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(a(317));Cr=M3(o)}else c===27?(c=Cr,pl(o.type)?(o=eb,eb=null,Cr=o):Cr=c):Cr=Ia?Os(o.stateNode.nextSibling):null;return!0}function tc(){Cr=Ia=null,Vt=!1}function Pv(){var o=Zo;return o!==null&&(Dn===null?Dn=o:Dn.push.apply(Dn,o),Zo=null),o}function M0(o){Zo===null?Zo=[o]:Zo.push(o)}var Dv=oe(null),rc=null,no=null;function tl(o,c,h){H(Dv,c._currentValue),c._currentValue=h}function so(o){o._currentValue=Dv.current,L(Dv)}function Rv(o,c,h){for(;o!==null;){var g=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),o===h)break;o=o.return}}function Fv(o,c,h,g){var _=o.child;for(_!==null&&(_.return=o);_!==null;){var S=_.dependencies;if(S!==null){var M=_.child;S=S.firstContext;e:for(;S!==null;){var J=S;S=_;for(var we=0;we<c.length;we++)if(J.context===c[we]){S.lanes|=h,J=S.alternate,J!==null&&(J.lanes|=h),Rv(S.return,h,o),g||(M=null);break e}S=J.next}}else if(_.tag===18){if(M=_.return,M===null)throw Error(a(341));M.lanes|=h,S=M.alternate,S!==null&&(S.lanes|=h),Rv(M,h,o),M=null}else M=_.child;if(M!==null)M.return=_;else for(M=_;M!==null;){if(M===o){M=null;break}if(_=M.sibling,_!==null){_.return=M.return,M=_;break}M=M.return}_=M}}function Mu(o,c,h,g){o=null;for(var _=c,S=!1;_!==null;){if(!S){if((_.flags&524288)!==0)S=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var M=_.alternate;if(M===null)throw Error(a(387));if(M=M.memoizedProps,M!==null){var J=_.type;Xn(_.pendingProps.value,M.value)||(o!==null?o.push(J):o=[J])}}else if(_===de.current){if(M=_.alternate,M===null)throw Error(a(387));M.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(o!==null?o.push(uf):o=[uf])}_=_.return}o!==null&&Fv(c,o,h,g),c.flags|=262144}function Tp(o){for(o=o.firstContext;o!==null;){if(!Xn(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function ac(o){rc=o,no=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function za(o){return f4(rc,o)}function Ep(o,c){return rc===null&&ac(o),f4(o,c)}function f4(o,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},no===null){if(o===null)throw Error(a(308));no=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else no=no.next=c;return h}var xI=typeof AbortController!="undefined"?AbortController:function(){var o=[],c=this.signal={aborted:!1,addEventListener:function(h,g){o.push(g)}};this.abort=function(){c.aborted=!0,o.forEach(function(h){return h()})}},yI=e.unstable_scheduleCallback,vI=e.unstable_NormalPriority,ta={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mv(){return{controller:new xI,data:new Map,refCount:0}}function L0(o){o.refCount--,o.refCount===0&&yI(vI,function(){o.controller.abort()})}var I0=null,Lv=0,Lu=0,Iu=null;function bI(o,c){if(I0===null){var h=I0=[];Lv=0,Lu=B1(),Iu={status:"pending",value:void 0,then:function(g){h.push(g)}}}return Lv++,c.then(h4,h4),c}function h4(){if(--Lv===0&&I0!==null){Iu!==null&&(Iu.status="fulfilled");var o=I0;I0=null,Lu=0,Iu=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function wI(o,c){var h=[],g={status:"pending",value:null,reason:null,then:function(_){h.push(_)}};return o.then(function(){g.status="fulfilled",g.value=c;for(var _=0;_<h.length;_++)(0,h[_])(c)},function(_){for(g.status="rejected",g.reason=_,_=0;_<h.length;_++)(0,h[_])(void 0)}),g}var p4=U.S;U.S=function(o,c){JN=tt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&bI(o,c),p4!==null&&p4(o,c)};var nc=oe(null);function Iv(){var o=nc.current;return o!==null?o:_r.pooledCache}function Ap(o,c){c===null?H(nc,nc.current):H(nc,c.pool)}function m4(){var o=Iv();return o===null?null:{parent:ta._currentValue,pool:o}}var zu=Error(a(460)),zv=Error(a(474)),Op=Error(a(542)),Pp={then:function(){}};function g4(o){return o=o.status,o==="fulfilled"||o==="rejected"}function x4(o,c,h){switch(h=o[h],h===void 0?o.push(c):h!==c&&(c.then(eo,eo),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,v4(o),o;default:if(typeof c.status=="string")c.then(eo,eo);else{if(o=_r,o!==null&&100<o.shellSuspendCounter)throw Error(a(482));o=c,o.status="pending",o.then(function(g){if(c.status==="pending"){var _=c;_.status="fulfilled",_.value=g}},function(g){if(c.status==="pending"){var _=c;_.status="rejected",_.reason=g}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,v4(o),o}throw ic=c,zu}}function sc(o){try{var c=o._init;return c(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(ic=h,zu):h}}var ic=null;function y4(){if(ic===null)throw Error(a(459));var o=ic;return ic=null,o}function v4(o){if(o===zu||o===Op)throw Error(a(483))}var Bu=null,z0=0;function Dp(o){var c=z0;return z0+=1,Bu===null&&(Bu=[]),x4(Bu,o,c)}function B0(o,c){c=c.props.ref,o.ref=c!==void 0?c:null}function Rp(o,c){throw c.$$typeof===x?Error(a(525)):(o=Object.prototype.toString.call(c),Error(a(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o)))}function b4(o){function c(Te,ke){if(o){var De=Te.deletions;De===null?(Te.deletions=[ke],Te.flags|=16):De.push(ke)}}function h(Te,ke){if(!o)return null;for(;ke!==null;)c(Te,ke),ke=ke.sibling;return null}function g(Te){for(var ke=new Map;Te!==null;)Te.key!==null?ke.set(Te.key,Te):ke.set(Te.index,Te),Te=Te.sibling;return ke}function _(Te,ke){return Te=ro(Te,ke),Te.index=0,Te.sibling=null,Te}function S(Te,ke,De){return Te.index=De,o?(De=Te.alternate,De!==null?(De=De.index,De<ke?(Te.flags|=67108866,ke):De):(Te.flags|=67108866,ke)):(Te.flags|=1048576,ke)}function M(Te){return o&&Te.alternate===null&&(Te.flags|=67108866),Te}function J(Te,ke,De,We){return ke===null||ke.tag!==6?(ke=Cv(De,Te.mode,We),ke.return=Te,ke):(ke=_(ke,De),ke.return=Te,ke)}function we(Te,ke,De,We){var bt=De.type;return bt===w?qe(Te,ke,De.props.children,We,De.key):ke!==null&&(ke.elementType===bt||typeof bt=="object"&&bt!==null&&bt.$$typeof===P&&sc(bt)===ke.type)?(ke=_(ke,De.props),B0(ke,De),ke.return=Te,ke):(ke=Np(De.type,De.key,De.props,null,Te.mode,We),B0(ke,De),ke.return=Te,ke)}function Re(Te,ke,De,We){return ke===null||ke.tag!==4||ke.stateNode.containerInfo!==De.containerInfo||ke.stateNode.implementation!==De.implementation?(ke=Tv(De,Te.mode,We),ke.return=Te,ke):(ke=_(ke,De.children||[]),ke.return=Te,ke)}function qe(Te,ke,De,We,bt){return ke===null||ke.tag!==7?(ke=ec(De,Te.mode,We,bt),ke.return=Te,ke):(ke=_(ke,De),ke.return=Te,ke)}function Ve(Te,ke,De){if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return ke=Cv(""+ke,Te.mode,De),ke.return=Te,ke;if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case v:return De=Np(ke.type,ke.key,ke.props,null,Te.mode,De),B0(De,ke),De.return=Te,De;case b:return ke=Tv(ke,Te.mode,De),ke.return=Te,ke;case P:return ke=sc(ke),Ve(Te,ke,De)}if(Z(ke)||V(ke))return ke=ec(ke,Te.mode,De,null),ke.return=Te,ke;if(typeof ke.then=="function")return Ve(Te,Dp(ke),De);if(ke.$$typeof===N)return Ve(Te,Ep(Te,ke),De);Rp(Te,ke)}return null}function Ie(Te,ke,De,We){var bt=ke!==null?ke.key:null;if(typeof De=="string"&&De!==""||typeof De=="number"||typeof De=="bigint")return bt!==null?null:J(Te,ke,""+De,We);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case v:return De.key===bt?we(Te,ke,De,We):null;case b:return De.key===bt?Re(Te,ke,De,We):null;case P:return De=sc(De),Ie(Te,ke,De,We)}if(Z(De)||V(De))return bt!==null?null:qe(Te,ke,De,We,null);if(typeof De.then=="function")return Ie(Te,ke,Dp(De),We);if(De.$$typeof===N)return Ie(Te,ke,Ep(Te,De),We);Rp(Te,De)}return null}function ze(Te,ke,De,We,bt){if(typeof We=="string"&&We!==""||typeof We=="number"||typeof We=="bigint")return Te=Te.get(De)||null,J(ke,Te,""+We,bt);if(typeof We=="object"&&We!==null){switch(We.$$typeof){case v:return Te=Te.get(We.key===null?De:We.key)||null,we(ke,Te,We,bt);case b:return Te=Te.get(We.key===null?De:We.key)||null,Re(ke,Te,We,bt);case P:return We=sc(We),ze(Te,ke,De,We,bt)}if(Z(We)||V(We))return Te=Te.get(De)||null,qe(ke,Te,We,bt,null);if(typeof We.then=="function")return ze(Te,ke,De,Dp(We),bt);if(We.$$typeof===N)return ze(Te,ke,De,Ep(ke,We),bt);Rp(ke,We)}return null}function ft(Te,ke,De,We){for(var bt=null,Xt=null,gt=ke,Et=ke=0,qt=null;gt!==null&&Et<De.length;Et++){gt.index>Et?(qt=gt,gt=null):qt=gt.sibling;var Jt=Ie(Te,gt,De[Et],We);if(Jt===null){gt===null&&(gt=qt);break}o&&gt&&Jt.alternate===null&&c(Te,gt),ke=S(Jt,ke,Et),Xt===null?bt=Jt:Xt.sibling=Jt,Xt=Jt,gt=qt}if(Et===De.length)return h(Te,gt),Vt&&ao(Te,Et),bt;if(gt===null){for(;Et<De.length;Et++)gt=Ve(Te,De[Et],We),gt!==null&&(ke=S(gt,ke,Et),Xt===null?bt=gt:Xt.sibling=gt,Xt=gt);return Vt&&ao(Te,Et),bt}for(gt=g(gt);Et<De.length;Et++)qt=ze(gt,Te,Et,De[Et],We),qt!==null&&(o&&qt.alternate!==null&&gt.delete(qt.key===null?Et:qt.key),ke=S(qt,ke,Et),Xt===null?bt=qt:Xt.sibling=qt,Xt=qt);return o&&gt.forEach(function(vl){return c(Te,vl)}),Vt&&ao(Te,Et),bt}function jt(Te,ke,De,We){if(De==null)throw Error(a(151));for(var bt=null,Xt=null,gt=ke,Et=ke=0,qt=null,Jt=De.next();gt!==null&&!Jt.done;Et++,Jt=De.next()){gt.index>Et?(qt=gt,gt=null):qt=gt.sibling;var vl=Ie(Te,gt,Jt.value,We);if(vl===null){gt===null&&(gt=qt);break}o&&gt&&vl.alternate===null&&c(Te,gt),ke=S(vl,ke,Et),Xt===null?bt=vl:Xt.sibling=vl,Xt=vl,gt=qt}if(Jt.done)return h(Te,gt),Vt&&ao(Te,Et),bt;if(gt===null){for(;!Jt.done;Et++,Jt=De.next())Jt=Ve(Te,Jt.value,We),Jt!==null&&(ke=S(Jt,ke,Et),Xt===null?bt=Jt:Xt.sibling=Jt,Xt=Jt);return Vt&&ao(Te,Et),bt}for(gt=g(gt);!Jt.done;Et++,Jt=De.next())Jt=ze(gt,Te,Et,Jt.value,We),Jt!==null&&(o&&Jt.alternate!==null&&gt.delete(Jt.key===null?Et:Jt.key),ke=S(Jt,ke,Et),Xt===null?bt=Jt:Xt.sibling=Jt,Xt=Jt);return o&&gt.forEach(function(Pz){return c(Te,Pz)}),Vt&&ao(Te,Et),bt}function xr(Te,ke,De,We){if(typeof De=="object"&&De!==null&&De.type===w&&De.key===null&&(De=De.props.children),typeof De=="object"&&De!==null){switch(De.$$typeof){case v:e:{for(var bt=De.key;ke!==null;){if(ke.key===bt){if(bt=De.type,bt===w){if(ke.tag===7){h(Te,ke.sibling),We=_(ke,De.props.children),We.return=Te,Te=We;break e}}else if(ke.elementType===bt||typeof bt=="object"&&bt!==null&&bt.$$typeof===P&&sc(bt)===ke.type){h(Te,ke.sibling),We=_(ke,De.props),B0(We,De),We.return=Te,Te=We;break e}h(Te,ke);break}else c(Te,ke);ke=ke.sibling}De.type===w?(We=ec(De.props.children,Te.mode,We,De.key),We.return=Te,Te=We):(We=Np(De.type,De.key,De.props,null,Te.mode,We),B0(We,De),We.return=Te,Te=We)}return M(Te);case b:e:{for(bt=De.key;ke!==null;){if(ke.key===bt)if(ke.tag===4&&ke.stateNode.containerInfo===De.containerInfo&&ke.stateNode.implementation===De.implementation){h(Te,ke.sibling),We=_(ke,De.children||[]),We.return=Te,Te=We;break e}else{h(Te,ke);break}else c(Te,ke);ke=ke.sibling}We=Tv(De,Te.mode,We),We.return=Te,Te=We}return M(Te);case P:return De=sc(De),xr(Te,ke,De,We)}if(Z(De))return ft(Te,ke,De,We);if(V(De)){if(bt=V(De),typeof bt!="function")throw Error(a(150));return De=bt.call(De),jt(Te,ke,De,We)}if(typeof De.then=="function")return xr(Te,ke,Dp(De),We);if(De.$$typeof===N)return xr(Te,ke,Ep(Te,De),We);Rp(Te,De)}return typeof De=="string"&&De!==""||typeof De=="number"||typeof De=="bigint"?(De=""+De,ke!==null&&ke.tag===6?(h(Te,ke.sibling),We=_(ke,De),We.return=Te,Te=We):(h(Te,ke),We=Cv(De,Te.mode,We),We.return=Te,Te=We),M(Te)):h(Te,ke)}return function(Te,ke,De,We){try{z0=0;var bt=xr(Te,ke,De,We);return Bu=null,bt}catch(gt){if(gt===zu||gt===Op)throw gt;var Xt=Jn(29,gt,null,Te.mode);return Xt.lanes=We,Xt.return=Te,Xt}}}var oc=b4(!0),w4=b4(!1),rl=!1;function Bv(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $v(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function al(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function nl(o,c,h){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(er&2)!==0){var _=g.pending;return _===null?c.next=c:(c.next=_.next,_.next=c),g.pending=c,c=Sp(o),n4(o,null,h),c}return kp(o,g,c,h),Sp(o)}function $0(o,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var g=c.lanes;g&=o.pendingLanes,h|=g,c.lanes=h,Qi(o,h)}}function Uv(o,c){var h=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var _=null,S=null;if(h=h.firstBaseUpdate,h!==null){do{var M={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};S===null?_=S=M:S=S.next=M,h=h.next}while(h!==null);S===null?_=S=c:S=S.next=c}else _=S=c;h={baseState:g.baseState,firstBaseUpdate:_,lastBaseUpdate:S,shared:g.shared,callbacks:g.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=c}var Hv=!1;function U0(){if(Hv){var o=Iu;if(o!==null)throw o}}function H0(o,c,h,g){Hv=!1;var _=o.updateQueue;rl=!1;var S=_.firstBaseUpdate,M=_.lastBaseUpdate,J=_.shared.pending;if(J!==null){_.shared.pending=null;var we=J,Re=we.next;we.next=null,M===null?S=Re:M.next=Re,M=we;var qe=o.alternate;qe!==null&&(qe=qe.updateQueue,J=qe.lastBaseUpdate,J!==M&&(J===null?qe.firstBaseUpdate=Re:J.next=Re,qe.lastBaseUpdate=we))}if(S!==null){var Ve=_.baseState;M=0,qe=Re=we=null,J=S;do{var Ie=J.lane&-536870913,ze=Ie!==J.lane;if(ze?(Ht&Ie)===Ie:(g&Ie)===Ie){Ie!==0&&Ie===Lu&&(Hv=!0),qe!==null&&(qe=qe.next={lane:0,tag:J.tag,payload:J.payload,callback:null,next:null});e:{var ft=o,jt=J;Ie=c;var xr=h;switch(jt.tag){case 1:if(ft=jt.payload,typeof ft=="function"){Ve=ft.call(xr,Ve,Ie);break e}Ve=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=jt.payload,Ie=typeof ft=="function"?ft.call(xr,Ve,Ie):ft,Ie==null)break e;Ve=m({},Ve,Ie);break e;case 2:rl=!0}}Ie=J.callback,Ie!==null&&(o.flags|=64,ze&&(o.flags|=8192),ze=_.callbacks,ze===null?_.callbacks=[Ie]:ze.push(Ie))}else ze={lane:Ie,tag:J.tag,payload:J.payload,callback:J.callback,next:null},qe===null?(Re=qe=ze,we=Ve):qe=qe.next=ze,M|=Ie;if(J=J.next,J===null){if(J=_.shared.pending,J===null)break;ze=J,J=ze.next,ze.next=null,_.lastBaseUpdate=ze,_.shared.pending=null}}while(!0);qe===null&&(we=Ve),_.baseState=we,_.firstBaseUpdate=Re,_.lastBaseUpdate=qe,S===null&&(_.shared.lanes=0),cl|=M,o.lanes=M,o.memoizedState=Ve}}function j4(o,c){if(typeof o!="function")throw Error(a(191,o));o.call(c)}function _4(o,c){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)j4(h[o],c)}var $u=oe(null),Fp=oe(0);function k4(o,c){o=mo,H(Fp,o),H($u,c),mo=o|c.baseLanes}function qv(){H(Fp,mo),H($u,$u.current)}function Wv(){mo=Fp.current,L($u),L(Fp)}var Qn=oe(null),As=null;function sl(o){var c=o.alternate;H(Jr,Jr.current&1),H(Qn,o),As===null&&(c===null||$u.current!==null||c.memoizedState!==null)&&(As=o)}function Vv(o){H(Jr,Jr.current),H(Qn,o),As===null&&(As=o)}function S4(o){o.tag===22?(H(Jr,Jr.current),H(Qn,o),As===null&&(As=o)):il()}function il(){H(Jr,Jr.current),H(Qn,Qn.current)}function Zn(o){L(Qn),As===o&&(As=null),L(Jr)}var Jr=oe(0);function Mp(o){for(var c=o;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Q1(h)||Z1(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var io=0,Ct=null,mr=null,ra=null,Lp=!1,Uu=!1,lc=!1,Ip=0,q0=0,Hu=null,jI=0;function Ur(){throw Error(a(321))}function Gv(o,c){if(c===null)return!1;for(var h=0;h<c.length&&h<o.length;h++)if(!Xn(o[h],c[h]))return!1;return!0}function Kv(o,c,h,g,_,S){return io=S,Ct=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,U.H=o===null||o.memoizedState===null?lN:c1,lc=!1,S=h(g,_),lc=!1,Uu&&(S=C4(c,h,g,_)),N4(o),S}function N4(o){U.H=G0;var c=mr!==null&&mr.next!==null;if(io=0,ra=mr=Ct=null,Lp=!1,q0=0,Hu=null,c)throw Error(a(300));o===null||aa||(o=o.dependencies,o!==null&&Tp(o)&&(aa=!0))}function C4(o,c,h,g){Ct=o;var _=0;do{if(Uu&&(Hu=null),q0=0,Uu=!1,25<=_)throw Error(a(301));if(_+=1,ra=mr=null,o.updateQueue!=null){var S=o.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}U.H=cN,S=c(h,g)}while(Uu);return S}function _I(){var o=U.H,c=o.useState()[0];return c=typeof c.then=="function"?W0(c):c,o=o.useState()[0],(mr!==null?mr.memoizedState:null)!==o&&(Ct.flags|=1024),c}function Yv(){var o=Ip!==0;return Ip=0,o}function Xv(o,c,h){c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~h}function Jv(o){if(Lp){for(o=o.memoizedState;o!==null;){var c=o.queue;c!==null&&(c.pending=null),o=o.next}Lp=!1}io=0,ra=mr=Ct=null,Uu=!1,q0=Ip=0,Hu=null}function gn(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ra===null?Ct.memoizedState=ra=o:ra=ra.next=o,ra}function Qr(){if(mr===null){var o=Ct.alternate;o=o!==null?o.memoizedState:null}else o=mr.next;var c=ra===null?Ct.memoizedState:ra.next;if(c!==null)ra=c,mr=o;else{if(o===null)throw Ct.alternate===null?Error(a(467)):Error(a(310));mr=o,o={memoizedState:mr.memoizedState,baseState:mr.baseState,baseQueue:mr.baseQueue,queue:mr.queue,next:null},ra===null?Ct.memoizedState=ra=o:ra=ra.next=o}return ra}function zp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function W0(o){var c=q0;return q0+=1,Hu===null&&(Hu=[]),o=x4(Hu,o,c),c=Ct,(ra===null?c.memoizedState:ra.next)===null&&(c=c.alternate,U.H=c===null||c.memoizedState===null?lN:c1),o}function Bp(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return W0(o);if(o.$$typeof===N)return za(o)}throw Error(a(438,String(o)))}function Qv(o){var c=null,h=Ct.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var g=Ct.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(c={data:g.data.map(function(_){return _.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=zp(),Ct.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(o),g=0;g<o;g++)h[g]=z;return c.index++,h}function oo(o,c){return typeof c=="function"?c(o):c}function $p(o){var c=Qr();return Zv(c,mr,o)}function Zv(o,c,h){var g=o.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=h;var _=o.baseQueue,S=g.pending;if(S!==null){if(_!==null){var M=_.next;_.next=S.next,S.next=M}c.baseQueue=_=S,g.pending=null}if(S=o.baseState,_===null)o.memoizedState=S;else{c=_.next;var J=M=null,we=null,Re=c,qe=!1;do{var Ve=Re.lane&-536870913;if(Ve!==Re.lane?(Ht&Ve)===Ve:(io&Ve)===Ve){var Ie=Re.revertLane;if(Ie===0)we!==null&&(we=we.next={lane:0,revertLane:0,gesture:null,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null}),Ve===Lu&&(qe=!0);else if((io&Ie)===Ie){Re=Re.next,Ie===Lu&&(qe=!0);continue}else Ve={lane:0,revertLane:Re.revertLane,gesture:null,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null},we===null?(J=we=Ve,M=S):we=we.next=Ve,Ct.lanes|=Ie,cl|=Ie;Ve=Re.action,lc&&h(S,Ve),S=Re.hasEagerState?Re.eagerState:h(S,Ve)}else Ie={lane:Ve,revertLane:Re.revertLane,gesture:Re.gesture,action:Re.action,hasEagerState:Re.hasEagerState,eagerState:Re.eagerState,next:null},we===null?(J=we=Ie,M=S):we=we.next=Ie,Ct.lanes|=Ve,cl|=Ve;Re=Re.next}while(Re!==null&&Re!==c);if(we===null?M=S:we.next=J,!Xn(S,o.memoizedState)&&(aa=!0,qe&&(h=Iu,h!==null)))throw h;o.memoizedState=S,o.baseState=M,o.baseQueue=we,g.lastRenderedState=S}return _===null&&(g.lanes=0),[o.memoizedState,g.dispatch]}function e1(o){var c=Qr(),h=c.queue;if(h===null)throw Error(a(311));h.lastRenderedReducer=o;var g=h.dispatch,_=h.pending,S=c.memoizedState;if(_!==null){h.pending=null;var M=_=_.next;do S=o(S,M.action),M=M.next;while(M!==_);Xn(S,c.memoizedState)||(aa=!0),c.memoizedState=S,c.baseQueue===null&&(c.baseState=S),h.lastRenderedState=S}return[S,g]}function T4(o,c,h){var g=Ct,_=Qr(),S=Vt;if(S){if(h===void 0)throw Error(a(407));h=h()}else h=c();var M=!Xn((mr||_).memoizedState,h);if(M&&(_.memoizedState=h,aa=!0),_=_.queue,a1(O4.bind(null,g,_,o),[o]),_.getSnapshot!==c||M||ra!==null&&ra.memoizedState.tag&1){if(g.flags|=2048,qu(9,{destroy:void 0},A4.bind(null,g,_,h,c),null),_r===null)throw Error(a(349));S||(io&127)!==0||E4(g,c,h)}return h}function E4(o,c,h){o.flags|=16384,o={getSnapshot:c,value:h},c=Ct.updateQueue,c===null?(c=zp(),Ct.updateQueue=c,c.stores=[o]):(h=c.stores,h===null?c.stores=[o]:h.push(o))}function A4(o,c,h,g){c.value=h,c.getSnapshot=g,P4(c)&&D4(o)}function O4(o,c,h){return h(function(){P4(c)&&D4(o)})}function P4(o){var c=o.getSnapshot;o=o.value;try{var h=c();return!Xn(o,h)}catch(g){return!0}}function D4(o){var c=Zl(o,2);c!==null&&Rn(c,o,2)}function t1(o){var c=gn();if(typeof o=="function"){var h=o;if(o=h(),lc){ea(!0);try{h()}finally{ea(!1)}}}return c.memoizedState=c.baseState=o,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oo,lastRenderedState:o},c}function R4(o,c,h,g){return o.baseState=h,Zv(o,mr,typeof g=="function"?g:oo)}function kI(o,c,h,g,_){if(qp(o))throw Error(a(485));if(o=c.action,o!==null){var S={payload:_,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){S.listeners.push(M)}};U.T!==null?h(!0):S.isTransition=!1,g(S),h=c.pending,h===null?(S.next=c.pending=S,F4(c,S)):(S.next=h.next,c.pending=h.next=S)}}function F4(o,c){var h=c.action,g=c.payload,_=o.state;if(c.isTransition){var S=U.T,M={};U.T=M;try{var J=h(_,g),we=U.S;we!==null&&we(M,J),M4(o,c,J)}catch(Re){r1(o,c,Re)}finally{S!==null&&M.types!==null&&(S.types=M.types),U.T=S}}else try{S=h(_,g),M4(o,c,S)}catch(Re){r1(o,c,Re)}}function M4(o,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){L4(o,c,g)},function(g){return r1(o,c,g)}):L4(o,c,h)}function L4(o,c,h){c.status="fulfilled",c.value=h,I4(c),o.state=h,c=o.pending,c!==null&&(h=c.next,h===c?o.pending=null:(h=h.next,c.next=h,F4(o,h)))}function r1(o,c,h){var g=o.pending;if(o.pending=null,g!==null){g=g.next;do c.status="rejected",c.reason=h,I4(c),c=c.next;while(c!==g)}o.action=null}function I4(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function z4(o,c){return c}function B4(o,c){if(Vt){var h=_r.formState;if(h!==null){e:{var g=Ct;if(Vt){if(Cr){t:{for(var _=Cr,S=Es;_.nodeType!==8;){if(!S){_=null;break t}if(_=Os(_.nextSibling),_===null){_=null;break t}}S=_.data,_=S==="F!"||S==="F"?_:null}if(_){Cr=Os(_.nextSibling),g=_.data==="F!";break e}}el(g)}g=!1}g&&(c=h[0])}}return h=gn(),h.memoizedState=h.baseState=c,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:z4,lastRenderedState:c},h.queue=g,h=sN.bind(null,Ct,g),g.dispatch=h,g=t1(!1),S=l1.bind(null,Ct,!1,g.queue),g=gn(),_={state:c,dispatch:null,action:o,pending:null},g.queue=_,h=kI.bind(null,Ct,_,S,h),_.dispatch=h,g.memoizedState=o,[c,h,!1]}function $4(o){var c=Qr();return U4(c,mr,o)}function U4(o,c,h){if(c=Zv(o,c,z4)[0],o=$p(oo)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var g=W0(c)}catch(M){throw M===zu?Op:M}else g=c;c=Qr();var _=c.queue,S=_.dispatch;return h!==c.memoizedState&&(Ct.flags|=2048,qu(9,{destroy:void 0},SI.bind(null,_,h),null)),[g,S,o]}function SI(o,c){o.action=c}function H4(o){var c=Qr(),h=mr;if(h!==null)return U4(c,h,o);Qr(),c=c.memoizedState,h=Qr();var g=h.queue.dispatch;return h.memoizedState=o,[c,g,!1]}function qu(o,c,h,g){return o={tag:o,create:h,deps:g,inst:c,next:null},c=Ct.updateQueue,c===null&&(c=zp(),Ct.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=o.next=o:(g=h.next,h.next=o,o.next=g,c.lastEffect=o),o}function q4(){return Qr().memoizedState}function Up(o,c,h,g){var _=gn();Ct.flags|=o,_.memoizedState=qu(1|c,{destroy:void 0},h,g===void 0?null:g)}function Hp(o,c,h,g){var _=Qr();g=g===void 0?null:g;var S=_.memoizedState.inst;mr!==null&&g!==null&&Gv(g,mr.memoizedState.deps)?_.memoizedState=qu(c,S,h,g):(Ct.flags|=o,_.memoizedState=qu(1|c,S,h,g))}function W4(o,c){Up(8390656,8,o,c)}function a1(o,c){Hp(2048,8,o,c)}function NI(o){Ct.flags|=4;var c=Ct.updateQueue;if(c===null)c=zp(),Ct.updateQueue=c,c.events=[o];else{var h=c.events;h===null?c.events=[o]:h.push(o)}}function V4(o){var c=Qr().memoizedState;return NI({ref:c,nextImpl:o}),function(){if((er&2)!==0)throw Error(a(440));return c.impl.apply(void 0,arguments)}}function G4(o,c){return Hp(4,2,o,c)}function K4(o,c){return Hp(4,4,o,c)}function Y4(o,c){if(typeof c=="function"){o=o();var h=c(o);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function X4(o,c,h){h=h!=null?h.concat([o]):null,Hp(4,4,Y4.bind(null,c,o),h)}function n1(){}function J4(o,c){var h=Qr();c=c===void 0?null:c;var g=h.memoizedState;return c!==null&&Gv(c,g[1])?g[0]:(h.memoizedState=[o,c],o)}function Q4(o,c){var h=Qr();c=c===void 0?null:c;var g=h.memoizedState;if(c!==null&&Gv(c,g[1]))return g[0];if(g=o(),lc){ea(!0);try{o()}finally{ea(!1)}}return h.memoizedState=[g,c],g}function s1(o,c,h){return h===void 0||(io&1073741824)!==0&&(Ht&261930)===0?o.memoizedState=c:(o.memoizedState=h,o=ZN(),Ct.lanes|=o,cl|=o,h)}function Z4(o,c,h,g){return Xn(h,c)?h:$u.current!==null?(o=s1(o,h,g),Xn(o,c)||(aa=!0),o):(io&42)===0||(io&1073741824)!==0&&(Ht&261930)===0?(aa=!0,o.memoizedState=h):(o=ZN(),Ct.lanes|=o,cl|=o,c)}function eN(o,c,h,g,_){var S=ce.p;ce.p=S!==0&&8>S?S:8;var M=U.T,J={};U.T=J,l1(o,!1,c,h);try{var we=_(),Re=U.S;if(Re!==null&&Re(J,we),we!==null&&typeof we=="object"&&typeof we.then=="function"){var qe=wI(we,g);V0(o,c,qe,rs(o))}else V0(o,c,g,rs(o))}catch(Ve){V0(o,c,{then:function(){},status:"rejected",reason:Ve},rs())}finally{ce.p=S,M!==null&&J.types!==null&&(M.types=J.types),U.T=M}}function CI(){}function i1(o,c,h,g){if(o.tag!==5)throw Error(a(476));var _=tN(o).queue;eN(o,_,c,xe,h===null?CI:function(){return rN(o),h(g)})}function tN(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oo,lastRenderedState:xe},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oo,lastRenderedState:h},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function rN(o){var c=tN(o);c.next===null&&(c=o.alternate.memoizedState),V0(o,c.next.queue,{},rs())}function o1(){return za(uf)}function aN(){return Qr().memoizedState}function nN(){return Qr().memoizedState}function TI(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var h=rs();o=al(h);var g=nl(c,o,h);g!==null&&(Rn(g,c,h),$0(g,c,h)),c={cache:Mv()},o.payload=c;return}c=c.return}}function EI(o,c,h){var g=rs();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},qp(o)?iN(c,h):(h=Sv(o,c,h,g),h!==null&&(Rn(h,o,g),oN(h,c,g)))}function sN(o,c,h){var g=rs();V0(o,c,h,g)}function V0(o,c,h,g){var _={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(qp(o))iN(c,_);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=c.lastRenderedReducer,S!==null))try{var M=c.lastRenderedState,J=S(M,h);if(_.hasEagerState=!0,_.eagerState=J,Xn(J,M))return kp(o,c,_,0),_r===null&&_p(),!1}catch(we){}if(h=Sv(o,c,_,g),h!==null)return Rn(h,o,g),oN(h,c,g),!0}return!1}function l1(o,c,h,g){if(g={lane:2,revertLane:B1(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},qp(o)){if(c)throw Error(a(479))}else c=Sv(o,h,g,2),c!==null&&Rn(c,o,2)}function qp(o){var c=o.alternate;return o===Ct||c!==null&&c===Ct}function iN(o,c){Uu=Lp=!0;var h=o.pending;h===null?c.next=c:(c.next=h.next,h.next=c),o.pending=c}function oN(o,c,h){if((h&4194048)!==0){var g=c.lanes;g&=o.pendingLanes,h|=g,c.lanes=h,Qi(o,h)}}var G0={readContext:za,use:Bp,useCallback:Ur,useContext:Ur,useEffect:Ur,useImperativeHandle:Ur,useLayoutEffect:Ur,useInsertionEffect:Ur,useMemo:Ur,useReducer:Ur,useRef:Ur,useState:Ur,useDebugValue:Ur,useDeferredValue:Ur,useTransition:Ur,useSyncExternalStore:Ur,useId:Ur,useHostTransitionStatus:Ur,useFormState:Ur,useActionState:Ur,useOptimistic:Ur,useMemoCache:Ur,useCacheRefresh:Ur};G0.useEffectEvent=Ur;var lN={readContext:za,use:Bp,useCallback:function(o,c){return gn().memoizedState=[o,c===void 0?null:c],o},useContext:za,useEffect:W4,useImperativeHandle:function(o,c,h){h=h!=null?h.concat([o]):null,Up(4194308,4,Y4.bind(null,c,o),h)},useLayoutEffect:function(o,c){return Up(4194308,4,o,c)},useInsertionEffect:function(o,c){Up(4,2,o,c)},useMemo:function(o,c){var h=gn();c=c===void 0?null:c;var g=o();if(lc){ea(!0);try{o()}finally{ea(!1)}}return h.memoizedState=[g,c],g},useReducer:function(o,c,h){var g=gn();if(h!==void 0){var _=h(c);if(lc){ea(!0);try{h(c)}finally{ea(!1)}}}else _=c;return g.memoizedState=g.baseState=_,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:_},g.queue=o,o=o.dispatch=EI.bind(null,Ct,o),[g.memoizedState,o]},useRef:function(o){var c=gn();return o={current:o},c.memoizedState=o},useState:function(o){o=t1(o);var c=o.queue,h=sN.bind(null,Ct,c);return c.dispatch=h,[o.memoizedState,h]},useDebugValue:n1,useDeferredValue:function(o,c){var h=gn();return s1(h,o,c)},useTransition:function(){var o=t1(!1);return o=eN.bind(null,Ct,o.queue,!0,!1),gn().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,h){var g=Ct,_=gn();if(Vt){if(h===void 0)throw Error(a(407));h=h()}else{if(h=c(),_r===null)throw Error(a(349));(Ht&127)!==0||E4(g,c,h)}_.memoizedState=h;var S={value:h,getSnapshot:c};return _.queue=S,W4(O4.bind(null,g,S,o),[o]),g.flags|=2048,qu(9,{destroy:void 0},A4.bind(null,g,S,h,c),null),h},useId:function(){var o=gn(),c=_r.identifierPrefix;if(Vt){var h=Ei,g=Ti;h=(g&~(1<<32-ma(g)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Ip++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=jI++,c="_"+c+"r_"+h.toString(32)+"_";return o.memoizedState=c},useHostTransitionStatus:o1,useFormState:B4,useActionState:B4,useOptimistic:function(o){var c=gn();c.memoizedState=c.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=l1.bind(null,Ct,!0,h),h.dispatch=c,[o,c]},useMemoCache:Qv,useCacheRefresh:function(){return gn().memoizedState=TI.bind(null,Ct)},useEffectEvent:function(o){var c=gn(),h={impl:o};return c.memoizedState=h,function(){if((er&2)!==0)throw Error(a(440));return h.impl.apply(void 0,arguments)}}},c1={readContext:za,use:Bp,useCallback:J4,useContext:za,useEffect:a1,useImperativeHandle:X4,useInsertionEffect:G4,useLayoutEffect:K4,useMemo:Q4,useReducer:$p,useRef:q4,useState:function(){return $p(oo)},useDebugValue:n1,useDeferredValue:function(o,c){var h=Qr();return Z4(h,mr.memoizedState,o,c)},useTransition:function(){var o=$p(oo)[0],c=Qr().memoizedState;return[typeof o=="boolean"?o:W0(o),c]},useSyncExternalStore:T4,useId:aN,useHostTransitionStatus:o1,useFormState:$4,useActionState:$4,useOptimistic:function(o,c){var h=Qr();return R4(h,mr,o,c)},useMemoCache:Qv,useCacheRefresh:nN};c1.useEffectEvent=V4;var cN={readContext:za,use:Bp,useCallback:J4,useContext:za,useEffect:a1,useImperativeHandle:X4,useInsertionEffect:G4,useLayoutEffect:K4,useMemo:Q4,useReducer:e1,useRef:q4,useState:function(){return e1(oo)},useDebugValue:n1,useDeferredValue:function(o,c){var h=Qr();return mr===null?s1(h,o,c):Z4(h,mr.memoizedState,o,c)},useTransition:function(){var o=e1(oo)[0],c=Qr().memoizedState;return[typeof o=="boolean"?o:W0(o),c]},useSyncExternalStore:T4,useId:aN,useHostTransitionStatus:o1,useFormState:H4,useActionState:H4,useOptimistic:function(o,c){var h=Qr();return mr!==null?R4(h,mr,o,c):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:Qv,useCacheRefresh:nN};cN.useEffectEvent=V4;function u1(o,c,h,g){c=o.memoizedState,h=h(g,c),h=h==null?c:m({},c,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var d1={enqueueSetState:function(o,c,h){o=o._reactInternals;var g=rs(),_=al(g);_.payload=c,h!=null&&(_.callback=h),c=nl(o,_,g),c!==null&&(Rn(c,o,g),$0(c,o,g))},enqueueReplaceState:function(o,c,h){o=o._reactInternals;var g=rs(),_=al(g);_.tag=1,_.payload=c,h!=null&&(_.callback=h),c=nl(o,_,g),c!==null&&(Rn(c,o,g),$0(c,o,g))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var h=rs(),g=al(h);g.tag=2,c!=null&&(g.callback=c),c=nl(o,g,h),c!==null&&(Rn(c,o,h),$0(c,o,h))}};function uN(o,c,h,g,_,S,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,S,M):c.prototype&&c.prototype.isPureReactComponent?!D0(h,g)||!D0(_,S):!0}function dN(o,c,h,g){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,g),c.state!==o&&d1.enqueueReplaceState(c,c.state,null)}function cc(o,c){var h=c;if("ref"in c){h={};for(var g in c)g!=="ref"&&(h[g]=c[g])}if(o=o.defaultProps){h===c&&(h=m({},h));for(var _ in o)h[_]===void 0&&(h[_]=o[_])}return h}function fN(o){jp(o)}function hN(o){console.error(o)}function pN(o){jp(o)}function Wp(o,c){try{var h=o.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(g){setTimeout(function(){throw g})}}function mN(o,c,h){try{var g=o.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function f1(o,c,h){return h=al(h),h.tag=3,h.payload={element:null},h.callback=function(){Wp(o,c)},h}function gN(o){return o=al(o),o.tag=3,o}function xN(o,c,h,g){var _=h.type.getDerivedStateFromError;if(typeof _=="function"){var S=g.value;o.payload=function(){return _(S)},o.callback=function(){mN(c,h,g)}}var M=h.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(o.callback=function(){mN(c,h,g),typeof _!="function"&&(ul===null?ul=new Set([this]):ul.add(this));var J=g.stack;this.componentDidCatch(g.value,{componentStack:J!==null?J:""})})}function AI(o,c,h,g,_){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(c=h.alternate,c!==null&&Mu(c,h,_,!0),h=Qn.current,h!==null){switch(h.tag){case 31:case 13:return As===null?am():h.alternate===null&&Hr===0&&(Hr=3),h.flags&=-257,h.flags|=65536,h.lanes=_,g===Pp?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([g]):c.add(g),L1(o,g,_)),!1;case 22:return h.flags|=65536,g===Pp?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([g]):h.add(g)),L1(o,g,_)),!1}throw Error(a(435,h.tag))}return L1(o,g,_),am(),!1}if(Vt)return c=Qn.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=_,g!==Ov&&(o=Error(a(422),{cause:g}),M0(Ns(o,h)))):(g!==Ov&&(c=Error(a(423),{cause:g}),M0(Ns(c,h))),o=o.current.alternate,o.flags|=65536,_&=-_,o.lanes|=_,g=Ns(g,h),_=f1(o.stateNode,g,_),Uv(o,_),Hr!==4&&(Hr=2)),!1;var S=Error(a(520),{cause:g});if(S=Ns(S,h),tf===null?tf=[S]:tf.push(S),Hr!==4&&(Hr=2),c===null)return!0;g=Ns(g,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,o=_&-_,h.lanes|=o,o=f1(h.stateNode,g,o),Uv(h,o),!1;case 1:if(c=h.type,S=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(ul===null||!ul.has(S))))return h.flags|=65536,_&=-_,h.lanes|=_,_=gN(_),xN(_,o,h,g),Uv(h,_),!1}h=h.return}while(h!==null);return!1}var h1=Error(a(461)),aa=!1;function Ba(o,c,h,g){c.child=o===null?w4(c,null,h,g):oc(c,o.child,h,g)}function yN(o,c,h,g,_){h=h.render;var S=c.ref;if("ref"in g){var M={};for(var J in g)J!=="ref"&&(M[J]=g[J])}else M=g;return ac(c),g=Kv(o,c,h,M,S,_),J=Yv(),o!==null&&!aa?(Xv(o,c,_),lo(o,c,_)):(Vt&&J&&Ev(c),c.flags|=1,Ba(o,c,g,_),c.child)}function vN(o,c,h,g,_){if(o===null){var S=h.type;return typeof S=="function"&&!Nv(S)&&S.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=S,bN(o,c,S,g,_)):(o=Np(h.type,null,g,c,c.mode,_),o.ref=c.ref,o.return=c,c.child=o)}if(S=o.child,!w1(o,_)){var M=S.memoizedProps;if(h=h.compare,h=h!==null?h:D0,h(M,g)&&o.ref===c.ref)return lo(o,c,_)}return c.flags|=1,o=ro(S,g),o.ref=c.ref,o.return=c,c.child=o}function bN(o,c,h,g,_){if(o!==null){var S=o.memoizedProps;if(D0(S,g)&&o.ref===c.ref)if(aa=!1,c.pendingProps=g=S,w1(o,_))(o.flags&131072)!==0&&(aa=!0);else return c.lanes=o.lanes,lo(o,c,_)}return p1(o,c,h,g,_)}function wN(o,c,h,g){var _=g.children,S=o!==null?o.memoizedState:null;if(o===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((c.flags&128)!==0){if(S=S!==null?S.baseLanes|h:h,o!==null){for(g=c.child=o.child,_=0;g!==null;)_=_|g.lanes|g.childLanes,g=g.sibling;g=_&~S}else g=0,c.child=null;return jN(o,c,S,h,g)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},o!==null&&Ap(c,S!==null?S.cachePool:null),S!==null?k4(c,S):qv(),S4(c);else return g=c.lanes=536870912,jN(o,c,S!==null?S.baseLanes|h:h,h,g)}else S!==null?(Ap(c,S.cachePool),k4(c,S),il(),c.memoizedState=null):(o!==null&&Ap(c,null),qv(),il());return Ba(o,c,_,h),c.child}function K0(o,c){return o!==null&&o.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function jN(o,c,h,g,_){var S=Iv();return S=S===null?null:{parent:ta._currentValue,pool:S},c.memoizedState={baseLanes:h,cachePool:S},o!==null&&Ap(c,null),qv(),S4(c),o!==null&&Mu(o,c,g,!0),c.childLanes=_,null}function Vp(o,c){return c=Kp({mode:c.mode,children:c.children},o.mode),c.ref=o.ref,o.child=c,c.return=o,c}function _N(o,c,h){return oc(c,o.child,null,h),o=Vp(c,c.pendingProps),o.flags|=2,Zn(c),c.memoizedState=null,o}function OI(o,c,h){var g=c.pendingProps,_=(c.flags&128)!==0;if(c.flags&=-129,o===null){if(Vt){if(g.mode==="hidden")return o=Vp(c,g),c.lanes=536870912,K0(null,o);if(Vv(c),(o=Cr)?(o=F3(o,Es),o=o!==null&&o.data==="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Qo!==null?{id:Ti,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},h=i4(o),h.return=c,c.child=h,Ia=c,Cr=null)):o=null,o===null)throw el(c);return c.lanes=536870912,null}return Vp(c,g)}var S=o.memoizedState;if(S!==null){var M=S.dehydrated;if(Vv(c),_)if(c.flags&256)c.flags&=-257,c=_N(o,c,h);else if(c.memoizedState!==null)c.child=o.child,c.flags|=128,c=null;else throw Error(a(558));else if(aa||Mu(o,c,h,!1),_=(h&o.childLanes)!==0,aa||_){if(g=_r,g!==null&&(M=Ne(g,h),M!==0&&M!==S.retryLane))throw S.retryLane=M,Zl(o,M),Rn(g,o,M),h1;am(),c=_N(o,c,h)}else o=S.treeContext,Cr=Os(M.nextSibling),Ia=c,Vt=!0,Zo=null,Es=!1,o!==null&&c4(c,o),c=Vp(c,g),c.flags|=4096;return c}return o=ro(o.child,{mode:g.mode,children:g.children}),o.ref=c.ref,c.child=o,o.return=c,o}function Gp(o,c){var h=c.ref;if(h===null)o!==null&&o.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(a(284));(o===null||o.ref!==h)&&(c.flags|=4194816)}}function p1(o,c,h,g,_){return ac(c),h=Kv(o,c,h,g,void 0,_),g=Yv(),o!==null&&!aa?(Xv(o,c,_),lo(o,c,_)):(Vt&&g&&Ev(c),c.flags|=1,Ba(o,c,h,_),c.child)}function kN(o,c,h,g,_,S){return ac(c),c.updateQueue=null,h=C4(c,g,h,_),N4(o),g=Yv(),o!==null&&!aa?(Xv(o,c,S),lo(o,c,S)):(Vt&&g&&Ev(c),c.flags|=1,Ba(o,c,h,S),c.child)}function SN(o,c,h,g,_){if(ac(c),c.stateNode===null){var S=Pu,M=h.contextType;typeof M=="object"&&M!==null&&(S=za(M)),S=new h(g,S),c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=d1,c.stateNode=S,S._reactInternals=c,S=c.stateNode,S.props=g,S.state=c.memoizedState,S.refs={},Bv(c),M=h.contextType,S.context=typeof M=="object"&&M!==null?za(M):Pu,S.state=c.memoizedState,M=h.getDerivedStateFromProps,typeof M=="function"&&(u1(c,h,M,g),S.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(M=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),M!==S.state&&d1.enqueueReplaceState(S,S.state,null),H0(c,g,S,_),U0(),S.state=c.memoizedState),typeof S.componentDidMount=="function"&&(c.flags|=4194308),g=!0}else if(o===null){S=c.stateNode;var J=c.memoizedProps,we=cc(h,J);S.props=we;var Re=S.context,qe=h.contextType;M=Pu,typeof qe=="object"&&qe!==null&&(M=za(qe));var Ve=h.getDerivedStateFromProps;qe=typeof Ve=="function"||typeof S.getSnapshotBeforeUpdate=="function",J=c.pendingProps!==J,qe||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(J||Re!==M)&&dN(c,S,g,M),rl=!1;var Ie=c.memoizedState;S.state=Ie,H0(c,g,S,_),U0(),Re=c.memoizedState,J||Ie!==Re||rl?(typeof Ve=="function"&&(u1(c,h,Ve,g),Re=c.memoizedState),(we=rl||uN(c,h,we,g,Ie,Re,M))?(qe||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(c.flags|=4194308)):(typeof S.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=Re),S.props=g,S.state=Re,S.context=M,g=we):(typeof S.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{S=c.stateNode,$v(o,c),M=c.memoizedProps,qe=cc(h,M),S.props=qe,Ve=c.pendingProps,Ie=S.context,Re=h.contextType,we=Pu,typeof Re=="object"&&Re!==null&&(we=za(Re)),J=h.getDerivedStateFromProps,(Re=typeof J=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==Ve||Ie!==we)&&dN(c,S,g,we),rl=!1,Ie=c.memoizedState,S.state=Ie,H0(c,g,S,_),U0();var ze=c.memoizedState;M!==Ve||Ie!==ze||rl||o!==null&&o.dependencies!==null&&Tp(o.dependencies)?(typeof J=="function"&&(u1(c,h,J,g),ze=c.memoizedState),(qe=rl||uN(c,h,qe,g,Ie,ze,we)||o!==null&&o.dependencies!==null&&Tp(o.dependencies))?(Re||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(g,ze,we),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(g,ze,we)),typeof S.componentDidUpdate=="function"&&(c.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof S.componentDidUpdate!="function"||M===o.memoizedProps&&Ie===o.memoizedState||(c.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&Ie===o.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=ze),S.props=g,S.state=ze,S.context=we,g=qe):(typeof S.componentDidUpdate!="function"||M===o.memoizedProps&&Ie===o.memoizedState||(c.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===o.memoizedProps&&Ie===o.memoizedState||(c.flags|=1024),g=!1)}return S=g,Gp(o,c),g=(c.flags&128)!==0,S||g?(S=c.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:S.render(),c.flags|=1,o!==null&&g?(c.child=oc(c,o.child,null,_),c.child=oc(c,null,h,_)):Ba(o,c,h,_),c.memoizedState=S.state,o=c.child):o=lo(o,c,_),o}function NN(o,c,h,g){return tc(),c.flags|=256,Ba(o,c,h,g),c.child}var m1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function g1(o){return{baseLanes:o,cachePool:m4()}}function x1(o,c,h){return o=o!==null?o.childLanes&~h:0,c&&(o|=ts),o}function CN(o,c,h){var g=c.pendingProps,_=!1,S=(c.flags&128)!==0,M;if((M=S)||(M=o!==null&&o.memoizedState===null?!1:(Jr.current&2)!==0),M&&(_=!0,c.flags&=-129),M=(c.flags&32)!==0,c.flags&=-33,o===null){if(Vt){if(_?sl(c):il(),(o=Cr)?(o=F3(o,Es),o=o!==null&&o.data!=="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Qo!==null?{id:Ti,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},h=i4(o),h.return=c,c.child=h,Ia=c,Cr=null)):o=null,o===null)throw el(c);return Z1(o)?c.lanes=32:c.lanes=536870912,null}var J=g.children;return g=g.fallback,_?(il(),_=c.mode,J=Kp({mode:"hidden",children:J},_),g=ec(g,_,h,null),J.return=c,g.return=c,J.sibling=g,c.child=J,g=c.child,g.memoizedState=g1(h),g.childLanes=x1(o,M,h),c.memoizedState=m1,K0(null,g)):(sl(c),y1(c,J))}var we=o.memoizedState;if(we!==null&&(J=we.dehydrated,J!==null)){if(S)c.flags&256?(sl(c),c.flags&=-257,c=v1(o,c,h)):c.memoizedState!==null?(il(),c.child=o.child,c.flags|=128,c=null):(il(),J=g.fallback,_=c.mode,g=Kp({mode:"visible",children:g.children},_),J=ec(J,_,h,null),J.flags|=2,g.return=c,J.return=c,g.sibling=J,c.child=g,oc(c,o.child,null,h),g=c.child,g.memoizedState=g1(h),g.childLanes=x1(o,M,h),c.memoizedState=m1,c=K0(null,g));else if(sl(c),Z1(J)){if(M=J.nextSibling&&J.nextSibling.dataset,M)var Re=M.dgst;M=Re,g=Error(a(419)),g.stack="",g.digest=M,M0({value:g,source:null,stack:null}),c=v1(o,c,h)}else if(aa||Mu(o,c,h,!1),M=(h&o.childLanes)!==0,aa||M){if(M=_r,M!==null&&(g=Ne(M,h),g!==0&&g!==we.retryLane))throw we.retryLane=g,Zl(o,g),Rn(M,o,g),h1;Q1(J)||am(),c=v1(o,c,h)}else Q1(J)?(c.flags|=192,c.child=o.child,c=null):(o=we.treeContext,Cr=Os(J.nextSibling),Ia=c,Vt=!0,Zo=null,Es=!1,o!==null&&c4(c,o),c=y1(c,g.children),c.flags|=4096);return c}return _?(il(),J=g.fallback,_=c.mode,we=o.child,Re=we.sibling,g=ro(we,{mode:"hidden",children:g.children}),g.subtreeFlags=we.subtreeFlags&65011712,Re!==null?J=ro(Re,J):(J=ec(J,_,h,null),J.flags|=2),J.return=c,g.return=c,g.sibling=J,c.child=g,K0(null,g),g=c.child,J=o.child.memoizedState,J===null?J=g1(h):(_=J.cachePool,_!==null?(we=ta._currentValue,_=_.parent!==we?{parent:we,pool:we}:_):_=m4(),J={baseLanes:J.baseLanes|h,cachePool:_}),g.memoizedState=J,g.childLanes=x1(o,M,h),c.memoizedState=m1,K0(o.child,g)):(sl(c),h=o.child,o=h.sibling,h=ro(h,{mode:"visible",children:g.children}),h.return=c,h.sibling=null,o!==null&&(M=c.deletions,M===null?(c.deletions=[o],c.flags|=16):M.push(o)),c.child=h,c.memoizedState=null,h)}function y1(o,c){return c=Kp({mode:"visible",children:c},o.mode),c.return=o,o.child=c}function Kp(o,c){return o=Jn(22,o,null,c),o.lanes=0,o}function v1(o,c,h){return oc(c,o.child,null,h),o=y1(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function TN(o,c,h){o.lanes|=c;var g=o.alternate;g!==null&&(g.lanes|=c),Rv(o.return,c,h)}function b1(o,c,h,g,_,S){var M=o.memoizedState;M===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:_,treeForkCount:S}:(M.isBackwards=c,M.rendering=null,M.renderingStartTime=0,M.last=g,M.tail=h,M.tailMode=_,M.treeForkCount=S)}function EN(o,c,h){var g=c.pendingProps,_=g.revealOrder,S=g.tail;g=g.children;var M=Jr.current,J=(M&2)!==0;if(J?(M=M&1|2,c.flags|=128):M&=1,H(Jr,M),Ba(o,c,g,h),g=Vt?F0:0,!J&&o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&TN(o,h,c);else if(o.tag===19)TN(o,h,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(_){case"forwards":for(h=c.child,_=null;h!==null;)o=h.alternate,o!==null&&Mp(o)===null&&(_=h),h=h.sibling;h=_,h===null?(_=c.child,c.child=null):(_=h.sibling,h.sibling=null),b1(c,!1,_,h,S,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,_=c.child,c.child=null;_!==null;){if(o=_.alternate,o!==null&&Mp(o)===null){c.child=_;break}o=_.sibling,_.sibling=h,h=_,_=o}b1(c,!0,h,null,S,g);break;case"together":b1(c,!1,null,null,void 0,g);break;default:c.memoizedState=null}return c.child}function lo(o,c,h){if(o!==null&&(c.dependencies=o.dependencies),cl|=c.lanes,(h&c.childLanes)===0)if(o!==null){if(Mu(o,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(o!==null&&c.child!==o.child)throw Error(a(153));if(c.child!==null){for(o=c.child,h=ro(o,o.pendingProps),c.child=h,h.return=c;o.sibling!==null;)o=o.sibling,h=h.sibling=ro(o,o.pendingProps),h.return=c;h.sibling=null}return c.child}function w1(o,c){return(o.lanes&c)!==0?!0:(o=o.dependencies,!!(o!==null&&Tp(o)))}function PI(o,c,h){switch(c.tag){case 3:ie(c,c.stateNode.containerInfo),tl(c,ta,o.memoizedState.cache),tc();break;case 27:case 5:he(c);break;case 4:ie(c,c.stateNode.containerInfo);break;case 10:tl(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Vv(c),null;break;case 13:var g=c.memoizedState;if(g!==null)return g.dehydrated!==null?(sl(c),c.flags|=128,null):(h&c.child.childLanes)!==0?CN(o,c,h):(sl(c),o=lo(o,c,h),o!==null?o.sibling:null);sl(c);break;case 19:var _=(o.flags&128)!==0;if(g=(h&c.childLanes)!==0,g||(Mu(o,c,h,!1),g=(h&c.childLanes)!==0),_){if(g)return EN(o,c,h);c.flags|=128}if(_=c.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),H(Jr,Jr.current),g)break;return null;case 22:return c.lanes=0,wN(o,c,h,c.pendingProps);case 24:tl(c,ta,o.memoizedState.cache)}return lo(o,c,h)}function AN(o,c,h){if(o!==null)if(o.memoizedProps!==c.pendingProps)aa=!0;else{if(!w1(o,h)&&(c.flags&128)===0)return aa=!1,PI(o,c,h);aa=(o.flags&131072)!==0}else aa=!1,Vt&&(c.flags&1048576)!==0&&l4(c,F0,c.index);switch(c.lanes=0,c.tag){case 16:e:{var g=c.pendingProps;if(o=sc(c.elementType),c.type=o,typeof o=="function")Nv(o)?(g=cc(o,g),c.tag=1,c=SN(null,c,o,g,h)):(c.tag=0,c=p1(null,c,o,g,h));else{if(o!=null){var _=o.$$typeof;if(_===O){c.tag=11,c=yN(null,c,o,g,h);break e}else if(_===T){c.tag=14,c=vN(null,c,o,g,h);break e}}throw c=ge(o)||o,Error(a(306,c,""))}}return c;case 0:return p1(o,c,c.type,c.pendingProps,h);case 1:return g=c.type,_=cc(g,c.pendingProps),SN(o,c,g,_,h);case 3:e:{if(ie(c,c.stateNode.containerInfo),o===null)throw Error(a(387));g=c.pendingProps;var S=c.memoizedState;_=S.element,$v(o,c),H0(c,g,null,h);var M=c.memoizedState;if(g=M.cache,tl(c,ta,g),g!==S.cache&&Fv(c,[ta],h,!0),U0(),g=M.element,S.isDehydrated)if(S={element:g,isDehydrated:!1,cache:M.cache},c.updateQueue.baseState=S,c.memoizedState=S,c.flags&256){c=NN(o,c,g,h);break e}else if(g!==_){_=Ns(Error(a(424)),c),M0(_),c=NN(o,c,g,h);break e}else for(o=c.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,Cr=Os(o.firstChild),Ia=c,Vt=!0,Zo=null,Es=!0,h=w4(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(tc(),g===_){c=lo(o,c,h);break e}Ba(o,c,g,h)}c=c.child}return c;case 26:return Gp(o,c),o===null?(h=$3(c.type,null,c.pendingProps,null))?c.memoizedState=h:Vt||(h=c.type,o=c.pendingProps,g=um(re.current).createElement(h),g[ae]=c,g[ue]=o,$a(g,h,o),lt(g),c.stateNode=g):c.memoizedState=$3(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return he(c),o===null&&Vt&&(g=c.stateNode=I3(c.type,c.pendingProps,re.current),Ia=c,Es=!0,_=Cr,pl(c.type)?(eb=_,Cr=Os(g.firstChild)):Cr=_),Ba(o,c,c.pendingProps.children,h),Gp(o,c),o===null&&(c.flags|=4194304),c.child;case 5:return o===null&&Vt&&((_=g=Cr)&&(g=lz(g,c.type,c.pendingProps,Es),g!==null?(c.stateNode=g,Ia=c,Cr=Os(g.firstChild),Es=!1,_=!0):_=!1),_||el(c)),he(c),_=c.type,S=c.pendingProps,M=o!==null?o.memoizedProps:null,g=S.children,Y1(_,S)?g=null:M!==null&&Y1(_,M)&&(c.flags|=32),c.memoizedState!==null&&(_=Kv(o,c,_I,null,null,h),uf._currentValue=_),Gp(o,c),Ba(o,c,g,h),c.child;case 6:return o===null&&Vt&&((o=h=Cr)&&(h=cz(h,c.pendingProps,Es),h!==null?(c.stateNode=h,Ia=c,Cr=null,o=!0):o=!1),o||el(c)),null;case 13:return CN(o,c,h);case 4:return ie(c,c.stateNode.containerInfo),g=c.pendingProps,o===null?c.child=oc(c,null,g,h):Ba(o,c,g,h),c.child;case 11:return yN(o,c,c.type,c.pendingProps,h);case 7:return Ba(o,c,c.pendingProps,h),c.child;case 8:return Ba(o,c,c.pendingProps.children,h),c.child;case 12:return Ba(o,c,c.pendingProps.children,h),c.child;case 10:return g=c.pendingProps,tl(c,c.type,g.value),Ba(o,c,g.children,h),c.child;case 9:return _=c.type._context,g=c.pendingProps.children,ac(c),_=za(_),g=g(_),c.flags|=1,Ba(o,c,g,h),c.child;case 14:return vN(o,c,c.type,c.pendingProps,h);case 15:return bN(o,c,c.type,c.pendingProps,h);case 19:return EN(o,c,h);case 31:return OI(o,c,h);case 22:return wN(o,c,h,c.pendingProps);case 24:return ac(c),g=za(ta),o===null?(_=Iv(),_===null&&(_=_r,S=Mv(),_.pooledCache=S,S.refCount++,S!==null&&(_.pooledCacheLanes|=h),_=S),c.memoizedState={parent:g,cache:_},Bv(c),tl(c,ta,_)):((o.lanes&h)!==0&&($v(o,c),H0(c,null,null,h),U0()),_=o.memoizedState,S=c.memoizedState,_.parent!==g?(_={parent:g,cache:g},c.memoizedState=_,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=_),tl(c,ta,g)):(g=S.cache,tl(c,ta,g),g!==_.cache&&Fv(c,[ta],h,!0))),Ba(o,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(a(156,c.tag))}function co(o){o.flags|=4}function j1(o,c,h,g,_){if((c=(o.mode&32)!==0)&&(c=!1),c){if(o.flags|=16777216,(_&335544128)===_)if(o.stateNode.complete)o.flags|=8192;else if(a3())o.flags|=8192;else throw ic=Pp,zv}else o.flags&=-16777217}function ON(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!V3(c))if(a3())o.flags|=8192;else throw ic=Pp,zv}function Yp(o,c){c!==null&&(o.flags|=4),o.flags&16384&&(c=o.tag!==22?Gl():536870912,o.lanes|=c,Ku|=c)}function Y0(o,c){if(!Vt)switch(o.tailMode){case"hidden":c=o.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Tr(o){var c=o.alternate!==null&&o.alternate.child===o.child,h=0,g=0;if(c)for(var _=o.child;_!==null;)h|=_.lanes|_.childLanes,g|=_.subtreeFlags&65011712,g|=_.flags&65011712,_.return=o,_=_.sibling;else for(_=o.child;_!==null;)h|=_.lanes|_.childLanes,g|=_.subtreeFlags,g|=_.flags,_.return=o,_=_.sibling;return o.subtreeFlags|=g,o.childLanes=h,c}function DI(o,c,h){var g=c.pendingProps;switch(Av(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tr(c),null;case 1:return Tr(c),null;case 3:return h=c.stateNode,g=null,o!==null&&(g=o.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),so(ta),se(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Fu(c)?co(c):o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Pv())),Tr(c),null;case 26:var _=c.type,S=c.memoizedState;return o===null?(co(c),S!==null?(Tr(c),ON(c,S)):(Tr(c),j1(c,_,null,g,h))):S?S!==o.memoizedState?(co(c),Tr(c),ON(c,S)):(Tr(c),c.flags&=-16777217):(o=o.memoizedProps,o!==g&&co(c),Tr(c),j1(c,_,o,g,h)),null;case 27:if(_e(c),h=re.current,_=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==g&&co(c);else{if(!g){if(c.stateNode===null)throw Error(a(166));return Tr(c),null}o=K.current,Fu(c)?u4(c):(o=I3(_,g,h),c.stateNode=o,co(c))}return Tr(c),null;case 5:if(_e(c),_=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==g&&co(c);else{if(!g){if(c.stateNode===null)throw Error(a(166));return Tr(c),null}if(S=K.current,Fu(c))u4(c);else{var M=um(re.current);switch(S){case 1:S=M.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:S=M.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":S=M.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":S=M.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":S=M.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof g.is=="string"?M.createElement("select",{is:g.is}):M.createElement("select"),g.multiple?S.multiple=!0:g.size&&(S.size=g.size);break;default:S=typeof g.is=="string"?M.createElement(_,{is:g.is}):M.createElement(_)}}S[ae]=c,S[ue]=g;e:for(M=c.child;M!==null;){if(M.tag===5||M.tag===6)S.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===c)break e;for(;M.sibling===null;){if(M.return===null||M.return===c)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}c.stateNode=S;e:switch($a(S,_,g),_){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&co(c)}}return Tr(c),j1(c,c.type,o===null?null:o.memoizedProps,c.pendingProps,h),null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==g&&co(c);else{if(typeof g!="string"&&c.stateNode===null)throw Error(a(166));if(o=re.current,Fu(c)){if(o=c.stateNode,h=c.memoizedProps,g=null,_=Ia,_!==null)switch(_.tag){case 27:case 5:g=_.memoizedProps}o[ae]=c,o=!!(o.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||C3(o.nodeValue,h)),o||el(c,!0)}else o=um(o).createTextNode(g),o[ae]=c,c.stateNode=o}return Tr(c),null;case 31:if(h=c.memoizedState,o===null||o.memoizedState!==null){if(g=Fu(c),h!==null){if(o===null){if(!g)throw Error(a(318));if(o=c.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(a(557));o[ae]=c}else tc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Tr(c),o=!1}else h=Pv(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return c.flags&256?(Zn(c),c):(Zn(c),null);if((c.flags&128)!==0)throw Error(a(558))}return Tr(c),null;case 13:if(g=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(_=Fu(c),g!==null&&g.dehydrated!==null){if(o===null){if(!_)throw Error(a(318));if(_=c.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(a(317));_[ae]=c}else tc(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Tr(c),_=!1}else _=Pv(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=_),_=!0;if(!_)return c.flags&256?(Zn(c),c):(Zn(c),null)}return Zn(c),(c.flags&128)!==0?(c.lanes=h,c):(h=g!==null,o=o!==null&&o.memoizedState!==null,h&&(g=c.child,_=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(_=g.alternate.memoizedState.cachePool.pool),S=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(S=g.memoizedState.cachePool.pool),S!==_&&(g.flags|=2048)),h!==o&&h&&(c.child.flags|=8192),Yp(c,c.updateQueue),Tr(c),null);case 4:return se(),o===null&&q1(c.stateNode.containerInfo),Tr(c),null;case 10:return so(c.type),Tr(c),null;case 19:if(L(Jr),g=c.memoizedState,g===null)return Tr(c),null;if(_=(c.flags&128)!==0,S=g.rendering,S===null)if(_)Y0(g,!1);else{if(Hr!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(S=Mp(o),S!==null){for(c.flags|=128,Y0(g,!1),o=S.updateQueue,c.updateQueue=o,Yp(c,o),c.subtreeFlags=0,o=h,h=c.child;h!==null;)s4(h,o),h=h.sibling;return H(Jr,Jr.current&1|2),Vt&&ao(c,g.treeForkCount),c.child}o=o.sibling}g.tail!==null&&tt()>em&&(c.flags|=128,_=!0,Y0(g,!1),c.lanes=4194304)}else{if(!_)if(o=Mp(S),o!==null){if(c.flags|=128,_=!0,o=o.updateQueue,c.updateQueue=o,Yp(c,o),Y0(g,!0),g.tail===null&&g.tailMode==="hidden"&&!S.alternate&&!Vt)return Tr(c),null}else 2*tt()-g.renderingStartTime>em&&h!==536870912&&(c.flags|=128,_=!0,Y0(g,!1),c.lanes=4194304);g.isBackwards?(S.sibling=c.child,c.child=S):(o=g.last,o!==null?o.sibling=S:c.child=S,g.last=S)}return g.tail!==null?(o=g.tail,g.rendering=o,g.tail=o.sibling,g.renderingStartTime=tt(),o.sibling=null,h=Jr.current,H(Jr,_?h&1|2:h&1),Vt&&ao(c,g.treeForkCount),o):(Tr(c),null);case 22:case 23:return Zn(c),Wv(),g=c.memoizedState!==null,o!==null?o.memoizedState!==null!==g&&(c.flags|=8192):g&&(c.flags|=8192),g?(h&536870912)!==0&&(c.flags&128)===0&&(Tr(c),c.subtreeFlags&6&&(c.flags|=8192)):Tr(c),h=c.updateQueue,h!==null&&Yp(c,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048),o!==null&&L(nc),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),so(ta),Tr(c),null;case 25:return null;case 30:return null}throw Error(a(156,c.tag))}function RI(o,c){switch(Av(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return so(ta),se(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return _e(c),null;case 31:if(c.memoizedState!==null){if(Zn(c),c.alternate===null)throw Error(a(340));tc()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 13:if(Zn(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(a(340));tc()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return L(Jr),null;case 4:return se(),null;case 10:return so(c.type),null;case 22:case 23:return Zn(c),Wv(),o!==null&&L(nc),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return so(ta),null;case 25:return null;default:return null}}function PN(o,c){switch(Av(c),c.tag){case 3:so(ta),se();break;case 26:case 27:case 5:_e(c);break;case 4:se();break;case 31:c.memoizedState!==null&&Zn(c);break;case 13:Zn(c);break;case 19:L(Jr);break;case 10:so(c.type);break;case 22:case 23:Zn(c),Wv(),o!==null&&L(nc);break;case 24:so(ta)}}function X0(o,c){try{var h=c.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var _=g.next;h=_;do{if((h.tag&o)===o){g=void 0;var S=h.create,M=h.inst;g=S(),M.destroy=g}h=h.next}while(h!==_)}}catch(J){cr(c,c.return,J)}}function ol(o,c,h){try{var g=c.updateQueue,_=g!==null?g.lastEffect:null;if(_!==null){var S=_.next;g=S;do{if((g.tag&o)===o){var M=g.inst,J=M.destroy;if(J!==void 0){M.destroy=void 0,_=c;var we=h,Re=J;try{Re()}catch(qe){cr(_,we,qe)}}}g=g.next}while(g!==S)}}catch(qe){cr(c,c.return,qe)}}function DN(o){var c=o.updateQueue;if(c!==null){var h=o.stateNode;try{_4(c,h)}catch(g){cr(o,o.return,g)}}}function RN(o,c,h){h.props=cc(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(g){cr(o,c,g)}}function J0(o,c){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var g=o.stateNode;break;case 30:g=o.stateNode;break;default:g=o.stateNode}typeof h=="function"?o.refCleanup=h(g):h.current=g}}catch(_){cr(o,c,_)}}function Ai(o,c){var h=o.ref,g=o.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(_){cr(o,c,_)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(_){cr(o,c,_)}else h.current=null}function FN(o){var c=o.type,h=o.memoizedProps,g=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(_){cr(o,o.return,_)}}function _1(o,c,h){try{var g=o.stateNode;rz(g,o.type,h,c),g[ue]=c}catch(_){cr(o,o.return,_)}}function MN(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&pl(o.type)||o.tag===4}function k1(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||MN(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&pl(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function S1(o,c,h){var g=o.tag;if(g===5||g===6)o=o.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(o),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=eo));else if(g!==4&&(g===27&&pl(o.type)&&(h=o.stateNode,c=null),o=o.child,o!==null))for(S1(o,c,h),o=o.sibling;o!==null;)S1(o,c,h),o=o.sibling}function Xp(o,c,h){var g=o.tag;if(g===5||g===6)o=o.stateNode,c?h.insertBefore(o,c):h.appendChild(o);else if(g!==4&&(g===27&&pl(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(Xp(o,c,h),o=o.sibling;o!==null;)Xp(o,c,h),o=o.sibling}function LN(o){var c=o.stateNode,h=o.memoizedProps;try{for(var g=o.type,_=c.attributes;_.length;)c.removeAttributeNode(_[0]);$a(c,g,h),c[ae]=o,c[ue]=h}catch(S){cr(o,o.return,S)}}var uo=!1,na=!1,N1=!1,IN=typeof WeakSet=="function"?WeakSet:Set,Na=null;function FI(o,c){if(o=o.containerInfo,G1=xm,o=XS(o),vv(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var _=g.anchorOffset,S=g.focusNode;g=g.focusOffset;try{h.nodeType,S.nodeType}catch(jt){h=null;break e}var M=0,J=-1,we=-1,Re=0,qe=0,Ve=o,Ie=null;t:for(;;){for(var ze;Ve!==h||_!==0&&Ve.nodeType!==3||(J=M+_),Ve!==S||g!==0&&Ve.nodeType!==3||(we=M+g),Ve.nodeType===3&&(M+=Ve.nodeValue.length),(ze=Ve.firstChild)!==null;)Ie=Ve,Ve=ze;for(;;){if(Ve===o)break t;if(Ie===h&&++Re===_&&(J=M),Ie===S&&++qe===g&&(we=M),(ze=Ve.nextSibling)!==null)break;Ve=Ie,Ie=Ve.parentNode}Ve=ze}h=J===-1||we===-1?null:{start:J,end:we}}else h=null}h=h||{start:0,end:0}}else h=null;for(K1={focusedElem:o,selectionRange:h},xm=!1,Na=c;Na!==null;)if(c=Na,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,Na=o;else for(;Na!==null;){switch(c=Na,S=c.alternate,o=c.flags,c.tag){case 0:if((o&4)!==0&&(o=c.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)_=o[h],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&S!==null){o=void 0,h=c,_=S.memoizedProps,S=S.memoizedState,g=h.stateNode;try{var ft=cc(h.type,_);o=g.getSnapshotBeforeUpdate(ft,S),g.__reactInternalSnapshotBeforeUpdate=o}catch(jt){cr(h,h.return,jt)}}break;case 3:if((o&1024)!==0){if(o=c.stateNode.containerInfo,h=o.nodeType,h===9)J1(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":J1(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(a(163))}if(o=c.sibling,o!==null){o.return=c.return,Na=o;break}Na=c.return}}function zN(o,c,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:ho(o,h),g&4&&X0(5,h);break;case 1:if(ho(o,h),g&4)if(o=h.stateNode,c===null)try{o.componentDidMount()}catch(M){cr(h,h.return,M)}else{var _=cc(h.type,c.memoizedProps);c=c.memoizedState;try{o.componentDidUpdate(_,c,o.__reactInternalSnapshotBeforeUpdate)}catch(M){cr(h,h.return,M)}}g&64&&DN(h),g&512&&J0(h,h.return);break;case 3:if(ho(o,h),g&64&&(o=h.updateQueue,o!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{_4(o,c)}catch(M){cr(h,h.return,M)}}break;case 27:c===null&&g&4&&LN(h);case 26:case 5:ho(o,h),c===null&&g&4&&FN(h),g&512&&J0(h,h.return);break;case 12:ho(o,h);break;case 31:ho(o,h),g&4&&UN(o,h);break;case 13:ho(o,h),g&4&&HN(o,h),g&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=qI.bind(null,h),uz(o,h))));break;case 22:if(g=h.memoizedState!==null||uo,!g){c=c!==null&&c.memoizedState!==null||na,_=uo;var S=na;uo=g,(na=c)&&!S?po(o,h,(h.subtreeFlags&8772)!==0):ho(o,h),uo=_,na=S}break;case 30:break;default:ho(o,h)}}function BN(o){var c=o.alternate;c!==null&&(o.alternate=null,BN(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&Ye(c)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Dr=null,An=!1;function fo(o,c,h){for(h=h.child;h!==null;)$N(o,c,h),h=h.sibling}function $N(o,c,h){if(jr&&typeof jr.onCommitFiberUnmount=="function")try{jr.onCommitFiberUnmount(Xr,h)}catch(S){}switch(h.tag){case 26:na||Ai(h,c),fo(o,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:na||Ai(h,c);var g=Dr,_=An;pl(h.type)&&(Dr=h.stateNode,An=!1),fo(o,c,h),of(h.stateNode),Dr=g,An=_;break;case 5:na||Ai(h,c);case 6:if(g=Dr,_=An,Dr=null,fo(o,c,h),Dr=g,An=_,Dr!==null)if(An)try{(Dr.nodeType===9?Dr.body:Dr.nodeName==="HTML"?Dr.ownerDocument.body:Dr).removeChild(h.stateNode)}catch(S){cr(h,c,S)}else try{Dr.removeChild(h.stateNode)}catch(S){cr(h,c,S)}break;case 18:Dr!==null&&(An?(o=Dr,D3(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),rd(o)):D3(Dr,h.stateNode));break;case 4:g=Dr,_=An,Dr=h.stateNode.containerInfo,An=!0,fo(o,c,h),Dr=g,An=_;break;case 0:case 11:case 14:case 15:ol(2,h,c),na||ol(4,h,c),fo(o,c,h);break;case 1:na||(Ai(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"&&RN(h,c,g)),fo(o,c,h);break;case 21:fo(o,c,h);break;case 22:na=(g=na)||h.memoizedState!==null,fo(o,c,h),na=g;break;default:fo(o,c,h)}}function UN(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{rd(o)}catch(h){cr(c,c.return,h)}}}function HN(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{rd(o)}catch(h){cr(c,c.return,h)}}function MI(o){switch(o.tag){case 31:case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new IN),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new IN),c;default:throw Error(a(435,o.tag))}}function Jp(o,c){var h=MI(o);c.forEach(function(g){if(!h.has(g)){h.add(g);var _=WI.bind(null,o,g);g.then(_,_)}})}function On(o,c){var h=c.deletions;if(h!==null)for(var g=0;g<h.length;g++){var _=h[g],S=o,M=c,J=M;e:for(;J!==null;){switch(J.tag){case 27:if(pl(J.type)){Dr=J.stateNode,An=!1;break e}break;case 5:Dr=J.stateNode,An=!1;break e;case 3:case 4:Dr=J.stateNode.containerInfo,An=!0;break e}J=J.return}if(Dr===null)throw Error(a(160));$N(S,M,_),Dr=null,An=!1,S=_.alternate,S!==null&&(S.return=null),_.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)qN(c,o),c=c.sibling}var Zs=null;function qN(o,c){var h=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:On(c,o),Pn(o),g&4&&(ol(3,o,o.return),X0(3,o),ol(5,o,o.return));break;case 1:On(c,o),Pn(o),g&512&&(na||h===null||Ai(h,h.return)),g&64&&uo&&(o=o.updateQueue,o!==null&&(g=o.callbacks,g!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var _=Zs;if(On(c,o),Pn(o),g&512&&(na||h===null||Ai(h,h.return)),g&4){var S=h!==null?h.memoizedState:null;if(g=o.memoizedState,h===null)if(g===null)if(o.stateNode===null){e:{g=o.type,h=o.memoizedProps,_=_.ownerDocument||_;t:switch(g){case"title":S=_.getElementsByTagName("title")[0],(!S||S[Le]||S[ae]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=_.createElement(g),_.head.insertBefore(S,_.querySelector("head > title"))),$a(S,g,h),S[ae]=o,lt(S),g=S;break e;case"link":var M=q3("link","href",_).get(g+(h.href||""));if(M){for(var J=0;J<M.length;J++)if(S=M[J],S.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&S.getAttribute("rel")===(h.rel==null?null:h.rel)&&S.getAttribute("title")===(h.title==null?null:h.title)&&S.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){M.splice(J,1);break t}}S=_.createElement(g),$a(S,g,h),_.head.appendChild(S);break;case"meta":if(M=q3("meta","content",_).get(g+(h.content||""))){for(J=0;J<M.length;J++)if(S=M[J],S.getAttribute("content")===(h.content==null?null:""+h.content)&&S.getAttribute("name")===(h.name==null?null:h.name)&&S.getAttribute("property")===(h.property==null?null:h.property)&&S.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&S.getAttribute("charset")===(h.charSet==null?null:h.charSet)){M.splice(J,1);break t}}S=_.createElement(g),$a(S,g,h),_.head.appendChild(S);break;default:throw Error(a(468,g))}S[ae]=o,lt(S),g=S}o.stateNode=g}else W3(_,o.type,o.stateNode);else o.stateNode=H3(_,g,o.memoizedProps);else S!==g?(S===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):S.count--,g===null?W3(_,o.type,o.stateNode):H3(_,g,o.memoizedProps)):g===null&&o.stateNode!==null&&_1(o,o.memoizedProps,h.memoizedProps)}break;case 27:On(c,o),Pn(o),g&512&&(na||h===null||Ai(h,h.return)),h!==null&&g&4&&_1(o,o.memoizedProps,h.memoizedProps);break;case 5:if(On(c,o),Pn(o),g&512&&(na||h===null||Ai(h,h.return)),o.flags&32){_=o.stateNode;try{Su(_,"")}catch(ft){cr(o,o.return,ft)}}g&4&&o.stateNode!=null&&(_=o.memoizedProps,_1(o,_,h!==null?h.memoizedProps:_)),g&1024&&(N1=!0);break;case 6:if(On(c,o),Pn(o),g&4){if(o.stateNode===null)throw Error(a(162));g=o.memoizedProps,h=o.stateNode;try{h.nodeValue=g}catch(ft){cr(o,o.return,ft)}}break;case 3:if(hm=null,_=Zs,Zs=dm(c.containerInfo),On(c,o),Zs=_,Pn(o),g&4&&h!==null&&h.memoizedState.isDehydrated)try{rd(c.containerInfo)}catch(ft){cr(o,o.return,ft)}N1&&(N1=!1,WN(o));break;case 4:g=Zs,Zs=dm(o.stateNode.containerInfo),On(c,o),Pn(o),Zs=g;break;case 12:On(c,o),Pn(o);break;case 31:On(c,o),Pn(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,Jp(o,g)));break;case 13:On(c,o),Pn(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Zp=tt()),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,Jp(o,g)));break;case 22:_=o.memoizedState!==null;var we=h!==null&&h.memoizedState!==null,Re=uo,qe=na;if(uo=Re||_,na=qe||we,On(c,o),na=qe,uo=Re,Pn(o),g&8192)e:for(c=o.stateNode,c._visibility=_?c._visibility&-2:c._visibility|1,_&&(h===null||we||uo||na||uc(o)),h=null,c=o;;){if(c.tag===5||c.tag===26){if(h===null){we=h=c;try{if(S=we.stateNode,_)M=S.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{J=we.stateNode;var Ve=we.memoizedProps.style,Ie=Ve!=null&&Ve.hasOwnProperty("display")?Ve.display:null;J.style.display=Ie==null||typeof Ie=="boolean"?"":(""+Ie).trim()}}catch(ft){cr(we,we.return,ft)}}}else if(c.tag===6){if(h===null){we=c;try{we.stateNode.nodeValue=_?"":we.memoizedProps}catch(ft){cr(we,we.return,ft)}}}else if(c.tag===18){if(h===null){we=c;try{var ze=we.stateNode;_?R3(ze,!0):R3(we.stateNode,!1)}catch(ft){cr(we,we.return,ft)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===o)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}g&4&&(g=o.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,Jp(o,h))));break;case 19:On(c,o),Pn(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,Jp(o,g)));break;case 30:break;case 21:break;default:On(c,o),Pn(o)}}function Pn(o){var c=o.flags;if(c&2){try{for(var h,g=o.return;g!==null;){if(MN(g)){h=g;break}g=g.return}if(h==null)throw Error(a(160));switch(h.tag){case 27:var _=h.stateNode,S=k1(o);Xp(o,S,_);break;case 5:var M=h.stateNode;h.flags&32&&(Su(M,""),h.flags&=-33);var J=k1(o);Xp(o,J,M);break;case 3:case 4:var we=h.stateNode.containerInfo,Re=k1(o);S1(o,Re,we);break;default:throw Error(a(161))}}catch(qe){cr(o,o.return,qe)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function WN(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;WN(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function ho(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)zN(o,c.alternate,c),c=c.sibling}function uc(o){for(o=o.child;o!==null;){var c=o;switch(c.tag){case 0:case 11:case 14:case 15:ol(4,c,c.return),uc(c);break;case 1:Ai(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&RN(c,c.return,h),uc(c);break;case 27:of(c.stateNode);case 26:case 5:Ai(c,c.return),uc(c);break;case 22:c.memoizedState===null&&uc(c);break;case 30:uc(c);break;default:uc(c)}o=o.sibling}}function po(o,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var g=c.alternate,_=o,S=c,M=S.flags;switch(S.tag){case 0:case 11:case 15:po(_,S,h),X0(4,S);break;case 1:if(po(_,S,h),g=S,_=g.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(Re){cr(g,g.return,Re)}if(g=S,_=g.updateQueue,_!==null){var J=g.stateNode;try{var we=_.shared.hiddenCallbacks;if(we!==null)for(_.shared.hiddenCallbacks=null,_=0;_<we.length;_++)j4(we[_],J)}catch(Re){cr(g,g.return,Re)}}h&&M&64&&DN(S),J0(S,S.return);break;case 27:LN(S);case 26:case 5:po(_,S,h),h&&g===null&&M&4&&FN(S),J0(S,S.return);break;case 12:po(_,S,h);break;case 31:po(_,S,h),h&&M&4&&UN(_,S);break;case 13:po(_,S,h),h&&M&4&&HN(_,S);break;case 22:S.memoizedState===null&&po(_,S,h),J0(S,S.return);break;case 30:break;default:po(_,S,h)}c=c.sibling}}function C1(o,c){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(o=c.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&L0(h))}function T1(o,c){o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&L0(o))}function ei(o,c,h,g){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)VN(o,c,h,g),c=c.sibling}function VN(o,c,h,g){var _=c.flags;switch(c.tag){case 0:case 11:case 15:ei(o,c,h,g),_&2048&&X0(9,c);break;case 1:ei(o,c,h,g);break;case 3:ei(o,c,h,g),_&2048&&(o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&L0(o)));break;case 12:if(_&2048){ei(o,c,h,g),o=c.stateNode;try{var S=c.memoizedProps,M=S.id,J=S.onPostCommit;typeof J=="function"&&J(M,c.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(we){cr(c,c.return,we)}}else ei(o,c,h,g);break;case 31:ei(o,c,h,g);break;case 13:ei(o,c,h,g);break;case 23:break;case 22:S=c.stateNode,M=c.alternate,c.memoizedState!==null?S._visibility&2?ei(o,c,h,g):Q0(o,c):S._visibility&2?ei(o,c,h,g):(S._visibility|=2,Wu(o,c,h,g,(c.subtreeFlags&10256)!==0||!1)),_&2048&&C1(M,c);break;case 24:ei(o,c,h,g),_&2048&&T1(c.alternate,c);break;default:ei(o,c,h,g)}}function Wu(o,c,h,g,_){for(_=_&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var S=o,M=c,J=h,we=g,Re=M.flags;switch(M.tag){case 0:case 11:case 15:Wu(S,M,J,we,_),X0(8,M);break;case 23:break;case 22:var qe=M.stateNode;M.memoizedState!==null?qe._visibility&2?Wu(S,M,J,we,_):Q0(S,M):(qe._visibility|=2,Wu(S,M,J,we,_)),_&&Re&2048&&C1(M.alternate,M);break;case 24:Wu(S,M,J,we,_),_&&Re&2048&&T1(M.alternate,M);break;default:Wu(S,M,J,we,_)}c=c.sibling}}function Q0(o,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=o,g=c,_=g.flags;switch(g.tag){case 22:Q0(h,g),_&2048&&C1(g.alternate,g);break;case 24:Q0(h,g),_&2048&&T1(g.alternate,g);break;default:Q0(h,g)}c=c.sibling}}var Z0=8192;function Vu(o,c,h){if(o.subtreeFlags&Z0)for(o=o.child;o!==null;)GN(o,c,h),o=o.sibling}function GN(o,c,h){switch(o.tag){case 26:Vu(o,c,h),o.flags&Z0&&o.memoizedState!==null&&jz(h,Zs,o.memoizedState,o.memoizedProps);break;case 5:Vu(o,c,h);break;case 3:case 4:var g=Zs;Zs=dm(o.stateNode.containerInfo),Vu(o,c,h),Zs=g;break;case 22:o.memoizedState===null&&(g=o.alternate,g!==null&&g.memoizedState!==null?(g=Z0,Z0=16777216,Vu(o,c,h),Z0=g):Vu(o,c,h));break;default:Vu(o,c,h)}}function KN(o){var c=o.alternate;if(c!==null&&(o=c.child,o!==null)){c.child=null;do c=o.sibling,o.sibling=null,o=c;while(o!==null)}}function ef(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];Na=g,XN(g,o)}KN(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)YN(o),o=o.sibling}function YN(o){switch(o.tag){case 0:case 11:case 15:ef(o),o.flags&2048&&ol(9,o,o.return);break;case 3:ef(o);break;case 12:ef(o);break;case 22:var c=o.stateNode;o.memoizedState!==null&&c._visibility&2&&(o.return===null||o.return.tag!==13)?(c._visibility&=-3,Qp(o)):ef(o);break;default:ef(o)}}function Qp(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var g=c[h];Na=g,XN(g,o)}KN(o)}for(o=o.child;o!==null;){switch(c=o,c.tag){case 0:case 11:case 15:ol(8,c,c.return),Qp(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,Qp(c));break;default:Qp(c)}o=o.sibling}}function XN(o,c){for(;Na!==null;){var h=Na;switch(h.tag){case 0:case 11:case 15:ol(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:L0(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Na=g;else e:for(h=o;Na!==null;){g=Na;var _=g.sibling,S=g.return;if(BN(g),g===h){Na=null;break e}if(_!==null){_.return=S,Na=_;break e}Na=S}}}var LI={getCacheForType:function(o){var c=za(ta),h=c.data.get(o);return h===void 0&&(h=o(),c.data.set(o,h)),h},cacheSignal:function(){return za(ta).controller.signal}},II=typeof WeakMap=="function"?WeakMap:Map,er=0,_r=null,zt=null,Ht=0,lr=0,es=null,ll=!1,Gu=!1,E1=!1,mo=0,Hr=0,cl=0,dc=0,A1=0,ts=0,Ku=0,tf=null,Dn=null,O1=!1,Zp=0,JN=0,em=1/0,tm=null,ul=null,ga=0,dl=null,Yu=null,go=0,P1=0,D1=null,QN=null,rf=0,R1=null;function rs(){return(er&2)!==0&&Ht!==0?Ht&-Ht:U.T!==null?B1():W()}function ZN(){if(ts===0)if((Ht&536870912)===0||Vt){var o=Js;Js<<=1,(Js&3932160)===0&&(Js=262144),ts=o}else ts=536870912;return o=Qn.current,o!==null&&(o.flags|=32),ts}function Rn(o,c,h){(o===_r&&(lr===2||lr===9)||o.cancelPendingCommit!==null)&&(Xu(o,0),fl(o,Ht,ts,!1)),Ni(o,h),((er&2)===0||o!==_r)&&(o===_r&&((er&2)===0&&(dc|=h),Hr===4&&fl(o,Ht,ts,!1)),Oi(o))}function e3(o,c,h){if((er&6)!==0)throw Error(a(327));var g=!h&&(c&127)===0&&(c&o.expiredLanes)===0||Si(o,c),_=g?$I(o,c):M1(o,c,!0),S=g;do{if(_===0){Gu&&!g&&fl(o,c,0,!1);break}else{if(h=o.current.alternate,S&&!zI(h)){_=M1(o,c,!1),S=!1;continue}if(_===2){if(S=c,o.errorRecoveryDisabledLanes&S)var M=0;else M=o.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){c=M;e:{var J=o;_=tf;var we=J.current.memoizedState.isDehydrated;if(we&&(Xu(J,M).flags|=256),M=M1(J,M,!1),M!==2){if(E1&&!we){J.errorRecoveryDisabledLanes|=S,dc|=S,_=4;break e}S=Dn,Dn=_,S!==null&&(Dn===null?Dn=S:Dn.push.apply(Dn,S))}_=M}if(S=!1,_!==2)continue}}if(_===1){Xu(o,0),fl(o,c,0,!0);break}e:{switch(g=o,S=_,S){case 0:case 1:throw Error(a(345));case 4:if((c&4194048)!==c)break;case 6:fl(g,c,ts,!ll);break e;case 2:Dn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((c&62914560)===c&&(_=Zp+300-tt(),10<_)){if(fl(g,c,ts,!ll),ws(g,0,!0)!==0)break e;go=c,g.timeoutHandle=O3(t3.bind(null,g,h,Dn,tm,O1,c,ts,dc,Ku,ll,S,"Throttled",-0,0),_);break e}t3(g,h,Dn,tm,O1,c,ts,dc,Ku,ll,S,null,-0,0)}}break}while(!0);Oi(o)}function t3(o,c,h,g,_,S,M,J,we,Re,qe,Ve,Ie,ze){if(o.timeoutHandle=-1,Ve=c.subtreeFlags,Ve&8192||(Ve&16785408)===16785408){Ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:eo},GN(c,S,Ve);var ft=(S&62914560)===S?Zp-tt():(S&4194048)===S?JN-tt():0;if(ft=_z(Ve,ft),ft!==null){go=S,o.cancelPendingCommit=ft(c3.bind(null,o,c,S,h,g,_,M,J,we,qe,Ve,null,Ie,ze)),fl(o,S,M,!Re);return}}c3(o,c,S,h,g,_,M,J,we)}function zI(o){for(var c=o;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var _=h[g],S=_.getSnapshot;_=_.value;try{if(!Xn(S(),_))return!1}catch(M){return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function fl(o,c,h,g){c&=~A1,c&=~dc,o.suspendedLanes|=c,o.pingedLanes&=~c,g&&(o.warmLanes|=c),g=o.expirationTimes;for(var _=c;0<_;){var S=31-ma(_),M=1<<S;g[S]=-1,_&=~M}h!==0&&Kl(o,h,c)}function rm(){return(er&6)===0?(af(0),!1):!0}function F1(){if(zt!==null){if(lr===0)var o=zt.return;else o=zt,no=rc=null,Jv(o),Bu=null,z0=0,o=zt;for(;o!==null;)PN(o.alternate,o),o=o.return;zt=null}}function Xu(o,c){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,sz(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),go=0,F1(),_r=o,zt=h=ro(o.current,null),Ht=c,lr=0,es=null,ll=!1,Gu=Si(o,c),E1=!1,Ku=ts=A1=dc=cl=Hr=0,Dn=tf=null,O1=!1,(c&8)!==0&&(c|=c&32);var g=o.entangledLanes;if(g!==0)for(o=o.entanglements,g&=c;0<g;){var _=31-ma(g),S=1<<_;c|=o[_],g&=~S}return mo=c,_p(),h}function r3(o,c){Ct=null,U.H=G0,c===zu||c===Op?(c=y4(),lr=3):c===zv?(c=y4(),lr=4):lr=c===h1?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,es=c,zt===null&&(Hr=1,Wp(o,Ns(c,o.current)))}function a3(){var o=Qn.current;return o===null?!0:(Ht&4194048)===Ht?As===null:(Ht&62914560)===Ht||(Ht&536870912)!==0?o===As:!1}function n3(){var o=U.H;return U.H=G0,o===null?G0:o}function s3(){var o=U.A;return U.A=LI,o}function am(){Hr=4,ll||(Ht&4194048)!==Ht&&Qn.current!==null||(Gu=!0),(cl&134217727)===0&&(dc&134217727)===0||_r===null||fl(_r,Ht,ts,!1)}function M1(o,c,h){var g=er;er|=2;var _=n3(),S=s3();(_r!==o||Ht!==c)&&(tm=null,Xu(o,c)),c=!1;var M=Hr;e:do try{if(lr!==0&&zt!==null){var J=zt,we=es;switch(lr){case 8:F1(),M=6;break e;case 3:case 2:case 9:case 6:Qn.current===null&&(c=!0);var Re=lr;if(lr=0,es=null,Ju(o,J,we,Re),h&&Gu){M=0;break e}break;default:Re=lr,lr=0,es=null,Ju(o,J,we,Re)}}BI(),M=Hr;break}catch(qe){r3(o,qe)}while(!0);return c&&o.shellSuspendCounter++,no=rc=null,er=g,U.H=_,U.A=S,zt===null&&(_r=null,Ht=0,_p()),M}function BI(){for(;zt!==null;)i3(zt)}function $I(o,c){var h=er;er|=2;var g=n3(),_=s3();_r!==o||Ht!==c?(tm=null,em=tt()+500,Xu(o,c)):Gu=Si(o,c);e:do try{if(lr!==0&&zt!==null){c=zt;var S=es;t:switch(lr){case 1:lr=0,es=null,Ju(o,c,S,1);break;case 2:case 9:if(g4(S)){lr=0,es=null,o3(c);break}c=function(){lr!==2&&lr!==9||_r!==o||(lr=7),Oi(o)},S.then(c,c);break e;case 3:lr=7;break e;case 4:lr=5;break e;case 7:g4(S)?(lr=0,es=null,o3(c)):(lr=0,es=null,Ju(o,c,S,7));break;case 5:var M=null;switch(zt.tag){case 26:M=zt.memoizedState;case 5:case 27:var J=zt;if(M?V3(M):J.stateNode.complete){lr=0,es=null;var we=J.sibling;if(we!==null)zt=we;else{var Re=J.return;Re!==null?(zt=Re,nm(Re)):zt=null}break t}}lr=0,es=null,Ju(o,c,S,5);break;case 6:lr=0,es=null,Ju(o,c,S,6);break;case 8:F1(),Hr=6;break e;default:throw Error(a(462))}}UI();break}catch(qe){r3(o,qe)}while(!0);return no=rc=null,U.H=g,U.A=_,er=h,zt!==null?0:(_r=null,Ht=0,_p(),Hr)}function UI(){for(;zt!==null&&!Ee();)i3(zt)}function i3(o){var c=AN(o.alternate,o,mo);o.memoizedProps=o.pendingProps,c===null?nm(o):zt=c}function o3(o){var c=o,h=c.alternate;switch(c.tag){case 15:case 0:c=kN(h,c,c.pendingProps,c.type,void 0,Ht);break;case 11:c=kN(h,c,c.pendingProps,c.type.render,c.ref,Ht);break;case 5:Jv(c);default:PN(h,c),c=zt=s4(c,mo),c=AN(h,c,mo)}o.memoizedProps=o.pendingProps,c===null?nm(o):zt=c}function Ju(o,c,h,g){no=rc=null,Jv(c),Bu=null,z0=0;var _=c.return;try{if(AI(o,_,c,h,Ht)){Hr=1,Wp(o,Ns(h,o.current)),zt=null;return}}catch(S){if(_!==null)throw zt=_,S;Hr=1,Wp(o,Ns(h,o.current)),zt=null;return}c.flags&32768?(Vt||g===1?o=!0:Gu||(Ht&536870912)!==0?o=!1:(ll=o=!0,(g===2||g===9||g===3||g===6)&&(g=Qn.current,g!==null&&g.tag===13&&(g.flags|=16384))),l3(c,o)):nm(c)}function nm(o){var c=o;do{if((c.flags&32768)!==0){l3(c,ll);return}o=c.return;var h=DI(c.alternate,c,mo);if(h!==null){zt=h;return}if(c=c.sibling,c!==null){zt=c;return}zt=c=o}while(c!==null);Hr===0&&(Hr=5)}function l3(o,c){do{var h=RI(o.alternate,o);if(h!==null){h.flags&=32767,zt=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(o=o.sibling,o!==null)){zt=o;return}zt=o=h}while(o!==null);Hr=6,zt=null}function c3(o,c,h,g,_,S,M,J,we){o.cancelPendingCommit=null;do sm();while(ga!==0);if((er&6)!==0)throw Error(a(327));if(c!==null){if(c===o.current)throw Error(a(177));if(S=c.lanes|c.childLanes,S|=kv,_u(o,h,S,M,J,we),o===_r&&(zt=_r=null,Ht=0),Yu=c,dl=o,go=h,P1=S,D1=_,QN=g,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,VI(ct,function(){return p3(),null})):(o.callbackNode=null,o.callbackPriority=0),g=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||g){g=U.T,U.T=null,_=ce.p,ce.p=2,M=er,er|=4;try{FI(o,c,h)}finally{er=M,ce.p=_,U.T=g}}ga=1,u3(),d3(),f3()}}function u3(){if(ga===1){ga=0;var o=dl,c=Yu,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=U.T,U.T=null;var g=ce.p;ce.p=2;var _=er;er|=4;try{qN(c,o);var S=K1,M=XS(o.containerInfo),J=S.focusedElem,we=S.selectionRange;if(M!==J&&J&&J.ownerDocument&&YS(J.ownerDocument.documentElement,J)){if(we!==null&&vv(J)){var Re=we.start,qe=we.end;if(qe===void 0&&(qe=Re),"selectionStart"in J)J.selectionStart=Re,J.selectionEnd=Math.min(qe,J.value.length);else{var Ve=J.ownerDocument||document,Ie=Ve&&Ve.defaultView||window;if(Ie.getSelection){var ze=Ie.getSelection(),ft=J.textContent.length,jt=Math.min(we.start,ft),xr=we.end===void 0?jt:Math.min(we.end,ft);!ze.extend&&jt>xr&&(M=xr,xr=jt,jt=M);var Te=KS(J,jt),ke=KS(J,xr);if(Te&&ke&&(ze.rangeCount!==1||ze.anchorNode!==Te.node||ze.anchorOffset!==Te.offset||ze.focusNode!==ke.node||ze.focusOffset!==ke.offset)){var De=Ve.createRange();De.setStart(Te.node,Te.offset),ze.removeAllRanges(),jt>xr?(ze.addRange(De),ze.extend(ke.node,ke.offset)):(De.setEnd(ke.node,ke.offset),ze.addRange(De))}}}}for(Ve=[],ze=J;ze=ze.parentNode;)ze.nodeType===1&&Ve.push({element:ze,left:ze.scrollLeft,top:ze.scrollTop});for(typeof J.focus=="function"&&J.focus(),J=0;J<Ve.length;J++){var We=Ve[J];We.element.scrollLeft=We.left,We.element.scrollTop=We.top}}xm=!!G1,K1=G1=null}finally{er=_,ce.p=g,U.T=h}}o.current=c,ga=2}}function d3(){if(ga===2){ga=0;var o=dl,c=Yu,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=U.T,U.T=null;var g=ce.p;ce.p=2;var _=er;er|=4;try{zN(o,c.alternate,c)}finally{er=_,ce.p=g,U.T=h}}ga=3}}function f3(){if(ga===4||ga===3){ga=0,Xe();var o=dl,c=Yu,h=go,g=QN;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?ga=5:(ga=0,Yu=dl=null,h3(o,o.pendingLanes));var _=o.pendingLanes;if(_===0&&(ul=null),ht(h),c=c.stateNode,jr&&typeof jr.onCommitFiberRoot=="function")try{jr.onCommitFiberRoot(Xr,c,void 0,(c.current.flags&128)===128)}catch(we){}if(g!==null){c=U.T,_=ce.p,ce.p=2,U.T=null;try{for(var S=o.onRecoverableError,M=0;M<g.length;M++){var J=g[M];S(J.value,{componentStack:J.stack})}}finally{U.T=c,ce.p=_}}(go&3)!==0&&sm(),Oi(o),_=o.pendingLanes,(h&261930)!==0&&(_&42)!==0?o===R1?rf++:(rf=0,R1=o):rf=0,af(0)}}function h3(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,L0(c)))}function sm(){return u3(),d3(),f3(),p3()}function p3(){if(ga!==5)return!1;var o=dl,c=P1;P1=0;var h=ht(go),g=U.T,_=ce.p;try{ce.p=32>h?32:h,U.T=null,h=D1,D1=null;var S=dl,M=go;if(ga=0,Yu=dl=null,go=0,(er&6)!==0)throw Error(a(331));var J=er;if(er|=4,YN(S.current),VN(S,S.current,M,h),er=J,af(0,!1),jr&&typeof jr.onPostCommitFiberRoot=="function")try{jr.onPostCommitFiberRoot(Xr,S)}catch(we){}return!0}finally{ce.p=_,U.T=g,h3(o,c)}}function m3(o,c,h){c=Ns(h,c),c=f1(o.stateNode,c,2),o=nl(o,c,2),o!==null&&(Ni(o,2),Oi(o))}function cr(o,c,h){if(o.tag===3)m3(o,o,h);else for(;c!==null;){if(c.tag===3){m3(c,o,h);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(ul===null||!ul.has(g))){o=Ns(h,o),h=gN(2),g=nl(c,h,2),g!==null&&(xN(h,g,c,o),Ni(g,2),Oi(g));break}}c=c.return}}function L1(o,c,h){var g=o.pingCache;if(g===null){g=o.pingCache=new II;var _=new Set;g.set(c,_)}else _=g.get(c),_===void 0&&(_=new Set,g.set(c,_));_.has(h)||(E1=!0,_.add(h),o=HI.bind(null,o,c,h),c.then(o,o))}function HI(o,c,h){var g=o.pingCache;g!==null&&g.delete(c),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,_r===o&&(Ht&h)===h&&(Hr===4||Hr===3&&(Ht&62914560)===Ht&&300>tt()-Zp?(er&2)===0&&Xu(o,0):A1|=h,Ku===Ht&&(Ku=0)),Oi(o)}function g3(o,c){c===0&&(c=Gl()),o=Zl(o,c),o!==null&&(Ni(o,c),Oi(o))}function qI(o){var c=o.memoizedState,h=0;c!==null&&(h=c.retryLane),g3(o,h)}function WI(o,c){var h=0;switch(o.tag){case 31:case 13:var g=o.stateNode,_=o.memoizedState;_!==null&&(h=_.retryLane);break;case 19:g=o.stateNode;break;case 22:g=o.stateNode._retryCache;break;default:throw Error(a(314))}g!==null&&g.delete(c),g3(o,h)}function VI(o,c){return Ce(o,c)}var im=null,Qu=null,I1=!1,om=!1,z1=!1,hl=0;function Oi(o){o!==Qu&&o.next===null&&(Qu===null?im=Qu=o:Qu=Qu.next=o),om=!0,I1||(I1=!0,KI())}function af(o,c){if(!z1&&om){z1=!0;do for(var h=!1,g=im;g!==null;){if(o!==0){var _=g.pendingLanes;if(_===0)var S=0;else{var M=g.suspendedLanes,J=g.pingedLanes;S=(1<<31-ma(42|o)+1)-1,S&=_&~(M&~J),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(h=!0,b3(g,S))}else S=Ht,S=ws(g,g===_r?S:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(S&3)===0||Si(g,S)||(h=!0,b3(g,S));g=g.next}while(h);z1=!1}}function GI(){x3()}function x3(){om=I1=!1;var o=0;hl!==0&&nz()&&(o=hl);for(var c=tt(),h=null,g=im;g!==null;){var _=g.next,S=y3(g,c);S===0?(g.next=null,h===null?im=_:h.next=_,_===null&&(Qu=h)):(h=g,(o!==0||(S&3)!==0)&&(om=!0)),g=_}ga!==0&&ga!==5||af(o),hl!==0&&(hl=0)}function y3(o,c){for(var h=o.suspendedLanes,g=o.pingedLanes,_=o.expirationTimes,S=o.pendingLanes&-62914561;0<S;){var M=31-ma(S),J=1<<M,we=_[M];we===-1?((J&h)===0||(J&g)!==0)&&(_[M]=ju(J,c)):we<=c&&(o.expiredLanes|=J),S&=~J}if(c=_r,h=Ht,h=ws(o,o===c?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g=o.callbackNode,h===0||o===c&&(lr===2||lr===9)||o.cancelPendingCommit!==null)return g!==null&&g!==null&&ye(g),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||Si(o,h)){if(c=h&-h,c===o.callbackPriority)return c;switch(g!==null&&ye(g),ht(h)){case 2:case 8:h=st;break;case 32:h=ct;break;case 268435456:h=Ze;break;default:h=ct}return g=v3.bind(null,o),h=Ce(h,g),o.callbackPriority=c,o.callbackNode=h,c}return g!==null&&g!==null&&ye(g),o.callbackPriority=2,o.callbackNode=null,2}function v3(o,c){if(ga!==0&&ga!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(sm()&&o.callbackNode!==h)return null;var g=Ht;return g=ws(o,o===_r?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g===0?null:(e3(o,g,c),y3(o,tt()),o.callbackNode!=null&&o.callbackNode===h?v3.bind(null,o):null)}function b3(o,c){if(sm())return null;e3(o,c,!0)}function KI(){iz(function(){(er&6)!==0?Ce(Oe,GI):x3()})}function B1(){if(hl===0){var o=Lu;o===0&&(o=ki,ki<<=1,(ki&261888)===0&&(ki=256)),hl=o}return hl}function w3(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:mp(""+o)}function j3(o,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,o.id&&h.setAttribute("form",o.id),c.parentNode.insertBefore(h,c),o=new FormData(o),h.parentNode.removeChild(h),o}function YI(o,c,h,g,_){if(c==="submit"&&h&&h.stateNode===_){var S=w3((_[ue]||null).action),M=g.submitter;M&&(c=(c=M[ue]||null)?w3(c.formAction):M.getAttribute("formAction"),c!==null&&(S=c,M=null));var J=new vp("action","action",null,g,_);o.push({event:J,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(hl!==0){var we=M?j3(_,M):new FormData(_);i1(h,{pending:!0,data:we,method:_.method,action:S},null,we)}}else typeof S=="function"&&(J.preventDefault(),we=M?j3(_,M):new FormData(_),i1(h,{pending:!0,data:we,method:_.method,action:S},S,we))},currentTarget:_}]})}}for(var $1=0;$1<_v.length;$1++){var U1=_v[$1],XI=U1.toLowerCase(),JI=U1[0].toUpperCase()+U1.slice(1);Qs(XI,"on"+JI)}Qs(ZS,"onAnimationEnd"),Qs(e4,"onAnimationIteration"),Qs(t4,"onAnimationStart"),Qs("dblclick","onDoubleClick"),Qs("focusin","onFocus"),Qs("focusout","onBlur"),Qs(hI,"onTransitionRun"),Qs(pI,"onTransitionStart"),Qs(mI,"onTransitionCancel"),Qs(r4,"onTransitionEnd"),js("onMouseEnter",["mouseout","mouseover"]),js("onMouseLeave",["mouseout","mouseover"]),js("onPointerEnter",["pointerout","pointerover"]),js("onPointerLeave",["pointerout","pointerover"]),pr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pr("onBeforeInput",["compositionend","keypress","textInput","paste"]),pr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nf="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(" "),QI=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nf));function _3(o,c){c=(c&4)!==0;for(var h=0;h<o.length;h++){var g=o[h],_=g.event;g=g.listeners;e:{var S=void 0;if(c)for(var M=g.length-1;0<=M;M--){var J=g[M],we=J.instance,Re=J.currentTarget;if(J=J.listener,we!==S&&_.isPropagationStopped())break e;S=J,_.currentTarget=Re;try{S(_)}catch(qe){jp(qe)}_.currentTarget=null,S=we}else for(M=0;M<g.length;M++){if(J=g[M],we=J.instance,Re=J.currentTarget,J=J.listener,we!==S&&_.isPropagationStopped())break e;S=J,_.currentTarget=Re;try{S(_)}catch(qe){jp(qe)}_.currentTarget=null,S=we}}}}function Bt(o,c){var h=c[Pe];h===void 0&&(h=c[Pe]=new Set);var g=o+"__bubble";h.has(g)||(k3(c,o,2,!1),h.add(g))}function H1(o,c,h){var g=0;c&&(g|=4),k3(h,o,g,c)}var lm="_reactListening"+Math.random().toString(36).slice(2);function q1(o){if(!o[lm]){o[lm]=!0,Yt.forEach(function(h){h!=="selectionchange"&&(QI.has(h)||H1(h,!1,o),H1(h,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[lm]||(c[lm]=!0,H1("selectionchange",!1,c))}}function k3(o,c,h,g){switch(Z3(c)){case 2:var _=Nz;break;case 8:_=Cz;break;default:_=sb}h=_.bind(null,c,h,o),_=void 0,!uv||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(_=!0),g?_!==void 0?o.addEventListener(c,h,{capture:!0,passive:_}):o.addEventListener(c,h,!0):_!==void 0?o.addEventListener(c,h,{passive:_}):o.addEventListener(c,h,!1)}function W1(o,c,h,g,_){var S=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var M=g.tag;if(M===3||M===4){var J=g.stateNode.containerInfo;if(J===_)break;if(M===4)for(M=g.return;M!==null;){var we=M.tag;if((we===3||we===4)&&M.stateNode.containerInfo===_)return;M=M.return}for(;J!==null;){if(M=rt(J),M===null)return;if(we=M.tag,we===5||we===6||we===26||we===27){g=S=M;continue e}J=J.parentNode}}g=g.return}ES(function(){var Re=S,qe=lv(h),Ve=[];e:{var Ie=a4.get(o);if(Ie!==void 0){var ze=vp,ft=o;switch(o){case"keypress":if(xp(h)===0)break e;case"keydown":case"keyup":ze=WL;break;case"focusin":ft="focus",ze=pv;break;case"focusout":ft="blur",ze=pv;break;case"beforeblur":case"afterblur":ze=pv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ze=PS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ze=DL;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ze=KL;break;case ZS:case e4:case t4:ze=ML;break;case r4:ze=XL;break;case"scroll":case"scrollend":ze=OL;break;case"wheel":ze=QL;break;case"copy":case"cut":case"paste":ze=IL;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ze=RS;break;case"toggle":case"beforetoggle":ze=eI}var jt=(c&4)!==0,xr=!jt&&(o==="scroll"||o==="scrollend"),Te=jt?Ie!==null?Ie+"Capture":null:Ie;jt=[];for(var ke=Re,De;ke!==null;){var We=ke;if(De=We.stateNode,We=We.tag,We!==5&&We!==26&&We!==27||De===null||Te===null||(We=N0(ke,Te),We!=null&&jt.push(sf(ke,We,De))),xr)break;ke=ke.return}0<jt.length&&(Ie=new ze(Ie,ft,null,h,qe),Ve.push({event:Ie,listeners:jt}))}}if((c&7)===0){e:{if(Ie=o==="mouseover"||o==="pointerover",ze=o==="mouseout"||o==="pointerout",Ie&&h!==ov&&(ft=h.relatedTarget||h.fromElement)&&(rt(ft)||ft[pe]))break e;if((ze||Ie)&&(Ie=qe.window===qe?qe:(Ie=qe.ownerDocument)?Ie.defaultView||Ie.parentWindow:window,ze?(ft=h.relatedTarget||h.toElement,ze=Re,ft=ft?rt(ft):null,ft!==null&&(xr=i(ft),jt=ft.tag,ft!==xr||jt!==5&&jt!==27&&jt!==6)&&(ft=null)):(ze=null,ft=Re),ze!==ft)){if(jt=PS,We="onMouseLeave",Te="onMouseEnter",ke="mouse",(o==="pointerout"||o==="pointerover")&&(jt=RS,We="onPointerLeave",Te="onPointerEnter",ke="pointer"),xr=ze==null?Ie:Je(ze),De=ft==null?Ie:Je(ft),Ie=new jt(We,ke+"leave",ze,h,qe),Ie.target=xr,Ie.relatedTarget=De,We=null,rt(qe)===Re&&(jt=new jt(Te,ke+"enter",ft,h,qe),jt.target=De,jt.relatedTarget=xr,We=jt),xr=We,ze&&ft)t:{for(jt=ZI,Te=ze,ke=ft,De=0,We=Te;We;We=jt(We))De++;We=0;for(var bt=ke;bt;bt=jt(bt))We++;for(;0<De-We;)Te=jt(Te),De--;for(;0<We-De;)ke=jt(ke),We--;for(;De--;){if(Te===ke||ke!==null&&Te===ke.alternate){jt=Te;break t}Te=jt(Te),ke=jt(ke)}jt=null}else jt=null;ze!==null&&S3(Ve,Ie,ze,jt,!1),ft!==null&&xr!==null&&S3(Ve,xr,ft,jt,!0)}}e:{if(Ie=Re?Je(Re):window,ze=Ie.nodeName&&Ie.nodeName.toLowerCase(),ze==="select"||ze==="input"&&Ie.type==="file")var Xt=US;else if(BS(Ie))if(HS)Xt=uI;else{Xt=lI;var gt=oI}else ze=Ie.nodeName,!ze||ze.toLowerCase()!=="input"||Ie.type!=="checkbox"&&Ie.type!=="radio"?Re&&iv(Re.elementType)&&(Xt=US):Xt=cI;if(Xt&&(Xt=Xt(o,Re))){$S(Ve,Xt,h,qe);break e}gt&&gt(o,Ie,Re),o==="focusout"&&Re&&Ie.type==="number"&&Re.memoizedProps.value!=null&&sv(Ie,"number",Ie.value)}switch(gt=Re?Je(Re):window,o){case"focusin":(BS(gt)||gt.contentEditable==="true")&&(Eu=gt,bv=Re,R0=null);break;case"focusout":R0=bv=Eu=null;break;case"mousedown":wv=!0;break;case"contextmenu":case"mouseup":case"dragend":wv=!1,JS(Ve,h,qe);break;case"selectionchange":if(fI)break;case"keydown":case"keyup":JS(Ve,h,qe)}var Et;if(gv)e:{switch(o){case"compositionstart":var qt="onCompositionStart";break e;case"compositionend":qt="onCompositionEnd";break e;case"compositionupdate":qt="onCompositionUpdate";break e}qt=void 0}else Tu?IS(o,h)&&(qt="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(qt="onCompositionStart");qt&&(FS&&h.locale!=="ko"&&(Tu||qt!=="onCompositionStart"?qt==="onCompositionEnd"&&Tu&&(Et=AS()):(Jo=qe,dv="value"in Jo?Jo.value:Jo.textContent,Tu=!0)),gt=cm(Re,qt),0<gt.length&&(qt=new DS(qt,o,null,h,qe),Ve.push({event:qt,listeners:gt}),Et?qt.data=Et:(Et=zS(h),Et!==null&&(qt.data=Et)))),(Et=rI?aI(o,h):nI(o,h))&&(qt=cm(Re,"onBeforeInput"),0<qt.length&&(gt=new DS("onBeforeInput","beforeinput",null,h,qe),Ve.push({event:gt,listeners:qt}),gt.data=Et)),YI(Ve,o,Re,h,qe)}_3(Ve,c)})}function sf(o,c,h){return{instance:o,listener:c,currentTarget:h}}function cm(o,c){for(var h=c+"Capture",g=[];o!==null;){var _=o,S=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||S===null||(_=N0(o,h),_!=null&&g.unshift(sf(o,_,S)),_=N0(o,c),_!=null&&g.push(sf(o,_,S))),o.tag===3)return g;o=o.return}return[]}function ZI(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function S3(o,c,h,g,_){for(var S=c._reactName,M=[];h!==null&&h!==g;){var J=h,we=J.alternate,Re=J.stateNode;if(J=J.tag,we!==null&&we===g)break;J!==5&&J!==26&&J!==27||Re===null||(we=Re,_?(Re=N0(h,S),Re!=null&&M.unshift(sf(h,Re,we))):_||(Re=N0(h,S),Re!=null&&M.push(sf(h,Re,we)))),h=h.return}M.length!==0&&o.push({event:c,listeners:M})}var ez=/\r\n?/g,tz=/\u0000|\uFFFD/g;function N3(o){return(typeof o=="string"?o:""+o).replace(ez,`
`).replace(tz,"")}function C3(o,c){return c=N3(c),N3(o)===c}function gr(o,c,h,g,_,S){switch(h){case"children":typeof g=="string"?c==="body"||c==="textarea"&&g===""||Su(o,g):(typeof g=="number"||typeof g=="bigint")&&c!=="body"&&Su(o,""+g);break;case"className":hp(o,"class",g);break;case"tabIndex":hp(o,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":hp(o,h,g);break;case"style":CS(o,g,S);break;case"data":if(c!=="object"){hp(o,"data",g);break}case"src":case"href":if(g===""&&(c!=="a"||h!=="href")){o.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(h);break}g=mp(""+g),o.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){o.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(h==="formAction"?(c!=="input"&&gr(o,c,"name",_.name,_,null),gr(o,c,"formEncType",_.formEncType,_,null),gr(o,c,"formMethod",_.formMethod,_,null),gr(o,c,"formTarget",_.formTarget,_,null)):(gr(o,c,"encType",_.encType,_,null),gr(o,c,"method",_.method,_,null),gr(o,c,"target",_.target,_,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(h);break}g=mp(""+g),o.setAttribute(h,g);break;case"onClick":g!=null&&(o.onclick=eo);break;case"onScroll":g!=null&&Bt("scroll",o);break;case"onScrollEnd":g!=null&&Bt("scrollend",o);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(h=g.__html,h!=null){if(_.children!=null)throw Error(a(60));o.innerHTML=h}}break;case"multiple":o.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":o.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){o.removeAttribute("xlink:href");break}h=mp(""+g),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,""+g):o.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":g===!0?o.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,g):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?o.setAttribute(h,g):o.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?o.removeAttribute(h):o.setAttribute(h,g);break;case"popover":Bt("beforetoggle",o),Bt("toggle",o),Tn(o,"popover",g);break;case"xlinkActuate":Zi(o,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Zi(o,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Zi(o,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Zi(o,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Zi(o,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Zi(o,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Zi(o,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Zi(o,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Zi(o,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Tn(o,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=EL.get(h)||h,Tn(o,h,g))}}function V1(o,c,h,g,_,S){switch(h){case"style":CS(o,g,S);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(h=g.__html,h!=null){if(_.children!=null)throw Error(a(60));o.innerHTML=h}}break;case"children":typeof g=="string"?Su(o,g):(typeof g=="number"||typeof g=="bigint")&&Su(o,""+g);break;case"onScroll":g!=null&&Bt("scroll",o);break;case"onScrollEnd":g!=null&&Bt("scrollend",o);break;case"onClick":g!=null&&(o.onclick=eo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!or.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(_=h.endsWith("Capture"),c=h.slice(2,_?h.length-7:void 0),S=o[ue]||null,S=S!=null?S[h]:null,typeof S=="function"&&o.removeEventListener(c,S,_),typeof g=="function")){typeof S!="function"&&S!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(c,g,_);break e}h in o?o[h]=g:g===!0?o.setAttribute(h,""):Tn(o,h,g)}}}function $a(o,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",o),Bt("load",o);var g=!1,_=!1,S;for(S in h)if(h.hasOwnProperty(S)){var M=h[S];if(M!=null)switch(S){case"src":g=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,c));default:gr(o,c,S,M,h,null)}}_&&gr(o,c,"srcSet",h.srcSet,h,null),g&&gr(o,c,"src",h.src,h,null);return;case"input":Bt("invalid",o);var J=S=M=_=null,we=null,Re=null;for(g in h)if(h.hasOwnProperty(g)){var qe=h[g];if(qe!=null)switch(g){case"name":_=qe;break;case"type":M=qe;break;case"checked":we=qe;break;case"defaultChecked":Re=qe;break;case"value":S=qe;break;case"defaultValue":J=qe;break;case"children":case"dangerouslySetInnerHTML":if(qe!=null)throw Error(a(137,c));break;default:gr(o,c,g,qe,h,null)}}_S(o,S,J,we,Re,M,_,!1);return;case"select":Bt("invalid",o),g=M=S=null;for(_ in h)if(h.hasOwnProperty(_)&&(J=h[_],J!=null))switch(_){case"value":S=J;break;case"defaultValue":M=J;break;case"multiple":g=J;default:gr(o,c,_,J,h,null)}c=S,h=M,o.multiple=!!g,c!=null?ku(o,!!g,c,!1):h!=null&&ku(o,!!g,h,!0);return;case"textarea":Bt("invalid",o),S=_=g=null;for(M in h)if(h.hasOwnProperty(M)&&(J=h[M],J!=null))switch(M){case"value":g=J;break;case"defaultValue":_=J;break;case"children":S=J;break;case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(91));break;default:gr(o,c,M,J,h,null)}SS(o,g,_,S);return;case"option":for(we in h)h.hasOwnProperty(we)&&(g=h[we],g!=null)&&(we==="selected"?o.selected=g&&typeof g!="function"&&typeof g!="symbol":gr(o,c,we,g,h,null));return;case"dialog":Bt("beforetoggle",o),Bt("toggle",o),Bt("cancel",o),Bt("close",o);break;case"iframe":case"object":Bt("load",o);break;case"video":case"audio":for(g=0;g<nf.length;g++)Bt(nf[g],o);break;case"image":Bt("error",o),Bt("load",o);break;case"details":Bt("toggle",o);break;case"embed":case"source":case"link":Bt("error",o),Bt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Re in h)if(h.hasOwnProperty(Re)&&(g=h[Re],g!=null))switch(Re){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,c));default:gr(o,c,Re,g,h,null)}return;default:if(iv(c)){for(qe in h)h.hasOwnProperty(qe)&&(g=h[qe],g!==void 0&&V1(o,c,qe,g,h,void 0));return}}for(J in h)h.hasOwnProperty(J)&&(g=h[J],g!=null&&gr(o,c,J,g,h,null))}function rz(o,c,h,g){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,S=null,M=null,J=null,we=null,Re=null,qe=null;for(ze in h){var Ve=h[ze];if(h.hasOwnProperty(ze)&&Ve!=null)switch(ze){case"checked":break;case"value":break;case"defaultValue":we=Ve;default:g.hasOwnProperty(ze)||gr(o,c,ze,null,g,Ve)}}for(var Ie in g){var ze=g[Ie];if(Ve=h[Ie],g.hasOwnProperty(Ie)&&(ze!=null||Ve!=null))switch(Ie){case"type":S=ze;break;case"name":_=ze;break;case"checked":Re=ze;break;case"defaultChecked":qe=ze;break;case"value":M=ze;break;case"defaultValue":J=ze;break;case"children":case"dangerouslySetInnerHTML":if(ze!=null)throw Error(a(137,c));break;default:ze!==Ve&&gr(o,c,Ie,ze,g,Ve)}}nv(o,M,J,we,Re,qe,S,_);return;case"select":ze=M=J=Ie=null;for(S in h)if(we=h[S],h.hasOwnProperty(S)&&we!=null)switch(S){case"value":break;case"multiple":ze=we;default:g.hasOwnProperty(S)||gr(o,c,S,null,g,we)}for(_ in g)if(S=g[_],we=h[_],g.hasOwnProperty(_)&&(S!=null||we!=null))switch(_){case"value":Ie=S;break;case"defaultValue":J=S;break;case"multiple":M=S;default:S!==we&&gr(o,c,_,S,g,we)}c=J,h=M,g=ze,Ie!=null?ku(o,!!h,Ie,!1):!!g!=!!h&&(c!=null?ku(o,!!h,c,!0):ku(o,!!h,h?[]:"",!1));return;case"textarea":ze=Ie=null;for(J in h)if(_=h[J],h.hasOwnProperty(J)&&_!=null&&!g.hasOwnProperty(J))switch(J){case"value":break;case"children":break;default:gr(o,c,J,null,g,_)}for(M in g)if(_=g[M],S=h[M],g.hasOwnProperty(M)&&(_!=null||S!=null))switch(M){case"value":Ie=_;break;case"defaultValue":ze=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:_!==S&&gr(o,c,M,_,g,S)}kS(o,Ie,ze);return;case"option":for(var ft in h)Ie=h[ft],h.hasOwnProperty(ft)&&Ie!=null&&!g.hasOwnProperty(ft)&&(ft==="selected"?o.selected=!1:gr(o,c,ft,null,g,Ie));for(we in g)Ie=g[we],ze=h[we],g.hasOwnProperty(we)&&Ie!==ze&&(Ie!=null||ze!=null)&&(we==="selected"?o.selected=Ie&&typeof Ie!="function"&&typeof Ie!="symbol":gr(o,c,we,Ie,g,ze));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var jt in h)Ie=h[jt],h.hasOwnProperty(jt)&&Ie!=null&&!g.hasOwnProperty(jt)&&gr(o,c,jt,null,g,Ie);for(Re in g)if(Ie=g[Re],ze=h[Re],g.hasOwnProperty(Re)&&Ie!==ze&&(Ie!=null||ze!=null))switch(Re){case"children":case"dangerouslySetInnerHTML":if(Ie!=null)throw Error(a(137,c));break;default:gr(o,c,Re,Ie,g,ze)}return;default:if(iv(c)){for(var xr in h)Ie=h[xr],h.hasOwnProperty(xr)&&Ie!==void 0&&!g.hasOwnProperty(xr)&&V1(o,c,xr,void 0,g,Ie);for(qe in g)Ie=g[qe],ze=h[qe],!g.hasOwnProperty(qe)||Ie===ze||Ie===void 0&&ze===void 0||V1(o,c,qe,Ie,g,ze);return}}for(var Te in h)Ie=h[Te],h.hasOwnProperty(Te)&&Ie!=null&&!g.hasOwnProperty(Te)&&gr(o,c,Te,null,g,Ie);for(Ve in g)Ie=g[Ve],ze=h[Ve],!g.hasOwnProperty(Ve)||Ie===ze||Ie==null&&ze==null||gr(o,c,Ve,Ie,g,ze)}function T3(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function az(){if(typeof performance.getEntriesByType=="function"){for(var o=0,c=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var _=h[g],S=_.transferSize,M=_.initiatorType,J=_.duration;if(S&&J&&T3(M)){for(M=0,J=_.responseEnd,g+=1;g<h.length;g++){var we=h[g],Re=we.startTime;if(Re>J)break;var qe=we.transferSize,Ve=we.initiatorType;qe&&T3(Ve)&&(we=we.responseEnd,M+=qe*(we<J?1:(J-Re)/(we-Re)))}if(--g,c+=8*(S+M)/(_.duration/1e3),o++,10<o)break}}if(0<o)return c/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var G1=null,K1=null;function um(o){return o.nodeType===9?o:o.ownerDocument}function E3(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function A3(o,c){if(o===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&c==="foreignObject"?0:o}function Y1(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var X1=null;function nz(){var o=window.event;return o&&o.type==="popstate"?o===X1?!1:(X1=o,!0):(X1=null,!1)}var O3=typeof setTimeout=="function"?setTimeout:void 0,sz=typeof clearTimeout=="function"?clearTimeout:void 0,P3=typeof Promise=="function"?Promise:void 0,iz=typeof queueMicrotask=="function"?queueMicrotask:typeof P3!="undefined"?function(o){return P3.resolve(null).then(o).catch(oz)}:O3;function oz(o){setTimeout(function(){throw o})}function pl(o){return o==="head"}function D3(o,c){var h=c,g=0;do{var _=h.nextSibling;if(o.removeChild(h),_&&_.nodeType===8)if(h=_.data,h==="/$"||h==="/&"){if(g===0){o.removeChild(_),rd(c);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")of(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,of(h);for(var S=h.firstChild;S;){var M=S.nextSibling,J=S.nodeName;S[Le]||J==="SCRIPT"||J==="STYLE"||J==="LINK"&&S.rel.toLowerCase()==="stylesheet"||h.removeChild(S),S=M}}else h==="body"&&of(o.ownerDocument.body);h=_}while(h);rd(c)}function R3(o,c){var h=o;o=0;do{var g=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=g}while(h)}function J1(o){var c=o.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":J1(h),Ye(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function lz(o,c,h,g){for(;o.nodeType===1;){var _=h;if(o.nodeName.toLowerCase()!==c.toLowerCase()){if(!g&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(g){if(!o[Le])switch(c){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(S=o.getAttribute("rel"),S==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(S!==_.rel||o.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||o.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||o.getAttribute("title")!==(_.title==null?null:_.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(S=o.getAttribute("src"),(S!==(_.src==null?null:_.src)||o.getAttribute("type")!==(_.type==null?null:_.type)||o.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&S&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(c==="input"&&o.type==="hidden"){var S=_.name==null?null:""+_.name;if(_.type==="hidden"&&o.getAttribute("name")===S)return o}else return o;if(o=Os(o.nextSibling),o===null)break}return null}function cz(o,c,h){if(c==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=Os(o.nextSibling),o===null))return null;return o}function F3(o,c){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!c||(o=Os(o.nextSibling),o===null))return null;return o}function Q1(o){return o.data==="$?"||o.data==="$~"}function Z1(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function uz(o,c){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=c;else if(o.data!=="$?"||h.readyState!=="loading")c();else{var g=function(){c(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),o._reactRetry=g}}function Os(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return o}var eb=null;function M3(o){o=o.nextSibling;for(var c=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(c===0)return Os(o.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}o=o.nextSibling}return null}function L3(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return o;c--}else h!=="/$"&&h!=="/&"||c++}o=o.previousSibling}return null}function I3(o,c,h){switch(c=um(h),o){case"html":if(o=c.documentElement,!o)throw Error(a(452));return o;case"head":if(o=c.head,!o)throw Error(a(453));return o;case"body":if(o=c.body,!o)throw Error(a(454));return o;default:throw Error(a(451))}}function of(o){for(var c=o.attributes;c.length;)o.removeAttributeNode(c[0]);Ye(o)}var Ps=new Map,z3=new Set;function dm(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var xo=ce.d;ce.d={f:dz,r:fz,D:hz,C:pz,L:mz,m:gz,X:yz,S:xz,M:vz};function dz(){var o=xo.f(),c=rm();return o||c}function fz(o){var c=et(o);c!==null&&c.tag===5&&c.type==="form"?rN(c):xo.r(o)}var Zu=typeof document=="undefined"?null:document;function B3(o,c,h){var g=Zu;if(g&&typeof c=="string"&&c){var _=ks(c);_='link[rel="'+o+'"][href="'+_+'"]',typeof h=="string"&&(_+='[crossorigin="'+h+'"]'),z3.has(_)||(z3.add(_),o={rel:o,crossOrigin:h,href:c},g.querySelector(_)===null&&(c=g.createElement("link"),$a(c,"link",o),lt(c),g.head.appendChild(c)))}}function hz(o){xo.D(o),B3("dns-prefetch",o,null)}function pz(o,c){xo.C(o,c),B3("preconnect",o,c)}function mz(o,c,h){xo.L(o,c,h);var g=Zu;if(g&&o&&c){var _='link[rel="preload"][as="'+ks(c)+'"]';c==="image"&&h&&h.imageSrcSet?(_+='[imagesrcset="'+ks(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(_+='[imagesizes="'+ks(h.imageSizes)+'"]')):_+='[href="'+ks(o)+'"]';var S=_;switch(c){case"style":S=ed(o);break;case"script":S=td(o)}Ps.has(S)||(o=m({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:o,as:c},h),Ps.set(S,o),g.querySelector(_)!==null||c==="style"&&g.querySelector(lf(S))||c==="script"&&g.querySelector(cf(S))||(c=g.createElement("link"),$a(c,"link",o),lt(c),g.head.appendChild(c)))}}function gz(o,c){xo.m(o,c);var h=Zu;if(h&&o){var g=c&&typeof c.as=="string"?c.as:"script",_='link[rel="modulepreload"][as="'+ks(g)+'"][href="'+ks(o)+'"]',S=_;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=td(o)}if(!Ps.has(S)&&(o=m({rel:"modulepreload",href:o},c),Ps.set(S,o),h.querySelector(_)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(cf(S)))return}g=h.createElement("link"),$a(g,"link",o),lt(g),h.head.appendChild(g)}}}function xz(o,c,h){xo.S(o,c,h);var g=Zu;if(g&&o){var _=it(g).hoistableStyles,S=ed(o);c=c||"default";var M=_.get(S);if(!M){var J={loading:0,preload:null};if(M=g.querySelector(lf(S)))J.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":c},h),(h=Ps.get(S))&&tb(o,h);var we=M=g.createElement("link");lt(we),$a(we,"link",o),we._p=new Promise(function(Re,qe){we.onload=Re,we.onerror=qe}),we.addEventListener("load",function(){J.loading|=1}),we.addEventListener("error",function(){J.loading|=2}),J.loading|=4,fm(M,c,g)}M={type:"stylesheet",instance:M,count:1,state:J},_.set(S,M)}}}function yz(o,c){xo.X(o,c);var h=Zu;if(h&&o){var g=it(h).hoistableScripts,_=td(o),S=g.get(_);S||(S=h.querySelector(cf(_)),S||(o=m({src:o,async:!0},c),(c=Ps.get(_))&&rb(o,c),S=h.createElement("script"),lt(S),$a(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},g.set(_,S))}}function vz(o,c){xo.M(o,c);var h=Zu;if(h&&o){var g=it(h).hoistableScripts,_=td(o),S=g.get(_);S||(S=h.querySelector(cf(_)),S||(o=m({src:o,async:!0,type:"module"},c),(c=Ps.get(_))&&rb(o,c),S=h.createElement("script"),lt(S),$a(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},g.set(_,S))}}function $3(o,c,h,g){var _=(_=re.current)?dm(_):null;if(!_)throw Error(a(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=ed(h.href),h=it(_).hoistableStyles,g=h.get(c),g||(g={type:"style",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=ed(h.href);var S=it(_).hoistableStyles,M=S.get(o);if(M||(_=_.ownerDocument||_,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(o,M),(S=_.querySelector(lf(o)))&&!S._p&&(M.instance=S,M.state.loading=5),Ps.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Ps.set(o,h),S||bz(_,o,h,M.state))),c&&g===null)throw Error(a(528,""));return M}if(c&&g!==null)throw Error(a(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=td(h),h=it(_).hoistableScripts,g=h.get(c),g||(g={type:"script",instance:null,count:0,state:null},h.set(c,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,o))}}function ed(o){return'href="'+ks(o)+'"'}function lf(o){return'link[rel="stylesheet"]['+o+"]"}function U3(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function bz(o,c,h,g){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?g.loading=1:(c=o.createElement("link"),g.preload=c,c.addEventListener("load",function(){return g.loading|=1}),c.addEventListener("error",function(){return g.loading|=2}),$a(c,"link",h),lt(c),o.head.appendChild(c))}function td(o){return'[src="'+ks(o)+'"]'}function cf(o){return"script[async]"+o}function H3(o,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var g=o.querySelector('style[data-href~="'+ks(h.href)+'"]');if(g)return c.instance=g,lt(g),g;var _=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(o.ownerDocument||o).createElement("style"),lt(g),$a(g,"style",_),fm(g,h.precedence,o),c.instance=g;case"stylesheet":_=ed(h.href);var S=o.querySelector(lf(_));if(S)return c.state.loading|=4,c.instance=S,lt(S),S;g=U3(h),(_=Ps.get(_))&&tb(g,_),S=(o.ownerDocument||o).createElement("link"),lt(S);var M=S;return M._p=new Promise(function(J,we){M.onload=J,M.onerror=we}),$a(S,"link",g),c.state.loading|=4,fm(S,h.precedence,o),c.instance=S;case"script":return S=td(h.src),(_=o.querySelector(cf(S)))?(c.instance=_,lt(_),_):(g=h,(_=Ps.get(S))&&(g=m({},h),rb(g,_)),o=o.ownerDocument||o,_=o.createElement("script"),lt(_),$a(_,"link",g),o.head.appendChild(_),c.instance=_);case"void":return null;default:throw Error(a(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(g=c.instance,c.state.loading|=4,fm(g,h.precedence,o));return c.instance}function fm(o,c,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=g.length?g[g.length-1]:null,S=_,M=0;M<g.length;M++){var J=g[M];if(J.dataset.precedence===c)S=J;else if(S!==_)break}S?S.parentNode.insertBefore(o,S.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(o,c.firstChild))}function tb(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.title==null&&(o.title=c.title)}function rb(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.integrity==null&&(o.integrity=c.integrity)}var hm=null;function q3(o,c,h){if(hm===null){var g=new Map,_=hm=new Map;_.set(h,g)}else _=hm,g=_.get(h),g||(g=new Map,_.set(h,g));if(g.has(o))return g;for(g.set(o,null),h=h.getElementsByTagName(o),_=0;_<h.length;_++){var S=h[_];if(!(S[Le]||S[ae]||o==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var M=S.getAttribute(c)||"";M=o+M;var J=g.get(M);J?J.push(S):g.set(M,[S])}}return g}function W3(o,c,h){o=o.ownerDocument||o,o.head.insertBefore(h,c==="title"?o.querySelector("head > title"):null)}function wz(o,c,h){if(h===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(o=c.disabled,typeof c.precedence=="string"&&o==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function V3(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function jz(o,c,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var _=ed(g.href),S=c.querySelector(lf(_));if(S){c=S._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(o.count++,o=pm.bind(o),c.then(o,o)),h.state.loading|=4,h.instance=S,lt(S);return}S=c.ownerDocument||c,g=U3(g),(_=Ps.get(_))&&tb(g,_),S=S.createElement("link"),lt(S);var M=S;M._p=new Promise(function(J,we){M.onload=J,M.onerror=we}),$a(S,"link",g),h.instance=S}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=pm.bind(o),c.addEventListener("load",h),c.addEventListener("error",h))}}var ab=0;function _z(o,c){return o.stylesheets&&o.count===0&&gm(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var g=setTimeout(function(){if(o.stylesheets&&gm(o,o.stylesheets),o.unsuspend){var S=o.unsuspend;o.unsuspend=null,S()}},6e4+c);0<o.imgBytes&&ab===0&&(ab=62500*az());var _=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&gm(o,o.stylesheets),o.unsuspend)){var S=o.unsuspend;o.unsuspend=null,S()}},(o.imgBytes>ab?50:800)+c);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(g),clearTimeout(_)}}:null}function pm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gm(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var mm=null;function gm(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,mm=new Map,c.forEach(kz,o),mm=null,pm.call(o))}function kz(o,c){if(!(c.state.loading&4)){var h=mm.get(o);if(h)var g=h.get(null);else{h=new Map,mm.set(o,h);for(var _=o.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<_.length;S++){var M=_[S];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(h.set(M.dataset.precedence,M),g=M)}g&&h.set(null,g)}_=c.instance,M=_.getAttribute("data-precedence"),S=h.get(M)||g,S===g&&h.set(null,_),h.set(M,_),this.count++,g=pm.bind(this),_.addEventListener("load",g),_.addEventListener("error",g),S?S.parentNode.insertBefore(_,S.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(_,o.firstChild)),c.state.loading|=4}}var uf={$$typeof:N,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function Sz(o,c,h,g,_,S,M,J,we){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Yo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yo(0),this.hiddenUpdates=Yo(null),this.identifierPrefix=g,this.onUncaughtError=_,this.onCaughtError=S,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=we,this.incompleteTransitions=new Map}function G3(o,c,h,g,_,S,M,J,we,Re,qe,Ve){return o=new Sz(o,c,h,M,we,Re,qe,Ve,J),c=1,S===!0&&(c|=24),S=Jn(3,null,null,c),o.current=S,S.stateNode=o,c=Mv(),c.refCount++,o.pooledCache=c,c.refCount++,S.memoizedState={element:g,isDehydrated:h,cache:c},Bv(S),o}function K3(o){return o?(o=Pu,o):Pu}function Y3(o,c,h,g,_,S){_=K3(_),g.context===null?g.context=_:g.pendingContext=_,g=al(c),g.payload={element:h},S=S===void 0?null:S,S!==null&&(g.callback=S),h=nl(o,g,c),h!==null&&(Rn(h,o,c),$0(h,o,c))}function X3(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<c?h:c}}function nb(o,c){X3(o,c),(o=o.alternate)&&X3(o,c)}function J3(o){if(o.tag===13||o.tag===31){var c=Zl(o,67108864);c!==null&&Rn(c,o,67108864),nb(o,67108864)}}function Q3(o){if(o.tag===13||o.tag===31){var c=rs();c=Qe(c);var h=Zl(o,c);h!==null&&Rn(h,o,c),nb(o,c)}}var xm=!0;function Nz(o,c,h,g){var _=U.T;U.T=null;var S=ce.p;try{ce.p=2,sb(o,c,h,g)}finally{ce.p=S,U.T=_}}function Cz(o,c,h,g){var _=U.T;U.T=null;var S=ce.p;try{ce.p=8,sb(o,c,h,g)}finally{ce.p=S,U.T=_}}function sb(o,c,h,g){if(xm){var _=ib(g);if(_===null)W1(o,c,g,ym,h),eC(o,g);else if(Ez(_,o,c,h,g))g.stopPropagation();else if(eC(o,g),c&4&&-1<Tz.indexOf(o)){for(;_!==null;){var S=et(_);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var M=mn(S.pendingLanes);if(M!==0){var J=S;for(J.pendingLanes|=2,J.entangledLanes|=2;M;){var we=1<<31-ma(M);J.entanglements[1]|=we,M&=~we}Oi(S),(er&6)===0&&(em=tt()+500,af(0))}}break;case 31:case 13:J=Zl(S,2),J!==null&&Rn(J,S,2),rm(),nb(S,2)}if(S=ib(g),S===null&&W1(o,c,g,ym,h),S===_)break;_=S}_!==null&&g.stopPropagation()}else W1(o,c,g,null,h)}}function ib(o){return o=lv(o),ob(o)}var ym=null;function ob(o){if(ym=null,o=rt(o),o!==null){var c=i(o);if(c===null)o=null;else{var h=c.tag;if(h===13){if(o=l(c),o!==null)return o;o=null}else if(h===31){if(o=u(c),o!==null)return o;o=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null)}}return ym=o,null}function Z3(o){switch(o){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ve()){case Oe:return 2;case st:return 8;case ct:case ot:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var lb=!1,ml=null,gl=null,xl=null,df=new Map,ff=new Map,yl=[],Tz="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".split(" ");function eC(o,c){switch(o){case"focusin":case"focusout":ml=null;break;case"dragenter":case"dragleave":gl=null;break;case"mouseover":case"mouseout":xl=null;break;case"pointerover":case"pointerout":df.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ff.delete(c.pointerId)}}function hf(o,c,h,g,_,S){return o===null||o.nativeEvent!==S?(o={blockedOn:c,domEventName:h,eventSystemFlags:g,nativeEvent:S,targetContainers:[_]},c!==null&&(c=et(c),c!==null&&J3(c)),o):(o.eventSystemFlags|=g,c=o.targetContainers,_!==null&&c.indexOf(_)===-1&&c.push(_),o)}function Ez(o,c,h,g,_){switch(c){case"focusin":return ml=hf(ml,o,c,h,g,_),!0;case"dragenter":return gl=hf(gl,o,c,h,g,_),!0;case"mouseover":return xl=hf(xl,o,c,h,g,_),!0;case"pointerover":var S=_.pointerId;return df.set(S,hf(df.get(S)||null,o,c,h,g,_)),!0;case"gotpointercapture":return S=_.pointerId,ff.set(S,hf(ff.get(S)||null,o,c,h,g,_)),!0}return!1}function tC(o){var c=rt(o.target);if(c!==null){var h=i(c);if(h!==null){if(c=h.tag,c===13){if(c=l(h),c!==null){o.blockedOn=c,le(o.priority,function(){Q3(h)});return}}else if(c===31){if(c=u(h),c!==null){o.blockedOn=c,le(o.priority,function(){Q3(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function vm(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var h=ib(o.nativeEvent);if(h===null){h=o.nativeEvent;var g=new h.constructor(h.type,h);ov=g,h.target.dispatchEvent(g),ov=null}else return c=et(h),c!==null&&J3(c),o.blockedOn=h,!1;c.shift()}return!0}function rC(o,c,h){vm(o)&&h.delete(c)}function Az(){lb=!1,ml!==null&&vm(ml)&&(ml=null),gl!==null&&vm(gl)&&(gl=null),xl!==null&&vm(xl)&&(xl=null),df.forEach(rC),ff.forEach(rC)}function bm(o,c){o.blockedOn===c&&(o.blockedOn=null,lb||(lb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Az)))}var wm=null;function aC(o){wm!==o&&(wm=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wm===o&&(wm=null);for(var c=0;c<o.length;c+=3){var h=o[c],g=o[c+1],_=o[c+2];if(typeof g!="function"){if(ob(g||h)===null)continue;break}var S=et(h);S!==null&&(o.splice(c,3),c-=3,i1(S,{pending:!0,data:_,method:h.method,action:g},g,_))}}))}function rd(o){function c(we){return bm(we,o)}ml!==null&&bm(ml,o),gl!==null&&bm(gl,o),xl!==null&&bm(xl,o),df.forEach(c),ff.forEach(c);for(var h=0;h<yl.length;h++){var g=yl[h];g.blockedOn===o&&(g.blockedOn=null)}for(;0<yl.length&&(h=yl[0],h.blockedOn===null);)tC(h),h.blockedOn===null&&yl.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var _=h[g],S=h[g+1],M=_[ue]||null;if(typeof S=="function")M||aC(h);else if(M){var J=null;if(S&&S.hasAttribute("formAction")){if(_=S,M=S[ue]||null)J=M.formAction;else if(ob(_)!==null)continue}else J=M.action;typeof J=="function"?h[g+1]=J:(h.splice(g,3),g-=3),aC(h)}}}function nC(){function o(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(M){return _=M})},focusReset:"manual",scroll:"manual"})}function c(){_!==null&&(_(),_=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,_=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),_!==null&&(_(),_=null)}}}function cb(o){this._internalRoot=o}jm.prototype.render=cb.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(a(409));var h=c.current,g=rs();Y3(h,g,o,c,null,null)},jm.prototype.unmount=cb.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;Y3(o.current,2,null,o,null,null),rm(),c[pe]=null}};function jm(o){this._internalRoot=o}jm.prototype.unstable_scheduleHydration=function(o){if(o){var c=W();o={blockedOn:null,target:o,priority:c};for(var h=0;h<yl.length&&c!==0&&c<yl[h].priority;h++);yl.splice(h,0,o),h===0&&tC(o)}};var sC=t.version;if(sC!=="19.2.7")throw Error(a(527,sC,"19.2.7"));ce.findDOMNode=function(o){var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(a(188)):(o=Object.keys(o).join(","),Error(a(268,o)));return o=f(c),o=o!==null?p(o):null,o=o===null?null:o.stateNode,o};var Oz={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var _m=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_m.isDisabled&&_m.supportsFiber)try{Xr=_m.inject(Oz),jr=_m}catch(o){}}return mf.createRoot=function(o,c){if(!s(o))throw Error(a(299));var h=!1,g="",_=fN,S=hN,M=pN;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(S=c.onCaughtError),c.onRecoverableError!==void 0&&(M=c.onRecoverableError)),c=G3(o,1,!1,null,null,h,g,null,_,S,M,nC),o[pe]=c.current,q1(o),new cb(c)},mf.hydrateRoot=function(o,c,h){if(!s(o))throw Error(a(299));var g=!1,_="",S=fN,M=hN,J=pN,we=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(_=h.identifierPrefix),h.onUncaughtError!==void 0&&(S=h.onUncaughtError),h.onCaughtError!==void 0&&(M=h.onCaughtError),h.onRecoverableError!==void 0&&(J=h.onRecoverableError),h.formState!==void 0&&(we=h.formState)),c=G3(o,1,!0,c,h!=null?h:null,g,_,we,S,M,J,nC),c.context=K3(null),h=c.current,g=rs(),g=Qe(g),_=al(g),_.callback=null,nl(h,_,g),h=g,c.current.lanes=h,Ni(c,h),Oi(c),o[pe]=c.current,q1(o),new jm(c)},mf.version="19.2.7",mf}var yC;function Vz(){if(yC)return hb.exports;yC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hb.exports=Wz(),hb.exports}var Gz=Vz(),xb={};const kt=e=>typeof e=="string",gf=()=>{let e,t;const r=new Promise((a,s)=>{e=a,t=s});return r.resolve=e,r.reject=t,r},vC=e=>e==null?"":""+e,Kz=(e,t,r)=>{e.forEach(a=>{t[a]&&(r[a]=t[a])})},Yz=/###/g,bC=e=>e&&e.indexOf("###")>-1?e.replace(Yz,"."):e,wC=e=>!e||kt(e),Wf=(e,t,r)=>{const a=kt(t)?t.split("."):t;let s=0;for(;s<a.length-1;){if(wC(e))return{};const i=bC(a[s]);!e[i]&&r&&(e[i]=new r),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++s}return wC(e)?{}:{obj:e,k:bC(a[s])}},jC=(e,t,r)=>{const{obj:a,k:s}=Wf(e,t,Object);if(a!==void 0||t.length===1){a[s]=r;return}let i=t[t.length-1],l=t.slice(0,t.length-1),u=Wf(e,l,Object);for(;u.obj===void 0&&l.length;)i=`${l[l.length-1]}.${i}`,l=l.slice(0,l.length-1),u=Wf(e,l,Object),u!=null&&u.obj&&typeof u.obj[`${u.k}.${i}`]!="undefined"&&(u.obj=void 0);u.obj[`${u.k}.${i}`]=r},Xz=(e,t,r,a)=>{const{obj:s,k:i}=Wf(e,t,Object);s[i]=s[i]||[],s[i].push(r)},Ng=(e,t)=>{const{obj:r,k:a}=Wf(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,a))return r[a]},Jz=(e,t,r)=>{const a=Ng(e,r);return a!==void 0?a:Ng(t,r)},bO=(e,t,r)=>{for(const a in t)a!=="__proto__"&&a!=="constructor"&&(a in e?kt(e[a])||e[a]instanceof String||kt(t[a])||t[a]instanceof String?r&&(e[a]=t[a]):bO(e[a],t[a],r):e[a]=t[a]);return e},hc=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Qz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Zz=e=>kt(e)?e.replace(/[&<>"'\/]/g,t=>Qz[t]):e;class eB{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const a=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,a),this.regExpQueue.push(t),a}}const tB=[" ",",","?","!",";"],rB=new eB(20),aB=(e,t,r)=>{t=t||"",r=r||"";const a=tB.filter(l=>t.indexOf(l)<0&&r.indexOf(l)<0);if(a.length===0)return!0;const s=rB.getRegExp(`(${a.map(l=>l==="?"?"\\?":l).join("|")})`);let i=!s.test(e);if(!i){const l=e.indexOf(r);l>0&&!s.test(e.substring(0,l))&&(i=!0)}return i},Ew=(e,t,r=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const a=t.split(r);let s=e;for(let i=0;i<a.length;){if(!s||typeof s!="object")return;let l,u="";for(let d=i;d<a.length;++d)if(d!==i&&(u+=r),u+=a[d],l=s[u],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&d<a.length-1)continue;i+=d-i+1;break}s=l}return s},ah=e=>e==null?void 0:e.replace(/_/g,"-"),nB={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var r,a;(a=(r=console==null?void 0:console[e])==null?void 0:r.apply)==null||a.call(r,console,t)}};class Cg{constructor(t,r={}){this.init(t,r)}init(t,r={}){this.prefix=r.prefix||"i18next:",this.logger=t||nB,this.options=r,this.debug=r.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,a,s){return s&&!this.debug?null:(kt(t[0])&&(t[0]=`${a}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new Cg(this.logger,ee({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Cg(this.logger,t)}}var zi=new Cg;let qx=class{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const s=this.observers[a].get(r)||0;this.observers[a].set(r,s+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t,...r){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([s,i])=>{for(let l=0;l<i;l++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,i])=>{for(let l=0;l<i;l++)s.apply(s,[t,...r])})}};class _C extends qx{constructor(t,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,a,s={}){var f,p;const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,l=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;t.indexOf(".")>-1?u=t.split("."):(u=[t,r],a&&(Array.isArray(a)?u.push(...a):kt(a)&&i?u.push(...a.split(i)):u.push(a)));const d=Ng(this.data,u);return!d&&!r&&!a&&t.indexOf(".")>-1&&(t=u[0],r=u[1],a=u.slice(2).join(".")),d||!l||!kt(a)?d:Ew((p=(f=this.data)==null?void 0:f[t])==null?void 0:p[r],a,i)}addResource(t,r,a,s,i={silent:!1}){const l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let u=[t,r];a&&(u=u.concat(l?a.split(l):a)),t.indexOf(".")>-1&&(u=t.split("."),s=r,r=u[1]),this.addNamespaces(r),jC(this.data,u,s),i.silent||this.emit("added",t,r,a,s)}addResources(t,r,a,s={silent:!1}){for(const i in a)(kt(a[i])||Array.isArray(a[i]))&&this.addResource(t,r,i,a[i],{silent:!0});s.silent||this.emit("added",t,r,a)}addResourceBundle(t,r,a,s,i,l={silent:!1,skipCopy:!1}){let u=[t,r];t.indexOf(".")>-1&&(u=t.split("."),s=a,a=r,r=u[1]),this.addNamespaces(r);let d=Ng(this.data,u)||{};l.skipCopy||(a=JSON.parse(JSON.stringify(a))),s?bO(d,a,i):d=ee(ee({},d),a),jC(this.data,u,d),l.silent||this.emit("added",t,r,a)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(s=>r[s]&&Object.keys(r[s]).length>0)}toJSON(){return this.data}}var wO={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,a,s){return e.forEach(i=>{var l,u;t=(u=(l=this.processors[i])==null?void 0:l.process(t,r,a,s))!=null?u:t}),t}};const jO=Symbol("i18next/PATH_KEY");function sB(){const e=[],t=Object.create(null);let r;return t.get=(a,s)=>{var i;return(i=r==null?void 0:r.revoke)==null||i.call(r),s===jO?e:(e.push(s),r=Proxy.revocable(a,t),r.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Md(e,t){var i,l;const{[jO]:r}=e(sB()),a=(i=t==null?void 0:t.keySeparator)!=null?i:".",s=(l=t==null?void 0:t.nsSeparator)!=null?l:":";if(r.length>1&&s){const u=t==null?void 0:t.ns,d=Array.isArray(u)?u:null;if(d&&d.length>1&&d.slice(1).includes(r[0]))return`${r[0]}${s}${r.slice(1).join(a)}`}return r.join(a)}const kC={},yb=e=>!kt(e)&&typeof e!="boolean"&&typeof e!="number";class Tg extends qx{constructor(t,r={}){super(),Kz(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=zi.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,r={interpolation:{}}){const a=ee({},r);if(t==null)return!1;const s=this.resolve(t,a);if((s==null?void 0:s.res)===void 0)return!1;const i=yb(s.res);return!(a.returnObjects===!1&&i)}extractFromKey(t,r){let a=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let i=r.ns||this.options.defaultNS||[];const l=a&&t.indexOf(a)>-1,u=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!aB(t,a,s);if(l&&!u){const d=t.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:t,namespaces:kt(i)?[i]:i};const f=t.split(a);(a!==s||a===s&&this.options.ns.indexOf(f[0])>-1)&&(i=f.shift()),t=f.join(s)}return{key:t,namespaces:kt(i)?[i]:i}}translate(t,r,a){let s=typeof r=="object"?ee({},r):r;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s=ee({},s)),s||(s={}),t==null)return"";typeof t=="function"&&(t=Md(t,ee(ee({},this.options),s))),Array.isArray(t)||(t=[String(t)]),t=t.map(ne=>typeof ne=="function"?Md(ne,ee(ee({},this.options),s)):String(ne));const i=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:u,namespaces:d}=this.extractFromKey(t[t.length-1],s),f=d[d.length-1];let p=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;p===void 0&&(p=":");const m=s.lng||this.language,x=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((m==null?void 0:m.toLowerCase())==="cimode")return x?i?{res:`${f}${p}${u}`,usedKey:u,exactUsedKey:u,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:`${f}${p}${u}`:i?{res:u,usedKey:u,exactUsedKey:u,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:u;const v=this.resolve(t,s);let b=v==null?void 0:v.res;const w=(v==null?void 0:v.usedKey)||u,j=(v==null?void 0:v.exactUsedKey)||u,k=["[object Number]","[object Function]","[object RegExp]"],C=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,N=!this.i18nFormat||this.i18nFormat.handleAsObject,O=s.count!==void 0&&!kt(s.count),E=Tg.hasDefaultValue(s),A=O?this.pluralResolver.getSuffix(m,s.count,s):"",T=s.ordinal&&O?this.pluralResolver.getSuffix(m,s.count,{ordinal:!1}):"",P=O&&!s.ordinal&&s.count===0,D=P&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${A}`]||s[`defaultValue${T}`]||s.defaultValue;let z=b;N&&!b&&E&&(z=D);const G=yb(z),V=Object.prototype.toString.apply(z);if(N&&z&&G&&k.indexOf(V)<0&&!(kt(C)&&Array.isArray(z))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ne=this.options.returnedObjectHandler?this.options.returnedObjectHandler(w,z,Se(ee({},s),{ns:d})):`key '${u} (${this.language})' returned an object instead of string.`;return i?(v.res=ne,v.usedParams=this.getUsedParamsDetails(s),v):ne}if(l){const ne=Array.isArray(z),ge=ne?[]:{},Z=ne?j:w;for(const U in z)if(Object.prototype.hasOwnProperty.call(z,U)){const ce=`${Z}${l}${U}`;E&&!b?ge[U]=this.translate(ce,Se(ee({},s),{defaultValue:yb(D)?D[U]:void 0,joinArrays:!1,ns:d})):ge[U]=this.translate(ce,Se(ee({},s),{joinArrays:!1,ns:d})),ge[U]===ce&&(ge[U]=z[U])}b=ge}}else if(N&&kt(C)&&Array.isArray(b))b=b.join(C),b&&(b=this.extendTranslation(b,t,s,a));else{let ne=!1,ge=!1;!this.isValidLookup(b)&&E&&(ne=!0,b=D),this.isValidLookup(b)||(ge=!0,b=u);const U=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ge?void 0:b,ce=E&&D!==b&&this.options.updateMissing;if(ge||ne||ce){if(this.logger.log(ce?"updateKey":"missingKey",m,f,u,ce?D:b),l){const oe=this.resolve(u,Se(ee({},s),{keySeparator:!1}));oe&&oe.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let xe=[];const be=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&be&&be[0])for(let oe=0;oe<be.length;oe++)xe.push(be[oe]);else this.options.saveMissingTo==="all"?xe=this.languageUtils.toResolveHierarchy(s.lng||this.language):xe.push(s.lng||this.language);const me=(oe,L,H)=>{var Y;const K=E&&H!==b?H:U;this.options.missingKeyHandler?this.options.missingKeyHandler(oe,f,L,K,ce,s):(Y=this.backendConnector)!=null&&Y.saveMissing&&this.backendConnector.saveMissing(oe,f,L,K,ce,s),this.emit("missingKey",oe,f,L,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?xe.forEach(oe=>{const L=this.pluralResolver.getSuffixes(oe,s);P&&s[`defaultValue${this.options.pluralSeparator}zero`]&&L.indexOf(`${this.options.pluralSeparator}zero`)<0&&L.push(`${this.options.pluralSeparator}zero`),L.forEach(H=>{me([oe],u+H,s[`defaultValue${H}`]||D)})}):me(xe,u,D))}b=this.extendTranslation(b,t,s,v,a),ge&&b===u&&this.options.appendNamespaceToMissingKey&&(b=`${f}${p}${u}`),(ge||ne)&&this.options.parseMissingKeyHandler&&(b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${p}${u}`:u,ne?b:void 0,s))}return i?(v.res=b,v.usedParams=this.getUsedParamsDetails(s),v):b}extendTranslation(t,r,a,s,i){var d,f;if((d=this.i18nFormat)!=null&&d.parse)t=this.i18nFormat.parse(t,ee(ee({},this.options.interpolation.defaultVariables),a),a.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init(Se(ee({},a),{interpolation:ee(ee({},this.options.interpolation),a.interpolation)}));const p=kt(t)&&(((f=a==null?void 0:a.interpolation)==null?void 0:f.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(p){const v=t.match(this.interpolator.nestingRegexp);m=v&&v.length}let x=a.replace&&!kt(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(x=ee(ee({},this.options.interpolation.defaultVariables),x)),t=this.interpolator.interpolate(t,x,a.lng||this.language||s.usedLng,a),p){const v=t.match(this.interpolator.nestingRegexp),b=v&&v.length;m<b&&(a.nest=!1)}!a.lng&&s&&s.res&&(a.lng=this.language||s.usedLng),a.nest!==!1&&(t=this.interpolator.nest(t,(...v)=>(i==null?void 0:i[0])===v[0]&&!a.context?(this.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${r[0]}`),null):this.translate(...v,r),a)),a.interpolation&&this.interpolator.reset()}const l=a.postProcess||this.options.postProcess,u=kt(l)?[l]:l;return t!=null&&(u!=null&&u.length)&&a.applyPostProcessor!==!1&&(t=wO.handle(u,t,r,this.options&&this.options.postProcessPassResolved?ee({i18nResolved:Se(ee({},s),{usedParams:this.getUsedParamsDetails(a)})},a):a,this)),t}resolve(t,r={}){let a,s,i,l,u;return kt(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(d=>typeof d=="function"?Md(d,ee(ee({},this.options),r)):d)),t.forEach(d=>{if(this.isValidLookup(a))return;const f=this.extractFromKey(d,r),p=f.key;s=p;let m=f.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const x=r.count!==void 0&&!kt(r.count),v=x&&!r.ordinal&&r.count===0,b=r.context!==void 0&&(kt(r.context)||typeof r.context=="number")&&r.context!=="",w=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);m.forEach(j=>{var k,C;this.isValidLookup(a)||(u=j,!kC[`${w[0]}-${j}`]&&((k=this.utils)!=null&&k.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(u))&&(kC[`${w[0]}-${j}`]=!0,this.logger.warn(`key "${s}" for languages "${w.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),w.forEach(N=>{var A;if(this.isValidLookup(a))return;l=N;const O=[p];if((A=this.i18nFormat)!=null&&A.addLookupKeys)this.i18nFormat.addLookupKeys(O,p,N,j,r);else{let T;x&&(T=this.pluralResolver.getSuffix(N,r.count,r));const P=`${this.options.pluralSeparator}zero`,D=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(x&&(r.ordinal&&T.indexOf(D)===0&&O.push(p+T.replace(D,this.options.pluralSeparator)),O.push(p+T),v&&O.push(p+P)),b){const z=`${p}${this.options.contextSeparator||"_"}${r.context}`;O.push(z),x&&(r.ordinal&&T.indexOf(D)===0&&O.push(z+T.replace(D,this.options.pluralSeparator)),O.push(z+T),v&&O.push(z+P))}}let E;for(;E=O.pop();)this.isValidLookup(a)||(i=E,a=this.getResource(N,j,E,r))}))})}),{res:a,usedKey:s,exactUsedKey:i,usedLng:l,usedNS:u}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,a,s={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,r,a,s):this.resourceStore.getResource(t,r,a,s)}getUsedParamsDetails(t={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=t.replace&&!kt(t.replace);let s=a?t.replace:t;if(a&&typeof t.count!="undefined"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s=ee(ee({},this.options.interpolation.defaultVariables),s)),!a){s=ee({},s);for(const i of r)delete s[i]}return s}static hasDefaultValue(t){const r="defaultValue";for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&r===a.substring(0,r.length)&&t[a]!==void 0)return!0;return!1}}class SC{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=zi.create("languageUtils")}getScriptPartFromCode(t){if(t=ah(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=ah(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(kt(t)&&t.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(t)[0]}catch(a){}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(a=>{if(r)return;const s=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(s))&&(r=s)}),!r&&this.options.supportedLngs&&t.forEach(a=>{if(r)return;const s=this.getScriptPartFromCode(a);if(this.isSupportedCode(s))return r=s;const i=this.getLanguagePartFromCode(a);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(l=>{if(l===i)return l;if(!(l.indexOf("-")<0&&i.indexOf("-")<0)&&(l.indexOf("-")>0&&i.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===i||l.indexOf(i)===0&&i.length>1))return l})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),kt(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let a=t[r];return a||(a=t[this.getScriptPartFromCode(r)]),a||(a=t[this.formatLanguageCode(r)]),a||(a=t[this.getLanguagePartFromCode(r)]),a||(a=t.default),a||[]}toResolveHierarchy(t,r){const a=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],t),s=[],i=l=>{l&&(this.isSupportedCode(l)?s.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return kt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):kt(t)&&i(this.formatLanguageCode(t)),a.forEach(l=>{s.indexOf(l)<0&&i(this.formatLanguageCode(l))}),s}}const NC={zero:0,one:1,two:2,few:3,many:4,other:5},CC={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class iB{constructor(t,r={}){this.languageUtils=t,this.options=r,this.logger=zi.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,r={}){const a=ah(t==="dev"?"en":t),s=r.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:a,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let l;try{l=new Intl.PluralRules(a,{type:s})}catch(u){if(typeof Intl=="undefined")return this.logger.error("No Intl support, please use an Intl polyfill!"),CC;if(!t.match(/-|_/))return CC;const d=this.languageUtils.getLanguagePartFromCode(t);l=this.getRule(d,r)}return this.pluralRulesCache[i]=l,l}needsPlural(t,r={}){let a=this.getRule(t,r);return a||(a=this.getRule("dev",r)),(a==null?void 0:a.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,r,a={}){return this.getSuffixes(t,a).map(s=>`${r}${s}`)}getSuffixes(t,r={}){let a=this.getRule(t,r);return a||(a=this.getRule("dev",r)),a?a.resolvedOptions().pluralCategories.sort((s,i)=>NC[s]-NC[i]).map(s=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,r,a={}){const s=this.getRule(t,a);return s?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${s.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,a))}}const TC=(e,t,r,a=".",s=!0)=>{let i=Jz(e,t,r);return!i&&s&&kt(r)&&(i=Ew(e,r,a),i===void 0&&(i=Ew(t,r,a))),i},vb=e=>e.replace(/\$/g,"$$$$");class EC{constructor(t={}){var r;this.logger=zi.create("interpolator"),this.options=t,this.format=((r=t==null?void 0:t.interpolation)==null?void 0:r.format)||(a=>a),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:a,useRawValueToEscape:s,prefix:i,prefixEscaped:l,suffix:u,suffixEscaped:d,formatSeparator:f,unescapeSuffix:p,unescapePrefix:m,nestingPrefix:x,nestingPrefixEscaped:v,nestingSuffix:b,nestingSuffixEscaped:w,nestingOptionsSeparator:j,maxReplaces:k,alwaysFormat:C}=t.interpolation;this.escape=r!==void 0?r:Zz,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?hc(i):l||"{{",this.suffix=u?hc(u):d||"}}",this.formatSeparator=f||",",this.unescapePrefix=p?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=x?hc(x):v||hc("$t("),this.nestingSuffix=b?hc(b):w||hc(")"),this.nestingOptionsSeparator=j||",",this.maxReplaces=k||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,a)=>(r==null?void 0:r.source)===a?(r.lastIndex=0,r):new RegExp(a,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,r,a,s){var v;let i,l,u;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=b=>{if(b.indexOf(this.formatSeparator)<0){const C=TC(r,d,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,a,Se(ee(ee({},s),r),{interpolationkey:b})):C}const w=b.split(this.formatSeparator),j=w.shift().trim(),k=w.join(this.formatSeparator).trim();return this.format(TC(r,d,j,this.options.keySeparator,this.options.ignoreJSONStructure),k,a,Se(ee(ee({},s),r),{interpolationkey:j}))};this.resetRegExp();const p=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,m=((v=s==null?void 0:s.interpolation)==null?void 0:v.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>vb(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?vb(this.escape(b)):vb(b)}].forEach(b=>{for(u=0;i=b.regex.exec(t);){const w=i[1].trim();if(l=f(w),l===void 0)if(typeof p=="function"){const k=p(t,i,s);l=kt(k)?k:""}else if(s&&Object.prototype.hasOwnProperty.call(s,w))l="";else if(m){l=i[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),l="";else!kt(l)&&!this.useRawValueToEscape&&(l=vC(l));const j=b.safeValue(l);if(t=t.replace(i[0],j),m?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=i[0].length):b.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),t}nest(t,r,a={}){let s,i,l;const u=(d,f)=>{var w,j;const p=this.nestingOptionsSeparator;if(d.indexOf(p)<0)return d;const m=d.split(new RegExp(`${hc(p)}[ ]*{`));let x=`{${m[1]}`;d=m[0],x=this.interpolate(x,l);const v=x.match(/'/g),b=x.match(/"/g);(((w=v==null?void 0:v.length)!=null?w:0)%2===0&&!b||((j=b==null?void 0:b.length)!=null?j:0)%2!==0)&&(x=x.replace(/'/g,'"'));try{l=JSON.parse(x),f&&(l=ee(ee({},f),l))}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,k),`${d}${p}${x}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,d};for(;s=this.nestingRegexp.exec(t);){let d=[];l=ee({},a),l=l.replace&&!kt(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const f=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(f!==-1&&(d=s[1].slice(f).split(this.formatSeparator).map(p=>p.trim()).filter(Boolean),s[1]=s[1].slice(0,f)),i=r(u.call(this,s[1].trim(),l),l),i&&s[0]===t&&!kt(i))return i;kt(i)||(i=vC(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),i=""),d.length&&(i=d.reduce((p,m)=>this.format(p,m,a.lng,Se(ee({},a),{interpolationkey:s[1].trim()})),i.trim())),t=t.replace(s[0],i),this.regexp.lastIndex=0}return t}}const oB=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const a=e.split("(");t=a[0].toLowerCase().trim();const s=a[1].substring(0,a[1].length-1);t==="currency"&&s.indexOf(":")<0?r.currency||(r.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?r.range||(r.range=s.trim()):s.split(";").forEach(l=>{if(l){const[u,...d]=l.split(":"),f=d.join(":").trim().replace(/^'+|'+$/g,""),p=u.trim();r[p]||(r[p]=f),f==="false"&&(r[p]=!1),f==="true"&&(r[p]=!0),isNaN(f)||(r[p]=parseInt(f,10))}})}return{formatName:t,formatOptions:r}},AC=e=>{const t={};return(r,a,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i=Se(ee({},i),{[s.interpolationkey]:void 0}));const l=a+JSON.stringify(i);let u=t[l];return u||(u=e(ah(a),s),t[l]=u),u(r)}},lB=e=>(t,r,a)=>e(ah(r),a)(t);class cB{constructor(t={}){this.logger=zi.create("formatter"),this.options=t,this.init(t)}init(t,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const a=r.cacheInBuiltFormats?AC:lB;this.formats={number:a((s,i)=>{const l=new Intl.NumberFormat(s,ee({},i));return u=>l.format(u)}),currency:a((s,i)=>{const l=new Intl.NumberFormat(s,Se(ee({},i),{style:"currency"}));return u=>l.format(u)}),datetime:a((s,i)=>{const l=new Intl.DateTimeFormat(s,ee({},i));return u=>l.format(u)}),relativetime:a((s,i)=>{const l=new Intl.RelativeTimeFormat(s,ee({},i));return u=>l.format(u,i.range||"day")}),list:a((s,i)=>{const l=new Intl.ListFormat(s,ee({},i));return u=>l.format(u)})}}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=AC(r)}format(t,r,a,s={}){const i=r.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(u=>u.indexOf(")")>-1)){const u=i.findIndex(d=>d.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,u)].join(this.formatSeparator)}return i.reduce((u,d)=>{var m;const{formatName:f,formatOptions:p}=oB(d);if(this.formats[f]){let x=u;try{const v=((m=s==null?void 0:s.formatParams)==null?void 0:m[s.interpolationkey])||{},b=v.locale||v.lng||s.locale||s.lng||a;x=this.formats[f](u,b,ee(ee(ee({},p),s),v))}catch(v){this.logger.warn(v)}return x}else this.logger.warn(`there was no format function for ${f}`);return u},t)}}const uB=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class dB extends qx{constructor(t,r,a,s={}){var i,l;super(),this.backend=t,this.store=r,this.services=a,this.languageUtils=a.languageUtils,this.options=s,this.logger=zi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(l=(i=this.backend)==null?void 0:i.init)==null||l.call(i,a,s.backend,s)}queueLoad(t,r,a,s){const i={},l={},u={},d={};return t.forEach(f=>{let p=!0;r.forEach(m=>{const x=`${f}|${m}`;!a.reload&&this.store.hasResourceBundle(f,m)?this.state[x]=2:this.state[x]<0||(this.state[x]===1?l[x]===void 0&&(l[x]=!0):(this.state[x]=1,p=!1,l[x]===void 0&&(l[x]=!0),i[x]===void 0&&(i[x]=!0),d[m]===void 0&&(d[m]=!0)))}),p||(u[f]=!0)}),(Object.keys(i).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(l),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(d)}}loaded(t,r,a){const s=t.split("|"),i=s[0],l=s[1];r&&this.emit("failedLoading",i,l,r),!r&&a&&this.store.addResourceBundle(i,l,a,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&a&&(this.state[t]=0);const u={};this.queue.forEach(d=>{Xz(d.loaded,[i],l),uB(d,t),r&&d.errors.push(r),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(f=>{u[f]||(u[f]={});const p=d.loaded[f];p.length&&p.forEach(m=>{u[f][m]===void 0&&(u[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(d=>!d.done)}read(t,r,a,s=0,i=this.retryTimeout,l){if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:a,tried:s,wait:i,callback:l});return}this.readingCalls++;const u=(f,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(f&&p&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,a,s+1,i*2,l)},i);return}l(f,p)},d=this.backend[a].bind(this.backend);if(d.length===2){try{const f=d(t,r);f&&typeof f.then=="function"?f.then(p=>u(null,p)).catch(u):u(null,f)}catch(f){u(f)}return}return d(t,r,u)}prepareLoading(t,r,a={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();kt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),kt(r)&&(r=[r]);const i=this.queueLoad(t,r,a,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(l=>{this.loadOne(l)})}load(t,r,a){this.prepareLoading(t,r,{},a)}reload(t,r,a){this.prepareLoading(t,r,{reload:!0},a)}loadOne(t,r=""){const a=t.split("|"),s=a[0],i=a[1];this.read(s,i,"read",void 0,void 0,(l,u)=>{l&&this.logger.warn(`${r}loading namespace ${i} for language ${s} failed`,l),!l&&u&&this.logger.log(`${r}loaded namespace ${i} for language ${s}`,u),this.loaded(t,l,u)})}saveMissing(t,r,a,s,i,l={},u=()=>{}){var d,f,p,m,x;if((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace&&!((m=(p=this.services)==null?void 0:p.utils)!=null&&m.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${a}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if((x=this.backend)!=null&&x.create){const v=Se(ee({},l),{isUpdate:i}),b=this.backend.create.bind(this.backend);if(b.length<6)try{let w;b.length===5?w=b(t,r,a,s,v):w=b(t,r,a,s),w&&typeof w.then=="function"?w.then(j=>u(null,j)).catch(u):u(null,w)}catch(w){u(w)}else b(t,r,a,s,u,v)}!t||!t[0]||this.store.addResource(t[0],r,a,s)}}}const bb=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),kt(e[1])&&(t.defaultValue=e[1]),kt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(a=>{t[a]=r[a]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),OC=e=>{var t,r;return kt(e.ns)&&(e.ns=[e.ns]),kt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),kt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((r=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:r.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Sm=()=>{},fB=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})},_O="__i18next_supportNoticeShown",hB=()=>!!(typeof globalThis!="undefined"&&globalThis[_O]||typeof process!="undefined"&&xb&&xb.I18NEXT_NO_SUPPORT_NOTICE||typeof process!="undefined"&&xb),pB=()=>{typeof globalThis!="undefined"&&(globalThis[_O]=!0)},mB=e=>{var t,r,a,s,i,l,u,d,f,p,m,x,v;return!!(((a=(r=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:r.name)==null?void 0:a.indexOf("Locize"))>0||((u=(l=(i=(s=e==null?void 0:e.modules)==null?void 0:s.backend)==null?void 0:i.constructor)==null?void 0:l.name)==null?void 0:u.indexOf("Locize"))>0||(f=(d=e==null?void 0:e.options)==null?void 0:d.backend)!=null&&f.backends&&e.options.backend.backends.some(b=>{var w,j,k;return((w=b==null?void 0:b.name)==null?void 0:w.indexOf("Locize"))>0||((k=(j=b==null?void 0:b.constructor)==null?void 0:j.name)==null?void 0:k.indexOf("Locize"))>0})||(m=(p=e==null?void 0:e.options)==null?void 0:p.backend)!=null&&m.projectId||(v=(x=e==null?void 0:e.options)==null?void 0:x.backend)!=null&&v.backendOptions&&e.options.backend.backendOptions.some(b=>b==null?void 0:b.projectId))};class Vf extends qx{constructor(t={},r){if(super(),this.options=OC(t),this.services={},this.logger=zi,this.modules={external:[]},fB(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(t={},r){this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(kt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const a=bb();this.options=ee(ee(ee({},a),this.options),OC(t)),this.options.interpolation=ee(ee({},a.interpolation),this.options.interpolation),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=a.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!mB(this)&&!hB()&&(typeof console!="undefined"&&typeof console.info!="undefined"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),pB());const s=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?zi.init(s(this.modules.logger),this.options):zi.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=cB;const p=new SC(this.options);this.store=new _C(this.options.resources,this.options);const m=this.services;m.logger=zi,m.resourceStore=this.store,m.languageUtils=p,m.pluralResolver=new iB(p,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==a.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),f&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(m.formatter=s(f),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new EC(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new dB(s(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(v,...b)=>{this.emit(v,...b)}),this.modules.languageDetector&&(m.languageDetector=s(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=s(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Tg(this.services,this.options),this.translator.on("*",(v,...b)=>{this.emit(v,...b)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Sm),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=(...p)=>this.store[f](...p)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...p)=>(this.store[f](...p),this)});const u=gf(),d=()=>{const f=(p,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(m),r(p,m)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?d():setTimeout(d,0),u}loadResources(t,r=Sm){var i,l;let a=r;const s=kt(t)?t:this.language;if(typeof t=="function"&&(a=t),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const u=[],d=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(m=>{m!=="cimode"&&u.indexOf(m)<0&&u.push(m)})};s?d(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>d(p)),(l=(i=this.options.preload)==null?void 0:i.forEach)==null||l.call(i,f=>d(f)),this.services.backendConnector.load(u,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(f)})}else a(null)}reloadResources(t,r,a){const s=gf();return typeof t=="function"&&(a=t,t=void 0),typeof r=="function"&&(a=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),a||(a=Sm),this.services.backendConnector.reload(t,r,i=>{s.resolve(),a(i)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&wO.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let r=0;r<this.languages.length;r++){const a=this.languages[r];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,r){this.isLanguageChangingTo=t;const a=gf();this.emit("languageChanging",t);const s=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},i=(u,d)=>{d?this.isLanguageChangingTo===t&&(s(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,a.resolve((...f)=>this.t(...f)),r&&r(u,(...f)=>this.t(...f))},l=u=>{var p,m;!t&&!u&&this.services.languageDetector&&(u=[]);const d=kt(u)?u:u&&u[0],f=this.store.hasLanguageSomeTranslations(d)?d:this.services.languageUtils.getBestMatchFromCodes(kt(u)?[u]:u);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),(m=(p=this.services.languageDetector)==null?void 0:p.cacheUserLanguage)==null||m.call(p,f)),this.loadResources(f,x=>{i(x,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),a}getFixedT(t,r,a){const s=(i,l,...u)=>{let d;typeof l!="object"?d=this.options.overloadTranslationOptionHandler([i,l].concat(u)):d=ee({},l),d.lng=d.lng||s.lng,d.lngs=d.lngs||s.lngs,d.ns=d.ns||s.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||a||s.keyPrefix);const f=ee(ee({},this.options),d);typeof d.keyPrefix=="function"&&(d.keyPrefix=Md(d.keyPrefix,f));const p=this.options.keySeparator||".";let m;return d.keyPrefix&&Array.isArray(i)?m=i.map(x=>(typeof x=="function"&&(x=Md(x,f)),`${d.keyPrefix}${p}${x}`)):(typeof i=="function"&&(i=Md(i,f)),m=d.keyPrefix?`${d.keyPrefix}${p}${i}`:i),this.t(m,d)};return kt(t)?s.lng=t:s.lngs=t,s.ns=r,s.keyPrefix=a,s}t(...t){var r;return(r=this.translator)==null?void 0:r.translate(...t)}exists(...t){var r;return(r=this.translator)==null?void 0:r.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const a=r.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const l=(u,d)=>{const f=this.services.backendConnector.state[`${u}|${d}`];return f===-1||f===0||f===2};if(r.precheck){const u=r.precheck(this,l);if(u!==void 0)return u}return!!(this.hasResourceBundle(a,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(a,t)&&(!s||l(i,t)))}loadNamespaces(t,r){const a=gf();return this.options.ns?(kt(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{a.resolve(),r&&r(s)}),a):(r&&r(),Promise.resolve())}loadLanguages(t,r){const a=gf();kt(t)&&(t=[t]);const s=this.options.preload||[],i=t.filter(l=>s.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return i.length?(this.options.preload=s.concat(i),this.loadResources(l=>{a.resolve(),r&&r(l)}),a):(r&&r(),Promise.resolve())}dir(t){var s,i;if(t||(t=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const l=new Intl.Locale(t);if(l&&l.getTextInfo){const u=l.getTextInfo();if(u&&u.direction)return u.direction}}catch(l){}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=((i=this.services)==null?void 0:i.languageUtils)||new SC(bb());return t.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(a.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},r){const a=new Vf(t,r);return a.createInstance=Vf.createInstance,a}cloneInstance(t={},r=Sm){const a=t.forkResourceStore;a&&delete t.forkResourceStore;const s=Se(ee(ee({},this.options),t),{isClone:!0}),i=new Vf(s);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(u=>{i[u]=this[u]}),i.services=ee({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},a){const u=Object.keys(this.store.data).reduce((d,f)=>(d[f]=ee({},this.store.data[f]),d[f]=Object.keys(d[f]).reduce((p,m)=>(p[m]=ee({},d[f][m]),p),d[f]),d),{});i.store=new _C(u,s),i.services.resourceStore=i.store}if(t.interpolation){const u=bb(),d=ee(ee(ee({},u.interpolation),this.options.interpolation),t.interpolation),f=Se(ee({},s),{interpolation:d});i.services.interpolator=new EC(f)}return i.translator=new Tg(i.services,s),i.translator.on("*",(u,...d)=>{i.emit(u,...d)}),i.init(s,r),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ra=Vf.createInstance();Ra.createInstance;Ra.dir;Ra.init;Ra.loadResources;Ra.reloadResources;Ra.use;Ra.changeLanguage;Ra.getFixedT;Ra.t;Ra.exists;Ra.setDefaultNamespace;Ra.hasLoadedNamespace;Ra.loadNamespaces;Ra.loadLanguages;const gB=(e,t,r,a)=>{var i,l,u,d;const s=[r,ee({code:t},a||{})];if((l=(i=e==null?void 0:e.services)==null?void 0:i.logger)!=null&&l.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);Vc(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(d=(u=e==null?void 0:e.services)==null?void 0:u.logger)!=null&&d.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},PC={},Aw=(e,t,r,a)=>{Vc(r)&&PC[r]||(Vc(r)&&(PC[r]=new Date),gB(e,t,r,a))},kO=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},Ow=(e,t,r)=>{e.loadNamespaces(t,kO(e,r))},DC=(e,t,r,a)=>{if(Vc(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ow(e,r,a);r.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,kO(e,a))},xB=(e,t,r={})=>!t.languages||!t.languages.length?(Aw(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(a,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!s(a.isLanguageChangingTo,e))return!1}}),Vc=e=>typeof e=="string",yB=e=>typeof e=="object"&&e!==null,vB=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,bB={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},wB=e=>bB[e],jB=e=>e.replace(vB,wB);let Pw={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:jB,transDefaultProps:void 0};const _B=(e={})=>{Pw=ee(ee({},Pw),e)},kB=()=>Pw;let SO;const SB=e=>{SO=e},NB=()=>SO,CB={type:"3rdParty",init(e){_B(e.options.react),SB(e)}},TB=y.createContext();class EB{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var wb={exports:{}},jb={};var RC;function AB(){if(RC)return jb;RC=1;var e=o0();function t(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function u(m,x){var v=x(),b=a({inst:{value:v,getSnapshot:x}}),w=b[0].inst,j=b[1];return i(function(){w.value=v,w.getSnapshot=x,d(w)&&j({inst:w})},[m,v,x]),s(function(){return d(w)&&j({inst:w}),m(function(){d(w)&&j({inst:w})})},[m]),l(v),v}function d(m){var x=m.getSnapshot;m=m.value;try{var v=x();return!r(m,v)}catch(b){return!0}}function f(m,x){return x()}var p=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?f:u;return jb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,jb}var FC;function NO(){return FC||(FC=1,wb.exports=AB()),wb.exports}var OB=NO();const PB=(e,t)=>{if(Vc(t))return t;if(yB(t)&&Vc(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const r=e[e.length-1];return typeof r=="function"?"":r}return e},DB={t:PB,ready:!1},RB=()=>()=>{},sr=(e,t={})=>{var D,z,G;const{i18n:r}=t,{i18n:a,defaultNS:s}=y.useContext(TB)||{},i=r||a||NB();i&&!i.reportNamespaces&&(i.reportNamespaces=new EB),i||Aw(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=y.useMemo(()=>{var V;return ee(ee(ee({},kB()),(V=i==null?void 0:i.options)==null?void 0:V.react),t)},[i,t]),{useSuspense:u,keyPrefix:d}=l,f=s||((D=i==null?void 0:i.options)==null?void 0:D.defaultNS),p=Vc(f)?[f]:f||["translation"],m=y.useMemo(()=>p,p);(G=(z=i==null?void 0:i.reportNamespaces)==null?void 0:z.addUsedNamespaces)==null||G.call(z,m);const x=y.useRef(0),v=y.useCallback(V=>{if(!i)return RB;const{bindI18n:ne,bindI18nStore:ge}=l,Z=()=>{x.current+=1,V()};return ne&&i.on(ne,Z),ge&&i.store.on(ge,Z),()=>{ne&&ne.split(" ").forEach(U=>i.off(U,Z)),ge&&ge.split(" ").forEach(U=>i.store.off(U,Z))}},[i,l]),b=y.useRef(),w=y.useCallback(()=>{if(!i)return DB;const V=!!(i.isInitialized||i.initializedStoreOnce)&&m.every(xe=>xB(xe,i,l)),ne=t.lng||i.language,ge=x.current,Z=b.current;if(Z&&Z.ready===V&&Z.lng===ne&&Z.keyPrefix===d&&Z.revision===ge)return Z;const ce={t:i.getFixedT(ne,l.nsMode==="fallback"?m:m[0],d),ready:V,lng:ne,keyPrefix:d,revision:ge};return b.current=ce,ce},[i,m,d,l,t.lng]),[j,k]=y.useState(0),{t:C,ready:N}=OB.useSyncExternalStore(v,w,w);y.useEffect(()=>{if(i&&!N&&!u){const V=()=>k(ne=>ne+1);t.lng?DC(i,t.lng,m,V):Ow(i,m,V)}},[i,t.lng,m,N,u,j]);const O=i||{},E=y.useRef(null),A=y.useRef(),T=V=>{const ne=Object.getOwnPropertyDescriptors(V);ne.__original&&delete ne.__original;const ge=Object.create(Object.getPrototypeOf(V),ne);if(!Object.prototype.hasOwnProperty.call(ge,"__original"))try{Object.defineProperty(ge,"__original",{value:V,writable:!1,enumerable:!1,configurable:!1})}catch(Z){}return ge},P=y.useMemo(()=>{const V=O,ne=V==null?void 0:V.language;let ge=V;V&&(E.current&&E.current.__original===V?A.current!==ne?(ge=T(V),E.current=ge,A.current=ne):ge=E.current:(ge=T(V),E.current=ge,A.current=ne));const Z=!N&&!u?(...ce)=>(Aw(i,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),C(...ce)):C,U=[Z,ge,N];return U.t=Z,U.i18n=ge,U.ready=N,U},[C,O,N,O.resolvedLanguage,O.language,O.languages]);if(i&&u&&!N)throw new Promise(V=>{const ne=()=>V();t.lng?DC(i,t.lng,m,ne):Ow(i,m,ne)});return P},{slice:FB,forEach:MB}=[];function LB(e){return MB.call(FB.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function IB(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(r=>r.test(e))}const MC=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,zB=function(e,t){const a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(t);let i=`${e}=${s}`;if(a.maxAge>0){const l=a.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(l)}`}if(a.domain){if(!MC.test(a.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${a.domain}`}if(a.path){if(!MC.test(a.path))throw new TypeError("option path is invalid");i+=`; Path=${a.path}`}if(a.expires){if(typeof a.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${a.expires.toUTCString()}`}if(a.httpOnly&&(i+="; HttpOnly"),a.secure&&(i+="; Secure"),a.sameSite)switch(typeof a.sameSite=="string"?a.sameSite.toLowerCase():a.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return a.partitioned&&(i+="; Partitioned"),i},LC={create(e,t,r,a){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+r*60*1e3)),a&&(s.domain=a),document.cookie=zB(e,t,s)},read(e){const t=`${e}=`,r=document.cookie.split(";");for(let a=0;a<r.length;a++){let s=r[a];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return s.substring(t.length,s.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var BB={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document!="undefined")return LC.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:a,cookieDomain:s,cookieOptions:i}=t;r&&typeof document!="undefined"&&LC.create(r,e,a,s,i)}},$B={name:"querystring",lookup(e){var a;let{lookupQuerystring:t}=e,r;if(typeof window!="undefined"){let{search:s}=window.location;!window.location.search&&((a=window.location.hash)==null?void 0:a.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const l=s.substring(1).split("&");for(let u=0;u<l.length;u++){const d=l[u].indexOf("=");d>0&&l[u].substring(0,d)===t&&(r=l[u].substring(d+1))}}return r}},UB={name:"hash",lookup(e){var s;let{lookupHash:t,lookupFromHashIndex:r}=e,a;if(typeof window!="undefined"){const{hash:i}=window.location;if(i&&i.length>2){const l=i.substring(1);if(t){const u=l.split("&");for(let d=0;d<u.length;d++){const f=u[d].indexOf("=");f>0&&u[d].substring(0,f)===t&&(a=u[d].substring(f+1))}}if(a)return a;if(!a&&r>-1){const u=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(u)?(s=u[typeof r=="number"?r:0])==null?void 0:s.replace("/",""):void 0}}}return a}};let ad=null;const IC=()=>{if(ad!==null)return ad;try{if(ad=typeof window!="undefined"&&window.localStorage!==null,!ad)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){ad=!1}return ad};var HB={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&IC())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&IC()&&window.localStorage.setItem(r,e)}};let nd=null;const zC=()=>{if(nd!==null)return nd;try{if(nd=typeof window!="undefined"&&window.sessionStorage!==null,!nd)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){nd=!1}return nd};var qB={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&zC())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&zC()&&window.sessionStorage.setItem(r,e)}},WB={name:"navigator",lookup(e){const t=[];if(typeof navigator!="undefined"){const{languages:r,userLanguage:a,language:s}=navigator;if(r)for(let i=0;i<r.length;i++)t.push(r[i]);a&&t.push(a),s&&t.push(s)}return t.length>0?t:void 0}},VB={name:"htmlTag",lookup(e){let{htmlTag:t}=e,r;const a=t||(typeof document!="undefined"?document.documentElement:null);return a&&typeof a.getAttribute=="function"&&(r=a.getAttribute("lang")),r}},GB={name:"path",lookup(e){var s;let{lookupFromPathIndex:t}=e;if(typeof window=="undefined")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?(s=r[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}},KB={name:"subdomain",lookup(e){var s,i;let{lookupFromSubdomainIndex:t}=e;const r=typeof t=="number"?t+1:1,a=typeof window!="undefined"&&((i=(s=window.location)==null?void 0:s.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(a)return a[r]}};let CO=!1;try{document.cookie,CO=!0}catch(e){}const TO=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];CO||TO.splice(1,1);const YB=()=>({order:TO,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class EO{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,r)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=LB(r,this.options||{},YB()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=a,this.addDetector(BB),this.addDetector($B),this.addDetector(HB),this.addDetector(qB),this.addDetector(WB),this.addDetector(VB),this.addDetector(GB),this.addDetector(KB),this.addDetector(UB)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return t.forEach(a=>{if(this.detectors[a]){let s=this.detectors[a].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(r=r.concat(s))}}),r=r.filter(a=>a!=null&&!IB(a)).map(a=>this.options.convertDetectedLanguage(a)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(a=>{this.detectors[a]&&this.detectors[a].cacheUserLanguage(t,this.options)}))}}EO.type="languageDetector";const XB={dashboard:"Dashboard",assets:"Assets",workOrders:"Work Orders",maintenance:"Asset Maintenance",ppm:"PPM",logout:"Logout",login:"Login",email:"Email",password:"Password",submit:"Submit",cancel:"Cancel",save:"Save",saveChanges:"Save Changes",delete:"Delete",deleting:"Deleting...",edit:"Edit",create:"Create",search:"Search",filter:"Filter",export:"Export",import:"Import",loading:"Loading...",noData:"No data available",error:"Error",success:"Success",darkMode:"Dark Mode",lightMode:"Light Mode",language:"Language",english:"English",arabic:"Arabic",backToDashboard:"Back to Dashboard",back:"Back",saving:"Saving...",tryAgain:"Try Again",filters:"Filters",enterFilterName:"Enter filter name",saveFilterPreset:"Save Filter Preset",saveFilter:"Save Filter",filtering:"Filtering...",updating:"Updating...",clearFilters:"Clear filters",total:"Total",selected:"selected",rows:"rows",actions:"Actions",selectAllTitle:"Select all",deselectAllTitle:"Deselect all",typeToSearch:"Type to search...",typing:"typing...",enterFilterNameExample:"Enter filter name (e.g., 'Open High Priority')",yes:"Yes",no:"No"},JB={title:"SEERA-ASM",loggedInAs:"Logged in as:",version:"Seera-ASM v2.26",inventory:"Inventory",ppmPlanner:"PPM Planner",maintenanceCalendar:"Maintenance Calendar",activeMap:"Active Map",maintenanceTeam:"Maintenance Team",procurement:"Procurement",projects:"Project Management",sla:"Service Level Agreement (SLA)",support:"Support",inspection:"Inspection",sfdaEntries:"SFDA Recalls",deleteRequests:"Delete Requests",userProfile:"User Profile"},QB={moduleTitle:"Project Management",title:"Projects",listTotal:"Total: ",listProject:"project",listProjects:"projects",projectsDoctype:"Projects",tasksDoctype:"Tasks",timesheetDoctype:"Timesheets",projectTemplateDoctype:"Project templates",activityTypeDoctype:"Activity types",newProject:"New project",newTask:"New task",newTimesheet:"New timesheet",newProjectTemplate:"New project template",newActivityType:"New activity type",searchPlaceholder:"Search by project name…",noProjects:"No projects found.",noTasks:"No tasks found.",noTimesheets:"No timesheets found.",projectName:"Project name",customer:"Customer",expectedEnd:"Expected end",progress:"Progress",project:"Project",assignedTo:"Assigned to",dueDate:"Due date",timesheetId:"Timesheet",totalHours:"Total hours",taskColumn:"Task",templateCreated:"Template saved.",templateUpdated:"Template updated.",timesheetCreated:"Timesheet saved.",timesheetUpdated:"Timesheet updated.",reportsDashboardTitle:"Project reports",reportsDashboardSubtitle:"Portfolio KPIs and charts from Project, Task, and Timesheet data.",projectOverviewSection:"Project overview",projectOverviewBanner:"Project Overview",reportProjectFilter:"Report project",reportProjectFilterHint:"Selection applies to charts, KPIs, and tasks. Project snapshot and project updates appear only when a project is selected.",selectProjectPlaceholder:"Select project…",searchProjectPlaceholder:"Search by name or ID…",clearProjectSelection:"Clear selection",noMatchingOpenProjects:"No matching open projects.",projectPickerLimitNote:"Showing up to 2,000 most recently modified open projects. Refine search to find one.",snapshotProjectBudget:"Project budget",snapshotOverallShort:"Overall",overviewProjectNameLabel:"Project Name :",overviewDepartmentLabel:"Department:",overviewDateLabel:"DATE:",overviewProgressLabel:"Progress:",overviewCustomerLabel:"Customer:",overviewDatesUpToday:"Dates up today",overviewProjectDuration:"Project Duration",overviewStartDateLabel:"Project start Date :",overviewEndDateLabel:"Project End Date :",projectNotesSection:"Project notes",hubSubtitle:"Projects, tasks, timesheets, and linked other documents.",reportsCardSub:"Charts & portfolio snapshot",chipOpenProjects:"Open projects",sectionCoreTitle:"Project & task management",sectionCoreSubtitle:"Core project tracking and planning.",tasksCardSub:"All tasks",timesheetsCardSub:"Time logs",reportsCardLabel:"Reports"},ZB={twoFactorTitle:"Two-factor authentication (OTP App)",twoFactorSidebarTitle:"Two-factor auth",twoFactorOtpAppNoteShort:"Authenticator app required. Reset only if you need a new QR setup.",twoFactorLoading:"Loading security settings…",twoFactorRequired:"Two-factor authentication is required for your account.",twoFactorNotRequired:"Two-factor authentication is not required for your roles.",twoFactorDisabledSite:"Two-factor authentication is not enabled on this site.",twoFactorOtpAppNote:"Use an authenticator app (Google Authenticator, Authy, etc.). On first login after reset, check your email for a QR setup link.",resetOtp:"Reset authenticator",resetOtpConfirm:"Reset your OTP secret? You will need to scan a new QR code on your next login.",resetOtpSuccess:"Authenticator reset. Check your email on next login for setup instructions.",resetOtpFailed:"Could not reset authenticator."},e$={title:"SEERA-ASM",subtitle:"Asset Management System",signIn:"Sign in to continue",emailPlaceholder:"Enter your email",passwordPlaceholder:"Enter your password",loginFailed:"Login failed. Please check your credentials.",demoLogin:"Demo Login",or:"or",forgotPassword:"Forgot password?",forgotPasswordTitle:"Forgot password?",forgotPasswordHint:"Enter the email or username you use to sign in. We will send reset instructions to your registered email address.",forgotPasswordUserRequired:"Please enter your email or username.",forgotPasswordUserPlaceholder:"Email or username",forgotPasswordSubmit:"Send reset link",forgotPasswordClose:"Cancel",forgotPasswordSentSuccess:"Password reset instructions have been sent to your registered email address. Please check your inbox.",forgotPasswordNotFound:"No user account was found with the provided email address.",forgotPasswordTimeout:"The request took too long. Please try again or contact your administrator if outbound email is not configured.",forgotPasswordCannotReset:"Password reset is not available for this account.",forgotPasswordFailed:"Could not send reset email. Please try again later.",finishingSignOut:"Finishing sign-out…",afterPasswordResetSignIn:"Your password was updated. Please sign in with your new password.",twoFactorTitle:"Two-factor verification",twoFactorCodeLabel:"Verification code",twoFactorCodePlaceholder:"000000",twoFactorVerify:"Verify",twoFactorBackToLogin:"Back to sign in",twoFactorOtpAppEnter:"Enter the 6-digit code from your authenticator app.",twoFactorOtpAppSetupIncomplete:"Authenticator setup is not complete. Check your email for the QR setup link or contact your administrator.",twoFactorEmailQrHint:"Open the setup link in your email on this device to scan the QR code, then return here to enter your code.",twoFactorCodeRequired:"Please enter the verification code.",twoFactorInvalid:"Incorrect verification code. Please try again.",twoFactorSessionExpired:"Verification session expired. Please sign in again."},t$={title:"Dashboard",loading:"Loading dashboard...",totalAssets:"TOTAL NO. OF ASSETS",assetsDown:"Assets Down",openWorkOrders:"OPEN WORK ORDERS",workOrdersInProgress:"WORK ORDERS IN PROGRESS",completedWorkOrders:"COMPLETED WORK ORDERS",totalWorkOrders:"TOTAL WORK ORDERS",overdueWorkOrders:"OVERDUE WORK ORDERS",closedWorkOrders:"Closed Work Orders",upTime:"Up Time",downTime:"Down Time",workOrderStatus:"Work Order Status",workOrderByType:"Work Order by Type",maintenanceByAsset:"Maintenance - Asset wise Count",assigneesStatus:"Asset Maintenance Assignees Status Count",assigneesCount:"Assignees",totalTasksAssigned:"Tasks Assigned",maintenanceFrequency:"Asset Maintenance Frequency Chart",maintenanceLogs:"MAINTENANCE LOGS",assetUptime:"Asset Uptime",avgResponseTime:"Avg Response Time",maintenanceEfficiency:"Maintenance Efficiency",overdueMaintenance:"Overdue Maintenance",upDownTimeChart:"Up & Down Time Chart",ppmStatus:"PPM Status",completionRate:"Contractor Completion Rate",completionRateChartHint:"Completion % over last 7 months — hover a point for details",completionRateTooltip:"{{value}}% completion rate",viewFullReport:"View Full Report",noDataAvailable:"No data available",loadingTechnicianHours:"Loading technician hours...",loadingTechnicianWorkData:"Loading technician work data...",welcome:"Welcome,",user:"User",failedToLoad:"Failed to load dashboard data",recentRecords:"Recent Records",latestEntries:"Latest entries from your Frappe backend",quickActions:"Quick Actions",cardTotalAssets:"Total Assets",cardOpenWorkOrders:"Open Work Orders",cardInProgress:"In Progress",cardCompletedWorkOrders:"Completed Work Orders",viewUsers:"View Users",manageUserAccounts:"Manage user accounts",settings:"Settings",configurePreferences:"Configure your preferences",events:"Events",viewCalendarEvents:"View calendar events",reports:"Reports",viewAnalyticsReports:"View analytics and reports",ppmTemplateCounts:"PPM Template Counts",repairCost:"Repair Cost",dashboardFilter:"Dashboard Filter",allDepartments:"All Departments",workOrderStatusDistribution:"Work Order Status Distribution",workOrderInspectionSummary:"Work Order Inspection Summary",woRejectionSummary:"WO Rejection Summary",total:"Total",inProgress:"In Progress",completed:"Completed",totalSales:"Total Sales",average:"Average",noChartDataAvailable:"No chart data available",loadingInspectionData:"Loading inspection data...",noInspectionDataAvailable:"No inspection data available",totalRejections:"Total rejections",loadingRejectionData:"Loading rejection data...",noRejectionDataAvailable:"No rejection data available",department:"Department",allOperational:"All Operational",low:"Low",highPriority:"High Priority",allClear:"All Clear",fastResponse:"Fast Response",monitor:"Monitor",onTrack:"On Track",needsAttention:"Needs Attention",totalHours:"Total: {{value}} hours",technicianWorkingHours:"Technicians Working Hours",techniciansWorked:"Technicians Work Summary",pendingReviewWorkOrders:"Pending Review",clear:"Clear",clearFilter:"Clear Filter",label:"Label",open:"Open"},r$={assetId:"Asset ID",assetName:"Asset Name",serialNumber:"Serial Number",company:"Company/Hospital",building:"Building",roomNumber:"Room Number",location:"Location",department:"Department",deviceStatus:"Device Status",modality:"Modality",manufacturer:"Manufacturer",supplier:"Supplier",assetCategory:"Asset Category",purchaseDate:"Purchase Date",purchaseAmount:"Purchase Amount",availableForUseDate:"Available For Use Date",createdOn:"Created On",modifiedOn:"Modified On",createdBy:"Created By",modifiedBy:"Modified By",workOrderId:"Work Order ID",workOrderType:"Type",status:"Status",priority:"Priority",description:"Description",assignedTo:"Assigned To",scheduledDate:"Scheduled Date",completedDate:"Completed Date",hospital:"Hospital",assetType:"Asset Type",siteName:"Site Name",assignedSupervisor:"Assigned Supervisor",assignedContractor:"Assigned Contractor",serialNumberShort:"Serial",departmentShort:"Dept",manufacturerShort:"Mfr",workOrderIdShort:"WO ID",assetShort:"Asset",typeShort:"Type",nameShort:"Name",pmId:"PM ID",name:"Name"},a$={filterBy:"Filter By",createdDate:"Created Date",latestModifiedDate:"Latest Modified Date",startDate:"Start Date",endDate:"End Date",assetId:"Asset ID",hospital:"Hospital",name:"Name",serial:"Serial",status:"Status",location:"Location",dept:"Dept",modality:"Modality",mfr:"Mfr",supplier:"Supplier",workOrderId:"WO ID",asset:"Asset",type:"Type",priority:"Priority",workflowState:"Workflow State",allStatuses:"All Statuses",allStates:"All States",allTypes:"All Types",allPriorities:"All priorities",allHospitals:"All Hospitals",allModalities:"All Modalities",filterByCompany:"Filter by Company",allManufacturers:"All Manufacturers",sortBy:"Sort by",sortCreationNewest:"Creation (newest first)",sortCreationOldest:"Creation (oldest first)",sortModifiedNewest:"Modified (newest first)",sortModifiedOldest:"Modified (oldest first)",sortNameAsc:"Name (A-Z)",sortNameDesc:"Name (Z-A)",sortAssetNameAsc:"Asset Name (A-Z)",sortAssetNameDesc:"Asset Name (Z-A)",sortItemNameAsc:"Item Name (A-Z)",sortItemNameDesc:"Item Name (Z-A)",sortTeamNameAsc:"Team Name (A-Z)",sortTeamNameDesc:"Team Name (Z-A)"},n$={addNew:"Add New",searchPlaceholder:"Search...",noResults:"No results found",showing:"Showing",of:"of",results:"results",selectAll:"Select All",deselectAll:"Deselect All",selected:"selected",actions:"Actions",view:"View",edit:"Edit",delete:"Delete",duplicate:"Duplicate",export:"Export",print:"Print",filters:"Filters",clearFilters:"Clear Filters",applyFilters:"Apply Filters",columns:"Columns",exportSelected:"Export Selected",exportAllOnPage:"Export All on Page",exportAllWithFilters:"Export All with Filters",exportFormat:"Export Format",csv:"CSV",excel:"Excel",exporting:"Exporting...",exportComplete:"Export Complete",close:"Close",loading:"Loading...",refresh:"Refresh",deselectAllTitle:"Deselect all",selectAllTitle:"Select all",typeToSearch:"Type to search...",enterFilterName:"Enter filter name",enterFilterNameExample:"Enter filter name (e.g., 'Open High Priority')",allStatuses:"All Statuses",noIssuesFound:"No issues found",createFirstIssue:"Create your first issue",saveFilterPreset:"Save Filter Preset",saveFilter:"Save Filter",savedFilters:"Saved Filters",clear:"Clear",typing:"typing...",filtering:"Filtering...",noMaintenanceTeamsFound:"No maintenance teams found",createFirstTeam:"Create your first team",all:"All",tryAdjustingFilters:"Try adjusting your search or filters",getStartedCreateFirst:"Get started by creating your first PPM Planner",noMaintenanceLogsFound:"No maintenance logs found",createFirstMaintenanceLog:"Create your first maintenance log",total:"Total",noPPMSchedulesFound:"No PPM schedules found",createFirstPPMSchedule:"Create your first PPM schedule",deleteConfirmCannotUndo:"This action cannot be undone."},s$={title:"Assets",addAsset:"Add New Asset",assetDetails:"Asset Details",assetInformation:"Asset Information",newAsset:"New Asset",duplicateAsset:"Duplicate Asset",fromAsset:"From Asset",creatingFromAsset:"Creating Work Order from Asset",assetInfoPrefilled:"Asset information prefilled from",pleaseSelectWorkOrderType:"Please select a Work Order type and add any additional details",loadingAssetDetails:"Loading asset details...",pleaseEnterAssetName:"Please enter an Asset Name",pleaseSelectCategory:"Please select a Category",assetDuplicatedSuccessfully:"Asset duplicated successfully!",assetCreatedSuccessfully:"Asset created successfully!",assetUpdatedSuccessfully:"Asset updated successfully!",sourceAssetNotFound:"Source Asset Not Found",assetNotFoundMessage:"The asset you're trying to duplicate could not be found.",backToAssetsList:"Back to Assets List",backToList:"Back to assets list",createNewAsset:"Create New Asset",newAssetDetails:"New Asset Details",noAssetsFound:"No assets found",createFirstAsset:"Create your first asset",deleteConfirmTitle:"Delete Asset",deleteConfirmMessage:"Are you sure you want to delete this asset? This action cannot be undone.",noDataToExport:"No data to export",loadingPermissions:"Loading permissions...",selectAssetId:"Select Asset ID",selectHospital:"Hospital",viewDetails:"View Details",editAsset:"Edit Asset",createWorkOrder:"Create Work Order",viewLinkedWOs:"View Linked Work Orders",moreActions:"More Actions",exportAsJson:"Export as JSON",printAsset:"Print",status:{up:"Up",down:"Down"},deviceStatus:"Device Status",apiNotAvailable:"Asset API Not Available",apiNotDeployed:"The Asset API endpoint is not deployed yet.",tryCreatingNew:"Try Creating a New Asset (Demo)",listTotal:"Total: ",table:{assetName:"Asset Name",serialNo:"Serial No",company:"Company",location:"Location",status:"Status",updatedOn:"Updated on",actions:"Actions"},export:{title:"Export Assets",selectData:"Select Data to Export",selectedRows:"Selected Rows",selectedCount:"Export {{count}} selected asset ",currentPage:"Current Page",currentPageCount:"Export {{count}} asset on current page",allWithFilters:"All Records (with current filters)",allWithFiltersCount:"Export all {{count}} asset matching current filters",csvDesc:"Comma-separated values",excelDesc:"XLSX spreadsheet",columnsToExport:"Columns to Export",selectAll:"Select All",resetToDefault:"Reset to Default",columnsSelected:"{{count}} column selected",exporting:"Exporting...",exportButton:"Export",exportingSelected:"Exporting {{count}} selected row ",exportingPage:"Exporting {{count}} row from current page",exportingAll:"Exporting all {{count}} row "},detail:{assetInformation:"Asset Information",technicalSpecs:"Technical Specs",financialDetails:"Financial Details",assetFinanceBooks:"Asset Finance Books",addRow:"Add Row",duplicatingFrom:"Duplicating from:",noDepartmentsMapped:"No departments mapped to this building",departmentsAvailable:"{{count}} department(s) available (filtered by building)",selectDepartmentForRoom:"Select Department to enable Room Number",depreciationMethodNote:"The depreciation method is an accounting method used to allocate the cost of a tangible asset over its useful life.",calculateDepreciation:"Calculate Depreciation",noFinanceBooksYet:'No finance books added yet. Click "Add Row" to add one.',noSparePartsYet:'No spare parts added yet. Click "Add Row" to add one.',assetName:"Asset Name",category:"Category",type:"Asset Type",modality:"Modality",class:"Class",assetId:"Asset ID",deviceStatus:"Device Status",serialCode:"Serial Code",technicalDepartment:"Technical Department",manufacturer:"Manufacturer",model:"Model",totalHours:"Total Hours",downTimeHours:"Down Time (Hours)",upTimeHours:"Up Time (Hours)",placeholderAssetName:"e.g. Laptop Model X",placeholderSerialCode:"e.g. SN-12345",placeholderModelNumber:"Model number",placeholderZero:"0",placeholderDescription:"Brief description of the asset",placeholderPONumber:"PO number",selectClass:"Select class",classA:"Class A",classB:"Class B",classC:"Class C",autoGenerated:"Auto-generated",calculatedFromAvailableDate:"Calculated from Available For Use Date",calculatedTotalMinusDown:"Calculated: Total Hours - Down Time",hospital:"Hospital",siteName:"Site name",selectSite:"Select Site",building:"Building",department:"Department",roomNumber:"Room Number",location:"Location",recalled:"Recalled",selectStatus:"Select status",operational:"Operational",underMaintenance:"Under Maintenance",decommissioned:"Decommissioned",selectServiceAgreement:"Select Service Agreement",warranty:"Warranty",contract:"Contract",frameWork:"Frame Work",mainContractor:"Main Contractor",outOfWarranty:"Out of warranty",underDismantle:"Under Dismantle",underInstallation:"Under Installation",selectServiceCoverage:"Select Service Coverage",pmOnly:"PM Only",labour:"Labour",labourAndParts:"Labour & Parts",comprehensive:"Comprehensive",supplierVendor:"Supplier/Vendor",selectMethod:"Select Method",straightLine:"Straight Line",doubleDecliningBalance:"Double Declining Balance",writtenDownValue:"Written Down Value",manual:"Manual",recycling:"Recycling",donation:"Donation",sale:"Sale",assetDuplicatedSuccess:"Asset duplicated successfully!",assetCreatedSuccess:"Asset created successfully!",assetUpdatedSuccess:"Asset updated successfully!",failedToSave:"Failed to save asset",cannotSubmitNotSaved:"Cannot submit: Asset not saved yet",confirmSubmit:'Are you sure you want to submit this asset? Once submitted, only fields marked as "Allow on Submit" can be edited.',assetSubmittedSuccess:"Asset submitted successfully!",failedToSubmit:"Failed to submit asset",pleaseSaveFirstForPPM:"Please save the asset first to view PPM Plan",pleaseSaveFirstForHistory:"Please save the asset first to view Asset History",failedToLoadPPMPlan:"Failed to load PPM Plan. Please try again.",noPlannedMaintenance:"No planned maintenance found for this asset",noWorkOrdersFound:"No Work Orders Found",noSparePartsUsed:"No Spare Parts Used",noMaintenanceRecords:"No Maintenance Records Found",noMaintenanceTasks:"No Maintenance Tasks Found",selectBuildingFirst:"Select Building first to enable Department",coverage:"Coverage",siteContractor:"Site Contractor",contractNumber:"Contract Number",serviceAgreement:"Service Agreement",serviceCoverage:"Service Coverage",purchaseOrderNumber:"Purchase Order Number",grossPurchaseAmount:"Gross Purchase Amount",purchaseDate:"Purchase Date",installationDate:"Installation Date",availableForUseDate:"Available For Use Date",financeBook:"Finance Book",depreciationMethod:"Depreciation Method",totalDepreciations:"Total Depreciations",frequencyMonths:"Frequency (Months)",depreciationPostingDate:"Depreciation Posting Date",startDate:"Start Date",endDate:"End Date",totalAmount:"Total Amount",selectRoomFirst:"Select Room Number to enable Location",autoSetFromRoom:"Auto-set from room mapping",moreDetails:"More Details"}},i$=JSON.parse(`{"title":"Work Orders","addWorkOrder":"Add New Work Order","workOrderDetails":"Work Order Details","newWorkOrder":"New Work Order","duplicateWorkOrder":"Duplicate Work Order","createFromAsset":"Create Work Order from Asset","createFromSupportIssue":"Create Work Order from Support Issue","closeWorkOrders":"Close Work Orders","closeConfirmTitle":"Close Work Orders","closeConfirmMessage":"Are you sure you want to close the selected work order(s)?","deleteConfirmMessage":"Are you sure you want to delete this work order? This action cannot be undone.","cancelConfirmMessage":"Are you sure you want to cancel this work order? This will mark the work order as cancelled and you can then delete it if needed.","assignConfirmMessage":"Are you sure you want to assign this work order to the following technician(s)?","deleteWorkOrder":"Delete Work Order","cancelWorkOrder":"Cancel Work Order","loadingWorkOrders":"Loading work orders...","loadingDetails":"Loading work order details...","backToList":"Back to work orders list","status":{"open":"Open","work_in_progress":"Work In Progress","pending_review":"Pending Review","completed":"Completed","cancelled":"Cancelled","closed":"Closed"},"priorityNormal":"Normal","priorityUrgent":"Urgent","workflowState":{"draft":"Draft"},"priority":{"normal":"Normal","urgent":"Urgent"},"table":{"workOrderId":"Work Order ID","asset":"Asset","type":"Type","technicalReport":"Technical Report","department":"Department","workflowState":"Workflow State","priority":"Priority","noWorkOrdersFound":"No work orders found","createFirstWorkOrder":"Create your first work order"},"export":{"title":"Export Work Orders","selectData":"What to Export","selectedRows":"Selected Rows","selectedCount":"Export {{count}} selected work order ","currentPage":"Current Page","currentPageCount":"Export {{count}} work order on current page","allWithFilters":"All Records (with current filters)","allWithFiltersCount":"Export all {{count}} work order matching current filters","csvDesc":"Comma-separated values","excelDesc":"XLSX spreadsheet","columnsToExport":"Columns to Export","selectAll":"Select All","resetToDefault":"Reset to Default","columnsSelected":"{{count}} column selected","exporting":"Exporting...","exportButton":"Export","exportingSelected":"Exporting {{count}} selected row ","exportingPage":"Exporting {{count}} row from current page","exportingAll":"Exporting all {{count}} row "},"closeModal":{"title":"Close Work Orders","confirmBulkClose":"Confirm Bulk Close Operation","aboutToClose":"You are about to close {{count}} work order . This action will change their workflow state to Closed.","alreadyClosedNote":"Note: {{count}} work order{{count !== 1 ? 's are' : ' is'}} already closed and will be skipped.","selectedWorkOrders":"Selected Work Orders ({{count}})","workOrderId":"Work Order ID","currentStatus":"Current Status","workflowState":"Workflow State","alreadyClosed":"(already closed)","willClose":"Will close {{count}} work order ","allAlreadyClosed":"All selected work orders are already closed","cancel":"Cancel","close":"Close","closing":"Closing..."},"detail":{"workOrderInformation":"Work Order Information","assignments":"Assignments","statusSummary":"Status Summary","existingWorkOrders":"Existing Work Order(s):","created":"Created","proceedCreateNew":"Do you still want to proceed with creating a new Work Order?","loadingTechnicians":"Loading technicians...","feedbackBy":"Feedback By","overallSatisfaction":"Overall Satisfaction","overallRatingPreview":"Overall Rating Preview","uploading":"Uploading...","uploadOpeningFile":"Upload Opening File","uploadClosingFile":"Upload Closing File","noAttachment":"No attachment","noClosingAttachment":"No closing attachment","closingAttachment":"Closing Attachment","currentState":"Current State","loadingActions":"Loading actions...","actionResults":"Action Results:","checkingFeedback":"Checking feedback...","yourRating":"Your Rating","repairStatus":"Repair Status","priority":"Priority","lastModified":"Last Modified","documentStatus":"Document Status","loadingActivity":"Loading activity...","added":"Added:","removed":"Removed:","modified":"Modified:","items":"item(s)","rows":"row(s)","pleaseAllowPopupsServiceReport":"Please allow popups for this site to print the Service Report.","pleaseProvideAtLeastOneRating":"Please provide at least one rating","feedbackSubmittedSuccessfully":"Feedback submitted successfully!","failedToSubmitFeedback":"Failed to submit feedback","feedbackUpdatedSuccessfully":"Feedback updated successfully!","failedToUpdateFeedback":"Failed to update feedback","locationAutoSetTo":"Location auto-set to: {{location}}","noTechniciansSelected":"No technicians selected","techniciansAssignedSuccessfully":"{{count}} additional technician(s) assigned successfully","removedTechnician":"Removed {{name}}","itemAlreadyAdded":"Item \\"{{itemCode}}\\" is already added in row {{row}}. Please select a different item.","insufficientStock":"Insufficient stock for {{itemCode}}. Available: {{available}}, Required: {{required}}","pleaseEnterSerialNumberToSearch":"Please enter a serial number to search","assetFound":"Asset found: {{name}}","noAssetFoundWithSerialNumber":"No asset found with this serial number","fileSizeExceeds":"File size exceeds 10MB limit","fileUploadedSuccessfully":"File uploaded successfully","failedToUploadFile":"Failed to upload file","attachmentRemoved":"Attachment removed","failureDateSetToCurrentTime":"Failure Date set to current time","firstRespondedOnSetToCurrentTime":"First Responded On set to current time","completionDateSetToCurrentTime":"Completion Date set to current time","firstRespondedOnSetTo":"First Responded On set to {{datetime}}","completionDateSetTo":"Completion Date set to {{datetime}}","assignedSupervisorMandatory":"Assigned Supervisor is mandatory for Work Control role.","assignedEngineerMandatory":"Assigned Engineer is mandatory for Work Control role.","assignedTechnicianMandatory":"Assigned Technician is mandatory when workflow is \\"Sent to Engineer\\".","workOrderCancelledSuccessfully":"Work Order cancelled successfully!","failedToCancel":"Failed to cancel: {{error}}","workOrderDeletedSuccessfully":"Work Order deleted successfully!","failedToDelete":"Failed to delete: {{error}}","pleaseSelectWorkOrderType":"Please select a Work Order Type","workOrderUpdatedSuccessfully":"Work order updated successfully!","workOrderCreatedSuccessfully":"Work order created successfully!","workOrderCreatedFromAssetSuccessfully":"Work order created from asset successfully!","workOrderCreatedFromIssueSuccessfully":"Work order created and linked. The support ticket stays open until the requester updates it after the work order is closed.","loadingSupportIssue":"Loading support issue...","failedToLoadSupportIssue":"Could not load support issue. You can still fill the work order manually.","supportIssue":"Support Issue","workOrderDuplicatedSuccessfully":"Work order duplicated successfully!","documentModifiedByAnotherUser":"Document was modified by another user. Refreshing...","pleaseReviewLatestChanges":"Please review the latest changes and try saving again.","failedToSaveWorkOrder":"Failed to save work order: {{error}}","technicalReportMandatoryForSupervisor":"Technical Report is mandatory when sending directly to Supervisor. Please fill in the Technical Report field before proceeding.","applyingAction":"Applying action \\"{{action}}\\"...","assignedTo":"Assigned to: {{name}}","actionCompletedSuccessfully":"Action \\"{{action}}\\" completed successfully!","documentModifiedRefreshing":"Document was modified. Refreshing...","tryActionAgainAfterReview":"Please try the action again after reviewing the latest changes.","failedToApplyAction":"Failed to apply action \\"{{action}}\\". {{error}}","editModeEnabled":"Edit mode enabled","editCancelledChangesDiscarded":"Edit cancelled - changes discarded","closingAttachmentRemoved":"Closing attachment removed","closingAttachmentUploadedSuccessfully":"Closing attachment uploaded successfully","failedToUploadClosingAttachment":"Failed to upload closing attachment","newStockItemRowAdded":"New stock item row added","stockItemRemoved":"Stock item {{item}} removed","activityLogRefreshed":"Activity log refreshed","errorLabel":"Error","backToList":"Back to work orders list","duplicateWorkOrder":"Duplicate Work Order","createFromAsset":"Create Work Order from Asset","createFromSupportIssue":"Create Work Order from Support Issue","newWorkOrder":"New Work Order","workOrderDetails":"Work Order Details","existingWorkOrderFound":"Existing Work Order Found","workOrderExistsForAsset":"A Work Order already exists for this Asset with workflow state not yet Approved or Closed.","workOrderExistsForTypeAndRoom":"A Work Order already exists for this Work Order Type and Room No with workflow state not yet Approved or Closed.","proceedWithNewWO":"Do you still want to proceed with creating a new Work Order?","proceedAnyway":"Proceed Anyway","noGoBack":"No, Go Back","yesCancel":"Yes, Cancel","cancelling":"Cancelling...","deleting":"Deleting...","selectAdditionalTechnicians":"Select Additional Technicians","searchTechnicians":"Search technicians...","techniciansSelected":"{{count}} technician(s) selected","clearAll":"Clear all","noTechniciansMatchSearch":"No technicians match your search","noTechniciansFound":"No technicians found","hospital":"Hospital","technicalDepartment":"Technical Department","woType":"WO Type","assetId":"Asset ID","assetName":"Asset Name","extensionNo":"Extension No","building":"Building","departmentName":"Department Name","roomNo":"Room No","location":"Location","manufacturer":"Manufacturer","supplier":"Supplier","assignedSupervisor":"Assigned Supervisor","assignedEngineer":"Assigned Engineer","assignedTechnician":"Assigned Technician","fromAsset":"From Asset","assetDetailsAutoPopulated":"Asset details auto-populated","selectBuildingFirst":"Select Building first to enable Department","printServiceReport":"Print Service Report","removeAttachment":"Remove attachment","removeClosingAttachment":"Remove closing attachment","setToCurrentDateTime":"Set to current date & time","selectItem":"Select Item","selectWarehouse":"Select Warehouse","autoPopulatedFromStock":"Auto-populated from stock","removeItem":"Remove item","noItemsAddedYet":"No items added yet","commentsDiscussion":"Comments & Discussion","refreshActivityLog":"Refresh activity log","supervisorsAvailableForType":"{{count}} Assigned Supervisor(s) available for this type","civilWorkCategory":"Civil Work Category","selectCivilWorkCategory":"Select Civil Work Category","selectPendingReason":"Select Pending Reason","pleaseSpecifyReason":"Please specify the reason...","selectServiceAgreement":"Select Service Agreement","selectServiceCoverage":"Select Service Coverage","describeComplaint":"Describe the nature of complaint...","describeWorkPerformed":"Describe the work performed...","enterSerialNumber":"Enter serial number","searchAssetBySerial":"Search asset by serial number","workOrder":"Work Order:","giveFeedback":"Give Feedback","editFeedback":"Edit Feedback","feedbackDetails":"Feedback Details","confirmAssignment":"Confirm Assignment","notRated":"Not rated","serviceReport":"Service Report","assetInfoPrefilled":"Asset information has been pre-filled from","linkedFromAsset":"Linked from Asset:","loadingAssetDetails":"Loading asset details...","cancelled":"Cancelled","workOrderId":"Work Order ID","pendingReason":"Pending Reason","otherReason":"Other Reason","serviceAgreementDetails":"Service Agreement Details","siteContractor":"Site Contractor","subcontractor":"Subcontractor","model":"Model","description":"Description","natureOfComplaint":"Nature of Complaint","technicalReport":"Technical Report","selectWoTypeFirstForSupervisors":"Select Work Order Type first to filter Assigned Supervisors","noSupervisorsFound":"No Assigned Supervisors found for this Work Order Type","requiredForExistingWO":"* Required for existing Work Orders","selectWoTypeFirstForEngineers":"Select Work Order Type first to filter Engineers","noEngineersFound":"No Engineers (Contractor Engineer role) found for this Work Order Type","engineersAvailable":"{{count}} Engineer(s) available","selectWoTypeFirstForTechnicians":"Select Work Order Type first to filter Technicians","noTechniciansFoundForType":"No Technicians found for this Work Order Type","techniciansAvailable":"{{count}} Technician(s) available","requiredForSentToEngineer":"* Required for \\"Sent to Engineer\\" state","autoCalculated":"(Auto-calculated)","autoSetOnRepairStart":"(Auto-set on repair start)","autoSetOnClose":"(Auto-set on close)","totalItems":"Total Items:","confirmAction":"Confirm Action","confirmActionMessage":"Are you sure you want to {{action}} this work order?","processing":"Processing...","yesAction":"Yes, {{action}}","systemManagerNote":"System Manager: Showing all valid actions for this state (conditions evaluated).","saveToSeeActions":"Save your changes to see all available actions.","availableActions":"Available Actions","allOptionsAvailable":"All Options Available","bothFilledMessage":"Both Technician and Technical Report are filled. You can now use any available workflow action above.","technicianAssigned":"Technician Assigned","assignedTechnicianLabel":"Assigned Technician:","wantToEnableSendToSupervisor":"Want to also enable \\"Send to Supervisor\\"?","fillTechnicalReportToUnlock":"Fill the \\"Technical Report\\" field to unlock this option","technicalReportFilled":"Technical Report Filled","howWasService":"How was the service for this work order?","noFeedbackYet":"No feedback has been given yet","statusInfoAfterCreation":"Status information will appear after creation","activityLog":"Activity Log","refreshActivityLogTitle":"Refresh activity log","noChangesRecorded":"No changes recorded yet","createdThisWorkOrder":"Created this Work Order","showLess":"Show Less","showAll":"Show All","entries":"entries","changedFrom":"changed from","documentUpdated":"Document updated","addItem":"Add Item","addFirstItem":"+ Add first item","item":"Item","valuationRate":"Valuation Rate","warehouse":"Warehouse","consumedQty":"Consumed Qty","availableStock":"Available Stock","totalValue":"Total Value","action":"Action","open":"Open","autoGenerated":"Auto-generated","updating":"Updating...","submitting":"Submitting...","updateFeedback":"Update Feedback","submitFeedback":"Submit Feedback","editRating":"Edit Rating","saveSelection":"Save Selection","troubleshootingTree":"Troubleshooting tree","troubleshootingGuideDone":"Completed","troubleshootingGuideDoneTitle":"Troubleshooting guide completed. Open again anytime to review the steps."},"troubleshootTree":{"pageTitle":"Troubleshooting tree","backToWorkOrder":"Back","workOrderBadge":"Work order: {{id}}","problemTypeTitle":"What type of problem is it?","selfServiceTitle":"Self-service checks","stepOf":"Step {{current}} of {{total}}","introHint":"Read the steps below. When you have actually tried them, use the button to continue.","confirmTried":"Yes, I've tried this","previousStep":"Previous step","guideCompleteBadge":"All steps done","allStepsCompleteTitle":"Troubleshooting steps completed","allStepsCompleteBodyWo":"Continue on the work order to resolve the complaint—technical report, photos, parts, and workflow actions.","allStepsCompleteBodyStandalone":"When you are ready, go back to Support to open or follow up on an issue.","continueToResolveComplaint":"Continue to resolve complaint","backToSupportFromGuide":"Back to support","reviewCategoryAgain":"Review this category again","cantComplete":"I can't complete these checks","cantCompleteHint":"Note what blocked you on the work order or tell your team lead.","cantCompleteStepPrompt":"Why can't you complete this step? (required to continue)","cantCompletePlaceholder":"e.g. No access to the panel, site policy, or missing tools…","saveExplanationContinue":"Save explanation and continue","backToChecks":"Back to checks","reasonRequiredToast":"Please explain why you can't complete this step to continue.","savedToWorkOrder":"Explanation saved on the work order.","explanationSavedStayOnGuide":"Saved to the technical report. You can keep going with the guide.","saveExplanationFailed":"Could not save to the work order. Try again.","workOrderStillLoading":"Work order is still loading. Wait a moment and try again.","notAvailableUntilRepairInProgress":"The troubleshooting guide is available after a technician is assigned (work order in Repair In Progress).","noSteps":"No steps configured for this category.","ultrasoundBadge":"Ultrasound diagnostic","footerTitle":"Still need help?","footerHint":"Continue on the work order to add details, attachments, or escalate through your normal process.","categories":{"air_conditioning":"Air conditioning","power":"Power & electrical","building_systems":"Building systems","applications_account":"Application & account","ultrasound":"GE Voluson 730 (Ultrasound)"},"steps":{"air_conditioning":[{"heroCaption":"Comfort and cooling basics","title":"Thermostat and operating mode","bullets":["Confirm the thermostat or controller is on, set to cool/heat as needed, and not locked or on a conflicting schedule.","If the display is blank, check power or batteries to the thermostat.","After changes, wait a few minutes; note room, setpoint, and what you observed."]},{"heroCaption":"Air movement","title":"Filters, grilles, and airflow","bullets":["Ensure supply/return grilles are open and not blocked.","If policy allows, check whether filters need cleaning or replacement.","Listen for unusual fan noise; note which indoor unit or zone is affected."]},{"heroCaption":"Condensate and drains","title":"Water and drain lines","bullets":["Look for water around the indoor unit; check visible condensate drains only if safe and permitted.","If you see active leaking, stop and report.","Record location and whether the issue is continuous or only when the system runs."]},{"heroCaption":"Before requesting service","title":"If there is still no improvement","bullets":["Capture temperatures, error codes or blinking patterns on the controller (if any).","List what you already tried and approximate times.","Do not open refrigerant circuits or electrical enclosures unless you are authorized."]}],"power":[{"heroCaption":"Panels, breakers, and protection devices","title":"Breakers, RCDs, and panels","bullets":["Identify whether one circuit or a whole area is affected.","Check the correct panel for that space; reset a tripped breaker only once if policy allows, and note which label matches the room or equipment.","If an RCD/GFCI device has tripped, press reset after unplugging new or suspect equipment—if it trips again, leave it off and report."]},{"heroCaption":"Local circuits","title":"Outlets, lighting, and equipment power","bullets":["Test another outlet on a different circuit; try a known-good lamp or charger.","Confirm equipment power switches and any local disconnects are on.","If only one device fails, try another socket before assuming a building fault."]},{"heroCaption":"Backup supply","title":"UPS, generators, and transfer","bullets":["If the site uses UPS or backup, check indicator panels for alarms or battery mode.","Do not reset generator or ATS equipment unless trained and authorized.","Record alarm messages verbatim for the work order."]},{"heroCaption":"Safety","title":"When to stop","bullets":["Smell of burning, arcing sounds, or hot panel surfaces: stay clear and report immediately.","Never defeat interlocks or safety covers.","Document affected areas and any labels on tripped devices."]}],"building_systems":[{"heroCaption":"Water and wet systems","title":"Shutoff and obvious leaks","bullets":["If safe, identify the nearest isolation valve for the affected fixture or zone—turn off only if you are authorized.","Contain small leaks with towels or bins; do not block drains meant for overflow.","Note color, flow rate, and whether hot or cold lines are involved."]},{"heroCaption":"Access and security","title":"Doors, locks, and access control","bullets":["Verify you are at the correct door or gate for the reported location.","For card or code access, confirm your credential is active; try a secondary reader if available.","Do not force doors or bypass locks—report access failures."]},{"heroCaption":"Fixtures","title":"Sanitary and small building items","bullets":["For simple blockages, use only approved tools or procedures; avoid chemical misuse.","Check for obvious obstructions where visible.","If sewage odor or backflow appears, stop and escalate."]},{"heroCaption":"Structure and glazing","title":"Glass, ceilings, and hazards","bullets":["Cordon off falling debris or broken glass; do not stand under damaged ceiling tiles.","Photograph from a safe distance if policy allows.","Record exact room/zone and approximate size of the issue."]}],"applications_account":[{"heroCaption":"Client side","title":"Browser, session, and cache","bullets":["Try a hard refresh or a second browser; close extra tabs if the app is slow.","Sign out and sign back in if the session seems stuck.","Note the exact URL, time, and any on-screen error text."]},{"heroCaption":"Connectivity","title":"Network and VPN","bullets":["Confirm WiFi or LAN is connected; try another network if permitted.","If VPN is required, reconnect and wait for full tunnel establishment.","Run a quick test to a known internal site only if standard procedure."]},{"heroCaption":"Identity","title":"Passwords, MFA, and lockouts","bullets":["Use the official password reset or unlock path—avoid sharing credentials.","If MFA fails, check device time sync and try one backup code if available.","Record whether the issue is all users or only your account."]},{"heroCaption":"Application errors","title":"Logs and support handoff","bullets":["Copy or screenshot error IDs; avoid pasting sensitive personal data into chat.","Note steps to reproduce in order.","Attach evidence to the work order or ticket per local policy."]}],"ultrasound":[{"heroCaption":"GE Voluson 730 — power and environment check","title":"Step 1 — Power supply and environment (Section 7-7-1)","bullets":["Verify the scanner power cable is firmly plugged into a standard wall outlet. Do NOT use a red emergency power outlet.","Confirm there is AC voltage at the wall outlet and that the room circuit breaker is ON.","Check that the main power switch on the back of the scanner is in the ON position — you should hear fan noise within a few seconds.","Ensure the room is not excessively hot. The GE Voluson 730 is prone to overheating — check that ventilation holes on the unit are clear of dust and obstructions.","If the scanner was recently moved from a cold environment (e.g. storage), allow at least 2 hours for temperature balance before powering on.","Record what you observe: any indicator lights, fan noise, amber/green ON/OFF button state."]},{"heroCaption":"GE Voluson 730 — probe inspection","title":"Step 2 — Probe and transducer check (Section 7-7-2, 7-7-3)","bullets":["Disconnect the probe from the port and reseat it firmly — a loose connection is the most common cause of missing or noisy images.","Visually inspect the probe cable along its full length for cracks, tears, or kinks. Check the connector for bent pins.","Inspect the probe lens for cracks or cuts — gel or disinfectant entering through cracks can permanently damage the transducer.","For 3D/4D mechanical probes (e.g. RAB series): gently press the dome — no error should appear. Wiggle the cable through its full length to check for intermittent faults.","If a second probe is available, swap it in. If the problem resolves, the fault is probe-related. If it persists across probes, the fault is in the machine itself.","Check the trackball: if it moves but is sluggish, remove the ball and clean it with a lint-free cloth. If it does not move at all, the trackball unit needs replacement."]},{"heroCaption":"GE Voluson 730 — image quality","title":"Step 3 — Image quality and noise (Section 7-7-2, 7-7-5)","bullets":["If the image is noisy or unclear, first check whether any nearby electrical devices (other medical equipment, transformers, HF surgery units) are causing electromagnetic interference. Move the scanner away from them if possible.","Try using a different wall socket — electrical noise from a shared circuit can degrade image quality.","Verify ultrasound gel is applied correctly and that gain, depth, and focus settings are appropriate for the examination type.","For monitor issues: if there is no image but power is on, check the video cable connection at the back of the monitor — ensure no pins are bent. Power cycle the monitor.","If the screen shows colour that is not uniform, power the monitor off and back on to activate the Auto-Degauss function.","If the image is fuzzy, adjust contrast and brightness settings. Check that the video cable is connected to both the scanner output and the monitor — a floating cable increases video output level and causes fuzz."]},{"heroCaption":"GE Voluson 730 — system restart procedure","title":"Step 4 — Correct shutdown and restart sequence","bullets":["Many GE Voluson software faults (freezing, boot loops, blank screens) are caused by improper shutdown — cutting main power instead of using the software sequence.","To shut down correctly: press the ON/OFF button on the control panel → wait for the system to complete its shutdown sequence → only then switch off the main power at the back.","To restart: switch main power ON → wait for the amber standby light → press the ON/OFF button → allow the full boot sequence to complete (typically 23 minutes).","If the system is frozen and unresponsive: disconnect main power, wait 30 seconds, then follow the correct startup sequence above.","If the system restarts automatically or shuts off within ~3 minutes of booting, the Primary Power Supply (CPY inside) is likely defective — do not continue cycling power; document and escalate.","After restart, check whether the reported problem persists before proceeding to the next step."]},{"heroCaption":"GE Voluson 730 — error codes and diagnostics","title":"Step 5 — Error codes, fan faults, and system diagnostics","bullets":["Note any error codes or messages displayed on screen verbatim — these are essential for GE service engineers.","Fan failure is a common GE Voluson fault: if you see a message like 'FAN1 Defect' or 'PS Code (0x5461)', the scanner is overheating. Shut it down immediately and do not restart until the fan issue is resolved.","Check the rear ventilation area for dust accumulation on the fan grilles — this is the leading cause of overheating on the Voluson series. Clean with a dry brush or low-pressure air if safe and permitted.","Check the keyboard and trackball for physical damage or stuck keys — some boot failures on Voluson E8 are triggered by keyboard faults rather than power supply issues.","If the scanner boots but shows no signal on the monitor, try reseating the video cable at both ends. If the monitor power indicator is flashing alternately green and orange, this indicates a potential monitor hardware failure.","Document: error code, time of occurrence, what the machine was doing when it failed, and any pattern (e.g. only after extended use, only on first boot in the morning)."]},{"heroCaption":"GE Voluson 730 — escalation to GE service","title":"Step 6 — Escalation: when to call GE / SAMAMA","bullets":["Escalate immediately if: the Primary Power Supply is suspected defective, a fan fault code is shown, internal hardware replacement (CKV module, BF board, power supply) is required, or the probe needs professional repair.","Before calling, gather: asset ID and serial number (visible in SEERA-ASM), the exact error code(s) from the screen, your findings from steps 15, and the service agreement details (warranty / contract / SAMAMA coverage).","Do NOT open refrigerant circuits, internal power supplies, or electronic enclosures unless you are a GE-authorized service engineer.","For SAMAMA-covered assets: log the findings in the Technical Report field on this work order, then contact SAMAMA with the work order number and your diagnostic notes.","For warranty-covered assets: contact GE Healthcare service directly with the serial number and error details.","After escalation, update this work order with the outcome: parts ordered, GE visit scheduled, or resolution confirmed."]},{"heroCaption":"GE Voluson 730 — printer troubleshooting","title":"Step 7 — Printer not working (Section 7-7-7)","bullets":["Check that the printer is properly connected — verify all signal and power supply cables between the printer and scanner are seated correctly.","Check that paper is loaded in the printer — insert paper if empty.","Verify the correct Print key(s) configuration is set on the scanner — configure if not set.","If still unable to print, check manual print operation — if manual print also fails, check signal cables between GEF and Backpanel.","If there is still no image on printout, check Video Output of system — if video output is OK, replace the printer. If video output is not OK, replace the CKV module.","Document the fault: which printer, what error message if any, and whether manual print also failed."]},{"heroCaption":"GE Voluson 730 — network troubleshooting","title":"Step 8 — Network connectivity issues (Section 7-7-10)","bullets":["Check that the network cable between the scanner and the wall network outlet is connected and firmly seated at both ends.","Try replacing with a known-good network cable to rule out a faulty cable.","Check the cable between the network connector on the Back Panel and the LAN connector on the GEF board inside the scanner.","Connect a network cable directly between the scanner and a PC — try to ping from the scanner to the PC's IP address. If ping succeeds, the internal hardware connection is OK and the issue is with the hospital network.","If ping fails, the fault is internal — escalate to GE service with findings.","Document: IP addresses used, ping result, which cable was tested, and whether the issue affects this scanner only or other network devices too."]}]}}}`),o$={title:"Asset Maintenance",maintenanceLogs:"Maintenance Logs",maintenanceDetails:"Maintenance Details",addMaintenance:"Add New Maintenance",listTotal:"Total: {{count}} maintenance log ",apiNotAvailable:"Maintenance API Not Available",apiNotDeployed:"The Asset Maintenance API endpoint is not deployed yet.",tryCreatingNew:"Try Creating New (Demo)",deletedSuccessfully:"Maintenance log deleted successfully!",status:{planned:"Planned",completed:"Completed",overdue:"Overdue",cancelled:"Cancelled"},maintenanceTeam:"Maintenance Team",newMaintenanceTeam:"New Maintenance Team",teamId:"Team ID",teamName:"Team Name",managerEmail:"Manager Email",managerName:"Supervisor Name",expertise:"Expertise",selectTeam:"Select Team",viewDetails:"View Details",editTeam:"Edit Team",duplicateTeam:"Duplicate Team",deleteTeam:"Delete Team",selectHospital:"Select Hospital",selectExpertise:"Select Expertise",selectManager:"Select Manager",enterTeamName:"Enter Team Name",teamInformation:"Team Information",selectUser:"Select User",selectRole:"Select Role",totalMembers:"Total Members",teamSummary:"Team Summary",addFirstMember:"Add First Member",manager:"Supervisor Email",loadingTeams:"Loading maintenance teams...",errorLoadingTeams:"Error Loading Maintenance Teams",deleteConfirmMessage:"Are you sure you want to delete this maintenance team? This action cannot be undone.",team:"Team",deleteTeamButton:"Delete Team",listTitle:"Maintenance Teams",statsTotalTeams:"Total Teams",statsManagers:"Managers",statsHospitals:"Hospitals",export:{title:"Export Maintenance Teams",selectData:"Select Data to Export",selectedRows:"Selected Rows",selectedCount:"Export {{count}} selected team ",currentPage:"Current Page",currentPageCount:"Export {{count}} team on current page",allWithFilters:"All Records (with current filters)",allWithFiltersCount:"Export all {{count}} team matching current filters",exportFormat:"Export Format",csv:"CSV",csvDesc:"Comma-separated values",excel:"Excel",excelDesc:"XLSX spreadsheet",columnsToExport:"Columns to Export",selectAll:"Select All",resetToDefault:"Reset to Default",columnsSelected:"{{count}} column selected",exporting:"Exporting...",exportButton:"Export",exportingSelected:"Exporting {{count}} selected row ",exportingPage:"Exporting {{count}} row from current page",exportingAll:"Exporting all {{count}} row "}},l$={title:"PPM",ppmDetails:"PPM Details",addPPM:"Add New PPM",periodicity:"Periodicity",dueDate:"Due Date",manageSchedules:"Manage PM Schedules",pmId:"PM ID",name:"Name",manufacturer:"Manufacturer",listTotal:"Total: {{count}} PPM schedule ",searchPlaceholder:"Search by ID, asset, company...",filterByCompany:"Filter by Company",company:"Company",asset:"Asset",assetType:"Asset Type",frequency:"Frequency",noOfPMs:"No. of PMs",totalAmount:"Total Amount",apiNotAvailable:"PPM API Not Available",apiNotDeployed:"The PPM API endpoint is not deployed yet.",tryCreatingNew:"Try Creating New (Demo)",deletedSuccessfully:"PPM schedule deleted successfully!",noSchedulesFound:"No PPM schedules found",createFirstSchedule:"Create your first PPM schedule",confirmDelete:"Confirm Delete",deleteConfirmMessage:"Are you sure you want to delete this PPM schedule? This action cannot be undone.",detail:{duplicateSchedule:"Duplicate PPM Schedule",newSchedule:"New PPM Schedule",scheduleDetails:"PPM Schedule Details",basicInformation:"Basic Information",financialInformation:"Financial Information",scheduleInformation:"Schedule Information",maintenanceTeam:"Maintenance Team",numberOfPMs:"Number of PMs",pricePerPM:"Price per PM",frequencyPlaceholder:"e.g., Monthly, Quarterly, Yearly",scheduleInfoAfterCreation:"Schedule information will appear after creation",assetName:"Asset Name",pleaseEnterAssetName:"Please enter Asset Name",duplicatedSuccessfully:"PPM schedule duplicated successfully!",createdSuccessfully:"PPM schedule created successfully!",updatedSuccessfully:"PPM schedule updated successfully!",failedToSave:"Failed to save",saveChanges:"Save Changes",loadingSchedule:"Loading PPM schedule...",backToSchedules:"Back to PPM schedules",errorLoading:"Error"}},c$={listTitle:"PPM Schedules",export:{title:"Export PPM Schedules",selectData:"Export Scope",selectedRows:"Selected Rows",selectedCount:"Export {{count}} selected schedule ",currentPage:"Current Page",currentPageCount:"Export {{count}} schedule on current page",allWithFilters:"All Records (with current filters)",allWithFiltersCount:"Export all {{count}} schedule matching current filters",csvDesc:"Comma-separated values",excelDesc:"XLSX spreadsheet",columnsToExport:"Columns to Export",selectAll:"Select All",resetToDefault:"Reset to Default",columnsSelected:"{{count}} column selected",exporting:"Exporting...",exportButton:"Export",exportingSelected:"Exporting {{count}} selected row ",exportingPage:"Exporting {{count}} row from current page",exportingAll:"Exporting all {{count}} row "}},u$={title:"Export",whatToExport:"What to Export",selectedRows:"Selected Rows",currentPage:"Current Page",allWithFilters:"All with Filters",exportSelected:"Export {count} selected",exportPage:"Export {count} on current page",exportAll:"Export all {count}",columnsToExport:"Columns to Export",selectAll:"Select All",selectDefault:"Select Default",exporting:"Exporting...",exportingSelected:"Exporting {count} selected row(s)",exportingPage:"Exporting {count} row(s) from current page",exportingAll:"Exporting all {count} row(s)",selected:"selected",rows:"rows"},d$={title:"Items",itemDetails:"Item details",newItem:"New item",addItem:"Add new item",itemId:"Item ID",itemCode:"Item code",itemName:"Item name",itemGroup:"Item group",stockUOM:"Stock UOM",partDescription:"Part description",brand:"Brand",valuationRate:"Valuation rate",openingStock:"Opening stock",lastCalibrationDate:"Last calibration date",nextCalibrationDate:"Next calibration date",selectItem:"Select item",selectItemGroup:"Select item group",selectHospital:"Select hospital",serialNo:"Serial no.",dateIn:"Date in",watts:"Watts",volts:"Volts",type:"Type",code:"Code",viewDetails:"View details",editItem:"Edit item",duplicateItem:"Duplicate item",deleteItem:"Delete item",basicInformation:"Basic information",inventoryDetails:"Inventory details",stockInformation:"Stock information",isStockItem:"Is stock item",isFixedAsset:"Is fixed asset",balanceQty:"Balance qty",calibrationInformation:"Calibration information",additionalInformation:"Additional information",refreshBalanceQty:"Refresh balance qty",warrantyMonths:"Warranty (months)",errorLoadingItems:"Error loading items",loadingItems:"Loading items...",deleteConfirmMessage:"Are you sure you want to delete this item? This cannot be undone.",backToInventory:"Back to inventory",loadingItem:"Loading item...",errorLoadingItem:"Error loading item",createNewItem:"Create new item",itemCodeLabel:"Item code",itemUpdatedSuccessfully:"Item updated successfully!",pleaseSaveFirst:"Please save the item first before submitting.",submittedSuccessfully:"Item submitted successfully!",failedToSave:"Failed to save",failedToSubmit:"Failed to submit",noItemsFound:"No items found",createFirstItem:"Create your first item",listTitle:"Inventory",listTotal:"Total: {{count}} item(s)",failedToLoadItems:"Failed to load items.",listAddItem:"Add item",export:{title:"Export items",selectData:"Select data to export",selectedRows:"Selected rows",selectedCount:"Export {{count}} selected item(s)",currentPage:"Current page",currentPageCount:"Export {{count}} item(s) on current page",allWithFilters:"All records (current filters)",allWithFiltersCount:"Export all {{count}} item(s) matching filters",csvDesc:"Comma-separated values",excelDesc:"XLSX spreadsheet",columnsToExport:"Columns to export",selectAll:"Select all",resetToDefault:"Reset to default",columnsSelected:"{{count}} column(s) selected",exporting:"Exporting...",exportButton:"Export",exportingSelected:"Exporting {{count}} selected row(s)",exportingPage:"Exporting {{count}} row(s) from current page",exportingAll:"Exporting all {{count}} row(s)"}},f$={title:"Issues",issueDetails:"Issue details",newIssue:"New ticket",addIssue:"Add new ticket",issueId:"Ticket ID",subject:"Subject",raisedBy:"Raised by",contact:"Contact",issueType:"Issue type",openingDate:"Opening date",resolutionDate:"Resolution date",resolvedBy:"Resolved by",firstRespondedOn:"First responded on",resolutionDetails:"Resolution details",selectIssue:"Select issue",allPriorities:"All priorities",allCompanies:"All companies",viewDetails:"View details",editIssue:"Edit issue",deleteIssue:"Delete issue",enterSubject:"Enter subject",selectPriority:"Select priority",selectIssueType:"Select issue type",describeIssue:"Describe the issue...",contactInformation:"Contact information",createNewIssue:"Create new support ticket",resolution:"Resolution",describeResolution:"Describe how the issue was resolved...",selectCompany:"Select company",statusInformation:"Status information",currentStatus:"Current status",timeline:"Timeline",loadingIssues:"Loading tickets...",errorLoadingIssues:"Error loading tickets",deleteConfirmMessage:"Are you sure you want to delete this ticket? This cannot be undone.",deletedSuccessfully:"Ticket deleted successfully!",createWorkOrderFromIssue:"Create work order",workflowActions:"Workflow actions",issueSingular:"support ticket",actionResults:"Action results:",listTitle:"Support tickets",listTotal:"Total",listSelected:"selected",statsTotalIssues:"Total tickets",statsOpen:"Open",statsResolved:"Resolved",statsClosed:"Closed",noIssuesFound:"No tickets found",createFirstIssue:"Create your first ticket",export:{title:"Export tickets",selectData:"Select data to export",selectedRows:"Selected rows",selectedCount:"Export {{count}} selected ticket(s)",currentPage:"Current page",currentPageCount:"Export {{count}} ticket(s) on current page",allWithFilters:"All records (current filters)",allWithFiltersCount:"Export all {{count}} ticket(s) matching filters",exportFormat:"Export format",csv:"CSV",csvDesc:"Comma-separated values",excel:"Excel",excelDesc:"XLSX spreadsheet",columnsToExport:"Columns to export",selectAll:"Select all",resetToDefault:"Reset to default",columnsSelected:"{{count}} column(s) selected",exporting:"Exporting...",exportButton:"Export",exportingSelected:"Exporting {{count}} selected row(s)",exportingPage:"Exporting {{count}} row(s) from current page",exportingAll:"Export all {{count}} row(s)"},status:{open:"Open",replied:"Replied",on_hold:"On hold",resolved:"Resolved",closed:"Closed"},priority:{low:"Low",medium:"Medium",high:"High",critical:"Critical"}},h$={title:"Users",userDetails:"User details",newUser:"New user",addUser:"Add new user",searchUsers:"Search users...",manageUsers:"Manage user accounts and permissions",noUsersFound:"No users found",tryAdjustingSearch:"Try adjusting your search.",noUsersAvailable:"No users available.",backToDashboard:"Back to dashboard",refresh:"Refresh",active:"Active",inactive:"Inactive",noEmail:"No email",created:"Created"},p$={title:"Events",eventDetails:"Event details",newEvent:"New event",addEvent:"Add event",upcomingEvents:"Upcoming events",eventsFromFrappe:"Events from Frappe",noEventsFound:"No events found",noEventsScheduled:"No events scheduled.",refreshEvents:"Refresh events"},m$={previous:"Previous",next:"Next",goTo:"Go to",go:"Go",page:"Page",showingToOf:"Showing {{start}} to {{end}} of {{total}} {{label}}",showingTo:"Showing {{start}} to {{end}} {{label}}",items:"items",assets:"assets",workOrders:"work orders",issues:"tickets",teams:"teams",inspections:"inspections",plans:"plans",sfdaEntries:"SFDA Recalls"},g$={loading:"Loading...",noResultsFound:"No results found",createNewDoctype:"Create new {{doctype}}",selectLabel:"Select {{label}}"},x$={loadingSupportPlans:"Loading support plans...",errorLoadingSupportPlans:"Error loading support plans",deleteConfirmMessage:"Are you sure you want to delete this support plan? This cannot be undone.",planId:"Plan ID",deletedSuccessfully:"Support plan deleted successfully!",deleteSupportPlan:"Delete support plan",noSupportPlansFound:"No support plans found",createFirstSupportPlan:"Create your first support plan",table:{planName:"Plan name",type:"Type",frequency:"Frequency",contractValue:"Contract value",warrantyStatus:"Warranty status",contractStatus:"Contract status"},status:{active:"Active",expired:"Expired",pending:"Pending",terminated:"Terminated early"},statusLabel:{warrantyPrefix:"W:",contractPrefix:"C:"},viewDetails:"View support plan",editSupportPlan:"Edit support plan",listTitle:"Support plans",statsTotalPlans:"Total plans",statsContracts:"Contracts",statsWarranties:"Warranties",statsActive:"Active",export:{title:"Export support plans",selectData:"Select data to export",selectedRows:"Selected rows",selectedCount:"Export {{count}} selected plan(s)",currentPage:"Current page",currentPageCount:"Export {{count}} plan(s) on current page",allWithFilters:"All records (current filters)",allWithFiltersCount:"Export all {{count}} plan(s) matching filters",exportFormat:"Export format",csv:"CSV",csvDesc:"Comma-separated values",excel:"Excel",excelDesc:"XLSX spreadsheet",columnsToExport:"Columns to export",selectAll:"Select all",resetToDefault:"Reset to default",columnsSelected:"{{count}} column(s) selected",exporting:"Exporting...",exportButton:"Export",exportingSelected:"Exporting {{count}} selected row(s)",exportingPage:"Exporting {{count}} row(s) from current page",exportingAll:"Export all {{count}} row(s)"}},y$={title:"Inspections",loadingInspections:"Loading inspections...",errorLoadingInspections:"Error loading inspections",deleteConfirmMessage:"Are you sure you want to delete this inspection? This cannot be undone.",inspectionId:"Inspection ID",deleteInspection:"Delete Inspection",deletedSuccessfully:"Inspection deleted successfully!",noInspectionsFound:"No inspections found",createFirstInspection:"Create your first inspection",type:"Type",workflowStateHeader:"Workflow state",targetDate:"Target Date",requestedBy:"Requested By",linkedWorkOrder:"Linked Work Order",savedFilters:"Saved Filters",newInspection:"New Inspection",inspectionReport:"Inspection Report",technicalDepartment:"Technical Department",filterStatus:"Filter Status",filterWorkflow:"Filter Workflow",filterType:"Filter Type",filterWorkOrder:"Filter Work Order",filterDepartment:"Filter Department",selectWorkOrder:"Select Work Order",selectDepartment:"Select Department",stats:{draft:"Draft",pendingApproval:"Pending Approval",closed:"Closed"},status:{open:"Open",in_progress:"In Progress",pending_review:"Pending Review",closed:"Closed"},workflowState:{draft:"Draft",sent_to_work_control:"Sent to Work Control",sent_to_technician:"Sent to technician",sent_to_supervisor:"Sent to Supervisor",closed:"Closed"},typeMap:{inspection:"Inspection",safety_inspection:"Safety Inspection"},viewDetails:"View Details",editInspection:"Edit Inspection",export:{title:"Export inspections",selectData:"Select data to export",selectedRows:"Selected rows",selectedCount:"Export {{count}} selected inspection(s)",currentPage:"Current page",currentPageCount:"Export {{count}} inspection(s) on current page",allWithFilters:"All records (current filters)",allWithFiltersCount:"Export all {{count}} inspection(s) matching filters",exportFormat:"Export format",csv:"CSV",csvDesc:"Comma-separated values",excel:"Excel",excelDesc:"XLSX spreadsheet",columnsToExport:"Columns to export",selectAll:"Select all",resetToDefault:"Reset to default",columnsSelected:"{{count}} column(s) selected",exporting:"Exporting...",exportButton:"Export",exportingSelected:"Exporting {{count}} selected row(s)",exportingPage:"Exporting {{count}} row(s) from current page",exportingAll:"Export all {{count}} row(s)",inspectionId:"Inspection ID",inspectionType:"Inspection Type",status:"Status",workflowState:"Workflow State",inspectionDate:"Inspection Date",targetClosureDate:"Target Closure Date",requestedBy:"Requested By",technicalDepartment:"Technical Department",linkedWorkOrder:"Linked Work Order",observationNote:"Observation Note",technicalResponse:"Technical Response",createdOn:"Created On",modifiedOn:"Modified On",createdBy:"Created By"},detail:{loadingDetails:"Loading Details...",errorLoading:"Error Loading...",backToList:"Back To List",newInspection:"New Inspection",inspectionDetails:"Inspection Details",createNewRecord:"Create New Record",cancelInspection:"Cancel Inspection",cancelConfirmMessage:"Are you sure you want to cancel this inspection? It will be marked cancelled and you can delete it afterwards if needed.",noGoBack:"No, go back",yesCancel:"Yes, cancel",cancelling:"Cancelling...",selectType:"Select Type",workOrderType:"Work Order Type",selectWorkOrderType:"Select Work Order Type",techniciansAvailable:"{{count}} technician(s) available for this type",selectDepartment:"Select Department",selectLocation:"Select Location",extensionNo:"Extension No",selectExtension:"Select Extension",inspectionDate:"Inspection Date",targetClosureDate:"Target Closure Date",cannotBeInPast:"Cannot be in the past",cannotBeEarlier:"Cannot be earlier than the inspection date or in the past",openingAttachment:"Opening Attachment",closingAttachment:"Closing Attachment",uploading:"Uploading...",uploadFile:"Upload File",uploadClosingFile:"Upload Closing File",noAttachment:"No Attachment",removeAttachment:"Remove Attachment",assignmentInformation:"Assignment Information",requestedBy:"Requested By",selectUser:"Select User",technicalDepartment:"Technical Department",assignedTechnician:"Assigned Technician",selectTechnician:"Select Technician",selectWOTypeFirst:"Select work order type first to filter technicians",noTechniciansForType:"No technicians found for this work order type",notesAndResponse:"Notes And Response",observationNote:"Observation Note",placeholderObservation:"Enter observation notes...",technicalResponse:"Technical Response",placeholderTechnicalResponse:"Enter technical response...",linkedWorkOrder:"Linked Work Order",linkedCorrectiveWO:"Linked Corrective WO",readOnly:"Read Only",viewWorkOrder:"View Work Order",noLinkedWorkOrder:"No Linked Work Order",workflowActions:"Workflow Actions",workflowProgress:"Workflow Progress",workControl:"Work Control",technicianStep:"Technician Step",supervisorStep:"Supervisor Step",draftStep:"Draft Step",closedStep:"Closed Step",statusInfo:"Status Info",documentStatus:"Document Status",woType:"WO Type",assignedTo:"Assigned To",submitted:"Submitted",cancelled:"Cancelled",added:"Added",removed:"Removed",modified:"Modified",items:"Items",rows:"Rows",activityLog:"Activity Log",activityLogRefreshed:"Activity Log Refreshed",refreshActivityLog:"Refresh Activity Log",noChangesRecorded:"No Changes Recorded",createdThisInspection:"Created This Inspection",changedFrom:"Changed From",documentUpdated:"Document Updated",showLess:"Show Less",showAll:"Show All",department:"Department",location:"Location",inspectionType:"Inspection Type",status:"Status",removeClosingAttachment:"Remove Closing Attachment",noClosingAttachment:"No Closing Attachment",cancelledSuccessfully:"Cancelled Successfully",failedToCancel:"Failed to cancel: {{error}}",failedToSave:"Failed to save: {{error}}",failedToDelete:"Failed to delete: {{error}}",targetClosureMandatory:"Target closure date is required to save.",attachmentMandatory:"Attachment is required to save.",extensionMandatory:"Extension number is required to save.",createdSuccessfully:"Created Successfully",updatedSuccessfully:"Updated Successfully",deletedSuccessfully:"Deleted Successfully",inspectionDateInPast:"Inspection date cannot be in the past.",targetClosureEarlier:"Target closure cannot be earlier than the inspection date.",targetClosureInPast:"Target closure date cannot be in the past.",fileSizeExceeds:"File size exceeds 10 MB limit",fileUploadedSuccess:"File uploaded successfully",failedToUpload:"Failed to upload file",closingAttachmentRemoved:"Closing Attachment Removed",closingAttachmentUploadedSuccess:"Closing Attachment Uploaded Success",failedToUploadClosing:"Failed to upload closing attachment",attachmentRemoved:"Attachment Removed",systemManager:"System Manager",workflow:"Workflow"}},v$={title:"Active map",loading:"Loading map data...",hospital:"Hospital",departmentWoType:"Department (work order type)",selectHospital:"Select Hospital",selectDepartment:"Select Department",clearDepartmentHint:"Clear department to filter by hospital only",clearHospitalHint:"Clear hospital to filter by department only",clearFilters:"Clear Filters",legendHospital:"Hospital",legendDepartment:"Department (work order type)",legendHasUrgent:"Has urgent work orders",totalAssets:"Total Assets",workOrderStatus:"Work Order Status",status:"Status",count:"Count",normal:"Normal",urgent:"Urgent",open:"Open",workInProgress:"Work In Progress",pendingReview:"Pending Review",completed:"Completed",closed:"Closed",preventiveMaintenance:"Preventive Maintenance",planned:"Planned",overdue:"Overdue",viewAssets:"View Assets",viewWorkOrders:"View Work Orders",viewAllWorkOrders:"View All Work Orders",showingWorkOrdersByType:"Work orders by type",deptWoType:"Department / WO type",tooltipDept:"Department",tooltipHospital:"Hospital",tooltipUrgent:"Urgent",normalWos:"Normal work orders:",urgentWos:"Urgent work orders:",closedWos:"Closed work orders:",plannedPms:"Planned PM:",completedPms:"Completed PM:",assets:"Assets"},b$={title:"Maintenance calendar",viewType:"View type",maintenanceLog:"Maintenance Log",ppmPlanner:"PPM planner",filters:"Filters",yearlyMap:"Yearly map",yearlyMapTitle:"Yearly PPM planner map view",mapShort:"Map",hospital:"Hospital",selectHospital:"Select Hospital",department:"Department",allDepartments:"All Departments",status:"Status",allStatuses:"All Statuses",planned:"Planned",completed:"Completed",overdue:"Overdue",cancelled:"Cancelled",assignedTo:"Assigned To",allTechnicians:"All Technicians",clearFilters:"Clear Filters",months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},days:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},previousMonth:"Previous Month",today:"Today",nextMonth:"Next Month",loadingLogs:"Loading maintenance logs...",loadingPpm:"Loading PPM schedules...",overdueInTooltip:"(overdue)",clickToViewDetails:"Click to view details",clickToViewPpmPlanner:"Click to open PPM planner",ppmPlannerDefault:"PPM planner",legendCompleted:"Completed",legendPlanned:"Planned",legendOverdue:"Overdue",legendToday:"Today",summaryPpmPlanners:"PPM planners"},w$={title:"SFDA Recalls",loading:"Loading SFDA Recalls...",errorLoading:"Error Loading SFDA Entries",noEntriesFound:"No SFDA entries found",viewDetails:"View Details",savedFilters:"Saved Filters",paginationLabel:"SFDA Recalls",columns:{title:"Title",date:"Date",ncmdrRef:"NCMDR Ref",manufacturer:"Manufacturer",passed:"Passed"},filters:{title:"Title",titlePlaceholder:"Search by title...",ncmdrRef:"NCMDR Ref",ncmdrRefPlaceholder:"Search by NCMDR ref...",manufacturer:"Manufacturer",manufacturerPlaceholder:"Search by manufacturer...",date:"Date",dateStart:"Date From",dateEnd:"Date To",dateNewest:"Alert Date (newest first)",dateOldest:"Alert Date (oldest first)",passed:"Passed"},stats:{passed:"Passed (this page)",notPassed:"Not Passed (this page)"},deviceFields:{material:"Material",materialDescription:"Material Description",catalogNumber:"Catalog Number",udi:"UDI",serialNo:"Serial No",matching:"Matching",gtin:"GTIN",batch:"Batch"},detail:{loading:"Loading SFDA entry details...",errorLoading:"Error Loading SFDA Entry",notFound:"SFDA entry not found",backToList:"Back to SFDA Recalls",entryInformation:"Weekly Bulletin Information",deviceList:"Alerts & Device List",devices:"device rows",alerts:"alerts",alertCount:"Alert Count",noDevices:"No alerts or devices in this weekly entry",adeDetailPdf:"ADE Detail PDF",openPdfNewTab:"PDF",noPdf:"No PDF attached",passed:"Passed",notPassed:"Not Passed",passedDate:"Passed Date",adeDetailUrl:"ADE",viewAde:"ADE",statusSummary:"Status Summary",passedStatus:"Passed Status",deviceCount:"Device Row Count",pdfAttached:"Rows with PDF",auditInfo:"Audit Information",documentId:"Document ID",openMatchingAsset:"View matching asset",resolvingMatches:"Resolving matches..."}},j$={common:XB,sidebar:JB,projects:QB,profile:ZB,login:e$,dashboard:t$,commonFields:r$,filters:a$,listPages:n$,assets:s$,workOrders:i$,maintenance:o$,ppm:l$,ppmPlanner:c$,exportModal:u$,items:d$,issues:f$,users:h$,events:p$,pagination:m$,linkField:g$,supportPlans:x$,inspections:y$,activeMap:v$,maintenanceCalendarPage:b$,sfdaEntries:w$},_$={dashboard:"لوحة التحكم",assets:"الأصول",workOrders:"أوامر العمل",maintenance:"صيانة الأصول",ppm:"الصيانة الوقائية",logout:"تسجيل الخروج",login:"تسجيل الدخول",email:"البريد الإلكتروني",password:"كلمة المرور",submit:"إرسال",cancel:"إلغاء",save:"حفظ",saveChanges:"حفظ التغييرات",delete:"حذف",deleting:"جاري الحذف...",edit:"تعديل",create:"إنشاء",search:"بحث",filter:"تصفية",export:"تصدير",import:"استيراد",loading:"جاري التحميل...",noData:"لا توجد بيانات",error:"خطأ",success:"نجح",darkMode:"الوضع الداكن",lightMode:"الوضع الفاتح",language:"اللغة",english:"الإنجليزية",arabic:"العربية",backToDashboard:"العودة إلى لوحة التحكم",back:"رجوع",saving:"جاري الحفظ...",tryAgain:"حاول مرة أخرى",filters:"المرشحات",enterFilterName:"أدخل اسم المرشح",saveFilterPreset:"حفظ مجموعة المرشحات",saveFilter:"حفظ المرشح",filtering:"جاري التصفية...",updating:"جاري التحديث...",clearFilters:"مسح المرشحات",total:"الإجمالي",selected:"محدد",rows:"صفوف",actions:"إجراءات",selectAllTitle:"تحديد الكل",deselectAllTitle:"إلغاء تحديد الكل",typeToSearch:"اكتب للبحث...",typing:"جاري الكتابة...",enterFilterNameExample:"أدخل اسم المرشح (مثال: 'مفتوح أولوية عالية')"},k$={title:"أصول سيرا",loggedInAs:"تم تسجيل الدخول كـ:",version:"أصول سيرا نظام إدارة الأصول الإصدار 2.26",inventory:"المخزون",ppmPlanner:"مخطط الصيانة الوقائية",maintenanceCalendar:"تقويم الصيانة",activeMap:"الخريطة النشطة",maintenanceTeam:"فريق الصيانة",procurement:"المشتريات",projects:"إدارة المشاريع",sla:"اتفاقية مستوى الخدمة",support:"الدعم",inspection:"التفتيش",sfdaEntries:"يتذكر SFDA",userProfile:"الملف الشخصي"},S$={moduleTitle:"إدارة المشاريع",hubSubtitle:"المشاريع والمهام وجداول الوقت والمستندات المرتبطة.",reportsCardSub:"مخططات ولقطة محفظة المشاريع.",title:"المشاريع",listTotal:"الإجمالي: ",listProject:"مشروع",listProjects:"مشاريع",projectsDoctype:"المشاريع",tasksDoctype:"المهام",timesheetDoctype:"جداول الوقت",projectTemplateDoctype:"قوالب المشاريع",activityTypeDoctype:"أنواع النشاط",newProject:"مشروع جديد",newTask:"مهمة جديدة",newTimesheet:"جدول وقت جديد",newProjectTemplate:"قالب مشروع جديد",newActivityType:"نوع نشاط جديد",searchPlaceholder:"البحث باسم المشروع…",noProjects:"لا توجد مشاريع.",noTasks:"لا توجد مهام.",noTimesheets:"لا توجد جداول وقت.",projectName:"اسم المشروع",customer:"العميل",expectedEnd:"تاريخ الانتهاء المتوقع",progress:"التقدم",project:"المشروع",assignedTo:"معيّن إلى",dueDate:"تاريخ الاستحقاق",timesheetId:"جدول الوقت",totalHours:"إجمالي الساعات",taskColumn:"المهمة",templateCreated:"تم حفظ القالب.",templateUpdated:"تم تحديث القالب.",timesheetCreated:"تم حفظ جدول الوقت.",timesheetUpdated:"تم تحديث جدول الوقت.",reportsDashboardTitle:"تقارير المشاريع",reportsDashboardSubtitle:"مؤشرات ومخططات من بيانات المشروع والمهمة وجدول الوقت.",projectOverviewSection:"نظرة عامة على المشروع",projectOverviewBanner:"نظرة عامة على المشروع",reportProjectFilter:"مشروع التقرير",reportProjectFilterHint:"يؤثر الاختيار على المخططات والمؤشرات والمهام. تظهر لقطة المشروع وتحديثات المشروع فقط عند اختيار مشروع.",selectProjectPlaceholder:"اختر مشروعًا…",searchProjectPlaceholder:"بحث بالاسم أو الرقم…",clearProjectSelection:"إلغاء الاختيار",noMatchingOpenProjects:"لا توجد مشاريع مفتوحة مطابقة.",projectPickerLimitNote:"عرض حتى 2000 مشروع مفتوح الأحدث تعديلًا. صفِّ البحث للعثور على مشروع.",snapshotProjectBudget:"ميزانية المشروع",snapshotOverallShort:"الإجمالي",overviewProjectNameLabel:"اسم المشروع :",overviewDepartmentLabel:"القسم:",overviewDateLabel:"التاريخ:",overviewProgressLabel:"التقدم:",overviewCustomerLabel:"العميل:",overviewDatesUpToday:"الأيام حتى اليوم",overviewProjectDuration:"مدة المشروع",overviewStartDateLabel:"تاريخ بدء المشروع :",overviewEndDateLabel:"تاريخ انتهاء المشروع :",projectNotesSection:"ملاحظات المشروع",reportsCardLabel:"التقارير"},N$={twoFactorTitle:"المصادقة الثنائية (تطبيق OTP)",twoFactorSidebarTitle:"المصادقة الثنائية",twoFactorOtpAppNoteShort:"تطبيق المصادقة مطلوب. أعد التعيين فقط عند الحاجة لرمز QR جديد.",twoFactorLoading:"جاري تحميل إعدادات الأمان…",twoFactorRequired:"المصادقة الثنائية مطلوبة لحسابك.",twoFactorNotRequired:"المصادقة الثنائية غير مطلوبة لأدوارك.",twoFactorDisabledSite:"المصادقة الثنائية غير مفعّلة على هذا الموقع.",twoFactorOtpAppNote:"استخدم تطبيق مصادقة (Google Authenticator، Authy، إلخ). بعد إعادة التعيين، راجع بريدك عند أول تسجيل دخول لرابط إعداد QR.",resetOtp:"إعادة تعيين المصادقة",resetOtpConfirm:"إعادة تعيين سر OTP؟ ستحتاج لمسح رمز QR جديد عند تسجيل الدخول التالي.",resetOtpSuccess:"تم إعادة تعيين المصادقة. راجع بريدك عند تسجيل الدخول التالي.",resetOtpFailed:"تعذر إعادة تعيين المصادقة."},C$={title:"أصول سيرا",subtitle:"نظام إدارة الأصول",signIn:"قم بتسجيل الدخول للمتابعة",emailPlaceholder:"أدخل بريدك الإلكتروني",passwordPlaceholder:"أدخل كلمة المرور",loginFailed:"فشل تسجيل الدخول. يرجى التحقق من بيانات الاعتماد الخاصة بك.",demoLogin:"تسجيل دخول تجريبي",or:"أو",forgotPassword:"نسيت كلمة المرور؟",forgotPasswordTitle:"نسيت كلمة المرور؟",forgotPasswordHint:"أدخل البريد الإلكتروني أو اسم المستخدم الذي تستخدمه لتسجيل الدخول. سنرسل تعليمات إعادة التعيين إلى بريدك المسجل.",forgotPasswordUserRequired:"يرجى إدخال البريد أو اسم المستخدم.",forgotPasswordUserPlaceholder:"البريد أو اسم المستخدم",forgotPasswordSubmit:"إرسال رابط إعادة التعيين",forgotPasswordClose:"إلغاء",forgotPasswordSentSuccess:"تم إرسال تعليمات إعادة تعيين كلمة المرور إلى بريدك المسجل. يرجى التحقق من صندوق الوارد.",forgotPasswordNotFound:"لم يتم العثور على حساب مستخدم بالبريد أو اسم المستخدم المقدم.",forgotPasswordTimeout:"استغرق الطلب وقتًا طويلاً. حاول مرة أخرى أو تواصل مع المسؤول إذا لم يكن البريد الصادر مُعدًا.",forgotPasswordCannotReset:"إعادة تعيين كلمة المرور غير متاحة لهذا الحساب.",forgotPasswordFailed:"تعذر إرسال بريد إعادة التعيين. حاول مرة أخرى لاحقًا.",finishingSignOut:"جاري إنهاء تسجيل الخروج…",afterPasswordResetSignIn:"تم تحديث كلمة المرور. يرجى تسجيل الدخول بكلمة المرور الجديدة.",twoFactorTitle:"التحقق بخطوتين",twoFactorCodeLabel:"رمز التحقق",twoFactorCodePlaceholder:"000000",twoFactorVerify:"تحقق",twoFactorBackToLogin:"العودة لتسجيل الدخول",twoFactorOtpAppEnter:"أدخل الرمز المكون من 6 أرقام من تطبيق المصادقة.",twoFactorOtpAppSetupIncomplete:"إعداد المصادقة غير مكتمل. راجع بريدك لرابط رمز QR أو تواصل مع المسؤول.",twoFactorEmailQrHint:"افتح رابط الإعداد في بريدك على هذا الجهاز لمسح رمز QR، ثم عد هنا لإدخال الرمز.",twoFactorCodeRequired:"يرجى إدخال رمز التحقق.",twoFactorInvalid:"رمز التحقق غير صحيح. حاول مرة أخرى.",twoFactorSessionExpired:"انتهت جلسة التحقق. يرجى تسجيل الدخول مرة أخرى."},T$={title:"لوحة التحكم",loading:"جاري تحميل لوحة التحكم...",totalAssets:"إجمالي عدد الأصول",assetsDown:"الأصول إلى أسفل",openWorkOrders:"أوامر العمل المفتوحة",workOrdersInProgress:"أوامر العمل قيد التنفيذ",completedWorkOrders:"أوامر العمل المكتملة",totalWorkOrders:"إجمالي أوامر العمل",overdueWorkOrders:"أوامر العمل المتأخرة",closedWorkOrders:"أوامر العمل المغلقة",upTime:"وقت التشغيل",downTime:"وقت التوقف",workOrderStatus:"حالة أمر العمل",workOrderByType:"أمر العمل حسب النوع",maintenanceByAsset:"الصيانة حسب الأصل",assigneesStatus:"حالة المكلفين",assigneesCount:"المكلفون",totalTasksAssigned:"المهام المعينة",maintenanceFrequency:"تكرار الصيانة",maintenanceLogs:"سجلات الصيانة",assetUptime:"وقت تشغيل الأصل",avgResponseTime:"متوسط وقت الاستجابة",maintenanceEfficiency:"كفاءة الصيانة",overdueMaintenance:"صيانة متأخرة",upDownTimeChart:"مخطط وقت التشغيل والتوقف",ppmStatus:"حالة الصيانة الوقائية",completionRate:"معدل الإكمال",completionRateChartHint:"نسبة الإكمال خلال آخر 7 أشهر — مرر المؤشر على النقطة للتفاصيل",completionRateTooltip:"{{value}}% معدل الإكمال",viewFullReport:"عرض التقرير الكامل",noDataAvailable:"لا توجد بيانات",loadingTechnicianHours:"جاري تحميل ساعات الفنيين...",loadingTechnicianWorkData:"جاري تحميل بيانات عمل الفنيين...",welcome:"مرحباً،",user:"المستخدم",failedToLoad:"فشل تحميل بيانات لوحة التحكم",recentRecords:"السجلات الأخيرة",latestEntries:"أحدث الإدخالات من النظام الخلفي",quickActions:"إجراءات سريعة",cardTotalAssets:"إجمالي الأصول",cardOpenWorkOrders:"أوامر العمل المفتوحة",cardInProgress:"قيد التنفيذ",cardCompletedWorkOrders:"أوامر العمل المكتملة",viewUsers:"عرض المستخدمين",manageUserAccounts:"إدارة حسابات المستخدمين",settings:"الإعدادات",configurePreferences:"تكوين التفضيلات",events:"الأحداث",viewCalendarEvents:"عرض أحداث التقويم",reports:"التقارير",viewAnalyticsReports:"عرض التحليلات والتقارير",ppmTemplateCounts:"عدادات قوالب الصيانة الوقائية",repairCost:"تكلفة الإصلاح",dashboardFilter:"فلتر لوحة التحكم",allDepartments:"جميع الأقسام",workOrderStatusDistribution:"توزيع حالة أوامر العمل",workOrderInspectionSummary:"ملخص تفتيش أوامر العمل",woRejectionSummary:"ملخص رفض أوامر العمل",total:"الإجمالي",inProgress:"قيد التنفيذ",completed:"مكتمل",totalSales:"إجمالي المبيعات",average:"متوسط",noChartDataAvailable:"لا توجد بيانات للمخطط",loadingInspectionData:"جاري تحميل بيانات التفتيش...",noInspectionDataAvailable:"لا توجد بيانات تفتيش",totalRejections:"إجمالي الرفض",loadingRejectionData:"جاري تحميل بيانات الرفض...",noRejectionDataAvailable:"لا توجد بيانات رفض",department:"القسم",allOperational:"جميع الأنظمة تعمل",low:"منخفض",highPriority:"أولوية عالية",allClear:"الكل واضح",fastResponse:"استجابة سريعة",monitor:"مراقبة",onTrack:"وفق الخطة",needsAttention:"يحتاج اهتمام",totalHours:"الإجمالي: {{value}} ساعة",technicianWorkingHours:"ساعات عمل الفنيين",techniciansWorked:"ملخص عمل الفنيين",pendingReviewWorkOrders:"قيد المراجعة",clear:"مسح",clearFilter:"مسح الفلتر",label:"التسمية",open:"مفتوح"},E$={assetId:"معرف الأصل",assetName:"اسم الأصل",serialNumber:"الرقم التسلسلي",company:"الشركة/المستشفى",location:"الموقع",department:"القسم",deviceStatus:"حالة الجهاز",modality:"الطريقة",manufacturer:"الشركة المصنعة",supplier:"المورد",assetCategory:"فئة الأصل",purchaseDate:"تاريخ الشراء",purchaseAmount:"مبلغ الشراء",availableForUseDate:"تاريخ التوفر للاستخدام",createdOn:"تم الإنشاء في",modifiedOn:"تم التعديل في",createdBy:"تم الإنشاء بواسطة",modifiedBy:"تم التعديل بواسطة",workOrderId:"معرف أمر العمل",workOrderType:"النوع",status:"الحالة",priority:"الأولوية",description:"الوصف",assignedTo:"مكلف إلى",scheduledDate:"التاريخ المجدول",completedDate:"تاريخ الإكمال",hospital:"المستشفى",assetType:"نوع الأصل",siteName:"اسم الموقع",assignedSupervisor:"المشرف المعين",assignedContractor:"المقاول المعين",serialNumberShort:"الرقم التسلسلي",departmentShort:"القسم",manufacturerShort:"الشركة المصنعة",workOrderIdShort:"معرف أمر العمل",assetShort:"الأصل",typeShort:"النوع",nameShort:"الاسم",pmId:"معرف الصيانة الوقائية",name:"الاسم"},A$={filterBy:"تصفية حسب",createdDate:"تاريخ الإنشاء",latestModifiedDate:"آخر تاريخ تعديل",startDate:"تاريخ البداية",endDate:"تاريخ النهاية",assetId:"معرف الأصل",hospital:"المستشفى",name:"الاسم",serial:"الرقم التسلسلي",status:"الحالة",location:"الموقع",dept:"القسم",modality:"الطريقة",mfr:"الشركة المصنعة",supplier:"المورد",workOrderId:"معرف أمر العمل",asset:"الأصل",type:"النوع",priority:"الأولوية",workflowState:"حالة سير العمل",allStatuses:"أي حالة",allStates:"جميع الحالات",allTypes:"جميع الأنواع",allPriorities:"أي أولوية",allHospitals:"جميع المستشفيات",allModalities:"جميع الطرق",filterByCompany:"تصفية حسب الشركة",allManufacturers:"جميع الشركات المصنعة",sortBy:"ترتيب حسب",sortCreationNewest:"تاريخ الإنشاء (الأحدث أولاً)",sortCreationOldest:"تاريخ الإنشاء (الأقدم أولاً)",sortModifiedNewest:"آخر تعديل (الأحدث أولاً)",sortModifiedOldest:"آخر تعديل (الأقدم أولاً)",sortNameAsc:"الاسم (أ-ي)",sortNameDesc:"الاسم (ي-أ)",sortAssetNameAsc:"اسم الأصل (أ-ي)",sortAssetNameDesc:"اسم الأصل (ي-أ)",sortItemNameAsc:"اسم العنصر (أ-ي)",sortItemNameDesc:"اسم العنصر (ي-أ)",sortTeamNameAsc:"اسم الفريق (أ-ي)",sortTeamNameDesc:"اسم الفريق (ي-أ)"},O$={addNew:"إضافة جديد",searchPlaceholder:"بحث...",noResults:"لم يتم العثور على نتائج",showing:"عرض",of:"من",results:"نتائج",selectAll:"تحديد الكل",deselectAll:"إلغاء تحديد الكل",selected:"محدد",actions:"الإجراءات",view:"عرض",edit:"تعديل",delete:"حذف",duplicate:"نسخ",export:"تصدير",print:"طباعة",filters:"المرشحات",clearFilters:"مسح المرشحات",applyFilters:"تطبيق المرشحات",columns:"الأعمدة",exportSelected:"تصدير المحدد",exportAllOnPage:"تصدير الكل في الصفحة",exportAllWithFilters:"تصدير الكل مع المرشحات",exportFormat:"تنسيق التصدير",csv:"CSV",excel:"Excel",exporting:"جاري التصدير...",exportComplete:"اكتمل التصدير",close:"إغلاق",loading:"جاري التحميل...",refresh:"تحديث",deselectAllTitle:"إلغاء تحديد الكل",selectAllTitle:"تحديد الكل",typeToSearch:"اكتب للبحث...",enterFilterName:"أدخل اسم المرشح",enterFilterNameExample:"أدخل اسم المرشح (مثال: 'مفتوح أولوية عالية')",allStatuses:"أي حالة",savedFilters:"المرشحات المحفوظة",clear:"مسح",noIssuesFound:"لم يتم العثور على تذاكر",createFirstIssue:"أنشئ تذكرتك الأولى",saveFilterPreset:"حفظ مجموعة المرشحات",saveFilter:"حفظ المرشح",filtering:"جاري التصفية...",noMaintenanceTeamsFound:"لم يتم العثور على فرق صيانة",createFirstTeam:"أنشئ فريقك الأول",all:"الكل",tryAdjustingFilters:"حاول تعديل البحث أو المرشحات",getStartedCreateFirst:"ابدأ بإنشاء مخطط الصيانة الوقائية الأول",noMaintenanceLogsFound:"لم يتم العثور على سجلات صيانة",createFirstMaintenanceLog:"أنشئ سجل الصيانة الأول",total:"الإجمالي",noPPMSchedulesFound:"لم يتم العثور على جداول صيانة وقائية",createFirstPPMSchedule:"أنشئ جدول الصيانة الوقائية الأول",deleteConfirmCannotUndo:"لا يمكن التراجع عن هذا الإجراء."},P$={title:"الأصول",addAsset:"إضافة أصل جديد",assetDetails:"تفاصيل الأصل",assetInformation:"معلومات الأصل",newAsset:"أصل جديد",duplicateAsset:"نسخ الأصل",fromAsset:"من الأصل",creatingFromAsset:"جاري إنشاء أمر العمل من الأصل",assetInfoPrefilled:"معلومات الأصل معبأة مسبقاً من",pleaseSelectWorkOrderType:"يرجى اختيار نوع أمر العمل وإضافة أي تفاصيل",loadingAssetDetails:"جاري تحميل تفاصيل الأصل...",pleaseEnterAssetName:"يرجى إدخال اسم الأصل",pleaseSelectCategory:"يرجى اختيار الفئة",assetDuplicatedSuccessfully:"تم نسخ الأصل بنجاح!",assetCreatedSuccessfully:"تم إنشاء الأصل بنجاح!",assetUpdatedSuccessfully:"تم تحديث الأصل بنجاح!",sourceAssetNotFound:"الأصل المصدر غير موجود",assetNotFoundMessage:"لم يتم العثور على الأصل الذي تحاول نسخه.",backToAssetsList:"العودة إلى قائمة الأصول",backToList:"العودة إلى قائمة الأصول",createNewAsset:"إنشاء أصل جديد",newAssetDetails:"تفاصيل أصل جديد",noAssetsFound:"لم يتم العثور على أصول",createFirstAsset:"أنشئ أول أصل",deleteConfirmTitle:"حذف الأصل",deleteConfirmMessage:"هل أنت متأكد من حذف هذا الأصل؟ لا يمكن التراجع عن هذا الإجراء.",noDataToExport:"لا توجد بيانات للتصدير",loadingPermissions:"جاري تحميل الصلاحيات...",selectAssetId:"اختر معرف الأصل",selectHospital:"المستشفى",viewDetails:"عرض التفاصيل",editAsset:"تعديل الأصل",createWorkOrder:"إنشاء أمر عمل",viewLinkedWOs:"عرض أوامر العمل المرتبطة",moreActions:"المزيد من الإجراءات",exportAsJson:"تصدير كـ JSON",printAsset:"طباعة",deviceStatus:"حالة الجهاز",status:{up:"يعمل",down:"متوقف"},apiNotAvailable:"واجهة برمجة الأصول غير متاحة",apiNotDeployed:"نقطة نهاية واجهة برمجة الأصول غير مُنشأة بعد.",tryCreatingNew:"حاول إنشاء أصل جديد (تجريبي)",listTotal:"الإجمالي: ",table:{assetName:"اسم الأصل",serialNo:"الرقم التسلسلي",company:"الشركة",location:"الموقع",status:"الحالة",updatedOn:"آخر تحديث",actions:"إجراءات"},export:{title:"تصدير الأصول",selectData:"اختر البيانات للتصدير",selectedRows:"الصفوف المحددة",selectedCount:"تصدير {{count}} أصل{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}",currentPage:"الصفحة الحالية",currentPageCount:"تصدير {{count}} أصل{{count !== 1 ? 'اً' : ''}} في الصفحة الحالية",allWithFilters:"جميع السجلات (مع الفلاتر الحالية)",allWithFiltersCount:"تصدير جميع {{count}} أصل{{count !== 1 ? 'اً' : ''}} المطابقة للفلاتر الحالية",csvDesc:"قيم مفصولة بفاصلة",excelDesc:"جدول XLSX",columnsToExport:"الأعمدة للتصدير",selectAll:"تحديد الكل",resetToDefault:"إعادة التعيين للافتراضي",columnsSelected:"{{count}} عمود{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}",exporting:"جاري التصدير...",exportButton:"تصدير",exportingSelected:"جاري تصدير {{count}} صف{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}",exportingPage:"جاري تصدير {{count}} صف{{count !== 1 ? 'اً' : ''}} من الصفحة الحالية",exportingAll:"جاري تصدير جميع {{count}} صف{{count !== 1 ? 'اً' : ''}}"},detail:{assetInformation:"معلومات الأصل",technicalSpecs:"المواصفات الفنية",financialDetails:"التفاصيل المالية",assetFinanceBooks:"دفاتر أصول التمويل",addRow:"إضافة صف",duplicatingFrom:"النسخ من:",noDepartmentsMapped:"لا توجد أقسام معينة لهذا المبنى",departmentsAvailable:"{{count}} قسم متاح (مُصفى حسب المبنى)",selectDepartmentForRoom:"اختر القسم لتفعيل رقم الغرفة",depreciationMethodNote:"طريقة الاستهلاك هي طريقة محاسبية لتوزيع تكلفة أصل ملموس على عمره الإنتاجي.",calculateDepreciation:"حساب الاستهلاك",noFinanceBooksYet:'لم تتم إضافة دفاتر مالية بعد. انقر "إضافة صف" للإضافة.',noSparePartsYet:'لم تتم إضافة قطع غيار بعد. انقر "إضافة صف" للإضافة.',assetName:"اسم الأصل",category:"الفئة",modality:"الطريقة",class:"الفئة",assetId:"معرف الأصل",deviceStatus:"حالة الجهاز",serialCode:"الرمز التسلسلي",technicalDepartment:"القسم الفني",manufacturer:"الشركة المصنعة",model:"الموديل",totalHours:"إجمالي الساعات",downTimeHours:"وقت التوقف (بالساعات)",upTimeHours:"وقت التشغيل (بالساعات)",placeholderAssetName:"مثال: كمبيوتر محمول موديل X",placeholderSerialCode:"مثال: SN-12345",placeholderModelNumber:"رقم الموديل",placeholderZero:"0",placeholderDescription:"وصف موجز للأصل",placeholderPONumber:"رقم أمر الشراء",selectClass:"اختر الفئة",classA:"فئة أ",classB:"فئة ب",classC:"فئة ج",autoGenerated:"يُولد تلقائياً",calculatedFromAvailableDate:"محسوب من تاريخ التوفر للاستخدام",calculatedTotalMinusDown:"محسوب: إجمالي الساعات - وقت التوقف",hospital:"المستشفى",siteName:"اسم الموقع",selectSite:"اختر الموقع",building:"المبنى",department:"القسم",roomNumber:"رقم الغرفة",location:"الموقع",recalled:"مسترجع",selectStatus:"اختر الحالة",operational:"يعمل",underMaintenance:"قيد الصيانة",decommissioned:"مُوقف",selectServiceAgreement:"اختر اتفاقية الخدمة",warranty:"ضمان",contract:"عقد",frameWork:"إطار عمل",mainContractor:"المقاول الرئيسي",outOfWarranty:"خارج الضمان",underDismantle:"قيد التفكيك",underInstallation:"قيد التركيب",selectServiceCoverage:"اختر تغطية الخدمة",pmOnly:"صيانة وقائية فقط",labour:"عمالة",labourAndParts:"عمالة وقطع غيار",comprehensive:"شامل",supplierVendor:"المورد/البائع",selectMethod:"اختر الطريقة",straightLine:"الطريقة الخطية",doubleDecliningBalance:"الرصيد المتناقص المزدوج",writtenDownValue:"القيمة المكتوبة",manual:"يدوي",recycling:"إعادة التدوير",donation:"تبرع",sale:"بيع",assetDuplicatedSuccess:"تم نسخ الأصل بنجاح!",assetCreatedSuccess:"تم إنشاء الأصل بنجاح!",assetUpdatedSuccess:"تم تحديث الأصل بنجاح!",failedToSave:"فشل حفظ الأصل",cannotSubmitNotSaved:"لا يمكن الإرسال: الأصل غير محفوظ بعد",confirmSubmit:'هل أنت متأكد من إرسال هذا الأصل؟ بعد الإرسال، يمكن تعديل الحقول المحددة بـ "السماح عند الإرسال" فقط.',assetSubmittedSuccess:"تم إرسال الأصل بنجاح!",failedToSubmit:"فشل إرسال الأصل",pleaseSaveFirstForPPM:"يرجى حفظ الأصل أولاً لعرض خطة الصيانة الوقائية",pleaseSaveFirstForHistory:"يرجى حفظ الأصل أولاً لعرض سجل الأصل",failedToLoadPPMPlan:"فشل تحميل خطة الصيانة الوقائية. يرجى المحاولة مرة أخرى.",noPlannedMaintenance:"لم يتم العثور على صيانة مخطط لها لهذا الأصل",noWorkOrdersFound:"لم يتم العثور على أوامر عمل",noSparePartsUsed:"لم تُستخدم قطع غيار",noMaintenanceRecords:"لم يتم العثور على سجلات صيانة",noMaintenanceTasks:"لم يتم العثور على مهام صيانة",selectBuildingFirst:"اختر المبنى أولاً لتفعيل القسم",coverage:"التغطية",siteContractor:"مقاول الموقع",contractNumber:"رقم العقد",serviceAgreement:"اتفاقية الخدمة",serviceCoverage:"تغطية الخدمة",purchaseOrderNumber:"رقم أمر الشراء",grossPurchaseAmount:"مبلغ الشراء الإجمالي",purchaseDate:"تاريخ الشراء",installationDate:"تاريخ التركيب",availableForUseDate:"تاريخ التوفر للاستخدام",financeBook:"دفتر المالية",depreciationMethod:"طريقة الاستهلاك",totalDepreciations:"إجمالي الاستهلاك",frequencyMonths:"التكرار (بالأشهر)",depreciationPostingDate:"تاريخ ترحيل الاستهلاك",startDate:"تاريخ البداية",endDate:"تاريخ النهاية",totalAmount:"المبلغ الإجمالي",selectRoomFirst:"اختر رقم الغرفة لتفعيل الموقع",autoSetFromRoom:"تم التعيين تلقائياً من خريطة الغرفة",moreDetails:"تفاصيل إضافية"}},D$=JSON.parse(`{"title":"أوامر العمل","addWorkOrder":"إضافة أمر عمل جديد","workOrderDetails":"تفاصيل أمر العمل","newWorkOrder":"أمر عمل جديد","duplicateWorkOrder":"نسخ أمر العمل","createFromAsset":"إنشاء أمر عمل من الأصل","closeWorkOrders":"إغلاق أوامر العمل","closeConfirmTitle":"إغلاق أوامر العمل","closeConfirmMessage":"هل أنت متأكد من إغلاق أمر/أوامر العمل المحددة؟","deleteConfirmMessage":"هل أنت متأكد من حذف أمر العمل هذا؟ لا يمكن التراجع عن هذا الإجراء.","cancelConfirmMessage":"هل أنت متأكد من إلغاء أمر العمل هذا؟ سيتم وضع علامة ملغى ويمكنك حذفه لاحقاً إذا لزم الأمر.","assignConfirmMessage":"هل أنت متأكد من تعيين أمر العمل هذا للفني/الفنيين التاليين؟","deleteWorkOrder":"حذف أمر العمل","cancelWorkOrder":"إلغاء أمر العمل","loadingWorkOrders":"جاري تحميل أوامر العمل...","loadingDetails":"جاري تحميل تفاصيل أمر العمل...","backToList":"العودة إلى قائمة أوامر العمل","status":{"open":"مفتوح","work_in_progress":"جاري العمل","pending_review":"قيد المراجعة","completed":"مكتمل","cancelled":"ملغى","closed":"مغلق"},"priorityNormal":"عادي","priorityUrgent":"عاجل","workflowState":{"draft":"مسودة"},"priority":{"normal":"عادي","urgent":"عاجل"},"table":{"workOrderId":"معرف أمر العمل","asset":"الأصل","type":"النوع","technicalReport":"التقرير الفني","department":"القسم","workflowState":"حالة سير العمل","priority":"الأولوية","noWorkOrdersFound":"لم يتم العثور على أوامر عمل","createFirstWorkOrder":"أنشئ أول أمر عمل"},"export":{"title":"تصدير أوامر العمل","selectData":"ماذا تُصدّر","selectedRows":"الصفوف المحددة","selectedCount":"تصدير {{count}} أمر عمل{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}","currentPage":"الصفحة الحالية","currentPageCount":"تصدير {{count}} أمر عمل{{count !== 1 ? 'اً' : ''}} في الصفحة الحالية","allWithFilters":"جميع السجلات (مع الفلاتر الحالية)","allWithFiltersCount":"تصدير جميع {{count}} أمر عمل{{count !== 1 ? 'اً' : ''}} المطابقة للفلاتر الحالية","csvDesc":"قيم مفصولة بفاصلة","excelDesc":"جدول XLSX","columnsToExport":"الأعمدة للتصدير","selectAll":"تحديد الكل","resetToDefault":"إعادة التعيين للافتراضي","columnsSelected":"{{count}} عمود{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}","exporting":"جاري التصدير...","exportButton":"تصدير","exportingSelected":"جاري تصدير {{count}} صف{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}","exportingPage":"جاري تصدير {{count}} صف{{count !== 1 ? 'اً' : ''}} من الصفحة الحالية","exportingAll":"جاري تصدير جميع {{count}} صف{{count !== 1 ? 'اً' : ''}}"},"closeModal":{"title":"إغلاق أوامر العمل","confirmBulkClose":"تأكيد عملية الإغلاق الجماعي","aboutToClose":"أنت على وشك إغلاق {{count}} أمر عمل{{count !== 1 ? 'اً' : ''}}. سيتم تغيير حالة سير العمل إلى \\"مغلق\\".","alreadyClosedNote":"ملاحظة: {{count}} أمر عمل{{count !== 1 ? ' مغلقة' : ' مغلق'}} بالفعل وسيتم تخطيها.","selectedWorkOrders":"أوامر العمل المحددة ({{count}})","workOrderId":"معرف أمر العمل","currentStatus":"الحالة الحالية","workflowState":"حالة سير العمل","alreadyClosed":"(مغلق بالفعل)","willClose":"سيتم إغلاق {{count}} أمر عمل{{count !== 1 ? 'اً' : ''}}","allAlreadyClosed":"جميع أوامر العمل المحددة مغلقة بالفعل","cancel":"إلغاء","close":"إغلاق","closing":"جاري الإغلاق..."},"detail":{"workOrderInformation":"معلومات أمر العمل","assignments":"التعيينات","statusSummary":"ملخص الحالة","existingWorkOrders":"أمر/أوامر العمل الموجودة:","created":"تاريخ الإنشاء","proceedCreateNew":"هل تريد المتابعة لإنشاء أمر عمل جديد؟","loadingTechnicians":"جاري تحميل الفنيين...","feedbackBy":"التقييم بواسطة","overallSatisfaction":"رضا إجمالي","overallRatingPreview":"معاينة التقييم الإجمالي","uploading":"جاري الرفع...","uploadOpeningFile":"رفع ملف الفتح","uploadClosingFile":"رفع ملف الإغلاق","noAttachment":"لا يوجد مرفق","noClosingAttachment":"لا يوجد مرفق إغلاق","closingAttachment":"مرفق الإغلاق","currentState":"الحالة الحالية","loadingActions":"جاري تحميل الإجراءات...","actionResults":"نتائج الإجراء:","checkingFeedback":"جاري التحقق من التقييم...","yourRating":"تقييمك","repairStatus":"حالة الإصلاح","priority":"الأولوية","lastModified":"آخر تعديل","documentStatus":"حالة المستند","loadingActivity":"جاري تحميل النشاط...","added":"تمت الإضافة:","removed":"تمت الإزالة:","modified":"تم التعديل:","items":"عنصر/عناصر","rows":"صف/صفوف","pleaseAllowPopupsServiceReport":"يرجى السماح بالنوافذ المنبثقة لهذا الموقع لطباعة تقرير الخدمة.","pleaseProvideAtLeastOneRating":"يرجى تقديم تقييم واحد على الأقل","feedbackSubmittedSuccessfully":"تم إرسال التقييم بنجاح!","failedToSubmitFeedback":"فشل إرسال التقييم","feedbackUpdatedSuccessfully":"تم تحديث التقييم بنجاح!","failedToUpdateFeedback":"فشل تحديث التقييم","locationAutoSetTo":"تم تعيين الموقع تلقائياً إلى: {{location}}","noTechniciansSelected":"لم يتم تحديد فنيين","techniciansAssignedSuccessfully":"تم تعيين {{count}} فني/فنيين إضافي بنجاح","removedTechnician":"تمت إزالة {{name}}","itemAlreadyAdded":"الصنف \\"{{itemCode}}\\" مضاف بالفعل في الصف {{row}}. يرجى اختيار صنف مختلف.","insufficientStock":"مخزون غير كافٍ لـ {{itemCode}}. المتوفر: {{available}}، المطلوب: {{required}}","pleaseEnterSerialNumberToSearch":"يرجى إدخال الرقم التسلسلي للبحث","assetFound":"تم العثور على الأصل: {{name}}","noAssetFoundWithSerialNumber":"لم يتم العثور على أصل بهذا الرقم التسلسلي","fileSizeExceeds":"حجم الملف يتجاوز حد 10 ميجابايت","fileUploadedSuccessfully":"تم رفع الملف بنجاح","failedToUploadFile":"فشل رفع الملف","attachmentRemoved":"تم إزالة المرفق","failureDateSetToCurrentTime":"تم تعيين تاريخ العطل على الوقت الحالي","firstRespondedOnSetToCurrentTime":"تم تعيين وقت أول استجابة على الوقت الحالي","completionDateSetToCurrentTime":"تم تعيين تاريخ الإكمال على الوقت الحالي","firstRespondedOnSetTo":"تم تعيين وقت أول استجابة على {{datetime}}","completionDateSetTo":"تم تعيين تاريخ الإكمال على {{datetime}}","assignedSupervisorMandatory":"المشرف المعيّن إلزامي لدور مراقبة العمل.","assignedEngineerMandatory":"المهندس المعيّن إلزامي لدور مراقبة العمل.","assignedTechnicianMandatory":"الفني المعيّن إلزامي عندما تكون الحالة \\"إرسال إلى المهندس\\".","workOrderCancelledSuccessfully":"تم إلغاء أمر العمل بنجاح!","failedToCancel":"فشل الإلغاء: {{error}}","workOrderDeletedSuccessfully":"تم حذف أمر العمل بنجاح!","failedToDelete":"فشل الحذف: {{error}}","pleaseSelectWorkOrderType":"يرجى اختيار نوع أمر العمل","workOrderUpdatedSuccessfully":"تم تحديث أمر العمل بنجاح!","workOrderCreatedSuccessfully":"تم إنشاء أمر العمل بنجاح!","workOrderCreatedFromAssetSuccessfully":"تم إنشاء أمر العمل من الأصل بنجاح!","workOrderDuplicatedSuccessfully":"تم نسخ أمر العمل بنجاح!","documentModifiedByAnotherUser":"تم تعديل المستند من قبل مستخدم آخر. جاري التحديث...","pleaseReviewLatestChanges":"يرجى مراجعة أحدث التغييرات والمحاولة مرة أخرى.","failedToSaveWorkOrder":"فشل حفظ أمر العمل: {{error}}","technicalReportMandatoryForSupervisor":"التقرير الفني إلزامي عند الإرسال مباشرة إلى المشرف. يرجى ملء حقل التقرير الفني قبل المتابعة.","applyingAction":"جاري تطبيق الإجراء \\"{{action}}\\"...","assignedTo":"معيّن إلى: {{name}}","actionCompletedSuccessfully":"تم إكمال الإجراء \\"{{action}}\\" بنجاح!","documentModifiedRefreshing":"تم تعديل المستند. جاري التحديث...","tryActionAgainAfterReview":"يرجى المحاولة مرة أخرى بعد مراجعة أحدث التغييرات.","failedToApplyAction":"فشل تطبيق الإجراء \\"{{action}}\\". {{error}}","editModeEnabled":"تم تفعيل وضع التحرير","editCancelledChangesDiscarded":"تم إلغاء التحرير - تم تجاهل التغييرات","closingAttachmentRemoved":"تم إزالة مرفق الإغلاق","closingAttachmentUploadedSuccessfully":"تم رفع مرفق الإغلاق بنجاح","failedToUploadClosingAttachment":"فشل رفع مرفق الإغلاق","newStockItemRowAdded":"تمت إضافة صف صنف جديد","stockItemRemoved":"تمت إزالة صنف المخزون {{item}}","activityLogRefreshed":"تم تحديث سجل النشاط","errorLabel":"خطأ","backToList":"العودة إلى قائمة أوامر العمل","duplicateWorkOrder":"نسخ أمر العمل","createFromAsset":"إنشاء أمر عمل من الأصل","newWorkOrder":"أمر عمل جديد","workOrderDetails":"تفاصيل أمر العمل","existingWorkOrderFound":"تم العثور على أمر عمل موجود","workOrderExistsForAsset":"يوجد أمر عمل بالفعل لهذا الأصل بحالة سير عمل غير معتمدة أو مغلقة.","workOrderExistsForTypeAndRoom":"يوجد أمر عمل بالفعل لهذا النوع ورقم الغرفة بحالة سير عمل غير معتمدة أو مغلقة.","proceedWithNewWO":"هل ما زلت تريد المتابعة بإنشاء أمر عمل جديد؟","proceedAnyway":"متابعة على أي حال","noGoBack":"لا، تراجع","yesCancel":"نعم، إلغاء","cancelling":"جاري الإلغاء...","deleting":"جاري الحذف...","selectAdditionalTechnicians":"اختر فنيين إضافيين","searchTechnicians":"البحث عن فنيين...","techniciansSelected":"{{count}} فني/فنيين محدد","clearAll":"مسح الكل","noTechniciansMatchSearch":"لا يوجد فنيون يطابقون بحثك","noTechniciansFound":"لم يتم العثور على فنيين","hospital":"المستشفى","technicalDepartment":"القسم الفني","woType":"نوع أمر العمل","assetId":"معرف الأصل","assetName":"اسم الأصل","extensionNo":"رقم الامتداد","building":"المبنى","departmentName":"اسم القسم","roomNo":"رقم الغرفة","location":"الموقع","manufacturer":"الشركة المصنعة","supplier":"المورد","assignedSupervisor":"المشرف المعيّن","assignedEngineer":"المهندس المعيّن","assignedTechnician":"الفني المعيّن","fromAsset":"من الأصل","assetDetailsAutoPopulated":"تم تعبئة تفاصيل الأصل تلقائياً","selectBuildingFirst":"اختر المبنى أولاً لتفعيل القسم","printServiceReport":"طباعة تقرير الخدمة","removeAttachment":"إزالة المرفق","removeClosingAttachment":"إزالة مرفق الإغلاق","setToCurrentDateTime":"تعيين على التاريخ والوقت الحالي","selectItem":"اختر الصنف","selectWarehouse":"اختر المستودع","autoPopulatedFromStock":"تم تعبئته تلقائياً من المخزون","removeItem":"إزالة الصنف","noItemsAddedYet":"لم تتم إضافة أصناف بعد","commentsDiscussion":"التعليقات والنقاش","refreshActivityLog":"تحديث سجل النشاط","supervisorsAvailableForType":"{{count}} مشرف/مشرفين معيّن متاح لهذا النوع","civilWorkCategory":"فئة الأعمال المدنية","selectCivilWorkCategory":"اختر فئة الأعمال المدنية","selectPendingReason":"اختر سبب الانتظار","pleaseSpecifyReason":"يرجى تحديد السبب...","selectServiceAgreement":"اختر اتفاقية الخدمة","selectServiceCoverage":"اختر تغطية الخدمة","describeComplaint":"صف طبيعة الشكوى...","describeWorkPerformed":"صف العمل المنفذ...","enterSerialNumber":"أدخل الرقم التسلسلي","searchAssetBySerial":"البحث عن الأصل بالرقم التسلسلي","workOrder":"أمر العمل:","giveFeedback":"تقديم التقييم","editFeedback":"تعديل التقييم","feedbackDetails":"تفاصيل التقييم","confirmAssignment":"تأكيد التعيين","notRated":"غير مُقيّم","serviceReport":"تقرير الخدمة","assetInfoPrefilled":"تم تعبئة معلومات الأصل تلقائياً من","linkedFromAsset":"مرتبط من الأصل:","loadingAssetDetails":"جاري تحميل تفاصيل الأصل...","cancelled":"ملغى","workOrderId":"معرف أمر العمل","pendingReason":"سبب الانتظار","otherReason":"سبب آخر","serviceAgreementDetails":"تفاصيل اتفاقية الخدمة","siteContractor":"متعاقد الموقع","subcontractor":"المقاول من الباطن","model":"الموديل","description":"الوصف","natureOfComplaint":"طبيعة الشكوى","technicalReport":"التقرير الفني","selectWoTypeFirstForSupervisors":"اختر نوع أمر العمل أولاً لتصفية المشرفين المعيّنين","noSupervisorsFound":"لم يتم العثور على مشرفين معيّنين لهذا النوع من أمر العمل","requiredForExistingWO":"* مطلوب لأوامر العمل الموجودة","selectWoTypeFirstForEngineers":"اختر نوع أمر العمل أولاً لتصفية المهندسين","noEngineersFound":"لم يتم العثور على مهندسين (دور مهندس المقاول) لهذا النوع من أمر العمل","engineersAvailable":"{{count}} مهندس/مهندسين متاح","selectWoTypeFirstForTechnicians":"اختر نوع أمر العمل أولاً لتصفية الفنيين","noTechniciansFoundForType":"لم يتم العثور على فنيين لهذا النوع من أمر العمل","techniciansAvailable":"{{count}} فني/فنيين متاح","requiredForSentToEngineer":"* مطلوب لحالة \\"إرسال إلى المهندس\\"","autoCalculated":"(محسوب تلقائياً)","autoSetOnRepairStart":"(يُعيّن عند بدء الإصلاح)","autoSetOnClose":"(يُعيّن عند الإغلاق)","totalItems":"إجمالي الأصناف:","confirmAction":"تأكيد الإجراء","confirmActionMessage":"هل أنت متأكد أنك تريد {{action}} أمر العمل هذا؟","processing":"جاري المعالجة...","yesAction":"نعم، {{action}}","systemManagerNote":"مدير النظام: عرض جميع الإجراءات الصالحة لهذه الحالة.","saveToSeeActions":"احفظ التغييرات لرؤية جميع الإجراءات المتاحة.","availableActions":"الإجراءات المتاحة","allOptionsAvailable":"جميع الخيارات متاحة","bothFilledMessage":"تم ملء الفني والتقرير الفني. يمكنك الآن استخدام أي إجراء سير عمل متاح أعلاه.","technicianAssigned":"تم تعيين الفني","assignedTechnicianLabel":"الفني المعيّن:","wantToEnableSendToSupervisor":"هل تريد أيضاً تمكين \\"إرسال إلى المشرف\\"؟","fillTechnicalReportToUnlock":"املأ حقل \\"التقرير الفني\\" لفتح هذا الخيار","technicalReportFilled":"تم ملء التقرير الفني","howWasService":"كيف كانت الخدمة لأمر العمل هذا؟","noFeedbackYet":"لم يُقدّم أي تقييم بعد","statusInfoAfterCreation":"ستظهر معلومات الحالة بعد الإنشاء","activityLog":"سجل النشاط","refreshActivityLogTitle":"تحديث سجل النشاط","noChangesRecorded":"لم يُسجّل أي تغيير بعد","createdThisWorkOrder":"أنشأ أمر العمل هذا","showLess":"عرض أقل","showAll":"عرض الكل","entries":"إدخالات","changedFrom":"تغيّر من","documentUpdated":"تم تحديث المستند","addItem":"إضافة صنف","addFirstItem":"+ إضافة الصنف الأول","item":"الصنف","valuationRate":"معدل التقييم","warehouse":"المستودع","consumedQty":"الكمية المستهلكة","availableStock":"المخزون المتاح","totalValue":"إجمالي القيمة","action":"الإجراء","open":"مفتوح","autoGenerated":"يُنشأ تلقائياً","updating":"جاري التحديث...","submitting":"جاري الإرسال...","updateFeedback":"تحديث التقييم","submitFeedback":"إرسال التقييم","editRating":"تعديل التقييم","saveSelection":"حفظ التحديد"}}`),R$={title:"صيانة الأصول",maintenanceLogs:"سجلات الصيانة",maintenanceDetails:"تفاصيل الصيانة",addMaintenance:"إضافة صيانة جديدة",listTotal:"الإجمالي: {{count}} سجل صيانة{{count !== 1 ? '' : ''}}",apiNotAvailable:"واجهة صيانة الأصول غير متاحة",apiNotDeployed:"لم يتم نشر نقطة نهاية واجهة صيانة الأصول بعد.",tryCreatingNew:"جرب الإنشاء (تجريبي)",deletedSuccessfully:"تم حذف فريق الصيانة بنجاح!",status:{planned:"مخطط",completed:"مكتمل",overdue:"متأخر",cancelled:"ملغى"},maintenanceTeam:"فريق الصيانة",newMaintenanceTeam:"فريق صيانة جديد",teamId:"معرف الفريق",teamName:"اسم الفريق",managerEmail:"بريد المشرف",managerName:"اسم المشرف",expertise:"الاختصاص",selectTeam:"اختر الفريق",viewDetails:"عرض التفاصيل",editTeam:"تعديل الفريق",duplicateTeam:"نسخ الفريق",deleteTeam:"حذف الفريق",selectHospital:"اختر المستشفى",selectExpertise:"اختر الاختصاص",selectManager:"اختر المشرف",enterTeamName:"أدخل اسم الفريق",teamInformation:"معلومات الفريق",selectUser:"اختر المستخدم",selectRole:"اختر الدور",totalMembers:"إجمالي الأعضاء",teamSummary:"ملخص الفريق",addFirstMember:"أضف العضو الأول",manager:"بريد المشرف",loadingTeams:"جاري تحميل فرق الصيانة...",errorLoadingTeams:"خطأ في تحميل فرق الصيانة",deleteConfirmMessage:"هل أنت متأكد من حذف فريق الصيانة هذا؟ لا يمكن التراجع عن هذا الإجراء.",team:"الفريق",deleteTeamButton:"حذف الفريق",listTitle:"فرق الصيانة",statsTotalTeams:"إجمالي الفرق",statsManagers:"المديرون",statsHospitals:"المستشفيات",export:{title:"تصدير فرق الصيانة",selectData:"اختر البيانات للتصدير",selectedRows:"الصفوف المحددة",selectedCount:"تصدير {{count}} فريق صيانة محدد",currentPage:"الصفحة الحالية",currentPageCount:"تصدير {{count}} فريق صيانة في الصفحة الحالية",allWithFilters:"جميع السجلات (مع المرشحات الحالية)",allWithFiltersCount:"تصدير كل {{count}} فريق صيانة مطابق للمرشحات",exportFormat:"تنسيق التصدير",csv:"CSV",csvDesc:"قيم مفصولة بفواصل",excel:"Excel",excelDesc:"جدول XLSX",columnsToExport:"الأعمدة للتصدير",selectAll:"تحديد الكل",resetToDefault:"إعادة إلى الافتراضي",columnsSelected:"{{count}} عمود محدد",exporting:"جاري التصدير...",exportButton:"تصدير",exportingSelected:"تصدير {{count}} صف محدد",exportingPage:"تصدير {{count}} صف من الصفحة الحالية",exportingAll:"تصدير كل {{count}} صف"}},F$={title:"الصيانة الوقائية",ppmDetails:"تفاصيل الصيانة الوقائية",addPPM:"إضافة صيانة وقائية جديدة",periodicity:"الدورية",dueDate:"تاريخ الاستحقاق",manageSchedules:"إدارة الجداول",pmId:"معرف الصيانة الوقائية",name:"الاسم",manufacturer:"الشركة المصنعة",listTotal:"الإجمالي: {{count}} جدول صيانة وقائية{{count !== 1 ? '' : ''}}",searchPlaceholder:"ابحث بالمعرف أو الأصل أو الشركة...",filterByCompany:"تصفية حسب الشركة",company:"الشركة",asset:"الأصل",assetType:"نوع الأصل",frequency:"التكرار",noOfPMs:"عدد الصيانات الوقائية",totalAmount:"المبلغ الإجمالي",apiNotAvailable:"واجهة الصيانة الوقائية غير متاحة",apiNotDeployed:"لم يتم نشر نقطة نهاية واجهة الصيانة الوقائية بعد.",tryCreatingNew:"جرب الإنشاء (تجريبي)",deletedSuccessfully:"تم حذف جدول الصيانة الوقائية بنجاح!",noSchedulesFound:"لم يتم العثور على جداول صيانة وقائية",createFirstSchedule:"أنشئ أول جدول صيانة وقائية",confirmDelete:"تأكيد الحذف",deleteConfirmMessage:"هل أنت متأكد من حذف جدول الصيانة الوقائية هذا؟ لا يمكن التراجع عن هذا الإجراء.",detail:{duplicateSchedule:"نسخ جدول الصيانة الوقائية",newSchedule:"جدول صيانة وقائية جديد",scheduleDetails:"تفاصيل جدول الصيانة الوقائية",basicInformation:"المعلومات الأساسية",financialInformation:"المعلومات المالية",scheduleInformation:"معلومات الجدول",maintenanceTeam:"فريق الصيانة",numberOfPMs:"عدد الصيانات الوقائية",pricePerPM:"السعر لكل صيانة وقائية",frequencyPlaceholder:"مثال: شهري، ربع سنوي، سنوي",scheduleInfoAfterCreation:"ستظهر معلومات الجدول بعد الإنشاء",assetName:"اسم الأصل",pleaseEnterAssetName:"يرجى إدخال اسم الأصل",duplicatedSuccessfully:"تم نسخ جدول الصيانة الوقائية بنجاح!",createdSuccessfully:"تم إنشاء جدول الصيانة الوقائية بنجاح!",updatedSuccessfully:"تم تحديث جدول الصيانة الوقائية بنجاح!",failedToSave:"فشل الحفظ",saveChanges:"حفظ التغييرات",loadingSchedule:"جاري تحميل جدول الصيانة الوقائية...",backToSchedules:"العودة إلى جداول الصيانة الوقائية",errorLoading:"خطأ"}},M$={listTitle:"جداول الصيانة الوقائية",export:{title:"تصدير جداول الصيانة الوقائية",selectData:"نطاق التصدير",selectedRows:"الصفوف المحددة",selectedCount:"تصدير {{count}} جدول{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}",currentPage:"الصفحة الحالية",currentPageCount:"تصدير {{count}} جدول{{count !== 1 ? 'اً' : ''}} في الصفحة الحالية",allWithFilters:"جميع السجلات (مع الفلاتر الحالية)",allWithFiltersCount:"تصدير جميع {{count}} جدول{{count !== 1 ? 'اً' : ''}} المطابقة للفلاتر الحالية",csvDesc:"قيم مفصولة بفاصلة",excelDesc:"جدول XLSX",columnsToExport:"الأعمدة للتصدير",selectAll:"تحديد الكل",resetToDefault:"إعادة التعيين للافتراضي",columnsSelected:"{{count}} عمود{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}",exporting:"جاري التصدير...",exportButton:"تصدير",exportingSelected:"جاري تصدير {{count}} صف{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}",exportingPage:"جاري تصدير {{count}} صف{{count !== 1 ? 'اً' : ''}} من الصفحة الحالية",exportingAll:"جاري تصدير جميع {{count}} صف{{count !== 1 ? 'اً' : ''}}"}},L$={title:"تصدير",whatToExport:"ما الذي سيتم تصديره",selectedRows:"الصفوف المحددة",currentPage:"الصفحة الحالية",allWithFilters:"الكل مع المرشحات",exportSelected:"تصدير {count} محدد",exportPage:"تصدير {count} في الصفحة الحالية",exportAll:"تصدير الكل {count}",columnsToExport:"الأعمدة للتصدير",selectAll:"تحديد الكل",selectDefault:"تحديد الافتراضي",exporting:"جاري التصدير...",exportingSelected:"جاري تصدير {count} صف(وف) محدد(ة)",exportingPage:"جاري تصدير {count} صف(وف) من الصفحة الحالية",exportingAll:"جاري تصدير جميع {count} صف(وف)",selected:"محدد",rows:"صفوف"},I$={title:"الأصناف",itemDetails:"تفاصيل الصنف",newItem:"صنف جديد",addItem:"إضافة صنف جديد",itemId:"معرف الصنف",itemCode:"كود الصنف",itemName:"اسم الصنف",itemGroup:"مجموعة الأصناف",stockUOM:"وحدة المخزون",partDescription:"وصف القطعة",brand:"العلامة التجارية",valuationRate:"معدل التقييم",openingStock:"رصيد الافتتاح",lastCalibrationDate:"تاريخ المعايرة الأخير",nextCalibrationDate:"تاريخ المعايرة القادم",selectItem:"اختر الصنف",selectItemGroup:"اختر مجموعة الأصناف",selectHospital:"اختر المستشفى",serialNo:"الرقم التسلسلي",dateIn:"تاريخ الدخول",watts:"واط",volts:"فولت",type:"النوع",code:"الرمز",viewDetails:"عرض التفاصيل",editItem:"تعديل الصنف",duplicateItem:"نسخ الصنف",deleteItem:"حذف الصنف",basicInformation:"المعلومات الأساسية",inventoryDetails:"تفاصيل المخزون",stockInformation:"معلومات المخزون",isStockItem:"صنف مخزني",isFixedAsset:"أصل ثابت",balanceQty:"الرصيد",calibrationInformation:"معلومات المعايرة",additionalInformation:"معلومات إضافية",refreshBalanceQty:"تحديث الرصيد",warrantyMonths:"الضمان (بالأشهر)",errorLoadingItems:"خطأ في تحميل الأصناف",loadingItems:"جاري تحميل الأصناف...",deleteConfirmMessage:"هل أنت متأكد من حذف هذا الصنف؟ لا يمكن التراجع عن هذا الإجراء.",backToInventory:"العودة إلى المخزون",loadingItem:"جاري تحميل الصنف...",errorLoadingItem:"خطأ في تحميل الصنف",createNewItem:"إنشاء صنف جديد",itemCodeLabel:"كود الصنف",itemUpdatedSuccessfully:"تم تحديث الصنف بنجاح!",pleaseSaveFirst:"يرجى حفظ الصنف أولاً قبل الإرسال.",submittedSuccessfully:"تم إرسال الصنف بنجاح!",failedToSave:"فشل الحفظ",failedToSubmit:"فشل الإرسال",noItemsFound:"لم يتم العثور على عناصر",createFirstItem:"أنشئ عنصرك الأول",listTitle:"المخزون",listTotal:"الإجمالي: {{count}} عنصر{{count !== 1 ? 'اً' : ''}}",failedToLoadItems:"فشل تحميل العناصر.",listAddItem:"إضافة عنصر",export:{title:"تصدير العناصر",selectData:"اختر البيانات للتصدير",selectedRows:"الصفوف المحددة",selectedCount:"تصدير {{count}} عنصر{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}",currentPage:"الصفحة الحالية",currentPageCount:"تصدير {{count}} عنصر{{count !== 1 ? 'اً' : ''}} في الصفحة الحالية",allWithFilters:"جميع السجلات (مع الفلاتر الحالية)",allWithFiltersCount:"تصدير جميع {{count}} عنصر{{count !== 1 ? 'اً' : ''}} المطابقة للفلاتر الحالية",csvDesc:"قيم مفصولة بفاصلة",excelDesc:"جدول XLSX",columnsToExport:"الأعمدة للتصدير",selectAll:"تحديد الكل",resetToDefault:"إعادة التعيين للافتراضي",columnsSelected:"{{count}} عمود{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}",exporting:"جاري التصدير...",exportButton:"تصدير",exportingSelected:"جاري تصدير {{count}} صف{{count !== 1 ? 'اً' : ''}} محدد{{count !== 1 ? 'ة' : ''}}",exportingPage:"جاري تصدير {{count}} صف{{count !== 1 ? 'اً' : ''}} من الصفحة الحالية",exportingAll:"جاري تصدير جميع {{count}} صف{{count !== 1 ? 'اً' : ''}}"}},z$={title:"التذاكر",issueDetails:"تفاصيل التذكرة",newIssue:"تذكرة جديدة",addIssue:"إضافة تذكرة جديدة",issueId:"معرف التذكرة",subject:"الموضوع",raisedBy:"أُبلغ بها",contact:"جهة الاتصال",issueType:"نوع التذكرة",openingDate:"تاريخ الفتح",resolutionDate:"تاريخ الحل",resolvedBy:"تم الحل بواسطة",firstRespondedOn:"أول رد في",resolutionDetails:"تفاصيل الحل",selectIssue:"اختر التذكرة",allPriorities:"أي أولوية",allCompanies:"جميع الشركات",viewDetails:"عرض التفاصيل",editIssue:"تعديل التذكرة",deleteIssue:"حذف التذكرة",enterSubject:"أدخل موضوع التذكرة",selectPriority:"اختر الأولوية",selectIssueType:"اختر نوع التذكرة",describeIssue:"صف التذكرة بالتفصيل...",contactInformation:"معلومات الاتصال",createNewIssue:"إنشاء تذكرة دعم جديدة",resolution:"الحل",describeResolution:"صف كيف تم حل التذكرة...",selectCompany:"اختر الشركة",statusInformation:"معلومات الحالة",currentStatus:"الحالة الحالية",timeline:"الجدول الزمني",loadingIssues:"جاري تحميل التذاكر...",errorLoadingIssues:"خطأ في تحميل التذاكر",deleteConfirmMessage:"هل أنت متأكد من حذف هذه التذكرة؟ لا يمكن التراجع عن هذا الإجراء.",deletedSuccessfully:"تم حذف التذكرة بنجاح!",listTitle:"تذاكر الدعم",listTotal:"الإجمالي",listSelected:"محدد",statsTotalIssues:"إجمالي التذاكر",statsOpen:"مفتوحة",statsResolved:"محلولة",statsClosed:"مغلقة",export:{title:"تصدير التذاكر",selectData:"اختر البيانات للتصدير",selectedRows:"الصفوف المحددة",selectedCount:"تصدير {{count}} تذكرة محددة",currentPage:"الصفحة الحالية",currentPageCount:"تصدير {{count}} تذكرة في الصفحة الحالية",allWithFilters:"جميع السجلات (مع المرشحات الحالية)",allWithFiltersCount:"تصدير كل {{count}} تذكرة مطابقة للمرشحات",exportFormat:"تنسيق التصدير",csv:"CSV",csvDesc:"قيم مفصولة بفواصل",excel:"Excel",excelDesc:"جدول XLSX",columnsToExport:"الأعمدة للتصدير",selectAll:"تحديد الكل",resetToDefault:"إعادة إلى الافتراضي",columnsSelected:"{{count}} عمود محدد",exporting:"جاري التصدير...",exportButton:"تصدير",exportingSelected:"تصدير {{count}} صف محدد",exportingPage:"تصدير {{count}} صف من الصفحة الحالية",exportingAll:"تصدير كل {{count}} صف"},status:{open:"مفتوحة",replied:"تم الرد",on_hold:"قيد الانتظار",resolved:"محلولة",closed:"مغلقة"},priority:{low:"منخفضة",medium:"متوسطة",high:"عالية",critical:"حرجة"}},B$={title:"المستخدمون",userDetails:"تفاصيل المستخدم",newUser:"مستخدم جديد",addUser:"إضافة مستخدم جديد",searchUsers:"بحث عن مستخدمين...",manageUsers:"إدارة حسابات المستخدمين والصلاحيات",noUsersFound:"لم يتم العثور على مستخدمين",tryAdjustingSearch:"حاول تعديل مصطلحات البحث.",noUsersAvailable:"لا يوجد مستخدمون متاحون.",backToDashboard:"العودة إلى لوحة التحكم",refresh:"تحديث",active:"نشط",inactive:"غير نشط",noEmail:"لا يوجد بريد إلكتروني",created:"تاريخ الإنشاء"},$$={title:"الفعاليات",eventDetails:"تفاصيل الفعالية",newEvent:"فعالية جديدة",addEvent:"إضافة فعالية",upcomingEvents:"الفعاليات القادمة",eventsFromFrappe:"فعاليات من نظام Frappe",noEventsFound:"لم يتم العثور على فعاليات",noEventsScheduled:"لا توجد فعاليات مجدولة حالياً.",refreshEvents:"تحديث الفعاليات"},U$={previous:"السابق",next:"التالي",goTo:"انتقل إلى",go:"انتقال",page:"صفحة",showingToOf:"عرض {{start}} إلى {{end}} من {{total}} {{label}}",showingTo:"عرض {{start}} إلى {{end}} {{label}}",items:"أصناف",assets:"أصول",workOrders:"أوامر عمل",issues:"تذاكر",teams:"فرق",inspections:"عمليات تفتيش",plans:"خطط"},H$={loading:"جاري التحميل...",noResultsFound:"لم يتم العثور على نتائج",createNewDoctype:"إنشاء {{doctype}} جديد",selectLabel:"اختر {{label}}"},q$={loadingSupportPlans:"جاري تحميل خطط الدعم...",errorLoadingSupportPlans:"خطأ في تحميل خطط الدعم",deleteConfirmMessage:"هل أنت متأكد من حذف خطة الدعم هذه؟ لا يمكن التراجع عن هذا الإجراء.",planId:"معرف الخطة",deletedSuccessfully:"تم حذف خطة الدعم بنجاح!",deleteSupportPlan:"حذف خطة الدعم",noSupportPlansFound:"لم يتم العثور على خطط دعم",createFirstSupportPlan:"أنشئ أول خطة دعم",table:{planName:"اسم الخطة",type:"النوع",frequency:"التكرار",contractValue:"قيمة العقد",warrantyStatus:"حالة الضمان",contractStatus:"حالة العقد"},status:{active:"نشط",expired:"منتهي",pending:"قيد الانتظار",terminated:"منتهي مبكرًا"},statusLabel:{warrantyPrefix:"ض:",contractPrefix:"ع:"},viewDetails:"عرض خطة الدعم",editSupportPlan:"تعديل خطة الدعم",listTitle:"خطط الدعم",statsTotalPlans:"إجمالي الخطط",statsContracts:"العقود",statsWarranties:"الضمانات",statsActive:"نشطة",export:{title:"تصدير خطط الدعم",selectData:"اختر البيانات للتصدير",selectedRows:"الصفوف المحددة",selectedCount:"تصدير {{count}} خطة دعم محددة",currentPage:"الصفحة الحالية",currentPageCount:"تصدير {{count}} خطة دعم في الصفحة الحالية",allWithFilters:"جميع السجلات (مع المرشحات الحالية)",allWithFiltersCount:"تصدير كل {{count}} خطة دعم مطابقة للمرشحات",exportFormat:"تنسيق التصدير",csv:"CSV",csvDesc:"قيم مفصولة بفواصل",excel:"Excel",excelDesc:"جدول XLSX",columnsToExport:"الأعمدة للتصدير",selectAll:"تحديد الكل",resetToDefault:"إعادة إلى الافتراضي",columnsSelected:"{{count}} عمود محدد",exporting:"جاري التصدير...",exportButton:"تصدير",exportingSelected:"تصدير {{count}} صف محدد",exportingPage:"تصدير {{count}} صف من الصفحة الحالية",exportingAll:"تصدير كل {{count}} صف"}},W$={title:"عمليات التفتيش",loadingInspections:"جاري تحميل عمليات التفتيش...",errorLoadingInspections:"خطأ في تحميل عمليات التفتيش",deleteConfirmMessage:"هل أنت متأكد من حذف عملية التفتيش هذه؟ لا يمكن التراجع عن هذا الإجراء.",inspectionId:"معرف التفتيش",deleteInspection:"حذف التفتيش",deletedSuccessfully:"تم حذف التفتيش بنجاح!",noInspectionsFound:"لم يتم العثور على عمليات تفتيش",createFirstInspection:"أنشئ أول عملية تفتيش",type:"نوع التفتيش",workflowStateHeader:"حالة سير العمل",targetDate:"تاريخ الاستهداف",requestedBy:"طُلِبت بواسطة",linkedWorkOrder:"أمر العمل المرتبط",savedFilters:"المرشحات المحفوظة",newInspection:"تفتيش جديد",inspectionReport:"تقرير التفتيش",technicalDepartment:"القسم الفني",filterStatus:"الحالة",filterWorkflow:"سير العمل",filterType:"النوع",filterWorkOrder:"أمر العمل",filterDepartment:"القسم",selectWorkOrder:"اختر أمر العمل",selectDepartment:"اختر القسم",stats:{draft:"مسودة",pendingApproval:"بانتظار الموافقة",closed:"مغلقة"},status:{open:"مفتوحة",in_progress:"قيد التنفيذ",pending_review:"بانتظار المراجعة",closed:"مغلقة"},workflowState:{draft:"مسودة",sent_to_work_control:"مرسل إلى التحكم بالعمل",sent_to_technician:"مرسل إلى الفني",sent_to_supervisor:"مرسلة إلى المشرف",closed:"مغلقة"},typeMap:{inspection:"تفتيش",safety_inspection:"تفتيش سلامة"},viewDetails:"عرض التفاصيل",editInspection:"تعديل التفتيش",export:{title:"تصدير عمليات التفتيش",selectData:"اختر البيانات للتصدير",selectedRows:"الصفوف المحددة",selectedCount:"تصدير {{count}} عملية تفتيش محددة",currentPage:"الصفحة الحالية",currentPageCount:"تصدير {{count}} عملية تفتيش في الصفحة الحالية",allWithFilters:"جميع السجلات (مع المرشحات الحالية)",allWithFiltersCount:"تصدير كل {{count}} عملية تفتيش مطابقة للمرشحات",exportFormat:"تنسيق التصدير",csv:"CSV",csvDesc:"قيم مفصولة بفواصل",excel:"Excel",excelDesc:"جدول XLSX",columnsToExport:"الأعمدة للتصدير",selectAll:"تحديد الكل",resetToDefault:"إعادة إلى الافتراضي",columnsSelected:"{{count}} عمود محدد",exporting:"جاري التصدير...",exportButton:"تصدير",exportingSelected:"تصدير {{count}} صف محدد",exportingPage:"تصدير {{count}} صف من الصفحة الحالية",exportingAll:"تصدير كل {{count}} صف",inspectionId:"معرف التفتيش",inspectionType:"نوع التفتيش",status:"الحالة",workflowState:"حالة سير العمل",inspectionDate:"تاريخ التفتيش",targetClosureDate:"تاريخ الإغلاق المستهدف",requestedBy:"طُلِبت بواسطة",technicalDepartment:"القسم الفني",linkedWorkOrder:"أمر العمل المرتبط",observationNote:"ملاحظة الملاحظة",technicalResponse:"الرد الفني",createdOn:"تاريخ الإنشاء",modifiedOn:"تاريخ التعديل",createdBy:"أنشئ بواسطة"},detail:{loadingDetails:"جاري تحميل تفاصيل التفتيش...",errorLoading:"خطأ في تحميل التفتيش",backToList:"العودة إلى التفتيشات",newInspection:"تفتيش جديد",inspectionDetails:"تفاصيل التفتيش",createNewRecord:"إنشاء سجل تفتيش جديد",cancelInspection:"إلغاء التفتيش",cancelConfirmMessage:"هل أنت متأكد أنك تريد إلغاء هذا التفتيش؟ سيتم تمييز التفتيش كملغى ويمكنك حذفه بعد ذلك إذا لزم الأمر.",noGoBack:"لا، تراجع",yesCancel:"نعم، إلغاء",cancelling:"جاري الإلغاء...",selectType:"اختر النوع",workOrderType:"نوع أمر العمل",selectWorkOrderType:"اختر نوع أمر العمل",techniciansAvailable:"{{count}} فني/فنيين متاح لهذا النوع",selectDepartment:"اختر القسم",selectLocation:"اختر الموقع",extensionNo:"رقم الامتداد *",selectExtension:"اختر الامتداد",inspectionDate:"تاريخ التفتيش",targetClosureDate:"تاريخ الإغلاق المستهدف",cannotBeInPast:"لا يمكن أن يكون في الماضي",cannotBeEarlier:"لا يمكن أن يكون أقدم من تاريخ التفتيش أو في الماضي",openingAttachment:"مرفق الافتتاح",closingAttachment:"مرفق الإغلاق",uploading:"جاري الرفع...",uploadFile:"رفع ملف",uploadClosingFile:"رفع ملف الإغلاق",noAttachment:"لا يوجد مرفق",removeAttachment:"إزالة المرفق",assignmentInformation:"معلومات التعيين",requestedBy:"طُلِبت بواسطة",selectUser:"اختر المستخدم",technicalDepartment:"القسم الفني",assignedTechnician:"الفني المعيّن",selectTechnician:"اختر الفني",selectWOTypeFirst:"اختر نوع أمر العمل أولاً لتصفية الفنيين",noTechniciansForType:"لم يتم العثور على فنيين لهذا النوع من أمر العمل",notesAndResponse:"الملاحظات والرد",observationNote:"ملاحظة الملاحظة",placeholderObservation:"أدخل ملاحظات الملاحظة...",technicalResponse:"الرد الفني",placeholderTechnicalResponse:"أدخل الرد الفني...",linkedWorkOrder:"أمر العمل المرتبط",linkedCorrectiveWO:"أمر العمل التصحيحي المرتبط",readOnly:"للقراءة فقط",viewWorkOrder:"عرض أمر العمل",noLinkedWorkOrder:"لا يوجد أمر عمل مرتبط",workflowActions:"إجراءات سير العمل",workflowProgress:"تقدم سير العمل",workControl:"مراقبة العمل",technicianStep:"الفني",supervisorStep:"المشرف",draftStep:"مسودة",closedStep:"مغلق",statusInfo:"معلومات الحالة",documentStatus:"حالة المستند",woType:"نوع أمر العمل",assignedTo:"معيّن إلى",submitted:"مُرسل",cancelled:"ملغى",added:"مضاف:",removed:"مُزال:",modified:"مُعدّل:",items:"عنصر/عناصر",rows:"صف/صفوف",activityLog:"سجل النشاط",activityLogRefreshed:"تم تحديث سجل النشاط",refreshActivityLog:"تحديث سجل النشاط",noChangesRecorded:"لم يتم تسجيل أي تغييرات بعد",createdThisInspection:"أنشأ هذا التفتيش",changedFrom:"تم التغيير من",documentUpdated:"تم تحديث المستند",showLess:"عرض أقل",showAll:"عرض الكل",department:"القسم",location:"الموقع",inspectionType:"نوع التفتيش",status:"الحالة",removeClosingAttachment:"إزالة مرفق الإغلاق",noClosingAttachment:"لا يوجد مرفق إغلاق",cancelledSuccessfully:"تم إلغاء التفتيش بنجاح!",failedToCancel:"فشل الإلغاء: {{error}}",failedToSave:"فشل الحفظ: {{error}}",failedToDelete:"فشل الحذف: {{error}}",targetClosureMandatory:"تاريخ الإغلاق المستهدف إلزامي للحفظ.",attachmentMandatory:"المرفق إلزامي للحفظ.",extensionMandatory:"رقم الامتداد إلزامي للحفظ.",createdSuccessfully:"تم إنشاء التفتيش بنجاح!",updatedSuccessfully:"تم تحديث التفتيش بنجاح!",deletedSuccessfully:"تم حذف التفتيش بنجاح!",inspectionDateInPast:"لا يمكن أن يكون تاريخ التفتيش في الماضي.",targetClosureEarlier:"لا يمكن أن يكون تاريخ الإغلاق المستهدف أقدم من تاريخ التفتيش.",targetClosureInPast:"لا يمكن أن يكون تاريخ الإغلاق المستهدف في الماضي.",fileSizeExceeds:"حجم الملف يتجاوز حد 10 ميجابايت",fileUploadedSuccess:"تم رفع الملف بنجاح",failedToUpload:"فشل رفع الملف",closingAttachmentRemoved:"تم إزالة مرفق الإغلاق",closingAttachmentUploadedSuccess:"تم رفع مرفق الإغلاق بنجاح",failedToUploadClosing:"فشل رفع مرفق الإغلاق",attachmentRemoved:"تم إزالة المرفق",systemManager:"مدير النظام",workflow:"سير العمل"}},V$={title:"الخريطة النشطة",loading:"جاري تحميل بيانات الخريطة...",hospital:"المستشفى",departmentWoType:"القسم (نوع أمر العمل)",selectHospital:"اختر المستشفى",selectDepartment:"اختر القسم",clearDepartmentHint:"مسح القسم للتصفية حسب المستشفى",clearHospitalHint:"مسح المستشفى للتصفية حسب القسم",clearFilters:"مسح المرشحات",legendHospital:"المستشفى",legendDepartment:"القسم (نوع أمر العمل)",legendHasUrgent:"يوجد أوامر عمل عاجلة",totalAssets:"إجمالي الأصول",workOrderStatus:"حالة أمر العمل",status:"الحالة",count:"العدد",normal:"عادي",urgent:"عاجل",open:"مفتوح",workInProgress:"قيد التنفيذ",pendingReview:"بانتظار المراجعة",completed:"مكتمل",closed:"مغلق",preventiveMaintenance:"الصيانة الوقائية",planned:"مخطط",overdue:"متأخر",viewAssets:"عرض الأصول",viewWorkOrders:"عرض أوامر العمل",viewAllWorkOrders:"عرض جميع أوامر العمل",showingWorkOrdersByType:"عرض أوامر العمل حسب النوع",deptWoType:"القسم / نوع أمر العمل",tooltipDept:"قسم",tooltipHospital:"مستشفى",tooltipUrgent:"عاجل! ",normalWos:"أوامر عادية:",urgentWos:"أوامر عاجلة:",closedWos:"أوامر مغلقة:",plannedPms:"صيانة مخطط لها:",completedPms:"صيانة مكتملة:",assets:"الأصول"},G$={title:"تقويم الصيانة",viewType:"نوع العرض",maintenanceLog:"سجل الصيانة",ppmPlanner:"مخطط الصيانة الوقائية",filters:"المرشحات",yearlyMap:"الخريطة السنوية",yearlyMapTitle:"عرض خريطة مخطط الصيانة الوقائية السنوية",mapShort:"خريطة",hospital:"المستشفى",selectHospital:"اختر المستشفى",department:"القسم",allDepartments:"جميع الأقسام",status:"الحالة",allStatuses:"جميع الحالات",planned:"مخطط",completed:"مكتمل",overdue:"متأخر",cancelled:"ملغى",assignedTo:"مكلف إلى",allTechnicians:"جميع الفنيين",clearFilters:"مسح المرشحات",months:{january:"يناير",february:"فبراير",march:"مارس",april:"أبريل",may:"مايو",june:"يونيو",july:"يوليو",august:"أغسطس",september:"سبتمبر",october:"أكتوبر",november:"نوفمبر",december:"ديسمبر"},days:{sun:"الأحد",mon:"الإثنين",tue:"الثلاثاء",wed:"الأربعاء",thu:"الخميس",fri:"الجمعة",sat:"السبت"},previousMonth:"الشهر السابق",today:"اليوم",nextMonth:"الشهر التالي",loadingLogs:"جاري تحميل سجلات الصيانة...",loadingPpm:"جاري تحميل مخططات الصيانة الوقائية...",overdueInTooltip:"(متأخر)",clickToViewDetails:"انقر لعرض التفاصيل",clickToViewPpmPlanner:"انقر لعرض مخطط الصيانة الوقائية",ppmPlannerDefault:"مخطط الصيانة الوقائية",legendCompleted:"مكتمل",legendPlanned:"مخطط",legendOverdue:"متأخر",legendToday:"اليوم",summaryPpmPlanners:"مخططات الصيانة الوقائية"},K$={common:_$,sidebar:k$,projects:S$,profile:N$,login:C$,dashboard:T$,commonFields:E$,filters:A$,listPages:O$,assets:P$,workOrders:D$,maintenance:R$,ppm:F$,ppmPlanner:M$,exportModal:L$,items:I$,issues:z$,users:B$,events:$$,pagination:U$,linkField:H$,supportPlans:q$,inspections:W$,activeMap:V$,maintenanceCalendarPage:G$},Ad={BASE_URL:"http://172.25.161.96:8000",ENDPOINTS:{LOGIN:"/api/method/login",RESET_PASSWORD:"/api/method/frappe.core.doctype.user.user.reset_password",LOGOUT:"/api/method/logout",CSRF_TOKEN:"/api/method/frappe.sessions.get_csrf_token",TWO_FACTOR_STATUS:"/api/method/project_management.api.two_factor.get_two_factor_status",UPLOAD_FILE:"/api/method/upload_file",GET_USER_PERMISSIONS:"/api/method/asset_lite.api.userperm_api.get_user_permissions",GET_PERMISSION_FILTERS:"/api/method/asset_lite.api.userperm_api.get_permission_filters",GET_ALLOWED_VALUES:"/api/method/asset_lite.api.userperm_api.get_allowed_values",CHECK_DOCUMENT_ACCESS:"/api/method/asset_lite.api.userperm_api.check_document_access",GET_CONFIGURED_DOCTYPES:"/api/method/asset_lite.api.userperm_api.get_configured_doctypes",GET_USER_DEFAULTS:"/api/method/asset_lite.api.userperm_api.get_user_defaults"},DEFAULT_HEADERS:{"Content-Type":"application/json",Accept:"application/json"},TIMEOUT:parseInt("60000")};class Y${constructor(){xn(this,"baseURL");xn(this,"endpoints");xn(this,"defaultHeaders");xn(this,"timeout");this.baseURL=Ad.BASE_URL,this.endpoints=Ad.ENDPOINTS,this.defaultHeaders=Ad.DEFAULT_HEADERS,this.timeout=Ad.TIMEOUT}getCSRFToken(){return fe(this,null,function*(){try{if(typeof window!="undefined"&&window.csrf_token)return window.csrf_token;if(!localStorage.getItem("user"))return null;const r=yield fetch(`${this.baseURL}${this.endpoints.CSRF_TOKEN}`,{method:"GET",headers:{Accept:"application/json"},credentials:"include"});return r.ok&&(yield r.json()).message||null}catch(t){return null}})}apiCall(a){return fe(this,arguments,function*(t,r={}){const s=`${this.baseURL}${t}`,i=ee({method:"GET",headers:ee(ee({},this.defaultHeaders),r.headers)},r),l=yield this.getCSRFToken();l&&(i.headers["X-Frappe-CSRF-Token"]=l);try{const u=new AbortController,d=setTimeout(()=>u.abort(),this.timeout),f=yield fetch(s,Se(ee({},i),{signal:u.signal}));if(clearTimeout(d),!f.ok){const m=yield f.json().catch(()=>({}));throw new oi(m.error||`HTTP error! status: ${f.status}`,f.status)}const p=yield f.json();return p.message!==void 0?p.message:p}catch(u){throw u instanceof Error?(console.error("API call failed:",u),new oi(u.message)):u}})}parseFrappeLoginError(t,r){if(typeof t.message=="string"&&t.message)return t.message;if(typeof t.exc=="string"&&t.exc){const a=t.exc.match(/:\s*(.+)$/);return a?a[1].trim():t.exc}if(t._server_messages)try{const i=JSON.parse(String(t._server_messages)).map(l=>JSON.parse(l)).map(l=>l.message).filter(Boolean).join(" ");if(i)return i}catch(a){}return r===401?"Invalid credentials or verification code.":"Login failed. Please try again."}parseLoggedInUser(t,r){return typeof t.message=="string"&&t.message==="Logged In"?{full_name:t.full_name,user_id:t.user||r,home_page:t.home_page,sid:t.sid,email:r}:t.message&&typeof t.message=="object"?t.message:t.full_name||t.user?{full_name:t.full_name,user_id:t.user||r,home_page:t.home_page,sid:t.sid,email:r}:null}postLoginRequest(t){return fe(this,null,function*(){const r=`${this.baseURL}${this.endpoints.LOGIN}`,a=new AbortController,s=setTimeout(()=>a.abort(),this.timeout);try{const i=yield fetch(r,{method:"POST",headers:{Accept:"application/json"},body:t,credentials:"include",signal:a.signal}),l=yield i.text();let u={};try{u=l?JSON.parse(l):{}}catch(d){u={}}if(!i.ok){const d=i.status===401?"Invalid credentials or verification code.":"Login failed. Please try again.";throw new oi(d,i.status)}return u}finally{clearTimeout(s)}})}mapLoginResponse(t,r){const a=t.verification,s=t.tmp_id,i=t.message;if(a&&s&&i!=="Logged In")return{status:"two_factor_required",tmp_id:s,verification:a};const l=this.parseLoggedInUser(t,r);if(l&&(i==="Logged In"||l.sid||l.user_id))return{status:"logged_in",user:l};throw new oi("Unexpected login response.",500,"INVALID_RESPONSE")}login(t){return fe(this,null,function*(){const r=new FormData;r.append("usr",t.email),r.append("pwd",t.password);const a=yield this.postLoginRequest(r);return this.mapLoginResponse(a,t.email)})}verifyLoginOtp(t,r){return fe(this,null,function*(){const a=new FormData;a.append("otp",r.trim()),a.append("tmp_id",t);const s=yield this.postLoginRequest(a),i=this.mapLoginResponse(s);if(i.status!=="logged_in")throw new oi("Verification failed. Please try again.",401,"OTP_FAILED");return i})}requestPasswordReset(t,r){return fe(this,null,function*(){const a=t.trim();if(!a)throw new oi("Email is required",400,"EMPTY_EMAIL");const s=yield this.getCSRFTokenForGuest(),i={Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"};s&&(i["X-Frappe-CSRF-Token"]=s);const l=`${this.baseURL}${this.endpoints.RESET_PASSWORD}`,u=new AbortController,d=setTimeout(()=>u.abort(),45e3),f=r?AbortSignal.any([r,u.signal]):u.signal;try{const p=yield fetch(l,{method:"POST",headers:i,body:new URLSearchParams({user:a}).toString(),credentials:"include",signal:f}),m=yield p.text();let x={};try{x=m?JSON.parse(m):{}}catch(b){x={}}const v=typeof x.message=="string"?x.message:typeof x.message=="object"&&x.message!==null&&"message"in x.message?String(x.message.message):"";if(p.status===404||v.toLowerCase().includes("not found"))throw new oi("User not found",404,"USER_NOT_FOUND");if(p.status===403)throw new oi("Could not send reset email",403,"FORBIDDEN");if(!p.ok)throw new oi(v||`HTTP error! status: ${p.status}`,p.status,"REQUEST_FAILED");if(v==="disabled"||v==="not allowed")throw new oi("Reset not allowed",200,"RESET_NOT_ALLOWED")}finally{clearTimeout(d)}})}getCSRFTokenForGuest(){return fe(this,null,function*(){const t=typeof window!="undefined"?window:void 0;if(t!=null&&t.csrf_token)return t.csrf_token;try{const r=yield fetch(`${this.baseURL}${this.endpoints.CSRF_TOKEN}`,{method:"GET",headers:{Accept:"application/json"},credentials:"include"});if(r.ok)return(yield r.json()).message||null}catch(r){}return null})}logout(){return fe(this,null,function*(){yield this.apiCall(this.endpoints.LOGOUT,{method:"POST"})})}getUserDetails(t){return fe(this,null,function*(){const r=t?`?user_id=${t}`:"";return this.apiCall(`${this.endpoints.USER_DETAILS}${r}`)})}getDoctypeRecords(t,r,a,s=20,i=0){return fe(this,null,function*(){const l=new URLSearchParams({doctype:t,limit:s.toString(),offset:i.toString()});return r&&l.append("filters",JSON.stringify(r)),a&&l.append("fields",JSON.stringify(a)),this.apiCall(`${this.endpoints.DOCTYPE_RECORDS}?${l}`)})}getDashboardStats(){return fe(this,null,function*(){return this.apiCall(this.endpoints.DASHBOARD_STATS)})}getNumberCards(){return fe(this,null,function*(){return this.apiCall(this.endpoints.DASHBOARD_NUMBER_CARDS)})}listDashboardCharts(t=!0){return fe(this,null,function*(){const r=new URLSearchParams({public_only:t?"1":"0"});return this.apiCall(`${this.endpoints.DASHBOARD_LIST_CHARTS}?${r}`)})}getDashboardChartData(t,r){return fe(this,null,function*(){const a=new URLSearchParams({chart_name:t});return r&&a.append("report_filters",JSON.stringify(r)),this.apiCall(`${this.endpoints.DASHBOARD_CHART_DATA}?${a}`)})}getKycDetails(){return fe(this,null,function*(){return this.apiCall(this.endpoints.KYC_DETAILS)})}uploadFile(t){return fe(this,null,function*(){const r=new FormData;return r.append("file",t.file),r.append("doctype",t.doctype),r.append("docname",t.docname),r.append("fieldname",t.fieldname),this.apiCall(this.endpoints.UPLOAD_FILE,{method:"POST",headers:{},body:r})})}getUserPermissions(t){return fe(this,null,function*(){const r=t?`?user=${encodeURIComponent(t)}`:"";return this.apiCall(`${this.endpoints.GET_USER_PERMISSIONS}${r}`)})}getPermissionFilters(t,r){return fe(this,null,function*(){const a=new URLSearchParams({target_doctype:t});return r&&a.append("user",r),this.apiCall(`${this.endpoints.GET_PERMISSION_FILTERS}?${a}`)})}getAllowedValues(t,r){return fe(this,null,function*(){const a=new URLSearchParams({allow_doctype:t});return r&&a.append("user",r),this.apiCall(`${this.endpoints.GET_ALLOWED_VALUES}?${a}`)})}checkDocumentAccess(t,r,a){return fe(this,null,function*(){const s=new URLSearchParams({doctype:t,docname:r});return a&&s.append("user",a),this.apiCall(`${this.endpoints.CHECK_DOCUMENT_ACCESS}?${s}`)})}getConfiguredDoctypes(){return fe(this,null,function*(){return this.apiCall(this.endpoints.GET_CONFIGURED_DOCTYPES)})}getUserDefaults(t){return fe(this,null,function*(){const r=t?`?user=${encodeURIComponent(t)}`:"";return this.apiCall(`${this.endpoints.GET_USER_DEFAULTS}${r}`)})}isAuthenticated(){return!!localStorage.getItem("frappe_session_id")}getSessionId(){return localStorage.getItem("frappe_session_id")}setSessionId(t){localStorage.setItem("frappe_session_id",t)}}class oi extends Error{constructor(r,a,s){super(r);xn(this,"status");xn(this,"code");this.name="ApiError",this.status=a,this.code=s}}const Ja=new Y$,Nm=Object.freeze(Object.defineProperty({__proto__:null,ApiError:oi,default:Ja},Symbol.toStringTag,{value:"Module"}));function X$(e){return fe(this,null,function*(){try{const t=yield Ja.getDoctypeRecords("Translation",{language:e},["source_text","translated_text","context"],1e4,0),r={};return t.records&&t.records.length>0&&t.records.forEach(a=>{const s=a.source_text,i=a.translated_text||s;if(a.context){const l=`${a.context}.${s}`;r[l]=i}else s.includes("."),r[s]=i}),r}catch(t){return console.error("Error fetching translations from Frappe:",t),{}}})}function J$(e){const t={};return Object.keys(e).forEach(r=>{if(r.includes(".")){const a=r.split(".");let s=t;for(let i=0;i<a.length-1;i++){const l=a[i];s[l]||(s[l]={}),s=s[l]}s[a[a.length-1]]=e[r]}else t[r]=e[r]}),t}function BC(e){return fe(this,null,function*(){const t=yield X$(e);return J$(t)})}Ra.use(EO).use(CB).init({resources:{en:{translation:j$},ar:{translation:K$}},fallbackLng:"en",defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});function Gf(){return fe(this,null,function*(){try{if(!localStorage.getItem("user"))return;const t=yield BC("en");Object.keys(t).length>0&&Ra.addResourceBundle("en","translation",t,!0,!0);const r=yield BC("ar");Object.keys(r).length>0&&Ra.addResourceBundle("ar","translation",r,!0,!0),console.log("✓ Translations loaded from Frappe")}catch(e){console.warn("⚠ Could not load translations from Frappe, using static translations:",e)}})}Ra.on("initialized",()=>{Gf()});var $C="popstate";function UC(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Q$(e={}){function t(a,s){var f;let i=(f=s.state)==null?void 0:f.masked,{pathname:l,search:u,hash:d}=i||a.location;return Dw("",{pathname:l,search:u,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default",i?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,s){return typeof s=="string"?s:nh(s)}return eU(t,r,null,e)}function Lr(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function Ws(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(r){}}}function Z$(){return Math.random().toString(36).substring(2,10)}function HC(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Dw(e,t,r=null,a,s){return Se(ee({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?l0(t):t),{state:r,key:t&&t.key||a||Z$(),mask:s})}function nh({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function l0(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function eU(e,t,r,a={}){let{window:s=document.defaultView,v5Compat:i=!1}=a,l=s.history,u="POP",d=null,f=p();f==null&&(f=0,l.replaceState(Se(ee({},l.state),{idx:f}),""));function p(){return(l.state||{idx:null}).idx}function m(){u="POP";let j=p(),k=j==null?null:j-f;f=j,d&&d({action:u,location:w.location,delta:k})}function x(j,k){u="PUSH";let C=UC(j)?j:Dw(w.location,j,k);f=p()+1;let N=HC(C,f),O=w.createHref(C.mask||C);try{l.pushState(N,"",O)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(O)}i&&d&&d({action:u,location:w.location,delta:1})}function v(j,k){u="REPLACE";let C=UC(j)?j:Dw(w.location,j,k);f=p();let N=HC(C,f),O=w.createHref(C.mask||C);l.replaceState(N,"",O),i&&d&&d({action:u,location:w.location,delta:0})}function b(j){return tU(s,j)}let w={get action(){return u},get location(){return e(s,l)},listen(j){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener($C,m),d=j,()=>{s.removeEventListener($C,m),d=null}},createHref(j){return t(s,j)},createURL:b,encodeLocation(j){let k=b(j);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:x,replace:v,go(j){return l.go(j)}};return w}function tU(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),Lr(a,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:nh(t);return s=s.replace(/ $/,"%20"),!r&&s.startsWith("//")&&(s=a+s),new URL(s,a)}function AO(e,t,r="/"){return rU(e,t,r,!1)}function rU(e,t,r,a,s){let i=typeof t=="string"?l0(t):t,l=Ro(i.pathname||"/",r);if(l==null)return null;let u=aU(e),d=null,f=mU(l);for(let p=0;d==null&&p<u.length;++p)d=hU(u[p],f,a);return d}function aU(e){let t=OO(e);return nU(t),t}function OO(e,t=[],r=[],a="",s=!1){let i=(l,u,d=s,f)=>{let p={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(a)&&d)return;Lr(p.relativePath.startsWith(a),`Absolute route path "${p.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(a.length)}let m=gi([a,p.relativePath]),x=r.concat(p);l.children&&l.children.length>0&&(Lr(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),OO(l.children,t,x,m,d)),!(l.path==null&&!l.index)&&t.push({path:m,score:dU(m,l.index),routesMeta:x})};return e.forEach((l,u)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))i(l,u);else for(let f of PO(l.path))i(l,u,!0,f)}),t}function PO(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(a.length===0)return s?[i,""]:[i];let l=PO(a.join("/")),u=[];return u.push(...l.map(d=>d===""?i:[i,d].join("/"))),s&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function nU(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:fU(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var sU=/^:[\w-]+$/,iU=3,oU=2,lU=1,cU=10,uU=-2,qC=e=>e==="*";function dU(e,t){let r=e.split("/"),a=r.length;return r.some(qC)&&(a+=uU),t&&(a+=oU),r.filter(s=>!qC(s)).reduce((s,i)=>s+(sU.test(i)?iU:i===""?lU:cU),a)}function fU(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function hU(e,t,r=!1){let{routesMeta:a}=e,s={},i="/",l=[];for(let u=0;u<a.length;++u){let d=a[u],f=u===a.length-1,p=i==="/"?t:t.slice(i.length)||"/",m=Eg({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},p),x=d.route;if(!m&&f&&r&&!a[a.length-1].route.index&&(m=Eg({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},p)),!m)return null;Object.assign(s,m.params),l.push({params:s,pathname:gi([i,m.pathname]),pathnameBase:vU(gi([i,m.pathnameBase])),route:x}),m.pathnameBase!=="/"&&(i=gi([i,m.pathnameBase]))}return l}function Eg(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=pU(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let i=s[0],l=i.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:a.reduce((f,{paramName:p,isOptional:m},x)=>{if(p==="*"){let b=u[x]||"";l=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const v=u[x];return m&&!v?f[p]=void 0:f[p]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:l,pattern:e}}function pU(e,t=!1,r=!0){Ws(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 a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d,f,p)=>{if(a.push({paramName:u,isOptional:d!=null}),d){let m=p.charAt(f+l.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function mU(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ws(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ro(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var gU=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function xU(e,t="/"){let{pathname:r,search:a="",hash:s=""}=typeof e=="string"?l0(e):e,i;return r?(r=DO(r),r.startsWith("/")?i=WC(r.substring(1),"/"):i=WC(r,t)):i=t,{pathname:i,search:bU(a),hash:wU(s)}}function WC(e,t){let r=Ag(t).split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function _b(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. 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 yU(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Gj(e){let t=yU(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Wx(e,t,r,a=!1){let s;typeof e=="string"?s=l0(e):(s=ee({},e),Lr(!s.pathname||!s.pathname.includes("?"),_b("?","pathname","search",s)),Lr(!s.pathname||!s.pathname.includes("#"),_b("#","pathname","hash",s)),Lr(!s.search||!s.search.includes("#"),_b("#","search","hash",s)));let i=e===""||s.pathname==="",l=i?"/":s.pathname,u;if(l==null)u=r;else{let m=t.length-1;if(!a&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),m-=1;s.pathname=x.join("/")}u=m>=0?t[m]:"/"}let d=xU(s,u),f=l&&l!=="/"&&l.endsWith("/"),p=(i||l===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(f||p)&&(d.pathname+="/"),d}var DO=e=>e.replace(/\/\/+/g,"/"),gi=e=>DO(e.join("/")),Ag=e=>e.replace(/\/+$/,""),vU=e=>Ag(e).replace(/^\/*/,"/"),bU=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wU=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,jU=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function _U(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function kU(e){let t=e.map(r=>r.route.path).filter(Boolean);return gi(t)||"/"}var RO=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function FO(e,t){let r=e;if(typeof r!="string"||!gU.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,s=!1;if(RO)try{let i=new URL(window.location.href),l=r.startsWith("//")?new URL(i.protocol+r):new URL(r),u=Ro(l.pathname,t);l.origin===i.origin&&u!=null?r=u+l.search+l.hash:s=!0}catch(i){Ws(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var MO=["POST","PUT","PATCH","DELETE"];new Set(MO);var SU=["GET",...MO];new Set(SU);var c0=y.createContext(null);c0.displayName="DataRouter";var Vx=y.createContext(null);Vx.displayName="DataRouterState";var LO=y.createContext(!1);function NU(){return y.useContext(LO)}var IO=y.createContext({isTransitioning:!1});IO.displayName="ViewTransition";var CU=y.createContext(new Map);CU.displayName="Fetchers";var TU=y.createContext(null);TU.displayName="Await";var ys=y.createContext(null);ys.displayName="Navigation";var Oh=y.createContext(null);Oh.displayName="Location";var bi=y.createContext({outlet:null,matches:[],isDataRoute:!1});bi.displayName="Route";var Kj=y.createContext(null);Kj.displayName="RouteError";var zO="REACT_ROUTER_ERROR",EU="REDIRECT",AU="ROUTE_ERROR_RESPONSE";function OU(e){if(e.startsWith(`${zO}:${EU}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch(t){}}function PU(e){if(e.startsWith(`${zO}:${AU}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new jU(t.status,t.statusText,t.data)}catch(t){}}function DU(e,{relative:t}={}){Lr(u0(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=y.useContext(ys),{hash:s,pathname:i,search:l}=Ph(e,{relative:t}),u=i;return r!=="/"&&(u=i==="/"?r:gi([r,i])),a.createHref({pathname:u,search:l,hash:s})}function u0(){return y.useContext(Oh)!=null}function vs(){return Lr(u0(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Oh).location}var BO="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function $O(e){y.useContext(ys).static||y.useLayoutEffect(e)}function Ut(){let{isDataRoute:e}=y.useContext(bi);return e?VU():RU()}function RU(){Lr(u0(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(c0),{basename:t,navigator:r}=y.useContext(ys),{matches:a}=y.useContext(bi),{pathname:s}=vs(),i=JSON.stringify(Gj(a)),l=y.useRef(!1);return $O(()=>{l.current=!0}),y.useCallback((d,f={})=>{if(Ws(l.current,BO),!l.current)return;if(typeof d=="number"){r.go(d);return}let p=Wx(d,JSON.parse(i),s,f.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:gi([t,p.pathname])),(f.replace?r.replace:r.push)(p,f.state,f)},[t,r,i,s,e])}y.createContext(null);function Hn(){var r;let{matches:e}=y.useContext(bi),t=e[e.length-1];return(r=t==null?void 0:t.params)!=null?r:{}}function Ph(e,{relative:t}={}){let{matches:r}=y.useContext(bi),{pathname:a}=vs(),s=JSON.stringify(Gj(r));return y.useMemo(()=>Wx(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function FU(e,t){return UO(e,t)}function UO(e,t,r){var j;Lr(u0(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=y.useContext(ys),{matches:s}=y.useContext(bi),i=s[s.length-1],l=i?i.params:{},u=i?i.pathname:"/",d=i?i.pathnameBase:"/",f=i&&i.route;{let k=f&&f.path||"";qO(u,!f||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=vs(),m;if(t){let k=typeof t=="string"?l0(t):t;Lr(d==="/"||((j=k.pathname)==null?void 0:j.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${k.pathname}" was given in the \`location\` prop.`),m=k}else m=p;let x=m.pathname||"/",v=x;if(d!=="/"){let k=d.replace(/^\//,"").split("/");v="/"+x.replace(/^\//,"").split("/").slice(k.length).join("/")}let b=r&&r.state.matches.length?r.state.matches.map(k=>Object.assign(k,{route:r.manifest[k.route.id]||k.route})):AO(e,{pathname:v});Ws(f||b!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Ws(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=BU(b&&b.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:gi([d,a.encodeLocation?a.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?d:gi([d,a.encodeLocation?a.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,r);return t&&w?y.createElement(Oh.Provider,{value:{location:ee({pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0},m),navigationType:"POP"}},w):w}function MU(){let e=WU(),t=_U(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},i={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:i},"ErrorBoundary")," or"," ",y.createElement("code",{style:i},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),r?y.createElement("pre",{style:s},r):null,l)}var LU=y.createElement(MU,null),HO=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=PU(e.digest);r&&(e=r)}let t=e!==void 0?y.createElement(bi.Provider,{value:this.props.routeContext},y.createElement(Kj.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(IU,{error:e},t):t}};HO.contextType=LO;var kb=new WeakMap;function IU({children:e,error:t}){let{basename:r}=y.useContext(ys);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=OU(t.digest);if(a){let s=kb.get(t);if(s)throw s;let i=FO(a.location,r);if(RO&&!kb.get(t))if(i.isExternal||a.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:a.replace}));throw kb.set(t,l),l}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function zU({routeContext:e,match:t,children:r}){let a=y.useContext(c0);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(bi.Provider,{value:e},r)}function BU(e,t=[],r){let a=r==null?void 0:r.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let s=e,i=a==null?void 0:a.errors;if(i!=null){let p=s.findIndex(m=>m.route.id&&(i==null?void 0:i[m.route.id])!==void 0);Lr(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),s=s.slice(0,Math.min(s.length,p+1))}let l=!1,u=-1;if(r&&a){l=a.renderFallback;for(let p=0;p<s.length;p++){let m=s[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=p),m.route.id){let{loaderData:x,errors:v}=a,b=m.route.loader&&!x.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||b){r.isStatic&&(l=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let d=r==null?void 0:r.onError,f=a&&d?(p,m)=>{var x,v,b;d(p,{location:a.location,params:(b=(v=(x=a.matches)==null?void 0:x[0])==null?void 0:v.params)!=null?b:{},pattern:kU(a.matches),errorInfo:m})}:void 0;return s.reduceRight((p,m,x)=>{let v,b=!1,w=null,j=null;a&&(v=i&&m.route.id?i[m.route.id]:void 0,w=m.route.errorElement||LU,l&&(u<0&&x===0?(qO("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,j=null):u===x&&(b=!0,j=m.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,x+1)),C=()=>{let N;return v?N=w:b?N=j:m.route.Component?N=y.createElement(m.route.Component,null):m.route.element?N=m.route.element:N=p,y.createElement(zU,{match:m,routeContext:{outlet:p,matches:k,isDataRoute:a!=null},children:N})};return a&&(m.route.ErrorBoundary||m.route.errorElement||x===0)?y.createElement(HO,{location:a.location,revalidation:a.revalidation,component:w,error:v,children:C(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:f}):C()},null)}function Yj(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $U(e){let t=y.useContext(c0);return Lr(t,Yj(e)),t}function UU(e){let t=y.useContext(Vx);return Lr(t,Yj(e)),t}function HU(e){let t=y.useContext(bi);return Lr(t,Yj(e)),t}function Xj(e){let t=HU(e),r=t.matches[t.matches.length-1];return Lr(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function qU(){return Xj("useRouteId")}function WU(){var a;let e=y.useContext(Kj),t=UU("useRouteError"),r=Xj("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function VU(){let{router:e}=$U("useNavigate"),t=Xj("useNavigate"),r=y.useRef(!1);return $O(()=>{r.current=!0}),y.useCallback((l,...u)=>fe(null,[l,...u],function*(s,i={}){Ws(r.current,BO),r.current&&(typeof s=="number"?yield e.navigate(s):yield e.navigate(s,ee({fromRouteId:t},i)))}),[e,t])}var VC={};function qO(e,t,r){!t&&!VC[e]&&(VC[e]=!0,Ws(!1,r))}y.memo(GU);function GU({routes:e,manifest:t,future:r,state:a,isStatic:s,onError:i}){return UO(e,void 0,{manifest:t,state:a,isStatic:s,onError:i})}function Ff({to:e,replace:t,state:r,relative:a}){Lr(u0(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=y.useContext(ys);Ws(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=y.useContext(bi),{pathname:l}=vs(),u=Ut(),d=Wx(e,Gj(i),l,a==="path"),f=JSON.stringify(d);return y.useEffect(()=>{u(JSON.parse(f),{replace:t,state:r,relative:a})},[u,f,a,t,r]),null}function $t(e){Lr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function KU({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:s,static:i=!1,useTransitions:l}){Lr(!u0(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=y.useMemo(()=>({basename:u,navigator:s,static:i,useTransitions:l,future:{}}),[u,s,i,l]);typeof r=="string"&&(r=l0(r));let{pathname:f="/",search:p="",hash:m="",state:x=null,key:v="default",mask:b}=r,w=y.useMemo(()=>{let j=Ro(f,u);return j==null?null:{location:{pathname:j,search:p,hash:m,state:x,key:v,mask:b},navigationType:a}},[u,f,p,m,x,v,a,b]);return Ws(w!=null,`<Router basename="${u}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(ys.Provider,{value:d},y.createElement(Oh.Provider,{children:t,value:w}))}function YU({children:e,location:t}){return FU(Rw(e),t)}function Rw(e,t=[]){let r=[];return y.Children.forEach(e,(a,s)=>{if(!y.isValidElement(a))return;let i=[...t,s];if(a.type===y.Fragment){r.push.apply(r,Rw(a.props.children,i));return}Lr(a.type===$t,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Lr(!a.props.index||!a.props.children,"An index route cannot have child routes.");let l={id:a.props.id||i.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(l.children=Rw(a.props.children,i)),r.push(l)}),r}var xg="get",yg="application/x-www-form-urlencoded";function Gx(e){return typeof HTMLElement!="undefined"&&e instanceof HTMLElement}function XU(e){return Gx(e)&&e.tagName.toLowerCase()==="button"}function JU(e){return Gx(e)&&e.tagName.toLowerCase()==="form"}function QU(e){return Gx(e)&&e.tagName.toLowerCase()==="input"}function ZU(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function eH(e,t){return e.button===0&&(!t||t==="_self")&&!ZU(e)}function Fw(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(s=>[r,s]):[[r,a]])},[]))}function tH(e,t){let r=Fw(e);return t&&t.forEach((a,s)=>{r.has(s)||t.getAll(s).forEach(i=>{r.append(s,i)})}),r}var Cm=null;function rH(){if(Cm===null)try{new FormData(document.createElement("form"),0),Cm=!1}catch(e){Cm=!0}return Cm}var aH=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sb(e){return e!=null&&!aH.has(e)?(Ws(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${yg}"`),null):e}function nH(e,t){let r,a,s,i,l;if(JU(e)){let u=e.getAttribute("action");a=u?Ro(u,t):null,r=e.getAttribute("method")||xg,s=Sb(e.getAttribute("enctype"))||yg,i=new FormData(e)}else if(XU(e)||QU(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||u.getAttribute("action");if(a=d?Ro(d,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||xg,s=Sb(e.getAttribute("formenctype"))||Sb(u.getAttribute("enctype"))||yg,i=new FormData(u,e),!rH()){let{name:f,type:p,value:m}=e;if(p==="image"){let x=f?`${f}.`:"";i.append(`${x}x`,"0"),i.append(`${x}y`,"0")}else f&&i.append(f,m)}}else{if(Gx(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=xg,a=null,s=yg,l=e}return i&&s==="text/plain"&&(l=i,i=void 0),{action:a,method:r.toLowerCase(),encType:s,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jj(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function WO(e,t,r,a){let s=typeof e=="string"?new URL(e,typeof window=="undefined"?"server://singlefetch/":window.location.origin):e;return r?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&Ro(s.pathname,t)==="/"?s.pathname=`${Ag(t)}/_root.${a}`:s.pathname=`${Ag(s.pathname)}.${a}`,s}function sH(e,t){return fe(this,null,function*(){if(e.id in t)return t[e.id];try{let r=yield import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}})}function iH(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}function oH(e,t,r){return fe(this,null,function*(){let a=yield Promise.all(e.map(s=>fe(null,null,function*(){let i=t.routes[s.route.id];if(i){let l=yield sH(i,r);return l.links?l.links():[]}return[]})));return dH(a.flat(1).filter(iH).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?Se(ee({},s),{rel:"prefetch",as:"style"}):Se(ee({},s),{rel:"prefetch"})))})}function GC(e,t,r,a,s,i){let l=(d,f)=>r[f]?d.route.id!==r[f].route.id:!0,u=(d,f)=>{var p;return r[f].pathname!==d.pathname||((p=r[f].route.path)==null?void 0:p.endsWith("*"))&&r[f].params["*"]!==d.params["*"]};return i==="assets"?t.filter((d,f)=>l(d,f)||u(d,f)):i==="data"?t.filter((d,f)=>{var m;let p=a.routes[d.route.id];if(!p||!p.hasLoader)return!1;if(l(d,f)||u(d,f))return!0;if(d.route.shouldRevalidate){let x=d.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((m=r[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function lH(e,t,{includeHydrateFallback:r}={}){return cH(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),r&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function cH(e){return[...new Set(e)]}function uH(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function dH(e,t){let r=new Set;return new Set(t),e.reduce((a,s)=>{let i=JSON.stringify(uH(s));return r.has(i)||(r.add(i),a.push({key:i,link:s})),a},[])}function Qj(){let e=y.useContext(c0);return Jj(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function fH(){let e=y.useContext(Vx);return Jj(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Zj=y.createContext(void 0);Zj.displayName="FrameworkContext";function e_(){let e=y.useContext(Zj);return Jj(e,"You must render this element inside a <HydratedRouter> element"),e}function hH(e,t){let r=y.useContext(Zj),[a,s]=y.useState(!1),[i,l]=y.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:f,onMouseLeave:p,onTouchStart:m}=t,x=y.useRef(null);y.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let w=k=>{k.forEach(C=>{l(C.isIntersecting)})},j=new IntersectionObserver(w,{threshold:.5});return x.current&&j.observe(x.current),()=>{j.disconnect()}}},[e]),y.useEffect(()=>{if(a){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[a]);let v=()=>{s(!0)},b=()=>{s(!1),l(!1)};return r?e!=="intent"?[i,x,{}]:[i,x,{onFocus:xf(u,v),onBlur:xf(d,b),onMouseEnter:xf(f,v),onMouseLeave:xf(p,b),onTouchStart:xf(m,v)}]:[!1,x,{}]}function xf(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function pH(r){var a=r,{page:e}=a,t=ti(a,["page"]);let s=NU(),{router:i}=Qj(),l=y.useMemo(()=>AO(i.routes,e,i.basename),[i.routes,e,i.basename]);return l?s?y.createElement(gH,ee({page:e,matches:l},t)):y.createElement(xH,ee({page:e,matches:l},t)):null}function mH(e){let{manifest:t,routeModules:r}=e_(),[a,s]=y.useState([]);return y.useEffect(()=>{let i=!1;return oH(e,t,r).then(l=>{i||s(l)}),()=>{i=!0}},[e,t,r]),a}function gH(a){var s=a,{page:e,matches:t}=s,r=ti(s,["page","matches"]);let i=vs(),{future:l}=e_(),{basename:u}=Qj(),d=y.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let f=WO(e,u,l.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,m=[];for(let x of t)typeof x.route.shouldRevalidate=="function"?p=!0:m.push(x.route.id);return p&&m.length>0&&f.searchParams.set("_routes",m.join(",")),[f.pathname+f.search]},[u,l.v8_trailingSlashAwareDataRequests,e,i,t]);return y.createElement(y.Fragment,null,d.map(f=>y.createElement("link",ee({key:f,rel:"prefetch",as:"fetch",href:f},r))))}function xH(a){var s=a,{page:e,matches:t}=s,r=ti(s,["page","matches"]);let i=vs(),{future:l,manifest:u,routeModules:d}=e_(),{basename:f}=Qj(),{loaderData:p,matches:m}=fH(),x=y.useMemo(()=>GC(e,t,m,u,i,"data"),[e,t,m,u,i]),v=y.useMemo(()=>GC(e,t,m,u,i,"assets"),[e,t,m,u,i]),b=y.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let k=new Set,C=!1;if(t.forEach(O=>{var A;let E=u.routes[O.route.id];!E||!E.hasLoader||(!x.some(T=>T.route.id===O.route.id)&&O.route.id in p&&((A=d[O.route.id])!=null&&A.shouldRevalidate)||E.hasClientLoader?C=!0:k.add(O.route.id))}),k.size===0)return[];let N=WO(e,f,l.v8_trailingSlashAwareDataRequests,"data");return C&&k.size>0&&N.searchParams.set("_routes",t.filter(O=>k.has(O.route.id)).map(O=>O.route.id).join(",")),[N.pathname+N.search]},[f,l.v8_trailingSlashAwareDataRequests,p,i,u,x,t,e,d]),w=y.useMemo(()=>lH(v,u),[v,u]),j=mH(v);return y.createElement(y.Fragment,null,b.map(k=>y.createElement("link",ee({key:k,rel:"prefetch",as:"fetch",href:k},r))),w.map(k=>y.createElement("link",ee({key:k,rel:"modulepreload",href:k},r))),j.map(({key:k,link:C})=>{var N;return y.createElement("link",Se(ee({key:k,nonce:r.nonce},C),{crossOrigin:(N=C.crossOrigin)!=null?N:r.crossOrigin}))}))}function yH(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var vH=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";try{vH&&(window.__reactRouterVersion="7.17.0")}catch(e){}function bH({basename:e,children:t,useTransitions:r,window:a}){let s=y.useRef();s.current==null&&(s.current=Q$({window:a,v5Compat:!0}));let i=s.current,[l,u]=y.useState({action:i.action,location:i.location}),d=y.useCallback(f=>{r===!1?u(f):y.startTransition(()=>u(f))},[r]);return y.useLayoutEffect(()=>i.listen(d),[i,d]),y.createElement(KU,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:r})}var VO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,t_=y.forwardRef(function(j,w){var k=j,{onClick:t,discover:r="render",prefetch:a="none",relative:s,reloadDocument:i,replace:l,mask:u,state:d,target:f,to:p,preventScrollReset:m,viewTransition:x,defaultShouldRevalidate:v}=k,b=ti(k,["onClick","discover","prefetch","relative","reloadDocument","replace","mask","state","target","to","preventScrollReset","viewTransition","defaultShouldRevalidate"]);let{basename:C,navigator:N,useTransitions:O}=y.useContext(ys),E=typeof p=="string"&&VO.test(p),A=FO(p,C);p=A.to;let T=DU(p,{relative:s}),P=vs(),D=null;if(u){let ce=Wx(u,[],P.mask?P.mask.pathname:"/",!0);C!=="/"&&(ce.pathname=ce.pathname==="/"?C:gi([C,ce.pathname])),D=N.createHref(ce)}let[z,G,V]=hH(a,b),ne=kH(p,{replace:l,mask:u,state:d,target:f,preventScrollReset:m,relative:s,viewTransition:x,defaultShouldRevalidate:v,useTransitions:O});function ge(ce){t&&t(ce),ce.defaultPrevented||ne(ce)}let Z=!(A.isExternal||i),U=y.createElement("a",Se(ee(ee({},b),V),{href:(Z?D:void 0)||A.absoluteURL||T,onClick:Z?ge:t,ref:yH(w,G),target:f,"data-discover":!E&&r==="render"?"true":void 0}));return z&&!E?y.createElement(y.Fragment,null,U,y.createElement(pH,{page:T})):U});t_.displayName="Link";var wH=y.forwardRef(function(m,p){var x=m,{"aria-current":t="page",caseSensitive:r=!1,className:a="",end:s=!1,style:i,to:l,viewTransition:u,children:d}=x,f=ti(x,["aria-current","caseSensitive","className","end","style","to","viewTransition","children"]);let v=Ph(l,{relative:f.relative}),b=vs(),w=y.useContext(Vx),{navigator:j,basename:k}=y.useContext(ys),C=w!=null&&EH(v)&&u===!0,N=j.encodeLocation?j.encodeLocation(v).pathname:v.pathname,O=b.pathname,E=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||(O=O.toLowerCase(),E=E?E.toLowerCase():null,N=N.toLowerCase()),E&&k&&(E=Ro(E,k)||E);const A=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let T=O===N||!s&&O.startsWith(N)&&O.charAt(A)==="/",P=E!=null&&(E===N||!s&&E.startsWith(N)&&E.charAt(N.length)==="/"),D={isActive:T,isPending:P,isTransitioning:C},z=T?t:void 0,G;typeof a=="function"?G=a(D):G=[a,T?"active":null,P?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let V=typeof i=="function"?i(D):i;return y.createElement(t_,Se(ee({},f),{"aria-current":z,className:G,ref:p,style:V,to:l,viewTransition:u}),typeof d=="function"?d(D):d)});wH.displayName="NavLink";var jH=y.forwardRef((w,b)=>{var j=w,{discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:s,state:i,method:l=xg,action:u,onSubmit:d,relative:f,preventScrollReset:p,viewTransition:m,defaultShouldRevalidate:x}=j,v=ti(j,["discover","fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition","defaultShouldRevalidate"]);let{useTransitions:k}=y.useContext(ys),C=CH(),N=TH(u,{relative:f}),O=l.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&VO.test(u),A=T=>{if(d&&d(T),T.defaultPrevented)return;T.preventDefault();let P=T.nativeEvent.submitter,D=(P==null?void 0:P.getAttribute("formmethod"))||l,z=()=>C(P||T.currentTarget,{fetcherKey:t,method:D,navigate:r,replace:s,state:i,relative:f,preventScrollReset:p,viewTransition:m,defaultShouldRevalidate:x});k&&r!==!1?y.startTransition(()=>z()):z()};return y.createElement("form",Se(ee({ref:b,method:O,action:N,onSubmit:a?d:A},v),{"data-discover":!E&&e==="render"?"true":void 0}))});jH.displayName="Form";function _H(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function GO(e){let t=y.useContext(c0);return Lr(t,_H(e)),t}function kH(e,{target:t,replace:r,mask:a,state:s,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:d,useTransitions:f}={}){let p=Ut(),m=vs(),x=Ph(e,{relative:l});return y.useCallback(v=>{if(eH(v,t)){v.preventDefault();let b=r!==void 0?r:nh(m)===nh(x),w=()=>p(e,{replace:b,mask:a,state:s,preventScrollReset:i,relative:l,viewTransition:u,defaultShouldRevalidate:d});f?y.startTransition(()=>w()):w()}},[m,p,x,r,a,s,t,e,i,l,u,d,f])}function dn(e){Ws(typeof URLSearchParams!="undefined","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(Fw(e)),r=y.useRef(!1),a=vs(),s=y.useMemo(()=>tH(a.search,r.current?null:t.current),[a.search]),i=Ut(),l=y.useCallback((u,d)=>{const f=Fw(typeof u=="function"?u(new URLSearchParams(s)):u);r.current=!0,i("?"+f,d)},[i,s]);return[s,l]}var SH=0,NH=()=>`__${String(++SH)}__`;function CH(){let{router:e}=GO("useSubmit"),{basename:t}=y.useContext(ys),r=qU(),a=e.fetch,s=e.navigate;return y.useCallback((u,...d)=>fe(null,[u,...d],function*(i,l={}){let{action:f,method:p,encType:m,formData:x,body:v}=nH(i,t);if(l.navigate===!1){let b=l.fetcherKey||NH();yield a(b,r,l.action||f,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:x,body:v,formMethod:l.method||p,formEncType:l.encType||m,flushSync:l.flushSync})}else yield s(l.action||f,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:x,body:v,formMethod:l.method||p,formEncType:l.encType||m,replace:l.replace,state:l.state,fromRouteId:r,flushSync:l.flushSync,viewTransition:l.viewTransition})}),[a,s,t,r])}function TH(e,{relative:t}={}){let{basename:r}=y.useContext(ys),a=y.useContext(bi);Lr(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),i=ee({},Ph(e||".",{relative:t})),l=vs();if(e==null){i.search=l.search;let u=new URLSearchParams(i.search),d=u.getAll("index");if(d.some(p=>p==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let p=u.toString();i.search=p?`?${p}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:gi([r,i.pathname])),nh(i)}function EH(e,{relative:t}={}){let r=y.useContext(IO);Lr(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=GO("useViewTransitionState"),s=Ph(e,{relative:t});if(!r.isTransitioning)return!1;let i=Ro(r.currentLocation.pathname,a)||r.currentLocation.pathname,l=Ro(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Eg(s.pathname,l)!=null||Eg(s.pathname,i)!=null}var Kx=vO();function KO(){return fe(this,null,function*(){var e,t;try{const r=yield fetch("/api/method/frappe.auth.get_logged_user",{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"},credentials:"include"});if(!r.ok)return{ok:!1};const a=yield r.json(),s=a==null?void 0:a.message;if(!s||s==="Guest")return{ok:!1};let i=s,l="";try{const d=yield fetch(`/api/resource/User/${encodeURIComponent(s)}?fields=["full_name","user_image"]`,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"},credentials:"include"});if(d.ok){const f=yield d.json();(e=f.data)!=null&&e.full_name&&(i=f.data.full_name),(t=f.data)!=null&&t.user_image&&(l=f.data.user_image)}}catch(d){}const u={email:s,full_name:i,user_image:l,roles:[]};return localStorage.setItem("user",JSON.stringify(u)),{ok:!0}}catch(r){return{ok:!1}}})}const AH="modulepreload",OH=function(e){return"/assets/project_management/pm_app/"+e},KC={},Mf=function(t,r,a){let s=Promise.resolve();if(r&&r.length>0){let f=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};var l=f;document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=f(r.map(p=>{if(p=OH(p),p in KC)return;KC[p]=!0;const m=p.endsWith(".css"),x=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${x}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":AH,m||(v.as="script"),v.crossOrigin="",v.href=p,d&&v.setAttribute("nonce",d),document.head.appendChild(v),m)return new Promise((b,w)=>{v.addEventListener("load",b),v.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return s.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})},Nb="asm_show_after_password_reset",Tm="asm_login_tmp_id",PH=()=>{const[e,t]=y.useState({email:"",password:""}),[r,a]=y.useState(!1),[s,i]=y.useState(!0),[l,u]=y.useState(null),[d,f]=y.useState(!1),[p,m]=y.useState(""),[x,v]=y.useState(!1),[b,w]=y.useState(null),[j,k]=y.useState(!1),[C,N]=y.useState(!1),[O,E]=y.useState(!1),[A,T]=y.useState("credentials"),[P,D]=y.useState(null),[z,G]=y.useState(""),[V,ne]=y.useState(null),ge=Ut(),Z=vs(),{t:U}=sr(),ce=y.useRef(!1),xe=y.useRef(null),be=y.useCallback(()=>{var he;(he=xe.current)==null||he.abort(),xe.current=null,f(!1),v(!1),w(null),k(!1)},[]),me=y.useCallback(()=>{f(!0),m(e.email),w(null),k(!1),v(!1),u(null)},[e.email]);y.useEffect(()=>{if(!d)return;const he=_e=>{_e.key==="Escape"&&be()};return document.addEventListener("keydown",he),()=>document.removeEventListener("keydown",he)},[d,be]),y.useEffect(()=>{let he=!1;return fe(null,null,function*(){if(typeof sessionStorage!="undefined"&&sessionStorage.getItem(Nb)==="1"&&(sessionStorage.removeItem(Nb),he||E(!0)),new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("manual_login")==="1"&&!ce.current){ce.current=!0,he||N(!0),localStorage.removeItem("user"),localStorage.removeItem("frappe_session_id");const X="";let R=typeof window!="undefined"?window.csrf_token:void 0;if(!R)try{const te=yield fetch(`${X}/api/method/frappe.sessions.get_csrf_token`,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(te.ok){const q=yield te.json();typeof q.message=="string"&&(R=q.message)}}catch(te){}const I={Accept:"application/json"};R&&(I["X-Frappe-CSRF-Token"]=R);try{yield fetch(`${X}/api/method/logout`,{method:"POST",credentials:"include",headers:I})}catch(te){}if(typeof sessionStorage!="undefined"&&sessionStorage.setItem(Nb,"1"),he)return;N(!1),ge("/login",{replace:!0});return}if(localStorage.getItem("user")){he||(i(!1),ge("/projects",{replace:!0}));return}const F=yield KO();if(!he){if(F.ok){try{yield Gf()}catch(X){console.warn("Could not load translations after session bootstrap:",X)}he||ge("/projects",{replace:!0})}he||i(!1)}}),()=>{he=!0}},[ge,Z.pathname,Z.search]);const oe="/assets/project_management/pm_app/",L="?v=1781184737",H=he=>{const{name:_e,value:F}=he.target;t(X=>Se(ee({},X),{[_e]:F})),u(null)},K=y.useCallback(he=>fe(null,null,function*(){const _e=(yield Mf(()=>fe(null,null,function*(){const{default:X}=yield Promise.resolve().then(()=>Nm);return{default:X}}),[])).default,F=Se(ee({},he),{email:he.email||e.email});localStorage.setItem("user",JSON.stringify(F)),he.sid&&_e.setSessionId(he.sid),sessionStorage.removeItem(Tm);try{yield Gf()}catch(X){console.warn("Could not load translations after login:",X)}ge("/projects")}),[e.email,ge]),Y=he=>fe(null,null,function*(){he.preventDefault(),a(!0),u(null);try{const F=yield(yield Mf(()=>fe(null,null,function*(){const{default:X}=yield Promise.resolve().then(()=>Nm);return{default:X}}),void 0)).default.login(e);if(F.status==="two_factor_required"){sessionStorage.setItem(Tm,F.tmp_id),D(F.tmp_id),ne(F.verification),T("otp"),G("");return}yield K(F.user)}catch(_e){console.error("Login error:",_e);const F=_e instanceof Error?_e.message:U("login.loginFailed");u(F)}finally{a(!1)}}),re=he=>fe(null,null,function*(){he.preventDefault();const _e=P||sessionStorage.getItem(Tm);if(!_e){u(U("login.twoFactorSessionExpired")),T("credentials");return}if(!z.trim()){u(U("login.twoFactorCodeRequired"));return}a(!0),u(null);try{const X=yield(yield Mf(()=>fe(null,null,function*(){const{default:R}=yield Promise.resolve().then(()=>Nm);return{default:R}}),void 0)).default.verifyLoginOtp(_e,z);X.status==="logged_in"&&(yield K(X.user))}catch(F){const X=F instanceof Error?F.message:U("login.twoFactorInvalid");u(X)}finally{a(!1)}}),de=()=>{sessionStorage.removeItem(Tm),T("credentials"),D(null),ne(null),G(""),u(null)},ie=()=>fe(null,null,function*(){const he={full_name:"Demo User",email:"demo@seeraarabia.com",user_image:"",roles:["System Manager","Administrator"]};localStorage.setItem("user",JSON.stringify(he));try{yield Gf()}catch(_e){console.warn("Could not load translations after demo login:",_e)}ge("/projects")}),se=he=>fe(null,null,function*(){var R;he.preventDefault();const _e=p.trim();if(!_e){w(U("login.forgotPasswordUserRequired"));return}(R=xe.current)==null||R.abort();const F=new AbortController;xe.current=F,v(!0),w(null),k(!1);const X=yield Mf(()=>Promise.resolve().then(()=>Nm),void 0);try{yield X.default.requestPasswordReset(_e,F.signal),k(!0)}catch(I){I instanceof Error&&I.name==="AbortError"?w(U("login.forgotPasswordTimeout")):I instanceof X.ApiError?I.code==="USER_NOT_FOUND"?w(U("login.forgotPasswordNotFound")):I.code==="RESET_NOT_ALLOWED"?w(U("login.forgotPasswordCannotReset")):I.code==="FORBIDDEN"?w(U("login.forgotPasswordFailed")):I.code==="EMPTY_EMAIL"?w(U("login.forgotPasswordUserRequired")):w(U("login.forgotPasswordFailed")):w(U("login.forgotPasswordFailed"))}finally{xe.current===F&&(xe.current=null),v(!1)}});return s||C?n.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50 dark:bg-gray-900",children:n.jsxs("div",{className:"flex flex-col items-center gap-3 text-gray-600 dark:text-gray-400",children:[n.jsxs("svg",{className:"h-10 w-10 animate-spin text-indigo-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":!0,children:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),n.jsx("span",{className:"text-sm",children:U(C?"login.finishingSignOut":"common.loading")})]})}):n.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 py-12 px-4 sm:px-6 lg:px-8",children:[n.jsxs("div",{className:"max-w-md w-full space-y-8",children:[n.jsxs("div",{children:[n.jsx("div",{className:"flex justify-center mb-6",children:n.jsxs("div",{className:"w-32 h-32 flex items-center justify-center bg-white dark:bg-gray-800 rounded-2xl shadow-2xl p-4",children:[n.jsx("img",{src:`${oe}${oe.endsWith("/")?"":"/"}seera-logo.png${L}`,alt:"Seera Arabia",className:"w-full h-full object-contain",onError:he=>{const _e=he.currentTarget.parentElement;_e&&_e.classList.add("bg-gradient-to-br","from-indigo-600","to-purple-600"),he.currentTarget.style.display="none";const F=he.currentTarget.nextElementSibling;F&&F.classList.remove("hidden")}}),n.jsxs("svg",{className:"w-20 h-20 hidden",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",fill:"white",fillOpacity:"0.9"}),n.jsx("path",{d:"M2 17L12 22L22 17V12L12 17L2 12V17Z",fill:"white",fillOpacity:"0.7"}),n.jsx("path",{d:"M12 12V17",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]})]})}),n.jsx("h2",{className:"text-center text-3xl font-semibold text-gray-900 dark:text-white",children:U("login.title")}),n.jsx("p",{className:"mt-2 text-center text-sm font-medium text-indigo-600 dark:text-indigo-400",children:U("login.subtitle")}),n.jsx("p",{className:"mt-1 text-center text-xs text-gray-600 dark:text-gray-400",children:U(A==="otp"?"login.twoFactorTitle":"login.signIn")})]}),n.jsxs("div",{className:"mt-8 space-y-6",children:[O&&A==="credentials"&&n.jsx("div",{className:"rounded-md bg-green-50 p-4 dark:bg-green-900/20",children:n.jsx("p",{className:"text-sm text-green-800 dark:text-green-300",children:U("login.afterPasswordResetSignIn")})}),A==="otp"?n.jsxs("form",{className:"space-y-6",onSubmit:re,children:[n.jsxs("div",{className:"rounded-md bg-indigo-50 p-4 text-sm text-indigo-900 dark:bg-indigo-900/20 dark:text-indigo-200",children:[(V==null?void 0:V.method)==="Email"&&V.prompt?n.jsx("p",{children:V.prompt}):(V==null?void 0:V.method)==="OTP App"&&V.setup?n.jsx("p",{children:U("login.twoFactorOtpAppEnter")}):(V==null?void 0:V.method)==="OTP App"&&!V.setup?n.jsx("p",{children:U("login.twoFactorOtpAppSetupIncomplete")}):n.jsx("p",{children:U("login.twoFactorOtpAppEnter")}),(V==null?void 0:V.method)==="Email"&&n.jsx("p",{className:"mt-2 text-xs text-indigo-800 dark:text-indigo-300",children:U("login.twoFactorEmailQrHint")})]}),n.jsxs("div",{children:[n.jsx("label",{htmlFor:"otp",className:"sr-only",children:U("login.twoFactorCodeLabel")}),n.jsx("input",{id:"otp",name:"otp",type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,required:!0,autoFocus:!0,className:"relative block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-center text-lg tracking-widest text-gray-900 placeholder-gray-500 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-800 dark:text-white",placeholder:U("login.twoFactorCodePlaceholder"),value:z,onChange:he=>{G(he.target.value.replace(/\D/g,"").slice(0,6)),u(null)}})]}),l&&n.jsx("div",{className:"rounded-md bg-red-50 p-4 dark:bg-red-900/20",children:n.jsx("div",{className:"text-sm text-red-700 dark:text-red-400",children:l})}),n.jsx("button",{type:"submit",disabled:r,className:"group relative flex w-full justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:U(r?"common.loading":"login.twoFactorVerify")}),n.jsx("button",{type:"button",onClick:de,className:"w-full text-center text-sm font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400",children:U("login.twoFactorBackToLogin")})]}):n.jsxs("form",{className:"space-y-6",onSubmit:Y,children:[n.jsxs("div",{className:"rounded-md shadow-sm -space-y-px",children:[n.jsxs("div",{children:[n.jsx("label",{htmlFor:"email",className:"sr-only",children:U("common.email")}),n.jsx("input",{id:"email",name:"email",type:"email",required:!0,className:"appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white bg-white dark:bg-gray-800 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm",placeholder:U("login.emailPlaceholder"),value:e.email,onChange:H})]}),n.jsxs("div",{children:[n.jsx("label",{htmlFor:"password",className:"sr-only",children:U("common.password")}),n.jsx("input",{id:"password",name:"password",type:"password",required:!0,className:"appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 placeholder-gray-500 dark:placeholder-gray-400 text-gray-900 dark:text-white bg-white dark:bg-gray-800 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm",placeholder:U("login.passwordPlaceholder"),value:e.password,onChange:H})]})]}),l&&n.jsx("div",{className:"rounded-md bg-red-50 dark:bg-red-900/20 p-4",children:n.jsx("div",{className:"text-sm text-red-700 dark:text-red-400",children:l})}),n.jsx("button",{type:"submit",disabled:r,className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed",children:r?n.jsxs("div",{className:"flex items-center",children:[n.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),U("common.loading")]}):U("common.login")})]}),A==="credentials"&&n.jsx("div",{className:"text-center",children:n.jsx("button",{type:"button",onClick:me,className:"text-sm font-medium text-indigo-600 dark:text-indigo-400 hover:text-indigo-500 dark:hover:text-indigo-300 focus:outline-none focus:underline",children:U("login.forgotPassword")})}),n.jsxs("div",{className:"hidden space-y-3","aria-hidden":"true",children:[n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute inset-0 flex items-center",children:n.jsx("div",{className:"w-full border-t border-gray-300 dark:border-gray-600"})}),n.jsx("div",{className:"relative flex justify-center text-sm",children:n.jsx("span",{className:"px-2 bg-gray-50 dark:bg-gray-900 text-gray-500 dark:text-gray-400",children:U("login.or")})})]}),n.jsxs("button",{type:"button",onClick:ie,tabIndex:-1,className:"w-full flex justify-center py-2 px-4 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:["🚀 ",U("login.demoLogin")]})]})]})]}),d&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:be,role:"presentation",children:n.jsxs("div",{className:"relative w-full max-w-md rounded-lg border border-gray-200 bg-white p-5 shadow-xl dark:border-gray-700 dark:bg-gray-800",onClick:he=>he.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"forgot-password-title",children:[n.jsx("button",{type:"button",onClick:be,className:"absolute right-3 top-3 rounded p-1 text-gray-500 hover:bg-gray-100 hover:text-gray-800 dark:hover:bg-gray-700 dark:hover:text-gray-200","aria-label":U("login.forgotPasswordClose"),children:"×"}),n.jsx("h3",{id:"forgot-password-title",className:"pr-8 text-lg font-semibold text-gray-900 dark:text-white",children:U("login.forgotPasswordTitle")}),n.jsx("p",{className:"mt-2 text-xs leading-relaxed text-gray-600 dark:text-gray-400",children:U("login.forgotPasswordHint")}),n.jsxs("form",{className:"mt-4 space-y-3",onSubmit:se,children:[n.jsx("input",{type:"text",name:"reset-user",autoComplete:"username",value:p,onChange:he=>{m(he.target.value),w(null),k(!1)},className:"relative block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder-gray-500 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:placeholder-gray-400",placeholder:U("login.forgotPasswordUserPlaceholder")}),b&&n.jsx("div",{className:"rounded-md bg-red-50 p-3 text-sm text-red-700 dark:bg-red-900/20 dark:text-red-400",children:b}),j&&n.jsx("div",{className:"rounded-md bg-green-50 p-3 text-sm text-green-800 dark:bg-green-900/20 dark:text-green-300",children:U("login.forgotPasswordSentSuccess")}),n.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end sm:gap-3",children:[n.jsx("button",{type:"button",onClick:be,className:"inline-flex justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:hover:bg-gray-700",children:U("login.forgotPasswordClose")}),n.jsx("button",{type:"submit",disabled:x,className:"inline-flex justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:U(x?"common.loading":"login.forgotPasswordSubmit")})]})]})]})})]})},YO=y.createContext(void 0),DH=({children:e})=>{const{i18n:t}=sr(),[r,a]=y.useState(()=>localStorage.getItem("i18nextLng")==="ar"?"ar":"en"),s=r==="ar";y.useEffect(()=>{const l=document.documentElement,u=document.documentElement;t.changeLanguage(r),u.setAttribute("lang",r),s?(u.setAttribute("dir","rtl"),l.classList.add("rtl"),l.classList.remove("ltr")):(u.setAttribute("dir","ltr"),l.classList.add("ltr"),l.classList.remove("rtl"))},[r,t,s]);const i=l=>fe(null,null,function*(){a(l),localStorage.setItem("i18nextLng",l),yield Gf()});return n.jsx(YO.Provider,{value:{language:r,changeLanguage:i,isRTL:s},children:e})},XO=()=>{const e=y.useContext(YO);if(!e)throw new Error("useLanguage must be used within LanguageProvider");return e},JO=y.createContext(void 0),RH=({children:e})=>{const[t,r]=y.useState(!1),a=y.useCallback(()=>{r(!0)},[]),s=y.useCallback(()=>{r(!1)},[]);return n.jsx(JO.Provider,{value:{mobileSidebarOpen:t,openMobileSidebar:a,closeMobileSidebar:s},children:e})},QO=()=>{const e=y.useContext(JO);if(!e)throw new Error("useSidebarLayout must be used within SidebarLayoutProvider");return e};const FH=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MH=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),YC=e=>{const t=MH(e);return t.charAt(0).toUpperCase()+t.slice(1)},ZO=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),LH=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var IH={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"};const zH=y.forwardRef((f,d)=>{var p=f,{color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:s="",children:i,iconNode:l}=p,u=ti(p,["color","size","strokeWidth","absoluteStrokeWidth","className","children","iconNode"]);return y.createElement("svg",ee(ee(Se(ee({ref:d},IH),{width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:ZO("lucide",s)}),!i&&!LH(u)&&{"aria-hidden":"true"}),u),[...l.map(([m,x])=>y.createElement(m,x)),...Array.isArray(i)?i:[i]])});const qn=(e,t)=>{const r=y.forwardRef((l,i)=>{var u=l,{className:a}=u,s=ti(u,["className"]);return y.createElement(zH,ee({ref:i,iconNode:t,className:ZO(`lucide-${FH(YC(e))}`,`lucide-${e}`,a)},s))});return r.displayName=YC(e),r};const BH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],eP=qn("circle-user",BH);const $H=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],UH=qn("clipboard-list",$H);const HH=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],qH=qn("clock",HH);const WH=[["path",{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1",key:"likhh7"}],["path",{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1",key:"17ky3x"}],["path",{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z",key:"1hyeo0"}]],VH=qn("file-stack",WH);const GH=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],XC=qn("folder-open",GH);const KH=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],YH=qn("languages",KH);const XH=[["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"}]],JH=qn("layout-dashboard",XH);const QH=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],ZH=qn("list",QH);const eq=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],tq=qn("log-out",eq);const rq=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],tP=qn("menu",rq);const aq=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],nq=qn("moon",aq);const sq=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],iq=qn("sun",sq);const oq=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],lq=qn("tags",oq);const cq=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],JC=qn("x",cq);var rP={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},QC=_t.createContext&&_t.createContext(rP),uq=["attr","size","title"];function dq(e,t){if(e==null)return{};var r,a,s=fq(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function fq(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}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 a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Og.apply(null,arguments)}function ZC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Pg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZC(Object(r),!0).forEach(function(a){hq(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZC(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function hq(e,t,r){return(t=pq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pq(e){var t=mq(e,"string");return typeof t=="symbol"?t:t+""}function mq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aP(e){return e&&e.map((t,r)=>_t.createElement(t.tag,Pg({key:r},t.attr),aP(t.child)))}function ut(e){return t=>_t.createElement(gq,Og({attr:Pg({},e.attr)},t),aP(e.child))}function gq(e){var t=r=>{var{attr:a,size:s,title:i}=e,l=dq(e,uq),u=s||r.size||"1em",d;return r.className&&(d=r.className),e.className&&(d=(d?d+" ":"")+e.className),_t.createElement("svg",Og({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,a,l,{className:d,style:Pg(Pg({color:e.color||r.color},r.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),i&&_t.createElement("title",null,i),e.children)};return QC!==void 0?_t.createElement(QC.Consumer,null,r=>t(r)):t(rP)}function eT(e){return ut({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"},child:[]}]})(e)}function sh(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"},child:[]}]})(e)}function Mw(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm95.8 32.6L272 480l-32-136 32-56h-96l32 56-32 136-47.8-191.4C56.9 292 0 350.3 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-72.1-56.9-130.4-128.2-133.8z"},child:[]}]})(e)}function xq(e){return ut({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M630.6 364.9l-90.3-90.2c-12-12-28.3-18.7-45.3-18.7h-79.3c-17.7 0-32 14.3-32 32v79.2c0 17 6.7 33.2 18.7 45.2l90.3 90.2c12.5 12.5 32.8 12.5 45.3 0l92.5-92.5c12.6-12.5 12.6-32.7.1-45.2zm-182.8-21c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24c0 13.2-10.7 24-24 24zm-223.8-88c70.7 0 128-57.3 128-128C352 57.3 294.7 0 224 0S96 57.3 96 128c0 70.6 57.3 127.9 128 127.9zm127.8 111.2V294c-12.2-3.6-24.9-6.2-38.2-6.2h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 287.9 0 348.1 0 422.3v41.6c0 26.5 21.5 48 48 48h352c15.5 0 29.1-7.5 37.9-18.9l-58-58c-18.1-18.1-28.1-42.2-28.1-67.9z"},child:[]}]})(e)}function Dg(e){return ut({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z"},child:[]}]})(e)}function Yx(e){return ut({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M624 352h-16V243.9c0-12.7-5.1-24.9-14.1-33.9L494 110.1c-9-9-21.2-14.1-33.9-14.1H416V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h16c0 53 43 96 96 96s96-43 96-96h128c0 53 43 96 96 96s96-43 96-96h48c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zM160 464c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm320 0c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm80-208H416V144h44.1l99.9 99.9V256z"},child:[]}]})(e)}function Za(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"},child:[]}]})(e)}function yt(e){return ut({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(e)}function Fr(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"},child:[]}]})(e)}function Gc(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M139.61 35.5a12 12 0 0 0-17 0L58.93 98.81l-22.7-22.12a12 12 0 0 0-17 0L3.53 92.41a12 12 0 0 0 0 17l47.59 47.4a12.78 12.78 0 0 0 17.61 0l15.59-15.62L156.52 69a12.09 12.09 0 0 0 .09-17zm0 159.19a12 12 0 0 0-17 0l-63.68 63.72-22.7-22.1a12 12 0 0 0-17 0L3.53 252a12 12 0 0 0 0 17L51 316.5a12.77 12.77 0 0 0 17.6 0l15.7-15.69 72.2-72.22a12 12 0 0 0 .09-16.9zM64 368c-26.49 0-48.59 21.5-48.59 48S37.53 464 64 464a48 48 0 0 0 0-96zm432 16H208a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h288a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H208a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h288a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H208a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h288a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"},child:[]}]})(e)}function nP(e){return ut({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M497.941 225.941L286.059 14.059A48 48 0 0 0 252.118 0H48C21.49 0 0 21.49 0 48v204.118a48 48 0 0 0 14.059 33.941l211.882 211.882c18.744 18.745 49.136 18.746 67.882 0l204.118-204.118c18.745-18.745 18.745-49.137 0-67.882zM112 160c-26.51 0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm513.941 133.823L421.823 497.941c-18.745 18.745-49.137 18.745-67.882 0l-.36-.36L527.64 323.522c16.999-16.999 26.36-39.6 26.36-63.64s-9.362-46.641-26.36-63.64L331.397 0h48.721a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882z"},child:[]}]})(e)}function en(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z"},child:[]}]})(e)}function yq(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 304c0 114.9-93.1 208-208 208S16 418.9 16 304c0-104 76.3-190.2 176-205.5V64h-28c-6.6 0-12-5.4-12-12V12c0-6.6 5.4-12 12-12h120c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-28v34.5c37.5 5.8 71.7 21.6 99.7 44.6l27.5-27.5c4.7-4.7 12.3-4.7 17 0l28.3 28.3c4.7 4.7 4.7 12.3 0 17l-29.4 29.4-.6.6C419.7 223.3 432 262.2 432 304zm-176 36V188.5c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12V340c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12z"},child:[]}]})(e)}function vq(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}function Gr(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}function vt(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"},child:[]}]})(e)}function sP(e){return ut({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M128 352H32c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h96c17.67 0 32-14.33 32-32v-96c0-17.67-14.33-32-32-32zm-24-80h192v48h48v-48h192v48h48v-57.59c0-21.17-17.23-38.41-38.41-38.41H344v-64h40c17.67 0 32-14.33 32-32V32c0-17.67-14.33-32-32-32H256c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h40v64H94.41C73.23 224 56 241.23 56 262.41V320h48v-48zm264 80h-96c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h96c17.67 0 32-14.33 32-32v-96c0-17.67-14.33-32-32-32zm240 0h-96c-17.67 0-32 14.33-32 32v96c0 17.67 14.33 32 32 32h96c17.67 0 32-14.33 32-32v-96c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function Ld(e){return ut({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528.12 301.319l47.273-208C578.806 78.301 567.391 64 551.99 64H159.208l-9.166-44.81C147.758 8.021 137.93 0 126.529 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24h69.883l70.248 343.435C147.325 417.1 136 435.222 136 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-15.674-6.447-29.835-16.824-40h209.647C430.447 426.165 424 440.326 424 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-22.172-12.888-41.332-31.579-50.405l5.517-24.276c3.413-15.018-8.002-29.319-23.403-29.319H218.117l-6.545-32h293.145c11.206 0 20.92-7.754 23.403-18.681z"},child:[]}]})(e)}function r_(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 160v-32C352 57.42 294.579 0 224 0 153.42 0 96 57.42 96 128v32H0v272c0 44.183 35.817 80 80 80h288c44.183 0 80-35.817 80-80V160h-96zm-192-32c0-35.29 28.71-64 64-64s64 28.71 64 64v32H160v-32zm160 120c-13.255 0-24-10.745-24-24s10.745-24 24-24 24 10.745 24 24-10.745 24-24 24zm-192 0c-13.255 0-24-10.745-24-24s10.745-24 24-24 24 10.745 24 24-10.745 24-24 24z"},child:[]}]})(e)}function Cb(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M466.5 83.7l-192-80a48.15 48.15 0 0 0-36.9 0l-192 80C27.7 91.1 16 108.6 16 128c0 198.5 114.5 335.7 221.5 380.3 11.8 4.9 25.1 4.9 36.9 0C360.1 472.6 496 349.3 496 128c0-19.4-11.7-36.9-29.5-44.3zM256.1 446.3l-.1-381 175.9 73.3c-3.3 151.4-82.1 261.1-175.8 307.7z"},child:[]}]})(e)}function fn(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function Cn(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"},child:[]}]})(e)}function bq(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M448 192V77.25c0-8.49-3.37-16.62-9.37-22.63L393.37 9.37c-6-6-14.14-9.37-22.63-9.37H96C78.33 0 64 14.33 64 32v160c-35.35 0-64 28.65-64 64v112c0 8.84 7.16 16 16 16h48v96c0 17.67 14.33 32 32 32h320c17.67 0 32-14.33 32-32v-96h48c8.84 0 16-7.16 16-16V256c0-35.35-28.65-64-64-64zm-64 256H128v-96h256v96zm0-224H128V64h192v48c0 8.84 7.16 16 16 16h48v96zm48 72c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"},child:[]}]})(e)}function Pt(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function Vs(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"},child:[]}]})(e)}function cu(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z"},child:[]}]})(e)}function Dl(e){return ut({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M621.16 54.46C582.37 38.19 543.55 32 504.75 32c-123.17-.01-246.33 62.34-369.5 62.34-30.89 0-61.76-3.92-92.65-13.72-3.47-1.1-6.95-1.62-10.35-1.62C15.04 79 0 92.32 0 110.81v317.26c0 12.63 7.23 24.6 18.84 29.46C57.63 473.81 96.45 480 135.25 480c123.17 0 246.34-62.35 369.51-62.35 30.89 0 61.76 3.92 92.65 13.72 3.47 1.1 6.95 1.62 10.35 1.62 17.21 0 32.25-13.32 32.25-31.81V83.93c-.01-12.64-7.24-24.6-18.85-29.47zM48 132.22c20.12 5.04 41.12 7.57 62.72 8.93C104.84 170.54 79 192.69 48 192.69v-60.47zm0 285v-47.78c34.37 0 62.18 27.27 63.71 61.4-22.53-1.81-43.59-6.31-63.71-13.62zM320 352c-44.19 0-80-42.99-80-96 0-53.02 35.82-96 80-96s80 42.98 80 96c0 53.03-35.83 96-80 96zm272 27.78c-17.52-4.39-35.71-6.85-54.32-8.44 5.87-26.08 27.5-45.88 54.32-49.28v57.72zm0-236.11c-30.89-3.91-54.86-29.7-55.81-61.55 19.54 2.17 38.09 6.23 55.81 12.66v48.89z"},child:[]}]})(e)}function iP(e){return ut({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M176 352c53.02 0 96-42.98 96-96V96c0-53.02-42.98-96-96-96S80 42.98 80 96v160c0 53.02 42.98 96 96 96zm160-160h-16c-8.84 0-16 7.16-16 16v48c0 74.8-64.49 134.82-140.79 127.38C96.71 376.89 48 317.11 48 250.3V208c0-8.84-7.16-16-16-16H16c-8.84 0-16 7.16-16 16v40.16c0 89.64 63.97 169.55 152 181.69V464H96c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h160c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16h-56v-33.77C285.71 418.47 352 344.9 352 256v-48c0-8.84-7.16-16-16-16z"},child:[]}]})(e)}function wq(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"},child:[]}]})(e)}function jq(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"},child:[]}]})(e)}function Tb(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z"},child:[]}]})(e)}function a_(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},child:[]}]})(e)}function _q(e){return ut({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M336 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM144 32h96c8.8 0 16 7.2 16 16s-7.2 16-16 16h-96c-8.8 0-16-7.2-16-16s7.2-16 16-16zm48 128c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H102.4C90 416 80 407.4 80 396.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2z"},child:[]}]})(e)}function kq(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 255.531c.253 136.64-111.18 248.372-247.82 248.468-59.015.042-113.223-20.53-155.822-54.911-11.077-8.94-11.905-25.541-1.839-35.607l11.267-11.267c8.609-8.609 22.353-9.551 31.891-1.984C173.062 425.135 212.781 440 256 440c101.705 0 184-82.311 184-184 0-101.705-82.311-184-184-184-48.814 0-93.149 18.969-126.068 49.932l50.754 50.754c10.08 10.08 2.941 27.314-11.313 27.314H24c-8.837 0-16-7.163-16-16V38.627c0-14.254 17.234-21.393 27.314-11.314l49.372 49.372C129.209 34.136 189.552 8 256 8c136.81 0 247.747 110.78 248 247.531zm-180.912 78.784l9.823-12.63c8.138-10.463 6.253-25.542-4.21-33.679L288 256.349V152c0-13.255-10.745-24-24-24h-16c-13.255 0-24 10.745-24 24v135.651l65.409 50.874c10.463 8.137 25.541 6.253 33.679-4.21z"},child:[]}]})(e)}function Id(e){return ut({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z"},child:[]}]})(e)}function Dh(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.976 0H24.028C2.71 0-8.047 25.866 7.058 40.971L192 225.941V432c0 7.831 3.821 15.17 10.237 19.662l80 55.98C298.02 518.69 320 507.493 320 487.98V225.941l184.947-184.97C520.021 25.896 509.338 0 487.976 0z"},child:[]}]})(e)}function Sq(e){return ut({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M288 256H96v64h192v-64zm89-151L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-153 31V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zM64 72c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8V72zm0 64c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8v-16zm256 304c0 4.42-3.58 8-8 8h-80c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16zm0-200v96c0 8.84-7.16 16-16 16H80c-8.84 0-16-7.16-16-16v-96c0-8.84 7.16-16 16-16h224c8.84 0 16 7.16 16 16z"},child:[]}]})(e)}function Kc(e){return ut({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M377 105L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-153 31V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zM64 72c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8V72zm0 80v-16c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8zm144 263.88V440c0 4.42-3.58 8-8 8h-16c-4.42 0-8-3.58-8-8v-24.29c-11.29-.58-22.27-4.52-31.37-11.35-3.9-2.93-4.1-8.77-.57-12.14l11.75-11.21c2.77-2.64 6.89-2.76 10.13-.73 3.87 2.42 8.26 3.72 12.82 3.72h28.11c6.5 0 11.8-5.92 11.8-13.19 0-5.95-3.61-11.19-8.77-12.73l-45-13.5c-18.59-5.58-31.58-23.42-31.58-43.39 0-24.52 19.05-44.44 42.67-45.07V232c0-4.42 3.58-8 8-8h16c4.42 0 8 3.58 8 8v24.29c11.29.58 22.27 4.51 31.37 11.35 3.9 2.93 4.1 8.77.57 12.14l-11.75 11.21c-2.77 2.64-6.89 2.76-10.13.73-3.87-2.43-8.26-3.72-12.82-3.72h-28.11c-6.5 0-11.8 5.92-11.8 13.19 0 5.95 3.61 11.19 8.77 12.73l45 13.5c18.59 5.58 31.58 23.42 31.58 43.39 0 24.53-19.05 44.44-42.67 45.07z"},child:[]}]})(e)}function hn(e){return ut({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z"},child:[]}]})(e)}function Nq(e){return ut({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm60.1 106.5L224 336l60.1 93.5c5.1 8-.6 18.5-10.1 18.5h-34.9c-4.4 0-8.5-2.4-10.6-6.3C208.9 405.5 192 373 192 373c-6.4 14.8-10 20-36.6 68.8-2.1 3.9-6.1 6.3-10.5 6.3H110c-9.5 0-15.2-10.5-10.1-18.5l60.3-93.5-60.3-93.5c-5.2-8 .6-18.5 10.1-18.5h34.8c4.4 0 8.5 2.4 10.6 6.3 26.1 48.8 20 33.6 36.6 68.5 0 0 6.1-11.7 36.6-68.5 2.1-3.9 6.2-6.3 10.6-6.3H274c9.5-.1 15.2 10.4 10.1 18.4zM384 121.9v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"},child:[]}]})(e)}function Cq(e){return ut({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm-96 144c0 4.42-3.58 8-8 8h-8c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h8c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8h-8c-26.51 0-48-21.49-48-48v-32c0-26.51 21.49-48 48-48h8c4.42 0 8 3.58 8 8v16zm44.27 104H160c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h12.27c5.95 0 10.41-3.5 10.41-6.62 0-1.3-.75-2.66-2.12-3.84l-21.89-18.77c-8.47-7.22-13.33-17.48-13.33-28.14 0-21.3 19.02-38.62 42.41-38.62H200c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8h-12.27c-5.95 0-10.41 3.5-10.41 6.62 0 1.3.75 2.66 2.12 3.84l21.89 18.77c8.47 7.22 13.33 17.48 13.33 28.14.01 21.29-19 38.62-42.39 38.62zM256 264v20.8c0 20.27 5.7 40.17 16 56.88 10.3-16.7 16-36.61 16-56.88V264c0-4.42 3.58-8 8-8h16c4.42 0 8 3.58 8 8v20.8c0 35.48-12.88 68.89-36.28 94.09-3.02 3.25-7.27 5.11-11.72 5.11s-8.7-1.86-11.72-5.11c-23.4-25.2-36.28-58.61-36.28-94.09V264c0-4.42 3.58-8 8-8h16c4.42 0 8 3.58 8 8zm121-159L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9z"},child:[]}]})(e)}function Tq(e){return ut({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zM64 72c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8V72zm0 64c0-4.42 3.58-8 8-8h80c4.42 0 8 3.58 8 8v16c0 4.42-3.58 8-8 8H72c-4.42 0-8-3.58-8-8v-16zm192.81 248H304c8.84 0 16 7.16 16 16s-7.16 16-16 16h-47.19c-16.45 0-31.27-9.14-38.64-23.86-2.95-5.92-8.09-6.52-10.17-6.52s-7.22.59-10.02 6.19l-7.67 15.34a15.986 15.986 0 0 1-14.31 8.84c-.38 0-.75-.02-1.14-.05-6.45-.45-12-4.75-14.03-10.89L144 354.59l-10.61 31.88c-5.89 17.66-22.38 29.53-41 29.53H80c-8.84 0-16-7.16-16-16s7.16-16 16-16h12.39c4.83 0 9.11-3.08 10.64-7.66l18.19-54.64c3.3-9.81 12.44-16.41 22.78-16.41s19.48 6.59 22.77 16.41l13.88 41.64c19.77-16.19 54.05-9.7 66 14.16 2.02 4.06 5.96 6.5 10.16 6.5zM377 105L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9z"},child:[]}]})(e)}function oP(e){return ut({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm64 236c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-64c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12v8zm0-72v8c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-8c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm96-114.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"},child:[]}]})(e)}function Hs(e){return ut({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"},child:[]}]})(e)}function Eb(e){return ut({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"},child:[]}]})(e)}function So(e){return ut({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},child:[]}]})(e)}function Eq(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"},child:[]}]})(e)}function ha(e){return ut({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"},child:[]}]})(e)}function Aq(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"},child:[]}]})(e)}function uu(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"},child:[]}]})(e)}function lP(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z"},child:[]}]})(e)}function ds(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z"},child:[]}]})(e)}function cP(e){return ut({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM96 424c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm0-96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm0-96c-13.3 0-24-10.7-24-24s10.7-24 24-24 24 10.7 24 24-10.7 24-24 24zm96-192c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm128 368c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-96c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-96c0 4.4-3.6 8-8 8H168c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16z"},child:[]}]})(e)}function uP(e){return ut({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm121.2 231.8l-143 141.8c-4.7 4.7-12.3 4.6-17-.1l-82.6-83.3c-4.7-4.7-4.6-12.3.1-17L99.1 285c4.7-4.7 12.3-4.6 17 .1l46 46.4 106-105.2c4.7-4.7 12.3-4.6 17 .1l28.2 28.4c4.7 4.8 4.6 12.3-.1 17z"},child:[]}]})(e)}function ps(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z"},child:[]}]})(e)}function bs(e){return ut({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(e)}function nr(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(e)}function Oq(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(e)}function Sn(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 480H48c-26.51 0-48-21.49-48-48V80c0-26.51 21.49-48 48-48h352c26.51 0 48 21.49 48 48v352c0 26.51-21.49 48-48 48zm-204.686-98.059l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.248-16.379-6.249-22.628 0L184 302.745l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.25 16.379 6.25 22.628.001z"},child:[]}]})(e)}function Or(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},child:[]}]})(e)}function Pq(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16zM464 96H345.94c-21.38 0-32.09 25.85-16.97 40.97l32.4 32.4L288 242.75l-73.37-73.37c-12.5-12.5-32.76-12.5-45.25 0l-68.69 68.69c-6.25 6.25-6.25 16.38 0 22.63l22.62 22.62c6.25 6.25 16.38 6.25 22.63 0L192 237.25l73.37 73.37c12.5 12.5 32.76 12.5 45.25 0l96-96 32.4 32.4c15.12 15.12 40.97 4.41 40.97-16.97V112c.01-8.84-7.15-16-15.99-16z"},child:[]}]})(e)}function tT(e){return ut({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M332.8 320h38.4c6.4 0 12.8-6.4 12.8-12.8V172.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h38.4c6.4 0 12.8-6.4 12.8-12.8V76.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-288 0h38.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h38.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-38.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zM496 384H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16z"},child:[]}]})(e)}function Dq(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V192H0v272zm320-196c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM192 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM64 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zM400 64h-48V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H160V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H48C21.5 64 0 85.5 0 112v48h448v-48c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}function dP(e){return ut({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M576 240c0-23.63-12.95-44.04-32-55.12V32.01C544 23.26 537.02 0 512 0c-7.12 0-14.19 2.38-19.98 7.02l-85.03 68.03C364.28 109.19 310.66 128 256 128H64c-35.35 0-64 28.65-64 64v96c0 35.35 28.65 64 64 64h33.7c-1.39 10.48-2.18 21.14-2.18 32 0 39.77 9.26 77.35 25.56 110.94 5.19 10.69 16.52 17.06 28.4 17.06h74.28c26.05 0 41.69-29.84 25.9-50.56-16.4-21.52-26.15-48.36-26.15-77.44 0-11.11 1.62-21.79 4.41-32H256c54.66 0 108.28 18.81 150.98 52.95l85.03 68.03a32.023 32.023 0 0 0 19.98 7.02c24.92 0 32-22.78 32-32V295.13C563.05 284.04 576 263.63 576 240zm-96 141.42l-33.05-26.44C392.95 311.78 325.12 288 256 288v-96c69.12 0 136.95-23.78 190.95-66.98L480 98.58v282.84z"},child:[]}]})(e)}function zd(e){return ut({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M560 288h-80v96l-32-21.3-32 21.3v-96h-80c-8.8 0-16 7.2-16 16v192c0 8.8 7.2 16 16 16h224c8.8 0 16-7.2 16-16V304c0-8.8-7.2-16-16-16zm-384-64h224c8.8 0 16-7.2 16-16V16c0-8.8-7.2-16-16-16h-80v96l-32-21.3L256 96V0h-80c-8.8 0-16 7.2-16 16v192c0 8.8 7.2 16 16 16zm64 64h-80v96l-32-21.3L96 384v-96H16c-8.8 0-16 7.2-16 16v192c0 8.8 7.2 16 16 16h224c8.8 0 16-7.2 16-16V304c0-8.8-7.2-16-16-16z"},child:[]}]})(e)}function rT(e){return ut({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M425.7 256c-16.9 0-32.8-9-41.4-23.4L320 126l-64.2 106.6c-8.7 14.5-24.6 23.5-41.5 23.5-4.5 0-9-.6-13.3-1.9L64 215v178c0 14.7 10 27.5 24.2 31l216.2 54.1c10.2 2.5 20.9 2.5 31 0L551.8 424c14.2-3.6 24.2-16.4 24.2-31V215l-137 39.1c-4.3 1.3-8.8 1.9-13.3 1.9zm212.6-112.2L586.8 41c-3.1-6.2-9.8-9.8-16.7-8.9L320 64l91.7 152.1c3.8 6.3 11.4 9.3 18.5 7.3l197.9-56.5c9.9-2.9 14.7-13.9 10.2-23.1zM53.2 41L1.7 143.8c-4.6 9.2.3 20.2 10.1 23l197.9 56.5c7.1 2 14.7-1 18.5-7.3L320 64 69.8 32.1c-6.9-.8-13.5 2.7-16.6 8.9z"},child:[]}]})(e)}function Rq(e){return ut({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M296 160H180.6l42.6-129.8C227.2 15 215.7 0 200 0H56C44 0 33.8 8.9 32.2 20.8l-32 240C-1.7 275.2 9.5 288 24 288h118.7L96.6 482.5c-3.6 15.2 8 29.5 23.3 29.5 8.4 0 16.4-4.4 20.8-12l176-304c9.3-15.9-2.2-36-20.7-36z"},child:[]}]})(e)}function Fq(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 512c35.32 0 63.97-28.65 63.97-64H160.03c0 35.35 28.65 64 63.97 64zm215.39-149.71c-19.32-20.76-55.47-51.99-55.47-154.29 0-77.7-54.48-139.9-127.94-155.16V32c0-17.67-14.32-32-31.98-32s-31.98 14.33-31.98 32v20.84C118.56 68.1 64.08 130.3 64.08 208c0 102.3-36.15 133.53-55.47 154.29-6 6.45-8.66 14.16-8.61 21.71.11 16.4 12.98 32 32.1 32h383.8c19.12 0 32-15.6 32.1-32 .05-7.55-2.61-15.27-8.61-21.71z"},child:[]}]})(e)}function da(e){return ut({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(e)}function Mq(){const[e,t]=y.useState(()=>typeof window!="undefined"?window.matchMedia("(min-width: 1024px)").matches:!1);return y.useEffect(()=>{const r=window.matchMedia("(min-width: 1024px)"),a=()=>t(r.matches);return r.addEventListener("change",a),()=>r.removeEventListener("change",a)},[]),e}const Lq=()=>{const[e,t]=y.useState(!1),[r,a]=y.useState(!0),s=vs(),i=Ut(),l=Mq(),{isRTL:u}=XO(),{t:d}=sr(),{mobileSidebarOpen:f,closeMobileSidebar:p}=QO(),m=()=>{l||p()},x=u?"border-l border-gray-200 dark:border-gray-700":"border-r border-gray-200 dark:border-gray-700",v=u?"border-r-4 border-white":"border-l-4 border-white",b="/assets/project_management/pm_app/",w=`${b}${b.endsWith("/")?"":"/"}sidebar-background.jpg`,j="?v=1781183030",k=[{id:"hub",title:d("sidebar.projects",{defaultValue:"Project Management"}),icon:n.jsx(XC,{size:20}),path:"/projects"},{id:"reports",title:"Dashboard",icon:n.jsx(JH,{size:20}),path:"/projects/reports"},{id:"list",title:"Projects",icon:n.jsx(ZH,{size:20}),path:"/projects/list"},{id:"tasks",title:"Tasks",icon:n.jsx(UH,{size:20}),path:"/projects/tasks"},{id:"timesheets",title:"Timesheets",icon:n.jsx(qH,{size:20}),path:"/projects/timesheets"},{id:"activity-types",title:"Activity Types",icon:n.jsx(lq,{size:20}),path:"/projects/activity-types"},{id:"templates",title:"Templates",icon:n.jsx(VH,{size:20}),path:"/projects/templates"},{id:"profile",title:d("sidebar.userProfile",{defaultValue:"User Profile"}),icon:n.jsx(eP,{size:20}),path:"/user-profile"}],C=E=>s.pathname===E||s.pathname.startsWith(`${E}/`),N=s.pathname==="/projects"||s.pathname.startsWith("/projects/"),O=f?`fixed inset-y-0 ${u?"right-0":"left-0"} z-50 lg:static lg:z-auto`:`fixed inset-y-0 ${u?"right-0":"left-0"} z-50 -translate-x-full lg:static lg:translate-x-0 lg:z-auto`;return n.jsxs(n.Fragment,{children:[f&&n.jsx("div",{className:"pm-app-sidebar-backdrop fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:p,"aria-label":d("common.close",{defaultValue:"Close menu"})}),n.jsxs("div",{className:`pm-app-sidebar h-screen transition-all duration-300 ease-in-out flex flex-col shadow-xl ${x} ${e?"w-16":"w-64"} ${O}`,style:{backgroundImage:`url(${w})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"},children:[n.jsx("div",{className:"absolute inset-0 bg-black/60 dark:bg-black/70 z-0"}),n.jsxs("div",{className:"relative z-10 flex flex-col h-full",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200/30 dark:border-gray-700/30",children:[!e&&n.jsxs("div",{className:"flex items-center space-x-3",children:[n.jsx("div",{className:"w-10 h-10 flex items-center justify-center bg-white/20 rounded-lg p-1 backdrop-blur-sm",children:n.jsx("img",{src:`${b}${b.endsWith("/")?"":"/"}seera-logo.png${j}`,alt:"Project Management",className:"w-full h-full object-contain"})}),n.jsx("h1",{className:"text-white text-lg font-semibold drop-shadow-lg",children:d("sidebar.pmTitle",{defaultValue:"Project Management"})})]}),n.jsx("button",{type:"button",onClick:()=>{l?t(!e):p()},className:"text-white hover:bg-white/20 p-2 rounded-lg transition-colors",children:l?e?n.jsx(tP,{size:20}):n.jsx(JC,{size:20}):n.jsx(JC,{size:20})})]}),n.jsxs("nav",{className:"flex-1 overflow-y-auto py-4",children:[n.jsxs("button",{type:"button",onClick:()=>{if(e){i("/projects"),m();return}a(E=>!E)},className:`w-full flex items-center px-4 py-3 text-white hover:bg-white/20 transition-all duration-200 ${N?`bg-white/30 ${v}`:""} ${e?"justify-center":""}`,children:[n.jsx(XC,{size:20}),!e&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`${u?"mr-4":"ml-4"} font-medium flex-1 text-left`,children:d("sidebar.projects",{defaultValue:"Project Management"})}),n.jsx("span",{className:"opacity-80",children:r?n.jsx(ps,{size:12}):n.jsx(nr,{size:12})})]})]}),!e&&r&&n.jsx("div",{className:`${u?"pr-6":"pl-6"} pb-2`,children:k.map(E=>n.jsxs(t_,{to:E.path,onClick:m,className:`flex items-center gap-2 px-4 py-2 text-white/90 hover:text-white hover:bg-white/15 rounded-lg transition-colors ${C(E.path)?"bg-white/20":""}`,children:[n.jsx("span",{className:"shrink-0",children:E.icon}),n.jsx("span",{className:"text-sm font-medium",children:E.title})]},E.id))})]})]})]})]})},fP=y.createContext(void 0),Iq=({children:e})=>{const[t,r]=y.useState(()=>localStorage.getItem("theme")||"light");y.useEffect(()=>{const s=document.documentElement;localStorage.setItem("theme",t),t==="dark"?s.classList.add("dark"):s.classList.remove("dark")},[t]);const a=()=>{r(s=>s==="light"?"dark":"light")};return n.jsx(fP.Provider,{value:{theme:t,toggleTheme:a},children:e})},zq=()=>{const e=y.useContext(fP);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e},Bq=()=>{const{theme:e,toggleTheme:t}=zq(),{language:r,changeLanguage:a}=XO(),{t:s}=sr(),{openMobileSidebar:i}=QO(),l=Ut(),[u,d]=y.useState(""),[f,p]=y.useState(!1);y.useEffect(()=>{fe(null,null,function*(){var v;try{const j=(yield(yield fetch("/api/method/frappe.auth.get_logged_user",{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"})).json()).message;if(j){const C=yield(yield fetch(`/api/resource/User/${encodeURIComponent(j)}?fields=["full_name"]`,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"})).json();(v=C.data)!=null&&v.full_name?d(C.data.full_name):d(j)}}catch(b){console.error("Error fetching user full name:",b)}})},[]);const m=()=>fe(null,null,function*(){var x;localStorage.removeItem("user"),localStorage.removeItem("sid");try{const v=((x=document.cookie.split("; ").find(b=>b.startsWith("X-Frappe-CSRF-Token=")))==null?void 0:x.split("=")[1])||"";yield fetch("/api/method/frappe.auth.logout",{method:"POST",headers:{"Content-Type":"application/json","X-Frappe-CSRF-Token":v},credentials:"include"}),yield fetch("/?cmd=web_logout",{credentials:"include"})}catch(v){console.error("Logout error:",v)}finally{window.location.href="/project_management/login"}});return n.jsxs("header",{className:"h-14 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-4 flex items-center justify-between gap-2 flex-shrink-0",children:[n.jsx("button",{type:"button",onClick:i,className:"lg:hidden p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-gray-700 dark:text-gray-300 -ms-1","aria-label":s("common.menu",{defaultValue:"Open menu"}),title:s("common.menu",{defaultValue:"Menu"}),children:n.jsx(tP,{size:22})}),n.jsx("div",{className:"flex-1 lg:flex-none","aria-hidden":"true"}),n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u&&n.jsxs("div",{className:"relative",children:[n.jsx("button",{type:"button",onClick:()=>l("/user-profile"),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),className:"p-2 rounded-lg bg-[#7911cc] hover:bg-[#6a0fb5] transition-colors text-white",title:u,children:n.jsx(eP,{size:20})}),f&&n.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 px-3 py-1.5 bg-gray-800 dark:bg-gray-700 text-white text-xs rounded-lg whitespace-nowrap shadow-lg",children:[u,n.jsx("div",{className:"absolute -top-1 right-3 w-2 h-2 bg-gray-800 dark:bg-gray-700 rotate-45"})]})]}),n.jsx("button",{onClick:()=>a(r==="en"?"ar":"en"),className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-gray-700 dark:text-gray-300",title:s("common.language"),children:n.jsx(YH,{size:20})}),n.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-gray-700 dark:text-gray-300",title:s(e==="light"?"common.darkMode":"common.lightMode"),children:e==="light"?n.jsx(nq,{size:20}):n.jsx(iq,{size:20})}),n.jsx("button",{onClick:m,className:"p-2 rounded-lg hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors text-red-600 dark:text-red-400",title:s("common.logout"),children:n.jsx(tq,{size:20})})]})]})};function hP(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=hP(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Wt(){for(var e,t,r=0,a="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=hP(e))&&(a&&(a+=" "),a+=t);return a}var Rh=e=>typeof e=="number"&&!isNaN(e),Yc=e=>typeof e=="string",Fo=e=>typeof e=="function",$q=e=>Yc(e)||Rh(e),Lw=e=>Yc(e)||Fo(e)?e:null,Uq=(e,t)=>e===!1||Rh(e)&&e>0?e:t,Iw=e=>y.isValidElement(e)||Yc(e)||Fo(e)||Rh(e);function Hq(e,t,r=300){let{scrollHeight:a,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=a+"px",s.transition=`all ${r}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,r)})})}function qq({enter:e,exit:t,appendPosition:r=!1,collapse:a=!0,collapseDuration:s=300}){return function({children:i,position:l,preventExitTransition:u,done:d,nodeRef:f,isIn:p,playToast:m}){let x=r?`${e}--${l}`:e,v=r?`${t}--${l}`:t,b=y.useRef(0);return y.useLayoutEffect(()=>{let w=f.current,j=x.split(" "),k=C=>{C.target===f.current&&(m(),w.removeEventListener("animationend",k),w.removeEventListener("animationcancel",k),b.current===0&&C.type!=="animationcancel"&&w.classList.remove(...j))};w.classList.add(...j),w.addEventListener("animationend",k),w.addEventListener("animationcancel",k)},[]),y.useEffect(()=>{let w=f.current,j=()=>{w.removeEventListener("animationend",j),a?Hq(w,d,s):d()};p||(u?j():(b.current=1,w.className+=` ${v}`,w.addEventListener("animationend",j)))},[p]),_t.createElement(_t.Fragment,null,i)}}function aT(e,t){return{content:pP(e.content,e.props),containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,reason:e.removalReason,status:t}}function pP(e,t,r=!1){return y.isValidElement(e)&&!Yc(e.type)?y.cloneElement(e,{closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:r}):Fo(e)?e({closeToast:t.closeToast,toastProps:t,data:t.data,isPaused:r}):e}function Wq({closeToast:e,theme:t,ariaLabel:r="close"}){return _t.createElement("button",{className:`Toastify__close-button Toastify__close-button--${t}`,type:"button",onClick:a=>{a.stopPropagation(),e(!0)},"aria-label":r},_t.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},_t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function Vq({delay:e,isRunning:t,closeToast:r,type:a="default",hide:s,className:i,controlledProgress:l,progress:u,rtl:d,isIn:f,theme:p}){let m=s||l&&u===0,x={animationDuration:`${e}ms`,animationPlayState:t?"running":"paused"};l&&(x.transform=`scaleX(${u})`);let v=Wt("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${p}`,`Toastify__progress-bar--${a}`,{"Toastify__progress-bar--rtl":d}),b=Fo(i)?i({rtl:d,type:a,defaultClassName:v}):Wt(v,i),w={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{f&&r()}};return _t.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":m},_t.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${p} Toastify__progress-bar--${a}`}),_t.createElement("div",ee({role:"progressbar","aria-hidden":m?"true":"false","aria-label":"notification timer","aria-valuenow":l?Math.round(u*100):void 0,"aria-valuemin":0,"aria-valuemax":100,className:b,style:x},w)))}var Gq=1,mP=()=>`${Gq++}`;function Kq(e,t,r){let a=1,s=0,i=[],l=[],u=t,d=new Map,f=new Set,p=C=>(f.add(C),()=>f.delete(C)),m=()=>{l=Array.from(d.values()),f.forEach(C=>C())},x=({containerId:C,toastId:N,updateId:O})=>{let E=C?C!==e:e!==1,A=d.has(N)&&O==null;return E||A},v=(C,N)=>{d.forEach(O=>{var E;(N==null||N===O.props.toastId)&&((E=O.toggle)==null||E.call(O,C))})},b=C=>{var N,O;C.isActive&&((O=(N=C.props)==null?void 0:N.onClose)==null||O.call(N,C.removalReason),C.isActive=!1,r(aT(C,"removed")))},w=C=>{if(C==null)d.forEach(b);else{let N=d.get(C);N&&b(N)}m()},j=()=>{s-=i.length,i=[]},k=C=>{var N,O;let{toastId:E,updateId:A}=C.props,T=A==null;C.staleId&&d.delete(C.staleId),C.isActive=!0,d.set(E,C),m(),r(aT(C,T?"added":"updated")),T&&((O=(N=C.props).onOpen)==null||O.call(N))};return{id:e,props:u,observe:p,toggle:v,removeToast:w,toasts:d,clearQueue:j,buildToast:(C,N)=>{if(x(N))return;let{toastId:O,updateId:E,data:A,staleId:T,delay:P}=N,D=E==null;D&&s++;let z=Se(ee(Se(ee({},u),{style:u.toastStyle,key:a++}),Object.fromEntries(Object.entries(N).filter(([V,ne])=>ne!=null))),{toastId:O,updateId:E,data:A,isIn:!1,className:Lw(N.className||u.toastClassName),progressClassName:Lw(N.progressClassName||u.progressClassName),autoClose:N.isLoading?!1:Uq(N.autoClose,u.autoClose),closeToast(V){let ne=d.get(O);ne&&(ne.removalReason=V,w(O))},deleteToast(){if(d.get(O)!=null){if(d.delete(O),s--,s<0&&(s=0),i.length>0){k(i.shift());return}m()}}});z.closeButton=u.closeButton,N.closeButton===!1||Iw(N.closeButton)?z.closeButton=N.closeButton:N.closeButton===!0&&(z.closeButton=Iw(u.closeButton)?u.closeButton:!0);let G={content:C,props:z,staleId:T};u.limit&&u.limit>0&&s>u.limit&&D?i.push(G):Rh(P)?setTimeout(()=>{k(G)},P):k(G)},setProps(C){u=C},setToggle:(C,N)=>{let O=d.get(C);O&&(O.toggle=N)},isToastActive:C=>{var N;return(N=d.get(C))==null?void 0:N.isActive},getSnapshot:()=>l}}var jn=new Map,ih=[],zw=new Set,Yq=e=>zw.forEach(t=>t(e)),gP=()=>jn.size>0;function Xq(){ih.forEach(e=>yP(e.content,e.options)),ih=[]}var Jq=(e,{containerId:t})=>{var r;return(r=jn.get(t||1))==null?void 0:r.toasts.get(e)};function xP(e,t){var r;if(t)return!!((r=jn.get(t))!=null&&r.isToastActive(e));let a=!1;return jn.forEach(s=>{s.isToastActive(e)&&(a=!0)}),a}function Qq(e){if(!gP()){ih=ih.filter(t=>e!=null&&t.options.toastId!==e);return}if(e==null||$q(e))jn.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=jn.get(e.containerId);t?t.removeToast(e.id):jn.forEach(r=>{r.removeToast(e.id)})}}var Zq=(e={})=>{jn.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})};function yP(e,t){Iw(e)&&(gP()||ih.push({content:e,options:t}),jn.forEach(r=>{r.buildToast(e,t)}))}function eW(e){var t;(t=jn.get(e.containerId||1))==null||t.setToggle(e.id,e.fn)}function vP(e,t){jn.forEach(r=>{(t==null||!(t!=null&&t.containerId)||(t==null?void 0:t.containerId)===r.id)&&r.toggle(e,t==null?void 0:t.id)})}function tW(e){let t=e.containerId||1;return{subscribe(r){let a=Kq(t,e,Yq);jn.set(t,a);let s=a.observe(r);return Xq(),()=>{s(),jn.delete(t)}},setProps(r){var a;(a=jn.get(t))==null||a.setProps(r)},getSnapshot(){var r;return(r=jn.get(t))==null?void 0:r.getSnapshot()}}}function rW(e){return zw.add(e),()=>{zw.delete(e)}}function aW(e){return e&&(Yc(e.toastId)||Rh(e.toastId))?e.toastId:mP()}function Fh(e,t){return yP(e,t),t.toastId}function Xx(e,t){return Se(ee({},t),{type:t&&t.type||e,toastId:aW(t)})}function Jx(e){return(t,r)=>Fh(t,Xx(e,r))}function $e(e,t){return Fh(e,Xx("default",t))}$e.loading=(e,t)=>Fh(e,Xx("default",ee({isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1},t)));function nW(e,{pending:t,error:r,success:a},s){let i;t&&(i=Yc(t)?$e.loading(t,s):$e.loading(t.render,ee(ee({},s),t)));let l={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(f,p,m)=>{if(p==null){$e.dismiss(i);return}let x=Se(ee(ee({type:f},l),s),{data:m}),v=Yc(p)?{render:p}:p;return i?$e.update(i,ee(ee({},x),v)):$e(v.render,ee(ee({},x),v)),m},d=Fo(e)?e():e;return d.then(f=>u("success",a,f)).catch(f=>u("error",r,f)),d}$e.promise=nW;$e.success=Jx("success");$e.info=Jx("info");$e.error=Jx("error");$e.warning=Jx("warning");$e.warn=$e.warning;$e.dark=(e,t)=>Fh(e,Xx("default",ee({theme:"dark"},t)));function sW(e){Qq(e)}$e.dismiss=sW;$e.clearWaitingQueue=Zq;$e.isActive=xP;$e.update=(e,t={})=>{let r=Jq(e,t);if(r){let{props:a,content:s}=r,i=Se(ee(ee({delay:100},a),t),{toastId:t.toastId||e,updateId:mP()});i.toastId!==e&&(i.staleId=e);let l=i.render||s;delete i.render,Fh(l,i)}};$e.done=e=>{$e.update(e,{progress:1})};$e.onChange=rW;$e.play=e=>vP(!0,e);$e.pause=e=>vP(!1,e);function iW(e){var t;let{subscribe:r,getSnapshot:a,setProps:s}=y.useRef(tW(e)).current;s(e);let i=(t=y.useSyncExternalStore(r,a,a))==null?void 0:t.slice();function l(u){if(!i)return[];let d=new Map;return e.newestOnTop&&i.reverse(),i.forEach(f=>{let{position:p}=f.props;d.has(p)||d.set(p,[]),d.get(p).push(f)}),Array.from(d,f=>u(f[0],f[1]))}return{getToastToRender:l,isToastActive:xP,count:i==null?void 0:i.length}}function oW(e){let[t,r]=y.useState(!1),[a,s]=y.useState(!1),i=y.useRef(null),l=y.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:u,pauseOnHover:d,closeToast:f,onClick:p,closeOnClick:m}=e;eW({id:e.toastId,containerId:e.containerId,fn:r}),y.useEffect(()=>{if(e.pauseOnFocusLoss)return x(),()=>{v()}},[e.pauseOnFocusLoss]);function x(){document.hasFocus()||k(),window.addEventListener("focus",j),window.addEventListener("blur",k)}function v(){window.removeEventListener("focus",j),window.removeEventListener("blur",k)}function b(T){if(e.draggable===!0||e.draggable===T.pointerType){C();let P=i.current;l.canCloseOnClick=!0,l.canDrag=!0,P.style.transition="none",e.draggableDirection==="x"?(l.start=T.clientX,l.removalDistance=P.offsetWidth*(e.draggablePercent/100)):(l.start=T.clientY,l.removalDistance=P.offsetHeight*(e.draggablePercent===80?e.draggablePercent*1.5:e.draggablePercent)/100)}}function w(T){let{top:P,bottom:D,left:z,right:G}=i.current.getBoundingClientRect();T.pointerType==="mouse"&&e.pauseOnHover&&T.clientX>=z&&T.clientX<=G&&T.clientY>=P&&T.clientY<=D?k():j()}function j(){r(!0)}function k(){r(!1)}function C(){l.didMove=!1,document.addEventListener("pointermove",O),document.addEventListener("pointerup",E)}function N(){document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",E)}function O(T){let P=i.current;if(l.canDrag&&P){l.didMove=!0,t&&k(),e.draggableDirection==="x"?l.delta=T.clientX-l.start:l.delta=T.clientY-l.start,l.start!==T.clientX&&(l.canCloseOnClick=!1);let D=e.draggableDirection==="x"?`${l.delta}px, var(--y)`:`0, calc(${l.delta}px + var(--y))`;P.style.transform=`translate3d(${D},0)`,P.style.opacity=`${1-Math.abs(l.delta/l.removalDistance)}`}}function E(){N();let T=i.current;if(l.canDrag&&l.didMove&&T){if(l.canDrag=!1,Math.abs(l.delta)>l.removalDistance){s(!0),e.closeToast(!0),e.collapseAll();return}T.style.transition="transform 0.2s, opacity 0.2s",T.style.removeProperty("transform"),T.style.removeProperty("opacity")}}let A={onPointerDown:b,onPointerUp:w};return u&&d&&(A.onMouseEnter=k,e.stacked||(A.onMouseLeave=j)),m&&(A.onClick=T=>{p&&p(T),l.canCloseOnClick&&f(!0)}),{playToast:j,pauseToast:k,isRunning:t,preventExitTransition:a,toastRef:i,eventHandlers:A}}var bP=typeof window!="undefined"?y.useLayoutEffect:y.useEffect,Qx=s=>{var i=s,{theme:e,type:t,isLoading:r}=i,a=ti(i,["theme","type","isLoading"]);return _t.createElement("svg",ee({viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`},a))};function lW(e){return _t.createElement(Qx,ee({},e),_t.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function cW(e){return _t.createElement(Qx,ee({},e),_t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function uW(e){return _t.createElement(Qx,ee({},e),_t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function dW(e){return _t.createElement(Qx,ee({},e),_t.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function fW(){return _t.createElement("div",{className:"Toastify__spinner"})}var Bw={info:cW,warning:lW,success:uW,error:dW,spinner:fW},hW=e=>e in Bw;function pW({theme:e,type:t,isLoading:r,icon:a}){let s=null,i={theme:e,type:t};return a===!1||(Fo(a)?s=a(Se(ee({},i),{isLoading:r})):y.isValidElement(a)?s=y.cloneElement(a,i):r?s=Bw.spinner():hW(t)&&(s=Bw[t](i))),s}var mW=e=>{let{isRunning:t,preventExitTransition:r,toastRef:a,eventHandlers:s,playToast:i}=oW(e),{closeButton:l,children:u,autoClose:d,onClick:f,type:p,hideProgressBar:m,closeToast:x,transition:v,position:b,className:w,style:j,progressClassName:k,updateId:C,role:N,progress:O,rtl:E,toastId:A,deleteToast:T,isIn:P,isLoading:D,closeOnClick:z,theme:G,ariaLabel:V}=e,ne=Wt("Toastify__toast",`Toastify__toast-theme--${G}`,`Toastify__toast--${p}`,{"Toastify__toast--rtl":E},{"Toastify__toast--close-on-click":z}),ge=Fo(w)?w({rtl:E,position:b,type:p,defaultClassName:ne}):Wt(ne,w),Z=pW(e),U=!!O||!d,ce={closeToast:x,type:p,theme:G},xe=null;return l===!1||(Fo(l)?xe=l(ce):y.isValidElement(l)?xe=y.cloneElement(l,ce):xe=Wq(ce)),_t.createElement(v,{isIn:P,done:T,position:b,preventExitTransition:r,nodeRef:a,playToast:i},_t.createElement("div",ee(Se(ee({id:A,tabIndex:0,onClick:f,"data-in":P,className:ge},s),{style:j,ref:a}),P&&{role:N,"aria-label":V}),Z!=null&&_t.createElement("div",{className:Wt("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!D})},Z),pP(u,e,!t),xe,!e.customProgressBar&&_t.createElement(Vq,Se(ee({},C&&!U?{key:`p-${C}`}:{}),{rtl:E,theme:G,delay:d,isRunning:t,isIn:P,closeToast:x,hide:m,type:p,className:k,controlledProgress:U,progress:O||0}))))},gW=(e,t=!1)=>({enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}),wP=qq(gW("bounce",!0)),xW={position:"top-right",transition:wP,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:e=>e.altKey&&e.code==="KeyT"};function yW(e){let t=ee(ee({},xW),e),r=e.stacked,[a,s]=y.useState(!0),i=y.useRef(null),{getToastToRender:l,isToastActive:u,count:d}=iW(t),{className:f,style:p,rtl:m,containerId:x,hotKeys:v}=t;function b(j){let k=Wt("Toastify__toast-container",`Toastify__toast-container--${j}`,{"Toastify__toast-container--rtl":m});return Fo(f)?f({position:j,rtl:m,defaultClassName:k}):Wt(k,Lw(f))}function w(){r&&(s(!0),$e.play())}return bP(()=>{var j;if(r){let k=i.current.querySelectorAll('[data-in="true"]'),C=12,N=(j=t.position)==null?void 0:j.includes("top"),O=0,E=0;Array.from(k).reverse().forEach((A,T)=>{let P=A;P.classList.add("Toastify__toast--stacked"),T>0&&(P.dataset.collapsed=`${a}`),P.dataset.pos||(P.dataset.pos=N?"top":"bot");let D=O*(a?.2:1)+(a?0:C*T),z=Math.max(.5,1-(a?E:0));P.style.setProperty("--y",`${N?D:D*-1}px`),P.style.setProperty("--g",`${C}`),P.style.setProperty("--s",`${z}`),O+=P.offsetHeight,E+=.025})}},[a,d,r]),y.useEffect(()=>{function j(k){var C;let N=i.current;v(k)&&((C=N==null?void 0:N.querySelector('[tabIndex="0"]'))==null||C.focus(),s(!1),$e.pause()),k.key==="Escape"&&(document.activeElement===N||N!=null&&N.contains(document.activeElement))&&(s(!0),$e.play())}return document.addEventListener("keydown",j),()=>{document.removeEventListener("keydown",j)}},[v]),_t.createElement("section",{ref:i,className:"Toastify",id:x,onMouseEnter:()=>{r&&(s(!1),$e.pause())},onMouseLeave:w,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":t["aria-label"]},l((j,k)=>{let C=k.length?ee({},p):Se(ee({},p),{pointerEvents:"none"});return _t.createElement("div",{tabIndex:-1,className:b(j),"data-stacked":r,style:C,key:`c-${j}`},k.map(({content:N,props:O})=>_t.createElement(mW,Se(ee({},O),{stacked:r,collapseAll:w,isIn:u(O.toastId,O.containerId),key:`t-${O.key}`}),N)))}))}var vW=`:root {
--toastify-color-light: #fff;
--toastify-color-dark: #121212;
--toastify-color-info: #3498db;
--toastify-color-success: #07bc0c;
--toastify-color-warning: #f1c40f;
--toastify-color-error: hsl(6, 78%, 57%);
--toastify-color-transparent: rgba(255, 255, 255, 0.7);
--toastify-icon-color-info: var(--toastify-color-info);
--toastify-icon-color-success: var(--toastify-color-success);
--toastify-icon-color-warning: var(--toastify-color-warning);
--toastify-icon-color-error: var(--toastify-color-error);
--toastify-container-width: fit-content;
--toastify-toast-width: 320px;
--toastify-toast-offset: 16px;
--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));
--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));
--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));
--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));
--toastify-toast-background: #fff;
--toastify-toast-padding: 14px;
--toastify-toast-min-height: 64px;
--toastify-toast-max-height: 800px;
--toastify-toast-bd-radius: 6px;
--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
--toastify-font-family: sans-serif;
--toastify-z-index: 9999;
--toastify-text-color-light: #757575;
--toastify-text-color-dark: #fff;
/* Used only for colored theme */
--toastify-text-color-info: #fff;
--toastify-text-color-success: #fff;
--toastify-text-color-warning: #fff;
--toastify-text-color-error: #fff;
--toastify-spinner-color: #616161;
--toastify-spinner-color-empty-area: #e0e0e0;
--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);
--toastify-color-progress-dark: #bb86fc;
--toastify-color-progress-info: var(--toastify-color-info);
--toastify-color-progress-success: var(--toastify-color-success);
--toastify-color-progress-warning: var(--toastify-color-warning);
--toastify-color-progress-error: var(--toastify-color-error);
/* used to control the opacity of the progress trail */
--toastify-color-progress-bgo: 0.2;
}
.Toastify__toast-container {
z-index: var(--toastify-z-index);
-webkit-transform: translate3d(0, 0, var(--toastify-z-index));
position: fixed;
width: var(--toastify-container-width);
box-sizing: border-box;
color: #fff;
display: flex;
flex-direction: column;
}
.Toastify__toast-container--top-left {
top: var(--toastify-toast-top);
left: var(--toastify-toast-left);
}
.Toastify__toast-container--top-center {
top: var(--toastify-toast-top);
left: 50%;
transform: translateX(-50%);
align-items: center;
}
.Toastify__toast-container--top-right {
top: var(--toastify-toast-top);
right: var(--toastify-toast-right);
align-items: end;
}
.Toastify__toast-container--bottom-left {
bottom: var(--toastify-toast-bottom);
left: var(--toastify-toast-left);
}
.Toastify__toast-container--bottom-center {
bottom: var(--toastify-toast-bottom);
left: 50%;
transform: translateX(-50%);
align-items: center;
}
.Toastify__toast-container--bottom-right {
bottom: var(--toastify-toast-bottom);
right: var(--toastify-toast-right);
align-items: end;
}
.Toastify__toast {
--y: 0px;
position: relative;
touch-action: none;
width: var(--toastify-toast-width);
min-height: var(--toastify-toast-min-height);
box-sizing: border-box;
margin-bottom: 1rem;
padding: var(--toastify-toast-padding);
border-radius: var(--toastify-toast-bd-radius);
box-shadow: var(--toastify-toast-shadow);
max-height: var(--toastify-toast-max-height);
font-family: var(--toastify-font-family);
/* webkit only issue #791 */
z-index: 0;
/* inner swag */
display: flex;
flex: 1 auto;
align-items: center;
word-break: break-word;
}
@media only screen and (max-width: 480px) {
.Toastify__toast-container {
width: 100vw;
left: env(safe-area-inset-left);
margin: 0;
}
.Toastify__toast-container--top-left,
.Toastify__toast-container--top-center,
.Toastify__toast-container--top-right {
top: env(safe-area-inset-top);
transform: translateX(0);
}
.Toastify__toast-container--bottom-left,
.Toastify__toast-container--bottom-center,
.Toastify__toast-container--bottom-right {
bottom: env(safe-area-inset-bottom);
transform: translateX(0);
}
.Toastify__toast-container--rtl {
right: env(safe-area-inset-right);
left: initial;
}
.Toastify__toast {
--toastify-toast-width: 100%;
margin-bottom: 0;
border-radius: 0;
}
}
.Toastify__toast-container[data-stacked='true'] {
width: var(--toastify-toast-width);
}
@media only screen and (max-width: 480px) {
.Toastify__toast-container[data-stacked='true'] {
width: 100vw;
}
}
.Toastify__toast--stacked {
position: absolute;
width: 100%;
transform: translate3d(0, var(--y), 0) scale(var(--s));
transition: transform 0.3s;
}
.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,
.Toastify__toast--stacked[data-collapsed] .Toastify__close-button {
transition: opacity 0.1s;
}
.Toastify__toast--stacked[data-collapsed='false'] {
overflow: visible;
}
.Toastify__toast--stacked[data-collapsed='true']:not(:last-child) > * {
opacity: 0;
}
.Toastify__toast--stacked:after {
content: '';
position: absolute;
left: 0;
right: 0;
height: calc(var(--g) * 1px);
bottom: 100%;
}
.Toastify__toast--stacked[data-pos='top'] {
top: 0;
}
.Toastify__toast--stacked[data-pos='bot'] {
bottom: 0;
}
.Toastify__toast--stacked[data-pos='bot'].Toastify__toast--stacked:before {
transform-origin: top;
}
.Toastify__toast--stacked[data-pos='top'].Toastify__toast--stacked:before {
transform-origin: bottom;
}
.Toastify__toast--stacked:before {
content: '';
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 100%;
transform: scaleY(3);
z-index: -1;
}
.Toastify__toast--rtl {
direction: rtl;
}
.Toastify__toast--close-on-click {
cursor: pointer;
}
.Toastify__toast-icon {
margin-inline-end: 10px;
width: 22px;
flex-shrink: 0;
display: flex;
}
.Toastify--animate {
animation-fill-mode: both;
animation-duration: 0.5s;
}
.Toastify--animate-icon {
animation-fill-mode: both;
animation-duration: 0.3s;
}
.Toastify__toast-theme--dark {
background: var(--toastify-color-dark);
color: var(--toastify-text-color-dark);
}
.Toastify__toast-theme--light {
background: var(--toastify-color-light);
color: var(--toastify-text-color-light);
}
.Toastify__toast-theme--colored.Toastify__toast--default {
background: var(--toastify-color-light);
color: var(--toastify-text-color-light);
}
.Toastify__toast-theme--colored.Toastify__toast--info {
color: var(--toastify-text-color-info);
background: var(--toastify-color-info);
}
.Toastify__toast-theme--colored.Toastify__toast--success {
color: var(--toastify-text-color-success);
background: var(--toastify-color-success);
}
.Toastify__toast-theme--colored.Toastify__toast--warning {
color: var(--toastify-text-color-warning);
background: var(--toastify-color-warning);
}
.Toastify__toast-theme--colored.Toastify__toast--error {
color: var(--toastify-text-color-error);
background: var(--toastify-color-error);
}
.Toastify__progress-bar-theme--light {
background: var(--toastify-color-progress-light);
}
.Toastify__progress-bar-theme--dark {
background: var(--toastify-color-progress-dark);
}
.Toastify__progress-bar--info {
background: var(--toastify-color-progress-info);
}
.Toastify__progress-bar--success {
background: var(--toastify-color-progress-success);
}
.Toastify__progress-bar--warning {
background: var(--toastify-color-progress-warning);
}
.Toastify__progress-bar--error {
background: var(--toastify-color-progress-error);
}
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error {
background: var(--toastify-color-transparent);
}
.Toastify__close-button {
color: #fff;
position: absolute;
top: 6px;
right: 6px;
background: transparent;
outline: none;
border: none;
padding: 0;
cursor: pointer;
opacity: 0.7;
transition: 0.3s ease;
z-index: 1;
}
.Toastify__toast--rtl .Toastify__close-button {
left: 6px;
right: unset;
}
.Toastify__close-button--light {
color: #000;
opacity: 0.3;
}
.Toastify__close-button > svg {
fill: currentColor;
height: 16px;
width: 14px;
}
.Toastify__close-button:hover,
.Toastify__close-button:focus {
opacity: 1;
}
@keyframes Toastify__trackProgress {
0% {
transform: scaleX(1);
}
100% {
transform: scaleX(0);
}
}
.Toastify__progress-bar {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
opacity: 0.7;
transform-origin: left;
}
.Toastify__progress-bar--animated {
animation: Toastify__trackProgress linear 1 forwards;
}
.Toastify__progress-bar--controlled {
transition: transform 0.2s;
}
.Toastify__progress-bar--rtl {
right: 0;
left: initial;
transform-origin: right;
border-bottom-left-radius: initial;
}
.Toastify__progress-bar--wrp {
position: absolute;
overflow: hidden;
bottom: 0;
left: 0;
width: 100%;
height: 5px;
border-bottom-left-radius: var(--toastify-toast-bd-radius);
border-bottom-right-radius: var(--toastify-toast-bd-radius);
}
.Toastify__progress-bar--wrp[data-hidden='true'] {
opacity: 0;
}
.Toastify__progress-bar--bg {
opacity: var(--toastify-color-progress-bgo);
width: 100%;
height: 100%;
}
.Toastify__spinner {
width: 20px;
height: 20px;
box-sizing: border-box;
border: 2px solid;
border-radius: 100%;
border-color: var(--toastify-spinner-color-empty-area);
border-right-color: var(--toastify-spinner-color);
animation: Toastify__spin 0.65s linear infinite;
}
@keyframes Toastify__bounceInRight {
from,
60%,
75%,
90%,
to {
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
from {
opacity: 0;
transform: translate3d(3000px, 0, 0);
}
60% {
opacity: 1;
transform: translate3d(-25px, 0, 0);
}
75% {
transform: translate3d(10px, 0, 0);
}
90% {
transform: translate3d(-5px, 0, 0);
}
to {
transform: none;
}
}
@keyframes Toastify__bounceOutRight {
20% {
opacity: 1;
transform: translate3d(-20px, var(--y), 0);
}
to {
opacity: 0;
transform: translate3d(2000px, var(--y), 0);
}
}
@keyframes Toastify__bounceInLeft {
from,
60%,
75%,
90%,
to {
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
0% {
opacity: 0;
transform: translate3d(-3000px, 0, 0);
}
60% {
opacity: 1;
transform: translate3d(25px, 0, 0);
}
75% {
transform: translate3d(-10px, 0, 0);
}
90% {
transform: translate3d(5px, 0, 0);
}
to {
transform: none;
}
}
@keyframes Toastify__bounceOutLeft {
20% {
opacity: 1;
transform: translate3d(20px, var(--y), 0);
}
to {
opacity: 0;
transform: translate3d(-2000px, var(--y), 0);
}
}
@keyframes Toastify__bounceInUp {
from,
60%,
75%,
90%,
to {
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
from {
opacity: 0;
transform: translate3d(0, 3000px, 0);
}
60% {
opacity: 1;
transform: translate3d(0, -20px, 0);
}
75% {
transform: translate3d(0, 10px, 0);
}
90% {
transform: translate3d(0, -5px, 0);
}
to {
transform: translate3d(0, 0, 0);
}
}
@keyframes Toastify__bounceOutUp {
20% {
transform: translate3d(0, calc(var(--y) - 10px), 0);
}
40%,
45% {
opacity: 1;
transform: translate3d(0, calc(var(--y) + 20px), 0);
}
to {
opacity: 0;
transform: translate3d(0, -2000px, 0);
}
}
@keyframes Toastify__bounceInDown {
from,
60%,
75%,
90%,
to {
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
0% {
opacity: 0;
transform: translate3d(0, -3000px, 0);
}
60% {
opacity: 1;
transform: translate3d(0, 25px, 0);
}
75% {
transform: translate3d(0, -10px, 0);
}
90% {
transform: translate3d(0, 5px, 0);
}
to {
transform: none;
}
}
@keyframes Toastify__bounceOutDown {
20% {
transform: translate3d(0, calc(var(--y) - 10px), 0);
}
40%,
45% {
opacity: 1;
transform: translate3d(0, calc(var(--y) + 20px), 0);
}
to {
opacity: 0;
transform: translate3d(0, 2000px, 0);
}
}
.Toastify__bounce-enter--top-left,
.Toastify__bounce-enter--bottom-left {
animation-name: Toastify__bounceInLeft;
}
.Toastify__bounce-enter--top-right,
.Toastify__bounce-enter--bottom-right {
animation-name: Toastify__bounceInRight;
}
.Toastify__bounce-enter--top-center {
animation-name: Toastify__bounceInDown;
}
.Toastify__bounce-enter--bottom-center {
animation-name: Toastify__bounceInUp;
}
.Toastify__bounce-exit--top-left,
.Toastify__bounce-exit--bottom-left {
animation-name: Toastify__bounceOutLeft;
}
.Toastify__bounce-exit--top-right,
.Toastify__bounce-exit--bottom-right {
animation-name: Toastify__bounceOutRight;
}
.Toastify__bounce-exit--top-center {
animation-name: Toastify__bounceOutUp;
}
.Toastify__bounce-exit--bottom-center {
animation-name: Toastify__bounceOutDown;
}
@keyframes Toastify__zoomIn {
from {
opacity: 0;
transform: scale3d(0.3, 0.3, 0.3);
}
50% {
opacity: 1;
}
}
@keyframes Toastify__zoomOut {
from {
opacity: 1;
}
50% {
opacity: 0;
transform: translate3d(0, var(--y), 0) scale3d(0.3, 0.3, 0.3);
}
to {
opacity: 0;
}
}
.Toastify__zoom-enter {
animation-name: Toastify__zoomIn;
}
.Toastify__zoom-exit {
animation-name: Toastify__zoomOut;
}
@keyframes Toastify__flipIn {
from {
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
animation-timing-function: ease-in;
opacity: 0;
}
40% {
transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
animation-timing-function: ease-in;
}
60% {
transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
opacity: 1;
}
80% {
transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
}
to {
transform: perspective(400px);
}
}
@keyframes Toastify__flipOut {
from {
transform: translate3d(0, var(--y), 0) perspective(400px);
}
30% {
transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, -20deg);
opacity: 1;
}
to {
transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, 90deg);
opacity: 0;
}
}
.Toastify__flip-enter {
animation-name: Toastify__flipIn;
}
.Toastify__flip-exit {
animation-name: Toastify__flipOut;
}
@keyframes Toastify__slideInRight {
from {
transform: translate3d(110%, 0, 0);
visibility: visible;
}
to {
transform: translate3d(0, var(--y), 0);
}
}
@keyframes Toastify__slideInLeft {
from {
transform: translate3d(-110%, 0, 0);
visibility: visible;
}
to {
transform: translate3d(0, var(--y), 0);
}
}
@keyframes Toastify__slideInUp {
from {
transform: translate3d(0, 110%, 0);
visibility: visible;
}
to {
transform: translate3d(0, var(--y), 0);
}
}
@keyframes Toastify__slideInDown {
from {
transform: translate3d(0, -110%, 0);
visibility: visible;
}
to {
transform: translate3d(0, var(--y), 0);
}
}
@keyframes Toastify__slideOutRight {
from {
transform: translate3d(0, var(--y), 0);
}
to {
visibility: hidden;
transform: translate3d(110%, var(--y), 0);
}
}
@keyframes Toastify__slideOutLeft {
from {
transform: translate3d(0, var(--y), 0);
}
to {
visibility: hidden;
transform: translate3d(-110%, var(--y), 0);
}
}
@keyframes Toastify__slideOutDown {
from {
transform: translate3d(0, var(--y), 0);
}
to {
visibility: hidden;
transform: translate3d(0, 500px, 0);
}
}
@keyframes Toastify__slideOutUp {
from {
transform: translate3d(0, var(--y), 0);
}
to {
visibility: hidden;
transform: translate3d(0, -500px, 0);
}
}
.Toastify__slide-enter--top-left,
.Toastify__slide-enter--bottom-left {
animation-name: Toastify__slideInLeft;
}
.Toastify__slide-enter--top-right,
.Toastify__slide-enter--bottom-right {
animation-name: Toastify__slideInRight;
}
.Toastify__slide-enter--top-center {
animation-name: Toastify__slideInDown;
}
.Toastify__slide-enter--bottom-center {
animation-name: Toastify__slideInUp;
}
.Toastify__slide-exit--top-left,
.Toastify__slide-exit--bottom-left {
animation-name: Toastify__slideOutLeft;
animation-timing-function: ease-in;
animation-duration: 0.3s;
}
.Toastify__slide-exit--top-right,
.Toastify__slide-exit--bottom-right {
animation-name: Toastify__slideOutRight;
animation-timing-function: ease-in;
animation-duration: 0.3s;
}
.Toastify__slide-exit--top-center {
animation-name: Toastify__slideOutUp;
animation-timing-function: ease-in;
animation-duration: 0.3s;
}
.Toastify__slide-exit--bottom-center {
animation-name: Toastify__slideOutDown;
animation-timing-function: ease-in;
animation-duration: 0.3s;
}
@keyframes Toastify__spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
`,nT=new Map,bW=(e,t)=>{bP(()=>{if(typeof document=="undefined")return;let r=document,a=nT.get(r);if(a){t&&a.setAttribute("nonce",t);return}let s=r.createElement("style");s.textContent=e,t&&s.setAttribute("nonce",t),r.head.appendChild(s),nT.set(r,s)},[t])};function Br(e){return bW(vW,e.nonce),_t.createElement(yW,ee({},e))}const jP={Location:{doctype:"Location",title:"Create New Location",titleField:"location_name",fields:[{fieldname:"location_name",label:"Location Name",fieldtype:"Data",required:!0,placeholder:"Enter location name"},{fieldname:"parent_location",label:"Parent Location",fieldtype:"Link",linkDoctype:"Location",placeholder:"Select parent location (optional)"},{fieldname:"is_group",label:"Is Group",fieldtype:"Check",defaultValue:0,description:"Check if this location contains sub-locations"},{fieldname:"latitude",label:"Latitude",fieldtype:"Float",placeholder:"e.g., 24.7136"},{fieldname:"longitude",label:"Longitude",fieldtype:"Float",placeholder:"e.g., 46.6753"}]},Room:{doctype:"Room",title:"Create New Room",titleField:"name",fields:[{fieldname:"room",label:"Room Name/Number",fieldtype:"Data",required:!0,placeholder:"Enter room name or number"},{fieldname:"building",label:"Building",fieldtype:"Link",linkDoctype:"Building",placeholder:"Select building"},{fieldname:"location_name",label:"Location Name",fieldtype:"Link",linkDoctype:"Location",placeholder:"Select Location"},{fieldname:"department",label:"Department",fieldtype:"Link",linkDoctype:"Department",placeholder:"Select department"}]},Building:{doctype:"Building",title:"Create New Building",titleField:"name",fields:[{fieldname:"building",label:"Building Name",fieldtype:"Data",required:!0,placeholder:"Enter building name"}]},"Extension Directory":{doctype:"Extension Directory",title:"Create New Extension",titleField:"name",fields:[{fieldname:"extension_number",label:"Extension Number",fieldtype:"Data",required:!0,placeholder:"Enter extension number"}]},Department:{doctype:"Department",title:"Create New Department",titleField:"department_name",fields:[{fieldname:"department_name",label:"Department Name",fieldtype:"Data",required:!0,placeholder:"Enter department name"},{fieldname:"company",label:"Company",fieldtype:"Link",linkDoctype:"Company",required:!0,placeholder:"Select company"},{fieldname:"parent_department",label:"Parent Department",fieldtype:"Link",linkDoctype:"Department",placeholder:"Select parent department"},{fieldname:"is_group",label:"Is Group",fieldtype:"Check",defaultValue:0}]},"Issue Type":{doctype:"Issue Type",title:"Create New Issue Type",titleField:"name",fields:[{fieldname:"__newname",label:"Issue Type Name",fieldtype:"Data",required:!0,placeholder:"Enter issue type name"},{fieldname:"description",label:"Description",fieldtype:"Text",placeholder:"Enter description"}]},Manufacturer:{doctype:"Manufacturer",title:"Create New Manufacturer",titleField:"name",fields:[{fieldname:"short_name",label:"Manufacturer Name",fieldtype:"Data",required:!0,placeholder:"Enter manufacturer name"},{fieldname:"full_name",label:"Full Name",fieldtype:"Data",placeholder:"Enter full company name"},{fieldname:"website",label:"Website",fieldtype:"Data",placeholder:"https://example.com"},{fieldname:"country",label:"Country",fieldtype:"Link",linkDoctype:"Country",placeholder:"Select country"}]},Supplier:{doctype:"Supplier",title:"Create New Supplier",titleField:"supplier_name",fields:[{fieldname:"supplier_name",label:"Supplier Name",fieldtype:"Data",required:!0,placeholder:"Enter supplier name"},{fieldname:"supplier_group",label:"Supplier Group",fieldtype:"Link",linkDoctype:"Supplier Group",placeholder:"Select supplier group"},{fieldname:"supplier_type",label:"Supplier Type",fieldtype:"Select",options:["Company","Individual"],defaultValue:"Company"},{fieldname:"country",label:"Country",fieldtype:"Link",linkDoctype:"Country",placeholder:"Select country"}]},Warehouse:{doctype:"Warehouse",title:"Create New Warehouse",titleField:"warehouse_name",fields:[{fieldname:"warehouse_name",label:"Warehouse Name",fieldtype:"Data",required:!0,placeholder:"Enter warehouse name"},{fieldname:"company",label:"Company",fieldtype:"Link",linkDoctype:"Company",required:!0,placeholder:"Select company"},{fieldname:"parent_warehouse",label:"Parent Warehouse",fieldtype:"Link",linkDoctype:"Warehouse",placeholder:"Select parent warehouse"},{fieldname:"is_group",label:"Is Group",fieldtype:"Check",defaultValue:0}]},Item:{doctype:"Item",title:"Create New Item",titleField:"item_name",fields:[{fieldname:"item_code",label:"Item Code",fieldtype:"Data",required:!0,placeholder:"Enter item code"},{fieldname:"item_name",label:"Item Name",fieldtype:"Data",required:!0,placeholder:"Enter item name"},{fieldname:"item_group",label:"Item Group",fieldtype:"Link",linkDoctype:"Item Group",required:!0,placeholder:"Select item group"},{fieldname:"stock_uom",label:"Default Unit of Measure",fieldtype:"Link",linkDoctype:"UOM",required:!0,defaultValue:"Nos",placeholder:"Select UOM"},{fieldname:"is_stock_item",label:"Maintain Stock",fieldtype:"Check",defaultValue:1},{fieldname:"description",label:"Description",fieldtype:"Text",placeholder:"Enter item description"}]},Asset:{doctype:"Asset",title:"Create New Asset",titleField:"asset_name",fields:[{fieldname:"asset_name",label:"Asset Name",fieldtype:"Data",required:!0,placeholder:"Enter asset name"},{fieldname:"item_code",label:"Item Code",fieldtype:"Link",linkDoctype:"Item",required:!0,linkFilters:{is_fixed_asset:1},placeholder:"Select item"},{fieldname:"company",label:"Company",fieldtype:"Link",linkDoctype:"Company",required:!0,placeholder:"Select company"},{fieldname:"location",label:"Location",fieldtype:"Link",linkDoctype:"Location",placeholder:"Select location"},{fieldname:"custodian",label:"Custodian",fieldtype:"Link",linkDoctype:"Employee",placeholder:"Select custodian"}]},"Technical Department":{doctype:"Technical Department",title:"Create New Technical Department",titleField:"name",fields:[{fieldname:"department",label:"Department Name",fieldtype:"Data",required:!0,placeholder:"Enter technical department name"}]}},wW=e=>jP[e]||null,jW=e=>e in jP,yf=new Map,_W=e=>fe(null,null,function*(){var t;try{return((t=(yield(yield fetch("/api/method/asset_lite.api.user_roles.check_has_role",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({roles:e.join(",")})})).json()).message)==null?void 0:t.has_role)===!0}catch(r){return console.error("[PermissionService] Error checking roles:",r),!1}}),kW=e=>fe(null,null,function*(){var r,a,s,i;const t=`create_${e}`;if(yf.has(t)){const l=yf.get(t);return console.log(`[PermissionService] ${e} (cached): ${l}`),l}console.log(`[PermissionService] Checking create permission for: ${e}`);try{const u=yield(yield fetch("/api/method/asset_lite.api.user_roles.has_create_permission",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({doctype:e})})).json();console.log(`[PermissionService] has_create_permission response for ${e}:`,u);const d=((r=u.message)==null?void 0:r.has_permission)===!0;return console.log(d?`[PermissionService] ${e}: Permission GRANTED via ${(a=u.message)==null?void 0:a.reason} (role: ${(s=u.message)==null?void 0:s.role})`:`[PermissionService] ${e}: Permission DENIED - ${(i=u.message)==null?void 0:i.reason}`),yf.set(t,d),d}catch(l){console.error(`[PermissionService] Error checking permission for ${e}:`,l);try{if(yield _W(["System Manager","Administrator"]))return console.log("[PermissionService] Fallback: User is admin, granting permission"),yf.set(t,!0),!0}catch(u){console.error("[PermissionService] Fallback check failed:",u)}return yf.set(t,!1),!1}}),SW=({doctype:e,value:t,onChange:r,disabled:a=!1,placeholder:s="Search...",filters:i={}})=>{const[l,u]=y.useState(""),[d,f]=y.useState([]),[p,m]=y.useState(!1),[x,v]=y.useState(!1),b=y.useRef(null),w=y.useRef(null),j=y.useCallback((N="")=>fe(null,null,function*(){if(e){v(!0);try{const O=new URLSearchParams({doctype:e,txt:N,page_length:"20"});i&&Object.keys(i).length>0&&O.append("filters",JSON.stringify(i));const E=yield Ja.apiCall(`/api/method/frappe.desk.search.search_link?${O.toString()}`);f(E||[])}catch(O){console.error(`Error fetching ${e} links:`,O),f([])}finally{v(!1)}}}),[e,i]);y.useEffect(()=>{if(p)return w.current&&clearTimeout(w.current),w.current=setTimeout(()=>j(l),300),()=>{w.current&&clearTimeout(w.current)}},[l,p,j]),y.useEffect(()=>{p&&j(l)},[p]),y.useEffect(()=>{const N=O=>{b.current&&!b.current.contains(O.target)&&(m(!1),u(""))};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]);const k=N=>{r(N),u(""),m(!1)},C=()=>{r(""),u("")};return n.jsxs("div",{ref:b,className:"relative",children:[n.jsxs("div",{className:"relative",children:[n.jsx(fn,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",size:12}),n.jsx("input",{type:"text",value:p?l:t,placeholder:s,disabled:a,className:`w-full pl-9 pr-8 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-md
focus:outline-none focus:ring-2 focus:ring-blue-500
disabled:bg-gray-100 dark:disabled:bg-gray-700
bg-white dark:bg-gray-700 text-gray-900 dark:text-white`,onFocus:()=>!a&&m(!0),onChange:N=>{u(N.target.value),m(!0)}}),t&&!a&&!p&&n.jsx("button",{type:"button",onClick:C,className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:n.jsx(yt,{size:12})})]}),p&&!a&&n.jsx("div",{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-md shadow-lg max-h-40 overflow-auto",children:x?n.jsxs("div",{className:"p-3 text-center text-gray-500 dark:text-gray-400 text-sm",children:[n.jsx(vt,{className:"animate-spin inline mr-2",size:12}),"Loading..."]}):d.length>0?n.jsx("ul",{children:d.map((N,O)=>n.jsxs("li",{onClick:()=>k(N.value),className:`px-3 py-2 cursor-pointer text-sm hover:bg-blue-500 hover:text-white
${t===N.value?"bg-blue-50 dark:bg-blue-900/30":""}`,children:[N.value,N.description&&n.jsx("span",{className:"text-xs text-gray-500 ml-2",children:N.description})]},O))}):n.jsx("div",{className:"p-3 text-center text-gray-500 dark:text-gray-400 text-sm",children:"No results found"})})]})},NW=({doctype:e,isOpen:t,onClose:r,onSuccess:a,initialValues:s={},parentFilters:i={},customConfig:l})=>{const[u,d]=y.useState({}),[f,p]=y.useState({}),[m,x]=y.useState(!1),[v,b]=y.useState(null);y.useEffect(()=>{const N=l||wW(e);if(b(N),N){const O={};N.fields.forEach(E=>{E.defaultValue!==void 0?O[E.fieldname]=E.defaultValue:E.fieldtype==="Check"?O[E.fieldname]=0:O[E.fieldname]=""}),d(ee(ee({},O),s))}},[e,l,s]),y.useEffect(()=>{if(t&&v){const N={};v.fields.forEach(O=>{O.defaultValue!==void 0?N[O.fieldname]=O.defaultValue:O.fieldtype==="Check"?N[O.fieldname]=0:N[O.fieldname]=""}),d(ee(ee({},N),s)),p({})}},[t,v,s]);const w=y.useCallback((N,O)=>{d(E=>Se(ee({},E),{[N]:O})),p(E=>{const A=ee({},E);return delete A[N],A})},[]),j=y.useCallback(()=>{if(!v)return!1;const N={};if(v.fields.forEach(O=>{if(O.required&&!O.hidden){const E=u[O.fieldname];(E==null||E==="")&&(N[O.fieldname]=`${O.label} is required`)}}),v.validateBeforeCreate){const O=v.validateBeforeCreate(u);if(O)return $e.error(O,{position:"top-right",autoClose:4e3,icon:n.jsx(So,{})}),!1}return p(N),Object.keys(N).length===0},[v,u]),k=N=>fe(null,null,function*(){if(N.preventDefault(),!(!j()||!v)){x(!0);try{const O={};Object.entries(u).forEach(([A,T])=>{T!==""&&T!==null&&T!==void 0&&(O[A]=T)});const E=yield Ja.apiCall(`/api/resource/${v.doctype}`,{method:"POST",body:JSON.stringify(O)});if(E!=null&&E.data){const A=E.data;$e.success(`${v.title.replace("Create New ","")} created successfully!`,{position:"top-right",autoClose:3e3,icon:n.jsx(Or,{})}),v.afterCreate&&v.afterCreate(A),a(A),r()}else throw new Error("Failed to create record")}catch(O){console.error("Error creating record:",O);const E=O instanceof Error?O.message:"Unknown error occurred";E.includes("Duplicate")||E.includes("already exists")?$e.error("A record with this name already exists. Please use a different name.",{position:"top-right",autoClose:5e3,icon:n.jsx(Fr,{})}):$e.error(`Failed to create: ${E}`,{position:"top-right",autoClose:5e3,icon:n.jsx(Fr,{})})}finally{x(!1)}}}),C=N=>{if(N.hidden)return null;const O=u[N.fieldname],E=f[N.fieldname],A=N.readOnly||m;if(N.dependsOn&&!u[N.dependsOn])return null;const T=`w-full px-3 py-2 text-sm border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500
${E?"border-red-500":"border-gray-300 dark:border-gray-600"}
${A?"bg-gray-100 dark:bg-gray-700 cursor-not-allowed":"bg-white dark:bg-gray-700"}
text-gray-900 dark:text-white`;switch(N.fieldtype){case"Data":return n.jsx("input",{type:"text",value:O||"",onChange:P=>w(N.fieldname,P.target.value),placeholder:N.placeholder,disabled:A,className:T});case"Text":return n.jsx("textarea",{value:O||"",onChange:P=>w(N.fieldname,P.target.value),placeholder:N.placeholder,disabled:A,rows:3,className:`${T} resize-none`});case"Select":return n.jsxs("select",{value:O||"",onChange:P=>w(N.fieldname,P.target.value),disabled:A,className:T,children:[n.jsxs("option",{value:"",children:["Select ",N.label]}),(N.options||[]).map(P=>{const D=typeof P=="string"?P:P.value,z=typeof P=="string"?P:P.label;return n.jsx("option",{value:D,children:z},D)})]});case"Link":return n.jsx(SW,{doctype:N.linkDoctype||"",value:O||"",onChange:P=>w(N.fieldname,P),disabled:A,placeholder:N.placeholder,filters:N.linkFilters||{}});case"Check":return n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:O===1||O===!0,onChange:P=>w(N.fieldname,P.target.checked?1:0),disabled:A,className:`w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500
dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2
dark:bg-gray-700 dark:border-gray-600`}),n.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:N.description||N.label})]});case"Int":return n.jsx("input",{type:"number",value:O||"",onChange:P=>w(N.fieldname,parseInt(P.target.value)||""),placeholder:N.placeholder,disabled:A,step:"1",className:T});case"Float":return n.jsx("input",{type:"number",value:O||"",onChange:P=>w(N.fieldname,parseFloat(P.target.value)||""),placeholder:N.placeholder,disabled:A,step:"0.01",className:T});case"Date":return n.jsx("input",{type:"date",value:O||"",onChange:P=>w(N.fieldname,P.target.value),disabled:A,className:T});case"Datetime":return n.jsx("input",{type:"datetime-local",value:O||"",onChange:P=>w(N.fieldname,P.target.value),disabled:A,className:T});default:return n.jsx("input",{type:"text",value:O||"",onChange:P=>w(N.fieldname,P.target.value),placeholder:N.placeholder,disabled:A,className:T})}};return!t||!v?null:n.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[9999]",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[90vh] flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("h3",{className:"text-lg font-semibold text-gray-800 dark:text-white flex items-center gap-2",children:[n.jsx(Pt,{className:"text-blue-500",size:16}),v.title]}),n.jsx("button",{type:"button",onClick:r,disabled:m,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded transition-colors disabled:opacity-50",children:n.jsx(yt,{size:18})})]}),n.jsx("form",{onSubmit:k,className:"flex-1 overflow-y-auto p-4",children:n.jsx("div",{className:"space-y-4",children:v.fields.map(N=>N.hidden||N.dependsOn&&!u[N.dependsOn]?null:n.jsxs("div",{children:[N.fieldtype!=="Check"&&n.jsxs("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:[N.label,N.required&&n.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),C(N),N.description&&N.fieldtype!=="Check"&&n.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:N.description}),f[N.fieldname]&&n.jsxs("p",{className:"mt-1 text-xs text-red-500 flex items-center gap-1",children:[n.jsx(So,{size:10}),f[N.fieldname]]})]},N.fieldname))})}),n.jsxs("div",{className:"flex justify-end gap-3 p-4 border-t border-gray-200 dark:border-gray-700",children:[n.jsx("button",{type:"button",onClick:r,disabled:m,className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-200 hover:bg-gray-300 rounded-lg transition-colors disabled:opacity-50",children:"Cancel"}),n.jsx("button",{type:"submit",onClick:k,disabled:m,className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors disabled:opacity-50 flex items-center gap-2",children:m?n.jsxs(n.Fragment,{children:[n.jsx(vt,{className:"animate-spin",size:14}),"Creating..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Pt,{size:14}),"Create"]})})]})]})})},CW={},Be=({label:e,doctype:t,value:r,onChange:a,hideLabel:s=!1,placeholder:i,disabled:l=!1,filters:u,compact:d=!1,usePortal:f=!0,allowQuickCreate:p=!1,onQuickCreateSuccess:m,quickCreateInitialValues:x={},query:v})=>{const{t:b}=sr(),[w,j]=y.useState([]),[k,C]=y.useState(""),[N,O]=y.useState(!1),[E,A]=y.useState(!1),[T,P]=y.useState({top:0,left:0,width:0}),[D,z]=y.useState(!1),[G,V]=y.useState(null),ne=y.useRef(null),ge=y.useRef(null),Z=y.useRef(null),U=y.useRef(null),ce=y.useRef(""),xe=y.useRef(!1),be=u||CW,me=y.useMemo(()=>JSON.stringify(be),[be]),oe=y.useMemo(()=>{const _e=jW(t);return console.log(`[LinkField] ${t} hasQuickCreateConfig: ${_e}`),_e},[t]);y.useEffect(()=>{V(null),p&&oe?(console.log(`[LinkField] Checking permission for ${t}...`),kW(t).then(_e=>{console.log(`[LinkField] Permission for ${t}: ${_e}`),V(_e)}).catch(_e=>{console.error(`[LinkField] Permission check failed for ${t}:`,_e),V(!1)})):(V(!1),p&&!oe&&console.warn(`[LinkField] ${t}: allowQuickCreate=true but no config in QuickCreateConfig.ts`))},[p,t,oe]);const L=y.useMemo(()=>{const _e=p&&oe&&G===!0;return console.log(`[LinkField] canQuickCreate for ${t}: ${_e}`,{allowQuickCreate:p,hasQuickCreateConfig:oe,hasPermission:G}),_e},[p,oe,G,t]),H=y.useCallback((_e="",F=!1)=>fe(null,null,function*(){const X=`${_e}-${me}-${v||""}`;if(!(!F&&ce.current===X)){ce.current=X,A(!0);try{let R=null;if(v){const I=new URLSearchParams({txt:_e,doctype:t,searchfield:"name",start:"0",page_len:"50"});be&&Object.keys(be).length>0&&I.append("filters",JSON.stringify(be));const te=yield Ja.apiCall(`/api/method/${v}?${I.toString()}`);Array.isArray(te)?R=te.map(q=>Array.isArray(q)?{value:q[0],description:q[1]||void 0}:{value:q.value||q.name||q,description:q.description}):R=[]}else{const I=new URLSearchParams({doctype:t,txt:_e,page_length:"50"});be&&Object.keys(be).length>0&&I.append("filters",JSON.stringify(be)),R=yield Ja.apiCall(`/api/method/frappe.desk.search.search_link?${I.toString()}`)}j(R||[])}catch(R){console.error(`Error fetching ${t} links:`,R),j([])}finally{A(!1)}}}),[t,me,be,v]),K=y.useCallback(_e=>{U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{H(_e)},300)},[H]);y.useEffect(()=>{N&&!xe.current&&(xe.current=!0,H(k||"",!0)),N||(xe.current=!1,ce.current="")},[N]),y.useEffect(()=>()=>{U.current&&clearTimeout(U.current)},[]);const Y=y.useCallback(()=>{if(f&&ge.current){const _e=ge.current.getBoundingClientRect();P({top:_e.bottom+window.scrollY,left:_e.left+window.scrollX,width:_e.width})}},[f]);y.useEffect(()=>{if(N&&f){Y();const _e=()=>Y();return window.addEventListener("scroll",_e,!0),window.addEventListener("resize",_e),()=>{window.removeEventListener("scroll",_e,!0),window.removeEventListener("resize",_e)}}},[N,f,Y]),y.useEffect(()=>{const _e=F=>{const X=F.target,R=ne.current&&!ne.current.contains(X),I=f&&Z.current&&!Z.current.contains(X);f?R&&I&&(O(!1),C("")):R&&(O(!1),C(""))};return document.addEventListener("mousedown",_e),()=>document.removeEventListener("mousedown",_e)},[f]);const re=_e=>{a(_e),C(""),O(!1)},de=()=>{a(""),C(""),O(!1)},ie=()=>{O(!1),C(""),z(!0)},se=_e=>{const F=_e.name||_e[Object.keys(_e)[0]];re(F),m&&m(_e)},he=()=>{const _e=`bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600
rounded-md w-full shadow-lg ${d?"mt-0.5":"mt-1"}`,F=f?{position:"fixed",top:`${T.top}px`,left:`${T.left}px`,width:`${T.width}px`,zIndex:1050,marginTop:d?"2px":"4px"}:{};if(!N||l)return null;const X=n.jsxs("div",{ref:Z,children:[E&&n.jsxs("div",{className:`${f?"":"absolute z-[1050]"} ${_e} text-center text-gray-500 dark:text-gray-400
${d?"p-1.5 text-[10px]":"p-3 text-sm"}`,style:F,children:[n.jsx("span",{className:"inline-block animate-spin mr-2",children:"⏳"}),b("linkField.loading")]}),!E&&n.jsxs("div",{className:`${f?"":"absolute z-[1050]"} ${_e} overflow-hidden`,style:F,children:[w.length>0?n.jsx("ul",{className:`overflow-auto ${d?"max-h-36":"max-h-48"}`,children:w.map((R,I)=>n.jsxs("li",{onClick:()=>re(R.value),className:`cursor-pointer text-gray-900 dark:text-gray-100
hover:bg-blue-500 dark:hover:bg-blue-600 hover:text-white
${d?"px-2 py-1 text-xs":"px-3 py-2 text-sm"}
${r===R.value?"bg-blue-50 dark:bg-blue-700 font-semibold":""}`,children:[R.value,R.description&&n.jsx("span",{className:`text-gray-600 dark:text-gray-300 ml-2
${d?"text-[9px] ml-1":"text-xs ml-2"}`,children:R.description})]},I))}):n.jsx("div",{className:`text-center text-gray-500 dark:text-gray-400
${d?"p-1.5 text-[10px]":"p-3 text-sm"}`,children:b("linkField.noResultsFound")}),L&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700"}),n.jsxs("div",{onClick:ie,className:`cursor-pointer flex items-center gap-2
text-green-600 dark:text-green-400
hover:bg-green-50 dark:hover:bg-green-900/20
hover:text-green-700 dark:hover:text-green-300
transition-colors
${d?"px-2 py-1.5 text-xs":"px-3 py-2.5 text-sm"}`,children:[n.jsx(Pt,{size:d?10:12}),n.jsx("span",{className:"font-medium",children:b("linkField.createNewDoctype",{doctype:t.replace(/_/g," ")})})]})]})]})]});return f?Kx.createPortal(X,document.body):X};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:ne,className:`relative w-full ${d?"mb-2":s?"mb-0":"mb-4"}`,children:[!s&&n.jsx("label",{className:`block font-medium text-gray-700 dark:text-gray-300 ${d?"text-[10px] mb-0.5":"text-sm mb-1"}`,children:e}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{ref:ge,type:"text",value:N?k:r,placeholder:i||b("linkField.selectLabel",{label:e}),disabled:l,className:`w-full border border-gray-300 dark:border-gray-600 rounded-md
focus:outline-none disabled:bg-gray-100 dark:disabled:bg-gray-700
bg-white dark:bg-gray-700 text-gray-900 dark:text-white
${d?"px-2 py-1 text-xs focus:ring-1 focus:ring-blue-500 rounded":"px-3 py-2 text-sm focus:ring-2 focus:ring-blue-500"}
${r?d?"pr-5":"pr-8":""}`,onFocus:()=>{l||(O(!0),C(""),f&&Y())},onChange:_e=>{const F=_e.target.value;C(F),K(F)}}),r&&!l&&!N&&n.jsx("button",{type:"button",onClick:de,className:`absolute top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300
${d?"right-1 text-xs":"right-2 text-sm"}`,children:"✕"})]}),he()]}),n.jsx(NW,{doctype:t,isOpen:D,onClose:()=>z(!1),onSuccess:se,initialValues:x,parentFilters:be})]})},TW=()=>fe(null,null,function*(){var e;try{const a=(yield(yield fetch("/api/method/frappe.auth.get_logged_user",{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"})).json()).message;if(!a)throw new Error("No user logged in");const i=yield(yield fetch("/api/method/frappe.client.get",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({doctype:"User",name:a})})).json();if(console.log("frappe.client.get response:",i),console.log("role_profile_name:",(e=i.message)==null?void 0:e.role_profile_name),i.message){const l=i.message;return l.roles||(l.roles=[]),l}throw new Error("Failed to fetch user profile")}catch(t){throw console.error("Error fetching user profile:",t),t}}),EW=(e,t)=>fe(null,null,function*(){try{const r=yield fetch(`/api/resource/User/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}),a=yield r.json();if(!r.ok)throw new Error(a.exc||a.message||"Failed to update profile");return a.data}catch(r){throw console.error("Error updating user profile:",r),r}}),AW=(e,t)=>fe(null,null,function*(){try{const r=yield fetch("/api/method/frappe.core.doctype.user.user.update_password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({new_password:e,old_password:t})}),a=yield r.json();if(!r.ok){let s="Failed to change password";if(a.exc){if(a.exc.includes("Incorrect Old Password"))s="Incorrect old password";else if(a.exc.includes("Password cannot be same"))s="New password cannot be the same as old password";else if(a._server_messages)try{const i=JSON.parse(a._server_messages);s=JSON.parse(i[0]).message||s}catch(i){}}throw new Error(s)}return{message:"Password changed successfully"}}catch(r){throw console.error("Error changing password:",r),r}}),_P="";function OW(e){return fe(this,null,function*(){const t=yield Ja.getCSRFTokenForGuest(),r={Accept:"application/json","Content-Type":"application/json"};t&&(r["X-Frappe-CSRF-Token"]=t);const a=yield fetch(`${_P}/api/method/project_management.api.two_factor.get_two_factor_status`,{method:"POST",credentials:"include",headers:r,body:JSON.stringify(e?{user:e}:{})}),s=yield a.json();if(!a.ok){const i=typeof s.message=="string"?s.message:s.exc||"Failed to load two-factor status";throw new Error(i)}return s.message})}function PW(e){return fe(this,null,function*(){const t=yield Ja.getCSRFTokenForGuest(),r={Accept:"application/json","Content-Type":"application/json"};t&&(r["X-Frappe-CSRF-Token"]=t);const a=yield fetch(`${_P}/api/method/frappe.twofactor.reset_otp_secret`,{method:"POST",credentials:"include",headers:r,body:JSON.stringify({user:e})}),s=yield a.json();if(!a.ok){const i=typeof s.message=="string"?s.message:s.exc||"Failed to reset OTP secret";throw new Error(i)}})}const DW=()=>{const e=Ut(),{t}=sr(),[r,a]=y.useState(!0),[s,i]=y.useState(!1),[l,u]=y.useState(!1),[d,f]=y.useState(!1),[p,m]=y.useState(null),[x,v]=y.useState(null),[b,w]=y.useState({first_name:"",middle_name:"",last_name:"",role_profile_name:"",custom_user_id:""}),[j,k]=y.useState(!1),[C,N]=y.useState({old_password:"",new_password:"",confirm_password:""}),[O,E]=y.useState(!1),[A,T]=y.useState(!1),[P,D]=y.useState(!1),[z,G]=y.useState(null),[V,ne]=y.useState(!0),[ge,Z]=y.useState(!1);y.useEffect(()=>{fe(null,null,function*(){var H;try{a(!0);const re=((H=(yield(yield fetch("/api/method/asset_lite.api.user_roles.check_has_role",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({roles:"System Manager"})})).json()).message)==null?void 0:H.has_role)||!1;u(re),console.log("Is System Manager:",re);const de=yield TW();console.log("Full profile data:",JSON.stringify(de,null,2)),console.log("role_profile_name:",de.role_profile_name),console.log("All keys:",Object.keys(de)),m(de),w({first_name:de.first_name||"",middle_name:de.middle_name||"",last_name:de.last_name||"",role_profile_name:de.role_profile_name||"",custom_user_id:de.custom_user_id||""});try{const ie=yield OW(de.name);G(ie)}catch(ie){console.warn("Could not load 2FA status:",ie),G(null)}finally{ne(!1)}}catch(K){const Y=K instanceof Error?K.message:"Failed to load profile";v(Y),$e.error(Y,{position:"top-right",autoClose:5e3,icon:n.jsx(Fr,{})})}finally{a(!1)}})},[]);const U=L=>{const{name:H,value:K}=L.target;w(Y=>Se(ee({},Y),{[H]:K}))},ce=L=>{const{name:H,value:K}=L.target;N(Y=>Se(ee({},Y),{[H]:K}))},xe=()=>fe(null,null,function*(){if(p!=null&&p.email)try{i(!0);const L={first_name:b.first_name,middle_name:b.middle_name,last_name:b.last_name,role_profile_name:b.role_profile_name},H=yield EW(p.email,L);m(K=>K?ee(ee({},K),H):H),$e.success("Profile updated successfully!",{position:"top-right",autoClose:3e3,icon:n.jsx(Or,{})})}catch(L){const H=L instanceof Error?L.message:"Failed to update profile";$e.error(H,{position:"top-right",autoClose:5e3,icon:n.jsx(Fr,{})})}finally{i(!1)}}),be=()=>fe(null,null,function*(){if(p!=null&&p.name&&window.confirm(t("profile.resetOtpConfirm")))try{Z(!0),yield PW(p.name),$e.success(t("profile.resetOtpSuccess"),{position:"top-right",autoClose:5e3,icon:n.jsx(Or,{})})}catch(L){const H=L instanceof Error?L.message:t("profile.resetOtpFailed");$e.error(H,{position:"top-right",autoClose:5e3,icon:n.jsx(Fr,{})})}finally{Z(!1)}}),me=()=>fe(null,null,function*(){if(!C.old_password){$e.error("Please enter your current password",{position:"top-right",autoClose:3e3,icon:n.jsx(So,{})});return}if(!C.new_password){$e.error("Please enter a new password",{position:"top-right",autoClose:3e3,icon:n.jsx(So,{})});return}if(C.new_password.length<8){$e.error("Password must be at least 8 characters long",{position:"top-right",autoClose:3e3,icon:n.jsx(So,{})});return}if(C.new_password!==C.confirm_password){$e.error("New passwords do not match",{position:"top-right",autoClose:3e3,icon:n.jsx(So,{})});return}try{f(!0),yield AW(C.new_password,C.old_password),$e.success("Password changed successfully!",{position:"top-right",autoClose:3e3,icon:n.jsx(Or,{})}),N({old_password:"",new_password:"",confirm_password:""}),k(!1)}catch(L){const H=L instanceof Error?L.message:"Failed to change password";$e.error(H,{position:"top-right",autoClose:5e3,icon:n.jsx(Fr,{})})}finally{f(!1)}});if(r)return n.jsx("div",{className:"flex items-center justify-center h-screen bg-gray-50 dark:bg-gray-900",children:n.jsxs("div",{className:"text-center",children:[n.jsx(vt,{className:"animate-spin text-blue-500 text-4xl mx-auto"}),n.jsx("p",{className:"mt-4 text-gray-600 dark:text-gray-400",children:"Loading profile..."})]})});if(x&&!p)return n.jsx("div",{className:"p-6 bg-gray-50 dark:bg-gray-900 min-h-screen",children:n.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-6",children:[n.jsxs("h2",{className:"text-xl font-bold text-red-800 dark:text-red-300 mb-4",children:[n.jsx(Fr,{className:"inline mr-2"}),"Error Loading Profile"]}),n.jsx("p",{className:"text-red-700 dark:text-red-400",children:x}),n.jsx("button",{onClick:()=>e(-1),className:"mt-4 bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded",children:"Go Back"})]})});const oe=!V&&!!(z!=null&&z.enabled_globally)&&!!(z!=null&&z.required_for_user)&&!!(z!=null&&z.otp_app);return n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 p-6",children:[n.jsx(Br,{position:"top-right",autoClose:4e3,hideProgressBar:!1,newestOnTop:!0,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"colored",transition:wP}),n.jsxs("div",{className:"mb-6 flex justify-between items-center",children:[n.jsx("div",{className:"flex items-center gap-4",children:n.jsxs("button",{onClick:()=>e(-1),className:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 flex items-center gap-2",children:[n.jsx(da,{}),n.jsx("span",{className:"text-gray-900 dark:text-white text-xl font-semibold",children:"User Profile"})]})}),n.jsx("button",{onClick:xe,disabled:s,className:"bg-green-600 hover:bg-green-700 text-white px-6 py-2 rounded-lg flex items-center gap-2 disabled:opacity-50 shadow-lg transition-all",children:s?n.jsxs(n.Fragment,{children:[n.jsx(vt,{className:"animate-spin"}),"Saving..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Cn,{}),"Save Changes"]})})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsx("div",{className:"lg:col-span-1",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 overflow-hidden",children:[n.jsxs("div",{className:"bg-gradient-to-r from-blue-500 to-blue-600 p-6 text-center",children:[n.jsx("div",{className:"w-24 h-24 bg-white/20 rounded-full mx-auto flex items-center justify-center mb-4",children:p!=null&&p.user_image?n.jsx("img",{src:p.user_image,alt:"Profile",className:"w-20 h-20 rounded-full object-cover"}):n.jsx(sh,{className:"text-white text-4xl"})}),n.jsx("h2",{className:"text-xl font-bold text-white",children:(p==null?void 0:p.full_name)||"User"}),n.jsx("p",{className:"text-white/80 text-sm mt-1",children:p==null?void 0:p.email})]}),n.jsxs("div",{className:"p-4 space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[n.jsx(_q,{className:"text-blue-500"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Username"}),n.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:(p==null?void 0:p.username)||"-"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[n.jsx(xq,{className:"text-green-500"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Role Profile"}),n.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white",children:(p==null?void 0:p.role_profile_name)||"-"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[n.jsx(Cb,{className:"text-purple-500"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Status"}),n.jsx("p",{className:`text-sm font-medium ${p!=null&&p.enabled?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:p!=null&&p.enabled?"Active":"Inactive"})]})]}),V&&n.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-[11px] text-gray-400",children:[n.jsx(vt,{className:"animate-spin shrink-0",size:12}),n.jsx("span",{children:t("profile.twoFactorLoading")})]}),oe&&n.jsx("div",{className:"rounded-lg border border-purple-200 bg-purple-50/80 p-3 dark:border-purple-800 dark:bg-purple-900/20",children:n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(Cb,{className:"mt-0.5 shrink-0 text-purple-600 dark:text-purple-400",size:13}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("p",{className:"text-xs font-semibold text-purple-900 dark:text-purple-200",children:t("profile.twoFactorSidebarTitle")}),n.jsx("p",{className:"mt-1 text-[11px] leading-snug text-purple-800/90 dark:text-purple-300/90",children:t("profile.twoFactorRequired")}),n.jsx("p",{className:"mt-1 text-[10px] leading-snug text-gray-600 dark:text-gray-400",children:t("profile.twoFactorOtpAppNoteShort")}),n.jsxs("button",{type:"button",onClick:be,disabled:ge,className:"mt-2 inline-flex w-full items-center justify-center gap-1.5 rounded-md border border-purple-300 bg-white px-2 py-1.5 text-[11px] font-medium text-purple-800 hover:bg-purple-50 disabled:opacity-50 dark:border-purple-600 dark:bg-purple-950/40 dark:text-purple-200 dark:hover:bg-purple-900/40",children:[ge?n.jsx(vt,{className:"animate-spin",size:10}):n.jsx(Cb,{size:10}),t("profile.resetOtp")]})]})]})})]})]})}),n.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 p-6",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-800 dark:text-white mb-4 pb-2 border-b border-gray-200 dark:border-gray-700 flex items-center gap-2",children:[n.jsx(sh,{className:"text-blue-500"}),"Basic Information"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Email",n.jsx("span",{className:"ml-1 text-gray-400",children:"(Read-only)"})]}),n.jsxs("div",{className:"relative",children:[n.jsx(Eq,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",size:14}),n.jsx("input",{type:"email",value:(p==null?void 0:p.email)||"",disabled:!0,className:"w-full pl-10 pr-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 cursor-not-allowed"})]})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Full Name",n.jsx("span",{className:"ml-1 text-gray-400",children:"(Auto-generated)"})]}),n.jsx("input",{type:"text",value:(p==null?void 0:p.full_name)||"",disabled:!0,className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 cursor-not-allowed"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["First Name ",n.jsx("span",{className:"text-red-500",children:"*"})]}),n.jsx("input",{type:"text",name:"first_name",value:b.first_name,onChange:U,placeholder:"Enter first name",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Middle Name"}),n.jsx("input",{type:"text",name:"middle_name",value:b.middle_name,onChange:U,placeholder:"Enter middle name",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Last Name"}),n.jsx("input",{type:"text",name:"last_name",value:b.last_name,onChange:U,placeholder:"Enter last name",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:"User ID No"}),n.jsx("input",{type:"text",name:"custom_user_id",value:b.custom_user_id,onChange:U,placeholder:"Enter User No",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white"})]}),n.jsx("div",{children:n.jsx(Be,{label:"Role Profile",doctype:"Role Profile",value:b.role_profile_name,onChange:L=>w(H=>Se(ee({},H),{role_profile_name:L})),placeholder:"Select Role Profile",disabled:!l})})]})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4 pb-2 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-800 dark:text-white flex items-center gap-2",children:[n.jsx(Tb,{className:"text-orange-500"}),"Change Password"]}),n.jsx("button",{onClick:()=>k(!j),className:"text-sm text-blue-600 dark:text-blue-400 hover:underline",children:j?"Cancel":"Change Password"})]}),j?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Current Password ",n.jsx("span",{className:"text-red-500",children:"*"})]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:O?"text":"password",name:"old_password",value:C.old_password,onChange:ce,placeholder:"Enter current password",className:"w-full px-3 py-2 pr-10 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white"}),n.jsx("button",{type:"button",onClick:()=>E(!O),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:O?n.jsx(Eb,{size:14}):n.jsx(Hs,{size:14})})]})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["New Password ",n.jsx("span",{className:"text-red-500",children:"*"})]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:A?"text":"password",name:"new_password",value:C.new_password,onChange:ce,placeholder:"Enter new password (min 8 characters)",className:"w-full px-3 py-2 pr-10 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white"}),n.jsx("button",{type:"button",onClick:()=>T(!A),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:A?n.jsx(Eb,{size:14}):n.jsx(Hs,{size:14})})]}),C.new_password&&C.new_password.length<8&&n.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Password must be at least 8 characters"})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Confirm New Password ",n.jsx("span",{className:"text-red-500",children:"*"})]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:P?"text":"password",name:"confirm_password",value:C.confirm_password,onChange:ce,placeholder:"Confirm new password",className:"w-full px-3 py-2 pr-10 text-sm border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white"}),n.jsx("button",{type:"button",onClick:()=>D(!P),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:P?n.jsx(Eb,{size:14}):n.jsx(Hs,{size:14})})]}),C.confirm_password&&C.new_password!==C.confirm_password&&n.jsx("p",{className:"mt-1 text-xs text-red-500",children:"Passwords do not match"}),C.confirm_password&&C.new_password===C.confirm_password&&C.new_password.length>=8&&n.jsxs("p",{className:"mt-1 text-xs text-green-500 flex items-center gap-1",children:[n.jsx(Or,{size:10})," Passwords match"]})]}),n.jsx("div",{className:"pt-2",children:n.jsx("button",{onClick:me,disabled:d,className:"w-full bg-orange-600 hover:bg-orange-700 text-white px-4 py-2.5 rounded-lg flex items-center justify-center gap-2 disabled:opacity-50 transition-colors",children:d?n.jsxs(n.Fragment,{children:[n.jsx(vt,{className:"animate-spin"}),"Changing Password..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Tb,{}),"Change Password"]})})})]}):n.jsxs("div",{className:"text-center py-6 text-gray-500 dark:text-gray-400",children:[n.jsx(Tb,{className:"mx-auto text-3xl mb-2 text-gray-300 dark:text-gray-600"}),n.jsx("p",{className:"text-sm",children:'Click "Change Password" to update your password'})]})]})]})]})]})};function Ta(e){if(!e||typeof e!="object")return[];const t=[];for(const[r,a]of Object.entries(e))if(!(a==null||a===""))if(r==="creation_from")t.push(["creation",">=",a]);else if(r==="creation_to"){const s=new Date(a);if(!isNaN(s.getTime())){s.setDate(s.getDate()+1);const i=s.toISOString().slice(0,10);t.push(["creation","<",i])}}else if(r==="modified_from")t.push(["modified",">=",a]);else if(r==="modified_to"){const s=new Date(a);if(!isNaN(s.getTime())){s.setDate(s.getDate()+1);const i=s.toISOString().slice(0,10);t.push(["modified","<",i])}}else Array.isArray(a)&&a.length>=2?t.push([r,a[0],a[1]]):t.push([r,"=",a]);return t}function n_(e,t,r){if(!e||!t&&!r)return{};const a={};return e==="creation"?(t&&(a.creation_from=t),r&&(a.creation_to=r)):(t&&(a.modified_from=t),r&&(a.modified_to=r)),a}const Lf="custom_task_updates",If="custom_project_updates";function $w(e,t){const r=t==null?void 0:t.fillTaskLink;return e.filter(a=>{const s=String(a.update_||"").trim(),i=String(a.date||"").trim(),l=String(a.task||"").trim();return s||i||l}).map((a,s)=>{const i={idx:s+1,update_:a.update_||""};a.date&&(i.date=a.date),a.name&&(i.name=a.name);const l=r!=null?r:a.task;return l&&(i.task=l),i})}class RW{constructor(){xn(this,"baseURL",Ad.BASE_URL);xn(this,"TASK_FIELDS",["name","subject","project","status","priority","task_weight","is_group","is_template","is_milestone","expected_time","actual_time","progress","exp_start_date","exp_end_date","parent_task","completed_on","custom_risk","custom_action","custom_task_obstacle","custom_assign_to","total_costing_amount","total_billing_amount","company","depends_on_tasks","_assign","owner","creation","modified"])}clearCsrfTokenCache(){if(typeof window!="undefined")try{delete window.csrf_token;const t=window.frappe;if(t&&typeof t=="object"&&"csrf_token"in t)try{delete t.csrf_token}catch(r){t.csrf_token=""}}catch(t){}}getCSRFToken(){return fe(this,null,function*(){var t;if(typeof window=="undefined")return null;if(window.csrf_token)return window.csrf_token;if((t=window.frappe)!=null&&t.csrf_token)return window.frappe.csrf_token;try{const r=yield fetch(`${this.baseURL}/api/method/frappe.sessions.get_csrf_token`,{credentials:"include",cache:"no-store"});if(r.ok){const a=yield r.json();if(a.message)return window.csrf_token=a.message,a.message}}catch(r){}return null})}mergeHeaders(t,r){const a=ee({},t);if(!r)return a;if(r instanceof Headers)return r.forEach((s,i)=>{a[i]=s}),a;if(Array.isArray(r)){for(const[s,i]of r)a[s]=i;return a}return ee(ee({},a),r)}isFrappeCsrfError(t){if(!t||typeof t!="object")return!1;const r=t;if(r.exc_type==="CSRFTokenError")return!0;const a=typeof r.message=="string"?r.message:"";if(/csrf/i.test(a))return!0;if(r._server_messages&&typeof r._server_messages=="string"){try{const i=JSON.parse(r._server_messages)[0],l=typeof i=="string"?JSON.parse(i):i,u=typeof(l==null?void 0:l.message)=="string"?l.message:"";if(/invalid request/i.test(u)&&r.exc_type==="CSRFTokenError")return!0}catch(s){}if(/CSRFTokenError|csrf/i.test(r._server_messages))return!0}return!1}getHeaders(){return fe(this,null,function*(){const t={Accept:"application/json","Content-Type":"application/json"},r=yield this.getCSRFToken();return r&&(t["X-Frappe-CSRF-Token"]=r),t})}parseFrappeError(t){return fe(this,null,function*(){const r={403:"Permission denied. Your role does not have access to this DocType.",417:"Validation error. Check field values or role permissions for this DocType.",404:"Record not found.",500:"Server error. Check that all field names are correct."};try{const a=yield t.json();if(a._server_messages)try{const s=JSON.parse(a._server_messages),i=typeof s[0]=="string"?JSON.parse(s[0]):s[0];if(i!=null&&i.message)return new Error(i.message)}catch(s){}if(a.message&&typeof a.message=="string"&&a.message.trim())return new Error(a.message);if(a.exc_type){const s=a.exc?a.exc.split(`
`).slice(-2).join(" ").trim():"";return new Error(`${a.exc_type}: ${s||r[t.status]||t.statusText}`)}}catch(a){}return new Error(r[t.status]||`HTTP ${t.status}: ${t.statusText}`)})}fetchJson(t,r){return fe(this,null,function*(){const a=yield fetch(t,Se(ee({credentials:"include"},r),{headers:ee(ee({},yield this.getHeaders()),(r==null?void 0:r.headers)||{})}));if(!a.ok)throw yield this.parseFrappeError(a.clone());return a.json()})}getProjects(){return fe(this,arguments,function*(t={}){const{filters:r={},fields:a=["name","project_name","status","priority","company","customer","expected_start_date","expected_end_date","percent_complete","actual_time","creation","modified","owner"],limit_start:s=0,limit_page_length:i=20,order_by:l="modified desc"}=t,u=new URLSearchParams;if(u.set("fields",JSON.stringify(a)),u.set("limit_start",String(s)),u.set("limit_page_length",String(i)),u.set("order_by",l),Object.keys(r).length>0){const f=Ta(r);f.length>0&&u.set("filters",JSON.stringify(f))}return{data:(yield this.fetchJson(`${this.baseURL}/api/resource/Project?${u}`)).data||[]}})}getProject(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Project/${encodeURIComponent(t)}`)).data})}getProjectCount(){return fe(this,arguments,function*(t={}){var a,s;const r=new URLSearchParams;if(r.set("fields",JSON.stringify(["count(name) as count"])),Object.keys(t).length>0){const i=Ta(t);i.length>0&&r.set("filters",JSON.stringify(i))}try{return((s=(a=(yield this.fetchJson(`${this.baseURL}/api/resource/Project?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)||0}catch(i){return 0}})}createProject(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Project`,{method:"POST",body:JSON.stringify(t)})).data})}updateProject(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Project/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}getProjectTemplates(){return fe(this,arguments,function*(t={}){const{filters:r={},limit_start:a=0,limit_page_length:s=50,order_by:i="name asc"}=t,l=new URLSearchParams;if(l.set("fields",JSON.stringify(["name","project_type","creation","modified"])),l.set("limit_start",String(a)),l.set("limit_page_length",String(s)),l.set("order_by",i),Object.keys(r).length>0){const u=Ta(r);u.length>0&&l.set("filters",JSON.stringify(u))}try{return{data:(yield this.fetchJson(`${this.baseURL}/api/resource/Project%20Template?${l}`)).data||[]}}catch(u){return{data:[]}}})}getProjectTemplate(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Project%20Template/${encodeURIComponent(t)}`)).data})}createProjectTemplate(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Project%20Template`,{method:"POST",body:JSON.stringify(t)})).data})}updateProjectTemplate(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Project%20Template/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}getProjectTemplateCount(){return fe(this,arguments,function*(t={}){var a,s;const r=new URLSearchParams;if(r.set("fields",JSON.stringify(["count(name) as count"])),Object.keys(t).length>0){const i=Ta(t);i.length>0&&r.set("filters",JSON.stringify(i))}try{return((s=(a=(yield this.fetchJson(`${this.baseURL}/api/resource/Project%20Template?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)||0}catch(i){return 0}})}getTasks(){return fe(this,arguments,function*(t={}){const{filters:r={},fields:a=this.TASK_FIELDS,limit_start:s=0,limit_page_length:i=50,order_by:l="creation desc"}=t,u=new URLSearchParams;if(u.set("fields",JSON.stringify(a)),u.set("limit_start",String(s)),u.set("limit_page_length",String(i)),u.set("order_by",l),Object.keys(r).length>0){const f=Ta(r);f.length>0&&u.set("filters",JSON.stringify(f))}return{data:(yield this.fetchJson(`${this.baseURL}/api/resource/Task?${u}`)).data||[]}})}getTasksForProject(t,r){return fe(this,null,function*(){return this.getTasks(Se(ee({},r),{filters:{project:t},limit_page_length:100}))})}getTask(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Task/${encodeURIComponent(t)}`)).data})}createTask(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Task`,{method:"POST",body:JSON.stringify(t)})).data})}updateTask(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Task/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}getTaskCount(){return fe(this,arguments,function*(t={}){var a,s;const r=new URLSearchParams;if(r.set("fields",JSON.stringify(["count(name) as count"])),Object.keys(t).length>0){const i=Ta(t);i.length>0&&r.set("filters",JSON.stringify(i))}try{return((s=(a=(yield this.fetchJson(`${this.baseURL}/api/resource/Task?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)||0}catch(i){return 0}})}getTimesheets(){return fe(this,arguments,function*(t={}){const{filters:r={},appendFilters:a=[],fields:s=["name","status","docstatus","currency","employee","customer","company","total_hours","total_billable_hours","total_billable_amount","total_costing_amount","creation","modified","owner"],limit_start:i=0,limit_page_length:l=20,order_by:u="creation desc"}=t,d=new URLSearchParams;d.set("fields",JSON.stringify(s)),d.set("limit_start",String(i)),d.set("limit_page_length",String(l)),d.set("order_by",u);let f=Ta(r);return a.length&&(f=[...f,...a]),f.length>0&&d.set("filters",JSON.stringify(f)),{data:(yield this.fetchJson(`${this.baseURL}/api/resource/Timesheet?${d}`)).data||[]}})}getTimesheetsForProject(t,r){return fe(this,null,function*(){const{limit_start:a=0,limit_page_length:s=50}=r||{},i=new URLSearchParams;return i.set("filters",JSON.stringify([["Timesheet Detail","project","=",t]])),i.set("fields",JSON.stringify(["name","status","docstatus","currency","total_hours","total_billable_hours","total_billable_amount","total_costing_amount","creation","modified"])),i.set("limit_start",String(a)),i.set("limit_page_length",String(s)),i.set("order_by","creation desc"),{data:(yield this.fetchJson(`${this.baseURL}/api/resource/Timesheet?${i}`)).data||[]}})}getTimesheet(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Timesheet/${encodeURIComponent(t)}`)).data})}createTimesheet(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Timesheet`,{method:"POST",body:JSON.stringify(t)})).data})}updateTimesheet(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Timesheet/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}submitTimesheet(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Timesheet/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({docstatus:1})})).data})}cancelTimesheet(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Timesheet/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({docstatus:2})})).data})}getTimesheetCount(){return fe(this,arguments,function*(t={},r=[]){var i,l;const a=new URLSearchParams;a.set("fields",JSON.stringify(["count(name) as count"]));let s=Ta(t);r.length&&(s=[...s,...r]),s.length>0&&a.set("filters",JSON.stringify(s));try{return((l=(i=(yield this.fetchJson(`${this.baseURL}/api/resource/Timesheet?${a}`)).data)==null?void 0:i[0])==null?void 0:l.count)||0}catch(u){return 0}})}getActivityTypes(){return fe(this,arguments,function*(t={}){const{filters:r={},limit_start:a=0,limit_page_length:s=50,order_by:i="name asc"}=t,l=new URLSearchParams;if(l.set("fields",JSON.stringify(["name","activity_type","billing_rate","costing_rate","disabled","creation","modified"])),l.set("limit_start",String(a)),l.set("limit_page_length",String(s)),l.set("order_by",i),Object.keys(r).length>0){const u=Ta(r);u.length>0&&l.set("filters",JSON.stringify(u))}try{return{data:(yield this.fetchJson(`${this.baseURL}/api/resource/Activity%20Type?${l}`)).data||[]}}catch(u){return{data:[]}}})}getActivityType(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Activity%20Type/${encodeURIComponent(t)}`)).data})}createActivityType(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Activity%20Type`,{method:"POST",body:JSON.stringify(t)})).data})}updateActivityType(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Activity%20Type/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}getActivityTypeCount(){return fe(this,arguments,function*(t={}){var a,s;const r=new URLSearchParams;if(r.set("fields",JSON.stringify(["count(name) as count"])),Object.keys(t).length>0){const i=Ta(t);i.length>0&&r.set("filters",JSON.stringify(i))}try{return((s=(a=(yield this.fetchJson(`${this.baseURL}/api/resource/Activity%20Type?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)||0}catch(i){return 0}})}getModuleCounts(){return fe(this,null,function*(){const[t,r,a]=yield Promise.all([this.getProjectCount({status:"Open"}),this.getTaskCount({}),this.getTimesheetCount({})]);return{projects:t,tasks:r,timesheets:a}})}getMergedProjectProgressUpdates(t,r){return fe(this,null,function*(){var m;const a=(m=r==null?void 0:r.maxTasks)!=null?m:120,s=yield this.getProject(t),{data:i}=yield this.getTasksForProject(t,{limit_page_length:a}),l=(s[If]||[]).map(x=>Se(ee({},x),{_source:"project"})),u=i.map(x=>x.name).filter(Boolean).slice(0,a),d=yield Promise.all(u.map(x=>this.getTask(x).catch(()=>null))),f=[];for(const x of d){if(!x)continue;const v=x[Lf]||[];for(const b of v)f.push(Se(ee({},b),{task:b.task||x.name,_source:"task"}))}const p=x=>String(x.date||"").slice(0,10)||"";return[...f,...l].sort((x,v)=>p(v).localeCompare(p(x)))})}}const wt=new RW;function sd(e){if(!e||typeof e!="string")return"";let t=e.replace(/<br\s*\/?>/gi,`
`).replace(/<\/(p|div|li|tr)>/gi,`
`).replace(/<a[^>]*>([\s\S]*?)<\/a>/gi,(r,a)=>a.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim()).replace(/<[^>]+>/g," ");return t=t.replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#39;/g,"'").replace(/&quot;/g,'"'),t.replace(/[ \t]+\n/g,`
`).replace(/\n{3,}/g,`
`).replace(/ +/g," ").trim()}function Ya(e){if(e==null)return"Something went wrong";if(e instanceof Error)return sd(e.message)||e.message;if(typeof e=="string")return sd(e);const t=e;let r=typeof t.message=="string"?t.message:"";if(t._server_messages)try{const a=t._server_messages,s=typeof a=="string"?JSON.parse(a):a;if(Array.isArray(s)){const i=[];for(const l of s)try{const u=typeof l=="string"?JSON.parse(l):l;u&&typeof u.message=="string"?i.push(sd(u.message)):typeof l=="string"&&i.push(sd(l))}catch(u){typeof l=="string"&&i.push(sd(l))}i.length&&(r=i.join(`
`))}}catch(a){}return!r&&typeof t.exc=="string"&&t.exc.length<800&&(r=t.exc),r?sd(r):"Request failed. Check stock, warehouses, and linked documents."}const id="Sales%20Order";class FW{getCSRFToken(){return fe(this,null,function*(){var t;if(typeof window=="undefined")return null;if(window.csrf_token)return window.csrf_token;if((t=window.frappe)!=null&&t.csrf_token)return window.frappe.csrf_token;try{const r=yield fetch("/api/method/frappe.sessions.get_csrf_token",{credentials:"include"});if(r.ok){const a=yield r.json();if(a.message)return window.csrf_token=a.message,a.message}}catch(r){}return null})}getHeaders(){return fe(this,null,function*(){const t={"Content-Type":"application/json",Accept:"application/json"},r=yield this.getCSRFToken();return r&&(t["X-Frappe-CSRF-Token"]=r),t})}fetchJson(a){return fe(this,arguments,function*(t,r={}){const s=yield this.getHeaders(),i=yield fetch(t,ee({credentials:"include",headers:s},r)),l=yield i.json().catch(()=>({}));if(!i.ok)throw new Error(Ya(l)||(l==null?void 0:l.message)||`HTTP ${i.status}`);if(l.exc)throw new Error(Ya(l)||"Request failed");return l})}getSalesOrders(){return fe(this,arguments,function*(t={}){var i,l,u,d;const r=new URLSearchParams,a=["name","customer","customer_name","transaction_date","status","grand_total","currency","docstatus","project","billing_status","delivery_status","creation","modified"];return r.set("fields",JSON.stringify(a)),(i=t.filters)!=null&&i.length&&r.set("filters",JSON.stringify(t.filters)),r.set("limit_start",String((l=t.limit_start)!=null?l:0)),r.set("limit_page_length",String((u=t.limit_page_length)!=null?u:20)),r.set("order_by",(d=t.order_by)!=null?d:"creation desc"),(yield this.fetchJson(`/api/resource/${id}?${r}`)).data||[]})}getSalesOrderCount(){return fe(this,arguments,function*(t=[]){var a,s,i;const r=new URLSearchParams;r.set("fields",JSON.stringify(["count(name) as count"])),t.length&&r.set("filters",JSON.stringify(t));try{return(i=(s=(a=(yield this.fetchJson(`/api/resource/${id}?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)!=null?i:0}catch(l){return 0}})}getSalesOrderNamesForProject(t,r=25){return fe(this,null,function*(){return(yield this.getSalesOrders({filters:[["Sales Order","project","=",t]],limit_start:0,limit_page_length:r,order_by:"modified desc"})).map(s=>s.name).filter(Boolean)})}getSalesOrder(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${id}/${encodeURIComponent(t)}`)).data})}createSalesOrder(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${id}`,{method:"POST",body:JSON.stringify(t)})).data})}updateSalesOrder(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${id}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}submitSalesOrder(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${id}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({docstatus:1})})).data})}}const cs=new FW;class MW{getCSRFToken(){return fe(this,null,function*(){var t;if(typeof window=="undefined")return null;if(window.csrf_token)return window.csrf_token;if((t=window.frappe)!=null&&t.csrf_token)return window.frappe.csrf_token;try{const r=yield fetch("/api/method/frappe.sessions.get_csrf_token",{credentials:"include"});if(r.ok){const a=yield r.json();if(a.message)return window.csrf_token=a.message,a.message}}catch(r){}return null})}getHeaders(){return fe(this,null,function*(){const t={"Content-Type":"application/json",Accept:"application/json"},r=yield this.getCSRFToken();return r&&(t["X-Frappe-CSRF-Token"]=r),t})}fetchJson(a){return fe(this,arguments,function*(t,r={}){const s=yield fetch(t,ee({credentials:"include"},r)),i=yield s.json();if(!s.ok){const l=Ya(i)||(i==null?void 0:i.exc_type)||`HTTP ${s.status}`;throw new Error(l)}return i})}getDeliveryNotes(){return fe(this,arguments,function*(t={}){var i,l,u,d;const r=new URLSearchParams,a=["name","customer","customer_name","posting_date","status","grand_total","currency","docstatus","creation"];return r.set("fields",JSON.stringify(a)),(i=t.filters)!=null&&i.length&&r.set("filters",JSON.stringify(t.filters)),r.set("limit_start",String((l=t.limit_start)!=null?l:0)),r.set("limit_page_length",String((u=t.limit_page_length)!=null?u:20)),r.set("order_by",(d=t.order_by)!=null?d:"creation desc"),(yield this.fetchJson(`/api/resource/Delivery Note?${r}`)).data||[]})}getDeliveryNoteCount(){return fe(this,arguments,function*(t=[]){var a,s,i;const r=new URLSearchParams;r.set("fields",JSON.stringify(["count(name) as count"])),t.length&&r.set("filters",JSON.stringify(t));try{return(i=(s=(a=(yield this.fetchJson(`/api/resource/Delivery Note?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)!=null?i:0}catch(l){return 0}})}getDeliveryNote(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/Delivery Note/${encodeURIComponent(t)}`)).data})}createDeliveryNote(t){return fe(this,null,function*(){const r=yield this.getHeaders();return(yield this.fetchJson("/api/resource/Delivery Note",{method:"POST",headers:r,body:JSON.stringify(Se(ee({},t),{doctype:"Delivery Note"}))})).data})}updateDeliveryNote(t,r){return fe(this,null,function*(){const a=yield this.getHeaders();return(yield this.fetchJson(`/api/resource/Delivery Note/${encodeURIComponent(t)}`,{method:"PUT",headers:a,body:JSON.stringify(r)})).data})}submitDeliveryNote(t){return fe(this,null,function*(){const r=yield this.getHeaders();return(yield this.fetchJson(`/api/resource/Delivery Note/${encodeURIComponent(t)}`,{method:"PUT",headers:r,body:JSON.stringify({docstatus:1})})).data})}}const Dc=new MW;class LW{constructor(){xn(this,"baseURL","")}getCSRFToken(){return fe(this,null,function*(){var t;if(typeof window=="undefined")return null;if(window.csrf_token)return window.csrf_token;if((t=window.frappe)!=null&&t.csrf_token)return window.frappe.csrf_token;try{const r=yield fetch("/api/method/frappe.sessions.get_csrf_token",{credentials:"include"});if(r.ok){const a=yield r.json();if(a.message)return window.csrf_token=a.message,a.message}}catch(r){}return null})}getHeaders(){return fe(this,null,function*(){const t={"Content-Type":"application/json",Accept:"application/json"},r=yield this.getCSRFToken();return r&&(t["X-Frappe-CSRF-Token"]=r),t})}sanitizeErrorMessage(t){if(!t)return"Something went wrong.";const r=t.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),a=r.toLowerCase().indexOf("traceback"),s=a>=0?r.slice(0,a).trim():r;return s.length>220?`${s.slice(0,220)}…`:s||"Something went wrong."}parseFrappeError(t){if((t==null?void 0:t.exc_type)==="ValidationError")return t.exc||t.message||"Validation error";if(t!=null&&t.message)return this.sanitizeErrorMessage(String(t.message));if(t!=null&&t._server_messages)try{const r=JSON.parse(t._server_messages),a=r==null?void 0:r[0],s=typeof a=="string"?JSON.parse(a):a,i=(s==null?void 0:s.message)||a||t._server_messages;return this.sanitizeErrorMessage(String(i))}catch(r){return this.sanitizeErrorMessage(String(t._server_messages))}return"Unknown error"}fetchJson(a){return fe(this,arguments,function*(t,r={}){const s=yield this.getHeaders(),i=yield fetch(t,ee({credentials:"include",headers:s},r)),l=yield i.json().catch(()=>({}));if(!i.ok)throw new Error(this.parseFrappeError(l));if(l.exc)throw new Error(this.parseFrappeError(l));return l})}getSalesInvoices(){return fe(this,arguments,function*(t={}){const{filters:r={},fields:a=["name","status","customer","customer_name","posting_date","currency","grand_total","outstanding_amount","docstatus","creation"],limit_start:s=0,limit_page_length:i=20,order_by:l="creation desc"}=t,u=new URLSearchParams;if(u.set("fields",JSON.stringify(a)),u.set("limit_start",String(s)),u.set("limit_page_length",String(i)),u.set("order_by",l),Object.keys(r).length>0){const f=Ta(r);f.length>0&&u.set("filters",JSON.stringify(f))}return{data:(yield this.fetchJson(`${this.baseURL}/api/resource/Sales Invoice?${u}`)).data||[]}})}getSalesInvoicesBySalesOrders(t){return fe(this,null,function*(){const{salesOrders:r,limit:a=1e3,orderBy:s="posting_date asc",fields:i=["name","posting_date","customer","customer_name","currency","grand_total","docstatus","status"]}=t;return r.length?(yield this.fetchJson(`${this.baseURL}/api/method/frappe.client.get_list`,{method:"POST",body:JSON.stringify({doctype:"Sales Invoice",fields:i,filters:[["Sales Invoice Item","sales_order","in",r]],order_by:s,limit_page_length:a})})).message||[]:[]})}getSalesInvoicesLinkedToProject(t){return fe(this,null,function*(){const{project:r,limit:a=1e3,orderBy:s="posting_date asc",fields:i=["name","posting_date","customer","customer_name","currency","grand_total","docstatus","status"]}=t;if(!(r!=null&&r.trim()))return[];const l=p=>this.fetchJson(`${this.baseURL}/api/method/frappe.client.get_list`,{method:"POST",body:JSON.stringify({doctype:"Sales Invoice",fields:i,filters:p,order_by:s,limit_page_length:a})}).then(m=>m.message||[]).catch(()=>[]),[u,d]=yield Promise.all([l([["project","=",r]]),l([["Sales Invoice Item","project","=",r]])]),f=new Map;for(const p of u)p!=null&&p.name&&f.set(p.name,p);for(const p of d)p!=null&&p.name&&f.set(p.name,p);return[...f.values()].sort((p,m)=>String(p.posting_date||"").localeCompare(String(m.posting_date||"")))})}getSalesInvoiceCount(){return fe(this,arguments,function*(t={}){var a,s;const r=new URLSearchParams;if(r.set("fields",JSON.stringify(["count(name) as count"])),Object.keys(t).length>0){const i=Ta(t);i.length>0&&r.set("filters",JSON.stringify(i))}try{return((s=(a=(yield this.fetchJson(`${this.baseURL}/api/resource/Sales Invoice?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)||0}catch(i){return 0}})}getSalesInvoice(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Sales%20Invoice/${encodeURIComponent(t)}`)).data})}createSalesInvoice(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Sales%20Invoice`,{method:"POST",body:JSON.stringify(t)})).data})}updateSalesInvoice(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Sales%20Invoice/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}clearItemLinkNones(t){return fe(this,null,function*(){var l;const r=yield this.getHeaders(),a=yield this.fetchJson(`${this.baseURL}/api/resource/Sales%20Invoice/${encodeURIComponent(t)}`),s=((l=a==null?void 0:a.data)==null?void 0:l.items)||[],i=["delivery_note","dn_detail","sales_order","so_detail","against_delivery_note","against_sales_order"];for(const u of s)!u.name||!i.some(f=>u[f]==="None"||u[f]==="none")||(yield this.fetchJson(`${this.baseURL}/api/method/frappe.client.set_value`,{method:"POST",headers:r,body:JSON.stringify({doctype:"Sales Invoice Item",name:u.name,fieldname:{delivery_note:"",dn_detail:"",sales_order:"",so_detail:"",against_delivery_note:"",against_sales_order:""}})}))})}submitSalesInvoice(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Sales%20Invoice/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({docstatus:1})})).data})}}const Ii=new LW;class IW{constructor(){xn(this,"csrfToken",null)}getCSRFToken(){return fe(this,null,function*(){var t;if(typeof window=="undefined")return null;if(window.csrf_token)return window.csrf_token;if((t=window.frappe)!=null&&t.csrf_token)return window.frappe.csrf_token;try{const r=yield fetch("/api/method/frappe.sessions.get_csrf_token",{credentials:"include"});if(r.ok){const a=yield r.json();if(a.message)return window.csrf_token=a.message,a.message}}catch(r){}return null})}getHeaders(){return fe(this,null,function*(){const t={"Content-Type":"application/json",Accept:"application/json"},r=yield this.getCSRFToken();return r&&(t["X-Frappe-CSRF-Token"]=r),t})}fetchJson(a){return fe(this,arguments,function*(t,r={}){const s=yield fetch(t,ee({credentials:"include"},r)),i=yield s.json();if(!s.ok){let l=(i==null?void 0:i.exc_type)||(i==null?void 0:i.message)||`HTTP ${s.status}`;if(i!=null&&i._server_messages)try{const u=JSON.parse(i._server_messages),d=Array.isArray(u)?u.map(f=>{try{return JSON.parse(f).message}catch(p){return f}}):[];d.length&&(l=d.join(`
`))}catch(u){}throw new Error(l)}return i})}getPaymentEntries(){return fe(this,arguments,function*(t={}){var i,l,u;const r=new URLSearchParams,a=["name","payment_type","posting_date","party","party_name","party_type","paid_amount","received_amount","status","mode_of_payment","company","docstatus","creation"];return r.set("fields",JSON.stringify(a)),(i=t.filters)!=null&&i.length&&r.set("filters",JSON.stringify(t.filters)),r.set("limit_start",String((l=t.limit_start)!=null?l:0)),r.set("limit_page_length",String((u=t.limit_page_length)!=null?u:20)),r.set("order_by","creation desc"),(yield this.fetchJson(`/api/resource/Payment Entry?${r}`)).data||[]})}getPaymentEntryCount(){return fe(this,arguments,function*(t=[]){var a,s,i;const r=new URLSearchParams;r.set("fields",JSON.stringify(["count(name) as count"])),t.length&&r.set("filters",JSON.stringify(t));try{return(i=(s=(a=(yield this.fetchJson(`/api/resource/Payment%20Entry?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)!=null?i:0}catch(l){return 0}})}getPaymentEntry(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/Payment Entry/${encodeURIComponent(t)}`)).data})}createPaymentEntry(t){return fe(this,null,function*(){const r=yield this.getHeaders();return(yield this.fetchJson("/api/resource/Payment Entry",{method:"POST",headers:r,body:JSON.stringify(Se(ee({},t),{doctype:"Payment Entry"}))})).data})}updatePaymentEntry(t,r){return fe(this,null,function*(){const a=yield this.getHeaders();return(yield this.fetchJson(`/api/resource/Payment Entry/${encodeURIComponent(t)}`,{method:"PUT",headers:a,body:JSON.stringify(r)})).data})}submitPaymentEntry(t){return fe(this,null,function*(){const r=yield this.getHeaders();return(yield this.fetchJson(`/api/resource/Payment Entry/${encodeURIComponent(t)}`,{method:"PUT",headers:r,body:JSON.stringify({docstatus:1})})).data})}}const Rc=new IW,od="Material%20Request";class zW{getCSRFToken(){return fe(this,null,function*(){var t;if(typeof window=="undefined")return null;if(window.csrf_token)return window.csrf_token;if((t=window.frappe)!=null&&t.csrf_token)return window.frappe.csrf_token;try{const r=yield fetch("/api/method/frappe.sessions.get_csrf_token",{credentials:"include"});if(r.ok){const a=yield r.json();if(a.message)return window.csrf_token=a.message,a.message}}catch(r){}return null})}getHeaders(){return fe(this,null,function*(){const t={"Content-Type":"application/json",Accept:"application/json"},r=yield this.getCSRFToken();return r&&(t["X-Frappe-CSRF-Token"]=r),t})}fetchJson(a){return fe(this,arguments,function*(t,r={}){const s=yield this.getHeaders(),i=yield fetch(t,ee({credentials:"include",headers:s},r)),l=yield i.json().catch(()=>({}));if(!i.ok)throw new Error(Ya(l)||(l==null?void 0:l.message)||`HTTP ${i.status}`);if(l.exc)throw new Error(Ya(l)||"Request failed");return l})}getMaterialRequests(){return fe(this,arguments,function*(t={}){var i,l,u,d;const r=new URLSearchParams,a=["name","material_request_type","transaction_date","status","company","docstatus","creation","modified"];return r.set("fields",JSON.stringify(a)),(i=t.filters)!=null&&i.length&&r.set("filters",JSON.stringify(t.filters)),r.set("limit_start",String((l=t.limit_start)!=null?l:0)),r.set("limit_page_length",String((u=t.limit_page_length)!=null?u:20)),r.set("order_by",(d=t.order_by)!=null?d:"creation desc"),(yield this.fetchJson(`/api/resource/${od}?${r}`)).data||[]})}getMaterialRequestCount(){return fe(this,arguments,function*(t=[]){var a,s,i;const r=new URLSearchParams;r.set("fields",JSON.stringify(["count(name) as count"])),t.length&&r.set("filters",JSON.stringify(t));try{return(i=(s=(a=(yield this.fetchJson(`/api/resource/${od}?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)!=null?i:0}catch(l){return 0}})}getMaterialRequest(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${od}/${encodeURIComponent(t)}`)).data})}createMaterialRequest(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${od}`,{method:"POST",body:JSON.stringify(t)})).data})}updateMaterialRequest(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${od}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}submitMaterialRequest(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${od}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({docstatus:1})})).data})}}const Fc=new zW,ld="Purchase%20Order";class BW{getCSRFToken(){return fe(this,null,function*(){var t;if(typeof window=="undefined")return null;if(window.csrf_token)return window.csrf_token;if((t=window.frappe)!=null&&t.csrf_token)return window.frappe.csrf_token;try{const r=yield fetch("/api/method/frappe.sessions.get_csrf_token",{credentials:"include"});if(r.ok){const a=yield r.json();if(a.message)return window.csrf_token=a.message,a.message}}catch(r){}return null})}getHeaders(){return fe(this,null,function*(){const t={"Content-Type":"application/json",Accept:"application/json"},r=yield this.getCSRFToken();return r&&(t["X-Frappe-CSRF-Token"]=r),t})}fetchJson(a){return fe(this,arguments,function*(t,r={}){const s=yield this.getHeaders(),i=yield fetch(t,ee({credentials:"include",headers:s},r)),l=yield i.json().catch(()=>({}));if(!i.ok)throw new Error(Ya(l)||(l==null?void 0:l.message)||`HTTP ${i.status}`);if(l.exc)throw new Error(Ya(l)||"Request failed");return l})}getPurchaseOrders(){return fe(this,arguments,function*(t={}){var i,l,u,d;const r=new URLSearchParams,a=["name","supplier","supplier_name","transaction_date","schedule_date","status","grand_total","currency","docstatus","company","creation","modified"];return r.set("fields",JSON.stringify(a)),(i=t.filters)!=null&&i.length&&r.set("filters",JSON.stringify(t.filters)),r.set("limit_start",String((l=t.limit_start)!=null?l:0)),r.set("limit_page_length",String((u=t.limit_page_length)!=null?u:20)),r.set("order_by",(d=t.order_by)!=null?d:"creation desc"),(yield this.fetchJson(`/api/resource/${ld}?${r}`)).data||[]})}getPurchaseOrderCount(){return fe(this,arguments,function*(t=[]){var a,s,i;const r=new URLSearchParams;r.set("fields",JSON.stringify(["count(name) as count"])),t.length&&r.set("filters",JSON.stringify(t));try{return(i=(s=(a=(yield this.fetchJson(`/api/resource/${ld}?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)!=null?i:0}catch(l){return 0}})}getPurchaseOrder(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${ld}/${encodeURIComponent(t)}`)).data})}createPurchaseOrder(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${ld}`,{method:"POST",body:JSON.stringify(t)})).data})}updatePurchaseOrder(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${ld}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}submitPurchaseOrder(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${ld}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({docstatus:1})})).data})}}const Mc=new BW,cd="Purchase%20Receipt";class $W{getCSRFToken(){return fe(this,null,function*(){var t;if(typeof window=="undefined")return null;if(window.csrf_token)return window.csrf_token;if((t=window.frappe)!=null&&t.csrf_token)return window.frappe.csrf_token;try{const r=yield fetch("/api/method/frappe.sessions.get_csrf_token",{credentials:"include"});if(r.ok){const a=yield r.json();if(a.message)return window.csrf_token=a.message,a.message}}catch(r){}return null})}getHeaders(){return fe(this,null,function*(){const t={"Content-Type":"application/json",Accept:"application/json"},r=yield this.getCSRFToken();return r&&(t["X-Frappe-CSRF-Token"]=r),t})}fetchJson(a){return fe(this,arguments,function*(t,r={}){const s=yield this.getHeaders(),i=yield fetch(t,ee({credentials:"include",headers:s},r)),l=yield i.json().catch(()=>({}));if(!i.ok)throw new Error(Ya(l)||(l==null?void 0:l.message)||`HTTP ${i.status}`);if(l.exc)throw new Error(Ya(l)||"Request failed");return l})}getPurchaseReceipts(){return fe(this,arguments,function*(t={}){var i,l,u,d;const r=new URLSearchParams,a=["name","supplier","supplier_name","posting_date","status","grand_total","currency","docstatus","company","creation","modified"];return r.set("fields",JSON.stringify(a)),(i=t.filters)!=null&&i.length&&r.set("filters",JSON.stringify(t.filters)),r.set("limit_start",String((l=t.limit_start)!=null?l:0)),r.set("limit_page_length",String((u=t.limit_page_length)!=null?u:20)),r.set("order_by",(d=t.order_by)!=null?d:"creation desc"),(yield this.fetchJson(`/api/resource/${cd}?${r}`)).data||[]})}getPurchaseReceiptCount(){return fe(this,arguments,function*(t=[]){var a,s,i;const r=new URLSearchParams;r.set("fields",JSON.stringify(["count(name) as count"])),t.length&&r.set("filters",JSON.stringify(t));try{return(i=(s=(a=(yield this.fetchJson(`/api/resource/${cd}?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)!=null?i:0}catch(l){return 0}})}getPurchaseReceipt(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${cd}/${encodeURIComponent(t)}`)).data})}createPurchaseReceipt(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${cd}`,{method:"POST",body:JSON.stringify(t)})).data})}updatePurchaseReceipt(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${cd}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}submitPurchaseReceipt(t){return fe(this,null,function*(){return(yield this.fetchJson(`/api/resource/${cd}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({docstatus:1})})).data})}}const Lc=new $W;class UW{constructor(){xn(this,"baseURL",Ad.BASE_URL)}getCSRFToken(){return fe(this,null,function*(){var t;if(typeof window=="undefined")return null;if(window.csrf_token)return window.csrf_token;if((t=window.frappe)!=null&&t.csrf_token)return window.frappe.csrf_token;try{const r=yield fetch(`${this.baseURL}/api/method/frappe.sessions.get_csrf_token`,{credentials:"include"});if(r.ok){const a=yield r.json();if(a.message)return window.csrf_token=a.message,a.message}}catch(r){}return null})}getHeaders(){return fe(this,null,function*(){const t={Accept:"application/json","Content-Type":"application/json"},r=yield this.getCSRFToken();return r&&(t["X-Frappe-CSRF-Token"]=r),t})}parseFrappeError(t){return fe(this,null,function*(){var a;try{const s=yield t.json();if(s._server_messages)try{const i=JSON.parse(s._server_messages),l=typeof i[0]=="string"?JSON.parse(i[0]):i[0];if(l!=null&&l.message)return new Error(l.message)}catch(i){}if(s.message&&typeof s.message=="string")return new Error(s.message);if(s.exc_type)return new Error(`${s.exc_type}: ${((a=s.exc)==null?void 0:a.split(`
`).slice(-2).join(" ").trim())||t.statusText}`)}catch(s){}const r={403:"Permission denied.",404:"Record not found.",417:"Validation error.",500:"Server error."};return new Error(r[t.status]||`HTTP ${t.status}`)})}fetchJson(t,r){return fe(this,null,function*(){const a=yield fetch(t,Se(ee({credentials:"include"},r),{headers:ee(ee({},yield this.getHeaders()),(r==null?void 0:r.headers)||{})}));if(!a.ok)throw yield this.parseFrappeError(a.clone());return a.json()})}getCustomers(){return fe(this,arguments,function*(t={}){const{limit_start:r=0,limit_page_length:a=20,filters:s={}}=t,i=new URLSearchParams;if(i.set("fields",JSON.stringify(["name","customer_name","customer_type","customer_group","territory","disabled","creation","modified"])),i.set("limit_start",String(r)),i.set("limit_page_length",String(a)),i.set("order_by","modified desc"),Object.keys(s).length>0){const u=Ta(s);u.length>0&&i.set("filters",JSON.stringify(u))}return{data:(yield this.fetchJson(`${this.baseURL}/api/resource/Customer?${i}`)).data||[]}})}getCustomer(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Customer/${encodeURIComponent(t)}`)).data})}createCustomer(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Customer`,{method:"POST",body:JSON.stringify(t)})).data})}updateCustomer(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Customer/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}getCustomerCount(){return fe(this,arguments,function*(t={}){var a,s;const r=new URLSearchParams;if(r.set("fields",JSON.stringify(["count(name) as count"])),Object.keys(t).length>0){const i=Ta(t);i.length>0&&r.set("filters",JSON.stringify(i))}try{return((s=(a=(yield this.fetchJson(`${this.baseURL}/api/resource/Customer?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)||0}catch(i){return 0}})}getEmployees(){return fe(this,arguments,function*(t={}){const{limit_start:r=0,limit_page_length:a=20,filters:s={}}=t,i=new URLSearchParams;if(i.set("fields",JSON.stringify(["name","employee_name","first_name","last_name","gender","status","company","designation","department","date_of_joining","creation","modified"])),i.set("limit_start",String(r)),i.set("limit_page_length",String(a)),i.set("order_by","modified desc"),Object.keys(s).length>0){const u=Ta(s);u.length>0&&i.set("filters",JSON.stringify(u))}return{data:(yield this.fetchJson(`${this.baseURL}/api/resource/Employee?${i}`)).data||[]}})}getEmployee(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Employee/${encodeURIComponent(t)}`)).data})}createEmployee(t){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Employee`,{method:"POST",body:JSON.stringify(t)})).data})}updateEmployee(t,r){return fe(this,null,function*(){return(yield this.fetchJson(`${this.baseURL}/api/resource/Employee/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(r)})).data})}getEmployeeCount(){return fe(this,arguments,function*(t={}){var a,s;const r=new URLSearchParams;if(r.set("fields",JSON.stringify(["count(name) as count"])),Object.keys(t).length>0){const i=Ta(t);i.length>0&&r.set("filters",JSON.stringify(i))}try{return((s=(a=(yield this.fetchJson(`${this.baseURL}/api/resource/Employee?${r}`)).data)==null?void 0:a[0])==null?void 0:s.count)||0}catch(i){return 0}})}}const qs=new UW,sT=()=>({projects:null,tasks:null,timesheets:null,salesOrders:null,deliveryNotes:null,salesInvoices:null,paymentEntries:null,materialRequests:null,purchaseOrders:null,purchaseReceipts:null,customers:null,employees:null,projectTemplates:null,activityTypes:null}),Fn=({label:e,sub:t,icon:r,count:a,loading:s,onClick:i,onNew:l,iconClassName:u="bg-gradient-to-br from-blue-600 to-indigo-700",cardClassName:d="",secondaryNew:f})=>n.jsx("div",{className:`group rounded-lg border overflow-hidden hover:shadow-md transition-all cursor-pointer shadow-sm h-full min-w-0 flex flex-col ${d||"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-blue-300/80 dark:hover:border-blue-600"}`,onClick:i,children:n.jsxs("div",{className:"p-2 flex-1 flex flex-col min-h-0",children:[n.jsxs("div",{className:"flex items-start justify-between mb-1 gap-1",children:[n.jsx("div",{className:`w-7 h-7 rounded-md ${u} flex items-center justify-center text-white shadow-sm shrink-0`,children:n.jsx("span",{className:"text-xs",children:r})}),(l||f)&&n.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[l&&n.jsx("button",{type:"button",onClick:p=>{p.stopPropagation(),l()},className:"p-1 rounded-md bg-blue-600 text-white border border-blue-600 hover:bg-blue-700 shadow-sm",title:`New ${e}`,children:n.jsx(Pt,{size:9})}),f&&n.jsx("button",{type:"button",onClick:p=>{p.stopPropagation(),f.onClick()},className:"p-1 rounded-md border border-violet-200 dark:border-violet-700 bg-violet-50 dark:bg-violet-900/40 text-violet-700 dark:text-violet-200 hover:bg-violet-100 dark:hover:bg-violet-900/60",title:f.title,children:n.jsxs("span",{className:"text-[10px] flex items-center gap-0.5 font-bold",children:[n.jsx(Pt,{size:7}),f.icon]})})]})]}),n.jsx("p",{className:"font-semibold text-gray-900 dark:text-white text-xs leading-tight",children:e}),t&&n.jsx("p",{className:"text-[10px] text-gray-500 dark:text-gray-400 mt-0.5 leading-snug line-clamp-2",children:t}),a!==void 0&&n.jsx("p",{className:"text-base font-bold text-gray-900 dark:text-white mt-auto pt-1 leading-none tabular-nums",children:s&&a===null?n.jsx(vt,{className:"animate-spin text-base text-gray-400"}):a!=null?a:0})]})}),Em="grid gap-1.5 w-full [grid-template-columns:repeat(auto-fit,minmax(6.75rem,1fr))]",Am=({title:e,subtitle:t,icon:r,children:a,headerClassName:s="bg-gradient-to-r from-slate-600 to-slate-800 dark:from-slate-700 dark:to-slate-900",bodyClassName:i="",className:l=""})=>n.jsxs("div",{className:`rounded-lg overflow-hidden shadow-sm border border-gray-200/70 dark:border-gray-700/80 ring-1 ring-black/[0.03] dark:ring-white/[0.06] flex flex-col min-h-0 h-full ${l}`,children:[n.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1.5 text-white shadow-inner shrink-0 ${s}`,children:[n.jsx("span",{className:"opacity-95 drop-shadow-sm shrink-0",children:r}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"text-xs font-semibold leading-tight tracking-tight",children:e}),t&&n.jsx("p",{className:"text-[9px] text-white/85 leading-snug mt-0.5 line-clamp-2",children:t})]})]}),n.jsx("div",{className:`p-2 flex-1 min-h-0 ${i}`,children:a})]}),HW=()=>{var d,f,p;const{t:e}=sr(),t=Ut(),[r,a]=y.useState(sT),[s,i]=y.useState(!0),l=y.useCallback(()=>fe(null,null,function*(){i(!0),a(sT());const m=yield Promise.allSettled([wt.getModuleCounts(),cs.getSalesOrderCount([]),Dc.getDeliveryNoteCount([]),Ii.getSalesInvoiceCount({}),Rc.getPaymentEntryCount([]),Fc.getMaterialRequestCount([]),Mc.getPurchaseOrderCount([]),Lc.getPurchaseReceiptCount([]),qs.getCustomerCount({}),qs.getEmployeeCount({}),wt.getProjectTemplateCount({}),wt.getActivityTypeCount({})]),x=b=>{const w=m[b];return w.status==="fulfilled"?w.value:0},v=m[0].status==="fulfilled"?m[0].value:{projects:0,tasks:0,timesheets:0};a({projects:v.projects,tasks:v.tasks,timesheets:v.timesheets,salesOrders:x(1),deliveryNotes:x(2),salesInvoices:x(3),paymentEntries:x(4),materialRequests:x(5),purchaseOrders:x(6),purchaseReceipts:x(7),customers:x(8),employees:x(9),projectTemplates:x(10),activityTypes:x(11)}),i(!1)}),[]);y.useEffect(()=>{l()},[l]);const u=s;return n.jsxs("div",{className:"p-3 min-h-screen bg-gray-50 dark:bg-gray-900 max-w-[1920px] mx-auto",children:[n.jsxs("div",{className:"flex flex-col gap-2 mb-3 sm:flex-row sm:items-center sm:justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("div",{className:"w-9 h-9 rounded-lg bg-gradient-to-br from-blue-600 to-indigo-700 flex items-center justify-center shadow-md ring-2 ring-white/50 dark:ring-gray-700/50",children:n.jsx(Id,{className:"text-white text-sm drop-shadow"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:e("projects.moduleTitle","Project Management")}),n.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-0.5",children:e("projects.hubSubtitle","Projects, tasks, timesheets, and linked other documents.")})]})]}),n.jsx("button",{type:"button",onClick:l,className:"p-2 text-gray-600 hover:text-blue-700 dark:text-gray-300 dark:hover:text-blue-400 border border-gray-200 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 shadow-sm self-start sm:self-center",title:e("common.refresh","Refresh"),children:n.jsx(en,{size:13,className:s?"animate-spin":""})})]}),n.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-2",children:[n.jsxs("button",{type:"button",onClick:()=>t("/projects/list"),className:"flex items-center gap-2 text-xs font-semibold px-3 py-1.5 rounded-full border border-sky-200 dark:border-sky-700 bg-gradient-to-r from-sky-100 to-blue-100 dark:from-sky-900/40 dark:to-blue-900/30 text-sky-950 dark:text-sky-100 shadow-sm hover:shadow transition-shadow",children:[n.jsx("span",{className:"text-blue-800 dark:text-sky-300 tabular-nums font-bold",children:s&&r.projects===null?"…":(d=r.projects)!=null?d:0}),"Open projects"]}),n.jsxs("button",{type:"button",onClick:()=>t("/projects/tasks"),className:"flex items-center gap-2 text-xs font-semibold px-3 py-1.5 rounded-full border border-indigo-200 dark:border-indigo-700 bg-gradient-to-r from-indigo-50 to-violet-100 dark:from-indigo-900/35 dark:to-violet-900/25 text-gray-800 dark:text-indigo-100 shadow-sm hover:shadow transition-shadow",children:[n.jsx("span",{className:"text-indigo-700 dark:text-indigo-300 tabular-nums font-bold",children:s&&r.tasks===null?"…":(f=r.tasks)!=null?f:0}),"Tasks"]}),n.jsxs("button",{type:"button",onClick:()=>t("/projects/timesheets"),className:"flex items-center gap-2 text-xs font-semibold px-3 py-1.5 rounded-full border border-emerald-200 dark:border-emerald-700 bg-gradient-to-r from-emerald-50 to-teal-100 dark:from-emerald-900/35 dark:to-teal-900/25 text-gray-800 dark:text-emerald-100 shadow-sm hover:shadow transition-shadow",children:[n.jsx("span",{className:"text-emerald-700 dark:text-emerald-300 tabular-nums font-bold",children:s&&r.timesheets===null?"…":(p=r.timesheets)!=null?p:0}),"Timesheets"]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-2 lg:gap-3 lg:items-stretch",children:[n.jsxs("div",{className:"flex flex-col gap-2 min-w-0",children:[n.jsx(Am,{title:"Masters",subtitle:"Customers, employees, templates, and activity types.",icon:n.jsx(eT,{size:14}),headerClassName:"bg-gradient-to-r from-purple-600 to-violet-700 dark:from-purple-700 dark:to-violet-800",bodyClassName:"bg-white dark:bg-gray-900/40",children:n.jsxs("div",{className:Em,children:[n.jsx(Fn,{label:"Customers",sub:"Customer master",icon:n.jsx(eT,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-violet-500 to-purple-700",cardClassName:"bg-gradient-to-b from-white to-violet-50/40 dark:from-gray-800 dark:to-violet-950/20 border-violet-200/50 dark:border-violet-800/50",count:r.customers,loading:s,onClick:()=>t("/customers"),onNew:()=>t("/customers/new")}),n.jsx(Fn,{label:"Employees",sub:"Employee master",icon:n.jsx(Dg,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-fuchsia-500 to-pink-700",cardClassName:"bg-gradient-to-b from-white to-fuchsia-50/35 dark:from-gray-800 dark:to-fuchsia-950/15 border-fuchsia-200/50 dark:border-fuchsia-800/50",count:r.employees,loading:s,onClick:()=>t("/employees"),onNew:()=>t("/employees/new")}),n.jsx(Fn,{label:"Project template",sub:"Reusable project templates",icon:n.jsx(lP,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-purple-600 to-indigo-800",cardClassName:"bg-gradient-to-b from-white to-purple-50/35 dark:from-gray-800 dark:to-purple-950/20 border-purple-200/50 dark:border-purple-800/50",count:r.projectTemplates,loading:s,onClick:()=>t("/projects/templates"),onNew:()=>t("/projects/templates/new")}),n.jsx(Fn,{label:"Activity type",sub:"Billing categories",icon:n.jsx(nP,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-cyan-500 to-blue-700",cardClassName:"bg-gradient-to-b from-white to-cyan-50/30 dark:from-gray-800 dark:to-cyan-950/15 border-cyan-200/50 dark:border-cyan-800/50",count:r.activityTypes,loading:s,onClick:()=>t("/projects/activity-types"),onNew:()=>t("/projects/activity-types/new")})]})}),n.jsx(Am,{title:"Sales flow",subtitle:"Sales Order -> Delivery Note -> Sales Invoice -> Payment",icon:n.jsx(Ld,{size:14}),headerClassName:"bg-gradient-to-r from-green-600 to-emerald-700 dark:from-green-700 dark:to-emerald-800",bodyClassName:"bg-white dark:bg-gray-900/40",children:n.jsxs("div",{className:Em,children:[n.jsx(Fn,{label:"Sales Order",sub:"Sales flow",icon:n.jsx(Ld,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-emerald-600 to-teal-700",cardClassName:"bg-gradient-to-b from-white to-emerald-50/45 dark:from-gray-800 dark:to-emerald-950/20 border-emerald-200/55 dark:border-emerald-800/50",count:r.salesOrders,loading:u,onClick:()=>t("/sales-orders")}),n.jsx(Fn,{label:"Delivery Note",sub:"Sales flow",icon:n.jsx(Yx,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-cyan-600 to-blue-700",cardClassName:"bg-gradient-to-b from-white to-cyan-50/40 dark:from-gray-800 dark:to-cyan-950/15 border-cyan-200/55 dark:border-cyan-800/50",count:r.deliveryNotes,loading:u,onClick:()=>t("/delivery-notes")}),n.jsx(Fn,{label:"Sales Invoice",sub:"Sales flow",icon:n.jsx(Kc,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-blue-600 to-indigo-700",cardClassName:"bg-gradient-to-b from-white to-blue-50/40 dark:from-gray-800 dark:to-blue-950/20 border-blue-200/55 dark:border-blue-800/50",count:r.salesInvoices,loading:u,onClick:()=>t("/invoices")}),n.jsx(Fn,{label:"Payment Entry",sub:"Sales flow",icon:n.jsx(Dl,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-violet-600 to-purple-800",cardClassName:"bg-gradient-to-b from-white to-violet-50/40 dark:from-gray-800 dark:to-violet-950/20 border-violet-200/55 dark:border-violet-800/50",count:r.paymentEntries,loading:u,onClick:()=>t("/payment-entries")})]})})]}),n.jsxs("div",{className:"flex flex-col gap-2 min-w-0",children:[n.jsx(Am,{title:"Project & task management",subtitle:"Core project monitoring and planning.",icon:n.jsx(Id,{size:14}),headerClassName:"bg-gradient-to-r from-blue-600 to-indigo-700 dark:from-blue-700 dark:to-indigo-800",bodyClassName:"bg-white dark:bg-gray-900/40",children:n.jsxs("div",{className:Em,children:[n.jsx(Fn,{label:"Projects",sub:"Open projects",icon:n.jsx(Id,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-sky-500 to-blue-700",cardClassName:"bg-gradient-to-b from-white to-sky-50/50 dark:from-gray-800 dark:to-sky-950/20 border-sky-200/60 dark:border-sky-800/50",count:r.projects,loading:s,onClick:()=>t("/projects/list"),onNew:()=>t("/projects/list/new")}),n.jsx(Fn,{label:"Tasks",sub:"All tasks",icon:n.jsx(Gc,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-indigo-500 to-violet-700",cardClassName:"bg-gradient-to-b from-white to-indigo-50/40 dark:from-gray-800 dark:to-indigo-950/20 border-indigo-200/50 dark:border-indigo-800/50",count:r.tasks,loading:s,onClick:()=>t("/projects/tasks"),onNew:()=>t("/projects/tasks/new")}),n.jsx(Fn,{label:"Timesheets",sub:"Time logs",icon:n.jsx(ds,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-emerald-500 to-teal-700",cardClassName:"bg-gradient-to-b from-white to-emerald-50/40 dark:from-gray-800 dark:to-emerald-950/20 border-emerald-200/50 dark:border-emerald-800/50",count:r.timesheets,loading:s,onClick:()=>t("/projects/timesheets"),onNew:()=>t("/projects/timesheets/new"),secondaryNew:{title:"New Sales Order",icon:n.jsx(Ld,{size:10}),onClick:()=>t("/sales-orders/new")}})]})}),n.jsx(Am,{title:"Buying / material flow",subtitle:"Material Request -> Purchase Order -> Purchase Receipt",icon:n.jsx(rT,{size:14}),headerClassName:"bg-gradient-to-r from-amber-500 via-orange-500 to-rose-600 dark:from-amber-600 dark:via-orange-600 dark:to-rose-700",bodyClassName:"bg-white dark:bg-gray-900/40",children:n.jsxs("div",{className:Em,children:[n.jsx(Fn,{label:"Material Request",sub:"Buying flow",icon:n.jsx(cP,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-amber-500 to-orange-600",cardClassName:"bg-gradient-to-b from-white to-amber-50/45 dark:from-gray-800 dark:to-amber-950/20 border-amber-200/55 dark:border-amber-800/50",count:r.materialRequests,loading:u,onClick:()=>t("/material-requests")}),n.jsx(Fn,{label:"Purchase Order",sub:"Buying flow",icon:n.jsx(Tq,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-orange-600 to-red-700",cardClassName:"bg-gradient-to-b from-white to-orange-50/40 dark:from-gray-800 dark:to-orange-950/20 border-orange-200/55 dark:border-orange-800/50",count:r.purchaseOrders,loading:u,onClick:()=>t("/purchase-orders")}),n.jsx(Fn,{label:"Purchase Receipt",sub:"Buying flow",icon:n.jsx(rT,{className:"text-white"}),iconClassName:"bg-gradient-to-br from-rose-600 to-pink-700",cardClassName:"bg-gradient-to-b from-white to-rose-50/40 dark:from-gray-800 dark:to-rose-950/20 border-rose-200/55 dark:border-rose-800/50",count:r.purchaseReceipts,loading:u,onClick:()=>t("/purchase-receipts")})]})})]})]})]})};var qW=["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","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function s_(e){if(typeof e!="string")return!1;var t=qW;return t.includes(e)}var WW=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],VW=new Set(WW);function kP(e){return typeof e!="string"?!1:VW.has(e)}function SP(e){return typeof e=="string"&&e.startsWith("data-")}function yi(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(kP(r)||SP(r))&&(t[r]=e[r]);return t}function oh(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return yi(t)}return typeof e=="object"&&!Array.isArray(e)?yi(e):null}function Gs(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(kP(r)||SP(r)||s_(r))&&(t[r]=e[r]);return t}var GW=["children","width","height","viewBox","className","style","title","desc"];function Uw(){return Uw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Uw.apply(null,arguments)}function KW(e,t){if(e==null)return{};var r,a,s=YW(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function YW(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var i_=y.forwardRef((e,t)=>{var{children:r,width:a,height:s,viewBox:i,className:l,style:u,title:d,desc:f}=e,p=KW(e,GW),m=i||{width:a,height:s,x:0,y:0},x=Wt("recharts-surface",l);return y.createElement("svg",Uw({},Gs(p),{className:x,width:a,height:s,style:u,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),y.createElement("title",null,d),y.createElement("desc",null,f),r)}),XW=["children","className"];function Hw(){return Hw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Hw.apply(null,arguments)}function JW(e,t){if(e==null)return{};var r,a,s=QW(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function QW(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var un=y.forwardRef((e,t)=>{var{children:r,className:a}=e,s=JW(e,XW),i=Wt("recharts-layer",a);return y.createElement("g",Hw({className:i},Gs(s),{ref:t}),r)}),NP=y.createContext(null),ZW=()=>y.useContext(NP);function Nr(e){return function(){return e}}const CP=Math.cos,Rg=Math.sin,wi=Math.sqrt,Fg=Math.PI,Zx=2*Fg,qw=Math.PI,Ww=2*qw,Nc=1e-6,eV=Ww-Nc;function TP(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function tV(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return TP;const r=fc(10,t);return function(a){this._+=a[0];for(let s=1,i=a.length;s<i;++s)this._+=Math.round(arguments[s]*r)/r+a[s]}}class rV{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?TP:tV(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,a,s){this._append`Q${+t},${+r},${this._x1=+a},${this._y1=+s}`}bezierCurveTo(t,r,a,s,i,l){this._append`C${+t},${+r},${+a},${+s},${this._x1=+i},${this._y1=+l}`}arcTo(t,r,a,s,i){if(t=+t,r=+r,a=+a,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let l=this._x1,u=this._y1,d=a-t,f=s-r,p=l-t,m=u-r,x=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(x>Nc)if(!(Math.abs(m*d-f*p)>Nc)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let v=a-l,b=s-u,w=d*d+f*f,j=v*v+b*b,k=Math.sqrt(w),C=Math.sqrt(x),N=i*Math.tan((qw-Math.acos((w+x-j)/(2*k*C)))/2),O=N/C,E=N/k;Math.abs(O-1)>Nc&&this._append`L${t+O*p},${r+O*m}`,this._append`A${i},${i},0,0,${+(m*v>p*b)},${this._x1=t+E*d},${this._y1=r+E*f}`}}arc(t,r,a,s,i,l){if(t=+t,r=+r,a=+a,l=!!l,a<0)throw new Error(`negative radius: ${a}`);let u=a*Math.cos(s),d=a*Math.sin(s),f=t+u,p=r+d,m=1^l,x=l?s-i:i-s;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>Nc||Math.abs(this._y1-p)>Nc)&&this._append`L${f},${p}`,a&&(x<0&&(x=x%Ww+Ww),x>eV?this._append`A${a},${a},0,1,${m},${t-u},${r-d}A${a},${a},0,1,${m},${this._x1=f},${this._y1=p}`:x>Nc&&this._append`A${a},${a},0,${+(x>=qw)},${m},${this._x1=t+a*Math.cos(i)},${this._y1=r+a*Math.sin(i)}`)}rect(t,r,a,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${a=+a}v${+s}h${-a}Z`}toString(){return this._}}function o_(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const a=Math.floor(r);if(!(a>=0))throw new RangeError(`invalid digits: ${r}`);t=a}return e},()=>new rV(t)}function l_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function EP(e){this._context=e}EP.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 ey(e){return new EP(e)}function AP(e){return e[0]}function OP(e){return e[1]}function PP(e,t){var r=Nr(!0),a=null,s=ey,i=null,l=o_(u);e=typeof e=="function"?e:e===void 0?AP:Nr(e),t=typeof t=="function"?t:t===void 0?OP:Nr(t);function u(d){var f,p=(d=l_(d)).length,m,x=!1,v;for(a==null&&(i=s(v=l())),f=0;f<=p;++f)!(f<p&&r(m=d[f],f,d))===x&&((x=!x)?i.lineStart():i.lineEnd()),x&&i.point(+e(m,f,d),+t(m,f,d));if(v)return i=null,v+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Nr(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Nr(+d),u):t},u.defined=function(d){return arguments.length?(r=typeof d=="function"?d:Nr(!!d),u):r},u.curve=function(d){return arguments.length?(s=d,a!=null&&(i=s(a)),u):s},u.context=function(d){return arguments.length?(d==null?a=i=null:i=s(a=d),u):a},u}function Om(e,t,r){var a=null,s=Nr(!0),i=null,l=ey,u=null,d=o_(f);e=typeof e=="function"?e:e===void 0?AP:Nr(+e),t=typeof t=="function"?t:Nr(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?OP:Nr(+r);function f(m){var x,v,b,w=(m=l_(m)).length,j,k=!1,C,N=new Array(w),O=new Array(w);for(i==null&&(u=l(C=d())),x=0;x<=w;++x){if(!(x<w&&s(j=m[x],x,m))===k)if(k=!k)v=x,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),b=x-1;b>=v;--b)u.point(N[b],O[b]);u.lineEnd(),u.areaEnd()}k&&(N[x]=+e(j,x,m),O[x]=+t(j,x,m),u.point(a?+a(j,x,m):N[x],r?+r(j,x,m):O[x]))}if(C)return u=null,C+""||null}function p(){return PP().defined(s).curve(l).context(i)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Nr(+m),a=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Nr(+m),f):e},f.x1=function(m){return arguments.length?(a=m==null?null:typeof m=="function"?m:Nr(+m),f):a},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Nr(+m),r=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Nr(+m),f):t},f.y1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Nr(+m),f):r},f.lineX0=f.lineY0=function(){return p().x(e).y(t)},f.lineY1=function(){return p().x(e).y(r)},f.lineX1=function(){return p().x(a).y(t)},f.defined=function(m){return arguments.length?(s=typeof m=="function"?m:Nr(!!m),f):s},f.curve=function(m){return arguments.length?(l=m,i!=null&&(u=l(i)),f):l},f.context=function(m){return arguments.length?(m==null?i=u=null:u=l(i=m),f):i},f}class DP{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 aV(e){return new DP(e,!0)}function nV(e){return new DP(e,!1)}const c_={draw(e,t){const r=wi(t/Fg);e.moveTo(r,0),e.arc(0,0,r,0,Zx)}},sV={draw(e,t){const r=wi(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()}},RP=wi(1/3),iV=RP*2,oV={draw(e,t){const r=wi(t/iV),a=r*RP;e.moveTo(0,-r),e.lineTo(a,0),e.lineTo(0,r),e.lineTo(-a,0),e.closePath()}},lV={draw(e,t){const r=wi(t),a=-r/2;e.rect(a,a,r,r)}},cV=.8908130915292852,FP=Rg(Fg/10)/Rg(7*Fg/10),uV=Rg(Zx/10)*FP,dV=-CP(Zx/10)*FP,fV={draw(e,t){const r=wi(t*cV),a=uV*r,s=dV*r;e.moveTo(0,-r),e.lineTo(a,s);for(let i=1;i<5;++i){const l=Zx*i/5,u=CP(l),d=Rg(l);e.lineTo(d*r,-u*r),e.lineTo(u*a-d*s,d*a+u*s)}e.closePath()}},Ab=wi(3),hV={draw(e,t){const r=-wi(t/(Ab*3));e.moveTo(0,r*2),e.lineTo(-Ab*r,-r),e.lineTo(Ab*r,-r),e.closePath()}},Ds=-.5,Rs=wi(3)/2,Vw=1/wi(12),pV=(Vw/2+1)*3,mV={draw(e,t){const r=wi(t/pV),a=r/2,s=r*Vw,i=a,l=r*Vw+r,u=-i,d=l;e.moveTo(a,s),e.lineTo(i,l),e.lineTo(u,d),e.lineTo(Ds*a-Rs*s,Rs*a+Ds*s),e.lineTo(Ds*i-Rs*l,Rs*i+Ds*l),e.lineTo(Ds*u-Rs*d,Rs*u+Ds*d),e.lineTo(Ds*a+Rs*s,Ds*s-Rs*a),e.lineTo(Ds*i+Rs*l,Ds*l-Rs*i),e.lineTo(Ds*u+Rs*d,Ds*d-Rs*u),e.closePath()}};function gV(e,t){let r=null,a=o_(s);e=typeof e=="function"?e:Nr(e||c_),t=typeof t=="function"?t:Nr(t===void 0?64:+t);function s(){let i;if(r||(r=i=a()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return s.type=function(i){return arguments.length?(e=typeof i=="function"?i:Nr(i),s):e},s.size=function(i){return arguments.length?(t=typeof i=="function"?i:Nr(+i),s):t},s.context=function(i){return arguments.length?(r=i==null?null:i,s):r},s}function Mg(){}function Lg(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 MP(e){this._context=e}MP.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:Lg(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:Lg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xV(e){return new MP(e)}function LP(e){this._context=e}LP.prototype={areaStart:Mg,areaEnd:Mg,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:Lg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yV(e){return new LP(e)}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=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,a=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,a):this._context.moveTo(r,a);break;case 3:this._point=4;default:Lg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vV(e){return new IP(e)}function zP(e){this._context=e}zP.prototype={areaStart:Mg,areaEnd:Mg,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 bV(e){return new zP(e)}function iT(e){return e<0?-1:1}function oT(e,t,r){var a=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(a||s<0&&-0),l=(r-e._y1)/(s||a<0&&-0),u=(i*s+l*a)/(a+s);return(iT(i)+iT(l))*Math.min(Math.abs(i),Math.abs(l),.5*Math.abs(u))||0}function lT(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ob(e,t,r){var a=e._x0,s=e._y0,i=e._x1,l=e._y1,u=(i-a)/3;e._context.bezierCurveTo(a+u,s+u*t,i-u,l-u*r,i,l)}function Ig(e){this._context=e}Ig.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:Ob(this,this._t0,lT(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,Ob(this,lT(this,r=oT(this,e,t)),r);break;default:Ob(this,this._t0,r=oT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function BP(e){this._context=new $P(e)}(BP.prototype=Object.create(Ig.prototype)).point=function(e,t){Ig.prototype.point.call(this,t,e)};function $P(e){this._context=e}$P.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,a,s,i){this._context.bezierCurveTo(t,e,a,r,i,s)}};function wV(e){return new Ig(e)}function jV(e){return new BP(e)}function UP(e){this._context=e}UP.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 a=cT(e),s=cT(t),i=0,l=1;l<r;++i,++l)this._context.bezierCurveTo(a[0][i],s[0][i],a[1][i],s[1][i],e[l],t[l]);(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 cT(e){var t,r=e.length-1,a,s=new Array(r),i=new Array(r),l=new Array(r);for(s[0]=0,i[0]=2,l[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,i[t]=4,l[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,i[r-1]=7,l[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)a=s[t]/i[t-1],i[t]-=a,l[t]-=a*l[t-1];for(s[r-1]=l[r-1]/i[r-1],t=r-2;t>=0;--t)s[t]=(l[t]-s[t+1])/i[t];for(i[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function _V(e){return new UP(e)}function ty(e,t){this._context=e,this._t=t}ty.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var 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 kV(e){return new ty(e,.5)}function SV(e){return new ty(e,0)}function NV(e){return new ty(e,1)}function Xc(e,t){if((l=e.length)>1)for(var r=1,a,s,i=e[t[0]],l,u=i.length;r<l;++r)for(s=i,i=e[t[r]],a=0;a<u;++a)i[a][1]+=i[a][0]=isNaN(s[a][1])?s[a][0]:s[a][1]}function Gw(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function CV(e,t){return e[t]}function TV(e){const t=[];return t.key=e,t}function EV(){var e=Nr([]),t=Gw,r=Xc,a=CV;function s(i){var l=Array.from(e.apply(this,arguments),TV),u,d=l.length,f=-1,p;for(const m of i)for(u=0,++f;u<d;++u)(l[u][f]=[0,+a(m,l[u].key,f,i)]).data=m;for(u=0,p=l_(t(l));u<d;++u)l[p[u]].index=u;return r(l,p),l}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:Nr(Array.from(i)),s):e},s.value=function(i){return arguments.length?(a=typeof i=="function"?i:Nr(+i),s):a},s.order=function(i){return arguments.length?(t=i==null?Gw:typeof i=="function"?i:Nr(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i==null?Xc:i,s):r},s}function AV(e,t){if((a=e.length)>0){for(var r,a,s=0,i=e[0].length,l;s<i;++s){for(l=r=0;r<a;++r)l+=e[r][s][1]||0;if(l)for(r=0;r<a;++r)e[r][s][1]/=l}Xc(e,t)}}function OV(e,t){if((s=e.length)>0){for(var r=0,a=e[t[0]],s,i=a.length;r<i;++r){for(var l=0,u=0;l<s;++l)u+=e[l][r][1]||0;a[r][1]+=a[r][0]=-u/2}Xc(e,t)}}function PV(e,t){if(!(!((l=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var r=0,a=1,s,i,l;a<i;++a){for(var u=0,d=0,f=0;u<l;++u){for(var p=e[t[u]],m=p[a][1]||0,x=p[a-1][1]||0,v=(m-x)/2,b=0;b<u;++b){var w=e[t[b]],j=w[a][1]||0,k=w[a-1][1]||0;v+=j-k}d+=m,f+=v*m}s[a-1][1]+=s[a-1][0]=r,d&&(r-=f/d)}s[a-1][1]+=s[a-1][0]=r,Xc(e,t)}}var Pb={},Db={},uT;function DV(){if(uT)return Db;uT=1;function e(t){return t==="__proto__"}return Db.isUnsafeProperty=e,Db}var Rb={},dT;function HP(){if(dT)return Rb;dT=1;function e(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}return Rb.isDeepKey=e,Rb}var Fb={},fT;function u_(){if(fT)return Fb;fT=1;function e(t){var r;return typeof t=="string"||typeof t=="symbol"?t:Object.is((r=t==null?void 0:t.valueOf)==null?void 0:r.call(t),-0)?"-0":String(t)}return Fb.toKey=e,Fb}var Mb={},Lb={},hT;function RV(){if(hT)return Lb;hT=1;function e(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(e).join(",");const r=String(t);return r==="0"&&Object.is(Number(t),-0)?"-0":r}return Lb.toString=e,Lb}var pT;function d_(){if(pT)return Mb;pT=1;const e=u_(),t=RV();function r(a){if(Array.isArray(a))return a.map(e.toKey);if(typeof a=="symbol")return[a];a=t.toString(a);const s=[],i=a.length;if(i===0)return s;let l=0,u="",d="",f=!1;for(a.charCodeAt(0)===46&&(s.push(""),l++);l<i;){const p=a[l];d?p==="\\"&&l+1<i?(l++,u+=a[l]):p===d?d="":u+=p:f?p==='"'||p==="'"?d=p:p==="]"?(f=!1,s.push(u),u=""):u+=p:p==="["?(f=!0,u&&(s.push(u),u="")):p==="."?u&&(s.push(u),u=""):u+=p,l++}return u&&s.push(u),s}return Mb.toPath=r,Mb}var mT;function f_(){if(mT)return Pb;mT=1;const e=DV(),t=HP(),r=u_(),a=d_();function s(l,u,d){if(l==null)return d;switch(typeof u){case"string":{if(e.isUnsafeProperty(u))return d;const f=l[u];return f===void 0?t.isDeepKey(u)?s(l,a.toPath(u),d):d:f}case"number":case"symbol":{typeof u=="number"&&(u=r.toKey(u));const f=l[u];return f===void 0?d:f}default:{if(Array.isArray(u))return i(l,u,d);if(Object.is(u==null?void 0:u.valueOf(),-0)?u="-0":u=String(u),e.isUnsafeProperty(u))return d;const f=l[u];return f===void 0?d:f}}}function i(l,u,d){if(u.length===0)return d;let f=l;for(let p=0;p<u.length;p++){if(f==null||e.isUnsafeProperty(u[p]))return d;f=f[u[p]]}return f===void 0?d:f}return Pb.get=s,Pb}var Ib,gT;function FV(){return gT||(gT=1,Ib=f_().get),Ib}var MV=FV();const Jc=zl(MV);var LV=4;function Tl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:LV,r=fc(10,t),a=Math.round(e*r)/r;return Object.is(a,-0)?0:a}function Wr(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return e.reduce((s,i,l)=>{var u=r[l-1];return typeof u=="string"?s+u+i:u!==void 0?s+Tl(u)+i:s+i},"")}var Oa=e=>e===0?0:e>0?1:-1,Wi=e=>typeof e=="number"&&e!=+e,Qc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,pt=e=>(typeof e=="number"||e instanceof Number)&&!Wi(e),Vi=e=>pt(e)||typeof e=="string",IV=0,lh=e=>{var t=++IV;return"".concat(e||"").concat(t)},on=function(t,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!pt(t)&&typeof t!="string")return a;var i;if(Qc(t)){if(r==null)return a;var l=t.indexOf("%");i=r*parseFloat(t.slice(0,l))/100}else i=+t;return Wi(i)&&(i=a),s&&r!=null&&i>r&&(i=r),i},qP=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},a=0;a<t;a++)if(!r[String(e[a])])r[String(e[a])]=!0;else return!0;return!1};function ba(e,t,r){return pt(e)&&pt(t)?Tl(e+r*(t-e)):t}function zV(e,t,r){if(!(!e||!e.length))return e.find(a=>a&&(typeof t=="function"?t(a):Jc(a,t))===r)}var ja=e=>e===null||typeof e=="undefined",Mh=e=>ja(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function In(e){return e!=null}function d0(){}var BV=["type","size","sizeType"];function Kw(){return Kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Kw.apply(null,arguments)}function xT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function yT(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xT(Object(r),!0).forEach(function(a){$V(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xT(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function $V(e,t,r){return(t=UV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UV(e){var t=HV(e,"string");return typeof t=="symbol"?t:t+""}function HV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qV(e,t){if(e==null)return{};var r,a,s=WV(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function WV(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var WP={symbolCircle:c_,symbolCross:sV,symbolDiamond:oV,symbolSquare:lV,symbolStar:fV,symbolTriangle:hV,symbolWye:mV},VV=Math.PI/180,GV=e=>{var t="symbol".concat(Mh(e));return WP[t]||c_},KV=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var a=18*VV;return 1.25*e*e*(Math.tan(a)-Math.tan(a*2)*fc(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},YV=(e,t)=>{WP["symbol".concat(Mh(e))]=t},h_=e=>{var{type:t="circle",size:r=64,sizeType:a="area"}=e,s=qV(e,BV),i=yT(yT({},s),{},{type:t,size:r,sizeType:a}),l="circle";typeof t=="string"&&(l=t);var u=()=>{var x=GV(l),v=gV().type(x).size(KV(r,a,l)),b=v();if(b!==null)return b},{className:d,cx:f,cy:p}=i,m=Gs(i);return pt(f)&&pt(p)&&pt(r)?y.createElement("path",Kw({},m,{className:Wt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};h_.registerSymbol=YV;var VP=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,XV=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(y.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var a={};return Object.keys(r).forEach(s=>{s_(s)&&typeof r[s]=="function"&&(a[s]=(i=>r[s](r,i)))}),a},JV=(e,t,r)=>a=>(e(t,r,a),null),Lh=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var a=null;return Object.keys(e).forEach(s=>{var i=e[s];s_(s)&&typeof i=="function"&&(a||(a={}),a[s]=JV(i,t,r))}),a};function vT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function QV(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vT(Object(r),!0).forEach(function(a){ZV(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vT(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ZV(e,t,r){return(t=eG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eG(e){var t=tG(e,"string");return typeof t=="symbol"?t:t+""}function tG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fa(e,t){var r=QV({},e),a=t,s=Object.keys(t),i=s.reduce((l,u)=>(l[u]===void 0&&a[u]!==void 0&&(l[u]=a[u]),l),r);return i}function zg(){return zg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},zg.apply(null,arguments)}function bT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function GP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bT(Object(r),!0).forEach(function(a){rG(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bT(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function rG(e,t,r){return(t=aG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aG(e){var t=nG(e,"string");return typeof t=="symbol"?t:t+""}function nG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zs=32,sG={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function iG(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function oG(e){var{data:t,iconType:r,inactiveColor:a}=e,s=zs/2,i=zs/6,l=zs/3,u=t.inactive?a:t.color,d=r!=null?r:t.type;if(d==="none")return null;if(d==="plainline")return y.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:iG(t.payload),x1:0,y1:s,x2:zs,y2:s,className:"recharts-legend-icon"});if(d==="line")return y.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(s,"h").concat(l,`
A`).concat(i,",").concat(i,",0,1,1,").concat(2*l,",").concat(s,`
H`).concat(zs,"M").concat(2*l,",").concat(s,`
A`).concat(i,",").concat(i,",0,1,1,").concat(l,",").concat(s),className:"recharts-legend-icon"});if(d==="rect")return y.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(zs/8,"h").concat(zs,"v").concat(zs*3/4,"h").concat(-zs,"z"),className:"recharts-legend-icon"});if(y.isValidElement(t.legendIcon)){var f=GP({},t);return delete f.legendIcon,y.cloneElement(t.legendIcon,f)}return y.createElement(h_,{fill:u,cx:s,cy:s,size:zs,sizeType:"diameter",type:d})}function lG(e){var{payload:t,iconSize:r,layout:a,formatter:s,inactiveColor:i,iconType:l,labelStyle:u}=e,d={x:0,y:0,width:zs,height:zs},f={display:a==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,x)=>{var v=m.formatter||s,b=Wt({"recharts-legend-item":!0,["legend-item-".concat(x)]:!0,inactive:m.inactive});if(m.type==="none")return null;var w=typeof u=="object"?GP({},u):{};w.color=m.inactive?i:w.color||m.color;var j=v?v(m.value,m,x):m.value;return y.createElement("li",zg({className:b,style:f,key:"legend-item-".concat(x)},Lh(e,m,x)),y.createElement(i_,{width:r,height:r,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},y.createElement(oG,{data:m,iconType:l,inactiveColor:i})),y.createElement("span",{className:"recharts-legend-item-text",style:w},j))})}var cG=e=>{var t=Fa(e,sG),{payload:r,layout:a,align:s}=t;if(!r||!r.length)return null;var i={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return y.createElement("ul",{className:"recharts-default-legend",style:i},y.createElement(lG,zg({},t,{payload:r})))},zb={},Bb={},wT;function uG(){if(wT)return Bb;wT=1;function e(t,r){const a=new Map;for(let s=0;s<t.length;s++){const i=t[s],l=r(i,s,t);a.has(l)||a.set(l,i)}return Array.from(a.values())}return Bb.uniqBy=e,Bb}var $b={},jT;function dG(){if(jT)return $b;jT=1;function e(t,r){return function(...a){return t.apply(this,a.slice(0,r))}}return $b.ary=e,$b}var Ub={},_T;function KP(){if(_T)return Ub;_T=1;function e(t){return t}return Ub.identity=e,Ub}var Hb={},qb={},kT;function fG(){if(kT)return qb;kT=1;const e=f_();function t(r){return function(a){return e.get(a,r)}}return qb.property=t,qb}var Wb={},Vb={},vf={},Gb={},ST;function YP(){if(ST)return Gb;ST=1;function e(t){return t==null||typeof t!="object"&&typeof t!="function"}return Gb.isPrimitive=e,Gb}var Kb={},NT;function hG(){if(NT)return Kb;NT=1;function e(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}return Kb.isTypedArray=e,Kb}var Yb={},CT;function pG(){if(CT)return Yb;CT=1;function e(t){return Object.getOwnPropertySymbols(t).filter(r=>Object.prototype.propertyIsEnumerable.call(t,r))}return Yb.getSymbols=e,Yb}var Xb={},TT;function p_(){if(TT)return Xb;TT=1;function e(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}return Xb.getTag=e,Xb}var yr={},ET;function XP(){if(ET)return yr;ET=1;const e="[object RegExp]",t="[object String]",r="[object Number]",a="[object Boolean]",s="[object Arguments]",i="[object Symbol]",l="[object Date]",u="[object Map]",d="[object Set]",f="[object Array]",p="[object Function]",m="[object ArrayBuffer]",x="[object Object]",v="[object Error]",b="[object DataView]",w="[object Uint8Array]",j="[object Uint8ClampedArray]",k="[object Uint16Array]",C="[object Uint32Array]",N="[object BigUint64Array]",O="[object Int8Array]",E="[object Int16Array]",A="[object Int32Array]",T="[object BigInt64Array]",P="[object Float32Array]",D="[object Float64Array]";return yr.argumentsTag=s,yr.arrayBufferTag=m,yr.arrayTag=f,yr.bigInt64ArrayTag=T,yr.bigUint64ArrayTag=N,yr.booleanTag=a,yr.dataViewTag=b,yr.dateTag=l,yr.errorTag=v,yr.float32ArrayTag=P,yr.float64ArrayTag=D,yr.functionTag=p,yr.int16ArrayTag=E,yr.int32ArrayTag=A,yr.int8ArrayTag=O,yr.mapTag=u,yr.numberTag=r,yr.objectTag=x,yr.regexpTag=e,yr.setTag=d,yr.stringTag=t,yr.symbolTag=i,yr.uint16ArrayTag=k,yr.uint32ArrayTag=C,yr.uint8ArrayTag=w,yr.uint8ClampedArrayTag=j,yr}var Jb={},Qb={},AT;function mG(){if(AT)return Qb;AT=1;const e=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof lC=="object"&&lC||(function(){return this})()||Function("return this")();return Qb.globalThis_=e,Qb}var OT;function gG(){if(OT)return Jb;OT=1;const e=mG();function t(r){return typeof e.globalThis_.Buffer!="undefined"&&e.globalThis_.Buffer.isBuffer(r)}return Jb.isBuffer=t,Jb}var PT;function JP(){if(PT)return vf;PT=1;const e=YP(),t=hG(),r=pG(),a=p_(),s=XP(),i=gG();function l(p,m){return u(p,void 0,p,new Map,m)}function u(p,m,x,v=new Map,b=void 0){const w=b==null?void 0:b(p,m,x,v);if(w!==void 0)return w;if(e.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const j=new Array(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=u(p[k],k,x,v,b);return Object.hasOwn(p,"index")&&(j.index=p.index),Object.hasOwn(p,"input")&&(j.input=p.input),j}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const j=new RegExp(p.source,p.flags);return j.lastIndex=p.lastIndex,j}if(p instanceof Map){const j=new Map;v.set(p,j);for(const[k,C]of p)j.set(k,u(C,k,x,v,b));return j}if(p instanceof Set){const j=new Set;v.set(p,j);for(const k of p)j.add(u(k,void 0,x,v,b));return j}if(i.isBuffer(p))return p.subarray();if(t.isTypedArray(p)){const j=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=u(p[k],k,x,v,b);return j}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer!="undefined"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const j=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,j),d(j,p,x,v,b),j}if(typeof File!="undefined"&&p instanceof File){const j=new File([p],p.name,{type:p.type});return v.set(p,j),d(j,p,x,v,b),j}if(typeof Blob!="undefined"&&p instanceof Blob){const j=new Blob([p],{type:p.type});return v.set(p,j),d(j,p,x,v,b),j}if(p instanceof Error){const j=structuredClone(p);return v.set(p,j),j.message=p.message,j.name=p.name,j.stack=p.stack,j.cause=p.cause,j.constructor=p.constructor,d(j,p,x,v,b),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,x,v,b),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,x,v,b),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,x,v,b),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,x,v,b),j}return p}function d(p,m,x=p,v,b){const w=[...Object.keys(m),...r.getSymbols(m)];for(let j=0;j<w.length;j++){const k=w[j],C=Object.getOwnPropertyDescriptor(p,k);(C==null||C.writable)&&(p[k]=u(m[k],k,x,v,b))}}function f(p){switch(a.getTag(p)){case s.argumentsTag:case s.arrayTag:case s.arrayBufferTag:case s.dataViewTag:case s.booleanTag:case s.dateTag:case s.float32ArrayTag:case s.float64ArrayTag:case s.int8ArrayTag:case s.int16ArrayTag:case s.int32ArrayTag:case s.mapTag:case s.numberTag:case s.objectTag:case s.regexpTag:case s.setTag:case s.stringTag:case s.symbolTag:case s.uint8ArrayTag:case s.uint8ClampedArrayTag:case s.uint16ArrayTag:case s.uint32ArrayTag:return!0;default:return!1}}return vf.cloneDeepWith=l,vf.cloneDeepWithImpl=u,vf.copyProperties=d,vf}var DT;function xG(){if(DT)return Vb;DT=1;const e=JP();function t(r){return e.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}return Vb.cloneDeep=t,Vb}var Zb={},e2={},t2={},RT;function QP(){if(RT)return t2;RT=1;function e(t,r){return t===r||Number.isNaN(t)&&Number.isNaN(r)}return t2.isEqualsSameValueZero=e,t2}var r2={},FT;function ZP(){if(FT)return r2;FT=1;function e(t){return t!==null&&(typeof t=="object"||typeof t=="function")}return r2.isObject=e,r2}var MT;function yG(){if(MT)return e2;MT=1;const e=YP(),t=QP(),r=ZP();function a(f,p,m){return typeof m!="function"?a(f,p,()=>{}):s(f,p,function x(v,b,w,j,k,C){const N=m(v,b,w,j,k,C);return N!==void 0?!!N:s(v,b,x,C)},new Map)}function s(f,p,m,x){if(p===f)return!0;switch(typeof p){case"object":return i(f,p,m,x);case"function":return Object.keys(p).length>0?s(f,ee({},p),m,x):t.isEqualsSameValueZero(f,p);default:return r.isObject(f)?typeof p=="string"?p==="":!0:t.isEqualsSameValueZero(f,p)}}function i(f,p,m,x){if(p==null)return!0;if(Array.isArray(p))return u(f,p,m,x);if(p instanceof Map)return l(f,p,m,x);if(p instanceof Set)return d(f,p,m,x);const v=Object.keys(p);if(f==null||e.isPrimitive(f))return v.length===0;if(v.length===0)return!0;if(x!=null&&x.has(p))return x.get(p)===f;x==null||x.set(p,f);try{for(let b=0;b<v.length;b++){const w=v[b];if(!e.isPrimitive(f)&&!(w in f)||p[w]===void 0&&f[w]!==void 0||p[w]===null&&f[w]!==null||!m(f[w],p[w],w,f,p,x))return!1}return!0}finally{x==null||x.delete(p)}}function l(f,p,m,x){if(p.size===0)return!0;if(!(f instanceof Map))return!1;for(const[v,b]of p.entries())if(m(f.get(v),b,v,f,p,x)===!1)return!1;return!0}function u(f,p,m,x){if(p.length===0)return!0;if(!Array.isArray(f))return!1;const v=new Set;for(let b=0;b<p.length;b++){const w=p[b];let j=!1;for(let k=0;k<f.length;k++){if(v.has(k))continue;const C=f[k];let N=!1;if(m(C,w,b,f,p,x)&&(N=!0),N){v.add(k),j=!0;break}}if(!j)return!1}return!0}function d(f,p,m,x){return p.size===0?!0:f instanceof Set?u([...f],[...p],m,x):!1}return e2.isMatchWith=a,e2}var LT;function e7(){if(LT)return Zb;LT=1;const e=yG();function t(r,a){return e.isMatchWith(r,a,()=>{})}return Zb.isMatch=t,Zb}var IT;function vG(){if(IT)return Wb;IT=1;const e=xG(),t=e7();function r(a){return a=e.cloneDeep(a),s=>t.isMatch(s,a)}return Wb.matches=r,Wb}var a2={},n2={},s2={},zT;function bG(){if(zT)return s2;zT=1;const e=p_(),t=XP(),r=JP();function a(s,i){return r.cloneDeepWith(s,(l,u,d,f)=>{const p=i==null?void 0:i(l,u,d,f);if(p!==void 0)return p;if(typeof s=="object"){if(e.getTag(s)==="[object Object]"&&typeof s.constructor!="function"){const m={};return f.set(s,m),r.copyProperties(m,s,d,f),m}switch(Object.prototype.toString.call(s)){case t.numberTag:case t.stringTag:case t.booleanTag:{const m=new s.constructor(s==null?void 0:s.valueOf());return r.copyProperties(m,s),m}case t.argumentsTag:{const m={};return r.copyProperties(m,s),m.length=s.length,m[Symbol.iterator]=s[Symbol.iterator],m}default:return}}})}return s2.cloneDeepWith=a,s2}var BT;function wG(){if(BT)return n2;BT=1;const e=bG();function t(r){return e.cloneDeepWith(r)}return n2.cloneDeep=t,n2}var i2={},o2={},$T;function t7(){if($T)return o2;$T=1;const e=/^(?:0|[1-9]\d*)$/;function t(r,a=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<a;case"symbol":return!1;case"string":return e.test(r)}}return o2.isIndex=t,o2}var l2={},UT;function jG(){if(UT)return l2;UT=1;const e=p_();function t(r){return r!==null&&typeof r=="object"&&e.getTag(r)==="[object Arguments]"}return l2.isArguments=t,l2}var HT;function _G(){if(HT)return i2;HT=1;const e=HP(),t=d_(),r=t7(),a=jG();function s(i,l){let u;if(Array.isArray(l)?u=l:typeof l=="string"&&e.isDeepKey(l)&&(i==null?void 0:i[l])==null?u=t.toPath(l):u=[l],u.length===0)return!1;let d=i;for(let f=0;f<u.length;f++){const p=u[f];if((d==null||!Object.hasOwn(d,p))&&!((Array.isArray(d)||a.isArguments(d))&&r.isIndex(p)&&p<d.length))return!1;d=d[p]}return!0}return i2.has=s,i2}var qT;function kG(){if(qT)return a2;qT=1;const e=u_(),t=f_(),r=e7(),a=wG(),s=_G();function i(l,u){switch(typeof l){case"object":Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break;case"number":l=e.toKey(l);break}return u=a.cloneDeep(u),function(d){const f=t.get(d,l);return f===void 0?s.has(d,l):u===void 0?f===void 0:r.isMatch(f,u)}}return a2.matchesProperty=i,a2}var WT;function SG(){if(WT)return Hb;WT=1;const e=KP(),t=fG(),r=vG(),a=kG();function s(i){if(i==null)return e.identity;switch(typeof i){case"function":return i;case"object":return Array.isArray(i)&&i.length===2?a.matchesProperty(i[0],i[1]):r.matches(i);case"string":case"symbol":case"number":return t.property(i)}}return Hb.iteratee=s,Hb}var c2={},u2={},d2={},VT;function NG(){if(VT)return d2;VT=1;function e(t){return Number.isSafeInteger(t)&&t>=0}return d2.isLength=e,d2}var GT;function r7(){if(GT)return u2;GT=1;const e=NG();function t(r){return r!=null&&typeof r!="function"&&e.isLength(r.length)}return u2.isArrayLike=t,u2}var f2={},KT;function CG(){if(KT)return f2;KT=1;function e(t){return typeof t=="object"&&t!==null}return f2.isObjectLike=e,f2}var YT;function TG(){if(YT)return c2;YT=1;const e=r7(),t=CG();function r(a){return t.isObjectLike(a)&&e.isArrayLike(a)}return c2.isArrayLikeObject=r,c2}var XT;function EG(){if(XT)return zb;XT=1;const e=uG(),t=dG(),r=KP(),a=SG(),s=TG();function i(l,u=r.identity){return s.isArrayLikeObject(l)?e.uniqBy(Array.from(l),t.ary(a.iteratee(u),1)):[]}return zb.uniqBy=i,zb}var h2,JT;function AG(){return JT||(JT=1,h2=EG().uniqBy),h2}var OG=AG();const QT=zl(OG);function a7(e,t,r){return t===!0?QT(e,r):typeof t=="function"?QT(e,t):e}var p2={exports:{}},m2={};var ZT;function PG(){if(ZT)return m2;ZT=1;var e=o0(),t=NO();function r(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var a=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return m2.useSyncExternalStoreWithSelector=function(f,p,m,x,v){var b=i(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=u(function(){function k(A){if(!C){if(C=!0,N=A,A=x(A),v!==void 0&&w.hasValue){var T=w.value;if(v(T,A))return O=T}return O=A}if(T=O,a(N,A))return T;var P=x(A);return v!==void 0&&v(T,P)?(N=A,T):(N=A,O=P)}var C=!1,N,O,E=m===void 0?null:m;return[function(){return k(p())},E===null?void 0:function(){return k(E())}]},[p,m,x,v]);var j=s(f,b[0],b[1]);return l(function(){w.hasValue=!0,w.value=j},[j]),d(j),j},m2}var e5;function DG(){return e5||(e5=1,p2.exports=PG()),p2.exports}var RG=DG(),m_=y.createContext(null),FG=e=>e,wr=()=>{var e=y.useContext(m_);return e?e.store.dispatch:FG},vg=()=>{},MG=()=>vg,LG=(e,t)=>e===t;function mt(e){var t=y.useContext(m_),r=y.useMemo(()=>t?a=>{if(a!=null)return e(a)}:vg,[t,e]);return RG.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:MG,t?t.store.getState:vg,t?t.store.getState:vg,r,LG)}function IG(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function zG(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function BG(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${t}[${r}]`)}}var t5=e=>Array.isArray(e)?e:[e];function $G(e){const t=Array.isArray(e[0])?e[0]:e;return BG(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function UG(e,t){const r=[],{length:a}=e;for(let s=0;s<a;s++)r.push(e[s].apply(null,t));return r}var HG=class{constructor(e){this.value=e}deref(){return this.value}},qG=typeof WeakRef!="undefined"?WeakRef:HG,WG=0,r5=1;function Pm(){return{s:WG,v:void 0,o:null,p:null}}function n7(e,t={}){let r=Pm();const{resultEqualityCheck:a}=t;let s,i=0;function l(){var m,x;let u=r;const{length:d}=arguments;for(let v=0,b=d;v<b;v++){const w=arguments[v];if(typeof w=="function"||typeof w=="object"&&w!==null){let j=u.o;j===null&&(u.o=j=new WeakMap);const k=j.get(w);k===void 0?(u=Pm(),j.set(w,u)):u=k}else{let j=u.p;j===null&&(u.p=j=new Map);const k=j.get(w);k===void 0?(u=Pm(),j.set(w,u)):u=k}}const f=u;let p;if(u.s===r5)p=u.v;else if(p=e.apply(null,arguments),i++,a){const v=(x=(m=s==null?void 0:s.deref)==null?void 0:m.call(s))!=null?x:s;v!=null&&a(v,p)&&(p=v,i!==0&&i--),s=typeof p=="object"&&p!==null||typeof p=="function"?new qG(p):p}return f.s=r5,f.v=p,p}return l.clearCache=()=>{r=Pm(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function VG(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,a=(...s)=>{let i=0,l=0,u,d={},f=s.pop();typeof f=="object"&&(d=f,f=s.pop()),IG(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p=ee(ee({},r),d),{memoize:m,memoizeOptions:x=[],argsMemoize:v=n7,argsMemoizeOptions:b=[]}=p,w=t5(x),j=t5(b),k=$G(s),C=m(function(){return i++,f.apply(null,arguments)},...w),N=v(function(){l++;const E=UG(k,arguments);return u=C.apply(null,E),u},...j);return Object.assign(N,{resultFunc:f,memoizedResultFunc:C,dependencies:k,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:m,argsMemoize:v})};return Object.assign(a,{withTypes:()=>a}),a}var Ae=VG(n7),GG=Object.assign((e,t=Ae)=>{zG(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),a=r.map(i=>e[i]);return t(a,(...i)=>i.reduce((l,u,d)=>(l[r[d]]=u,l),{}))},{withTypes:()=>GG}),g2={},x2={},a5;function KG(){if(a5)return x2;a5=1;function e(t,r=1){const a=[],s=Math.floor(r),i=(l,u)=>{for(let d=0;d<l.length;d++){const f=l[d];Array.isArray(f)&&u<s?i(f,u+1):a.push(f)}};return i(t,0),a}return x2.flatten=e,x2}var y2={},n5;function s7(){if(n5)return y2;n5=1;const e=QP(),t=r7(),r=ZP(),a=t7();function s(i,l,u){return r.isObject(u)&&(typeof l=="number"&&t.isArrayLike(u)&&a.isIndex(l)&&l<u.length||typeof l=="string"&&l in u)?e.isEqualsSameValueZero(u[l],i):!1}return y2.isIterateeCall=s,y2}var v2={},b2={},s5;function YG(){if(s5)return b2;s5=1;function e(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const t=(r,a,s)=>{if(r!==a){const i=e(r),l=e(a);if(i===l&&i===0){if(r<a)return s==="desc"?1:-1;if(r>a)return s==="desc"?-1:1}return s==="desc"?l-i:i-l}return 0};return b2.compareValues=t,b2}var w2={},j2={},i5;function i7(){if(i5)return j2;i5=1;function e(t){return typeof t=="symbol"||t instanceof Symbol}return j2.isSymbol=e,j2}var o5;function XG(){if(o5)return w2;o5=1;const e=i7(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(s,i){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||e.isSymbol(s)?!0:typeof s=="string"&&(r.test(s)||!t.test(s))||i!=null&&Object.hasOwn(i,s)}return w2.isKey=a,w2}var l5;function JG(){if(l5)return v2;l5=1;const e=d_(),t=YG(),r=XG();function a(s,i,l,u){if(s==null)return[];l=u?void 0:l,Array.isArray(s)||(s=Object.values(s)),Array.isArray(i)||(i=i==null?[null]:[i]),i.length===0&&(i=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(m=>String(m));const d=(m,x)=>{let v=m;for(let b=0;b<x.length&&v!=null;++b)v=v[x[b]];return v},f=(m,x)=>x==null||m==null?x:typeof m=="object"&&"key"in m?Object.hasOwn(x,m.key)?x[m.key]:d(x,m.path):typeof m=="function"?m(x):Array.isArray(m)?d(x,m):typeof x=="object"?x[m]:x,p=i.map(m=>(Array.isArray(m)&&m.length===1&&(m=m[0]),m==null||typeof m=="function"||Array.isArray(m)||r.isKey(m)?m:{key:m,path:e.toPath(m)}));return s.map(m=>({original:m,criteria:p.map(x=>f(x,m))})).slice().sort((m,x)=>{for(let v=0;v<p.length;v++){const b=t.compareValues(m.criteria[v],x.criteria[v],l[v]);if(b!==0)return b}return 0}).map(m=>m.original)}return v2.orderBy=a,v2}var c5;function QG(){if(c5)return g2;c5=1;const e=KG(),t=s7(),r=JG();function a(s,...i){const l=i.length;return l>1&&t.isIterateeCall(s,i[0],i[1])?i=[]:l>2&&t.isIterateeCall(i[0],i[1],i[2])&&(i=[i[0]]),r.orderBy(s,e.flatten(i),["asc"])}return g2.sortBy=a,g2}var _2,u5;function ZG(){return u5||(u5=1,_2=QG().sortBy),_2}var eK=ZG();const ry=zl(eK);var o7=e=>e.legend.settings,tK=e=>e.legend.size,rK=e=>e.legend.payload,aK=Ae([rK,o7],(e,t)=>{var{itemSorter:r}=t,a=e.flat(1);return r?ry(a,r):a});function nK(){return mt(aK)}var Dm=1;function l7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=y.useState({height:0,left:0,top:0,width:0}),a=y.useCallback(s=>{if(s!=null){var i=s.getBoundingClientRect(),l={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(l.height-t.height)>Dm||Math.abs(l.left-t.left)>Dm||Math.abs(l.top-t.top)>Dm||Math.abs(l.width-t.width)>Dm)&&r({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,a]}function Ha(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var sK=typeof Symbol=="function"&&Symbol.observable||"@@observable",d5=sK,k2=()=>Math.random().toString(36).substring(7).split("").join("."),iK={INIT:`@@redux/INIT${k2()}`,REPLACE:`@@redux/REPLACE${k2()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${k2()}`},Bg=iK;function g_(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function c7(e,t,r){if(typeof e!="function")throw new Error(Ha(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ha(0));if(typeof t=="function"&&typeof r=="undefined"&&(r=t,t=void 0),typeof r!="undefined"){if(typeof r!="function")throw new Error(Ha(1));return r(c7)(e,t)}let a=e,s=t,i=new Map,l=i,u=0,d=!1;function f(){l===i&&(l=new Map,i.forEach((j,k)=>{l.set(k,j)}))}function p(){if(d)throw new Error(Ha(3));return s}function m(j){if(typeof j!="function")throw new Error(Ha(4));if(d)throw new Error(Ha(5));let k=!0;f();const C=u++;return l.set(C,j),function(){if(k){if(d)throw new Error(Ha(6));k=!1,f(),l.delete(C),i=null}}}function x(j){if(!g_(j))throw new Error(Ha(7));if(typeof j.type=="undefined")throw new Error(Ha(8));if(typeof j.type!="string")throw new Error(Ha(17));if(d)throw new Error(Ha(9));try{d=!0,s=a(s,j)}finally{d=!1}return(i=l).forEach(C=>{C()}),j}function v(j){if(typeof j!="function")throw new Error(Ha(10));a=j,x({type:Bg.REPLACE})}function b(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Ha(11));function C(){const O=k;O.next&&O.next(p())}return C(),{unsubscribe:j(C)}},[d5](){return this}}}return x({type:Bg.INIT}),{dispatch:x,subscribe:m,getState:p,replaceReducer:v,[d5]:b}}function oK(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Bg.INIT})=="undefined")throw new Error(Ha(12));if(typeof r(void 0,{type:Bg.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error(Ha(13))})}function u7(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const l=t[i];typeof e[l]=="function"&&(r[l]=e[l])}const a=Object.keys(r);let s;try{oK(r)}catch(i){s=i}return function(l={},u){if(s)throw s;let d=!1;const f={};for(let p=0;p<a.length;p++){const m=a[p],x=r[m],v=l[m],b=x(v,u);if(typeof b=="undefined")throw u&&u.type,new Error(Ha(14));f[m]=b,d=d||b!==v}return d=d||a.length!==Object.keys(l).length,d?f:l}}function $g(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...a)=>t(r(...a)))}function lK(...e){return t=>(r,a)=>{const s=t(r,a);let i=()=>{throw new Error(Ha(15))};const l={getState:s.getState,dispatch:(d,...f)=>i(d,...f)},u=e.map(d=>d(l));return i=$g(...u)(s.dispatch),Se(ee({},s),{dispatch:i})}}function d7(e){return g_(e)&&"type"in e&&typeof e.type=="string"}var f7=Symbol.for("immer-nothing"),f5=Symbol.for("immer-draftable"),Nn=Symbol.for("immer-state");function li(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fs=Object,Kd=fs.getPrototypeOf,Ug="constructor",ay="prototype",Yw="configurable",Hg="enumerable",bg="writable",ch="value",Mo=e=>!!e&&!!e[Nn];function vi(e){var t;return e?h7(e)||sy(e)||!!e[f5]||!!((t=e[Ug])!=null&&t[f5])||iy(e)||oy(e):!1}var cK=fs[ay][Ug].toString(),h5=new WeakMap;function h7(e){if(!e||!x_(e))return!1;const t=Kd(e);if(t===null||t===fs[ay])return!0;const r=fs.hasOwnProperty.call(t,Ug)&&t[Ug];if(r===Object)return!0;if(!Nd(r))return!1;let a=h5.get(r);return a===void 0&&(a=Function.toString.call(r),h5.set(r,a)),a===cK}function ny(e,t,r=!0){Ih(e)===0?(r?Reflect.ownKeys(e):fs.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((a,s)=>t(s,a,e))}function Ih(e){const t=e[Nn];return t?t.type_:sy(e)?1:iy(e)?2:oy(e)?3:0}var p5=(e,t,r=Ih(e))=>r===2?e.has(t):fs[ay].hasOwnProperty.call(e,t),Xw=(e,t,r=Ih(e))=>r===2?e.get(t):e[t],qg=(e,t,r,a=Ih(e))=>{a===2?e.set(t,r):a===3?e.add(r):e[t]=r};function uK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var sy=Array.isArray,iy=e=>e instanceof Map,oy=e=>e instanceof Set,x_=e=>typeof e=="object",Nd=e=>typeof e=="function",S2=e=>typeof e=="boolean";function dK(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var _o=e=>e.copy_||e.base_,y_=e=>e.modified_?e.copy_:e.base_;function Jw(e,t){if(iy(e))return new Map(e);if(oy(e))return new Set(e);if(sy(e))return Array[ay].slice.call(e);const r=h7(e);if(t===!0||t==="class_only"&&!r){const a=fs.getOwnPropertyDescriptors(e);delete a[Nn];let s=Reflect.ownKeys(a);for(let i=0;i<s.length;i++){const l=s[i],u=a[l];u[bg]===!1&&(u[bg]=!0,u[Yw]=!0),(u.get||u.set)&&(a[l]={[Yw]:!0,[bg]:!0,[Hg]:u[Hg],[ch]:e[l]})}return fs.create(Kd(e),a)}else{const a=Kd(e);if(a!==null&&r)return ee({},e);const s=fs.create(a);return fs.assign(s,e)}}function v_(e,t=!1){return ly(e)||Mo(e)||!vi(e)||(Ih(e)>1&&fs.defineProperties(e,{set:Rm,add:Rm,clear:Rm,delete:Rm}),fs.freeze(e),t&&ny(e,(r,a)=>{v_(a,!0)},!1)),e}function fK(){li(2)}var Rm={[ch]:fK};function ly(e){return e===null||!x_(e)?!0:fs.isFrozen(e)}var Wg="MapSet",Qw="Patches",m5="ArrayMethods",p7={};function Zc(e){const t=p7[e];return t||li(0,e),t}var g5=e=>!!p7[e],uh,m7=()=>uh,hK=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:g5(Wg)?Zc(Wg):void 0,arrayMethodsPlugin_:g5(m5)?Zc(m5):void 0});function x5(e,t){t&&(e.patchPlugin_=Zc(Qw),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zw(e){ej(e),e.drafts_.forEach(pK),e.drafts_=null}function ej(e){e===uh&&(uh=e.parent_)}var y5=e=>uh=hK(uh,e);function pK(e){const t=e[Nn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function v5(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Nn].modified_&&(Zw(t),li(4)),vi(e)&&(e=b5(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[Nn].base_,e,t)}else e=b5(t,r);return mK(t,e,!0),Zw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==f7?e:void 0}function b5(e,t){if(ly(t))return t;const r=t[Nn];if(!r)return Vg(t,e.handledSet_,e);if(!cy(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:a}=r;if(a)for(;a.length>0;)a.pop()(e);y7(r,e)}return r.copy_}function mK(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&v_(t,r)}function g7(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var cy=(e,t)=>e.scope_===t,gK=[];function x7(e,t,r,a){var u;const s=_o(e),i=e.type_;if(a!==void 0&&Xw(s,a,i)===t){qg(s,a,r,i);return}if(!e.draftLocations_){const d=e.draftLocations_=new Map;ny(s,(f,p)=>{if(Mo(p)){const m=d.get(p)||[];m.push(f),d.set(p,m)}})}const l=(u=e.draftLocations_.get(t))!=null?u:gK;for(const d of l)qg(s,d,r,i)}function xK(e,t,r){e.callbacks_.push(function(s){var u,d;const i=t;if(!i||!cy(i,s))return;(u=s.mapSetPlugin_)==null||u.fixSetContents(i);const l=y_(i);x7(e,(d=i.draft_)!=null?d:i,l,r),y7(i,s)})}function y7(e,t){var a,s;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||((s=(a=e.assigned_)==null?void 0:a.size)!=null?s:0)>0)){const{patchPlugin_:i}=t;if(i){const l=i.getPath(e);l&&i.generatePatches_(e,l,t)}g7(e)}}function yK(e,t,r){const{scope_:a}=e;if(Mo(r)){const s=r[Nn];cy(s,a)&&s.callbacks_.push(function(){wg(e);const l=y_(s);x7(e,r,l,t)})}else vi(r)&&e.callbacks_.push(function(){var l;const i=_o(e);e.type_===3?i.has(r)&&Vg(r,a.handledSet_,a):Xw(i,t,e.type_)===r&&a.drafts_.length>1&&((l=e.assigned_.get(t))!=null?l:!1)===!0&&e.copy_&&Vg(Xw(e.copy_,t,e.type_),a.handledSet_,a)})}function Vg(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Mo(e)||t.has(e)||!vi(e)||ly(e)||(t.add(e),ny(e,(a,s)=>{if(Mo(s)){const i=s[Nn];if(cy(i,r)){const l=y_(i);qg(e,a,l,e.type_),g7(i)}}else vi(s)&&Vg(s,t,r)})),e}function vK(e,t){const r=sy(e),a={type_:r?1:0,scope_:t?t.scope_:m7(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=a,i=Gg;r&&(s=[a],i=dh);const{revoke:l,proxy:u}=Proxy.revocable(s,i);return a.draft_=u,a.revoke_=l,[u,a]}var Gg={get(e,t){if(t===Nn)return e;let r=e.scope_.arrayMethodsPlugin_;const a=e.type_===1&&typeof t=="string";if(a&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const s=_o(e);if(!p5(s,t,e.type_))return bK(e,s,t);const i=s[t];if(e.finalized_||!vi(i)||a&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&dK(t))return i;if(i===N2(e.base_,t)){wg(e);const l=e.type_===1?+t:t,u=rj(e.scope_,i,e,l);return e.copy_[l]=u}return i},has(e,t){return t in _o(e)},ownKeys(e){return Reflect.ownKeys(_o(e))},set(e,t,r){const a=v7(_o(e),t);if(a!=null&&a.set)return a.set.call(e.draft_,r),!0;if(!e.modified_){const s=N2(_o(e),t),i=s==null?void 0:s[Nn];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(uK(r,s)&&(r!==void 0||p5(e.base_,t,e.type_)))return!0;wg(e),tj(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),yK(e,t,r)),!0},deleteProperty(e,t){return wg(e),N2(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),tj(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=_o(e),a=Reflect.getOwnPropertyDescriptor(r,t);return a&&{[bg]:!0,[Yw]:e.type_!==1||t!=="length",[Hg]:a[Hg],[ch]:r[t]}},defineProperty(){li(11)},getPrototypeOf(e){return Kd(e.base_)},setPrototypeOf(){li(12)}},dh={};for(let e in Gg){let t=Gg[e];dh[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}dh.deleteProperty=function(e,t){return dh.set.call(this,e,t,void 0)};dh.set=function(e,t,r){return Gg.set.call(this,e[0],t,r,e[0])};function N2(e,t){const r=e[Nn];return(r?_o(r):e)[t]}function bK(e,t,r){var s;const a=v7(t,r);return a?ch in a?a[ch]:(s=a.get)==null?void 0:s.call(e.draft_):void 0}function v7(e,t){if(!(t in e))return;let r=Kd(e);for(;r;){const a=Object.getOwnPropertyDescriptor(r,t);if(a)return a;r=Kd(r)}}function tj(e){e.modified_||(e.modified_=!0,e.parent_&&tj(e.parent_))}function wg(e){e.copy_||(e.assigned_=new Map,e.copy_=Jw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var wK=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,a,s)=>{if(Nd(r)&&!Nd(a)){const l=a;a=r;const u=this;return function(f=l,...p){return u.produce(f,m=>a.call(this,m,...p))}}Nd(a)||li(6),s!==void 0&&!Nd(s)&&li(7);let i;if(vi(r)){const l=y5(this),u=rj(l,r,void 0);let d=!0;try{i=a(u),d=!1}finally{d?Zw(l):ej(l)}return x5(l,s),v5(i,l)}else if(!r||!x_(r)){if(i=a(r),i===void 0&&(i=r),i===f7&&(i=void 0),this.autoFreeze_&&v_(i,!0),s){const l=[],u=[];Zc(Qw).generateReplacementPatches_(r,i,{patches_:l,inversePatches_:u}),s(l,u)}return i}else li(1,r)},this.produceWithPatches=(r,a)=>{if(Nd(r))return(u,...d)=>this.produceWithPatches(u,f=>r(f,...d));let s,i;return[this.produce(r,a,(u,d)=>{s=u,i=d}),s,i]},S2(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),S2(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),S2(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){vi(t)||li(8),Mo(t)&&(t=$s(t));const r=y5(this),a=rj(r,t,void 0);return a[Nn].isManual_=!0,ej(r),a}finishDraft(t,r){const a=t&&t[Nn];(!a||!a.isManual_)&&li(9);const{scope_:s}=a;return x5(s,r),v5(void 0,s)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let a;for(a=r.length-1;a>=0;a--){const i=r[a];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}a>-1&&(r=r.slice(a+1));const s=Zc(Qw).applyPatches_;return Mo(t)?s(t,r):this.produce(t,i=>s(i,r))}};function rj(e,t,r,a){var u,d;const[s,i]=iy(t)?Zc(Wg).proxyMap_(t,r):oy(t)?Zc(Wg).proxySet_(t,r):vK(t,r);return((u=r==null?void 0:r.scope_)!=null?u:m7()).drafts_.push(s),i.callbacks_=(d=r==null?void 0:r.callbacks_)!=null?d:[],i.key_=a,r&&a!==void 0?xK(r,i,a):i.callbacks_.push(function(p){var x;(x=p.mapSetPlugin_)==null||x.fixSetContents(i);const{patchPlugin_:m}=p;i.modified_&&m&&m.generatePatches_(i,[],p)}),s}function $s(e){return Mo(e)||li(10,e),b7(e)}function b7(e){if(!vi(e)||ly(e))return e;const t=e[Nn];let r,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Jw(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else r=Jw(e,!0);return ny(r,(s,i)=>{qg(r,s,b7(i))},a),t&&(t.finalized_=!1),r}var jK=new wK,w7=jK.produce;function j7(e){return({dispatch:r,getState:a})=>s=>i=>typeof i=="function"?i(r,a,e):s(i)}var _K=j7(),kK=j7,SK=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?$g:$g.apply(null,arguments)};function ms(e,t){function r(...a){if(t){let s=t(...a);if(!s)throw new Error(hs(0));return ee(ee({type:e,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:e,payload:a[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=a=>d7(a)&&a.type===e,r}var _7=class zf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,zf.prototype)}static get[Symbol.species](){return zf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new zf(...t[0].concat(this)):new zf(...t.concat(this))}};function w5(e){return vi(e)?w7(e,()=>{}):e}function Fm(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function NK(e){return typeof e=="boolean"}var CK=()=>function(t){const{thunk:r=!0,immutableCheck:a=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t!=null?t:{};let l=new _7;return r&&(NK(r)?l.push(_K):l.push(kK(r.extraArgument))),l},k7="RTK_autoBatch",Er=()=>e=>({payload:e,meta:{[k7]:!0}}),j5=e=>t=>{setTimeout(t,e)},TK=(e,t)=>r=>{let a=!1;const s=()=>{a||(a=!0,cancelAnimationFrame(i),clearTimeout(l),r())},i=e(s),l=setTimeout(s,t)},S7=(e={type:"raf"})=>t=>(...r)=>{const a=t(...r);let s=!0,i=!1,l=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window!="undefined"&&window.requestAnimationFrame?TK(window.requestAnimationFrame,100):j5(10):e.type==="callback"?e.queueNotification:j5(e.timeout),f=()=>{l=!1,i&&(i=!1,u.forEach(p=>p()))};return Object.assign({},a,{subscribe(p){const m=()=>s&&p(),x=a.subscribe(m);return u.add(p),()=>{x(),u.delete(p)}},dispatch(p){var m;try{return s=!((m=p==null?void 0:p.meta)!=null&&m[k7]),i=!s,i&&(l||(l=!0,d(f))),a.dispatch(p)}finally{s=!0}}})},EK=e=>function(r){const{autoBatch:a=!0}=r!=null?r:{};let s=new _7(e);return a&&s.push(S7(typeof a=="object"?a:void 0)),s};function AK(e){const t=CK(),{reducer:r=void 0,middleware:a,devTools:s=!0,preloadedState:i=void 0,enhancers:l=void 0}=e||{};let u;if(typeof r=="function")u=r;else if(g_(r))u=u7(r);else throw new Error(hs(1));let d;typeof a=="function"?d=a(t):d=t();let f=$g;s&&(f=SK(ee({trace:!1},typeof s=="object"&&s)));const p=lK(...d),m=EK(p);let x=typeof l=="function"?l(m):m();const v=f(...x);return c7(u,i,v)}function N7(e){const t={},r=[];let a;const s={addCase(i,l){const u=typeof i=="string"?i:i.type;if(!u)throw new Error(hs(28));if(u in t)throw new Error(hs(29));return t[u]=l,s},addAsyncThunk(i,l){return l.pending&&(t[i.pending.type]=l.pending),l.rejected&&(t[i.rejected.type]=l.rejected),l.fulfilled&&(t[i.fulfilled.type]=l.fulfilled),l.settled&&r.push({matcher:i.settled,reducer:l.settled}),s},addMatcher(i,l){return r.push({matcher:i,reducer:l}),s},addDefaultCase(i){return a=i,s}};return e(s),[t,r,a]}function OK(e){return typeof e=="function"}function PK(e,t){let[r,a,s]=N7(t),i;if(OK(e))i=()=>w5(e());else{const u=w5(e);i=()=>u}function l(u=i(),d){let f=[r[d.type],...a.filter(({matcher:p})=>p(d)).map(({reducer:p})=>p)];return f.filter(p=>!!p).length===0&&(f=[s]),f.reduce((p,m)=>{if(m)if(Mo(p)){const v=m(p,d);return v===void 0?p:v}else{if(vi(p))return w7(p,x=>m(x,d));{const x=m(p,d);if(x===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return p},u)}return l.getInitialState=i,l}var DK="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",RK=(e=21)=>{let t="",r=e;for(;r--;)t+=DK[Math.random()*64|0];return t},FK=Symbol.for("rtk-slice-createasyncthunk");function MK(e,t){return`${e}/${t}`}function LK({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[FK];return function(s){const{name:i,reducerPath:l=i}=s;if(!i)throw new Error(hs(11));const u=(typeof s.reducers=="function"?s.reducers(zK()):s.reducers)||{},d=Object.keys(u),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(O,E){const A=typeof O=="string"?O:O.type;if(!A)throw new Error(hs(12));if(A in f.sliceCaseReducersByType)throw new Error(hs(13));return f.sliceCaseReducersByType[A]=E,p},addMatcher(O,E){return f.sliceMatchers.push({matcher:O,reducer:E}),p},exposeAction(O,E){return f.actionCreators[O]=E,p},exposeCaseReducer(O,E){return f.sliceCaseReducersByName[O]=E,p}};d.forEach(O=>{const E=u[O],A={reducerName:O,type:MK(i,O),createNotation:typeof s.reducers=="function"};$K(E)?HK(A,E,p,t):BK(A,E,p)});function m(){const[O={},E=[],A=void 0]=typeof s.extraReducers=="function"?N7(s.extraReducers):[s.extraReducers],T=ee(ee({},O),f.sliceCaseReducersByType);return PK(s.initialState,P=>{for(let D in T)P.addCase(D,T[D]);for(let D of f.sliceMatchers)P.addMatcher(D.matcher,D.reducer);for(let D of E)P.addMatcher(D.matcher,D.reducer);A&&P.addDefaultCase(A)})}const x=O=>O,v=new Map,b=new WeakMap;let w;function j(O,E){return w||(w=m()),w(O,E)}function k(){return w||(w=m()),w.getInitialState()}function C(O,E=!1){function A(P){let D=P[O];return typeof D=="undefined"&&E&&(D=Fm(b,A,k)),D}function T(P=x){const D=Fm(v,E,()=>new WeakMap);return Fm(D,P,()=>{var G;const z={};for(const[V,ne]of Object.entries((G=s.selectors)!=null?G:{}))z[V]=IK(ne,P,()=>Fm(b,P,k),E);return z})}return{reducerPath:O,getSelectors:T,get selectors(){return T(A)},selectSlice:A}}const N=Se(ee({name:i,reducer:j,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:k},C(l)),{injectInto(O,T={}){var P=T,{reducerPath:E}=P,A=ti(P,["reducerPath"]);const D=E!=null?E:l;return O.inject({reducerPath:D,reducer:j},A),ee(ee({},N),C(D,!0))}});return N}}function IK(e,t,r,a){function s(i,...l){let u=t(i);return typeof u=="undefined"&&a&&(u=r()),e(u,...l)}return s.unwrapped=e,s}var pn=LK();function zK(){function e(t,r){return ee({_reducerDefinitionType:"asyncThunk",payloadCreator:t},r)}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function BK({type:e,reducerName:t,createNotation:r},a,s){let i,l;if("reducer"in a){if(r&&!UK(a))throw new Error(hs(17));i=a.reducer,l=a.prepare}else i=a;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,l?ms(e,l):ms(e))}function $K(e){return e._reducerDefinitionType==="asyncThunk"}function UK(e){return e._reducerDefinitionType==="reducerWithPrepare"}function HK({type:e,reducerName:t},r,a,s){if(!s)throw new Error(hs(18));const{payloadCreator:i,fulfilled:l,pending:u,rejected:d,settled:f,options:p}=r,m=s(e,i,p);a.exposeAction(t,m),l&&a.addCase(m.fulfilled,l),u&&a.addCase(m.pending,u),d&&a.addCase(m.rejected,d),f&&a.addMatcher(m.settled,f),a.exposeCaseReducer(t,{fulfilled:l||Mm,pending:u||Mm,rejected:d||Mm,settled:f||Mm})}function Mm(){}var qK="task",C7="listener",T7="completed",b_="cancelled",WK=`task-${b_}`,VK=`task-${T7}`,aj=`${C7}-${b_}`,GK=`${C7}-${T7}`,uy=class{constructor(e){xn(this,"code");xn(this,"name","TaskAbortError");xn(this,"message");this.code=e,this.message=`${qK} ${b_} (reason: ${e})`}},w_=(e,t)=>{if(typeof e!="function")throw new TypeError(hs(32))},Kg=()=>{},E7=(e,t=Kg)=>(e.catch(t),e),A7=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Uc=e=>{if(e.aborted)throw new uy(e.reason)};function O7(e,t){let r=Kg;return new Promise((a,s)=>{const i=()=>s(new uy(e.reason));if(e.aborted){i();return}r=A7(e,i),t.finally(()=>r()).then(a,s)}).finally(()=>{r=Kg})}var KK=(e,t)=>fe(null,null,function*(){try{return yield Promise.resolve(),{status:"ok",value:yield e()}}catch(r){return{status:r instanceof uy?"cancelled":"rejected",error:r}}finally{t==null||t()}}),Yg=e=>t=>E7(O7(e,t).then(r=>(Uc(e),r))),P7=e=>{const t=Yg(e);return r=>t(new Promise(a=>setTimeout(a,r)))},{assign:Bd}=Object,_5={},dy="listenerMiddleware",YK=(e,t)=>{const r=a=>A7(e,()=>a.abort(e.reason));return(a,s)=>{w_(a);const i=new AbortController;r(i);const l=KK(()=>fe(null,null,function*(){Uc(e),Uc(i.signal);const u=yield a({pause:Yg(i.signal),delay:P7(i.signal),signal:i.signal});return Uc(i.signal),u}),()=>i.abort(VK));return s!=null&&s.autoJoin&&t.push(l.catch(Kg)),{result:Yg(e)(l),cancel(){i.abort(WK)}}}},XK=(e,t)=>{const r=(a,s)=>fe(null,null,function*(){Uc(t);let i=()=>{};const u=[new Promise((d,f)=>{let p=e({predicate:a,effect:(m,x)=>{x.unsubscribe(),d([m,x.getState(),x.getOriginalState()])}});i=()=>{p(),f()}})];s!=null&&u.push(new Promise(d=>setTimeout(d,s,null)));try{const d=yield O7(t,Promise.race(u));return Uc(t),d}finally{i()}});return((a,s)=>E7(r(a,s)))},D7=e=>{let{type:t,actionCreator:r,matcher:a,predicate:s,effect:i}=e;if(t)s=ms(t).match;else if(r)t=r.type,s=r.match;else if(a)s=a;else if(!s)throw new Error(hs(21));return w_(i),{predicate:s,type:t,effect:i}},R7=Bd(e=>{const{type:t,predicate:r,effect:a}=D7(e);return{id:RK(),effect:a,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(hs(22))}}},{withTypes:()=>R7}),k5=(e,t)=>{const{type:r,effect:a,predicate:s}=D7(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===s)&&i.effect===a)},nj=e=>{e.pending.forEach(t=>{t.abort(aj)})},JK=(e,t)=>()=>{for(const r of t.keys())nj(r);e.clear()},S5=(e,t,r)=>{try{e(t,r)}catch(a){setTimeout(()=>{throw a},0)}},F7=Bd(ms(`${dy}/add`),{withTypes:()=>F7}),QK=ms(`${dy}/removeAll`),M7=Bd(ms(`${dy}/remove`),{withTypes:()=>M7}),ZK=(...e)=>{console.error(`${dy}/error`,...e)},zh=(e={})=>{const t=new Map,r=new Map,a=v=>{var w;const b=(w=r.get(v))!=null?w:0;r.set(v,b+1)},s=v=>{var w;const b=(w=r.get(v))!=null?w:1;b===1?r.delete(v):r.set(v,b-1)},{extra:i,onError:l=ZK}=e;w_(l);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&nj(v)}),d=(v=>{var w;const b=(w=k5(t,v))!=null?w:R7(v);return u(b)});Bd(d,{withTypes:()=>d});const f=v=>{const b=k5(t,v);return b&&(b.unsubscribe(),v.cancelActive&&nj(b)),!!b};Bd(f,{withTypes:()=>f});const p=(v,b,w,j)=>fe(null,null,function*(){const k=new AbortController,C=XK(d,k.signal),N=[];try{v.pending.add(k),a(v),yield Promise.resolve(v.effect(b,Bd({},w,{getOriginalState:j,condition:(O,E)=>C(O,E).then(Boolean),take:C,delay:P7(k.signal),pause:Yg(k.signal),extra:i,signal:k.signal,fork:YK(k.signal,N),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((O,E,A)=>{O!==k&&(O.abort(aj),A.delete(O))})},cancel:()=>{k.abort(aj),v.pending.delete(k)},throwIfCancelled:()=>{Uc(k.signal)}})))}catch(O){O instanceof uy||S5(l,O,{raisedBy:"effect"})}finally{yield Promise.all(N),k.abort(GK),s(v),v.pending.delete(k)}}),m=JK(t,r);return{middleware:v=>b=>w=>{if(!d7(w))return b(w);if(F7.match(w))return d(w.payload);if(QK.match(w)){m();return}if(M7.match(w))return f(w.payload);let j=v.getState();const k=()=>{if(j===_5)throw new Error(hs(23));return j};let C;try{if(C=b(w),t.size>0){const N=v.getState(),O=Array.from(t.values());for(const E of O){let A=!1;try{A=E.predicate(w,N,j)}catch(T){A=!1,S5(l,T,{raisedBy:"predicate"})}A&&p(E,w,v,k)}}}finally{j=_5}return C},startListening:d,stopListening:f,clearListeners:m}};function hs(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var eY={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},L7=pn({name:"chartLayout",initialState:eY,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,a,s,i;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(a=t.payload.right)!==null&&a!==void 0?a:0,e.margin.bottom=(s=t.payload.bottom)!==null&&s!==void 0?s:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:tY,setLayout:rY,setChartSize:aY,setScale:nY}=L7.actions,sY=L7.reducer;function I7(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function Kt(e){return Number.isFinite(e)}function Gi(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function N5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Od(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N5(Object(r),!0).forEach(function(a){iY(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function iY(e,t,r){return(t=oY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oY(e){var t=lY(e,"string");return typeof t=="symbol"?t:t+""}function lY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kr(e,t,r){return ja(e)||ja(t)?r:Vi(t)?Jc(e,t,r):typeof t=="function"?t(e):r}var cY=(e,t,r)=>{if(t&&r){var{width:a,height:s}=r,{align:i,verticalAlign:l,layout:u}=t;if((u==="vertical"||u==="horizontal"&&l==="middle")&&i!=="center"&&pt(e[i]))return Od(Od({},e),{},{[i]:e[i]+(a||0)});if((u==="horizontal"||u==="vertical"&&i==="center")&&l!=="middle"&&pt(e[l]))return Od(Od({},e),{},{[l]:e[l]+(s||0)})}return e},Bl=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",z7=(e,t,r,a)=>{if(a)return e.map(u=>u.coordinate);var s,i,l=e.map(u=>(u.coordinate===t&&(s=!0),u.coordinate===r&&(i=!0),u.coordinate));return s||l.push(t),i||l.push(r),l},B7=(e,t,r)=>{if(!e)return null;var{duplicateDomain:a,type:s,range:i,scale:l,realScaleType:u,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:x,axisType:v}=e;if(!l)return null;var b=u==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,w=s==="category"&&l.bandwidth?l.bandwidth()/b:0;if(w=v==="angleAxis"&&i&&i.length>=2?Oa(i[0]-i[1])*2*w:w,m||x){var j=(m||x||[]).map((k,C)=>{var N=a?a.indexOf(k):k,O=l.map(N);return Kt(O)?{coordinate:O+w,value:k,offset:w,index:C}:null}).filter(In);return j}return d&&f?f.map((k,C)=>{var N=l.map(k);return Kt(N)?{coordinate:N+w,value:k,index:C,offset:w}:null}).filter(In):l.ticks&&p!=null?l.ticks(p).map((k,C)=>{var N=l.map(k);return Kt(N)?{coordinate:N+w,value:k,index:C,offset:w}:null}).filter(In):l.domain().map((k,C)=>{var N=l.map(k);return Kt(N)?{coordinate:N+w,value:a?a[k]:k,index:C,offset:w}:null}).filter(In)},uY=(e,t)=>{if(!t||t.length!==2||!pt(t[0])||!pt(t[1]))return e;var r=Math.min(t[0],t[1]),a=Math.max(t[0],t[1]),s=[e[0],e[1]];return(!pt(e[0])||e[0]<r)&&(s[0]=r),(!pt(e[1])||e[1]>a)&&(s[1]=a),s[0]>a&&(s[0]=a),s[1]<r&&(s[1]=r),s},dY=e=>{var t,r=e.length;if(!(r<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var s=0;s<a;++s)for(var i=0,l=0,u=0;u<r;++u){var d=e[u],f=d==null?void 0:d[s];if(f!=null){var p=f[1],m=f[0],x=Wi(p)?m:p;x>=0?(f[0]=i,i+=x,f[1]=i):(f[0]=l,l+=x,f[1]=l)}}}},fY=e=>{var t,r=e.length;if(!(r<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var s=0;s<a;++s)for(var i=0,l=0;l<r;++l){var u=e[l],d=u==null?void 0:u[s];if(d!=null){var f=Wi(d[1])?d[0]:d[1];f>=0?(d[0]=i,i+=f,d[1]=i):(d[0]=0,d[1]=0)}}}},hY={sign:dY,expand:AV,none:Xc,silhouette:OV,wiggle:PV,positive:fY},pY=(e,t,r)=>{var a,s=(a=hY[r])!==null&&a!==void 0?a:Xc,i=EV().keys(t).value((u,d)=>Number(kr(u,d,0))).order(Gw).offset(s),l=i(e);return l.forEach((u,d)=>{u.forEach((f,p)=>{var m=kr(e[p],t[d],0);Array.isArray(m)&&m.length===2&&pt(m[0])&&pt(m[1])&&(f[0]=m[0],f[1]=m[1])})}),l};function mY(e){return e==null?void 0:String(e)}var C5=e=>{var{axis:t,ticks:r,offset:a,bandSize:s,entry:i,index:l}=e;if(t.type==="category")return r[l]?r[l].coordinate+a:null;var u=kr(i,t.dataKey,t.scale.domain()[l]);if(ja(u))return null;var d=t.scale.map(u);return pt(d)?d-s/2+a:null},gY=e=>{var{numericAxis:t}=e,r=t.scale.domain();if(t.type==="number"){var a=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return a<=0&&s>=0?0:s<0?s:a}return r[0]},xY=e=>{var t=e.flat(2).filter(pt);return[Math.min(...t),Math.max(...t)]},yY=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],vY=(e,t,r)=>{if(e!=null)return yY(Object.keys(e).reduce((a,s)=>{var i=e[s];if(!i)return a;var{stackedData:l}=i,u=l.reduce((d,f)=>{var p=I7(f,t,r),m=xY(p);return!Kt(m[0])||!Kt(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(u[0],a[0]),Math.max(u[1],a[1])]},[1/0,-1/0]))},T5=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,E5=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Xg=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var a=e.scale.bandwidth();if(!r||a>0)return a}if(e&&t&&t.length>=2){for(var s=ry(t,p=>p.coordinate),i=1/0,l=1,u=s.length;l<u;l++){var d=s[l],f=s[l-1];i=Math.min(((d==null?void 0:d.coordinate)||0)-((f==null?void 0:f.coordinate)||0),i)}return i===1/0?0:i}return r?void 0:0};function A5(e){var{tooltipEntrySettings:t,dataKey:r,payload:a,value:s,name:i}=e;return Od(Od({},t),{},{dataKey:r,payload:a,value:s,name:i})}function fy(e,t){if(e)return String(e);if(typeof t=="string")return t}var bY=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},wY=(e,t)=>t==="centric"?e.angle:e.radius,Uo=e=>e.layout.width,Ho=e=>e.layout.height,jY=e=>e.layout.scale,$7=e=>e.layout.margin,hy=Ae(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),py=Ae(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),U7="data-recharts-item-index",H7="data-recharts-item-id",Bh=60;function O5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Lm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?O5(Object(r),!0).forEach(function(a){_Y(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function _Y(e,t,r){return(t=kY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kY(e){var t=SY(e,"string");return typeof t=="symbol"?t:t+""}function SY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NY=e=>e.brush.height;function CY(e){var t=py(e);return t.reduce((r,a)=>{if(a.orientation==="left"&&!a.mirror&&!a.hide){var s=typeof a.width=="number"?a.width:Bh;return r+s}return r},0)}function TY(e){var t=py(e);return t.reduce((r,a)=>{if(a.orientation==="right"&&!a.mirror&&!a.hide){var s=typeof a.width=="number"?a.width:Bh;return r+s}return r},0)}function EY(e){var t=hy(e);return t.reduce((r,a)=>a.orientation==="top"&&!a.mirror&&!a.hide?r+a.height:r,0)}function AY(e){var t=hy(e);return t.reduce((r,a)=>a.orientation==="bottom"&&!a.mirror&&!a.hide?r+a.height:r,0)}var _a=Ae([Uo,Ho,$7,NY,CY,TY,EY,AY,o7,tK],(e,t,r,a,s,i,l,u,d,f)=>{var p={left:(r.left||0)+s,right:(r.right||0)+i},m={top:(r.top||0)+l,bottom:(r.bottom||0)+u},x=Lm(Lm({},m),p),v=x.bottom;x.bottom+=a,x=cY(x,d,f);var b=e-x.left-x.right,w=t-x.top-x.bottom;return Lm(Lm({brushBottom:v},x),{},{width:Math.max(b,0),height:Math.max(w,0)})}),OY=Ae(_a,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),j_=Ae(Uo,Ho,(e,t)=>({x:0,y:0,width:e,height:t})),PY=y.createContext(null),Wn=()=>y.useContext(PY)!=null,my=e=>e.brush,gy=Ae([my,_a,$7],(e,t,r)=>({height:e.height,x:pt(e.x)?e.x:t.left,y:pt(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:pt(e.width)?e.width:t.width})),C2={},T2={},E2={},P5;function DY(){if(P5)return E2;P5=1;function e(t,r,{signal:a,edges:s}={}){let i,l=null;const u=s!=null&&s.includes("leading"),d=s==null||s.includes("trailing"),f=()=>{l!==null&&(t.apply(i,l),i=void 0,l=null)},p=()=>{d&&f(),b()};let m=null;const x=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,p()},r)},v=()=>{m!==null&&(clearTimeout(m),m=null)},b=()=>{v(),i=void 0,l=null},w=()=>{f()},j=function(...k){if(a!=null&&a.aborted)return;i=this,l=k;const C=m==null;x(),u&&C&&f()};return j.schedule=x,j.cancel=b,j.flush=w,a==null||a.addEventListener("abort",b,{once:!0}),j}return E2.debounce=e,E2}var D5;function RY(){if(D5)return T2;D5=1;const e=DY();function t(r,a=0,s={}){typeof s!="object"&&(s={});const{leading:i=!1,trailing:l=!0,maxWait:u}=s,d=Array(2);i&&(d[0]="leading"),l&&(d[1]="trailing");let f,p=null;const m=e.debounce(function(...b){f=r.apply(this,b),p=null},a,{edges:d}),x=function(...b){return u!=null&&(p===null&&(p=Date.now()),Date.now()-p>=u)?(f=r.apply(this,b),p=Date.now(),m.cancel(),m.schedule(),f):(m.apply(this,b),f)},v=()=>(m.flush(),f);return x.cancel=m.cancel,x.flush=v,x}return T2.debounce=t,T2}var R5;function FY(){if(R5)return C2;R5=1;const e=RY();function t(r,a=0,s={}){const{leading:i=!0,trailing:l=!0}=s;return e.debounce(r,a,{leading:i,maxWait:a,trailing:l})}return C2.throttle=t,C2}var A2,F5;function MY(){return F5||(F5=1,A2=FY().throttle),A2}var LY=MY();const IY=zl(LY);var Jg=function(t,r){for(var a=arguments.length,s=new Array(a>2?a-2:0),i=2;i<a;i++)s[i-2]=arguments[i];if(typeof console!="undefined"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>s[l++]))}},Bi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},q7=(e,t,r)=>{var{width:a=Bi.width,height:s=Bi.height,aspect:i,maxHeight:l}=r,u=Qc(a)?e:Number(a),d=Qc(s)?t:Number(s);return i&&i>0&&(u?d=u/i:d&&(u=d*i),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:u,calculatedHeight:d}},zY={width:0,height:0,overflow:"visible"},BY={width:0,overflowX:"visible"},$Y={height:0,overflowY:"visible"},UY={},HY=e=>{var{width:t,height:r}=e,a=Qc(t),s=Qc(r);return a&&s?zY:a?BY:s?$Y:UY};function qY(e){var{width:t,height:r,aspect:a}=e,s=t,i=r;return s===void 0&&i===void 0?(s=Bi.width,i=Bi.height):s===void 0?s=a&&a>0?void 0:Bi.width:i===void 0&&(i=a&&a>0?void 0:Bi.height),{width:s,height:i}}function sj(){return sj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},sj.apply(null,arguments)}function M5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function L5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?M5(Object(r),!0).forEach(function(a){WY(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function WY(e,t,r){return(t=VY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VY(e){var t=GY(e,"string");return typeof t=="symbol"?t:t+""}function GY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var W7=y.createContext(Bi.initialDimension);function KY(e){return Gi(e.width)&&Gi(e.height)}function V7(e){var{children:t,width:r,height:a}=e,s=y.useMemo(()=>({width:r,height:a}),[r,a]);return KY(s)?y.createElement(W7.Provider,{value:s},t):null}var __=()=>y.useContext(W7),YY=y.forwardRef((e,t)=>{var{aspect:r,initialDimension:a=Bi.initialDimension,width:s,height:i,minWidth:l=Bi.minWidth,minHeight:u,maxHeight:d,children:f,debounce:p=Bi.debounce,id:m,className:x,onResize:v,style:b={}}=e,w=y.useRef(null),j=y.useRef();j.current=v,y.useImperativeHandle(t,()=>w.current);var[k,C]=y.useState({containerWidth:a.width,containerHeight:a.height}),N=y.useCallback((P,D)=>{C(z=>{var G=Math.round(P),V=Math.round(D);return z.containerWidth===G&&z.containerHeight===V?z:{containerWidth:G,containerHeight:V}})},[]);y.useEffect(()=>{if(w.current==null||typeof ResizeObserver=="undefined")return d0;var P=V=>{var ne,ge=V[0];if(ge!=null){var{width:Z,height:U}=ge.contentRect;N(Z,U),(ne=j.current)===null||ne===void 0||ne.call(j,Z,U)}};p>0&&(P=IY(P,p,{trailing:!0,leading:!1}));var D=new ResizeObserver(P),{width:z,height:G}=w.current.getBoundingClientRect();return N(z,G),D.observe(w.current),()=>{D.disconnect()}},[N,p]);var{containerWidth:O,containerHeight:E}=k;Jg(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:A,calculatedHeight:T}=q7(O,E,{width:s,height:i,aspect:r,maxHeight:d});return Jg(A!=null&&A>0||T!=null&&T>0,`The width(%s) and height(%s) of chart should be greater than 0,
please check the style of container, or the props width(%s) and height(%s),
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
height and width.`,A,T,s,i,l,u,r),y.createElement("div",{id:m?"".concat(m):void 0,className:Wt("recharts-responsive-container",x),style:L5(L5({},b),{},{width:s,height:i,minWidth:l,minHeight:u,maxHeight:d}),ref:w},y.createElement("div",{style:HY({width:s,height:i})},y.createElement(V7,{width:A,height:T},f)))}),Im=y.forwardRef((e,t)=>{var r=__();if(Gi(r.width)&&Gi(r.height))return e.children;var{width:a,height:s}=qY({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:l}=q7(void 0,void 0,{width:a,height:s,aspect:e.aspect,maxHeight:e.maxHeight});return pt(i)&&pt(l)?y.createElement(V7,{width:i,height:l},e.children):y.createElement(YY,sj({},e,{width:a,height:s,ref:t}))});function k_(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var xy=()=>{var e,t=Wn(),r=mt(OY),a=mt(gy),s=(e=mt(my))===null||e===void 0?void 0:e.padding;return!t||!a||!s?r:{width:a.width-s.left-s.right,height:a.height-s.top-s.bottom,x:s.left,y:s.top}},XY={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},G7=()=>{var e;return(e=mt(_a))!==null&&e!==void 0?e:XY},S_=()=>mt(Uo),N_=()=>mt(Ho),JY=()=>mt(e=>e.layout.margin),ir=e=>e.layout.layoutType,f0=()=>mt(ir),K7=()=>{var e=f0();if(e==="horizontal"||e==="vertical")return e},Y7=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},QY=()=>{var e=f0();return e!==void 0},$h=e=>{var t=wr(),r=Wn(),{width:a,height:s}=e,i=__(),l=a,u=s;return i&&(l=i.width>0?i.width:a,u=i.height>0?i.height:s),y.useEffect(()=>{!r&&Gi(l)&&Gi(u)&&t(aY({width:l,height:u}))},[t,r,l,u]),null},X7=Symbol.for("immer-nothing"),I5=Symbol.for("immer-draftable"),gs=Symbol.for("immer-state");function ci(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fh=Object.getPrototypeOf;function Yd(e){return!!e&&!!e[gs]}function eu(e){var t;return e?J7(e)||Array.isArray(e)||!!e[I5]||!!((t=e.constructor)!=null&&t[I5])||Uh(e)||vy(e):!1}var ZY=Object.prototype.constructor.toString(),z5=new WeakMap;function J7(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let a=z5.get(r);return a===void 0&&(a=Function.toString.call(r),z5.set(r,a)),a===ZY}function Qg(e,t,r=!0){yy(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((a,s)=>t(s,a,e))}function yy(e){const t=e[gs];return t?t.type_:Array.isArray(e)?1:Uh(e)?2:vy(e)?3:0}function ij(e,t){return yy(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Q7(e,t,r){const a=yy(e);a===2?e.set(t,r):a===3?e.add(r):e[t]=r}function eX(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Uh(e){return e instanceof Map}function vy(e){return e instanceof Set}function Cc(e){return e.copy_||e.base_}function oj(e,t){if(Uh(e))return new Map(e);if(vy(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=J7(e);if(t===!0||t==="class_only"&&!r){const a=Object.getOwnPropertyDescriptors(e);delete a[gs];let s=Reflect.ownKeys(a);for(let i=0;i<s.length;i++){const l=s[i],u=a[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(a[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(fh(e),a)}else{const a=fh(e);if(a!==null&&r)return ee({},e);const s=Object.create(a);return Object.assign(s,e)}}function C_(e,t=!1){return by(e)||Yd(e)||!eu(e)||(yy(e)>1&&Object.defineProperties(e,{set:zm,add:zm,clear:zm,delete:zm}),Object.freeze(e),t&&Object.values(e).forEach(r=>C_(r,!0))),e}function tX(){ci(2)}var zm={value:tX};function by(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var rX={};function tu(e){const t=rX[e];return t||ci(0,e),t}var hh;function Z7(){return hh}function aX(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function B5(e,t){t&&(tu("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lj(e){cj(e),e.drafts_.forEach(nX),e.drafts_=null}function cj(e){e===hh&&(hh=e.parent_)}function $5(e){return hh=aX(hh,e)}function nX(e){const t=e[gs];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function U5(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[gs].modified_&&(lj(t),ci(4)),eu(e)&&(e=Zg(t,e),t.parent_||ex(t,e)),t.patches_&&tu("Patches").generateReplacementPatches_(r[gs].base_,e,t.patches_,t.inversePatches_)):e=Zg(t,r,[]),lj(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==X7?e:void 0}function Zg(e,t,r){if(by(t))return t;const a=e.immer_.shouldUseStrictIteration(),s=t[gs];if(!s)return Qg(t,(i,l)=>H5(e,s,t,i,l,r),a),t;if(s.scope_!==e)return t;if(!s.modified_)return ex(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const i=s.copy_;let l=i,u=!1;s.type_===3&&(l=new Set(i),i.clear(),u=!0),Qg(l,(d,f)=>H5(e,s,i,d,f,r,u),a),ex(e,i,!1),r&&e.patches_&&tu("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function H5(e,t,r,a,s,i,l){if(s==null||typeof s!="object"&&!l)return;const u=by(s);if(!(u&&!l)){if(Yd(s)){const d=i&&t&&t.type_!==3&&!ij(t.assigned_,a)?i.concat(a):void 0,f=Zg(e,s,d);if(Q7(r,a,f),Yd(f))e.canAutoFreeze_=!1;else return}else l&&r.add(s);if(eu(s)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[a]===s&&u)return;Zg(e,s),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&(Uh(r)?r.has(a):Object.prototype.propertyIsEnumerable.call(r,a))&&ex(e,s)}}}function ex(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&C_(t,r)}function sX(e,t){const r=Array.isArray(e),a={type_:r?1:0,scope_:t?t.scope_:Z7(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=a,i=T_;r&&(s=[a],i=ph);const{revoke:l,proxy:u}=Proxy.revocable(s,i);return a.draft_=u,a.revoke_=l,u}var T_={get(e,t){if(t===gs)return e;const r=Cc(e);if(!ij(r,t))return iX(e,r,t);const a=r[t];return e.finalized_||!eu(a)?a:a===O2(e.base_,t)?(P2(e),e.copy_[t]=dj(a,e)):a},has(e,t){return t in Cc(e)},ownKeys(e){return Reflect.ownKeys(Cc(e))},set(e,t,r){const a=eD(Cc(e),t);if(a!=null&&a.set)return a.set.call(e.draft_,r),!0;if(!e.modified_){const s=O2(Cc(e),t),i=s==null?void 0:s[gs];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(eX(r,s)&&(r!==void 0||ij(e.base_,t)))return!0;P2(e),uj(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return O2(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,P2(e),uj(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Cc(e),a=Reflect.getOwnPropertyDescriptor(r,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:r[t]}},defineProperty(){ci(11)},getPrototypeOf(e){return fh(e.base_)},setPrototypeOf(){ci(12)}},ph={};Qg(T_,(e,t)=>{ph[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ph.deleteProperty=function(e,t){return ph.set.call(this,e,t,void 0)};ph.set=function(e,t,r){return T_.set.call(this,e[0],t,r,e[0])};function O2(e,t){const r=e[gs];return(r?Cc(r):e)[t]}function iX(e,t,r){var s;const a=eD(t,r);return a?"value"in a?a.value:(s=a.get)==null?void 0:s.call(e.draft_):void 0}function eD(e,t){if(!(t in e))return;let r=fh(e);for(;r;){const a=Object.getOwnPropertyDescriptor(r,t);if(a)return a;r=fh(r)}}function uj(e){e.modified_||(e.modified_=!0,e.parent_&&uj(e.parent_))}function P2(e){e.copy_||(e.copy_=oj(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oX=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,a)=>{if(typeof t=="function"&&typeof r!="function"){const i=r;r=t;const l=this;return function(d=i,...f){return l.produce(d,p=>r.call(this,p,...f))}}typeof r!="function"&&ci(6),a!==void 0&&typeof a!="function"&&ci(7);let s;if(eu(t)){const i=$5(this),l=dj(t,void 0);let u=!0;try{s=r(l),u=!1}finally{u?lj(i):cj(i)}return B5(i,a),U5(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===X7&&(s=void 0),this.autoFreeze_&&C_(s,!0),a){const i=[],l=[];tu("Patches").generateReplacementPatches_(t,s,i,l),a(i,l)}return s}else ci(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(l,...u)=>this.produceWithPatches(l,d=>t(d,...u));let a,s;return[this.produce(t,r,(l,u)=>{a=l,s=u}),a,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){eu(e)||ci(8),Yd(e)&&(e=lX(e));const t=$5(this),r=dj(e,void 0);return r[gs].isManual_=!0,cj(t),r}finishDraft(e,t){const r=e&&e[gs];(!r||!r.isManual_)&&ci(9);const{scope_:a}=r;return B5(a,t),U5(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));const a=tu("Patches").applyPatches_;return Yd(e)?a(e,t):this.produce(e,s=>a(s,t))}};function dj(e,t){const r=Uh(e)?tu("MapSet").proxyMap_(e,t):vy(e)?tu("MapSet").proxySet_(e,t):sX(e,t);return(t?t.scope_:Z7()).drafts_.push(r),r}function lX(e){return Yd(e)||ci(10,e),tD(e)}function tD(e){if(!eu(e)||by(e))return e;const t=e[gs];let r,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=oj(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else r=oj(e,!0);return Qg(r,(s,i)=>{Q7(r,s,tD(i))},a),t&&(t.finalized_=!1),r}var cX=new oX;cX.produce;var uX={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},rD=pn({name:"legend",initialState:uX,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:Er()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:a}=t.payload,s=$s(e).payload.indexOf(r);s>-1&&(e.payload[s]=a)},prepare:Er()},removeLegendPayload:{reducer(e,t){var r=$s(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:Er()}}}),{setLegendSize:q5,setLegendSettings:dX,addLegendPayload:aD,replaceLegendPayload:nD,removeLegendPayload:sD}=rD.actions,fX=rD.reducer,D2={exports:{}},R2={};var W5;function hX(){if(W5)return R2;W5=1;var e=o0();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:t,a=e.useSyncExternalStore,s=e.useRef,i=e.useEffect,l=e.useMemo,u=e.useDebugValue;return R2.useSyncExternalStoreWithSelector=function(d,f,p,m,x){var v=s(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=l(function(){function j(E){if(!k){if(k=!0,C=E,E=m(E),x!==void 0&&b.hasValue){var A=b.value;if(x(A,E))return N=A}return N=E}if(A=N,r(C,E))return A;var T=m(E);return x!==void 0&&x(A,T)?(C=E,A):(C=E,N=T)}var k=!1,C,N,O=p===void 0?null:p;return[function(){return j(f())},O===null?void 0:function(){return j(O())}]},[f,p,m,x]);var w=a(d,v[0],v[1]);return i(function(){b.hasValue=!0,b.value=w},[w]),u(w),w},R2}var V5;function pX(){return V5||(V5=1,D2.exports=hX()),D2.exports}pX();function mX(e){e()}function gX(){let e=null,t=null;return{clear(){e=null,t=null},notify(){mX(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let a=e;for(;a;)r.push(a),a=a.next;return r},subscribe(r){let a=!0;const s=t={callback:r,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!a||e===null||(a=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var G5={notify(){},get:()=>[]};function xX(e,t){let r,a=G5,s=0,i=!1;function l(w){p();const j=a.subscribe(w);let k=!1;return()=>{k||(k=!0,j(),m())}}function u(){a.notify()}function d(){b.onStateChange&&b.onStateChange()}function f(){return i}function p(){s++,r||(r=e.subscribe(d),a=gX())}function m(){s--,r&&s===0&&(r(),r=void 0,a.clear(),a=G5)}function x(){i||(i=!0,p())}function v(){i&&(i=!1,m())}const b={addNestedSub:l,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:x,tryUnsubscribe:v,getListeners:()=>a};return b}var yX=()=>typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",vX=yX(),bX=()=>typeof navigator!="undefined"&&navigator.product==="ReactNative",wX=bX(),jX=()=>vX||wX?y.useLayoutEffect:y.useEffect,_X=jX();function K5(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function kX(e,t){if(K5(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(t,r[s])||!K5(e[r[s]],t[r[s]]))return!1;return!0}var F2=Symbol.for("react-redux-context"),M2=typeof globalThis!="undefined"?globalThis:{};function SX(){var r;if(!y.createContext)return{};const e=(r=M2[F2])!=null?r:M2[F2]=new Map;let t=e.get(y.createContext);return t||(t=y.createContext(null),e.set(y.createContext,t)),t}var NX=SX();function CX(e){const{children:t,context:r,serverState:a,store:s}=e,i=y.useMemo(()=>{const d=xX(s);return{store:s,subscription:d,getServerState:a?()=>a:void 0}},[s,a]),l=y.useMemo(()=>s.getState(),[s]);_X(()=>{const{subscription:d}=i;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),l!==s.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[i,l]);const u=r||NX;return y.createElement(u.Provider,{value:i},t)}var TX=CX,EX=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function AX(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Hh(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var a of r)if(EX.has(a)){if(e[a]==null&&t[a]==null)continue;if(!kX(e[a],t[a]))return!1}else if(!AX(e[a],t[a]))return!1;return!0}var OX=["contextPayload"];function fj(){return fj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},fj.apply(null,arguments)}function Y5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Xd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Y5(Object(r),!0).forEach(function(a){PX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function PX(e,t,r){return(t=DX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DX(e){var t=RX(e,"string");return typeof t=="symbol"?t:t+""}function RX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FX(e,t){if(e==null)return{};var r,a,s=MX(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function MX(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function LX(e){return e.value}function IX(e){var{contextPayload:t}=e,r=FX(e,OX),a=a7(t,e.payloadUniqBy,LX),s=Xd(Xd({},r),{},{payload:a});return y.isValidElement(e.content)?y.cloneElement(e.content,s):typeof e.content=="function"?y.createElement(e.content,s):y.createElement(cG,s)}function zX(e,t,r,a,s,i){var{layout:l,align:u,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(u==="center"&&l==="vertical"?f={left:((a||0)-i.width)/2}:f=u==="right"?{right:r&&r.right||0}:{left:r&&r.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(d==="middle"?p={top:((s||0)-i.height)/2}:p=d==="bottom"?{bottom:r&&r.bottom||0}:{top:r&&r.top||0}),Xd(Xd({},f),p)}function BX(e){var t=wr();return y.useEffect(()=>{t(dX(e))},[t,e]),null}function $X(e){var t=wr();return y.useEffect(()=>(t(q5(e)),()=>{t(q5({width:0,height:0}))}),[t,e]),null}function UX(e,t,r,a){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:r||a}:null}var HX={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function qX(e){var t=Fa(e,HX),r=nK(),a=ZW(),s=JY(),{width:i,height:l,wrapperStyle:u,portal:d}=t,[f,p]=l7([r]),m=S_(),x=N_();if(m==null||x==null)return null;var v=m-((s==null?void 0:s.left)||0)-((s==null?void 0:s.right)||0),b=UX(t.layout,l,i,v),w=d?u:Xd(Xd({position:"absolute",width:(b==null?void 0:b.width)||i||"auto",height:(b==null?void 0:b.height)||l||"auto"},zX(u,t,s,m,x,f)),u),j=d!=null?d:a;if(j==null||r==null)return null;var k=y.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:p},y.createElement(BX,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&y.createElement($X,{width:f.width,height:f.height}),y.createElement(IX,fj({},t,b,{margin:s,chartWidth:m,chartHeight:x,contextPayload:r})));return Kx.createPortal(k,j)}var hj=y.memo(qX,Hh);hj.displayName="Legend";function pj(){return pj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},pj.apply(null,arguments)}function X5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function bf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X5(Object(r),!0).forEach(function(a){WX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function WX(e,t,r){return(t=VX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VX(e){var t=GX(e,"string");return typeof t=="symbol"?t:t+""}function GX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KX(e){return Array.isArray(e)&&Vi(e[0])&&Vi(e[1])?e.join(" ~ "):e}var ud={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function YX(e,t){return t==null?e:ry(e,t)}var XX=e=>{var{separator:t=ud.separator,contentStyle:r,itemStyle:a,labelStyle:s=ud.labelStyle,payload:i,formatter:l,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:x=ud.accessibilityLayer}=e,v=()=>{if(i&&i.length){var E={padding:0,margin:0},A=YX(i,u),T=A.map((P,D)=>{if(!P||P.type==="none")return null;var z=P.formatter||l||KX,{value:G,name:V}=P,ne=G,ge=V;if(z){var Z=z(G,V,P,D,i);if(Array.isArray(Z))[ne,ge]=Z;else if(Z!=null)ne=Z;else return null}var U=bf(bf({},ud.itemStyle),{},{color:P.color||ud.itemStyle.color},a);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:U},Vi(ge)?y.createElement("span",{className:"recharts-tooltip-item-name"},ge):null,Vi(ge)?y.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,y.createElement("span",{className:"recharts-tooltip-item-value"},ne),y.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:E},T)}return null},b=bf(bf({},ud.contentStyle),r),w=bf({margin:0},s),j=!ja(p),k=j?p:"",C=Wt("recharts-default-tooltip",d),N=Wt("recharts-tooltip-label",f);j&&m&&i!==void 0&&i!==null&&(k=m(p,i));var O=x?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",pj({className:C,style:b},O),y.createElement("p",{className:N,style:w},y.isValidElement(k)?k:"".concat(k)),v())},wf="recharts-tooltip-wrapper",JX={visibility:"hidden"};function QX(e){var{coordinate:t,translateX:r,translateY:a}=e;return Wt(wf,{["".concat(wf,"-right")]:pt(r)&&t&&pt(t.x)&&r>=t.x,["".concat(wf,"-left")]:pt(r)&&t&&pt(t.x)&&r<t.x,["".concat(wf,"-bottom")]:pt(a)&&t&&pt(t.y)&&a>=t.y,["".concat(wf,"-top")]:pt(a)&&t&&pt(t.y)&&a<t.y})}function J5(e){var{allowEscapeViewBox:t,coordinate:r,key:a,offset:s,position:i,reverseDirection:l,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(i&&pt(i[a]))return i[a];var p=r[a]-u-(s>0?s:0),m=r[a]+s;if(t[a])return l[a]?p:m;var x=d[a];if(x==null)return 0;if(l[a]){var v=p,b=x;return v<b?Math.max(m,x):Math.max(p,x)}if(f==null)return 0;var w=m+u,j=x+f;return w>j?Math.max(p,x):Math.max(m,x)}function ZX(e){var{translateX:t,translateY:r,useTranslate3d:a}=e;return{transform:a?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function eJ(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:a,offsetLeft:s,position:i,reverseDirection:l,tooltipBox:u,useTranslate3d:d,viewBox:f}=e,p,m,x;return u.height>0&&u.width>0&&r?(m=J5({allowEscapeViewBox:t,coordinate:r,key:"x",offset:s,position:i,reverseDirection:l,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),x=J5({allowEscapeViewBox:t,coordinate:r,key:"y",offset:a,position:i,reverseDirection:l,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=ZX({translateX:m,translateY:x,useTranslate3d:d})):p=JX,{cssProperties:p,cssClasses:QX({translateX:m,translateY:x,coordinate:r})}}var tJ=()=>!(typeof window!="undefined"&&window.document&&window.document.createElement&&window.setTimeout),qh={isSsr:tJ()};function iD(){var[e,t]=y.useState(()=>qh.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return y.useEffect(()=>{if(window.matchMedia){var r=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{t(r.matches)};return r.addEventListener("change",a),()=>{r.removeEventListener("change",a)}}},[]),e}function Q5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function dd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Q5(Object(r),!0).forEach(function(a){rJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function rJ(e,t,r){return(t=aJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aJ(e){var t=nJ(e,"string");return typeof t=="symbol"?t:t+""}function nJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sJ(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function iJ(e){var t,r,a,s,i,l,u=iD(),[d,f]=y.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));y.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var j,k,C,N;f({dismissed:!0,dismissedAtCoordinate:{x:(j=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&j!==void 0?j:0,y:(C=(N=e.coordinate)===null||N===void 0?void 0:N.y)!==null&&C!==void 0?C:0}})}};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),d.dismissed&&(((a=(s=e.coordinate)===null||s===void 0?void 0:s.x)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.x||((i=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&i!==void 0?i:0)!==d.dismissedAtCoordinate.y)&&f(dd(dd({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=eJ({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),x=e.hasPortalFromProps?{}:dd(dd({transition:sJ({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=dd(dd({},x),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return y.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var oJ=y.memo(iJ),oD=()=>{var e;return(e=mt(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function mj(){return mj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},mj.apply(null,arguments)}function Z5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function e6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z5(Object(r),!0).forEach(function(a){lJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function lJ(e,t,r){return(t=cJ(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 typeof t=="symbol"?t:t+""}function uJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var t6={curveBasisClosed:yV,curveBasisOpen:vV,curveBasis:xV,curveBumpX:aV,curveBumpY:nV,curveLinearClosed:bV,curveLinear:ey,curveMonotoneX:wV,curveMonotoneY:jV,curveNatural:_V,curveStep:kV,curveStepAfter:NV,curveStepBefore:SV},tx=e=>Kt(e.x)&&Kt(e.y),r6=e=>e.base!=null&&tx(e.base)&&tx(e),jf=e=>e.x,_f=e=>e.y,dJ=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Mh(e));if((r==="curveMonotone"||r==="curveBump")&&t){var a=t6["".concat(r).concat(t==="vertical"?"Y":"X")];if(a)return a}return t6[r]||ey},a6={connectNulls:!1,type:"linear"},fJ=e=>{var{type:t=a6.type,points:r=[],baseLine:a,layout:s,connectNulls:i=a6.connectNulls}=e,l=dJ(t,s),u=i?r.filter(tx):r;if(Array.isArray(a)){var d,f=r.map((b,w)=>e6(e6({},b),{},{base:a[w]}));s==="vertical"?d=Om().y(_f).x1(jf).x0(b=>b.base.x):d=Om().x(jf).y1(_f).y0(b=>b.base.y);var p=d.defined(r6).curve(l),m=i?f.filter(r6):f;return p(m)}var x;s==="vertical"&&pt(a)?x=Om().y(_f).x1(jf).x0(a):pt(a)?x=Om().x(jf).y1(_f).y0(a):x=PP().x(jf).y(_f);var v=x.defined(tx).curve(l);return v(u)},E_=e=>{var{className:t,points:r,path:a,pathRef:s}=e,i=f0();if((!r||!r.length)&&!a)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},u=r&&r.length?fJ(l):a;return y.createElement("path",mj({},yi(e),XV(e),{className:Wt("recharts-curve",t),d:u===null?void 0:u,ref:s}))},hJ=["x","y","top","left","width","height","className"];function gj(){return gj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},gj.apply(null,arguments)}function n6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function pJ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?n6(Object(r),!0).forEach(function(a){mJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function mJ(e,t,r){return(t=gJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gJ(e){var t=xJ(e,"string");return typeof t=="symbol"?t:t+""}function xJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yJ(e,t){if(e==null)return{};var r,a,s=vJ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function vJ(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var bJ=(e,t,r,a,s,i)=>"M".concat(e,",").concat(s,"v").concat(a,"M").concat(i,",").concat(t,"h").concat(r),wJ=e=>{var{x:t=0,y:r=0,top:a=0,left:s=0,width:i=0,height:l=0,className:u}=e,d=yJ(e,hJ),f=pJ({x:t,y:r,top:a,left:s,width:i,height:l},d);return!pt(t)||!pt(r)||!pt(i)||!pt(l)||!pt(a)||!pt(s)?null:y.createElement("path",gj({},Gs(f),{className:Wt("recharts-cross",u),d:bJ(t,r,i,l,a,s)}))};function jJ(e,t,r,a){var s=a/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-s,width:e==="horizontal"?a:r.width-1,height:e==="horizontal"?r.height-1:a}}function s6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function i6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s6(Object(r),!0).forEach(function(a){_J(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function _J(e,t,r){return(t=kJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kJ(e){var t=SJ(e,"string");return typeof t=="symbol"?t:t+""}function SJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NJ=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),lD=(e,t,r)=>e.map(a=>"".concat(NJ(a)," ").concat(t,"ms ").concat(r)).join(","),CJ=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,a)=>r.filter(s=>a.includes(s))),mh=(e,t)=>Object.keys(t).reduce((r,a)=>i6(i6({},r),{},{[a]:e(a,t[a])}),{});function o6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function wa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?o6(Object(r),!0).forEach(function(a){TJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function TJ(e,t,r){return(t=EJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EJ(e){var t=AJ(e,"string");return typeof t=="symbol"?t:t+""}function AJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rx=(e,t,r)=>e+(t-e)*r,xj=e=>{var{from:t,to:r}=e;return t!==r},cD=(e,t,r)=>{var a=mh((s,i)=>{if(xj(i)){var[l,u]=e(i.from,i.to,i.velocity);return wa(wa({},i),{},{from:l,velocity:u})}return i},t);return r<1?mh((s,i)=>xj(i)&&a[s]!=null?wa(wa({},i),{},{velocity:rx(i.velocity,a[s].velocity,r),from:rx(i.from,a[s].from,r)}):i,t):cD(e,a,r-1)};function OJ(e,t,r,a,s,i){var l,u=a.reduce((x,v)=>wa(wa({},x),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>mh((x,v)=>v.from,u),f=()=>!Object.values(u).filter(xj).length,p=null,m=x=>{l||(l=x);var v=x-l,b=v/r.dt;u=cD(r,u,b),s(wa(wa(wa({},e),t),d())),l=x,f()||(p=i.setTimeout(m))};return()=>(p=i.setTimeout(m),()=>{var x;(x=p)===null||x===void 0||x()})}function PJ(e,t,r,a,s,i,l){var u=null,d=s.reduce((m,x)=>{var v=e[x],b=t[x];return v==null||b==null?m:wa(wa({},m),{},{[x]:[v,b]})},{}),f,p=m=>{f||(f=m);var x=(m-f)/a,v=mh((w,j)=>rx(...j,r(x)),d);if(i(wa(wa(wa({},e),t),v)),x<1)u=l.setTimeout(p);else{var b=mh((w,j)=>rx(...j,r(1)),d);i(wa(wa(wa({},e),t),b))}};return()=>(u=l.setTimeout(p),()=>{var m;(m=u)===null||m===void 0||m()})}const DJ=(e,t,r,a,s,i)=>{var l=CJ(e,t);return r==null?()=>(s(wa(wa({},e),t)),()=>{}):r.isStepper===!0?OJ(e,t,r,l,s,i):PJ(e,t,r,a,l,s,i)};var ax=1e-4,uD=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],dD=(e,t)=>e.map((r,a)=>r*fc(t,a)).reduce((r,a)=>r+a),l6=(e,t)=>r=>{var a=uD(e,t);return dD(a,r)},RJ=(e,t)=>r=>{var a=uD(e,t),s=[...a.map((i,l)=>i*l).slice(1),0];return dD(s,r)},FJ=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var a=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(a==null||a.length!==4)return null;var s=a.map(i=>parseFloat(i));return[s[0],s[1],s[2],s[3]]},MJ=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];if(r.length===1)switch(r[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var s=FJ(r[0]);if(s)return s}}return r.length===4?r:[0,0,1,1]},LJ=(e,t,r,a)=>{var s=l6(e,r),i=l6(t,a),l=RJ(e,r),u=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,x=0;x<8;++x){var v=s(m)-p,b=l(m);if(Math.abs(v-p)<ax||b<ax)return i(m);m=u(m-v/b)}return i(m)};return d.isStepper=!1,d},c6=function(){return LJ(...MJ(...arguments))},IJ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:a=8,dt:s=17}=t,i=(l,u,d)=>{var f=-(l-u)*r,p=d*a,m=d+(f-p)*s/1e3,x=d*s/1e3+l;return Math.abs(x-u)<ax&&Math.abs(m)<ax?[u,0]:[x,m]};return i.isStepper=!0,i.dt=s,i},zJ=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return c6(e);case"spring":return IJ();default:if(e.split("(")[0]==="cubic-bezier")return c6(e)}return typeof e=="function"?e:null};function BJ(e){var t,r=()=>null,a=!1,s=null,i=l=>{if(!a){if(Array.isArray(l)){if(!l.length)return;var u=l,[d,...f]=u;if(typeof d=="number"){s=e.setTimeout(i.bind(null,f),d);return}i(d),s=e.setTimeout(i.bind(null,f));return}typeof l=="string"&&(t=l,r(t)),typeof l=="object"&&(t=l,r(t)),typeof l=="function"&&l()}};return{stop:()=>{a=!0},start:l=>{a=!1,s&&(s(),s=null),i(l)},subscribe:l=>(r=l,()=>{r=()=>null}),getTimeoutController:()=>e}}class $J{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=performance.now(),s=null,i=l=>{l-a>=r?t(l):typeof requestAnimationFrame=="function"&&(s=requestAnimationFrame(i))};return s=requestAnimationFrame(i),()=>{s!=null&&cancelAnimationFrame(s)}}}function UJ(){return BJ(new $J)}var HJ=y.createContext(UJ);function qJ(e,t){var r=y.useContext(HJ);return y.useMemo(()=>t!=null?t:r(e),[e,t,r])}var WJ={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},u6={t:0},L2={t:1};function wy(e){var t=Fa(e,WJ),{isActive:r,canBegin:a,duration:s,easing:i,begin:l,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=iD(),m=r==="auto"?!qh.isSsr&&!p:r,x=qJ(t.animationId,t.animationManager),[v,b]=y.useState(m?u6:L2),w=y.useRef(null);return y.useEffect(()=>{m||b(L2)},[m]),y.useEffect(()=>{if(!m||!a)return d0;var j=DJ(u6,L2,zJ(i),s,b,x.getTimeoutController()),k=()=>{w.current=j()};return x.start([d,l,k,s,u]),()=>{x.stop(),w.current&&w.current(),u()}},[m,a,s,i,l,d,u,x]),f(v.t)}function jy(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=y.useRef(lh(t)),a=y.useRef(e);return a.current!==e&&(r.current=lh(t),a.current=e),r.current}var VJ=["radius"],GJ=["radius"],d6,f6,h6,p6,m6,g6,x6,y6,v6,b6;function w6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function j6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w6(Object(r),!0).forEach(function(a){KJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function KJ(e,t,r){return(t=YJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YJ(e){var t=XJ(e,"string");return typeof t=="symbol"?t:t+""}function XJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nx(){return nx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},nx.apply(null,arguments)}function _6(e,t){if(e==null)return{};var r,a,s=JJ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function JJ(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Pi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var k6=(e,t,r,a,s)=>{var i=Tl(r),l=Tl(a),u=Math.min(Math.abs(i)/2,Math.abs(l)/2),d=l>=0?1:-1,f=i>=0?1:-1,p=l>=0&&i>=0||l<0&&i<0?1:0,m;if(u>0&&Array.isArray(s)){for(var x=[0,0,0,0],v=0,b=4;v<b;v++){var w,j=(w=s[v])!==null&&w!==void 0?w:0;x[v]=j>u?u:j}m=Wr(d6||(d6=Pi(["M",",",""])),e,t+d*x[0]),x[0]>0&&(m+=Wr(f6||(f6=Pi(["A ",",",",0,0,",",",",",""])),x[0],x[0],p,e+f*x[0],t)),m+=Wr(h6||(h6=Pi(["L ",",",""])),e+r-f*x[1],t),x[1]>0&&(m+=Wr(p6||(p6=Pi(["A ",",",",0,0,",`,
`,",",""])),x[1],x[1],p,e+r,t+d*x[1])),m+=Wr(m6||(m6=Pi(["L ",",",""])),e+r,t+a-d*x[2]),x[2]>0&&(m+=Wr(g6||(g6=Pi(["A ",",",",0,0,",`,
`,",",""])),x[2],x[2],p,e+r-f*x[2],t+a)),m+=Wr(x6||(x6=Pi(["L ",",",""])),e+f*x[3],t+a),x[3]>0&&(m+=Wr(y6||(y6=Pi(["A ",",",",0,0,",`,
`,",",""])),x[3],x[3],p,e,t+a-d*x[3])),m+="Z"}else if(u>0&&s===+s&&s>0){var k=Math.min(u,s);m=Wr(v6||(v6=Pi(["M ",",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",",",`
L `,",",`
A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,p,e+f*k,t,e+r-f*k,t,k,k,p,e+r,t+d*k,e+r,t+a-d*k,k,k,p,e+r-f*k,t+a,e+f*k,t+a,k,k,p,e,t+a-d*k)}else m=Wr(b6||(b6=Pi(["M ",","," h "," v "," h "," Z"])),e,t,r,a,-r);return m},S6={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},fD=e=>{var t=Fa(e,S6),r=y.useRef(null),[a,s]=y.useState(-1);y.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var ce=r.current.getTotalLength();ce&&s(ce)}catch(xe){}},[]);var{x:i,y:l,width:u,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:x,animationBegin:v,isAnimationActive:b,isUpdateAnimationActive:w}=t,j=y.useRef(u),k=y.useRef(d),C=y.useRef(i),N=y.useRef(l),O=y.useMemo(()=>({x:i,y:l,width:u,height:d,radius:f}),[i,l,u,d,f]),E=jy(O,"rectangle-");if(i!==+i||l!==+l||u!==+u||d!==+d||u===0||d===0)return null;var A=Wt("recharts-rectangle",p);if(!w){var T=Gs(t),{radius:P}=T,D=_6(T,VJ);return y.createElement("path",nx({},D,{x:Tl(i),y:Tl(l),width:Tl(u),height:Tl(d),radius:typeof f=="number"?f:void 0,className:A,d:k6(i,l,u,d,f)}))}var z=j.current,G=k.current,V=C.current,ne=N.current,ge="0px ".concat(a===-1?1:a,"px"),Z="".concat(a,"px ").concat(a,"px"),U=lD(["strokeDasharray"],x,typeof m=="string"?m:S6.animationEasing);return y.createElement(wy,{animationId:E,key:E,canBegin:a>0,duration:x,easing:m,isActive:w,begin:v},ce=>{var xe=ba(z,u,ce),be=ba(G,d,ce),me=ba(V,i,ce),oe=ba(ne,l,ce);r.current&&(j.current=xe,k.current=be,C.current=me,N.current=oe);var L;b?ce>0?L={transition:U,strokeDasharray:Z}:L={strokeDasharray:ge}:L={strokeDasharray:Z};var H=Gs(t),{radius:K}=H,Y=_6(H,GJ);return y.createElement("path",nx({},Y,{radius:typeof f=="number"?f:void 0,className:A,d:k6(me,oe,xe,be,f),ref:r,style:j6(j6({},L),t.style)}))})};function N6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function C6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N6(Object(r),!0).forEach(function(a){QJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function QJ(e,t,r){return(t=ZJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZJ(e){var t=eQ(e,"string");return typeof t=="symbol"?t:t+""}function eQ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sx=Math.PI/180,tQ=e=>e*180/Math.PI,la=(e,t,r,a)=>({x:e+Math.cos(-sx*a)*r,y:t+Math.sin(-sx*a)*r}),hD=function(t,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(a.left||0)-(a.right||0)),Math.abs(r-(a.top||0)-(a.bottom||0)))/2},rQ=(e,t)=>{var{x:r,y:a}=e,{x:s,y:i}=t;return Math.sqrt(fc(r-s,2)+fc(a-i,2))},aQ=(e,t)=>{var{x:r,y:a}=e,{cx:s,cy:i}=t,l=rQ({x:r,y:a},{x:s,y:i});if(l<=0)return{radius:l,angle:0};var u=(r-s)/l,d=Math.acos(u);return a>i&&(d=2*Math.PI-d),{radius:l,angle:tQ(d),angleInRadian:d}},nQ=e=>{var{startAngle:t,endAngle:r}=e,a=Math.floor(t/360),s=Math.floor(r/360),i=Math.min(a,s);return{startAngle:t-i*360,endAngle:r-i*360}},sQ=(e,t)=>{var{startAngle:r,endAngle:a}=t,s=Math.floor(r/360),i=Math.floor(a/360),l=Math.min(s,i);return e+l*360},iQ=(e,t)=>{var{relativeX:r,relativeY:a}=e,{radius:s,angle:i}=aQ({x:r,y:a},t),{innerRadius:l,outerRadius:u}=t;if(s<l||s>u||s===0)return null;var{startAngle:d,endAngle:f}=nQ(t),p=i,m;if(d<=f){for(;p>f;)p-=360;for(;p<d;)p+=360;m=p>=d&&p<=f}else{for(;p>d;)p-=360;for(;p<f;)p+=360;m=p>=f&&p<=d}return m?C6(C6({},t),{},{radius:s,angle:sQ(p,t)}):null};function pD(e){var{cx:t,cy:r,radius:a,startAngle:s,endAngle:i}=e,l=la(t,r,a,s),u=la(t,r,a,i);return{points:[l,u],cx:t,cy:r,radius:a,startAngle:s,endAngle:i}}var T6,E6,A6,O6,P6,D6,R6;function yj(){return yj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},yj.apply(null,arguments)}function Ic(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var oQ=(e,t)=>{var r=Oa(t-e),a=Math.min(Math.abs(t-e),359.999);return r*a},Bm=e=>{var{cx:t,cy:r,radius:a,angle:s,sign:i,isExternal:l,cornerRadius:u,cornerIsExternal:d}=e,f=u*(l?1:-1)+a,p=Math.asin(u/f)/sx,m=d?s:s+i*p,x=la(t,r,f,m),v=la(t,r,a,m),b=d?s-i*p:s,w=la(t,r,f*Math.cos(p*sx),b);return{center:x,circleTangency:v,lineTangency:w,theta:p}},mD=e=>{var{cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:i,endAngle:l}=e,u=oQ(i,l),d=i+u,f=la(t,r,s,i),p=la(t,r,s,d),m=Wr(T6||(T6=Ic(["M ",",",`
A `,",",`,0,
`,",",`,
`,",",`
`])),f.x,f.y,s,s,+(Math.abs(u)>180),+(i>d),p.x,p.y);if(a>0){var x=la(t,r,a,i),v=la(t,r,a,d);m+=Wr(E6||(E6=Ic(["L ",",",`
A `,",",`,0,
`,",",`,
`,","," Z"])),v.x,v.y,a,a,+(Math.abs(u)>180),+(i<=d),x.x,x.y)}else m+=Wr(A6||(A6=Ic(["L ",","," Z"])),t,r);return m},lQ=e=>{var{cx:t,cy:r,innerRadius:a,outerRadius:s,cornerRadius:i,forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:f}=e,p=Oa(f-d),{circleTangency:m,lineTangency:x,theta:v}=Bm({cx:t,cy:r,radius:s,angle:d,sign:p,cornerRadius:i,cornerIsExternal:u}),{circleTangency:b,lineTangency:w,theta:j}=Bm({cx:t,cy:r,radius:s,angle:f,sign:-p,cornerRadius:i,cornerIsExternal:u}),k=u?Math.abs(d-f):Math.abs(d-f)-v-j;if(k<0)return l?Wr(O6||(O6=Ic(["M ",",",`
a`,",",",0,0,1,",`,0
a`,",",",0,0,1,",`,0
`])),x.x,x.y,i,i,i*2,i,i,-i*2):mD({cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:d,endAngle:f});var C=Wr(P6||(P6=Ic(["M ",",",`
A`,",",",0,0,",",",",",`
A`,",",",0,",",",",",",",`
A`,",",",0,0,",",",",",`
`])),x.x,x.y,i,i,+(p<0),m.x,m.y,s,s,+(k>180),+(p<0),b.x,b.y,i,i,+(p<0),w.x,w.y);if(a>0){var{circleTangency:N,lineTangency:O,theta:E}=Bm({cx:t,cy:r,radius:a,angle:d,sign:p,isExternal:!0,cornerRadius:i,cornerIsExternal:u}),{circleTangency:A,lineTangency:T,theta:P}=Bm({cx:t,cy:r,radius:a,angle:f,sign:-p,isExternal:!0,cornerRadius:i,cornerIsExternal:u}),D=u?Math.abs(d-f):Math.abs(d-f)-E-P;if(D<0&&i===0)return"".concat(C,"L").concat(t,",").concat(r,"Z");C+=Wr(D6||(D6=Ic(["L",",",`
A`,",",",0,0,",",",",",`
A`,",",",0,",",",",",",",`
A`,",",",0,0,",",",",","Z"])),T.x,T.y,i,i,+(p<0),A.x,A.y,a,a,+(D>180),+(p>0),N.x,N.y,i,i,+(p<0),O.x,O.y)}else C+=Wr(R6||(R6=Ic(["L",",","Z"])),t,r);return C},cQ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},gD=e=>{var t=Fa(e,cQ),{cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:l,forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(i<s||f===p)return null;var x=Wt("recharts-sector",m),v=i-s,b=on(l,v,0,!0),w;return b>0&&Math.abs(f-p)<360?w=lQ({cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:Math.min(b,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):w=mD({cx:r,cy:a,innerRadius:s,outerRadius:i,startAngle:f,endAngle:p}),y.createElement("path",yj({},Gs(t),{className:x,d:w}))};function uQ(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(VP(t)){if(e==="centric"){var{cx:a,cy:s,innerRadius:i,outerRadius:l,angle:u}=t,d=la(a,s,i,u),f=la(a,s,l,u);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return pD(t)}}var I2={},z2={},B2={},F6;function dQ(){if(F6)return B2;F6=1;const e=i7();function t(r){return e.isSymbol(r)?NaN:Number(r)}return B2.toNumber=t,B2}var M6;function fQ(){if(M6)return z2;M6=1;const e=dQ();function t(r){return r?(r=e.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}return z2.toFinite=t,z2}var L6;function hQ(){if(L6)return I2;L6=1;const e=fQ(),t=s7();function r(a,s,i){i&&typeof i!="number"&&t.isIterateeCall(a,s,i)&&(s=i=void 0),a=e.toFinite(a),s===void 0?(s=a,a=0):s=e.toFinite(s),i=i===void 0?a<s?1:-1:e.toFinite(i);const l=Math.max(Math.ceil((s-a)/(i||1)),0),u=new Array(l);for(let d=0;d<l;d++)u[d]=a,a+=i;return u}return I2.range=r,I2}var $2,I6;function pQ(){return I6||(I6=1,$2=hQ().range),$2}var mQ=pQ();const xD=zl(mQ);var ji=e=>e.chartData,Wh=Ae([ji],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),_y=(e,t,r,a)=>a?Wh(e):ji(e),gQ=(e,t,r)=>r?Wh(e):ji(e),xQ=Ae([_y],e=>{var{chartData:t,dataStartIndex:r,dataEndIndex:a}=e;return t!=null?t.slice(r,a+1):[]}),yQ=Ae([Wh],e=>{var{chartData:t,dataStartIndex:r,dataEndIndex:a}=e;return t!=null?t.slice(r,a+1):[]}),vQ=Ae([ji],e=>{var{chartData:t,dataStartIndex:r,dataEndIndex:a}=e;return t!=null?t.slice(r,a+1):[]});function Ui(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Kt(t)&&Kt(r))return!0}return!1}function z6(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function yD(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,a]=e,s,i;if(Kt(r))s=r;else if(typeof r=="function")return;if(Kt(a))i=a;else if(typeof a=="function")return;var l=[s,i];if(Ui(l))return l}}function bQ(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var a=e(t,r);if(Ui(a))return z6(a,t,r)}catch(v){}if(Array.isArray(e)&&e.length===2){var[s,i]=e,l,u;if(s==="auto")t!=null&&(l=Math.min(...t));else if(pt(s))l=s;else if(typeof s=="function")try{t!=null&&(l=s(t==null?void 0:t[0]))}catch(v){}else if(typeof s=="string"&&T5.test(s)){var d=T5.exec(s);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[0]-f}}else l=t==null?void 0:t[0];if(i==="auto")t!=null&&(u=Math.max(...t));else if(pt(i))u=i;else if(typeof i=="function")try{t!=null&&(u=i(t==null?void 0:t[1]))}catch(v){}else if(typeof i=="string"&&E5.test(i)){var p=E5.exec(i);if(p==null||p[1]==null||t==null)u=void 0;else{var m=+p[1];u=t[1]+m}}else u=t==null?void 0:t[1];var x=[l,u];if(Ui(x))return t==null?x:z6(x,t,r)}}}var h0=1e9,wQ={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},O_,Mr=!0,Ks="[DecimalError] ",Hc=Ks+"Invalid argument: ",A_=Ks+"Exponent out of range: ",p0=Math.floor,Tc=Math.pow,jQ=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,us,Ea=1e7,Ar=7,vD=9007199254740991,ix=p0(vD/Ar),dt={};dt.absoluteValue=dt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};dt.comparedTo=dt.cmp=function(e){var t,r,a,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(a=i.d.length,s=e.d.length,t=0,r=a<s?a:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return a===s?0:a>s^i.s<0?1:-1};dt.decimalPlaces=dt.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Ar;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};dt.dividedBy=dt.div=function(e){return To(this,new this.constructor(e))};dt.dividedToIntegerBy=dt.idiv=function(e){var t=this,r=t.constructor;return Sr(To(t,new r(e),0,1),r.precision)};dt.equals=dt.eq=function(e){return!this.cmp(e)};dt.exponent=function(){return ca(this)};dt.greaterThan=dt.gt=function(e){return this.cmp(e)>0};dt.greaterThanOrEqualTo=dt.gte=function(e){return this.cmp(e)>=0};dt.isInteger=dt.isint=function(){return this.e>this.d.length-2};dt.isNegative=dt.isneg=function(){return this.s<0};dt.isPositive=dt.ispos=function(){return this.s>0};dt.isZero=function(){return this.s===0};dt.lessThan=dt.lt=function(e){return this.cmp(e)<0};dt.lessThanOrEqualTo=dt.lte=function(e){return this.cmp(e)<1};dt.logarithm=dt.log=function(e){var t,r=this,a=r.constructor,s=a.precision,i=s+5;if(e===void 0)e=new a(10);else if(e=new a(e),e.s<1||e.eq(us))throw Error(Ks+"NaN");if(r.s<1)throw Error(Ks+(r.s?"NaN":"-Infinity"));return r.eq(us)?new a(0):(Mr=!1,t=To(gh(r,i),gh(e,i),i),Mr=!0,Sr(t,s))};dt.minus=dt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?jD(t,e):bD(t,(e.s=-e.s,e))};dt.modulo=dt.mod=function(e){var t,r=this,a=r.constructor,s=a.precision;if(e=new a(e),!e.s)throw Error(Ks+"NaN");return r.s?(Mr=!1,t=To(r,e,0,1).times(e),Mr=!0,r.minus(t)):Sr(new a(r),s)};dt.naturalExponential=dt.exp=function(){return wD(this)};dt.naturalLogarithm=dt.ln=function(){return gh(this)};dt.negated=dt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};dt.plus=dt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?bD(t,e):jD(t,(e.s=-e.s,e))};dt.precision=dt.sd=function(e){var t,r,a,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Hc+e);if(t=ca(s)+1,a=s.d.length-1,r=a*Ar+1,a=s.d[a],a){for(;a%10==0;a/=10)r--;for(a=s.d[0];a>=10;a/=10)r++}return e&&t>r?t:r};dt.squareRoot=dt.sqrt=function(){var e,t,r,a,s,i,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Ks+"NaN")}for(e=ca(u),Mr=!1,s=Math.sqrt(+u),s==0||s==1/0?(t=$i(u.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=p0((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),a=new d(t)):a=new d(s.toString()),r=d.precision,s=l=r+3;;)if(i=a,a=i.plus(To(u,i,l+2)).times(.5),$i(i.d).slice(0,l)===(t=$i(a.d)).slice(0,l)){if(t=t.slice(l-3,l+1),s==l&&t=="4999"){if(Sr(i,r+1,0),i.times(i).eq(u)){a=i;break}}else if(t!="9999")break;l+=4}return Mr=!0,Sr(a,r)};dt.times=dt.mul=function(e){var t,r,a,s,i,l,u,d,f,p=this,m=p.constructor,x=p.d,v=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,r=p.e+e.e,d=x.length,f=v.length,d<f&&(i=x,x=v,v=i,l=d,d=f,f=l),i=[],l=d+f,a=l;a--;)i.push(0);for(a=f;--a>=0;){for(t=0,s=d+a;s>a;)u=i[s]+v[a]*x[s-a-1]+t,i[s--]=u%Ea|0,t=u/Ea|0;i[s]=(i[s]+t)%Ea|0}for(;!i[--l];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Mr?Sr(e,m.precision):e};dt.toDecimalPlaces=dt.todp=function(e,t){var r=this,a=r.constructor;return r=new a(r),e===void 0?r:(Ki(e,0,h0),t===void 0?t=a.rounding:Ki(t,0,8),Sr(r,e+ca(r)+1,t))};dt.toExponential=function(e,t){var r,a=this,s=a.constructor;return e===void 0?r=ru(a,!0):(Ki(e,0,h0),t===void 0?t=s.rounding:Ki(t,0,8),a=Sr(new s(a),e+1,t),r=ru(a,!0,e+1)),r};dt.toFixed=function(e,t){var r,a,s=this,i=s.constructor;return e===void 0?ru(s):(Ki(e,0,h0),t===void 0?t=i.rounding:Ki(t,0,8),a=Sr(new i(s),e+ca(s)+1,t),r=ru(a.abs(),!1,e+ca(a)+1),s.isneg()&&!s.isZero()?"-"+r:r)};dt.toInteger=dt.toint=function(){var e=this,t=e.constructor;return Sr(new t(e),ca(e)+1,t.rounding)};dt.toNumber=function(){return+this};dt.toPower=dt.pow=function(e){var t,r,a,s,i,l,u=this,d=u.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(us);if(u=new d(u),!u.s){if(e.s<1)throw Error(Ks+"Infinity");return u}if(u.eq(us))return u;if(a=d.precision,e.eq(us))return Sr(u,a);if(t=e.e,r=e.d.length-1,l=t>=r,i=u.s,l){if((r=p<0?-p:p)<=vD){for(s=new d(us),t=Math.ceil(a/Ar+4),Mr=!1;r%2&&(s=s.times(u),$6(s.d,t)),r=p0(r/2),r!==0;)u=u.times(u),$6(u.d,t);return Mr=!0,e.s<0?new d(us).div(s):Sr(s,a)}}else if(i<0)throw Error(Ks+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,Mr=!1,s=e.times(gh(u,a+f)),Mr=!0,s=wD(s),s.s=i,s};dt.toPrecision=function(e,t){var r,a,s=this,i=s.constructor;return e===void 0?(r=ca(s),a=ru(s,r<=i.toExpNeg||r>=i.toExpPos)):(Ki(e,1,h0),t===void 0?t=i.rounding:Ki(t,0,8),s=Sr(new i(s),e,t),r=ca(s),a=ru(s,e<=r||r<=i.toExpNeg,e)),a};dt.toSignificantDigits=dt.tosd=function(e,t){var r=this,a=r.constructor;return e===void 0?(e=a.precision,t=a.rounding):(Ki(e,1,h0),t===void 0?t=a.rounding:Ki(t,0,8)),Sr(new a(r),e,t)};dt.toString=dt.valueOf=dt.val=dt.toJSON=dt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ca(e),r=e.constructor;return ru(e,t<=r.toExpNeg||t>=r.toExpPos)};function bD(e,t){var r,a,s,i,l,u,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),Mr?Sr(t,m):t;if(d=e.d,f=t.d,l=e.e,s=t.e,d=d.slice(),i=l-s,i){for(i<0?(a=d,i=-i,u=f.length):(a=f,s=l,u=d.length),l=Math.ceil(m/Ar),u=l>u?l+1:u+1,i>u&&(i=u,a.length=1),a.reverse();i--;)a.push(0);a.reverse()}for(u=d.length,i=f.length,u-i<0&&(i=u,a=f,f=d,d=a),r=0;i;)r=(d[--i]=d[i]+f[i]+r)/Ea|0,d[i]%=Ea;for(r&&(d.unshift(r),++s),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=s,Mr?Sr(t,m):t}function Ki(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Hc+e)}function $i(e){var t,r,a,s=e.length-1,i="",l=e[0];if(s>0){for(i+=l,t=1;t<s;t++)a=e[t]+"",r=Ar-a.length,r&&(i+=Sl(r)),i+=a;l=e[t],a=l+"",r=Ar-a.length,r&&(i+=Sl(r))}else if(l===0)return"0";for(;l%10===0;)l/=10;return i+l}var To=(function(){function e(a,s){var i,l=0,u=a.length;for(a=a.slice();u--;)i=a[u]*s+l,a[u]=i%Ea|0,l=i/Ea|0;return l&&a.unshift(l),a}function t(a,s,i,l){var u,d;if(i!=l)d=i>l?1:-1;else for(u=d=0;u<i;u++)if(a[u]!=s[u]){d=a[u]>s[u]?1:-1;break}return d}function r(a,s,i){for(var l=0;i--;)a[i]-=l,l=a[i]<s[i]?1:0,a[i]=l*Ea+a[i]-s[i];for(;!a[0]&&a.length>1;)a.shift()}return function(a,s,i,l){var u,d,f,p,m,x,v,b,w,j,k,C,N,O,E,A,T,P,D=a.constructor,z=a.s==s.s?1:-1,G=a.d,V=s.d;if(!a.s)return new D(a);if(!s.s)throw Error(Ks+"Division by zero");for(d=a.e-s.e,T=V.length,E=G.length,v=new D(z),b=v.d=[],f=0;V[f]==(G[f]||0);)++f;if(V[f]>(G[f]||0)&&--d,i==null?C=i=D.precision:l?C=i+(ca(a)-ca(s))+1:C=i,C<0)return new D(0);if(C=C/Ar+2|0,f=0,T==1)for(p=0,V=V[0],C++;(f<E||p)&&C--;f++)N=p*Ea+(G[f]||0),b[f]=N/V|0,p=N%V|0;else{for(p=Ea/(V[0]+1)|0,p>1&&(V=e(V,p),G=e(G,p),T=V.length,E=G.length),O=T,w=G.slice(0,T),j=w.length;j<T;)w[j++]=0;P=V.slice(),P.unshift(0),A=V[0],V[1]>=Ea/2&&++A;do p=0,u=t(V,w,T,j),u<0?(k=w[0],T!=j&&(k=k*Ea+(w[1]||0)),p=k/A|0,p>1?(p>=Ea&&(p=Ea-1),m=e(V,p),x=m.length,j=w.length,u=t(m,w,x,j),u==1&&(p--,r(m,T<x?P:V,x))):(p==0&&(u=p=1),m=V.slice()),x=m.length,x<j&&m.unshift(0),r(w,m,j),u==-1&&(j=w.length,u=t(V,w,T,j),u<1&&(p++,r(w,T<j?P:V,j))),j=w.length):u===0&&(p++,w=[0]),b[f++]=p,u&&w[0]?w[j++]=G[O]||0:(w=[G[O]],j=1);while((O++<E||w[0]!==void 0)&&C--)}return b[0]||b.shift(),v.e=d,Sr(v,l?i+ca(v)+1:i)}})();function wD(e,t){var r,a,s,i,l,u,d=0,f=0,p=e.constructor,m=p.precision;if(ca(e)>16)throw Error(A_+ca(e));if(!e.s)return new p(us);for(Mr=!1,u=m,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(a=Math.log(Tc(2,f))/Math.LN10*2+5|0,u+=a,r=s=i=new p(us),p.precision=u;;){if(s=Sr(s.times(e),u),r=r.times(++d),l=i.plus(To(s,r,u)),$i(l.d).slice(0,u)===$i(i.d).slice(0,u)){for(;f--;)i=Sr(i.times(i),u);return p.precision=m,t==null?(Mr=!0,Sr(i,m)):i}i=l}}function ca(e){for(var t=e.e*Ar,r=e.d[0];r>=10;r/=10)t++;return t}function U2(e,t,r){if(t>e.LN10.sd())throw Mr=!0,r&&(e.precision=r),Error(Ks+"LN10 precision limit exceeded");return Sr(new e(e.LN10),t)}function Sl(e){for(var t="";e--;)t+="0";return t}function gh(e,t){var r,a,s,i,l,u,d,f,p,m=1,x=10,v=e,b=v.d,w=v.constructor,j=w.precision;if(v.s<1)throw Error(Ks+(v.s?"NaN":"-Infinity"));if(v.eq(us))return new w(0);if(t==null?(Mr=!1,f=j):f=t,v.eq(10))return t==null&&(Mr=!0),U2(w,f);if(f+=x,w.precision=f,r=$i(b),a=r.charAt(0),i=ca(v),Math.abs(i)<15e14){for(;a<7&&a!=1||a==1&&r.charAt(1)>3;)v=v.times(e),r=$i(v.d),a=r.charAt(0),m++;i=ca(v),a>1?(v=new w("0."+r),i++):v=new w(a+"."+r.slice(1))}else return d=U2(w,f+2,j).times(i+""),v=gh(new w(a+"."+r.slice(1)),f-x).plus(d),w.precision=j,t==null?(Mr=!0,Sr(v,j)):v;for(u=l=v=To(v.minus(us),v.plus(us),f),p=Sr(v.times(v),f),s=3;;){if(l=Sr(l.times(p),f),d=u.plus(To(l,new w(s),f)),$i(d.d).slice(0,f)===$i(u.d).slice(0,f))return u=u.times(2),i!==0&&(u=u.plus(U2(w,f+2,j).times(i+""))),u=To(u,new w(m),f),w.precision=j,t==null?(Mr=!0,Sr(u,j)):u;u=d,s+=2}}function B6(e,t){var r,a,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(r<0&&(r=a),r+=+t.slice(a+1),t=t.substring(0,a)):r<0&&(r=t.length),a=0;t.charCodeAt(a)===48;)++a;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(a,s),t){if(s-=a,r=r-a-1,e.e=p0(r/Ar),e.d=[],a=(r+1)%Ar,r<0&&(a+=Ar),a<s){for(a&&e.d.push(+t.slice(0,a)),s-=Ar;a<s;)e.d.push(+t.slice(a,a+=Ar));t=t.slice(a),a=Ar-t.length}else a-=s;for(;a--;)t+="0";if(e.d.push(+t),Mr&&(e.e>ix||e.e<-ix))throw Error(A_+r)}else e.s=0,e.e=0,e.d=[0];return e}function Sr(e,t,r){var a,s,i,l,u,d,f,p,m=e.d;for(l=1,i=m[0];i>=10;i/=10)l++;if(a=t-l,a<0)a+=Ar,s=t,f=m[p=0];else{if(p=Math.ceil((a+1)/Ar),i=m.length,p>=i)return e;for(f=i=m[p],l=1;i>=10;i/=10)l++;a%=Ar,s=a-Ar+l}if(r!==void 0&&(i=Tc(10,l-s-1),u=f/i%10|0,d=t<0||m[p+1]!==void 0||f%i,d=r<4?(u||d)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||d||r==6&&(a>0?s>0?f/Tc(10,l-s):0:m[p-1])%10&1||r==(e.s<0?8:7))),t<1||!m[0])return d?(i=ca(e),m.length=1,t=t-i-1,m[0]=Tc(10,(Ar-t%Ar)%Ar),e.e=p0(-t/Ar)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(a==0?(m.length=p,i=1,p--):(m.length=p+1,i=Tc(10,Ar-a),m[p]=s>0?(f/Tc(10,l-s)%Tc(10,s)|0)*i:0),d)for(;;)if(p==0){(m[0]+=i)==Ea&&(m[0]=1,++e.e);break}else{if(m[p]+=i,m[p]!=Ea)break;m[p--]=0,i=1}for(a=m.length;m[--a]===0;)m.pop();if(Mr&&(e.e>ix||e.e<-ix))throw Error(A_+ca(e));return e}function jD(e,t){var r,a,s,i,l,u,d,f,p,m,x=e.constructor,v=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),Mr?Sr(t,v):t;if(d=e.d,m=t.d,a=t.e,f=e.e,d=d.slice(),l=f-a,l){for(p=l<0,p?(r=d,l=-l,u=m.length):(r=m,a=f,u=d.length),s=Math.max(Math.ceil(v/Ar),u)+2,l>s&&(l=s,r.length=1),r.reverse(),s=l;s--;)r.push(0);r.reverse()}else{for(s=d.length,u=m.length,p=s<u,p&&(u=s),s=0;s<u;s++)if(d[s]!=m[s]){p=d[s]<m[s];break}l=0}for(p&&(r=d,d=m,m=r,t.s=-t.s),u=d.length,s=m.length-u;s>0;--s)d[u++]=0;for(s=m.length;s>l;){if(d[--s]<m[s]){for(i=s;i&&d[--i]===0;)d[i]=Ea-1;--d[i],d[s]+=Ea}d[s]-=m[s]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--a;return d[0]?(t.d=d,t.e=a,Mr?Sr(t,v):t):new x(0)}function ru(e,t,r){var a,s=ca(e),i=$i(e.d),l=i.length;return t?(r&&(a=r-l)>0?i=i.charAt(0)+"."+i.slice(1)+Sl(a):l>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Sl(-s-1)+i,r&&(a=r-l)>0&&(i+=Sl(a))):s>=l?(i+=Sl(s+1-l),r&&(a=r-s-1)>0&&(i=i+"."+Sl(a))):((a=s+1)<l&&(i=i.slice(0,a)+"."+i.slice(a)),r&&(a=r-l)>0&&(s+1===l&&(i+="."),i+=Sl(a))),e.s<0?"-"+i:i}function $6(e,t){if(e.length>t)return e.length=t,!0}function _D(e){var t,r,a;function s(i){var l=this;if(!(l instanceof s))return new s(i);if(l.constructor=s,i instanceof s){l.s=i.s,l.e=i.e,l.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Hc+i);if(i>0)l.s=1;else if(i<0)i=-i,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(i===~~i&&i<1e7){l.e=0,l.d=[i];return}return B6(l,i.toString())}else if(typeof i!="string")throw Error(Hc+i);if(i.charCodeAt(0)===45?(i=i.slice(1),l.s=-1):l.s=1,jQ.test(i))B6(l,i);else throw Error(Hc+i)}if(s.prototype=dt,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=_D,s.config=s.set=_Q,e===void 0&&(e={}),e)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<a.length;)e.hasOwnProperty(r=a[t++])||(e[r]=this[r]);return s.config(e),s}function _Q(e){if(!e||typeof e!="object")throw Error(Ks+"Object expected");var t,r,a,s=["precision",1,h0,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((a=e[r=s[t]])!==void 0)if(p0(a)===a&&a>=s[t+1]&&a<=s[t+2])this[r]=a;else throw Error(Hc+r+": "+a);if((a=e[r="LN10"])!==void 0)if(a==Math.LN10)this[r]=new this(a);else throw Error(Hc+r+": "+a);return this}var O_=_D(wQ);us=new O_(1);const Gt=O_;function kD(e){var t;return e===0?t=1:t=Math.floor(new Gt(e).abs().log(10).toNumber())+1,t}function SD(e,t,r){for(var a=new Gt(e),s=0,i=[];a.lt(t)&&s<1e5;)i.push(a.toNumber()),a=a.add(r),s++;return i}var ND=e=>{var[t,r]=e,[a,s]=[t,r];return t>r&&([a,s]=[r,t]),[a,s]},P_=(e,t,r)=>{if(e.lte(0))return new Gt(0);var a=kD(e.toNumber()),s=new Gt(10).pow(a),i=e.div(s),l=a!==1?.05:.1,u=new Gt(Math.ceil(i.div(l).toNumber())).add(r).mul(l),d=u.mul(s);return t?new Gt(d.toNumber()):new Gt(Math.ceil(d.toNumber()))},CD=(e,t,r)=>{var a;if(e.lte(0))return new Gt(0);var s=[1,2,2.5,5],i=e.toNumber(),l=Math.floor(new Gt(i).abs().log(10).toNumber()),u=new Gt(10).pow(l),d=e.div(u).toNumber(),f=s.findIndex(v=>v>=d-1e-10);if(f===-1&&(u=u.mul(10),f=0),f+=r,f>=s.length){var p=Math.floor(f/s.length);f%=s.length,u=u.mul(new Gt(10).pow(p))}var m=(a=s[f])!==null&&a!==void 0?a:1,x=new Gt(m).mul(u);return t?x:new Gt(Math.ceil(x.toNumber()))},kQ=(e,t,r)=>{var a=new Gt(1),s=new Gt(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(a=new Gt(10).pow(kD(e)-1),s=new Gt(Math.floor(s.div(a).toNumber())).mul(a)):i>1&&(s=new Gt(Math.floor(e)))}else e===0?s=new Gt(Math.floor((t-1)/2)):r||(s=new Gt(Math.floor(e)));for(var l=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(s.add(new Gt(d-l).mul(a)).toNumber());return u},TD=function(t,r,a,s){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:P_;if(!Number.isFinite((r-t)/(a-1)))return{step:new Gt(0),tickMin:new Gt(0),tickMax:new Gt(0)};var u=l(new Gt(r).sub(t).div(a-1),s,i),d;t<=0&&r>=0?d=new Gt(0):(d=new Gt(t).add(r).div(2),d=d.sub(new Gt(d).mod(u)));var f=Math.ceil(d.sub(t).div(u).toNumber()),p=Math.ceil(new Gt(r).sub(d).div(u).toNumber()),m=f+p+1;return m>a?TD(t,r,a,s,i+1,l):(m<a&&(p=r>0?p+(a-m):p,f=r>0?f:f+(a-m)),{step:u,tickMin:d.sub(new Gt(f).mul(u)),tickMax:d.add(new Gt(p).mul(u))})},U6=function(t){var[r,a]=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(s,2),[d,f]=ND([r,a]);if(d===-1/0||f===1/0){var p=f===1/0?[d,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),f];return r>a?p.reverse():p}if(d===f)return kQ(d,s,i);var m=l==="snap125"?CD:P_,{step:x,tickMin:v,tickMax:b}=TD(d,f,u,i,0,m),w=SD(v,b.add(new Gt(.1).mul(x)),x);return r>a?w.reverse():w},H6=function(t,r){var[a,s]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,d]=ND([a,s]);if(u===-1/0||d===1/0)return[a,s];if(u===d)return[u];var f=l==="snap125"?CD:P_,p=Math.max(r,2),m=f(new Gt(d).sub(u).div(p-1),i,0),x=[...SD(new Gt(u),new Gt(d),m),d];return i===!1&&(x=x.map(v=>Math.round(v))),a>s?x.reverse():x},ED=e=>e.rootProps.maxBarSize,SQ=e=>e.rootProps.barGap,AD=e=>e.rootProps.barCategoryGap,NQ=e=>e.rootProps.barSize,Vh=e=>e.rootProps.stackOffset,OD=e=>e.rootProps.reverseStackOrder,D_=e=>e.options.chartName,R_=e=>e.rootProps.syncId,PD=e=>e.rootProps.syncMethod,F_=e=>e.options.eventEmitter,Xa={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},pc={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Di={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},ky=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Sy(e,t,r){if(r!=="auto")return r;if(e!=null)return Bl(e,t)?"category":"number"}function q6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function ox(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q6(Object(r),!0).forEach(function(a){CQ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function CQ(e,t,r){return(t=TQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TQ(e){var t=EQ(e,"string");return typeof t=="symbol"?t:t+""}function EQ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var W6={allowDataOverflow:pc.allowDataOverflow,allowDecimals:pc.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:pc.angleAxisId,includeHidden:!1,name:void 0,reversed:pc.reversed,scale:pc.scale,tick:pc.tick,tickCount:void 0,ticks:void 0,type:pc.type,unit:void 0,niceTicks:"auto"},V6={allowDataOverflow:Di.allowDataOverflow,allowDecimals:Di.allowDecimals,allowDuplicatedCategory:Di.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Di.radiusAxisId,includeHidden:Di.includeHidden,name:void 0,reversed:Di.reversed,scale:Di.scale,tick:Di.tick,tickCount:Di.tickCount,ticks:void 0,type:Di.type,unit:void 0,niceTicks:"auto"},AQ=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},M_=Ae([AQ,Y7],(e,t)=>{var r;if(e!=null)return e;var a=(r=Sy(t,"angleAxis",W6.type))!==null&&r!==void 0?r:"category";return ox(ox({},W6),{},{type:a})}),OQ=(e,t)=>e.polarAxis.radiusAxis[t],L_=Ae([OQ,Y7],(e,t)=>{var r;if(e!=null)return e;var a=(r=Sy(t,"radiusAxis",V6.type))!==null&&r!==void 0?r:"category";return ox(ox({},V6),{},{type:a})}),Ny=e=>e.polarOptions,I_=Ae([Uo,Ho,_a],hD),DD=Ae([Ny,I_],(e,t)=>{if(e!=null)return on(e.innerRadius,t,0)}),RD=Ae([Ny,I_],(e,t)=>{if(e!=null)return on(e.outerRadius,t,t*.8)}),PQ=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},FD=Ae([Ny],PQ);Ae([M_,FD],ky);var MD=Ae([I_,DD,RD],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Ae([L_,MD],ky);var LD=Ae([ir,Ny,DD,RD,Uo,Ho],(e,t,r,a,s,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||a==null)){var{cx:l,cy:u,startAngle:d,endAngle:f}=t;return{cx:on(l,s,s/2),cy:on(u,i,i/2),innerRadius:r,outerRadius:a,startAngle:d,endAngle:f,clockWise:!1}}}),$r=(e,t)=>t,Gh=(e,t,r)=>r;function z_(e){return e==null?void 0:e.id}function ID(e,t,r){var{chartData:a=[]}=t,{allowDuplicatedCategory:s,dataKey:i}=r,l=new Map;return e.forEach(u=>{var d,f=(d=u.data)!==null&&d!==void 0?d:a;if(!(f==null||f.length===0)){var p=z_(u);f.forEach((m,x)=>{var v=i==null||s?x:String(kr(m,i,null)),b=kr(m,u.dataKey,0),w;l.has(v)?w=l.get(v):w={},Object.assign(w,{[p]:b}),l.set(v,w)})}}),Array.from(l.values())}function Cy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Ty=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Ey(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function DQ(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var Ma=e=>{var t=ir(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},m0=e=>e.tooltip.settings.axisId;function B_(e){if(e!=null){var t=e.ticks,r=e.bandwidth,a=e.range(),s=[Math.min(...a),Math.max(...a)];return{domain:()=>e.domain(),range:(function(i){function l(){return i.apply(this,arguments)}return l.toString=function(){return i.toString()},l})(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(i){var l=s[0],u=s[1];return l<=u?i>=l&&i<=u:i>=u&&i<=l},bandwidth:r?()=>r.call(e):void 0,ticks:t?i=>t.call(e,i):void 0,map:(i,l)=>{var u=e(i);if(u!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}}var zD=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ui(t)){for(var r,a,s=0;s<t.length;s++){var i=t[s];Kt(i)&&((r===void 0||i<r)&&(r=i),(a===void 0||i>a)&&(a=i))}return r!==void 0&&a!==void 0?[r,a]:void 0}return t}default:return t}};function Ol(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function RQ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function $_(e){let t,r,a;e.length!==2?(t=Ol,r=(u,d)=>Ol(e(u),d),a=(u,d)=>e(u)-d):(t=e===Ol||e===RQ?e:FQ,r=e,a=e);function s(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;r(u[m],d)<0?f=m+1:p=m}while(f<p)}return f}function i(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;r(u[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function l(u,d,f=0,p=u.length){const m=s(u,d,f,p-1);return m>f&&a(u[m-1],d)>-a(u[m],d)?m-1:m}return{left:s,center:l,right:i}}function FQ(){return 0}function BD(e){return e===null?NaN:+e}function*MQ(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const LQ=$_(Ol),Kh=LQ.right;$_(BD).center;class G6 extends Map{constructor(t,r=BQ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[a,s]of t)this.set(a,s)}get(t){return super.get(K6(this,t))}has(t){return super.has(K6(this,t))}set(t,r){return super.set(IQ(this,t),r)}delete(t){return super.delete(zQ(this,t))}}function K6({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):r}function IQ({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):(e.set(a,r),r)}function zQ({_intern:e,_key:t},r){const a=t(r);return e.has(a)&&(r=e.get(a),e.delete(a)),r}function BQ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function $Q(e=Ol){if(e===Ol)return $D;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const a=e(t,r);return a||a===0?a:(e(r,r)===0)-(e(t,t)===0)}}function $D(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const UQ=Math.sqrt(50),HQ=Math.sqrt(10),qQ=Math.sqrt(2);function lx(e,t,r){const a=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(a)),i=a/Math.pow(10,s),l=i>=UQ?10:i>=HQ?5:i>=qQ?2:1;let u,d,f;return s<0?(f=Math.pow(10,-s)/l,u=Math.round(e*f),d=Math.round(t*f),u/f<e&&++u,d/f>t&&--d,f=-f):(f=Math.pow(10,s)*l,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=r&&r<2?lx(e,t,r*2):[u,d,f]}function vj(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const a=t<e,[s,i,l]=a?lx(t,e,r):lx(e,t,r);if(!(i>=s))return[];const u=i-s+1,d=new Array(u);if(a)if(l<0)for(let f=0;f<u;++f)d[f]=(i-f)/-l;else for(let f=0;f<u;++f)d[f]=(i-f)*l;else if(l<0)for(let f=0;f<u;++f)d[f]=(s+f)/-l;else for(let f=0;f<u;++f)d[f]=(s+f)*l;return d}function bj(e,t,r){return t=+t,e=+e,r=+r,lx(e,t,r)[2]}function wj(e,t,r){t=+t,e=+e,r=+r;const a=t<e,s=a?bj(t,e,r):bj(e,t,r);return(a?-1:1)*(s<0?1/-s:s)}function Y6(e,t){let r;for(const a of e)a!=null&&(r<a||r===void 0&&a>=a)&&(r=a);return r}function X6(e,t){let r;for(const a of e)a!=null&&(r>a||r===void 0&&a>=a)&&(r=a);return r}function UD(e,t,r=0,a=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),a=Math.floor(Math.min(e.length-1,a)),!(r<=t&&t<=a))return e;for(s=s===void 0?$D:$Q(s);a>r;){if(a-r>600){const d=a-r+1,f=t-r+1,p=Math.log(d),m=.5*Math.exp(2*p/3),x=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(r,Math.floor(t-f*m/d+x)),b=Math.min(a,Math.floor(t+(d-f)*m/d+x));UD(e,t,v,b,s)}const i=e[t];let l=r,u=a;for(kf(e,r,t),s(e[a],i)>0&&kf(e,r,a);l<u;){for(kf(e,l,u),++l,--u;s(e[l],i)<0;)++l;for(;s(e[u],i)>0;)--u}s(e[r],i)===0?kf(e,r,u):(++u,kf(e,u,a)),u<=t&&(r=u+1),t<=u&&(a=u-1)}return e}function kf(e,t,r){const a=e[t];e[t]=e[r],e[r]=a}function WQ(e,t,r){if(e=Float64Array.from(MQ(e)),!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return X6(e);if(t>=1)return Y6(e);var a,s=(a-1)*t,i=Math.floor(s),l=Y6(UD(e,i).subarray(0,i+1)),u=X6(e.subarray(i+1));return l+(u-l)*(s-i)}}function VQ(e,t,r=BD){if(!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return+r(e[0],0,e);if(t>=1)return+r(e[a-1],a-1,e);var a,s=(a-1)*t,i=Math.floor(s),l=+r(e[i],i,e),u=+r(e[i+1],i+1,e);return l+(u-l)*(s-i)}}function GQ(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var a=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(s);++a<s;)i[a]=e+a*r;return i}function Ys(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function qo(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 jj=Symbol("implicit");function U_(){var e=new G6,t=[],r=[],a=jj;function s(i){let l=e.get(i);if(l===void 0){if(a!==jj)return a;e.set(i,l=t.push(i)-1)}return r[l%r.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new G6;for(const l of i)e.has(l)||e.set(l,t.push(l)-1);return s},s.range=function(i){return arguments.length?(r=Array.from(i),s):r.slice()},s.unknown=function(i){return arguments.length?(a=i,s):a},s.copy=function(){return U_(t,r).unknown(a)},Ys.apply(s,arguments),s}function H_(){var e=U_().unknown(void 0),t=e.domain,r=e.range,a=0,s=1,i,l,u=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var x=t().length,v=s<a,b=v?s:a,w=v?a:s;i=(w-b)/Math.max(1,x-d+f*2),u&&(i=Math.floor(i)),b+=(w-b-i*(x-d))*p,l=i*(1-d),u&&(b=Math.round(b),l=Math.round(l));var j=GQ(x).map(function(k){return b+i*k});return r(v?j.reverse():j)}return e.domain=function(x){return arguments.length?(t(x),m()):t()},e.range=function(x){return arguments.length?([a,s]=x,a=+a,s=+s,m()):[a,s]},e.rangeRound=function(x){return[a,s]=x,a=+a,s=+s,u=!0,m()},e.bandwidth=function(){return l},e.step=function(){return i},e.round=function(x){return arguments.length?(u=!!x,m()):u},e.padding=function(x){return arguments.length?(d=Math.min(1,f=+x),m()):d},e.paddingInner=function(x){return arguments.length?(d=Math.min(1,x),m()):d},e.paddingOuter=function(x){return arguments.length?(f=+x,m()):f},e.align=function(x){return arguments.length?(p=Math.max(0,Math.min(1,x)),m()):p},e.copy=function(){return H_(t(),[a,s]).round(u).paddingInner(d).paddingOuter(f).align(p)},Ys.apply(m(),arguments)}function HD(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return HD(t())},e}function KQ(){return HD(H_.apply(null,arguments).paddingInner(1))}function q_(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function qD(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function Yh(){}var xh=.7,cx=1/xh,$d="\\s*([+-]?\\d+)\\s*",yh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",YQ=/^#([0-9a-f]{3,8})$/,XQ=new RegExp(`^rgb\\(${$d},${$d},${$d}\\)$`),JQ=new RegExp(`^rgb\\(${Hi},${Hi},${Hi}\\)$`),QQ=new RegExp(`^rgba\\(${$d},${$d},${$d},${yh}\\)$`),ZQ=new RegExp(`^rgba\\(${Hi},${Hi},${Hi},${yh}\\)$`),eZ=new RegExp(`^hsl\\(${yh},${Hi},${Hi}\\)$`),tZ=new RegExp(`^hsla\\(${yh},${Hi},${Hi},${yh}\\)$`),J6={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};q_(Yh,vh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Q6,formatHex:Q6,formatHex8:rZ,formatHsl:aZ,formatRgb:Z6,toString:Z6});function Q6(){return this.rgb().formatHex()}function rZ(){return this.rgb().formatHex8()}function aZ(){return WD(this).formatHsl()}function Z6(){return this.rgb().formatRgb()}function vh(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=YQ.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?eE(t):r===3?new zn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?$m(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?$m(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=XQ.exec(e))?new zn(t[1],t[2],t[3],1):(t=JQ.exec(e))?new zn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=QQ.exec(e))?$m(t[1],t[2],t[3],t[4]):(t=ZQ.exec(e))?$m(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=eZ.exec(e))?aE(t[1],t[2]/100,t[3]/100,1):(t=tZ.exec(e))?aE(t[1],t[2]/100,t[3]/100,t[4]):J6.hasOwnProperty(e)?eE(J6[e]):e==="transparent"?new zn(NaN,NaN,NaN,0):null}function eE(e){return new zn(e>>16&255,e>>8&255,e&255,1)}function $m(e,t,r,a){return a<=0&&(e=t=r=NaN),new zn(e,t,r,a)}function nZ(e){return e instanceof Yh||(e=vh(e)),e?(e=e.rgb(),new zn(e.r,e.g,e.b,e.opacity)):new zn}function _j(e,t,r,a){return arguments.length===1?nZ(e):new zn(e,t,r,a==null?1:a)}function zn(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}q_(zn,_j,qD(Yh,{brighter(e){return e=e==null?cx:Math.pow(cx,e),new zn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xh:Math.pow(xh,e),new zn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new zn(qc(this.r),qc(this.g),qc(this.b),ux(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:tE,formatHex:tE,formatHex8:sZ,formatRgb:rE,toString:rE}));function tE(){return`#${zc(this.r)}${zc(this.g)}${zc(this.b)}`}function sZ(){return`#${zc(this.r)}${zc(this.g)}${zc(this.b)}${zc((isNaN(this.opacity)?1:this.opacity)*255)}`}function rE(){const e=ux(this.opacity);return`${e===1?"rgb(":"rgba("}${qc(this.r)}, ${qc(this.g)}, ${qc(this.b)}${e===1?")":`, ${e})`}`}function ux(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zc(e){return e=qc(e),(e<16?"0":"")+e.toString(16)}function aE(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ui(e,t,r,a)}function WD(e){if(e instanceof ui)return new ui(e.h,e.s,e.l,e.opacity);if(e instanceof Yh||(e=vh(e)),!e)return new ui;if(e instanceof ui)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,s=Math.min(t,r,a),i=Math.max(t,r,a),l=NaN,u=i-s,d=(i+s)/2;return u?(t===i?l=(r-a)/u+(r<a)*6:r===i?l=(a-t)/u+2:l=(t-r)/u+4,u/=d<.5?i+s:2-i-s,l*=60):u=d>0&&d<1?0:l,new ui(l,u,d,e.opacity)}function iZ(e,t,r,a){return arguments.length===1?WD(e):new ui(e,t,r,a==null?1:a)}function ui(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}q_(ui,iZ,qD(Yh,{brighter(e){return e=e==null?cx:Math.pow(cx,e),new ui(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xh:Math.pow(xh,e),new ui(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,a=r+(r<.5?r:1-r)*t,s=2*r-a;return new zn(H2(e>=240?e-240:e+120,s,a),H2(e,s,a),H2(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new ui(nE(this.h),Um(this.s),Um(this.l),ux(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=ux(this.opacity);return`${e===1?"hsl(":"hsla("}${nE(this.h)}, ${Um(this.s)*100}%, ${Um(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nE(e){return e=(e||0)%360,e<0?e+360:e}function Um(e){return Math.max(0,Math.min(1,e||0))}function H2(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 W_=e=>()=>e;function oZ(e,t){return function(r){return e+r*t}}function lZ(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(a){return Math.pow(e+a*t,r)}}function cZ(e){return(e=+e)==1?VD:function(t,r){return r-t?lZ(t,r,e):W_(isNaN(t)?r:t)}}function VD(e,t){var r=t-e;return r?oZ(e,r):W_(isNaN(e)?t:e)}const sE=(function e(t){var r=cZ(t);function a(s,i){var l=r((s=_j(s)).r,(i=_j(i)).r),u=r(s.g,i.g),d=r(s.b,i.b),f=VD(s.opacity,i.opacity);return function(p){return s.r=l(p),s.g=u(p),s.b=d(p),s.opacity=f(p),s+""}}return a.gamma=e,a})(1);function uZ(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,a=t.slice(),s;return function(i){for(s=0;s<r;++s)a[s]=e[s]*(1-i)+t[s]*i;return a}}function dZ(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fZ(e,t){var r=t?t.length:0,a=e?Math.min(r,e.length):0,s=new Array(a),i=new Array(r),l;for(l=0;l<a;++l)s[l]=g0(e[l],t[l]);for(;l<r;++l)i[l]=t[l];return function(u){for(l=0;l<a;++l)i[l]=s[l](u);return i}}function hZ(e,t){var r=new Date;return e=+e,t=+t,function(a){return r.setTime(e*(1-a)+t*a),r}}function dx(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function pZ(e,t){var r={},a={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=g0(e[s],t[s]):a[s]=t[s];return function(i){for(s in r)a[s]=r[s](i);return a}}var kj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,q2=new RegExp(kj.source,"g");function mZ(e){return function(){return e}}function gZ(e){return function(t){return e(t)+""}}function xZ(e,t){var r=kj.lastIndex=q2.lastIndex=0,a,s,i,l=-1,u=[],d=[];for(e=e+"",t=t+"";(a=kj.exec(e))&&(s=q2.exec(t));)(i=s.index)>r&&(i=t.slice(r,i),u[l]?u[l]+=i:u[++l]=i),(a=a[0])===(s=s[0])?u[l]?u[l]+=s:u[++l]=s:(u[++l]=null,d.push({i:l,x:dx(a,s)})),r=q2.lastIndex;return r<t.length&&(i=t.slice(r),u[l]?u[l]+=i:u[++l]=i),u.length<2?d[0]?gZ(d[0].x):mZ(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)u[(m=d[p]).i]=m.x(f);return u.join("")})}function g0(e,t){var r=typeof t,a;return t==null||r==="boolean"?W_(t):(r==="number"?dx:r==="string"?(a=vh(t))?(t=a,sE):xZ:t instanceof vh?sE:t instanceof Date?hZ:dZ(t)?uZ:Array.isArray(t)?fZ:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?pZ:dx)(e,t)}function V_(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function yZ(e,t){t===void 0&&(t=e,e=g0);for(var r=0,a=t.length-1,s=t[0],i=new Array(a<0?0:a);r<a;)i[r]=e(s,s=t[++r]);return function(l){var u=Math.max(0,Math.min(a-1,Math.floor(l*=a)));return i[u](l-u)}}function vZ(e){return function(){return e}}function fx(e){return+e}var iE=[0,1];function _n(e){return e}function Sj(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:vZ(isNaN(t)?NaN:.5)}function bZ(e,t){var r;return e>t&&(r=e,e=t,t=r),function(a){return Math.max(e,Math.min(t,a))}}function wZ(e,t,r){var a=e[0],s=e[1],i=t[0],l=t[1];return s<a?(a=Sj(s,a),i=r(l,i)):(a=Sj(a,s),i=r(i,l)),function(u){return i(a(u))}}function jZ(e,t,r){var a=Math.min(e.length,t.length)-1,s=new Array(a),i=new Array(a),l=-1;for(e[a]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<a;)s[l]=Sj(e[l],e[l+1]),i[l]=r(t[l],t[l+1]);return function(u){var d=Kh(e,u,1,a)-1;return i[d](s[d](u))}}function Xh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ay(){var e=iE,t=iE,r=g0,a,s,i,l=_n,u,d,f;function p(){var x=Math.min(e.length,t.length);return l!==_n&&(l=bZ(e[0],e[x-1])),u=x>2?jZ:wZ,d=f=null,m}function m(x){return x==null||isNaN(x=+x)?i:(d||(d=u(e.map(a),t,r)))(a(l(x)))}return m.invert=function(x){return l(s((f||(f=u(t,e.map(a),dx)))(x)))},m.domain=function(x){return arguments.length?(e=Array.from(x,fx),p()):e.slice()},m.range=function(x){return arguments.length?(t=Array.from(x),p()):t.slice()},m.rangeRound=function(x){return t=Array.from(x),r=V_,p()},m.clamp=function(x){return arguments.length?(l=x?!0:_n,p()):l!==_n},m.interpolate=function(x){return arguments.length?(r=x,p()):r},m.unknown=function(x){return arguments.length?(i=x,m):i},function(x,v){return a=x,s=v,p()}}function G_(){return Ay()(_n,_n)}function _Z(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function hx(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),a=e.slice(0,r);return[a.length>1?a[0]+a.slice(2):a,+e.slice(r+1)]}function Jd(e){return e=hx(Math.abs(e)),e?e[1]:NaN}function kZ(e,t){return function(r,a){for(var s=r.length,i=[],l=0,u=e[0],d=0;s>0&&u>0&&(d+u+1>a&&(u=Math.max(1,a-d)),i.push(r.substring(s-=u,s+u)),!((d+=u+1)>a));)u=e[l=(l+1)%e.length];return i.reverse().join(t)}}function SZ(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var NZ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bh(e){if(!(t=NZ.exec(e)))throw new Error("invalid format: "+e);var t;return new K_({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]})}bh.prototype=K_.prototype;function K_(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+""}K_.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 CZ(e){e:for(var t=e.length,r=1,a=-1,s;r<t;++r)switch(e[r]){case".":a=s=r;break;case"0":a===0&&(a=r),s=r;break;default:if(!+e[r])break e;a>0&&(a=0);break}return a>0?e.slice(0,a)+e.slice(s+1):e}var px;function TZ(e,t){var r=hx(e,t);if(!r)return px=void 0,e.toPrecision(t);var a=r[0],s=r[1],i=s-(px=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,l=a.length;return i===l?a:i>l?a+new Array(i-l+1).join("0"):i>0?a.slice(0,i)+"."+a.slice(i):"0."+new Array(1-i).join("0")+hx(e,Math.max(0,t+i-1))[0]}function oE(e,t){var r=hx(e,t);if(!r)return e+"";var a=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+a:a.length>s+1?a.slice(0,s+1)+"."+a.slice(s+1):a+new Array(s-a.length+2).join("0")}const lE={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_Z,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)=>oE(e*100,t),r:oE,s:TZ,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cE(e){return e}var uE=Array.prototype.map,dE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function EZ(e){var t=e.grouping===void 0||e.thousands===void 0?cE:kZ(uE.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",a=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?cE:SZ(uE.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,x){m=bh(m);var v=m.fill,b=m.align,w=m.sign,j=m.symbol,k=m.zero,C=m.width,N=m.comma,O=m.precision,E=m.trim,A=m.type;A==="n"?(N=!0,A="g"):lE[A]||(O===void 0&&(O=12),E=!0,A="g"),(k||v==="0"&&b==="=")&&(k=!0,v="0",b="=");var T=(x&&x.prefix!==void 0?x.prefix:"")+(j==="$"?r:j==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),P=(j==="$"?a:/[%p]/.test(A)?l:"")+(x&&x.suffix!==void 0?x.suffix:""),D=lE[A],z=/[defgprs%]/.test(A);O=O===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function G(V){var ne=T,ge=P,Z,U,ce;if(A==="c")ge=D(V)+ge,V="";else{V=+V;var xe=V<0||1/V<0;if(V=isNaN(V)?d:D(Math.abs(V),O),E&&(V=CZ(V)),xe&&+V==0&&w!=="+"&&(xe=!1),ne=(xe?w==="("?w:u:w==="-"||w==="("?"":w)+ne,ge=(A==="s"&&!isNaN(V)&&px!==void 0?dE[8+px/3]:"")+ge+(xe&&w==="("?")":""),z){for(Z=-1,U=V.length;++Z<U;)if(ce=V.charCodeAt(Z),48>ce||ce>57){ge=(ce===46?s+V.slice(Z+1):V.slice(Z))+ge,V=V.slice(0,Z);break}}}N&&!k&&(V=t(V,1/0));var be=ne.length+V.length+ge.length,me=be<C?new Array(C-be+1).join(v):"";switch(N&&k&&(V=t(me+V,me.length?C-ge.length:1/0),me=""),b){case"<":V=ne+V+ge+me;break;case"=":V=ne+me+V+ge;break;case"^":V=me.slice(0,be=me.length>>1)+ne+V+ge+me.slice(be);break;default:V=me+ne+V+ge;break}return i(V)}return G.toString=function(){return m+""},G}function p(m,x){var v=Math.max(-8,Math.min(8,Math.floor(Jd(x)/3)))*3,b=Math.pow(10,-v),w=f((m=bh(m),m.type="f",m),{suffix:dE[8+v/3]});return function(j){return w(b*j)}}return{format:f,formatPrefix:p}}var Hm,Y_,GD;AZ({thousands:",",grouping:[3],currency:["$",""]});function AZ(e){return Hm=EZ(e),Y_=Hm.format,GD=Hm.formatPrefix,Hm}function OZ(e){return Math.max(0,-Jd(Math.abs(e)))}function PZ(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jd(t)/3)))*3-Jd(Math.abs(e)))}function DZ(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jd(t)-Jd(e))+1}function KD(e,t,r,a){var s=wj(e,t,r),i;switch(a=bh(a==null?",f":a),a.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return a.precision==null&&!isNaN(i=PZ(s,l))&&(a.precision=i),GD(a,l)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(i=DZ(s,Math.max(Math.abs(e),Math.abs(t))))&&(a.precision=i-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(i=OZ(s))&&(a.precision=i-(a.type==="%")*2);break}}return Y_(a)}function $l(e){var t=e.domain;return e.ticks=function(r){var a=t();return vj(a[0],a[a.length-1],r==null?10:r)},e.tickFormat=function(r,a){var s=t();return KD(s[0],s[s.length-1],r==null?10:r,a)},e.nice=function(r){r==null&&(r=10);var a=t(),s=0,i=a.length-1,l=a[s],u=a[i],d,f,p=10;for(u<l&&(f=l,l=u,u=f,f=s,s=i,i=f);p-- >0;){if(f=bj(l,u,r),f===d)return a[s]=l,a[i]=u,t(a);if(f>0)l=Math.floor(l/f)*f,u=Math.ceil(u/f)*f;else if(f<0)l=Math.ceil(l*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function YD(){var e=G_();return e.copy=function(){return Xh(e,YD())},Ys.apply(e,arguments),$l(e)}function XD(e){var t;function r(a){return a==null||isNaN(a=+a)?t:a}return r.invert=r,r.domain=r.range=function(a){return arguments.length?(e=Array.from(a,fx),r):e.slice()},r.unknown=function(a){return arguments.length?(t=a,r):t},r.copy=function(){return XD(e).unknown(t)},e=arguments.length?Array.from(e,fx):[0,1],$l(r)}function JD(e,t){e=e.slice();var r=0,a=e.length-1,s=e[r],i=e[a],l;return i<s&&(l=r,r=a,a=l,l=s,s=i,i=l),e[r]=t.floor(s),e[a]=t.ceil(i),e}function fE(e){return Math.log(e)}function hE(e){return Math.exp(e)}function RZ(e){return-Math.log(-e)}function FZ(e){return-Math.exp(-e)}function MZ(e){return isFinite(e)?+("1e"+e):e<0?0:e}function LZ(e){return e===10?MZ:e===Math.E?Math.exp:t=>Math.pow(e,t)}function IZ(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 pE(e){return(t,r)=>-e(-t,r)}function X_(e){const t=e(fE,hE),r=t.domain;let a=10,s,i;function l(){return s=IZ(a),i=LZ(a),r()[0]<0?(s=pE(s),i=pE(i),e(RZ,FZ)):e(fE,hE),t}return t.base=function(u){return arguments.length?(a=+u,l()):a},t.domain=function(u){return arguments.length?(r(u),l()):r()},t.ticks=u=>{const d=r();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let x=s(f),v=s(p),b,w;const j=u==null?10:+u;let k=[];if(!(a%1)&&v-x<j){if(x=Math.floor(x),v=Math.ceil(v),f>0){for(;x<=v;++x)for(b=1;b<a;++b)if(w=x<0?b/i(-x):b*i(x),!(w<f)){if(w>p)break;k.push(w)}}else for(;x<=v;++x)for(b=a-1;b>=1;--b)if(w=x>0?b/i(-x):b*i(x),!(w<f)){if(w>p)break;k.push(w)}k.length*2<j&&(k=vj(f,p,j))}else k=vj(x,v,Math.min(v-x,j)).map(i);return m?k.reverse():k},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=a===10?"s":","),typeof d!="function"&&(!(a%1)&&(d=bh(d)).precision==null&&(d.trim=!0),d=Y_(d)),u===1/0)return d;const f=Math.max(1,a*u/t.ticks().length);return p=>{let m=p/i(Math.round(s(p)));return m*a<a-.5&&(m*=a),m<=f?d(p):""}},t.nice=()=>r(JD(r(),{floor:u=>i(Math.floor(s(u))),ceil:u=>i(Math.ceil(s(u)))})),t}function QD(){const e=X_(Ay()).domain([1,10]);return e.copy=()=>Xh(e,QD()).base(e.base()),Ys.apply(e,arguments),e}function mE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function gE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function J_(e){var t=1,r=e(mE(t),gE(t));return r.constant=function(a){return arguments.length?e(mE(t=+a),gE(t)):t},$l(r)}function ZD(){var e=J_(Ay());return e.copy=function(){return Xh(e,ZD()).constant(e.constant())},Ys.apply(e,arguments)}function xE(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function zZ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function BZ(e){return e<0?-e*e:e*e}function Q_(e){var t=e(_n,_n),r=1;function a(){return r===1?e(_n,_n):r===.5?e(zZ,BZ):e(xE(r),xE(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,a()):r},$l(t)}function Z_(){var e=Q_(Ay());return e.copy=function(){return Xh(e,Z_()).exponent(e.exponent())},Ys.apply(e,arguments),e}function $Z(){return Z_.apply(null,arguments).exponent(.5)}function yE(e){return Math.sign(e)*e*e}function UZ(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function eR(){var e=G_(),t=[0,1],r=!1,a;function s(i){var l=UZ(e(i));return isNaN(l)?a:r?Math.round(l):l}return s.invert=function(i){return e.invert(yE(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,fx)).map(yE)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(r=!!i,s):r},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(a=i,s):a},s.copy=function(){return eR(e.domain(),t).round(r).clamp(e.clamp()).unknown(a)},Ys.apply(s,arguments),$l(s)}function tR(){var e=[],t=[],r=[],a;function s(){var l=0,u=Math.max(1,t.length);for(r=new Array(u-1);++l<u;)r[l-1]=VQ(e,l/u);return i}function i(l){return l==null||isNaN(l=+l)?a:t[Kh(r,l)]}return i.invertExtent=function(l){var u=t.indexOf(l);return u<0?[NaN,NaN]:[u>0?r[u-1]:e[0],u<r.length?r[u]:e[e.length-1]]},i.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let u of l)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(Ol),s()},i.range=function(l){return arguments.length?(t=Array.from(l),s()):t.slice()},i.unknown=function(l){return arguments.length?(a=l,i):a},i.quantiles=function(){return r.slice()},i.copy=function(){return tR().domain(e).range(t).unknown(a)},Ys.apply(i,arguments)}function rR(){var e=0,t=1,r=1,a=[.5],s=[0,1],i;function l(d){return d!=null&&d<=d?s[Kh(a,d,0,r)]:i}function u(){var d=-1;for(a=new Array(r);++d<r;)a[d]=((d+1)*t-(d-r)*e)/(r+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},l.range=function(d){return arguments.length?(r=(s=Array.from(d)).length-1,u()):s.slice()},l.invertExtent=function(d){var f=s.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,a[0]]:f>=r?[a[r-1],t]:[a[f-1],a[f]]},l.unknown=function(d){return arguments.length&&(i=d),l},l.thresholds=function(){return a.slice()},l.copy=function(){return rR().domain([e,t]).range(s).unknown(i)},Ys.apply($l(l),arguments)}function aR(){var e=[.5],t=[0,1],r,a=1;function s(i){return i!=null&&i<=i?t[Kh(e,i,0,a)]:r}return s.domain=function(i){return arguments.length?(e=Array.from(i),a=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),a=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var l=t.indexOf(i);return[e[l-1],e[l]]},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return aR().domain(e).range(t).unknown(r)},Ys.apply(s,arguments)}const W2=new Date,V2=new Date;function ka(e,t,r,a){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const l=s(i),u=s.ceil(i);return i-l<u-i?l:u},s.offset=(i,l)=>(t(i=new Date(+i),l==null?1:Math.floor(l)),i),s.range=(i,l,u)=>{const d=[];if(i=s.ceil(i),u=u==null?1:Math.floor(u),!(i<l)||!(u>0))return d;let f;do d.push(f=new Date(+i)),t(i,u),e(i);while(f<i&&i<l);return d},s.filter=i=>ka(l=>{if(l>=l)for(;e(l),!i(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!i(l););else for(;--u>=0;)for(;t(l,1),!i(l););}),r&&(s.count=(i,l)=>(W2.setTime(+i),V2.setTime(+l),e(W2),e(V2),Math.floor(r(W2,V2))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(a?l=>a(l)%i===0:l=>s.count(0,l)%i===0):s)),s}const mx=ka(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);mx.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ka(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):mx);mx.range;const No=1e3,Us=No*60,Co=Us*60,Lo=Co*24,ek=Lo*7,vE=Lo*30,G2=Lo*365,Bc=ka(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*No)},(e,t)=>(t-e)/No,e=>e.getUTCSeconds());Bc.range;const tk=ka(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*No)},(e,t)=>{e.setTime(+e+t*Us)},(e,t)=>(t-e)/Us,e=>e.getMinutes());tk.range;const rk=ka(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Us)},(e,t)=>(t-e)/Us,e=>e.getUTCMinutes());rk.range;const ak=ka(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*No-e.getMinutes()*Us)},(e,t)=>{e.setTime(+e+t*Co)},(e,t)=>(t-e)/Co,e=>e.getHours());ak.range;const nk=ka(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Co)},(e,t)=>(t-e)/Co,e=>e.getUTCHours());nk.range;const Jh=ka(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Us)/Lo,e=>e.getDate()-1);Jh.range;const Oy=ka(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Lo,e=>e.getUTCDate()-1);Oy.range;const nR=ka(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Lo,e=>Math.floor(e/Lo));nR.range;function du(e){return ka(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())*Us)/ek)}const Py=du(0),gx=du(1),HZ=du(2),qZ=du(3),Qd=du(4),WZ=du(5),VZ=du(6);Py.range;gx.range;HZ.range;qZ.range;Qd.range;WZ.range;VZ.range;function fu(e){return ka(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)/ek)}const Dy=fu(0),xx=fu(1),GZ=fu(2),KZ=fu(3),Zd=fu(4),YZ=fu(5),XZ=fu(6);Dy.range;xx.range;GZ.range;KZ.range;Zd.range;YZ.range;XZ.range;const sk=ka(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());sk.range;const ik=ka(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());ik.range;const Io=ka(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());Io.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ka(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)});Io.range;const zo=ka(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());zo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ka(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)});zo.range;function sR(e,t,r,a,s,i){const l=[[Bc,1,No],[Bc,5,5*No],[Bc,15,15*No],[Bc,30,30*No],[i,1,Us],[i,5,5*Us],[i,15,15*Us],[i,30,30*Us],[s,1,Co],[s,3,3*Co],[s,6,6*Co],[s,12,12*Co],[a,1,Lo],[a,2,2*Lo],[r,1,ek],[t,1,vE],[t,3,3*vE],[e,1,G2]];function u(f,p,m){const x=p<f;x&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),b=v?v.range(f,+p+1):[];return x?b.reverse():b}function d(f,p,m){const x=Math.abs(p-f)/m,v=$_(([,,j])=>j).right(l,x);if(v===l.length)return e.every(wj(f/G2,p/G2,m));if(v===0)return mx.every(Math.max(wj(f,p,m),1));const[b,w]=l[x/l[v-1][2]<l[v][2]/x?v-1:v];return b.every(w)}return[u,d]}const[JZ,QZ]=sR(zo,ik,Dy,nR,nk,rk),[ZZ,eee]=sR(Io,sk,Py,Jh,ak,tk);function K2(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 Y2(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 Sf(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function tee(e){var t=e.dateTime,r=e.date,a=e.time,s=e.periods,i=e.days,l=e.shortDays,u=e.months,d=e.shortMonths,f=Nf(s),p=Cf(s),m=Nf(i),x=Cf(i),v=Nf(l),b=Cf(l),w=Nf(u),j=Cf(u),k=Nf(d),C=Cf(d),N={a:ce,A:xe,b:be,B:me,c:null,d:SE,e:SE,f:kee,g:Ree,G:Mee,H:wee,I:jee,j:_ee,L:iR,m:See,M:Nee,p:oe,q:L,Q:TE,s:EE,S:Cee,u:Tee,U:Eee,V:Aee,w:Oee,W:Pee,x:null,X:null,y:Dee,Y:Fee,Z:Lee,"%":CE},O={a:H,A:K,b:Y,B:re,c:null,d:NE,e:NE,f:$ee,g:Jee,G:Zee,H:Iee,I:zee,j:Bee,L:lR,m:Uee,M:Hee,p:de,q:ie,Q:TE,s:EE,S:qee,u:Wee,U:Vee,V:Gee,w:Kee,W:Yee,x:null,X:null,y:Xee,Y:Qee,Z:ete,"%":CE},E={a:z,A:G,b:V,B:ne,c:ge,d:_E,e:_E,f:xee,g:jE,G:wE,H:kE,I:kE,j:hee,L:gee,m:fee,M:pee,p:D,q:dee,Q:vee,s:bee,S:mee,u:iee,U:oee,V:lee,w:see,W:cee,x:Z,X:U,y:jE,Y:wE,Z:uee,"%":yee};N.x=A(r,N),N.X=A(a,N),N.c=A(t,N),O.x=A(r,O),O.X=A(a,O),O.c=A(t,O);function A(se,he){return function(_e){var F=[],X=-1,R=0,I=se.length,te,q,B;for(_e instanceof Date||(_e=new Date(+_e));++X<I;)se.charCodeAt(X)===37&&(F.push(se.slice(R,X)),(q=bE[te=se.charAt(++X)])!=null?te=se.charAt(++X):q=te==="e"?" ":"0",(B=he[te])&&(te=B(_e,q)),F.push(te),R=X+1);return F.push(se.slice(R,X)),F.join("")}}function T(se,he){return function(_e){var F=Sf(1900,void 0,1),X=P(F,se,_e+="",0),R,I;if(X!=_e.length)return null;if("Q"in F)return new Date(F.Q);if("s"in F)return new Date(F.s*1e3+("L"in F?F.L:0));if(he&&!("Z"in F)&&(F.Z=0),"p"in F&&(F.H=F.H%12+F.p*12),F.m===void 0&&(F.m="q"in F?F.q:0),"V"in F){if(F.V<1||F.V>53)return null;"w"in F||(F.w=1),"Z"in F?(R=Y2(Sf(F.y,0,1)),I=R.getUTCDay(),R=I>4||I===0?xx.ceil(R):xx(R),R=Oy.offset(R,(F.V-1)*7),F.y=R.getUTCFullYear(),F.m=R.getUTCMonth(),F.d=R.getUTCDate()+(F.w+6)%7):(R=K2(Sf(F.y,0,1)),I=R.getDay(),R=I>4||I===0?gx.ceil(R):gx(R),R=Jh.offset(R,(F.V-1)*7),F.y=R.getFullYear(),F.m=R.getMonth(),F.d=R.getDate()+(F.w+6)%7)}else("W"in F||"U"in F)&&("w"in F||(F.w="u"in F?F.u%7:"W"in F?1:0),I="Z"in F?Y2(Sf(F.y,0,1)).getUTCDay():K2(Sf(F.y,0,1)).getDay(),F.m=0,F.d="W"in F?(F.w+6)%7+F.W*7-(I+5)%7:F.w+F.U*7-(I+6)%7);return"Z"in F?(F.H+=F.Z/100|0,F.M+=F.Z%100,Y2(F)):K2(F)}}function P(se,he,_e,F){for(var X=0,R=he.length,I=_e.length,te,q;X<R;){if(F>=I)return-1;if(te=he.charCodeAt(X++),te===37){if(te=he.charAt(X++),q=E[te in bE?he.charAt(X++):te],!q||(F=q(se,_e,F))<0)return-1}else if(te!=_e.charCodeAt(F++))return-1}return F}function D(se,he,_e){var F=f.exec(he.slice(_e));return F?(se.p=p.get(F[0].toLowerCase()),_e+F[0].length):-1}function z(se,he,_e){var F=v.exec(he.slice(_e));return F?(se.w=b.get(F[0].toLowerCase()),_e+F[0].length):-1}function G(se,he,_e){var F=m.exec(he.slice(_e));return F?(se.w=x.get(F[0].toLowerCase()),_e+F[0].length):-1}function V(se,he,_e){var F=k.exec(he.slice(_e));return F?(se.m=C.get(F[0].toLowerCase()),_e+F[0].length):-1}function ne(se,he,_e){var F=w.exec(he.slice(_e));return F?(se.m=j.get(F[0].toLowerCase()),_e+F[0].length):-1}function ge(se,he,_e){return P(se,t,he,_e)}function Z(se,he,_e){return P(se,r,he,_e)}function U(se,he,_e){return P(se,a,he,_e)}function ce(se){return l[se.getDay()]}function xe(se){return i[se.getDay()]}function be(se){return d[se.getMonth()]}function me(se){return u[se.getMonth()]}function oe(se){return s[+(se.getHours()>=12)]}function L(se){return 1+~~(se.getMonth()/3)}function H(se){return l[se.getUTCDay()]}function K(se){return i[se.getUTCDay()]}function Y(se){return d[se.getUTCMonth()]}function re(se){return u[se.getUTCMonth()]}function de(se){return s[+(se.getUTCHours()>=12)]}function ie(se){return 1+~~(se.getUTCMonth()/3)}return{format:function(se){var he=A(se+="",N);return he.toString=function(){return se},he},parse:function(se){var he=T(se+="",!1);return he.toString=function(){return se},he},utcFormat:function(se){var he=A(se+="",O);return he.toString=function(){return se},he},utcParse:function(se){var he=T(se+="",!0);return he.toString=function(){return se},he}}}var bE={"-":"",_:" ",0:"0"},La=/^\s*\d+/,ree=/^%/,aee=/[\\^$*+?|[\]().{}]/g;function Zt(e,t,r){var a=e<0?"-":"",s=(a?-e:e)+"",i=s.length;return a+(i<r?new Array(r-i+1).join(t)+s:s)}function nee(e){return e.replace(aee,"\\$&")}function Nf(e){return new RegExp("^(?:"+e.map(nee).join("|")+")","i")}function Cf(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function see(e,t,r){var a=La.exec(t.slice(r,r+1));return a?(e.w=+a[0],r+a[0].length):-1}function iee(e,t,r){var a=La.exec(t.slice(r,r+1));return a?(e.u=+a[0],r+a[0].length):-1}function oee(e,t,r){var a=La.exec(t.slice(r,r+2));return a?(e.U=+a[0],r+a[0].length):-1}function lee(e,t,r){var a=La.exec(t.slice(r,r+2));return a?(e.V=+a[0],r+a[0].length):-1}function cee(e,t,r){var a=La.exec(t.slice(r,r+2));return a?(e.W=+a[0],r+a[0].length):-1}function wE(e,t,r){var a=La.exec(t.slice(r,r+4));return a?(e.y=+a[0],r+a[0].length):-1}function jE(e,t,r){var a=La.exec(t.slice(r,r+2));return a?(e.y=+a[0]+(+a[0]>68?1900:2e3),r+a[0].length):-1}function uee(e,t,r){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return a?(e.Z=a[1]?0:-(a[2]+(a[3]||"00")),r+a[0].length):-1}function dee(e,t,r){var a=La.exec(t.slice(r,r+1));return a?(e.q=a[0]*3-3,r+a[0].length):-1}function fee(e,t,r){var a=La.exec(t.slice(r,r+2));return a?(e.m=a[0]-1,r+a[0].length):-1}function _E(e,t,r){var a=La.exec(t.slice(r,r+2));return a?(e.d=+a[0],r+a[0].length):-1}function hee(e,t,r){var a=La.exec(t.slice(r,r+3));return a?(e.m=0,e.d=+a[0],r+a[0].length):-1}function kE(e,t,r){var a=La.exec(t.slice(r,r+2));return a?(e.H=+a[0],r+a[0].length):-1}function pee(e,t,r){var a=La.exec(t.slice(r,r+2));return a?(e.M=+a[0],r+a[0].length):-1}function mee(e,t,r){var a=La.exec(t.slice(r,r+2));return a?(e.S=+a[0],r+a[0].length):-1}function gee(e,t,r){var a=La.exec(t.slice(r,r+3));return a?(e.L=+a[0],r+a[0].length):-1}function xee(e,t,r){var a=La.exec(t.slice(r,r+6));return a?(e.L=Math.floor(a[0]/1e3),r+a[0].length):-1}function yee(e,t,r){var a=ree.exec(t.slice(r,r+1));return a?r+a[0].length:-1}function vee(e,t,r){var a=La.exec(t.slice(r));return a?(e.Q=+a[0],r+a[0].length):-1}function bee(e,t,r){var a=La.exec(t.slice(r));return a?(e.s=+a[0],r+a[0].length):-1}function SE(e,t){return Zt(e.getDate(),t,2)}function wee(e,t){return Zt(e.getHours(),t,2)}function jee(e,t){return Zt(e.getHours()%12||12,t,2)}function _ee(e,t){return Zt(1+Jh.count(Io(e),e),t,3)}function iR(e,t){return Zt(e.getMilliseconds(),t,3)}function kee(e,t){return iR(e,t)+"000"}function See(e,t){return Zt(e.getMonth()+1,t,2)}function Nee(e,t){return Zt(e.getMinutes(),t,2)}function Cee(e,t){return Zt(e.getSeconds(),t,2)}function Tee(e){var t=e.getDay();return t===0?7:t}function Eee(e,t){return Zt(Py.count(Io(e)-1,e),t,2)}function oR(e){var t=e.getDay();return t>=4||t===0?Qd(e):Qd.ceil(e)}function Aee(e,t){return e=oR(e),Zt(Qd.count(Io(e),e)+(Io(e).getDay()===4),t,2)}function Oee(e){return e.getDay()}function Pee(e,t){return Zt(gx.count(Io(e)-1,e),t,2)}function Dee(e,t){return Zt(e.getFullYear()%100,t,2)}function Ree(e,t){return e=oR(e),Zt(e.getFullYear()%100,t,2)}function Fee(e,t){return Zt(e.getFullYear()%1e4,t,4)}function Mee(e,t){var r=e.getDay();return e=r>=4||r===0?Qd(e):Qd.ceil(e),Zt(e.getFullYear()%1e4,t,4)}function Lee(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Zt(t/60|0,"0",2)+Zt(t%60,"0",2)}function NE(e,t){return Zt(e.getUTCDate(),t,2)}function Iee(e,t){return Zt(e.getUTCHours(),t,2)}function zee(e,t){return Zt(e.getUTCHours()%12||12,t,2)}function Bee(e,t){return Zt(1+Oy.count(zo(e),e),t,3)}function lR(e,t){return Zt(e.getUTCMilliseconds(),t,3)}function $ee(e,t){return lR(e,t)+"000"}function Uee(e,t){return Zt(e.getUTCMonth()+1,t,2)}function Hee(e,t){return Zt(e.getUTCMinutes(),t,2)}function qee(e,t){return Zt(e.getUTCSeconds(),t,2)}function Wee(e){var t=e.getUTCDay();return t===0?7:t}function Vee(e,t){return Zt(Dy.count(zo(e)-1,e),t,2)}function cR(e){var t=e.getUTCDay();return t>=4||t===0?Zd(e):Zd.ceil(e)}function Gee(e,t){return e=cR(e),Zt(Zd.count(zo(e),e)+(zo(e).getUTCDay()===4),t,2)}function Kee(e){return e.getUTCDay()}function Yee(e,t){return Zt(xx.count(zo(e)-1,e),t,2)}function Xee(e,t){return Zt(e.getUTCFullYear()%100,t,2)}function Jee(e,t){return e=cR(e),Zt(e.getUTCFullYear()%100,t,2)}function Qee(e,t){return Zt(e.getUTCFullYear()%1e4,t,4)}function Zee(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Zd(e):Zd.ceil(e),Zt(e.getUTCFullYear()%1e4,t,4)}function ete(){return"+0000"}function CE(){return"%"}function TE(e){return+e}function EE(e){return Math.floor(+e/1e3)}var fd,uR,dR;tte({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","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 tte(e){return fd=tee(e),uR=fd.format,fd.parse,dR=fd.utcFormat,fd.utcParse,fd}function rte(e){return new Date(e)}function ate(e){return e instanceof Date?+e:+new Date(+e)}function ok(e,t,r,a,s,i,l,u,d,f){var p=G_(),m=p.invert,x=p.domain,v=f(".%L"),b=f(":%S"),w=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),C=f("%b %d"),N=f("%B"),O=f("%Y");function E(A){return(d(A)<A?v:u(A)<A?b:l(A)<A?w:i(A)<A?j:a(A)<A?s(A)<A?k:C:r(A)<A?N:O)(A)}return p.invert=function(A){return new Date(m(A))},p.domain=function(A){return arguments.length?x(Array.from(A,ate)):x().map(rte)},p.ticks=function(A){var T=x();return e(T[0],T[T.length-1],A==null?10:A)},p.tickFormat=function(A,T){return T==null?E:f(T)},p.nice=function(A){var T=x();return(!A||typeof A.range!="function")&&(A=t(T[0],T[T.length-1],A==null?10:A)),A?x(JD(T,A)):p},p.copy=function(){return Xh(p,ok(e,t,r,a,s,i,l,u,d,f))},p}function nte(){return Ys.apply(ok(ZZ,eee,Io,sk,Py,Jh,ak,tk,Bc,uR).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ste(){return Ys.apply(ok(JZ,QZ,zo,ik,Dy,Oy,nk,rk,Bc,dR).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ry(){var e=0,t=1,r,a,s,i,l=_n,u=!1,d;function f(m){return m==null||isNaN(m=+m)?d:l(s===0?.5:(m=(i(m)-r)*s,u?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t]=m,r=i(e=+e),a=i(t=+t),s=r===a?0:1/(a-r),f):[e,t]},f.clamp=function(m){return arguments.length?(u=!!m,f):u},f.interpolator=function(m){return arguments.length?(l=m,f):l};function p(m){return function(x){var v,b;return arguments.length?([v,b]=x,l=m(v,b),f):[l(0),l(1)]}}return f.range=p(g0),f.rangeRound=p(V_),f.unknown=function(m){return arguments.length?(d=m,f):d},function(m){return i=m,r=m(e),a=m(t),s=r===a?0:1/(a-r),f}}function Ul(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function fR(){var e=$l(Ry()(_n));return e.copy=function(){return Ul(e,fR())},qo.apply(e,arguments)}function hR(){var e=X_(Ry()).domain([1,10]);return e.copy=function(){return Ul(e,hR()).base(e.base())},qo.apply(e,arguments)}function pR(){var e=J_(Ry());return e.copy=function(){return Ul(e,pR()).constant(e.constant())},qo.apply(e,arguments)}function lk(){var e=Q_(Ry());return e.copy=function(){return Ul(e,lk()).exponent(e.exponent())},qo.apply(e,arguments)}function ite(){return lk.apply(null,arguments).exponent(.5)}function mR(){var e=[],t=_n;function r(a){if(a!=null&&!isNaN(a=+a))return t((Kh(e,a,1)-1)/(e.length-1))}return r.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Ol),r},r.interpolator=function(a){return arguments.length?(t=a,r):t},r.range=function(){return e.map((a,s)=>t(s/(e.length-1)))},r.quantiles=function(a){return Array.from({length:a+1},(s,i)=>WQ(e,i/a))},r.copy=function(){return mR(t).domain(e)},qo.apply(r,arguments)}function Fy(){var e=0,t=.5,r=1,a=1,s,i,l,u,d,f=_n,p,m=!1,x;function v(w){return isNaN(w=+w)?x:(w=.5+((w=+p(w))-i)*(a*w<a*i?u:d),f(m?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([e,t,r]=w,s=p(e=+e),i=p(t=+t),l=p(r=+r),u=s===i?0:.5/(i-s),d=i===l?0:.5/(l-i),a=i<s?-1:1,v):[e,t,r]},v.clamp=function(w){return arguments.length?(m=!!w,v):m},v.interpolator=function(w){return arguments.length?(f=w,v):f};function b(w){return function(j){var k,C,N;return arguments.length?([k,C,N]=j,f=yZ(w,[k,C,N]),v):[f(0),f(.5),f(1)]}}return v.range=b(g0),v.rangeRound=b(V_),v.unknown=function(w){return arguments.length?(x=w,v):x},function(w){return p=w,s=w(e),i=w(t),l=w(r),u=s===i?0:.5/(i-s),d=i===l?0:.5/(l-i),a=i<s?-1:1,v}}function gR(){var e=$l(Fy()(_n));return e.copy=function(){return Ul(e,gR())},qo.apply(e,arguments)}function xR(){var e=X_(Fy()).domain([.1,1,10]);return e.copy=function(){return Ul(e,xR()).base(e.base())},qo.apply(e,arguments)}function yR(){var e=J_(Fy());return e.copy=function(){return Ul(e,yR()).constant(e.constant())},qo.apply(e,arguments)}function ck(){var e=Q_(Fy());return e.copy=function(){return Ul(e,ck()).exponent(e.exponent())},qo.apply(e,arguments)}function ote(){return ck.apply(null,arguments).exponent(.5)}const vR=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:H_,scaleDiverging:gR,scaleDivergingLog:xR,scaleDivergingPow:ck,scaleDivergingSqrt:ote,scaleDivergingSymlog:yR,scaleIdentity:XD,scaleImplicit:jj,scaleLinear:YD,scaleLog:QD,scaleOrdinal:U_,scalePoint:KQ,scalePow:Z_,scaleQuantile:tR,scaleQuantize:rR,scaleRadial:eR,scaleSequential:fR,scaleSequentialLog:hR,scaleSequentialPow:lk,scaleSequentialQuantile:mR,scaleSequentialSqrt:ite,scaleSequentialSymlog:pR,scaleSqrt:$Z,scaleSymlog:ZD,scaleThreshold:aR,scaleTime:nte,scaleUtc:ste,tickFormat:KD},Symbol.toStringTag,{value:"Module"}));function lte(e){var t=vR;if(e in t&&typeof t[e]=="function")return t[e]();var r="scale".concat(Mh(e));if(r in t&&typeof t[r]=="function")return t[r]()}function AE(e,t,r){if(typeof e=="function")return e.copy().domain(t).range(r);if(e!=null){var a=lte(e);if(a!=null)return a.domain(t).range(r),a}}function uk(e,t,r,a){if(!(r==null||a==null))return typeof e.scale=="function"?AE(e.scale,r,a):AE(t,r,a)}function cte(e){return"scale".concat(Mh(e))}function ute(e){return cte(e)in vR}var bR=(e,t,r)=>{if(e!=null){var{scale:a,type:s}=e;if(a==="auto")return s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof a=="string")return ute(a)?a:"point"}};function dte(e,t){for(var r=0,a=e.length,s=e[0]<e[e.length-1];r<a;){var i=Math.floor((r+a)/2);(s?e[i]<t:e[i]>t)?r=i+1:a=i}return r}function wR(e,t){if(e){var r=t!=null?t:e.domain(),a=r.map(i=>{var l;return(l=e(i))!==null&&l!==void 0?l:0}),s=e.range();if(!(r.length===0||s.length<2))return i=>{var l,u,d=dte(a,i);if(d<=0)return r[0];if(d>=r.length)return r[r.length-1];var f=(l=a[d-1])!==null&&l!==void 0?l:0,p=(u=a[d])!==null&&u!==void 0?u:0;return Math.abs(i-f)<=Math.abs(i-p)?r[d-1]:r[d]}}}function fte(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):wR(e,void 0)}function OE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function yx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OE(Object(r),!0).forEach(function(a){hte(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OE(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function hte(e,t,r){return(t=pte(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pte(e){var t=mte(e,"string");return typeof t=="symbol"?t:t+""}function mte(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nj=[0,"auto"],xa={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},jR=(e,t)=>e.cartesianAxis.xAxis[t],Wo=(e,t)=>{var r=jR(e,t);return r==null?xa:r},ya={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Nj,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:Bh},_R=(e,t)=>e.cartesianAxis.yAxis[t],Vo=(e,t)=>{var r=_R(e,t);return r==null?ya:r},gte={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},dk=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r==null?gte:r},Yr=(e,t,r)=>{switch(t){case"xAxis":return Wo(e,r);case"yAxis":return Vo(e,r);case"zAxis":return dk(e,r);case"angleAxis":return M_(e,r);case"radiusAxis":return L_(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},xte=(e,t,r)=>{switch(t){case"xAxis":return Wo(e,r);case"yAxis":return Vo(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},x0=(e,t,r)=>{switch(t){case"xAxis":return Wo(e,r);case"yAxis":return Vo(e,r);case"angleAxis":return M_(e,r);case"radiusAxis":return L_(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},kR=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function fk(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var hk=e=>e.graphicalItems.cartesianItems,yte=Ae([$r,Gh],fk),pk=(e,t,r)=>e.filter(r).filter(a=>(t==null?void 0:t.includeHidden)===!0?!0:!a.hide),y0=Ae([hk,Yr,yte],pk,{memoizeOptions:{resultEqualityCheck:Ey}}),SR=Ae([y0],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Cy)),NR=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),vte=Ae([y0],NR),mk=e=>e.map(t=>t.data).filter(Boolean).flat(1),bte=Ae([y0],e=>e.some(t=>!t.data)),CR=Ae([y0],mk,{memoizeOptions:{resultEqualityCheck:Ey}}),gk=(e,t)=>{var{chartData:r=[],dataStartIndex:a,dataEndIndex:s}=t;return e.length>0?e:r.slice(a,s+1)},xk=Ae([CR,_y],gk),TR=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(a=>({value:kr(a,t.dataKey)})):r.length>0?r.map(a=>a.dataKey).flatMap(a=>e.map(s=>({value:kr(s,a)}))):e.map(a=>({value:a})),ER=(e,t,r,a,s,i)=>{var{chartData:l=[],dataStartIndex:u,dataEndIndex:d}=a,f=TR(e,t,r);if(s&&(t==null?void 0:t.dataKey)!=null&&i.length>0){var p=l.slice(u,d+1),m=p.map(x=>({value:kr(x,t.dataKey)})).filter(x=>x.value!=null);return[...m,...f]}return f},Qh=Ae([xk,Yr,y0,_y,bte,CR],ER);function Ud(e){if(Vi(e)||e instanceof Date){var t=Number(e);if(Kt(t))return t}}function PE(e){if(Array.isArray(e)){var t=[Ud(e[0]),Ud(e[1])];return Ui(t)?t:void 0}var r=Ud(e);if(r!=null)return[r,r]}function Yi(e){return e.map(Ud).filter(In)}function wte(e,t){var r=Ud(e),a=Ud(t);return r==null&&a==null?0:r==null?-1:a==null?1:r-a}var jte=Ae([Qh],e=>e==null?void 0:e.map(t=>t.value).sort(wte));function AR(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function _te(e,t,r){if(!r)return[];if(!r.length)return[];var a;if(typeof t=="number"&&!Wi(t))a=t;else if(Array.isArray(t)){var s=Yi(t);s.length>0&&(a=Math.max(...s))}return a==null?[]:Yi(r.flatMap(i=>{var l=kr(e,i.dataKey),u,d;if(Array.isArray(l)?[u,d]=l:u=d=l,!(!Kt(u)||!Kt(d)))return[a-u,a+d]}))}var Sa=e=>{var t=Ma(e),r=m0(e);return x0(e,t,r)},e0=Ae([Sa],e=>e==null?void 0:e.dataKey),kte=Ae([SR,_y,Sa],ID),OR=(e,t,r,a)=>{var s={},i=t.reduce((l,u)=>{if(u.stackId==null)return l;var d=l[u.stackId];return d==null&&(d=[]),d.push(u),l[u.stackId]=d,l},s);return Object.fromEntries(Object.entries(i).map(l=>{var[u,d]=l,f=a?[...d].reverse():d,p=f.map(z_);return[u,{stackedData:pY(e,p,r),graphicalItems:f}]}))},Cj=Ae([kte,SR,Vh,OD],OR),PR=(e,t,r,a)=>{var{dataStartIndex:s,dataEndIndex:i}=t;if(a==null&&r!=="zAxis"){var l=vY(e,s,i);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},Ste=Ae([Yr],e=>e.allowDataOverflow),yk=e=>{var t;if(e==null||!("domain"in e))return Nj;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Yi(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:Nj},vk=Ae([Yr],yk),bk=Ae([vk,Ste],yD),Nte=Ae([Cj,ji,$r,bk],PR,{memoizeOptions:{resultEqualityCheck:Ty}}),My=e=>e.errorBars,Cte=(e,t,r)=>e.flatMap(a=>t[a.id]).filter(Boolean).filter(a=>AR(r,a)),vx=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];var s=r.filter(Boolean);if(s.length!==0){var i=s.flat(),l=Math.min(...i),u=Math.max(...i);return[l,u]}},wk=function(t,r,a,s,i){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],u,d;if(a.length>0&&a.forEach(f=>{var p,m=f.data!=null?[...f.data]:l,x=(p=s[f.id])===null||p===void 0?void 0:p.filter(v=>AR(i,v));m.forEach(v=>{var b,w=kr(v,(b=r.dataKey)!==null&&b!==void 0?b:f.dataKey),j=_te(v,w,x);if(j.length>=2){var k=Math.min(...j),C=Math.max(...j);(u==null||k<u)&&(u=k),(d==null||C>d)&&(d=C)}var N=PE(w);N!=null&&(u=u==null?N[0]:Math.min(u,N[0]),d=d==null?N[1]:Math.max(d,N[1]))})}),(r==null?void 0:r.dataKey)!=null&&a.length===0&&t.forEach(f=>{var p=PE(kr(f,r.dataKey));p!=null&&(u=u==null?p[0]:Math.min(u,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),Kt(u)&&Kt(d))return[u,d]},Tte=Ae([xk,Yr,vte,My,$r,xQ],wk,{memoizeOptions:{resultEqualityCheck:Ty}});function Ete(e){var{value:t}=e;if(Vi(t)||t instanceof Date)return t}var Ate=(e,t,r)=>{var a=e.map(Ete).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&qP(a))?xD(0,e.length):t.allowDuplicatedCategory?a:Array.from(new Set(a))},DR=e=>e.referenceElements.dots,v0=(e,t,r)=>e.filter(a=>a.ifOverflow==="extendDomain").filter(a=>t==="xAxis"?a.xAxisId===r:a.yAxisId===r),Ote=Ae([DR,$r,Gh],v0),RR=e=>e.referenceElements.areas,Pte=Ae([RR,$r,Gh],v0),FR=e=>e.referenceElements.lines,Dte=Ae([FR,$r,Gh],v0),MR=(e,t)=>{if(e!=null){var r=Yi(e.map(a=>t==="xAxis"?a.x:a.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Rte=Ae(Ote,$r,MR),LR=(e,t)=>{if(e!=null){var r=Yi(e.flatMap(a=>[t==="xAxis"?a.x1:a.y1,t==="xAxis"?a.x2:a.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Fte=Ae([Pte,$r],LR);function Mte(e){var t;if(e.x!=null)return Yi([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.x);return r==null||r.length===0?[]:Yi(r)}function Lte(e){var t;if(e.y!=null)return Yi([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.y);return r==null||r.length===0?[]:Yi(r)}var IR=(e,t)=>{if(e!=null){var r=e.flatMap(a=>t==="xAxis"?Mte(a):Lte(a));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Ite=Ae([Dte,$r],IR),zte=Ae(Rte,Ite,Fte,(e,t,r)=>vx(e,r,t)),jk=(e,t,r,a,s,i,l,u)=>{if(r!=null)return r;var d=l==="vertical"&&u==="xAxis"||l==="horizontal"&&u==="yAxis",f=d?vx(a,i,s):vx(i,s);return bQ(t,f,e.allowDataOverflow)},Bte=Ae([Yr,vk,bk,Nte,Tte,zte,ir,$r],jk,{memoizeOptions:{resultEqualityCheck:Ty}}),$te=[0,1],_k=(e,t,r,a,s,i,l)=>{if(!((e==null||r==null||r.length===0)&&l===void 0)){var{dataKey:u,type:d}=e,f=Bl(t,i);if(f&&u==null){var p;return xD(0,(p=r==null?void 0:r.length)!==null&&p!==void 0?p:0)}return d==="category"?Ate(a,e,f):s==="expand"&&!f?$te:l}},kk=Ae([Yr,ir,xk,Qh,Vh,$r,Bte],_k),Hl=Ae([Yr,kR,D_],bR),Sk=(e,t,r)=>{var{niceTicks:a}=t;if(a!=="none"){var s=yk(t),i=Array.isArray(s)&&(s[0]==="auto"||s[1]==="auto");if((a==="snap125"||a==="adaptive")&&t!=null&&t.tickCount&&Ui(e)){if(i)return U6(e,t.tickCount,t.allowDecimals,a);if(t.type==="number")return H6(e,t.tickCount,t.allowDecimals,a)}if(a==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(i&&Ui(e))return U6(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Ui(e))return H6(e,t.tickCount,t.allowDecimals,"adaptive")}}},Nk=Ae([kk,x0,Hl],Sk),Ck=(e,t,r,a)=>{if(a!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Ui(t)&&Array.isArray(r)&&r.length>0){var s,i,l=t[0],u=(s=r[0])!==null&&s!==void 0?s:0,d=t[1],f=(i=r[r.length-1])!==null&&i!==void 0?i:0;return[Math.min(l,u),Math.max(d,f)]}return t},Ute=Ae([Yr,kk,Nk,$r],Ck),Hte=Ae(Qh,Yr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,a=Array.from(Yi(e.map(m=>m.value))).sort((m,x)=>m-x),s=a[0],i=a[a.length-1];if(s==null||i==null)return 1/0;var l=i-s;if(l===0)return 1/0;for(var u=0;u<a.length-1;u++){var d=a[u],f=a[u+1];if(!(d==null||f==null)){var p=f-d;r=Math.min(r,p)}}return r/l}}),zR=Ae(Hte,ir,AD,_a,(e,t,r,a,s)=>s,(e,t,r,a,s)=>{if(!Kt(e))return 0;var i=t==="vertical"?a.height:a.width;if(s==="gap")return e*i/2;if(s==="no-gap"){var l=on(r,e*i),u=e*i/2;return u-l-(u-l)/i*l}return 0}),qte=(e,t,r)=>{var a=Wo(e,t);return a==null||typeof a.padding!="string"?0:zR(e,"xAxis",t,r,a.padding)},Wte=(e,t,r)=>{var a=Vo(e,t);return a==null||typeof a.padding!="string"?0:zR(e,"yAxis",t,r,a.padding)},Vte=Ae(Wo,qte,(e,t)=>{var r,a;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((r=s.left)!==null&&r!==void 0?r:0)+t,right:((a=s.right)!==null&&a!==void 0?a:0)+t}}),Gte=Ae(Vo,Wte,(e,t)=>{var r,a;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((r=s.top)!==null&&r!==void 0?r:0)+t,bottom:((a=s.bottom)!==null&&a!==void 0?a:0)+t}}),Kte=Ae([_a,Vte,gy,my,(e,t,r)=>r],(e,t,r,a,s)=>{var{padding:i}=a;return s?[i.left,r.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),Yte=Ae([_a,ir,Gte,gy,my,(e,t,r)=>r],(e,t,r,a,s,i)=>{var{padding:l}=s;return i?[a.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Zh=(e,t,r,a)=>{var s;switch(t){case"xAxis":return Kte(e,r,a);case"yAxis":return Yte(e,r,a);case"zAxis":return(s=dk(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return FD(e);case"radiusAxis":return MD(e,r);default:return}},BR=Ae([Yr,Zh],ky),Xte=Ae([Hl,Ute],zD),Tk=Ae([Yr,Hl,Xte,BR],uk),$R=(e,t,r,a)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:i}=r,l=Bl(e,a);if(l&&(s==="number"||i!=="auto"))return t.map(u=>u.value)}},Ek=Ae([ir,Qh,x0,$r],$R),Ly=Ae([Tk],B_);Ae([Tk],fte);Ae([Tk,jte],wR);Ae([y0,My,$r],Cte);function UR(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Iy=(e,t)=>t,zy=(e,t,r)=>r,Jte=Ae(hy,Iy,zy,(e,t,r)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===r).sort(UR)),Qte=Ae(py,Iy,zy,(e,t,r)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===r).sort(UR)),HR=(e,t)=>({width:e.width,height:t.height}),Zte=(e,t)=>{var r=typeof t.width=="number"?t.width:Bh;return{width:r,height:e.height}},qR=Ae(_a,Wo,HR),ere=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},tre=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},rre=Ae(Ho,_a,Jte,Iy,zy,(e,t,r,a,s)=>{var i={},l;return r.forEach(u=>{var d=HR(t,u);l==null&&(l=ere(t,a,e));var f=a==="top"&&!s||a==="bottom"&&s;i[u.id]=l-Number(f)*d.height,l+=(f?-1:1)*d.height}),i}),are=Ae(Uo,_a,Qte,Iy,zy,(e,t,r,a,s)=>{var i={},l;return r.forEach(u=>{var d=Zte(t,u);l==null&&(l=tre(t,a,e));var f=a==="left"&&!s||a==="right"&&s;i[u.id]=l-Number(f)*d.width,l+=(f?-1:1)*d.width}),i}),nre=(e,t)=>{var r=Wo(e,t);if(r!=null)return rre(e,r.orientation,r.mirror)},sre=Ae([_a,Wo,nre,(e,t)=>t],(e,t,r,a)=>{if(t!=null){var s=r==null?void 0:r[a];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),ire=(e,t)=>{var r=Vo(e,t);if(r!=null)return are(e,r.orientation,r.mirror)},ore=Ae([_a,Vo,ire,(e,t)=>t],(e,t,r,a)=>{if(t!=null){var s=r==null?void 0:r[a];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),WR=Ae(_a,Vo,(e,t)=>{var r=typeof t.width=="number"?t.width:Bh;return{width:r,height:e.height}}),DE=(e,t,r)=>{switch(t){case"xAxis":return qR(e,r).width;case"yAxis":return WR(e,r).height;default:return}},VR=(e,t,r,a)=>{if(r!=null){var{allowDuplicatedCategory:s,type:i,dataKey:l}=r,u=Bl(e,a),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(l&&u&&i==="category"&&s&&qP(f))return d}},Ak=Ae([ir,Qh,Yr,$r],VR),RE=Ae([ir,xte,Hl,Ly,Ak,Ek,Zh,Nk,$r],(e,t,r,a,s,i,l,u,d)=>{if(t!=null){var f=Bl(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:i,duplicateDomain:s,isCategorical:f,niceTicks:u,range:l,realScaleType:r,scale:a}}}),lre=(e,t,r,a,s,i,l,u,d)=>{if(!(t==null||a==null)){var f=Bl(e,d),{type:p,ticks:m,tickCount:x}=t,v=r==="scaleBand"&&typeof a.bandwidth=="function"?a.bandwidth()/2:2,b=p==="category"&&a.bandwidth?a.bandwidth()/v:0;b=d==="angleAxis"&&i!=null&&i.length>=2?Oa(i[0]-i[1])*2*b:b;var w=m||s;return w?w.map((j,k)=>{var C=l?l.indexOf(j):j,N=a.map(C);return Kt(N)?{index:k,coordinate:N+b,value:j,offset:b}:null}).filter(In):f&&u?u.map((j,k)=>{var C=a.map(j);return Kt(C)?{coordinate:C+b,value:j,index:k,offset:b}:null}).filter(In):a.ticks?a.ticks(x).map((j,k)=>{var C=a.map(j);return Kt(C)?{coordinate:C+b,value:j,index:k,offset:b}:null}).filter(In):a.domain().map((j,k)=>{var C=a.map(j);return Kt(C)?{coordinate:C+b,value:l?l[j]:j,index:k,offset:b}:null}).filter(In)}},GR=Ae([ir,x0,Hl,Ly,Nk,Zh,Ak,Ek,$r],lre),cre=(e,t,r,a,s,i,l)=>{if(!(t==null||r==null||a==null||a[0]===a[1])){var u=Bl(e,l),{tickCount:d}=t,f=0;return f=l==="angleAxis"&&(a==null?void 0:a.length)>=2?Oa(a[0]-a[1])*2*f:f,u&&i?i.map((p,m)=>{var x=r.map(p);return Kt(x)?{coordinate:x+f,value:p,index:m,offset:f}:null}).filter(In):r.ticks?r.ticks(d).map((p,m)=>{var x=r.map(p);return Kt(x)?{coordinate:x+f,value:p,index:m,offset:f}:null}).filter(In):r.domain().map((p,m)=>{var x=r.map(p);return Kt(x)?{coordinate:x+f,value:s?s[p]:p,index:m,offset:f}:null}).filter(In)}},t0=Ae([ir,x0,Ly,Zh,Ak,Ek,$r],cre),r0=Ae(Yr,Ly,(e,t)=>{if(!(e==null||t==null))return yx(yx({},e),{},{scale:t})}),ure=Ae([Yr,Hl,kk,BR],uk),dre=Ae([ure],B_);Ae((e,t,r)=>dk(e,r),dre,(e,t)=>{if(!(e==null||t==null))return yx(yx({},e),{},{scale:t})});var fre=Ae([ir,hy,py],(e,t,r)=>{switch(e){case"horizontal":return t.some(a=>a.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(a=>a.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),hre=(e,t,r)=>{var a;return(a=e.renderedTicks[t])===null||a===void 0?void 0:a[r]};Ae([hre],e=>{if(!(!e||e.length===0))return t=>{var r,a=1/0,s=e[0];for(var i of e){var l=Math.abs(i.coordinate-t);l<a&&(a=l,s=i)}return(r=s)===null||r===void 0?void 0:r.value}});var KR=e=>e.options.defaultTooltipEventType,YR=e=>e.options.validateTooltipEventTypes;function XR(e,t,r){if(e==null)return t;var a=e?"axis":"item";return r==null?t:r.includes(a)?a:t}function ep(e,t){var r=KR(e),a=YR(e);return XR(t,r,a)}function pre(e){return mt(t=>ep(t,e))}var JR=(e,t)=>{var r,a=Number(t);if(!(Wi(a)||t==null))return a>=0?e==null||(r=e[a])===null||r===void 0?void 0:r.value:void 0},mre=e=>e.tooltip.settings,Cl={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},gre={itemInteraction:{click:Cl,hover:Cl},axisInteraction:{click:Cl,hover:Cl},keyboardInteraction:Cl,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},QR=pn({name:"tooltip",initialState:gre,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Er()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:a}=t.payload,s=$s(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=a)},prepare:Er()},removeTooltipEntrySettings:{reducer(e,t){var r=$s(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:Er()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:xre,replaceTooltipEntrySettings:yre,removeTooltipEntrySettings:vre,setTooltipSettingsState:bre,setActiveMouseOverItemIndex:ZR,mouseLeaveItem:wre,mouseLeaveChart:e9,setActiveClickItemIndex:jre,setMouseOverAxisIndex:t9,setMouseClickAxisIndex:_re,setSyncInteraction:Bf,setKeyboardInteraction:bx}=QR.actions,kre=QR.reducer;function FE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function qm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FE(Object(r),!0).forEach(function(a){Sre(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FE(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Sre(e,t,r){return(t=Nre(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nre(e){var t=Cre(e,"string");return typeof t=="symbol"?t:t+""}function Cre(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tre(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Ere(e){return e.index!=null}var r9=(e,t,r,a)=>{if(t==null)return Cl;var s=Tre(e,t,r);if(s==null)return Cl;if(s.active)return s;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var i=e.settings.active===!0;if(Ere(s)){if(i)return qm(qm({},s),{},{active:!0})}else if(a!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:a,graphicalItemId:void 0};return qm(qm({},Cl),{},{coordinate:s.coordinate})};function Are(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function Ore(e,t){var r=Are(e),a=t[0],s=t[1];if(r===void 0)return!1;var i=Math.min(a,s),l=Math.max(a,s);return r>=i&&r<=l}function Pre(e,t,r){if(r==null||t==null)return!0;var a=kr(e,t);return a==null||!Ui(r)?!0:Ore(a,r)}var Kf=(e,t,r,a)=>{var s=e==null?void 0:e.index;if(s==null)return null;var i=Number(s);if(!Kt(i))return s;var l=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(l,Math.min(i,u)),f=t[d];return f==null||Pre(f,r,a)?String(d):null},a9=(e,t,r,a,s,i,l)=>{if(i!=null){var u=l[0],d=u==null?void 0:u.getPosition(i);if(d!=null)return d;var f=s==null?void 0:s[Number(i)];if(f)return r==="horizontal"?{x:f.coordinate,y:(a.top+t)/2}:{x:(a.left+e)/2,y:f.coordinate}}},n9=(e,t,r,a)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(r==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&s==null)return e.tooltipItemPayloads;if(s==null&&(a!=null||e.keyboardInteraction.active)){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(l=>{var u;return((u=l.settings)===null||u===void 0?void 0:u.graphicalItemId)===s})},s9=e=>e.options.tooltipPayloadSearcher,b0=e=>e.tooltip;function ME(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function LE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ME(Object(r),!0).forEach(function(a){Dre(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ME(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Dre(e,t,r){return(t=Rre(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rre(e){var t=Fre(e,"string");return typeof t=="symbol"?t:t+""}function Fre(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mre(e){if(typeof e=="string"||typeof e=="number")return e}function Lre(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Ire(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function IE(e){if(typeof e=="string")return e}function zre(e){if(!(e==null||typeof e!="object")){var t="name"in e?Mre(e.name):void 0,r="unit"in e?Lre(e.unit):void 0,a="dataKey"in e?Ire(e.dataKey):void 0,s="payload"in e?e.payload:void 0,i="color"in e?IE(e.color):void 0,l="fill"in e?IE(e.fill):void 0;return{name:t,unit:r,dataKey:a,payload:s,color:i,fill:l}}}function Bre(e,t){return e!=null?e:t}var i9=(e,t,r,a,s,i,l)=>{if(!(t==null||i==null)){var{chartData:u,computedData:d,dataStartIndex:f,dataEndIndex:p}=r,m=[];return e.reduce((x,v)=>{var b,{dataDefinedOnItem:w,settings:j}=v,k=Bre(w,u),C=Array.isArray(k)?I7(k,f,p):k,N=(b=j==null?void 0:j.dataKey)!==null&&b!==void 0?b:a,O=j==null?void 0:j.nameKey,E;if(a&&Array.isArray(C)&&!Array.isArray(C[0])&&l==="axis"?E=zV(C,a,s):E=i(C,t,d,O),Array.isArray(E))E.forEach(T=>{var P,D,z=zre(T),G=z==null?void 0:z.name,V=z==null?void 0:z.dataKey,ne=z==null?void 0:z.payload,ge=LE(LE({},j),{},{name:G,unit:z==null?void 0:z.unit,color:(P=z==null?void 0:z.color)!==null&&P!==void 0?P:j==null?void 0:j.color,fill:(D=z==null?void 0:z.fill)!==null&&D!==void 0?D:j==null?void 0:j.fill});x.push(A5({tooltipEntrySettings:ge,dataKey:V,payload:ne,value:kr(ne,V),name:G==null?void 0:String(G)}))});else{var A;x.push(A5({tooltipEntrySettings:j,dataKey:N,payload:E,value:kr(E,N),name:(A=kr(E,O))!==null&&A!==void 0?A:j==null?void 0:j.name}))}return x},m)}},Ok=Ae([Sa,kR,D_],bR),$re=Ae([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Ure=Ae([Ma,m0],fk),hu=Ae([$re,Sa,Ure],pk,{memoizeOptions:{resultEqualityCheck:Ey}}),Hre=Ae([hu],e=>e.filter(Cy)),o9=Ae([hu],mk,{memoizeOptions:{resultEqualityCheck:Ey}}),qre=Ae([hu],e=>e.some(t=>!t.data)),au=Ae([o9,ji],gk),Wre=Ae([Hre,ji,Sa],ID),Pk=Ae([au,Sa,hu,ji,qre,o9],ER),l9=Ae([Sa],yk),Vre=Ae([Sa],e=>e.allowDataOverflow),c9=Ae([l9,Vre],yD),Gre=Ae([hu],e=>e.filter(Cy)),Kre=Ae([Wre,Gre,Vh,OD],OR),Yre=Ae([Kre,ji,Ma,c9],PR),Xre=Ae([hu],NR),Jre=Ae([au,Sa,Xre,My,Ma,vQ],wk,{memoizeOptions:{resultEqualityCheck:Ty}}),Qre=Ae([DR,Ma,m0],v0),Zre=Ae([Qre,Ma],MR),eae=Ae([RR,Ma,m0],v0),tae=Ae([eae,Ma],LR),rae=Ae([FR,Ma,m0],v0),aae=Ae([rae,Ma],IR),nae=Ae([Zre,aae,tae],vx),sae=Ae([Sa,l9,c9,Yre,Jre,nae,ir,Ma],jk),a0=Ae([Sa,ir,au,Pk,Vh,Ma,sae],_k),iae=Ae([a0,Sa,Ok],Sk),oae=Ae([Sa,a0,iae,Ma],Ck),u9=e=>{var t=Ma(e),r=m0(e),a=!1;return Zh(e,t,r,a)},d9=Ae([Sa,u9],ky),lae=Ae([Sa,Ok,oae,d9],uk),f9=Ae([lae],B_),cae=Ae([ir,Pk,Sa,Ma],VR),uae=Ae([ir,Pk,Sa,Ma],$R),dae=(e,t,r,a,s,i,l,u)=>{if(t){var{type:d}=t,f=Bl(e,u);if(a){var p=r==="scaleBand"&&a.bandwidth?a.bandwidth()/2:2,m=d==="category"&&a.bandwidth?a.bandwidth()/p:0;return m=u==="angleAxis"&&s!=null&&(s==null?void 0:s.length)>=2?Oa(s[0]-s[1])*2*m:m,f&&l?l.map((x,v)=>{var b=a.map(x);return Kt(b)?{coordinate:b+m,value:x,index:v,offset:m}:null}).filter(In):a.domain().map((x,v)=>{var b=a.map(x);return Kt(b)?{coordinate:b+m,value:i?i[x]:x,index:v,offset:m}:null}).filter(In)}}},Go=Ae([ir,Sa,Ok,f9,u9,cae,uae,Ma],dae),Dk=Ae([KR,YR,mre],(e,t,r)=>XR(r.shared,e,t)),h9=e=>e.tooltip.settings.trigger,Rk=e=>e.tooltip.settings.defaultIndex,tp=Ae([b0,Dk,h9,Rk],r9),nu=Ae([tp,au,e0,a0],Kf),p9=Ae([Go,nu],JR),Fk=Ae([tp],e=>{if(e)return e.dataKey}),m9=Ae([tp],e=>{if(e)return e.graphicalItemId}),g9=Ae([b0,Dk,h9,Rk],n9),fae=Ae([Uo,Ho,ir,_a,Go,Rk,g9],a9),hae=Ae([tp,fae],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),pae=Ae([tp],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),mae=Ae([g9,nu,ji,e0,p9,s9,Dk],i9);Ae([mae],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function zE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function BE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zE(Object(r),!0).forEach(function(a){gae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zE(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function gae(e,t,r){return(t=xae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xae(e){var t=yae(e,"string");return typeof t=="symbol"?t:t+""}function yae(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vae=()=>mt(Sa),bae=()=>{var e=vae(),t=mt(Go),r=mt(f9);return Xg(!e||!r?void 0:BE(BE({},e),{},{scale:r}),t)};function $E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function hd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$E(Object(r),!0).forEach(function(a){wae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$E(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function wae(e,t,r){return(t=jae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jae(e){var t=_ae(e,"string");return typeof t=="symbol"?t:t+""}function _ae(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kae=(e,t,r,a)=>{var s=t.find(i=>i&&i.index===r);if(s){if(e==="horizontal")return{x:s.coordinate,y:a.relativeY};if(e==="vertical")return{x:a.relativeX,y:s.coordinate}}return{x:0,y:0}},Sae=(e,t,r,a)=>{var s=t.find(f=>f&&f.index===r);if(s){if(e==="centric"){var i=s.coordinate,{radius:l}=a;return hd(hd(hd({},a),la(a.cx,a.cy,l,i)),{},{angle:i,radius:l})}var u=s.coordinate,{angle:d}=a;return hd(hd(hd({},a),la(a.cx,a.cy,u,d)),{},{angle:d,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Nae(e,t){var{relativeX:r,relativeY:a}=e;return r>=t.left&&r<=t.left+t.width&&a>=t.top&&a<=t.top+t.height}var x9=(e,t,r,a,s)=>{var i,l=(i=t==null?void 0:t.length)!==null&&i!==void 0?i:0;if(l<=1||e==null)return 0;if(a==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var u=0;u<l;u++){var d,f,p,m,x,v=u>0?(d=r[u-1])===null||d===void 0?void 0:d.coordinate:(f=r[l-1])===null||f===void 0?void 0:f.coordinate,b=(p=r[u])===null||p===void 0?void 0:p.coordinate,w=u>=l-1?(m=r[0])===null||m===void 0?void 0:m.coordinate:(x=r[u+1])===null||x===void 0?void 0:x.coordinate,j=void 0;if(!(v==null||b==null||w==null))if(Oa(b-v)!==Oa(w-b)){var k=[];if(Oa(w-b)===Oa(s[1]-s[0])){j=w;var C=b+s[1]-s[0];k[0]=Math.min(C,(C+v)/2),k[1]=Math.max(C,(C+v)/2)}else{j=v;var N=w+s[1]-s[0];k[0]=Math.min(b,(N+b)/2),k[1]=Math.max(b,(N+b)/2)}var O=[Math.min(b,(j+b)/2),Math.max(b,(j+b)/2)];if(e>O[0]&&e<=O[1]||e>=k[0]&&e<=k[1]){var E;return(E=r[u])===null||E===void 0?void 0:E.index}}else{var A=Math.min(v,w),T=Math.max(v,w);if(e>(A+b)/2&&e<=(T+b)/2){var P;return(P=r[u])===null||P===void 0?void 0:P.index}}}else if(t)for(var D=0;D<l;D++){var z=t[D];if(z!=null){var G=t[D+1],V=t[D-1];if(D===0&&G!=null&&e<=(z.coordinate+G.coordinate)/2||D===l-1&&V!=null&&e>(z.coordinate+V.coordinate)/2||D>0&&D<l-1&&V!=null&&G!=null&&e>(z.coordinate+V.coordinate)/2&&e<=(z.coordinate+G.coordinate)/2)return z.index}}return-1},Cae=()=>mt(D_),Mk=(e,t)=>t,y9=(e,t,r)=>r,Lk=(e,t,r,a)=>a,Tae=Ae(Go,e=>ry(e,t=>t.coordinate)),Ik=Ae([b0,Mk,y9,Lk],r9),zk=Ae([Ik,au,e0,a0],Kf),Eae=(e,t,r)=>{if(t!=null){var a=b0(e);return t==="axis"?r==="hover"?a.axisInteraction.hover.dataKey:a.axisInteraction.click.dataKey:r==="hover"?a.itemInteraction.hover.dataKey:a.itemInteraction.click.dataKey}},v9=Ae([b0,Mk,y9,Lk],n9),wx=Ae([Uo,Ho,ir,_a,Go,Lk,v9],a9),Aae=Ae([Ik,wx],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),b9=Ae([Go,zk],JR),Oae=Ae([v9,zk,ji,e0,b9,s9,Mk],i9),Pae=Ae([Ik,zk],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Dae=(e,t,r,a,s,i,l)=>{if(!(!e||!r||!a||!s)&&Nae(e,l)){var u=bY(e,t),d=x9(u,i,s,r,a),f=kae(t,s,d,e);return{activeIndex:String(d),activeCoordinate:f}}},Rae=(e,t,r,a,s,i,l)=>{if(!(!e||!a||!s||!i||!r)){var u=iQ(e,r);if(u){var d=wY(u,t),f=x9(d,l,i,a,s),p=Sae(t,i,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},Fae=(e,t,r,a,s,i,l,u)=>{if(!(!e||!t||!a||!s||!i))return t==="horizontal"||t==="vertical"?Dae(e,t,a,s,i,l,u):Rae(e,t,r,a,s,i,l)},Mae=Ae(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var a=e[t];if(a!=null)return r?a.panoramaElement:a.element}}),Lae=Ae(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(a=>parseInt(a,10)).concat(Object.values(Xa)),r=Array.from(new Set(t));return r.sort((a,s)=>a-s)},{memoizeOptions:{resultEqualityCheck:DQ}});function UE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function HE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UE(Object(r),!0).forEach(function(a){Iae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UE(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Iae(e,t,r){return(t=zae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zae(e){var t=Bae(e,"string");return typeof t=="symbol"?t:t+""}function Bae(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $ae={},Uae={zIndexMap:Object.values(Xa).reduce((e,t)=>HE(HE({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),$ae)},Hae=new Set(Object.values(Xa));function qae(e){return Hae.has(e)}var w9=pn({name:"zIndex",initialState:Uae,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Er()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!qae(r)&&delete e.zIndexMap[r])},prepare:Er()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:a,isPanorama:s}=t.payload;e.zIndexMap[r]?s?e.zIndexMap[r].panoramaElement=a:e.zIndexMap[r].element=a:e.zIndexMap[r]={consumers:0,element:s?void 0:a,panoramaElement:s?a:void 0}},prepare:Er()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:Er()}}}),{registerZIndexPortal:Wae,unregisterZIndexPortal:X2,registerZIndexPortalElement:Vae,unregisterZIndexPortalElement:Gae}=w9.actions,Kae=w9.reducer;function _i(e){var{zIndex:t,children:r}=e,a=QY(),s=a&&t!==void 0&&t!==0,i=Wn(),l=y.useRef(void 0),u=y.useRef(new Set),d=wr(),f=mt(m=>Mae(m,t,i));if(y.useLayoutEffect(()=>{if(!s){var m=u.current;m.forEach(v=>{d(X2({zIndex:v}))}),m.clear(),l.current=void 0;return}if(u.current.has(t)||(d(Wae({zIndex:t})),u.current.add(t)),f){l.current=f;var x=u.current;x.forEach(v=>{v!==t&&(d(X2({zIndex:v})),x.delete(v))})}},[d,t,s,f]),y.useLayoutEffect(()=>{var m=u.current;return()=>{m.forEach(x=>{d(X2({zIndex:x}))}),m.clear()}},[d]),!s)return r;var p=f!=null?f:l.current;return p?Kx.createPortal(r,p):null}function Tj(){return Tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Tj.apply(null,arguments)}function qE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Wm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qE(Object(r),!0).forEach(function(a){Yae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qE(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Yae(e,t,r){return(t=Xae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xae(e){var t=Jae(e,"string");return typeof t=="symbol"?t:t+""}function Jae(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qae(e){var{cursor:t,cursorComp:r,cursorProps:a}=e;return y.isValidElement(t)?y.cloneElement(t,a):y.createElement(r,a)}function Zae(e){var t,{coordinate:r,payload:a,index:s,offset:i,tooltipAxisBandSize:l,layout:u,cursor:d,tooltipEventType:f,chartName:p}=e,m=r,x=a,v=s;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var b,w,j;if(p==="ScatterChart")b=m,w=wJ,j=Xa.cursorLine;else if(p==="BarChart")b=jJ(u,m,i,l),w=fD,j=Xa.cursorRectangle;else if(u==="radial"&&VP(m)){var{cx:k,cy:C,radius:N,startAngle:O,endAngle:E}=pD(m);b={cx:k,cy:C,startAngle:O,endAngle:E,innerRadius:N,outerRadius:N},w=gD,j=Xa.cursorLine}else b={points:uQ(u,m,i)},w=E_,j=Xa.cursorLine;var A=typeof d=="object"&&"className"in d?d.className:void 0,T=Wm(Wm(Wm(Wm({stroke:"#ccc",pointerEvents:"none"},i),b),oh(d)),{},{payload:x,payloadIndex:v,className:Wt("recharts-tooltip-cursor",A)});return y.createElement(_i,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},y.createElement(Qae,{cursor:d,cursorComp:w,cursorProps:T}))}function ene(e){var t=bae(),r=G7(),a=f0(),s=Cae();return t==null||r==null||a==null||s==null?null:y.createElement(Zae,Tj({},e,{offset:r,layout:a,tooltipAxisBandSize:t,chartName:s}))}var j9=y.createContext(null),tne=()=>y.useContext(j9),J2={exports:{}},WE;function rne(){return WE||(WE=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(r=!1));function s(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function i(d,f,p,m,x){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new s(p,m||d,x),b=r?r+f:f;return d._events[b]?d._events[b].fn?d._events[b]=[d._events[b],v]:d._events[b].push(v):(d._events[b]=v,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new a:delete d._events[f]}function u(){this._events=new a,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)t.call(p,m)&&f.push(r?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=r?r+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var x=0,v=m.length,b=new Array(v);x<v;x++)b[x]=m[x].fn;return b},u.prototype.listenerCount=function(f){var p=r?r+f:f,m=this._events[p];return m?m.fn?1:m.length:0},u.prototype.emit=function(f,p,m,x,v,b){var w=r?r+f:f;if(!this._events[w])return!1;var j=this._events[w],k=arguments.length,C,N;if(j.fn){switch(j.once&&this.removeListener(f,j.fn,void 0,!0),k){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,p),!0;case 3:return j.fn.call(j.context,p,m),!0;case 4:return j.fn.call(j.context,p,m,x),!0;case 5:return j.fn.call(j.context,p,m,x,v),!0;case 6:return j.fn.call(j.context,p,m,x,v,b),!0}for(N=1,C=new Array(k-1);N<k;N++)C[N-1]=arguments[N];j.fn.apply(j.context,C)}else{var O=j.length,E;for(N=0;N<O;N++)switch(j[N].once&&this.removeListener(f,j[N].fn,void 0,!0),k){case 1:j[N].fn.call(j[N].context);break;case 2:j[N].fn.call(j[N].context,p);break;case 3:j[N].fn.call(j[N].context,p,m);break;case 4:j[N].fn.call(j[N].context,p,m,x);break;default:if(!C)for(E=1,C=new Array(k-1);E<k;E++)C[E-1]=arguments[E];j[N].fn.apply(j[N].context,C)}}return!0},u.prototype.on=function(f,p,m){return i(this,f,p,m,!1)},u.prototype.once=function(f,p,m){return i(this,f,p,m,!0)},u.prototype.removeListener=function(f,p,m,x){var v=r?r+f:f;if(!this._events[v])return this;if(!p)return l(this,v),this;var b=this._events[v];if(b.fn)b.fn===p&&(!x||b.once)&&(!m||b.context===m)&&l(this,v);else{for(var w=0,j=[],k=b.length;w<k;w++)(b[w].fn!==p||x&&!b[w].once||m&&b[w].context!==m)&&j.push(b[w]);j.length?this._events[v]=j.length===1?j[0]:j:l(this,v)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=r?r+f:f,this._events[p]&&l(this,p)):(this._events=new a,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,e.exports=u})(J2)),J2.exports}var ane=rne();const nne=zl(ane);var wh=new nne,Ej="recharts.syncEvent.tooltip",VE="recharts.syncEvent.brush",_9=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Wi(r))return e[r]}},sne={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},k9=pn({name:"options",initialState:sne,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),ine=k9.reducer,{createEventEmitter:one}=k9.actions;function lne(e){return e.tooltip.syncInteraction}var cne={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},S9=pn({name:"chartData",initialState:cne,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:a}=t.payload;r!=null&&(e.dataStartIndex=r),a!=null&&(e.dataEndIndex=a)}}}),{setChartData:GE,setDataStartEndIndexes:une,setComputedData:lbe}=S9.actions,dne=S9.reducer,fne=["x","y"];function KE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function pd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KE(Object(r),!0).forEach(function(a){hne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KE(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function hne(e,t,r){return(t=pne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pne(e){var t=mne(e,"string");return typeof t=="symbol"?t:t+""}function mne(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gne(e,t){if(e==null)return{};var r,a,s=xne(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function xne(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function yne(){var e=mt(R_),t=mt(F_),r=wr(),a=mt(PD),s=mt(Go),i=f0(),l=xy(),u=mt(d=>d.rootProps.className);y.useEffect(()=>{if(e==null)return d0;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){r(Bf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(a==="index"){var x;if(l&&p!==null&&p!==void 0&&(x=p.payload)!==null&&x!==void 0&&x.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:b,y:w}=v,j=gne(v,fne),{x:k,y:C,width:N,height:O}=p.payload.sourceViewBox,E=pd(pd({},j),{},{x:l.x+(N?(b-k)/N:0)*l.width,y:l.y+(O?(w-C)/O:0)*l.height});r(pd(pd({},p),{},{payload:pd(pd({},p.payload),{},{coordinate:E})}))}else r(p);return}if(s!=null){var A;if(typeof a=="function"){var T={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},P=a(s,T);A=s[P]}else a==="value"&&(A=s.find(U=>String(U.value)===p.payload.label));var{coordinate:D}=p.payload;if(D==null||l==null){r(Bf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(A==null){r(Bf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:z,y:G}=D,V=Math.min(z,l.x+l.width),ne=Math.min(G,l.y+l.height),ge={x:i==="horizontal"?A.coordinate:V,y:i==="horizontal"?ne:A.coordinate},Z=Bf({active:p.payload.active,coordinate:ge,dataKey:p.payload.dataKey,index:String(A.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});r(Z)}}};return wh.on(Ej,d),()=>{wh.off(Ej,d)}},[u,r,t,e,a,s,i,l])}function vne(){var e=mt(R_),t=mt(F_),r=wr();y.useEffect(()=>{if(e==null)return d0;var a=(s,i,l)=>{t!==l&&e===s&&r(une(i))};return wh.on(VE,a),()=>{wh.off(VE,a)}},[r,t,e])}function bne(){var e=wr();y.useEffect(()=>{e(one())},[e]),yne(),vne()}function wne(e,t,r,a,s,i){var l=mt(b=>Eae(b,e,t)),u=mt(m9),d=mt(F_),f=mt(R_),p=mt(PD),m=mt(lne),x=(m==null?void 0:m.sourceViewBox)!=null,v=xy();y.useEffect(()=>{if(!x&&f!=null&&d!=null){var b=Bf({active:i,coordinate:r,dataKey:l,index:s,label:typeof a=="number"?String(a):a,sourceViewBox:v,graphicalItemId:u});wh.emit(Ej,f,b,d)}},[x,r,l,u,s,a,d,f,p,i,v])}function YE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function XE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YE(Object(r),!0).forEach(function(a){jne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YE(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function jne(e,t,r){return(t=_ne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _ne(e){var t=kne(e,"string");return typeof t=="symbol"?t:t+""}function kne(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sne(e){return e.dataKey}function Nne(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e=="function"?y.createElement(e,t):y.createElement(XX,t)}var JE=[],Cne={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function Vm(e){var t,r,a=Fa(e,Cne),{active:s,allowEscapeViewBox:i,animationDuration:l,animationEasing:u,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:x,position:v,reverseDirection:b,useTranslate3d:w,wrapperStyle:j,cursor:k,shared:C,trigger:N,defaultIndex:O,portal:E,axisId:A}=a,T=wr(),P=typeof O=="number"?String(O):O;y.useEffect(()=>{T(bre({shared:C,trigger:N,axisId:A,active:s,defaultIndex:P}))},[T,C,N,A,s,P]);var D=xy(),z=oD(),G=pre(C),{activeIndex:V,isActive:ne}=(t=mt(ie=>Pae(ie,G,N,P)))!==null&&t!==void 0?t:{},ge=mt(ie=>Oae(ie,G,N,P)),Z=mt(ie=>b9(ie,G,N,P)),U=mt(ie=>Aae(ie,G,N,P)),ce=ge,xe=tne(),be=(r=s!=null?s:ne)!==null&&r!==void 0?r:!1,[me,oe]=l7([ce,be]),L=G==="axis"?Z:void 0;wne(G,N,U,L,V,be);var H=E!=null?E:xe;if(H==null||D==null||G==null)return null;var K=ce!=null?ce:JE;be||(K=JE),f&&K.length&&(K=a7(K.filter(ie=>ie.value!=null&&(ie.hide!==!0||a.includeHidden)),x,Sne));var Y=K.length>0,re=XE(XE({},a),{},{payload:K,label:L,active:be,activeIndex:V,coordinate:U,accessibilityLayer:z}),de=y.createElement(oJ,{allowEscapeViewBox:i,animationDuration:l,animationEasing:u,isAnimationActive:p,active:be,coordinate:U,hasPayload:Y,offset:m,position:v,reverseDirection:b,useTranslate3d:w,viewBox:D,wrapperStyle:j,lastBoundingBox:me,innerRef:oe,hasPortalFromProps:!!E},Nne(d,re));return y.createElement(y.Fragment,null,Kx.createPortal(de,H),be&&y.createElement(ene,{cursor:k,tooltipEventType:G,coordinate:U,payload:K,index:V}))}var n0=e=>null;n0.displayName="Cell";function Tne(e,t,r){return(t=Ene(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ene(e){var t=Ane(e,"string");return typeof t=="symbol"?t:t+""}function Ane(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class One{constructor(t){Tne(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var a=this.cache.keys().next().value;a!=null&&this.cache.delete(a)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function QE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Pne(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QE(Object(r),!0).forEach(function(a){Dne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QE(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Dne(e,t,r){return(t=Rne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rne(e){var t=Fne(e,"string");return typeof t=="symbol"?t:t+""}function Fne(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mne={cacheSize:2e3,enableCache:!0},N9=Pne({},Mne),ZE=new One(N9.cacheSize),Lne={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},eA="recharts_measurement_span";function Ine(e,t){var r=t.fontSize||"",a=t.fontFamily||"",s=t.fontWeight||"",i=t.fontStyle||"",l=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(a,"|").concat(s,"|").concat(i,"|").concat(l,"|").concat(u)}var tA=(e,t)=>{try{var r=document.getElementById(eA);r||(r=document.createElement("span"),r.setAttribute("id",eA),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,Lne,t),r.textContent="".concat(e);var a=r.getBoundingClientRect();return{width:a.width,height:a.height}}catch(s){return{width:0,height:0}}},Yf=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||qh.isSsr)return{width:0,height:0};if(!N9.enableCache)return tA(t,r);var a=Ine(t,r),s=ZE.get(a);if(s)return s;var i=tA(t,r);return ZE.set(a,i),i},C9;function zne(e,t,r){return(t=Bne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bne(e){var t=$ne(e,"string");return typeof t=="symbol"?t:t+""}function $ne(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,aA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Une=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Hne=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,qne={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Wne=["cm","mm","pt","pc","in","Q","px"];function Vne(e){return Wne.includes(e)}var Pd="NaN";function Gne(e,t){return e*qne[t]}class qa{static parse(t){var r,[,a,s]=(r=Hne.exec(t))!==null&&r!==void 0?r:[];return a==null?qa.NaN:new qa(parseFloat(a),s!=null?s:"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Wi(t)&&(this.unit=""),r!==""&&!Une.test(r)&&(this.num=NaN,this.unit=""),Vne(r)&&(this.num=Gne(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new qa(NaN,""):new qa(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new qa(NaN,""):new qa(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new qa(NaN,""):new qa(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new qa(NaN,""):new qa(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Wi(this.num)}}C9=qa;zne(qa,"NaN",new C9(NaN,""));function T9(e){if(e==null||e.includes(Pd))return Pd;for(var t=e;t.includes("*")||t.includes("/");){var r,[,a,s,i]=(r=rA.exec(t))!==null&&r!==void 0?r:[],l=qa.parse(a!=null?a:""),u=qa.parse(i!=null?i:""),d=s==="*"?l.multiply(u):l.divide(u);if(d.isNaN())return Pd;t=t.replace(rA,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,x]=(f=aA.exec(t))!==null&&f!==void 0?f:[],v=qa.parse(p!=null?p:""),b=qa.parse(x!=null?x:""),w=m==="+"?v.add(b):v.subtract(b);if(w.isNaN())return Pd;t=t.replace(aA,w.toString())}return t}var nA=/\(([^()]*)\)/;function Kne(e){for(var t=e,r;(r=nA.exec(t))!=null;){var[,a]=r;t=t.replace(nA,T9(a))}return t}function Yne(e){var t=e.replace(/\s+/g,"");return t=Kne(t),t=T9(t),t}function Xne(e){try{return Yne(e)}catch(t){return Pd}}function Q2(e){var t=Xne(e.slice(5,-1));return t===Pd?"":t}var Jne=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Qne=["dx","dy","angle","className","breakAll"];function Aj(){return Aj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Aj.apply(null,arguments)}function sA(e,t){if(e==null)return{};var r,a,s=Zne(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Zne(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var E9=/[ \f\n\r\t\v\u2028\u2029]+/,A9=e=>{var{children:t,breakAll:r,style:a}=e;try{var s=[];ja(t)||(r?s=t.toString().split(""):s=t.toString().split(E9));var i=s.map(u=>({word:u,width:Yf(u,a).width})),l=r?0:Yf(" ",a).width;return{wordsWithComputedWidth:i,spaceWidth:l}}catch(u){return null}};function O9(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function ese(e){return ja(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var P9=(e,t,r,a)=>e.reduce((s,i)=>{var{word:l,width:u}=i,d=s[s.length-1];if(d&&u!=null&&(t==null||a||d.width+u+r<Number(t)))d.words.push(l),d.width+=u+r;else{var f={words:[l],width:u};s.push(f)}return s},[]),D9=e=>e.reduce((t,r)=>t.width>r.width?t:r),tse="…",iA=(e,t,r,a,s,i,l,u)=>{var d=e.slice(0,t),f=A9({breakAll:r,style:a,children:d+tse});if(!f)return[!1,[]];var p=P9(f.wordsWithComputedWidth,i,l,u),m=p.length>s||D9(p).width>Number(i);return[m,p]},rse=(e,t,r,a,s)=>{var{maxLines:i,children:l,style:u,breakAll:d}=e,f=pt(i),p=String(l),m=P9(t,a,r,s);if(!f||s)return m;var x=m.length>i||D9(m).width>Number(a);if(!x)return m;for(var v=0,b=p.length-1,w=0,j;v<=b&&w<=p.length-1;){var k=Math.floor((v+b)/2),C=k-1,[N,O]=iA(p,C,d,u,i,a,r,s),[E]=iA(p,k,d,u,i,a,r,s);if(!N&&!E&&(v=k+1),N&&E&&(b=k-1),!N&&E){j=O;break}w++}return j||m},oA=e=>{var t=ja(e)?[]:e.toString().split(E9);return[{words:t,width:void 0}]},ase=e=>{var{width:t,scaleToFit:r,children:a,style:s,breakAll:i,maxLines:l}=e;if((t||r)&&!qh.isSsr){var u,d,f=A9({breakAll:i,children:a,style:s});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return oA(a);return rse({breakAll:i,children:a,maxLines:l,style:s},u,d,t,!!r)}return oA(a)},R9="#808080",nse={angle:0,breakAll:!1,capHeight:"0.71em",fill:R9,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},By=y.forwardRef((e,t)=>{var r=Fa(e,nse),{x:a,y:s,lineHeight:i,capHeight:l,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=r,m=sA(r,Jne),x=y.useMemo(()=>ase({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:v,dy:b,angle:w,className:j,breakAll:k}=m,C=sA(m,Qne);if(!Vi(a)||!Vi(s)||x.length===0)return null;var N=Number(a)+(pt(v)?v:0),O=Number(s)+(pt(b)?b:0);if(!Kt(N)||!Kt(O))return null;var E;switch(p){case"start":E=Q2("calc(".concat(l,")"));break;case"middle":E=Q2("calc(".concat((x.length-1)/2," * -").concat(i," + (").concat(l," / 2))"));break;default:E=Q2("calc(".concat(x.length-1," * -").concat(i,")"));break}var A=[],T=x[0];if(d&&T!=null){var P=T.width,{width:D}=m;A.push("scale(".concat(pt(D)&&pt(P)?D/P:1,")"))}return w&&A.push("rotate(".concat(w,", ").concat(N,", ").concat(O,")")),A.length&&(C.transform=A.join(" ")),y.createElement("text",Aj({},Gs(C),{ref:t,x:N,y:O,className:Wt("recharts-text",j),textAnchor:f,fill:u.includes("url")?R9:u}),x.map((z,G)=>{var V=z.words.join(k?"":" ");return y.createElement("tspan",{x:N,dy:G===0?E:i,key:"".concat(V,"-").concat(G)},V)}))});By.displayName="Text";function lA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Ri(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lA(Object(r),!0).forEach(function(a){sse(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function sse(e,t,r){return(t=ise(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ise(e){var t=ose(e,"string");return typeof t=="symbol"?t:t+""}function ose(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lse=e=>{var{viewBox:t,position:r,offset:a=0,parentViewBox:s}=e,{x:i,y:l,height:u,upperWidth:d,lowerWidth:f}=k_(t),p=i,m=i+(d-f)/2,x=(p+m)/2,v=(d+f)/2,b=p+d/2,w=u>=0?1:-1,j=w*a,k=w>0?"end":"start",C=w>0?"start":"end",N=d>=0?1:-1,O=N*a,E=N>0?"end":"start",A=N>0?"start":"end",T=s;if(r==="top"){var P={x:p+d/2,y:l-j,horizontalAnchor:"middle",verticalAnchor:k};return T&&(P.height=Math.max(l-T.y,0),P.width=d),P}if(r==="bottom"){var D={x:m+f/2,y:l+u+j,horizontalAnchor:"middle",verticalAnchor:C};return T&&(D.height=Math.max(T.y+T.height-(l+u),0),D.width=f),D}if(r==="left"){var z={x:x-O,y:l+u/2,horizontalAnchor:E,verticalAnchor:"middle"};return T&&(z.width=Math.max(z.x-T.x,0),z.height=u),z}if(r==="right"){var G={x:x+v+O,y:l+u/2,horizontalAnchor:A,verticalAnchor:"middle"};return T&&(G.width=Math.max(T.x+T.width-G.x,0),G.height=u),G}var V=T?{width:v,height:u}:{};return r==="insideLeft"?Ri({x:x+O,y:l+u/2,horizontalAnchor:A,verticalAnchor:"middle"},V):r==="insideRight"?Ri({x:x+v-O,y:l+u/2,horizontalAnchor:E,verticalAnchor:"middle"},V):r==="insideTop"?Ri({x:p+d/2,y:l+j,horizontalAnchor:"middle",verticalAnchor:C},V):r==="insideBottom"?Ri({x:m+f/2,y:l+u-j,horizontalAnchor:"middle",verticalAnchor:k},V):r==="insideTopLeft"?Ri({x:p+O,y:l+j,horizontalAnchor:A,verticalAnchor:C},V):r==="insideTopRight"?Ri({x:p+d-O,y:l+j,horizontalAnchor:E,verticalAnchor:C},V):r==="insideBottomLeft"?Ri({x:m+O,y:l+u-j,horizontalAnchor:A,verticalAnchor:k},V):r==="insideBottomRight"?Ri({x:m+f-O,y:l+u-j,horizontalAnchor:E,verticalAnchor:k},V):r&&typeof r=="object"&&(pt(r.x)||Qc(r.x))&&(pt(r.y)||Qc(r.y))?Ri({x:i+on(r.x,v),y:l+on(r.y,u),horizontalAnchor:"end",verticalAnchor:"end"},V):Ri({x:b,y:l+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},V)},cse=["labelRef"],use=["content"];function cA(e,t){if(e==null)return{};var r,a,s=dse(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function dse(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function uA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function $f(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uA(Object(r),!0).forEach(function(a){fse(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function fse(e,t,r){return(t=hse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hse(e){var t=pse(e,"string");return typeof t=="symbol"?t:t+""}function pse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ko(){return ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},ko.apply(null,arguments)}var F9=y.createContext(null),mse=e=>{var{x:t,y:r,upperWidth:a,lowerWidth:s,width:i,height:l,children:u}=e,d=y.useMemo(()=>({x:t,y:r,upperWidth:a,lowerWidth:s,width:i,height:l}),[t,r,a,s,i,l]);return y.createElement(F9.Provider,{value:d},u)},M9=()=>{var e=y.useContext(F9),t=xy();return e||(t?k_(t):void 0)},gse=y.createContext(null),xse=()=>{var e=y.useContext(gse),t=mt(LD);return e||t},yse=e=>{var{value:t,formatter:r}=e,a=ja(e.children)?t:e.children;return typeof r=="function"?r(a):a},Bk=e=>e!=null&&typeof e=="function",vse=(e,t)=>{var r=Oa(t-e),a=Math.min(Math.abs(t-e),360);return r*a},bse=(e,t,r,a,s)=>{var{offset:i,className:l}=e,{cx:u,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:x,clockWise:v}=s,b=(f+p)/2,w=vse(m,x),j=w>=0?1:-1,k,C;switch(t){case"insideStart":k=m+j*i,C=v;break;case"insideEnd":k=x-j*i,C=!v;break;case"end":k=x+j*i,C=v;break;default:throw new Error("Unsupported position ".concat(t))}C=w<=0?C:!C;var N=la(u,d,b,k),O=la(u,d,b,k+(C?1:-1)*359),E="M".concat(N.x,",").concat(N.y,`
A`).concat(b,",").concat(b,",0,1,").concat(C?0:1,`,
`).concat(O.x,",").concat(O.y),A=ja(e.id)?lh("recharts-radial-line-"):e.id;return y.createElement("text",ko({},a,{dominantBaseline:"central",className:Wt("recharts-radial-bar-label",l)}),y.createElement("defs",null,y.createElement("path",{id:A,d:E})),y.createElement("textPath",{xlinkHref:"#".concat(A)},r))},wse=(e,t,r)=>{var{cx:a,cy:s,innerRadius:i,outerRadius:l,startAngle:u,endAngle:d}=e,f=(u+d)/2;if(r==="outside"){var{x:p,y:m}=la(a,s,l+t,f);return{x:p,y:m,textAnchor:p>=a?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var x=(i+l)/2,{x:v,y:b}=la(a,s,x,f);return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},jg=e=>e!=null&&"cx"in e&&pt(e.cx),jse={angle:0,offset:5,zIndex:Xa.label,position:"middle",textBreakAll:!1};function _se(e){if(!jg(e))return e;var{cx:t,cy:r,outerRadius:a}=e,s=a*2;return{x:t-a,y:r-a,width:s,upperWidth:s,lowerWidth:s,height:s}}function Nl(e){var t=Fa(e,jse),{viewBox:r,parentViewBox:a,position:s,value:i,children:l,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=xse(),x=M9(),v=s==="center"?x:m!=null?m:x,b,w,j;r==null?b=v:jg(r)?b=r:b=k_(r);var k=_se(b);if(!b||ja(i)&&ja(l)&&!y.isValidElement(u)&&typeof u!="function")return null;var C=$f($f({},t),{},{viewBox:b});if(y.isValidElement(u)){var{labelRef:N}=C,O=cA(C,cse);return y.cloneElement(u,O)}if(typeof u=="function"){var{content:E}=C,A=cA(C,use);if(w=y.createElement(u,A),y.isValidElement(w))return w}else w=yse(t);var T=Gs(t);if(jg(b)){if(s==="insideStart"||s==="insideEnd"||s==="end")return bse(t,s,w,T,b);j=wse(b,t.offset,t.position)}else{if(!k)return null;var P=lse({viewBox:k,position:s,offset:t.offset,parentViewBox:jg(a)?void 0:a});j=$f($f({x:P.x,y:P.y,textAnchor:P.horizontalAnchor,verticalAnchor:P.verticalAnchor},P.width!==void 0?{width:P.width}:{}),P.height!==void 0?{height:P.height}:{})}return y.createElement(_i,{zIndex:t.zIndex},y.createElement(By,ko({ref:p,className:Wt("recharts-label",d)},T,j,{textAnchor:O9(T.textAnchor)?T.textAnchor:j.textAnchor,breakAll:f}),w))}Nl.displayName="Label";var kse=(e,t,r)=>{if(!e)return null;var a={viewBox:t,labelRef:r};return e===!0?y.createElement(Nl,ko({key:"label-implicit"},a)):Vi(e)?y.createElement(Nl,ko({key:"label-implicit",value:e},a)):y.isValidElement(e)?e.type===Nl?y.cloneElement(e,$f({key:"label-implicit"},a)):y.createElement(Nl,ko({key:"label-implicit",content:e},a)):Bk(e)?y.createElement(Nl,ko({key:"label-implicit",content:e},a)):e&&typeof e=="object"?y.createElement(Nl,ko({},e,{key:"label-implicit"},a)):null};function Sse(e){var{label:t,labelRef:r}=e,a=M9();return kse(t,a,r)||null}var Nse=["valueAccessor"],Cse=["dataKey","clockWise","id","textBreakAll","zIndex"];function jx(){return jx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},jx.apply(null,arguments)}function dA(e,t){if(e==null)return{};var r,a,s=Tse(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Tse(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var Ese=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(ese(t))return t},L9=y.createContext(void 0),Ase=L9.Provider,I9=y.createContext(void 0),Ose=I9.Provider;function Pse(){return y.useContext(L9)}function Dse(){return y.useContext(I9)}function Hd(e){var{valueAccessor:t=Ese}=e,r=dA(e,Nse),{dataKey:a,clockWise:s,id:i,textBreakAll:l,zIndex:u}=r,d=dA(r,Cse),f=Pse(),p=Dse(),m=f||p;return!m||!m.length?null:y.createElement(_i,{zIndex:u!=null?u:Xa.label},y.createElement(un,{className:"recharts-label-list"},m.map((x,v)=>{var b,w=ja(a)?t(x,v):kr(x.payload,a),j=ja(i)?{}:{id:"".concat(i,"-").concat(v)};return y.createElement(Nl,jx({key:"label-".concat(v)},Gs(x),d,j,{fill:(b=r.fill)!==null&&b!==void 0?b:x.fill,parentViewBox:x.parentViewBox,value:w,textBreakAll:l,viewBox:x.viewBox,index:v,zIndex:0}))})))}Hd.displayName="LabelList";function z9(e){var{label:t}=e;return t?t===!0?y.createElement(Hd,{key:"labelList-implicit"}):y.isValidElement(t)||Bk(t)?y.createElement(Hd,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(Hd,jx({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var B9=e=>e.graphicalItems.polarItems,Rse=Ae([$r,Gh],fk),$y=Ae([B9,Yr,Rse],pk),Fse=Ae([$y],mk),Uy=Ae([Fse,Wh],gk),Mse=Ae([Uy,Yr,$y],TR);Ae([Uy,Yr,$y],(e,t,r)=>r.length>0?e.flatMap(a=>r.flatMap(s=>{var i,l=kr(a,(i=t.dataKey)!==null&&i!==void 0?i:s.dataKey);return{value:l,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(a=>({value:kr(a,t.dataKey),errorDomain:[]})):e.map(a=>({value:a,errorDomain:[]})));var fA=()=>{},Lse=Ae([Uy,Yr,$y,My,$r,yQ],wk),Ise=Ae([Yr,vk,bk,fA,Lse,fA,ir,$r],jk),$9=Ae([Yr,ir,Uy,Mse,Vh,$r,Ise],_k),zse=Ae([$9,x0,Hl],Sk),Bse=Ae([Yr,$9,zse,$r],Ck);Ae([Hl,Bse],zD);var $se={radiusAxis:{},angleAxis:{}},U9=pn({name:"polarAxis",initialState:$se,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:cbe,removeRadiusAxis:ube,addAngleAxis:dbe,removeAngleAxis:fbe}=U9.actions,Use=U9.reducer;function H9(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function hA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function pA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hA(Object(r),!0).forEach(function(a){Hse(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Hse(e,t,r){return(t=qse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qse(e){var t=Wse(e,"string");return typeof t=="symbol"?t:t+""}function Wse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vse=(e,t)=>t,$k=Ae([B9,Vse],(e,t)=>e.filter(r=>r.type==="pie").find(r=>r.id===t)),Gse=[],Uk=(e,t,r)=>(r==null?void 0:r.length)===0?Gse:r,q9=Ae([Wh,$k,Uk],(e,t,r)=>{var{chartData:a}=e;if(t!=null){var s;if((t==null?void 0:t.data)!=null&&t.data.length>0?s=t.data:s=a,(!s||!s.length)&&r!=null&&(s=r.map(i=>pA(pA({},t.presentationProps),i.props))),s!=null)return s}}),Kse=Ae([q9,$k,Uk],(e,t,r)=>{if(!(e==null||t==null))return e.map((a,s)=>{var i,l=kr(a,t.nameKey,t.name),u;return r!=null&&(i=r[s])!==null&&i!==void 0&&(i=i.props)!==null&&i!==void 0&&i.fill?u=r[s].props.fill:typeof a=="object"&&a!=null&&"fill"in a?u=a.fill:u=t.fill,{value:fy(l,t.dataKey),color:u,payload:a,type:t.legendType}})}),Yse=Ae([q9,$k,Uk,_a],(e,t,r,a)=>{if(!(t==null||e==null))return toe({offset:a,pieSettings:t,displayedData:e,cells:r})}),Z2={exports:{}},vr={};var mA;function Xse(){if(mA)return vr;mA=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),x=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function b(w){if(typeof w=="object"&&w!==null){var j=w.$$typeof;switch(j){case e:switch(w=w.type,w){case r:case s:case a:case d:case f:case x:return w;default:switch(w=w&&w.$$typeof,w){case l:case u:case m:case p:return w;case i:return w;default:return j}}case t:return j}}}return vr.ContextConsumer=i,vr.ContextProvider=l,vr.Element=e,vr.ForwardRef=u,vr.Fragment=r,vr.Lazy=m,vr.Memo=p,vr.Portal=t,vr.Profiler=s,vr.StrictMode=a,vr.Suspense=d,vr.SuspenseList=f,vr.isContextConsumer=function(w){return b(w)===i},vr.isContextProvider=function(w){return b(w)===l},vr.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},vr.isForwardRef=function(w){return b(w)===u},vr.isFragment=function(w){return b(w)===r},vr.isLazy=function(w){return b(w)===m},vr.isMemo=function(w){return b(w)===p},vr.isPortal=function(w){return b(w)===t},vr.isProfiler=function(w){return b(w)===s},vr.isStrictMode=function(w){return b(w)===a},vr.isSuspense=function(w){return b(w)===d},vr.isSuspenseList=function(w){return b(w)===f},vr.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===r||w===s||w===a||w===d||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===p||w.$$typeof===l||w.$$typeof===i||w.$$typeof===u||w.$$typeof===v||w.getModuleId!==void 0)},vr.typeOf=b,vr}var gA;function Jse(){return gA||(gA=1,Z2.exports=Xse()),Z2.exports}var Qse=Jse(),xA=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",yA=null,ew=null,W9=e=>{if(e===yA&&Array.isArray(ew))return ew;var t=[];return y.Children.forEach(e,r=>{ja(r)||(Qse.isFragment(r)?t=t.concat(W9(r.props.children)):t.push(r))}),ew=t,yA=e,t};function Hk(e,t){var r=[],a=[];return Array.isArray(t)?a=t.map(s=>xA(s)):a=[xA(t)],W9(e).forEach(s=>{var i=Jc(s,"type.displayName")||Jc(s,"type.name");i&&a.indexOf(i)!==-1&&r.push(s)}),r}var tw={},vA;function Zse(){if(vA)return tw;vA=1;function e(t){var a;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const s=t[Symbol.toStringTag];return s==null||!((a=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&a.writable)?!1:t.toString()===`[object ${s}]`}let r=t;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(t)===r}return tw.isPlainObject=e,tw}var rw,bA;function eie(){return bA||(bA=1,rw=Zse().isPlainObject),rw}var tie=eie();const rie=zl(tie);var wA,jA,_A,kA,SA;function NA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function CA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?NA(Object(r),!0).forEach(function(a){aie(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function aie(e,t,r){return(t=nie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nie(e){var t=sie(e,"string");return typeof t=="symbol"?t:t+""}function sie(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _x(){return _x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_x.apply(null,arguments)}function Tf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var TA=(e,t,r,a,s)=>{var i=r-a,l;return l=Wr(wA||(wA=Tf(["M ",",",""])),e,t),l+=Wr(jA||(jA=Tf(["L ",",",""])),e+r,t),l+=Wr(_A||(_A=Tf(["L ",",",""])),e+r-i/2,t+s),l+=Wr(kA||(kA=Tf(["L ",",",""])),e+r-i/2-a,t+s),l+=Wr(SA||(SA=Tf(["L ",","," Z"])),e,t),l},iie={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},oie=e=>{var t=Fa(e,iie),{x:r,y:a,upperWidth:s,lowerWidth:i,height:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isUpdateAnimationActive:m}=t,x=y.useRef(null),[v,b]=y.useState(-1),w=y.useRef(s),j=y.useRef(i),k=y.useRef(l),C=y.useRef(r),N=y.useRef(a),O=jy(e,"trapezoid-");if(y.useEffect(()=>{if(x.current&&x.current.getTotalLength)try{var ge=x.current.getTotalLength();ge&&b(ge)}catch(Z){}},[]),r!==+r||a!==+a||s!==+s||i!==+i||l!==+l||s===0&&i===0||l===0)return null;var E=Wt("recharts-trapezoid",u);if(!m)return y.createElement("g",null,y.createElement("path",_x({},Gs(t),{className:E,d:TA(r,a,s,i,l)})));var A=w.current,T=j.current,P=k.current,D=C.current,z=N.current,G="0px ".concat(v===-1?1:v,"px"),V="".concat(v,"px ").concat(v,"px"),ne=lD(["strokeDasharray"],f,d);return y.createElement(wy,{animationId:O,key:O,canBegin:v>0,duration:f,easing:d,isActive:m,begin:p},ge=>{var Z=ba(A,s,ge),U=ba(T,i,ge),ce=ba(P,l,ge),xe=ba(D,r,ge),be=ba(z,a,ge);x.current&&(w.current=Z,j.current=U,k.current=ce,C.current=xe,N.current=be);var me=ge>0?{transition:ne,strokeDasharray:V}:{strokeDasharray:G};return y.createElement("path",_x({},Gs(t),{className:E,d:TA(xe,be,Z,U,ce),ref:x,style:CA(CA({},me),t.style)}))})},lie=["option","shapeType","activeClassName","inActiveClassName"];function cie(e,t){if(e==null)return{};var r,a,s=uie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function uie(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function EA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function kx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?EA(Object(r),!0).forEach(function(a){die(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function die(e,t,r){return(t=fie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fie(e){var t=hie(e,"string");return typeof t=="symbol"?t:t+""}function hie(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pie(e,t){return kx(kx({},t),e)}function mie(e,t){return e==="symbols"}function AA(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return y.createElement(fD,r);case"trapezoid":return y.createElement(oie,r);case"sector":return y.createElement(gD,r);case"symbols":if(mie(t))return y.createElement(h_,r);break;case"curve":return y.createElement(E_,r);default:return null}}function gie(e){return y.isValidElement(e)?e.props:e}function V9(e){var{option:t,shapeType:r,activeClassName:a="recharts-active-shape",inActiveClassName:s="recharts-shape"}=e,i=cie(e,lie),l;if(y.isValidElement(t))l=y.cloneElement(t,kx(kx({},i),gie(t)));else if(typeof t=="function")l=t(i,i.index);else if(rie(t)&&typeof t!="boolean"){var u=pie(t,i);l=y.createElement(AA,{shapeType:r,elementProps:u})}else{var d=i;l=y.createElement(AA,{shapeType:r,elementProps:d})}return i.isActive?y.createElement(un,{className:a},l):y.createElement(un,{className:s},l)}var qk=(e,t,r)=>{var a=wr();return(s,i)=>l=>{e==null||e(s,i,l),a(ZR({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}},Wk=e=>{var t=wr();return(r,a)=>s=>{e==null||e(r,a,s),t(wre())}},Vk=(e,t,r)=>{var a=wr();return(s,i)=>l=>{e==null||e(s,i,l),a(jre({activeIndex:String(i),activeDataKey:t,activeCoordinate:s.tooltipPosition,activeGraphicalItemId:r}))}};function G9(e){var{tooltipEntrySettings:t}=e,r=wr(),a=Wn(),s=y.useRef(null);return y.useLayoutEffect(()=>{a||(s.current===null?r(xre(t)):s.current!==t&&r(yre({prev:s.current,next:t})),s.current=t)},[t,r,a]),y.useLayoutEffect(()=>()=>{s.current&&(r(vre(s.current)),s.current=null)},[r]),null}function xie(e){var{legendPayload:t}=e,r=wr(),a=Wn(),s=y.useRef(null);return y.useLayoutEffect(()=>{a||(s.current===null?r(aD(t)):s.current!==t&&r(nD({prev:s.current,next:t})),s.current=t)},[r,a,t]),y.useLayoutEffect(()=>()=>{s.current&&(r(sD(s.current)),s.current=null)},[r]),null}function yie(e){var{legendPayload:t}=e,r=wr(),a=mt(ir),s=y.useRef(null);return y.useLayoutEffect(()=>{a!=="centric"&&a!=="radial"||(s.current===null?r(aD(t)):s.current!==t&&r(nD({prev:s.current,next:t})),s.current=t)},[r,a,t]),y.useLayoutEffect(()=>()=>{s.current&&(r(sD(s.current)),s.current=null)},[r]),null}var aw,vie=()=>{var[e]=y.useState(()=>lh("uid-"));return e},bie=(aw=$z.useId)!==null&&aw!==void 0?aw:vie;function wie(e,t){var r=bie();return t||(e?"".concat(e,"-").concat(r):r)}var jie=y.createContext(void 0),K9=e=>{var{id:t,type:r,children:a}=e,s=wie("recharts-".concat(r),t);return y.createElement(jie.Provider,{value:s},a(s))},_ie={cartesianItems:[],polarItems:[]},Y9=pn({name:"graphicalItems",initialState:_ie,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Er()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:a}=t.payload,s=$s(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=a)},prepare:Er()},removeCartesianGraphicalItem:{reducer(e,t){var r=$s(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:Er()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Er()},removePolarGraphicalItem:{reducer(e,t){var r=$s(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:Er()},replacePolarGraphicalItem:{reducer(e,t){var{prev:r,next:a}=t.payload,s=$s(e).polarItems.indexOf(r);s>-1&&(e.polarItems[s]=a)},prepare:Er()}}}),{addCartesianGraphicalItem:kie,replaceCartesianGraphicalItem:Sie,removeCartesianGraphicalItem:Nie,addPolarGraphicalItem:Cie,removePolarGraphicalItem:Tie,replacePolarGraphicalItem:Eie}=Y9.actions,Aie=Y9.reducer,Oie=e=>{var t=wr(),r=y.useRef(null);return y.useLayoutEffect(()=>{r.current===null?t(kie(e)):r.current!==e&&t(Sie({prev:r.current,next:e})),r.current=e},[t,e]),y.useLayoutEffect(()=>()=>{r.current&&(t(Nie(r.current)),r.current=null)},[t]),null},Pie=y.memo(Oie),Die=e=>{var t=wr(),r=y.useRef(null);return y.useLayoutEffect(()=>{r.current===null?t(Cie(e)):r.current!==e&&t(Eie({prev:r.current,next:e})),r.current=e},[t,e]),y.useLayoutEffect(()=>()=>{r.current&&(t(Tie(r.current)),r.current=null)},[t]),null},Rie=y.memo(Die),Fie=["key"],Mie=["onMouseEnter","onClick","onMouseLeave"],Lie=["id"],Iie=["id"];function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Rl.apply(null,arguments)}function Hy(e,t){if(e==null)return{};var r,a,s=zie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function zie(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function OA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Rr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OA(Object(r),!0).forEach(function(a){Bie(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Bie(e,t,r){return(t=$ie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $ie(e){var t=Uie(e,"string");return typeof t=="symbol"?t:t+""}function Uie(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hie(e){var t=y.useMemo(()=>Hk(e.children,n0),[e.children]),r=mt(a=>Kse(a,e.id,t));return r==null?null:y.createElement(yie,{legendPayload:r})}function qie(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(y.isValidElement(e)){var t,r=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof r=="string"?r:void 0}var{fill:a}=e;return typeof a=="string"?a:void 0}}var Wie=y.memo(e=>{var{dataKey:t,nameKey:r,sectors:a,stroke:s,strokeWidth:i,fill:l,name:u,hide:d,tooltipType:f,id:p,activeShape:m}=e,x=qie(m),v=a.map(w=>{var j=w.tooltipPayload;return x==null||j==null?j:j.map(k=>Rr(Rr({},k),{},{color:x,fill:x}))}),b={dataDefinedOnItem:v,getPosition:w=>{var j;return(j=a[Number(w)])===null||j===void 0?void 0:j.tooltipPosition},settings:{stroke:s,strokeWidth:i,fill:l,dataKey:t,nameKey:r,name:fy(u,t),hide:d,type:f,color:l,unit:"",graphicalItemId:p}};return y.createElement(G9,{tooltipEntrySettings:b})}),Vie=(e,t)=>e>t?"start":e<t?"end":"middle",Gie=(e,t,r)=>on(typeof t=="function"?t(e):t,r,r*.8),Kie=(e,t,r)=>{var{top:a,left:s,width:i,height:l}=t,u=hD(i,l),d=s+on(e.cx,i,i/2),f=a+on(e.cy,l,l/2),p=on(e.innerRadius,u,0),m=Gie(r,e.outerRadius,u),x=e.maxRadius||Math.sqrt(i*i+l*l)/2;return{cx:d,cy:f,innerRadius:p,outerRadius:m,maxRadius:x}},Yie=(e,t)=>{var r=Oa(t-e),a=Math.min(Math.abs(t-e),360);return r*a},Xie=(e,t)=>{if(y.isValidElement(e))return y.cloneElement(e,t);if(typeof e=="function")return e(t);var r=Wt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:a}=t,s=Hy(t,Fie);return y.createElement(E_,Rl({},s,{type:"linear",className:r}))},Jie=(e,t,r)=>{if(y.isValidElement(e))return y.cloneElement(e,t);var a=r;if(typeof e=="function"&&(a=e(t),y.isValidElement(a)))return a;var s=Wt("recharts-pie-label-text",H9(e));return y.createElement(By,Rl({},t,{alignmentBaseline:"middle",className:s}),a)};function Qie(e){var{sectors:t,props:r,showLabels:a}=e,{label:s,labelLine:i,dataKey:l}=r;if(!a||!s||!t)return null;var u=yi(r),d=oh(s),f=oh(i),p=typeof s=="object"&&"offsetRadius"in s&&typeof s.offsetRadius=="number"&&s.offsetRadius||20,m=t.map((x,v)=>{var b=(x.startAngle+x.endAngle)/2,w=la(x.cx,x.cy,x.outerRadius+p,b),j=Rr(Rr(Rr(Rr({},u),x),{},{stroke:"none"},d),{},{index:v,textAnchor:Vie(w.x,x.cx)},w),k=Rr(Rr(Rr(Rr({},u),x),{},{fill:"none",stroke:x.fill},f),{},{index:v,points:[la(x.cx,x.cy,x.outerRadius,b),w],key:"line"});return y.createElement(_i,{zIndex:Xa.label,key:"label-".concat(x.startAngle,"-").concat(x.endAngle,"-").concat(x.midAngle,"-").concat(v)},y.createElement(un,null,i&&Xie(i,k),Jie(s,j,kr(x,l))))});return y.createElement(un,{className:"recharts-pie-labels"},m)}function Zie(e){var{sectors:t,props:r,showLabels:a}=e,{label:s}=r;return typeof s=="object"&&s!=null&&"position"in s?y.createElement(z9,{label:s}):y.createElement(Qie,{sectors:t,props:r,showLabels:a})}function eoe(e){var{sectors:t,activeShape:r,inactiveShape:a,allOtherPieProps:s,shape:i,id:l}=e,u=mt(nu),d=mt(Fk),f=mt(m9),{onMouseEnter:p,onClick:m,onMouseLeave:x}=s,v=Hy(s,Mie),b=qk(p,s.dataKey,l),w=Wk(x),j=Vk(m,s.dataKey,l);return t==null||t.length===0?null:y.createElement(y.Fragment,null,t.map((k,C)=>{if((k==null?void 0:k.startAngle)===0&&(k==null?void 0:k.endAngle)===0&&t.length!==1)return null;var N=f==null||f===l,O=String(C)===u&&(d==null||s.dataKey===d)&&N,E=u?a:null,A=r&&O?r:E,T=Rr(Rr({},k),{},{stroke:k.stroke,tabIndex:-1,[U7]:C,[H7]:l});return y.createElement(un,Rl({key:"sector-".concat(k==null?void 0:k.startAngle,"-").concat(k==null?void 0:k.endAngle,"-").concat(k.midAngle,"-").concat(C),tabIndex:-1,className:"recharts-pie-sector"},Lh(v,k,C),{onMouseEnter:b(k,C),onMouseLeave:w(k,C),onClick:j(k,C)}),y.createElement(V9,Rl({option:i!=null?i:A,index:C,shapeType:"sector",isActive:O},T)))}))}function toe(e){var t,{pieSettings:r,displayedData:a,cells:s,offset:i}=e,{cornerRadius:l,startAngle:u,endAngle:d,dataKey:f,nameKey:p,tooltipType:m}=r,x=Math.abs(r.minAngle),v=Yie(u,d),b=Math.abs(v),w=a.length<=1?0:(t=r.paddingAngle)!==null&&t!==void 0?t:0,j=a.filter(P=>kr(P,f,0)!==0).length,k=(b>=360?j:j-1)*w,C=a.reduce((P,D)=>{var z=kr(D,f,0);return P+(pt(z)?z:0)},0),N=x>0&&C>0&&a.some(P=>{var D=kr(P,f,0),z=(pt(D)?D:0)/C;return D!==0&&z*b<x}),O=N?x:0,E=b-j*O-k,A;if(C>0){var T;A=a.map((P,D)=>{var z=kr(P,f,0),G=kr(P,p,D),V=Kie(r,i,P),ne=(pt(z)?z:0)/C,ge,Z=Rr(Rr({},P),s&&s[D]&&s[D].props),U=Z!=null&&"fill"in Z&&typeof Z.fill=="string"?Z.fill:r.fill;D?ge=T.endAngle+Oa(v)*w*(z!==0?1:0):ge=u;var ce=ge+Oa(v)*((z!==0?O:0)+ne*E),xe=(ge+ce)/2,be=(V.innerRadius+V.outerRadius)/2,me=[{name:G,value:z,payload:Z,dataKey:f,type:m,color:U,fill:U,graphicalItemId:r.id}],oe=la(V.cx,V.cy,be,xe);return T=Rr(Rr(Rr(Rr({},r.presentationProps),{},{percent:ne,cornerRadius:typeof l=="string"?parseFloat(l):l,name:G,tooltipPayload:me,midAngle:xe,middleRadius:be,tooltipPosition:oe},Z),V),{},{value:z,dataKey:f,startAngle:ge,endAngle:ce,payload:Z,paddingAngle:z!==0?Oa(v)*w:0}),T})}return A}function roe(e){var{showLabels:t,sectors:r,children:a}=e,s=y.useMemo(()=>!t||!r?[]:r.map(i=>({value:i.value,payload:i.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:i.cx,cy:i.cy,innerRadius:i.innerRadius,outerRadius:i.outerRadius,startAngle:i.startAngle,endAngle:i.endAngle,clockWise:!1},fill:i.fill})),[r,t]);return y.createElement(Ose,{value:t?s:void 0},a)}function aoe(e){var{props:t,previousSectorsRef:r,id:a}=e,{sectors:s,isAnimationActive:i,animationBegin:l,animationDuration:u,animationEasing:d,activeShape:f,inactiveShape:p,onAnimationStart:m,onAnimationEnd:x}=t,v=jy(t,"recharts-pie-"),b=r.current,[w,j]=y.useState(!1),k=y.useCallback(()=>{typeof x=="function"&&x(),j(!1)},[x]),C=y.useCallback(()=>{typeof m=="function"&&m(),j(!0)},[m]);return y.createElement(roe,{showLabels:!w,sectors:s},y.createElement(wy,{animationId:v,begin:l,duration:u,isActive:i,easing:d,onAnimationStart:C,onAnimationEnd:k,key:v},N=>{var O,E=[],A=s&&s[0],T=(O=A==null?void 0:A.startAngle)!==null&&O!==void 0?O:0;return s==null||s.forEach((P,D)=>{var z=b&&b[D],G=D>0?Jc(P,"paddingAngle",0):0;if(z){var V=ba(z.endAngle-z.startAngle,P.endAngle-P.startAngle,N),ne=Rr(Rr({},P),{},{startAngle:T+G,endAngle:T+V+G});E.push(ne),T=ne.endAngle}else{var{endAngle:ge,startAngle:Z}=P,U=ba(0,ge-Z,N),ce=Rr(Rr({},P),{},{startAngle:T+G,endAngle:T+U+G});E.push(ce),T=ce.endAngle}}),r.current=E,y.createElement(un,null,y.createElement(eoe,{sectors:E,activeShape:f,inactiveShape:p,allOtherPieProps:t,shape:t.shape,id:a}))}),y.createElement(Zie,{showLabels:!w,sectors:s,props:t}),t.children)}var noe={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Xa.area};function soe(e){var{id:t}=e,r=Hy(e,Lie),{hide:a,className:s,rootTabIndex:i}=e,l=y.useMemo(()=>Hk(e.children,n0),[e.children]),u=mt(p=>Yse(p,t,l)),d=y.useRef(null),f=Wt("recharts-pie",s);return a||u==null?(d.current=null,y.createElement(un,{tabIndex:i,className:f})):y.createElement(_i,{zIndex:e.zIndex},y.createElement(Wie,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:u,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),y.createElement(un,{tabIndex:i,className:f},y.createElement(aoe,{props:Rr(Rr({},r),{},{sectors:u}),previousSectorsRef:d,id:t})))}function ioe(e){var t=Fa(e,noe),{id:r}=t,a=Hy(t,Iie),s=yi(a);return y.createElement(K9,{id:r,type:"pie"},i=>y.createElement(y.Fragment,null,y.createElement(Rie,{type:"pie",id:i,data:a.data,dataKey:a.dataKey,hide:a.hide,angleAxisId:0,radiusAxisId:0,name:a.name,nameKey:a.nameKey,tooltipType:a.tooltipType,legendType:a.legendType,fill:a.fill,cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,paddingAngle:a.paddingAngle,minAngle:a.minAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius,cornerRadius:a.cornerRadius,presentationProps:s,maxRadius:t.maxRadius}),y.createElement(Hie,Rl({},a,{id:i})),y.createElement(soe,Rl({},a,{id:i}))))}var X9=ioe;X9.displayName="Pie";function PA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function DA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PA(Object(r),!0).forEach(function(a){ooe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ooe(e,t,r){return(t=loe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function loe(e){var t=coe(e,"string");return typeof t=="symbol"?t:t+""}function coe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J9=0,uoe={xAxis:{},yAxis:{},zAxis:{}},Q9=pn({name:"cartesianAxis",initialState:uoe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Er()},replaceXAxis:{reducer(e,t){var{prev:r,next:a}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==a.id&&delete e.xAxis[r.id],e.xAxis[a.id]=a)},prepare:Er()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Er()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Er()},replaceYAxis:{reducer(e,t){var{prev:r,next:a}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==a.id&&delete e.yAxis[r.id],e.yAxis[a.id]=a)},prepare:Er()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Er()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Er()},replaceZAxis:{reducer(e,t){var{prev:r,next:a}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==a.id&&delete e.zAxis[r.id],e.zAxis[a.id]=a)},prepare:Er()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Er()},updateYAxisWidth(e,t){var{id:r,width:a}=t.payload,s=e.yAxis[r];if(s){var i,l=s.widthHistory||[];if(l.length===3&&l[0]===l[2]&&a===l[1]&&a!==s.width&&Math.abs(a-((i=l[0])!==null&&i!==void 0?i:0))<=1)return;var u=[...l,a].slice(-3);e.yAxis[r]=DA(DA({},s),{},{width:a,widthHistory:u})}}}}),{addXAxis:doe,replaceXAxis:foe,removeXAxis:hoe,addYAxis:poe,replaceYAxis:moe,removeYAxis:goe,addZAxis:hbe,replaceZAxis:pbe,removeZAxis:mbe,updateYAxisWidth:xoe}=Q9.actions,yoe=Q9.reducer,voe=Ae([_a],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),boe=Ae([voe,Uo,Ho],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Z9=()=>mt(boe),RA=(e,t,r)=>{var a=r!=null?r:e;if(!ja(a))return on(a,t,0)},woe=(e,t,r)=>{var a={},s=e.filter(Cy),i=e.filter(f=>f.stackId==null),l=s.reduce((f,p)=>{var m=f[p.stackId];return m==null&&(m=[]),m.push(p),f[p.stackId]=m,f},a),u=Object.entries(l).map(f=>{var p,[m,x]=f,v=x.map(w=>w.dataKey),b=RA(t,r,(p=x[0])===null||p===void 0?void 0:p.barSize);return{stackId:m,dataKeys:v,barSize:b}}),d=i.map(f=>{var p=[f.dataKey].filter(x=>x!=null),m=RA(t,r,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...u,...d]};function FA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Gm(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FA(Object(r),!0).forEach(function(a){joe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function joe(e,t,r){return(t=_oe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _oe(e){var t=koe(e,"string");return typeof t=="symbol"?t:t+""}function koe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Soe(e,t,r,a,s){var i,l=a.length;if(!(l<1)){var u=on(e,r,0,!0),d,f=[];if(Kt((i=a[0])===null||i===void 0?void 0:i.barSize)){var p=!1,m=r/l,x=a.reduce((C,N)=>C+(N.barSize||0),0);x+=(l-1)*u,x>=r&&(x-=(l-1)*u,u=0),x>=r&&m>0&&(p=!0,m*=.9,x=l*m);var v=(r-x)/2>>0,b={offset:v-u,size:0};d=a.reduce((C,N)=>{var O,E={stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:b.offset+b.size+u,size:p?m:(O=N.barSize)!==null&&O!==void 0?O:0}},A=[...C,E];return b=E.position,A},f)}else{var w=on(t,r,0,!0);r-2*w-(l-1)*u<=0&&(u=0);var j=(r-2*w-(l-1)*u)/l;j>1&&(j>>=0);var k=Kt(s)?Math.min(j,s):j;d=a.reduce((C,N,O)=>[...C,{stackId:N.stackId,dataKeys:N.dataKeys,position:{offset:w+(j+u)*O+(j-k)/2,size:k}}],f)}return d}}var Noe=(e,t,r,a,s,i,l)=>{var u=ja(l)?t:l,d=Soe(r,a,s!==i?s:i,e,u);return s!==i&&d!=null&&(d=d.map(f=>Gm(Gm({},f),{},{position:Gm(Gm({},f.position),{},{offset:f.position.offset-s/2})}))),d},Coe=(e,t)=>{var r=z_(t);if(!(!e||r==null||t==null)){var{stackId:a}=t;if(a!=null){var s=e[a];if(s){var{stackedData:i}=s;if(i)return i.find(l=>l.key===r)}}}},Toe=(e,t)=>{if(!(e==null||t==null)){var r=e.find(a=>a.stackId===t.stackId&&t.dataKey!=null&&a.dataKeys.includes(t.dataKey));if(r!=null)return r.position}};function Eoe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Kt(e.zIndex)?e.zIndex:t}var eF=e=>{var{chartData:t}=e,r=wr(),a=Wn();return y.useEffect(()=>a?()=>{}:(r(GE(t)),()=>{r(GE(void 0))}),[t,r,a]),null},MA={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},tF=pn({name:"brush",initialState:MA,reducers:{setBrushSettings(e,t){return t.payload==null?MA:t.payload}}}),{setBrushSettings:gbe}=tF.actions,Aoe=tF.reducer;function Ooe(e){return(e%180+180)%180}var Poe=function(t){var{width:r,height:a}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Ooe(s),l=i*Math.PI/180,u=Math.atan(a/r),d=l>u&&l<Math.PI-u?a/Math.sin(l):r/Math.cos(l);return Math.abs(d)},Doe={dots:[],areas:[],lines:[]},rF=pn({name:"referenceElements",initialState:Doe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=$s(e).dots.findIndex(a=>a===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=$s(e).areas.findIndex(a=>a===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=$s(e).lines.findIndex(a=>a===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:xbe,removeDot:ybe,addArea:vbe,removeArea:bbe,addLine:wbe,removeLine:jbe}=rF.actions,Roe=rF.reducer,Foe=y.createContext(void 0),Moe=e=>{var{children:t}=e,[r]=y.useState("".concat(lh("recharts"),"-clip")),a=Z9();if(a==null)return null;var{x:s,y:i,width:l,height:u}=a;return y.createElement(Foe.Provider,{value:r},y.createElement("defs",null,y.createElement("clipPath",{id:r},y.createElement("rect",{x:s,y:i,height:u,width:l}))),t)};function aF(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],a=0;a<e.length;a+=t){var s=e[a];s!==void 0&&r.push(s)}return r}function Loe(e,t,r){var a={width:e.width+t.width,height:e.height+t.height};return Poe(a,r)}function Ioe(e,t,r){var a=r==="width",{x:s,y:i,width:l,height:u}=e;return t===1?{start:a?s:i,end:a?s+l:i+u}:{start:a?s+l:i+u,end:a?s:i}}function jh(e,t,r,a,s){if(e*t<e*a||e*t>e*s)return!1;var i=r();return e*(t-e*i/2-a)>=0&&e*(t+e*i/2-s)<=0}function zoe(e,t){return aF(e,t+1)}function Boe(e,t,r,a,s){for(var i=(a||[]).slice(),{start:l,end:u}=t,d=0,f=1,p=l,m=function(){var b=a==null?void 0:a[d];if(b===void 0)return{v:aF(a,f)};var w=d,j,k=()=>(j===void 0&&(j=r(b,w)),j),C=b.coordinate,N=d===0||jh(e,C,k,p,u);N||(d=0,p=l,f+=1),N&&(p=C+e*(k()/2+s),d+=f)},x;f<=i.length;)if(x=m(),x)return x.v;return[]}function $oe(e,t,r,a,s){var i=(a||[]).slice(),l=i.length;if(l===0)return[];for(var{start:u,end:d}=t,f=1;f<=l;f++){for(var p=(l-1)%f,m=u,x=!0,v=function(){var O=a[w];if(O==null)return 0;var E=w,A,T=()=>(A===void 0&&(A=r(O,E)),A),P=O.coordinate,D=w===p||jh(e,P,T,m,d);if(!D)return x=!1,1;D&&(m=P+e*(T()/2+s))},b,w=p;w<l&&(b=v(),!(b!==0&&b===1));w+=f);if(x){for(var j=[],k=p;k<l;k+=f){var C=a[k];C!=null&&j.push(C)}return j}}return[]}function LA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function an(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LA(Object(r),!0).forEach(function(a){Uoe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Uoe(e,t,r){return(t=Hoe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hoe(e){var t=qoe(e,"string");return typeof t=="symbol"?t:t+""}function qoe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Woe(e,t,r,a,s){for(var i=(a||[]).slice(),l=i.length,{start:u}=t,{end:d}=t,f=function(x){var v=i[x];if(v==null)return 1;var b=v,w,j=()=>(w===void 0&&(w=r(v,x)),w);if(x===l-1){var k=e*(b.coordinate+e*j()/2-d);i[x]=b=an(an({},b),{},{tickCoord:k>0?b.coordinate-k*e:b.coordinate})}else i[x]=b=an(an({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var C=jh(e,b.tickCoord,j,u,d);C&&(d=b.tickCoord-e*(j()/2+s),i[x]=an(an({},b),{},{isShow:!0}))}},p=l-1;p>=0;p--)f(p);return i}function Voe(e,t,r,a,s,i){var l=(a||[]).slice(),u=l.length,{start:d,end:f}=t;if(i){var p=a[u-1];if(p!=null){var m=r(p,u-1),x=e*(p.coordinate+e*m/2-f);if(l[u-1]=p=an(an({},p),{},{tickCoord:x>0?p.coordinate-x*e:p.coordinate}),p.tickCoord!=null){var v=jh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+s),l[u-1]=an(an({},p),{},{isShow:!0}))}}}for(var b=i?u-1:u,w=function(C){var N=l[C];if(N==null)return 1;var O=N,E,A=()=>(E===void 0&&(E=r(N,C)),E);if(C===0){var T=e*(O.coordinate-e*A()/2-d);l[C]=O=an(an({},O),{},{tickCoord:T<0?O.coordinate-T*e:O.coordinate})}else l[C]=O=an(an({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var P=jh(e,O.tickCoord,A,d,f);P&&(d=O.tickCoord+e*(A()/2+s),l[C]=an(an({},O),{},{isShow:!0}))}},j=0;j<b;j++)w(j);return l}function Gk(e,t,r){var{tick:a,ticks:s,viewBox:i,minTickGap:l,orientation:u,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!s||!s.length||!a)return[];if(pt(d)||qh.isSsr){var x;return(x=zoe(s,pt(d)?d:0))!==null&&x!==void 0?x:[]}var v=[],b=u==="top"||u==="bottom"?"width":"height",w=p&&b==="width"?Yf(p,{fontSize:t,letterSpacing:r}):{width:0,height:0},j=(E,A)=>{var T=typeof f=="function"?f(E.value,A):E.value;return b==="width"?Loe(Yf(T,{fontSize:t,letterSpacing:r}),w,m):Yf(T,{fontSize:t,letterSpacing:r})[b]},k=s[0],C=s[1],N=s.length>=2&&k!=null&&C!=null?Oa(C.coordinate-k.coordinate):1,O=Ioe(i,N,b);return d==="equidistantPreserveStart"?Boe(N,O,j,s,l):d==="equidistantPreserveEnd"?$oe(N,O,j,s,l):(d==="preserveStart"||d==="preserveStartEnd"?v=Voe(N,O,j,s,l,d==="preserveStartEnd"):v=Woe(N,O,j,s,l),v.filter(E=>E.isShow))}var Goe=e=>{var{ticks:t,label:r,labelGapWithTick:a=5,tickSize:s=0,tickMargin:i=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>l&&(l=m.width)}});var u=r?r.getBoundingClientRect().width:0,d=s+i,f=l+d+u+(r?a:0);return Math.round(f)}return 0},Koe={xAxis:{},yAxis:{}},nF=pn({name:"renderedTicks",initialState:Koe,reducers:{setRenderedTicks:(e,t)=>{var{axisType:r,axisId:a,ticks:s}=t.payload;e[r][a]=s},removeRenderedTicks:(e,t)=>{var{axisType:r,axisId:a}=t.payload;delete e[r][a]}}}),{setRenderedTicks:Yoe,removeRenderedTicks:Xoe}=nF.actions,Joe=nF.reducer,Qoe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Zoe(e,t){if(e==null)return{};var r,a,s=ele(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function ele(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function su(){return su=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},su.apply(null,arguments)}function IA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function qr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?IA(Object(r),!0).forEach(function(a){tle(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function tle(e,t,r){return(t=rle(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rle(e){var t=ale(e,"string");return typeof t=="symbol"?t:t+""}function ale(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Eo={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",zIndex:Xa.axis};function nle(e){var{x:t,y:r,width:a,height:s,orientation:i,mirror:l,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var f=qr(qr(qr({},d),yi(u)),{},{fill:"none"});if(i==="top"||i==="bottom"){var p=+(i==="top"&&!l||i==="bottom"&&l);f=qr(qr({},f),{},{x1:t,y1:r+p*s,x2:t+a,y2:r+p*s})}else{var m=+(i==="left"&&!l||i==="right"&&l);f=qr(qr({},f),{},{x1:t+m*a,y1:r,x2:t+m*a,y2:r+s})}return y.createElement("line",su({},f,{className:Wt("recharts-cartesian-axis-line",Jc(u,"className"))}))}function sle(e,t,r,a,s,i,l,u,d){var f,p,m,x,v,b,w=u?-1:1,j=e.tickSize||l,k=pt(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":f=p=e.coordinate,x=r+ +!u*s,m=x-w*j,b=m-w*d,v=k;break;case"left":m=x=e.coordinate,p=t+ +!u*a,f=p-w*j,v=f-w*d,b=k;break;case"right":m=x=e.coordinate,p=t+ +u*a,f=p+w*j,v=f+w*d,b=k;break;default:f=p=e.coordinate,x=r+ +u*s,m=x+w*j,b=m+w*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:x},tick:{x:v,y:b}}}function ile(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function ole(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function lle(e){var{option:t,tickProps:r,value:a}=e,s,i=Wt(r.className,"recharts-cartesian-axis-tick-value");if(y.isValidElement(t))s=y.cloneElement(t,qr(qr({},r),{},{className:i}));else if(typeof t=="function")s=t(qr(qr({},r),{},{className:i}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=Wt(l,H9(t))),s=y.createElement(By,su({},r,{className:l}),a)}return s}function cle(e){var{ticks:t,axisType:r,axisId:a}=e,s=wr();return y.useEffect(()=>{if(a==null||r==null)return d0;var i=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return s(Yoe({ticks:i,axisId:a,axisType:r})),()=>{s(Xoe({axisId:a,axisType:r}))}},[s,t,a,r]),null}var ule=y.forwardRef((e,t)=>{var{ticks:r=[],tick:a,tickLine:s,stroke:i,tickFormatter:l,unit:u,padding:d,tickTextProps:f,orientation:p,mirror:m,x,y:v,width:b,height:w,tickSize:j,tickMargin:k,fontSize:C,letterSpacing:N,getTicksConfig:O,events:E,axisType:A,axisId:T}=e,P=Gk(qr(qr({},O),{},{ticks:r}),C,N),D=yi(O),z=oh(a),G=O9(D.textAnchor)?D.textAnchor:ile(p,m),V=ole(p,m),ne={};typeof s=="object"&&(ne=s);var ge=qr(qr({},D),{},{fill:"none"},ne),Z=P.map(xe=>qr({entry:xe},sle(xe,x,v,b,w,p,j,m,k))),U=Z.map(xe=>{var{entry:be,line:me}=xe;return y.createElement(un,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(be.value,"-").concat(be.coordinate,"-").concat(be.tickCoord)},s&&y.createElement("line",su({},ge,me,{className:Wt("recharts-cartesian-axis-tick-line",Jc(s,"className"))})))}),ce=Z.map((xe,be)=>{var me,oe,{entry:L,tick:H}=xe,K=qr(qr(qr(qr({verticalAnchor:V},D),{},{textAnchor:G,stroke:"none",fill:i},H),{},{index:be,payload:L,visibleTicksCount:P.length,tickFormatter:l,padding:d},f),{},{angle:(me=(oe=f==null?void 0:f.angle)!==null&&oe!==void 0?oe:D.angle)!==null&&me!==void 0?me:0}),Y=qr(qr({},K),z);return y.createElement(un,su({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(L.value,"-").concat(L.coordinate,"-").concat(L.tickCoord)},Lh(E,L,be)),a&&y.createElement(lle,{option:a,tickProps:Y,value:"".concat(typeof l=="function"?l(L.value,be):L.value).concat(u||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},y.createElement(cle,{ticks:P,axisId:T,axisType:A}),ce.length>0&&y.createElement(_i,{zIndex:Xa.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},ce)),U.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},U))}),dle=y.forwardRef((e,t)=>{var{axisLine:r,width:a,height:s,className:i,hide:l,ticks:u,axisType:d,axisId:f}=e,p=Zoe(e,Qoe),[m,x]=y.useState(""),[v,b]=y.useState(""),w=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return Goe({ticks:w.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=y.useCallback(k=>{if(k){var C=k.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=C;var N=C[0];if(N){var O=window.getComputedStyle(N),E=O.fontSize,A=O.letterSpacing;(E!==m||A!==v)&&(x(E),b(A))}}},[m,v]);return l||a!=null&&a<=0||s!=null&&s<=0?null:y.createElement(_i,{zIndex:e.zIndex},y.createElement(un,{className:Wt("recharts-cartesian-axis",i)},y.createElement(nle,{x:e.x,y:e.y,width:a,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:yi(e)}),y.createElement(ule,{ref:j,axisType:d,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),y.createElement(mse,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(Sse,{label:e.label,labelRef:e.labelRef}),e.children)))}),Kk=y.forwardRef((e,t)=>{var r=Fa(e,Eo);return y.createElement(dle,su({},r,{ref:t}))});Kk.displayName="CartesianAxis";var fle=["x1","y1","x2","y2","key"],hle=["offset"],ple=["xAxisId","yAxisId"],mle=["xAxisId","yAxisId"];function zA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function nn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zA(Object(r),!0).forEach(function(a){gle(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function gle(e,t,r){return(t=xle(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xle(e){var t=yle(e,"string");return typeof t=="symbol"?t:t+""}function yle(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},$c.apply(null,arguments)}function Sx(e,t){if(e==null)return{};var r,a,s=vle(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function vle(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var ble=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:a,y:s,width:i,height:l,ry:u}=e;return y.createElement("rect",{x:a,y:s,ry:u,width:i,height:l,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function sF(e){var{option:t,lineItemProps:r}=e,a;if(y.isValidElement(t))a=y.cloneElement(t,r);else if(typeof t=="function")a=t(r);else{var s,{x1:i,y1:l,x2:u,y2:d,key:f}=r,p=Sx(r,fle),m=(s=yi(p))!==null&&s!==void 0?s:{},{offset:x}=m,v=Sx(m,hle);a=y.createElement("line",$c({},v,{x1:i,y1:l,x2:u,y2:d,fill:"none",key:f}))}return a}function wle(e){var{x:t,width:r,horizontal:a=!0,horizontalPoints:s}=e;if(!a||!s||!s.length)return null;var{xAxisId:i,yAxisId:l}=e,u=Sx(e,ple),d=s.map((f,p)=>{var m=nn(nn({},u),{},{x1:t,y1:f,x2:t+r,y2:f,key:"line-".concat(p),index:p});return y.createElement(sF,{key:"line-".concat(p),option:a,lineItemProps:m})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function jle(e){var{y:t,height:r,vertical:a=!0,verticalPoints:s}=e;if(!a||!s||!s.length)return null;var{xAxisId:i,yAxisId:l}=e,u=Sx(e,mle),d=s.map((f,p)=>{var m=nn(nn({},u),{},{x1:f,y1:t,x2:f,y2:t+r,key:"line-".concat(p),index:p});return y.createElement(sF,{option:a,lineItemProps:m,key:"line-".concat(p)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function _le(e){var{horizontalFill:t,fillOpacity:r,x:a,y:s,width:i,height:l,horizontalPoints:u,horizontal:d=!0}=e;if(!d||!t||!t.length||u==null)return null;var f=u.map(m=>Math.round(m+s-s)).sort((m,x)=>m-x);s!==f[0]&&f.unshift(0);var p=f.map((m,x)=>{var v=f[x+1],b=v==null,w=b?s+l-m:v-m;if(w<=0)return null;var j=x%t.length;return y.createElement("rect",{key:"react-".concat(x),y:m,x:a,height:w,width:i,stroke:"none",fill:t[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function kle(e){var{vertical:t=!0,verticalFill:r,fillOpacity:a,x:s,y:i,width:l,height:u,verticalPoints:d}=e;if(!t||!r||!r.length)return null;var f=d.map(m=>Math.round(m+s-s)).sort((m,x)=>m-x);s!==f[0]&&f.unshift(0);var p=f.map((m,x)=>{var v=f[x+1],b=v==null,w=b?s+l-m:v-m;if(w<=0)return null;var j=x%r.length;return y.createElement("rect",{key:"react-".concat(x),x:m,y:i,width:w,height:u,stroke:"none",fill:r[j],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Sle=(e,t)=>{var{xAxis:r,width:a,height:s,offset:i}=e;return z7(Gk(nn(nn(nn({},Eo),r),{},{ticks:B7(r),viewBox:{x:0,y:0,width:a,height:s}})),i.left,i.left+i.width,t)},Nle=(e,t)=>{var{yAxis:r,width:a,height:s,offset:i}=e;return z7(Gk(nn(nn(nn({},Eo),r),{},{ticks:B7(r),viewBox:{x:0,y:0,width:a,height:s}})),i.top,i.top+i.height,t)},Cle={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Xa.grid};function _g(e){var t=S_(),r=N_(),a=G7(),s=nn(nn({},Fa(e,Cle)),{},{x:pt(e.x)?e.x:a.left,y:pt(e.y)?e.y:a.top,width:pt(e.width)?e.width:a.width,height:pt(e.height)?e.height:a.height}),{xAxisId:i,yAxisId:l,x:u,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:x,verticalValues:v}=s,b=Wn(),w=mt(D=>RE(D,"xAxis",i,b)),j=mt(D=>RE(D,"yAxis",l,b));if(!Gi(f)||!Gi(p)||!pt(u)||!pt(d))return null;var k=s.verticalCoordinatesGenerator||Sle,C=s.horizontalCoordinatesGenerator||Nle,{horizontalPoints:N,verticalPoints:O}=s;if((!N||!N.length)&&typeof C=="function"){var E=x&&x.length,A=C({yAxis:j?nn(nn({},j),{},{ticks:E?x:j.ticks}):void 0,width:t!=null?t:f,height:r!=null?r:p,offset:a},E?!0:m);Jg(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(N=A)}if((!O||!O.length)&&typeof k=="function"){var T=v&&v.length,P=k({xAxis:w?nn(nn({},w),{},{ticks:T?v:w.ticks}):void 0,width:t!=null?t:f,height:r!=null?r:p,offset:a},T?!0:m);Jg(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(O=P)}return y.createElement(_i,{zIndex:s.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(ble,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),y.createElement(_le,$c({},s,{horizontalPoints:N})),y.createElement(kle,$c({},s,{verticalPoints:O})),y.createElement(wle,$c({},s,{offset:a,horizontalPoints:N,xAxis:w,yAxis:j})),y.createElement(jle,$c({},s,{offset:a,verticalPoints:O,xAxis:w,yAxis:j}))))}_g.displayName="CartesianGrid";var Tle={},iF=pn({name:"errorBars",initialState:Tle,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:a}=t.payload;e[r]||(e[r]=[]),e[r].push(a)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:a,next:s}=t.payload;e[r]&&(e[r]=e[r].map(i=>i.dataKey===a.dataKey&&i.direction===a.direction?s:i))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:a}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==a.dataKey||s.direction!==a.direction))}}}),{addErrorBar:_be,replaceErrorBar:kbe,removeErrorBar:Sbe}=iF.actions,Ele=iF.reducer,Ale=["children"];function Ole(e,t){if(e==null)return{};var r,a,s=Ple(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Ple(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var Dle={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Rle=y.createContext(Dle);function Fle(e){var{children:t}=e,r=Ole(e,Ale);return y.createElement(Rle.Provider,{value:r},t)}function oF(e,t){var r,a,s=mt(f=>Wo(f,e)),i=mt(f=>Vo(f,t)),l=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:xa.allowDataOverflow,u=(a=i==null?void 0:i.allowDataOverflow)!==null&&a!==void 0?a:ya.allowDataOverflow,d=l||u;return{needClip:d,needClipX:l,needClipY:u}}function Mle(e){var{xAxisId:t,yAxisId:r,clipPathId:a}=e,s=Z9(),{needClipX:i,needClipY:l,needClip:u}=oF(t,r);if(!u||!s)return null;var{x:d,y:f,width:p,height:m}=s;return y.createElement("clipPath",{id:"clipPath-".concat(a)},y.createElement("rect",{x:i?d:d-p/2,y:l?f:f-m/2,width:i?p:p*2,height:l?m:m*2}))}function pu(e,t){var r,a;return(r=(a=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||a===void 0?void 0:a.xAxisId)!==null&&r!==void 0?r:J9}function mu(e,t){var r,a;return(r=(a=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||a===void 0?void 0:a.yAxisId)!==null&&r!==void 0?r:J9}var Lle="Invariant failed";function Ile(e,t){throw new Error(Lle)}function Oj(){return Oj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Oj.apply(null,arguments)}function Yk(e){return y.createElement(V9,Oj({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var zle=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(a,s)=>{if(pt(t))return t;var i=pt(a)||ja(a);return i?t(a,s):(i||Ile(),r)}},Ble=(e,t,r)=>r,$le=(e,t)=>t,rp=Ae([hk,$le],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),Ule=Ae([rp],e=>e==null?void 0:e.maxBarSize),Hle=(e,t,r,a)=>a,qle=Ae([ir,hk,pu,mu,Ble],(e,t,r,a,s)=>t.filter(i=>e==="horizontal"?i.xAxisId===r:i.yAxisId===a).filter(i=>i.isPanorama===s).filter(i=>i.hide===!1).filter(i=>i.type==="bar")),Wle=(e,t,r)=>{var a=ir(e),s=pu(e,t),i=mu(e,t);if(!(s==null||i==null))return a==="horizontal"?Cj(e,"yAxis",i,r):Cj(e,"xAxis",s,r)},Vle=(e,t)=>{var r=ir(e),a=pu(e,t),s=mu(e,t);if(!(a==null||s==null))return r==="horizontal"?DE(e,"xAxis",a):DE(e,"yAxis",s)},Gle=Ae([qle,NQ,Vle],woe),Kle=(e,t,r)=>{var a,s,i=rp(e,t);if(i==null)return 0;var l=pu(e,t),u=mu(e,t);if(l==null||u==null)return 0;var d=ir(e),f=ED(e),{maxBarSize:p}=i,m=ja(p)?f:p,x,v;return d==="horizontal"?(x=r0(e,"xAxis",l,r),v=t0(e,"xAxis",l,r)):(x=r0(e,"yAxis",u,r),v=t0(e,"yAxis",u,r)),(a=(s=Xg(x,v,!0))!==null&&s!==void 0?s:m)!==null&&a!==void 0?a:0},lF=(e,t,r)=>{var a=ir(e),s=pu(e,t),i=mu(e,t);if(!(s==null||i==null)){var l,u;return a==="horizontal"?(l=r0(e,"xAxis",s,r),u=t0(e,"xAxis",s,r)):(l=r0(e,"yAxis",i,r),u=t0(e,"yAxis",i,r)),Xg(l,u)}},Yle=Ae([Gle,ED,SQ,AD,Kle,lF,Ule],Noe),Xle=(e,t,r)=>{var a=pu(e,t);if(a!=null)return r0(e,"xAxis",a,r)},Jle=(e,t,r)=>{var a=mu(e,t);if(a!=null)return r0(e,"yAxis",a,r)},Qle=(e,t,r)=>{var a=pu(e,t);if(a!=null)return t0(e,"xAxis",a,r)},Zle=(e,t,r)=>{var a=mu(e,t);if(a!=null)return t0(e,"yAxis",a,r)},ece=Ae([Yle,rp],Toe),tce=Ae([Wle,rp],Coe),rce=Ae([_a,j_,Xle,Jle,Qle,Zle,ece,ir,gQ,lF,tce,rp,Hle],(e,t,r,a,s,i,l,u,d,f,p,m,x)=>{var{chartData:v,dataStartIndex:b,dataEndIndex:w}=d;if(!(m==null||l==null||t==null||u!=="horizontal"&&u!=="vertical"||r==null||a==null||s==null||i==null||f==null)){var{data:j}=m,k;if(j!=null&&j.length>0?k=j:k=v==null?void 0:v.slice(b,w+1),k!=null)return Ace({layout:u,barSettings:m,pos:l,parentViewBox:t,bandSize:f,xAxis:r,yAxis:a,xAxisTicks:s,yAxisTicks:i,stackedData:p,displayedData:k,offset:e,cells:x,dataStartIndex:b})}}),ace=["index"];function Pj(){return Pj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Pj.apply(null,arguments)}function nce(e,t){if(e==null)return{};var r,a,s=sce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function sce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var cF=y.createContext(void 0),ice=e=>{var t=y.useContext(cF);if(t!=null)return t.stackId;if(e!=null)return mY(e)},oce=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),lce=e=>{var t=y.useContext(cF);if(t!=null){var{stackId:r}=t;return"url(#".concat(oce(r,e),")")}},uF=e=>{var{index:t}=e,r=nce(e,ace),a=lce(t);return y.createElement(un,Pj({className:"recharts-bar-stack-layer",clipPath:a},r))},cce=["onMouseEnter","onMouseLeave","onClick"],uce=["value","background","tooltipPosition"],dce=["id"],fce=["onMouseEnter","onClick","onMouseLeave"];function Fl(){return Fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Fl.apply(null,arguments)}function BA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function wn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BA(Object(r),!0).forEach(function(a){hce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function hce(e,t,r){return(t=pce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pce(e){var t=mce(e,"string");return typeof t=="symbol"?t:t+""}function mce(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nx(e,t){if(e==null)return{};var r,a,s=gce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function gce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var xce=e=>{var{dataKey:t,name:r,fill:a,legendType:s,hide:i}=e;return[{inactive:i,dataKey:t,type:s,color:a,value:fy(r,t),payload:e}]},yce=y.memo(e=>{var{dataKey:t,stroke:r,strokeWidth:a,fill:s,name:i,hide:l,unit:u,tooltipType:d,id:f}=e,p={dataDefinedOnItem:void 0,getPosition:d0,settings:{stroke:r,strokeWidth:a,fill:s,dataKey:t,nameKey:void 0,name:fy(i,t),hide:l,type:d,color:s,unit:u,graphicalItemId:f}};return y.createElement(G9,{tooltipEntrySettings:p})});function vce(e){var t=mt(nu),{data:r,dataKey:a,background:s,allOtherBarProps:i}=e,{onMouseEnter:l,onMouseLeave:u,onClick:d}=i,f=Nx(i,cce),p=qk(l,a,i.id),m=Wk(u),x=Vk(d,a,i.id);if(!s||r==null)return null;var v=oh(s);return y.createElement(_i,{zIndex:Eoe(s,Xa.barBackground)},r.map((b,w)=>{var{value:j,background:k,tooltipPosition:C}=b,N=Nx(b,uce);if(!k)return null;var O=p(b,w),E=m(b,w),A=x(b,w),T=wn(wn(wn(wn(wn({option:s,isActive:String(w)===t},N),{},{fill:"#eee"},k),v),Lh(f,b,w)),{},{onMouseEnter:O,onMouseLeave:E,onClick:A,dataKey:a,index:w,className:"recharts-bar-background-rectangle"});return y.createElement(Yk,Fl({key:"background-bar-".concat(w)},T))}))}function bce(e){var{showLabels:t,children:r,rects:a}=e,s=a==null?void 0:a.map(i=>{var l={x:i.x,y:i.y,width:i.width,lowerWidth:i.width,upperWidth:i.width,height:i.height};return wn(wn({},l),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:l,fill:i.fill})});return y.createElement(Ase,{value:t?s:void 0},r)}function wce(e){var{shape:t,activeBar:r,baseProps:a,entry:s,index:i,dataKey:l}=e,u=mt(nu),d=mt(Fk),f=r&&String(s.originalDataIndex)===u&&(d==null||l===d),[p,m]=y.useState(!1),[x,v]=y.useState(!1);y.useEffect(()=>{var N;return f?(m(!0),N=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(N)}},[f]);var b=y.useCallback(()=>{f||m(!1)},[f]),w=f&&x,j=f||p,k;f?r===!0?k=t:k=r:k=t;var C=y.createElement(Yk,Fl({},a,{name:String(a.name)},s,{isActive:w,option:k,index:i,dataKey:l,onTransitionEnd:b}));return j?y.createElement(_i,{zIndex:Xa.activeBar},y.createElement(uF,{index:s.originalDataIndex},C)):C}function jce(e){var{shape:t,baseProps:r,entry:a,index:s,dataKey:i}=e;return y.createElement(Yk,Fl({},r,{name:String(r.name)},a,{isActive:!1,option:t,index:s,dataKey:i}))}function _ce(e){var t,{data:r,props:a}=e,s=(t=yi(a))!==null&&t!==void 0?t:{},{id:i}=s,l=Nx(s,dce),{shape:u,dataKey:d,activeBar:f}=a,{onMouseEnter:p,onClick:m,onMouseLeave:x}=a,v=Nx(a,fce),b=qk(p,d,i),w=Wk(x),j=Vk(m,d,i);return r?y.createElement(y.Fragment,null,r.map((k,C)=>y.createElement(uF,Fl({index:k.originalDataIndex,key:"rectangle-".concat(k==null?void 0:k.x,"-").concat(k==null?void 0:k.y,"-").concat(k==null?void 0:k.value,"-").concat(C),className:"recharts-bar-rectangle"},Lh(v,k,C),{onMouseEnter:b(k,C),onMouseLeave:w(k,C),onClick:j(k,C)}),f?y.createElement(wce,{shape:u,activeBar:f,baseProps:l,entry:k,index:C,dataKey:d}):y.createElement(jce,{shape:u,baseProps:l,entry:k,index:C,dataKey:d})))):null}function kce(e){var{props:t,previousRectanglesRef:r}=e,{data:a,layout:s,isAnimationActive:i,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationEnd:f,onAnimationStart:p}=t,m=r.current,x=jy(t,"recharts-bar-"),[v,b]=y.useState(!1),w=!v,j=y.useCallback(()=>{typeof f=="function"&&f(),b(!1)},[f]),k=y.useCallback(()=>{typeof p=="function"&&p(),b(!0)},[p]);return y.createElement(bce,{showLabels:w,rects:a},y.createElement(wy,{animationId:x,begin:l,duration:u,isActive:i,easing:d,onAnimationEnd:j,onAnimationStart:k,key:x},C=>{var N=C===1?a:a==null?void 0:a.map((O,E)=>{var A=m&&m[E];if(A)return wn(wn({},O),{},{x:ba(A.x,O.x,C),y:ba(A.y,O.y,C),width:ba(A.width,O.width,C),height:ba(A.height,O.height,C)});if(s==="horizontal"){var T=ba(0,O.height,C),P=ba(O.stackedBarStart,O.y,C);return wn(wn({},O),{},{y:P,height:T})}var D=ba(0,O.width,C),z=ba(O.stackedBarStart,O.x,C);return wn(wn({},O),{},{width:D,x:z})});return C>0&&(r.current=N!=null?N:null),N==null?null:y.createElement(un,null,y.createElement(_ce,{props:t,data:N}))}),y.createElement(z9,{label:t.label}),t.children)}function Sce(e){var t=y.useRef(null);return y.createElement(kce,{previousRectanglesRef:t,props:e})}var dF=0,Nce=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:kr(e,t)}};class Cce extends y.PureComponent{render(){var{hide:t,data:r,dataKey:a,className:s,xAxisId:i,yAxisId:l,needClip:u,background:d,id:f}=this.props;if(t||r==null)return null;var p=Wt("recharts-bar",s),m=f;return y.createElement(un,{className:p,id:f},u&&y.createElement("defs",null,y.createElement(Mle,{clipPathId:m,xAxisId:i,yAxisId:l})),y.createElement(un,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(m,")"):void 0},y.createElement(vce,{data:r,dataKey:a,background:d,allOtherBarProps:this.props}),y.createElement(Sce,this.props)))}}var Tce={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:dF,xAxisId:0,yAxisId:0,zIndex:Xa.bar};function Ece(e){var{xAxisId:t,yAxisId:r,hide:a,legendType:s,minPointSize:i,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=oF(t,r),x=f0(),v=Wn(),b=Hk(e.children,n0),w=mt(C=>rce(C,e.id,v,b));if(x!=="vertical"&&x!=="horizontal")return null;var j,k=w==null?void 0:w[0];return k==null||k.height==null||k.width==null?j=0:j=x==="vertical"?k.height/2:k.width/2,y.createElement(Fle,{xAxisId:t,yAxisId:r,data:w,dataPointFormatter:Nce,errorBarOffset:j},y.createElement(Cce,Fl({},e,{layout:x,needClip:m,data:w,xAxisId:t,yAxisId:r,hide:a,legendType:s,minPointSize:i,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p})))}function Ace(e){var{layout:t,barSettings:{dataKey:r,minPointSize:a,hasCustomShape:s},pos:i,bandSize:l,xAxis:u,yAxis:d,xAxisTicks:f,yAxisTicks:p,stackedData:m,displayedData:x,offset:v,cells:b,parentViewBox:w,dataStartIndex:j}=e,k=t==="horizontal"?d:u,C=m?k.scale.domain():null,N=gY({numericAxis:k}),O=k.scale.map(N);return x.map((E,A)=>{var T,P,D,z,G,V;if(m){var ne=m[A+j];if(ne==null)return null;T=uY(ne,C)}else T=kr(E,r),Array.isArray(T)||(T=[N,T]);var ge=zle(a,dF)(T[1],A);if(t==="horizontal"){var Z,U=d.scale.map(T[0]),ce=d.scale.map(T[1]);if(U==null||ce==null)return null;P=C5({axis:u,ticks:f,bandSize:l,offset:i.offset,entry:E,index:A}),D=(Z=ce!=null?ce:U)!==null&&Z!==void 0?Z:void 0,z=i.size;var xe=U-ce;if(G=Wi(xe)?0:xe,V={x:P,y:v.top,width:z,height:v.height},Math.abs(ge)>0&&Math.abs(G)<Math.abs(ge)){var be=Oa(G||ge)*(Math.abs(ge)-Math.abs(G));D-=be,G+=be}}else{var me=u.scale.map(T[0]),oe=u.scale.map(T[1]);if(me==null||oe==null)return null;if(P=me,D=C5({axis:d,ticks:p,bandSize:l,offset:i.offset,entry:E,index:A}),z=oe-me,G=i.size,V={x:v.left,y:D,width:v.width,height:G},Math.abs(ge)>0&&Math.abs(z)<Math.abs(ge)){var L=Oa(z||ge)*(Math.abs(ge)-Math.abs(z));z+=L}}if(P==null||D==null||z==null||G==null||!s&&(z===0||G===0))return null;var H=wn(wn({},E),{},{stackedBarStart:O,x:P,y:D,width:z,height:G,value:m?T:T[1],payload:E,background:V,tooltipPosition:{x:P+z/2,y:D+G/2},parentViewBox:w,originalDataIndex:A},b&&b[A]&&b[A].props);return H}).filter(Boolean)}function Oce(e){var t=Fa(e,Tce),r=ice(t.stackId),a=Wn();return y.createElement(K9,{id:t.id,type:"bar"},s=>y.createElement(y.Fragment,null,y.createElement(xie,{legendPayload:xce(t)}),y.createElement(yce,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:s}),y.createElement(Pie,{type:"bar",id:s,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:r,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:a,hasCustomShape:t.shape!=null}),y.createElement(_i,{zIndex:t.zIndex},y.createElement(Ece,Fl({},t,{id:s})))))}var Uf=y.memo(Oce,Hh);Uf.displayName="Bar";var Pce=["domain","range"],Dce=["domain","range"];function $A(e,t){if(e==null)return{};var r,a,s=Rce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Rce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function UA(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function fF(e,t){if(e===t)return!0;var{domain:r,range:a}=e,s=$A(e,Pce),{domain:i,range:l}=t,u=$A(t,Dce);return!UA(r,i)||!UA(a,l)?!1:Hh(s,u)}var Fce=["type"],Mce=["dangerouslySetInnerHTML","ticks","scale"],Lce=["id","scale"];function Dj(){return Dj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Dj.apply(null,arguments)}function HA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function qA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HA(Object(r),!0).forEach(function(a){Ice(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Ice(e,t,r){return(t=zce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zce(e){var t=Bce(e,"string");return typeof t=="symbol"?t:t+""}function Bce(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rj(e,t){if(e==null)return{};var r,a,s=$ce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function $ce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Uce(e){var t=wr(),r=y.useRef(null),a=K7(),{type:s}=e,i=Rj(e,Fce),l=Sy(a,"xAxis",s),u=y.useMemo(()=>{if(l!=null)return qA(qA({},i),{},{type:l})},[i,l]);return y.useLayoutEffect(()=>{u!=null&&(r.current===null?t(doe(u)):r.current!==u&&t(foe({prev:r.current,next:u})),r.current=u)},[u,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(hoe(r.current)),r.current=null)},[t]),null}var Hce=e=>{var{xAxisId:t,className:r}=e,a=mt(j_),s=Wn(),i="xAxis",l=mt(k=>GR(k,i,t,s)),u=mt(k=>qR(k,t)),d=mt(k=>sre(k,t)),f=mt(k=>jR(k,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:x}=e,v=Rj(e,Mce),{id:b,scale:w}=f,j=Rj(f,Lce);return y.createElement(Kk,Dj({},v,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:Wt("recharts-".concat(i," ").concat(i),r),viewBox:a,ticks:l,axisType:i,axisId:t}))},qce={allowDataOverflow:xa.allowDataOverflow,allowDecimals:xa.allowDecimals,allowDuplicatedCategory:xa.allowDuplicatedCategory,angle:xa.angle,axisLine:Eo.axisLine,height:xa.height,hide:!1,includeHidden:xa.includeHidden,interval:xa.interval,label:!1,minTickGap:xa.minTickGap,mirror:xa.mirror,orientation:xa.orientation,padding:xa.padding,reversed:xa.reversed,scale:xa.scale,tick:xa.tick,tickCount:xa.tickCount,tickLine:Eo.tickLine,tickSize:Eo.tickSize,type:xa.type,niceTicks:xa.niceTicks,xAxisId:0},Wce=e=>{var t=Fa(e,qce);return y.createElement(y.Fragment,null,y.createElement(Uce,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),y.createElement(Hce,t))},kg=y.memo(Wce,fF);kg.displayName="XAxis";var Vce=["type"],Gce=["dangerouslySetInnerHTML","ticks","scale"],Kce=["id","scale"];function Fj(){return Fj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Fj.apply(null,arguments)}function WA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function VA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WA(Object(r),!0).forEach(function(a){Yce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Yce(e,t,r){return(t=Xce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xce(e){var t=Jce(e,"string");return typeof t=="symbol"?t:t+""}function Jce(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mj(e,t){if(e==null)return{};var r,a,s=Qce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Qce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Zce(e){var t=wr(),r=y.useRef(null),a=K7(),{type:s}=e,i=Mj(e,Vce),l=Sy(a,"yAxis",s),u=y.useMemo(()=>{if(l!=null)return VA(VA({},i),{},{type:l})},[l,i]);return y.useLayoutEffect(()=>{u!=null&&(r.current===null?t(poe(u)):r.current!==u&&t(moe({prev:r.current,next:u})),r.current=u)},[u,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(goe(r.current)),r.current=null)},[t]),null}function eue(e){var{yAxisId:t,className:r,width:a,label:s}=e,i=y.useRef(null),l=y.useRef(null),u=mt(j_),d=Wn(),f=wr(),p="yAxis",m=mt(A=>WR(A,t)),x=mt(A=>ore(A,t)),v=mt(A=>GR(A,p,t,d)),b=mt(A=>_R(A,t));if(y.useLayoutEffect(()=>{if(!(a!=="auto"||!m||Bk(s)||y.isValidElement(s)||b==null)){var A=i.current;if(A){var T=A.getCalculatedWidth();Math.round(m.width)!==Math.round(T)&&f(xoe({id:t,width:T}))}}},[v,m,f,s,t,a,b]),m==null||x==null||b==null)return null;var{dangerouslySetInnerHTML:w,ticks:j,scale:k}=e,C=Mj(e,Gce),{id:N,scale:O}=b,E=Mj(b,Kce);return y.createElement(Kk,Fj({},C,E,{ref:i,labelRef:l,x:x.x,y:x.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:m.width,height:m.height,className:Wt("recharts-".concat(p," ").concat(p),r),viewBox:u,ticks:v,axisType:p,axisId:t}))}var tue={allowDataOverflow:ya.allowDataOverflow,allowDecimals:ya.allowDecimals,allowDuplicatedCategory:ya.allowDuplicatedCategory,angle:ya.angle,axisLine:Eo.axisLine,hide:!1,includeHidden:ya.includeHidden,interval:ya.interval,label:!1,minTickGap:ya.minTickGap,mirror:ya.mirror,orientation:ya.orientation,padding:ya.padding,reversed:ya.reversed,scale:ya.scale,tick:ya.tick,tickCount:ya.tickCount,tickLine:Eo.tickLine,tickSize:Eo.tickSize,type:ya.type,niceTicks:ya.niceTicks,width:ya.width,yAxisId:0},rue=e=>{var t=Fa(e,tue);return y.createElement(y.Fragment,null,y.createElement(Zce,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),y.createElement(eue,t))},Sg=y.memo(rue,fF);Sg.displayName="YAxis";var aue=(e,t)=>t,Xk=Ae([aue,ir,LD,Ma,d9,Go,Tae,_a],Fae);function nue(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Jk(e){var t=e.currentTarget.getBoundingClientRect(),r,a;if(nue(e)){var s=e.currentTarget.getBBox();r=s.width>0?t.width/s.width:1,a=s.height>0?t.height/s.height:1}else{var i=e.currentTarget;r=i.offsetWidth>0?t.width/i.offsetWidth:1,a=i.offsetHeight>0?t.height/i.offsetHeight:1}var l=(u,d)=>({relativeX:Math.round((u-t.left)/r),relativeY:Math.round((d-t.top)/a)});return"touches"in e?Array.from(e.touches).map(u=>l(u.clientX,u.clientY)):l(e.clientX,e.clientY)}var hF=ms("mouseClick"),pF=zh();pF.startListening({actionCreator:hF,effect:(e,t)=>{var r=e.payload,a=Xk(t.getState(),Jk(r));(a==null?void 0:a.activeIndex)!=null&&t.dispatch(_re({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}});var Lj=ms("mouseMove"),mF=zh(),md=null,mc=null,nw=null;mF.startListening({actionCreator:Lj,effect:(e,t)=>{var r=e.payload,a=t.getState(),{throttleDelay:s,throttledEvents:i}=a.eventSettings,l=i==="all"||(i==null?void 0:i.includes("mousemove"));md!==null&&(cancelAnimationFrame(md),md=null),mc!==null&&(typeof s!="number"||!l)&&(clearTimeout(mc),mc=null),nw=Jk(r);var u=()=>{var d=t.getState(),f=ep(d,d.tooltip.settings.shared);if(!nw){md=null,mc=null;return}if(f==="axis"){var p=Xk(d,nw);(p==null?void 0:p.activeIndex)!=null?t.dispatch(t9({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(e9())}md=null,mc=null};if(!l){u();return}s==="raf"?md=requestAnimationFrame(u):typeof s=="number"&&mc===null&&(mc=setTimeout(u,s))}});function sue(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var GA={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},gF=pn({name:"rootProps",initialState:GA,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:GA.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),iue=gF.reducer,{updateOptions:oue}=gF.actions,lue=null,cue={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},xF=pn({name:"polarOptions",initialState:lue,reducers:cue}),{updatePolarOptions:uue}=xF.actions,due=xF.reducer,yF=ms("keyDown"),vF=ms("focus"),bF=ms("blur"),qy=zh(),gd=null,gc=null,Km=null;qy.startListening({actionCreator:yF,effect:(e,t)=>{Km=e.payload,gd!==null&&(cancelAnimationFrame(gd),gd=null);var r=t.getState(),{throttleDelay:a,throttledEvents:s}=r.eventSettings,i=s==="all"||s.includes("keydown");gc!==null&&(typeof a!="number"||!i)&&(clearTimeout(gc),gc=null);var l=()=>{try{var u=t.getState(),d=u.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=u.tooltip,p=Km;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=Kf(f,au(u),e0(u),a0(u)),x=m==null?-1:Number(m),v=!Number.isFinite(x)||x<0,b=Go(u),w=au(u),j=ep(u,u.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=wx(u,j,"hover",String(f.index));t.dispatch(bx({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var C=fre(u),N=C==="left-to-right"?1:-1,O=p==="ArrowRight"?1:-1,E;if(v){var A=e0(u),T=a0(u),P=O*N,D=ge=>({active:!1,index:String(ge),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(E=-1,P>0){for(var z=0;z<w.length;z++)if(Kf(D(z),w,A,T)!=null){E=z;break}}else for(var G=w.length-1;G>=0;G--)if(Kf(D(G),w,A,T)!=null){E=G;break}if(E<0)return}else{E=x+O*N;var V=(b==null?void 0:b.length)||w.length;if(V===0||E>=V||E<0)return}var ne=wx(u,j,"hover",String(E));t.dispatch(bx({active:!0,activeIndex:E.toString(),activeCoordinate:ne}))}finally{gd=null,gc=null}};if(!i){l();return}a==="raf"?gd=requestAnimationFrame(l):typeof a=="number"&&gc===null&&(l(),Km=null,gc=setTimeout(()=>{Km?l():(gc=null,gd=null)},a))}});qy.startListening({actionCreator:vF,effect:(e,t)=>{var r=t.getState(),a=r.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var i="0",l=ep(r,r.tooltip.settings.shared),u=wx(r,l,"hover",String(i));t.dispatch(bx({active:!0,activeIndex:i,activeCoordinate:u}))}}}});qy.startListening({actionCreator:bF,effect:(e,t)=>{var r=t.getState(),a=r.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:s}=r.tooltip;s.active&&t.dispatch(bx({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function wF(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(r,a)=>{if(a==="currentTarget")return t;var s=Reflect.get(r,a);return typeof s=="function"?s.bind(r):s}})}var Ls=ms("externalEvent"),jF=zh(),Ym=new Map,Ef=new Map,sw=new Map;jF.startListening({actionCreator:Ls,effect:(e,t)=>{var{handler:r,reactEvent:a}=e.payload;if(r!=null){var s=a.type,i=wF(a);sw.set(s,{handler:r,reactEvent:i});var l=Ym.get(s);l!==void 0&&(cancelAnimationFrame(l),Ym.delete(s));var u=t.getState(),{throttleDelay:d,throttledEvents:f}=u.eventSettings,p=f,m=p==="all"||(p==null?void 0:p.includes(s)),x=Ef.get(s);x!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(x),Ef.delete(s));var v=()=>{var j=sw.get(s);try{if(!j)return;var{handler:k,reactEvent:C}=j,N=t.getState(),O={activeCoordinate:hae(N),activeDataKey:Fk(N),activeIndex:nu(N),activeLabel:p9(N),activeTooltipIndex:nu(N),isTooltipActive:pae(N)};k&&k(O,C)}finally{Ym.delete(s),Ef.delete(s),sw.delete(s)}};if(!m){v();return}if(d==="raf"){var b=requestAnimationFrame(v);Ym.set(s,b)}else if(typeof d=="number"){if(!Ef.has(s)){v();var w=setTimeout(v,d);Ef.set(s,w)}}else v()}}});var fue=Ae([b0],e=>e.tooltipItemPayloads),hue=Ae([fue,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var a=e.find(i=>i.settings.graphicalItemId===r);if(a!=null){var{getPosition:s}=a;if(s!=null)return s(t)}}}),_F=ms("touchMove"),kF=zh(),xc=null,bl=null,KA=null,Af=null;kF.startListening({actionCreator:_F,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){Af=wF(r);var a=t.getState(),{throttleDelay:s,throttledEvents:i}=a.eventSettings,l=i==="all"||i.includes("touchmove");xc!==null&&(cancelAnimationFrame(xc),xc=null),bl!==null&&(typeof s!="number"||!l)&&(clearTimeout(bl),bl=null),KA=Array.from(r.touches).map(d=>Jk({clientX:d.clientX,clientY:d.clientY,currentTarget:r.currentTarget}));var u=()=>{if(Af!=null){var d=t.getState(),f=ep(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=KA)===null||p===void 0?void 0:p[0];if(m==null){xc=null,bl=null;return}var x=Xk(d,m);(x==null?void 0:x.activeIndex)!=null&&t.dispatch(t9({activeIndex:x.activeIndex,activeDataKey:void 0,activeCoordinate:x.activeCoordinate}))}else if(f==="item"){var v,b=Af.touches[0];if(document.elementFromPoint==null||b==null)return;var w=document.elementFromPoint(b.clientX,b.clientY);if(!w||!w.getAttribute)return;var j=w.getAttribute(U7),k=(v=w.getAttribute(H7))!==null&&v!==void 0?v:void 0,C=hu(d).find(E=>E.id===k);if(j==null||C==null||k==null)return;var{dataKey:N}=C,O=hue(d,j,k);t.dispatch(ZR({activeDataKey:N,activeIndex:j,activeCoordinate:O,activeGraphicalItemId:k}))}xc=null,bl=null}};if(!l){u();return}s==="raf"?xc=requestAnimationFrame(u):typeof s=="number"&&bl===null&&(u(),Af=null,bl=setTimeout(()=>{Af?u():(bl=null,xc=null)},s))}}});var Qk={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},SF=pn({name:"eventSettings",initialState:Qk,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:pue}=SF.actions,mue=SF.reducer,gue=u7({brush:Aoe,cartesianAxis:yoe,chartData:dne,errorBars:Ele,eventSettings:mue,graphicalItems:Aie,layout:sY,legend:fX,options:ine,polarAxis:Use,polarOptions:due,referenceElements:Roe,renderedTicks:Joe,rootProps:iue,tooltip:kre,zIndex:Kae}),xue=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return AK({reducer:gue,preloadedState:t,middleware:a=>{var s;return a({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([pF.middleware,mF.middleware,qy.middleware,jF.middleware,kF.middleware])},enhancers:a=>{var s=a;return typeof a=="function"&&(s=a()),s.concat(S7({type:"raf"}))},devTools:{serialize:{replacer:sue},name:"recharts-".concat(r)}})};function NF(e){var{preloadedState:t,children:r,reduxStoreName:a}=e,s=Wn(),i=y.useRef(null);if(s)return r;i.current==null&&(i.current=xue(t,a));var l=m_;return y.createElement(TX,{context:l,store:i.current},r)}function yue(e){var{layout:t,margin:r}=e,a=wr(),s=Wn();return y.useEffect(()=>{s||(a(rY(t)),a(tY(r)))},[a,s,t,r]),null}var CF=y.memo(yue,Hh);function TF(e){var t=wr();return y.useEffect(()=>{t(oue(e))},[t,e]),null}var vue=e=>{var t=wr();return y.useEffect(()=>{t(pue(e))},[t,e]),null},EF=y.memo(vue,Hh);function YA(e){var{zIndex:t,isPanorama:r}=e,a=y.useRef(null),s=wr();return y.useLayoutEffect(()=>(a.current&&s(Vae({zIndex:t,element:a.current,isPanorama:r})),()=>{s(Gae({zIndex:t,isPanorama:r}))}),[s,t,r]),y.createElement("g",{tabIndex:-1,ref:a,className:"recharts-zIndex-layer_".concat(t)})}function XA(e){var{children:t,isPanorama:r}=e,a=mt(Lae);if(!a||a.length===0)return t;var s=a.filter(l=>l<0),i=a.filter(l=>l>0);return y.createElement(y.Fragment,null,s.map(l=>y.createElement(YA,{key:l,zIndex:l,isPanorama:r})),t,i.map(l=>y.createElement(YA,{key:l,zIndex:l,isPanorama:r})))}var bue=["children"];function wue(e,t){if(e==null)return{};var r,a,s=jue(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function jue(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Cx(){return Cx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Cx.apply(null,arguments)}var _ue={width:"100%",height:"100%",display:"block"},kue=y.forwardRef((e,t)=>{var r=S_(),a=N_(),s=oD();if(!Gi(r)||!Gi(a))return null;var{children:i,otherAttributes:l,title:u,desc:d}=e,f,p;return l!=null&&(typeof l.tabIndex=="number"?f=l.tabIndex:f=s?0:void 0,typeof l.role=="string"?p=l.role:p=s?"application":void 0),y.createElement(i_,Cx({},l,{title:u,desc:d,role:p,tabIndex:f,width:r,height:a,style:_ue,ref:t}),i)}),Sue=e=>{var{children:t}=e,r=mt(gy);if(!r)return null;var{width:a,height:s,y:i,x:l}=r;return y.createElement(i_,{width:a,height:s,x:l,y:i},t)},JA=y.forwardRef((e,t)=>{var{children:r}=e,a=wue(e,bue),s=Wn();return s?y.createElement(Sue,null,y.createElement(XA,{isPanorama:!0},r)):y.createElement(kue,Cx({ref:t},a),y.createElement(XA,{isPanorama:!1},r))});function Nue(){var e=wr(),[t,r]=y.useState(null),a=mt(jY);return y.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),i=s.width/t.offsetWidth;Kt(i)&&i!==a&&e(nY(i))}},[t,e,a]),r}function QA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Cue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QA(Object(r),!0).forEach(function(a){Tue(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Tue(e,t,r){return(t=Eue(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Eue(e){var t=Aue(e,"string");return typeof t=="symbol"?t:t+""}function Aue(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pl(){return Pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Pl.apply(null,arguments)}var Oue=()=>(bne(),null);function Tx(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Pue=y.forwardRef((e,t)=>{var r,a,s=y.useRef(null),[i,l]=y.useState({containerWidth:Tx((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Tx((a=e.style)===null||a===void 0?void 0:a.height)}),u=y.useCallback((f,p)=>{l(m=>{var x=Math.round(f),v=Math.round(p);return m.containerWidth===x&&m.containerHeight===v?m:{containerWidth:x,containerHeight:v}})},[]),d=y.useCallback(f=>{if(typeof t=="function"&&t(f),s.current!=null&&(s.current.disconnect(),s.current=null),f!=null&&typeof ResizeObserver!="undefined"){var{width:p,height:m}=f.getBoundingClientRect();u(p,m);var x=b=>{var w=b[0];if(w!=null){var{width:j,height:k}=w.contentRect;u(j,k)}},v=new ResizeObserver(x);v.observe(f),s.current=v}},[t,u]);return y.useEffect(()=>()=>{var f=s.current;f!=null&&f.disconnect()},[u]),y.createElement(y.Fragment,null,y.createElement($h,{width:i.containerWidth,height:i.containerHeight}),y.createElement("div",Pl({ref:d},e)))}),Due=y.forwardRef((e,t)=>{var{width:r,height:a}=e,[s,i]=y.useState({containerWidth:Tx(r),containerHeight:Tx(a)}),l=y.useCallback((d,f)=>{i(p=>{var m=Math.round(d),x=Math.round(f);return p.containerWidth===m&&p.containerHeight===x?p:{containerWidth:m,containerHeight:x}})},[]),u=y.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();l(f,p)}},[t,l]);return y.createElement(y.Fragment,null,y.createElement($h,{width:s.containerWidth,height:s.containerHeight}),y.createElement("div",Pl({ref:u},e)))}),Rue=y.forwardRef((e,t)=>{var{width:r,height:a}=e;return y.createElement(y.Fragment,null,y.createElement($h,{width:r,height:a}),y.createElement("div",Pl({ref:t},e)))}),Fue=y.forwardRef((e,t)=>{var{width:r,height:a}=e;return typeof r=="string"||typeof a=="string"?y.createElement(Due,Pl({},e,{ref:t})):typeof r=="number"&&typeof a=="number"?y.createElement(Rue,Pl({},e,{width:r,height:a,ref:t})):y.createElement(y.Fragment,null,y.createElement($h,{width:r,height:a}),y.createElement("div",Pl({ref:t},e)))});function Mue(e){return e?Pue:Fue}var Lue=y.forwardRef((e,t)=>{var{children:r,className:a,height:s,onClick:i,onContextMenu:l,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:x,onTouchEnd:v,onTouchMove:b,onTouchStart:w,style:j,width:k,responsive:C,dispatchTouchEvents:N=!0}=e,O=y.useRef(null),E=wr(),[A,T]=y.useState(null),[P,D]=y.useState(null),z=Nue(),G=__(),V=(G==null?void 0:G.width)>0?G.width:k,ne=(G==null?void 0:G.height)>0?G.height:s,ge=y.useCallback(he=>{z(he),typeof t=="function"&&t(he),T(he),D(he),he!=null&&(O.current=he)},[z,t,T,D]),Z=y.useCallback(he=>{E(hF(he)),E(Ls({handler:i,reactEvent:he}))},[E,i]),U=y.useCallback(he=>{E(Lj(he)),E(Ls({handler:f,reactEvent:he}))},[E,f]),ce=y.useCallback(he=>{E(e9()),E(Ls({handler:p,reactEvent:he}))},[E,p]),xe=y.useCallback(he=>{E(Lj(he)),E(Ls({handler:m,reactEvent:he}))},[E,m]),be=y.useCallback(()=>{E(vF())},[E]),me=y.useCallback(()=>{E(bF())},[E]),oe=y.useCallback(he=>{E(yF(he.key))},[E]),L=y.useCallback(he=>{E(Ls({handler:l,reactEvent:he}))},[E,l]),H=y.useCallback(he=>{E(Ls({handler:u,reactEvent:he}))},[E,u]),K=y.useCallback(he=>{E(Ls({handler:d,reactEvent:he}))},[E,d]),Y=y.useCallback(he=>{E(Ls({handler:x,reactEvent:he}))},[E,x]),re=y.useCallback(he=>{E(Ls({handler:w,reactEvent:he}))},[E,w]),de=y.useCallback(he=>{N&&E(_F(he)),E(Ls({handler:b,reactEvent:he}))},[E,N,b]),ie=y.useCallback(he=>{E(Ls({handler:v,reactEvent:he}))},[E,v]),se=Mue(C);return y.createElement(j9.Provider,{value:A},y.createElement(NP.Provider,{value:P},y.createElement(se,{width:V!=null?V:j==null?void 0:j.width,height:ne!=null?ne:j==null?void 0:j.height,className:Wt("recharts-wrapper",a),style:Cue({position:"relative",cursor:"default",width:V,height:ne},j),onClick:Z,onContextMenu:L,onDoubleClick:H,onFocus:be,onBlur:me,onKeyDown:oe,onMouseDown:K,onMouseEnter:U,onMouseLeave:ce,onMouseMove:xe,onMouseUp:Y,onTouchEnd:ie,onTouchMove:de,onTouchStart:re,ref:ge},y.createElement(Oue,null),r)))}),Iue=["width","height","responsive","children","className","style","compact","title","desc"];function zue(e,t){if(e==null)return{};var r,a,s=Bue(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Bue(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var AF=y.forwardRef((e,t)=>{var{width:r,height:a,responsive:s,children:i,className:l,style:u,compact:d,title:f,desc:p}=e,m=zue(e,Iue),x=yi(m);return d?y.createElement(y.Fragment,null,y.createElement($h,{width:r,height:a}),y.createElement(JA,{otherAttributes:x,title:f,desc:p},i)):y.createElement(Lue,{className:l,style:u,width:r,height:a,responsive:s!=null?s:!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},y.createElement(JA,{otherAttributes:x,title:f,desc:p,ref:t},y.createElement(Moe,null,i)))});function Ij(){return Ij=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ij.apply(null,arguments)}function ZA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function $ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZA(Object(r),!0).forEach(function(a){Uue(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZA(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Uue(e,t,r){return(t=Hue(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hue(e){var t=que(e,"string");return typeof t=="symbol"?t:t+""}function que(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wue={top:5,right:5,bottom:5,left:5},Vue=$ue({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Wue,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Qk),Gue=y.forwardRef(function(t,r){var a,s=Fa(t.categoricalChartProps,Vue),{chartName:i,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:i,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return y.createElement(NF,{preloadedState:{options:p},reduxStoreName:(a=f.id)!==null&&a!==void 0?a:i},y.createElement(eF,{chartData:f.data}),y.createElement(CF,{layout:s.layout,margin:s.margin}),y.createElement(EF,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),y.createElement(TF,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),y.createElement(AF,Ij({},s,{ref:r})))}),Kue=["axis","item"],iw=y.forwardRef((e,t)=>y.createElement(Gue,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Kue,tooltipPayloadSearcher:_9,categoricalChartProps:e,ref:t}));function Yue(e){var t=wr();return y.useEffect(()=>{t(uue(e))},[t,e]),null}var Xue=["layout"];function zj(){return zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},zj.apply(null,arguments)}function Jue(e,t){if(e==null)return{};var r,a,s=Que(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Que(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function e8(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Zue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?e8(Object(r),!0).forEach(function(a){ede(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e8(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ede(e,t,r){return(t=tde(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tde(e){var t=rde(e,"string");return typeof t=="symbol"?t:t+""}function rde(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ade={top:5,right:5,bottom:5,left:5},OF=Zue({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:ade,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Qk),nde=y.forwardRef(function(t,r){var a,s=Fa(t.categoricalChartProps,OF),{layout:i}=s,l=Jue(s,Xue),{chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:f,tooltipPayloadSearcher:p}=t,m={chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:f,tooltipPayloadSearcher:p,eventEmitter:void 0};return y.createElement(NF,{preloadedState:{options:m},reduxStoreName:(a=s.id)!==null&&a!==void 0?a:u},y.createElement(eF,{chartData:s.data}),y.createElement(CF,{layout:i,margin:s.margin}),y.createElement(EF,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),y.createElement(TF,{baseValue:void 0,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),y.createElement(Yue,{cx:s.cx,cy:s.cy,startAngle:s.startAngle,endAngle:s.endAngle,innerRadius:s.innerRadius,outerRadius:s.outerRadius}),y.createElement(AF,zj({},l,{ref:r})))});function t8(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function r8(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?t8(Object(r),!0).forEach(function(a){sde(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t8(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function sde(e,t,r){return(t=ide(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ide(e){var t=ode(e,"string");return typeof t=="symbol"?t:t+""}function ode(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lde=["item"],cde=r8(r8({},OF),{},{layout:"centric",startAngle:0,endAngle:360}),ude=y.forwardRef((e,t)=>{var r=Fa(e,cde);return y.createElement(nde,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:lde,tooltipPayloadSearcher:_9,categoricalChartProps:r,ref:t})});function dde(e){return e.replace(/&nbsp;/gi," ").replace(/&#(\d+);/g,(t,r)=>String.fromCharCode(Number(r))).replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCharCode(parseInt(r,16))).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'")}function fde(e){const t=e.replace(/<\/p>/gi,`
`).replace(/<br\s*\/?>/gi,`
`).replace(/<\/div>/gi,`
`).replace(/<\/li>/gi,`
`).replace(/<[^>]+>/g,"");return dde(t)}function Bj(e){if(e==null)return"";let t=String(e).trim();if(!t)return"";if(t.startsWith("["))try{const u=JSON.parse(t);if(Array.isArray(u)&&u.every(d=>typeof d=="string"))return u.map(d=>d.trim()).filter(Boolean).join(`
`)}catch(u){}let r=t;const a=r.match(/<div[^>]*class="[^"]*ql-editor[^"]*"[^>]*>([\s\S]*?)<\/div>/i);a&&(r=a[1].trim());const i=(/<\/?[a-z][\s\S]*>/i.test(r)?fde(r):r).replace(/\r\n/g,`
`),l=[...i.matchAll(/"((?:[^"\\]|\\.)*)"\s*,?/g)].map(u=>u[1].replace(/\\"/g,'"'));return l.length>=2?l.map(u=>u.trim()).filter(Boolean).join(`
`):l.length===1&&!i.replace(/"((?:[^"\\]|\\.)*)"\s*,?/g,"").replace(/[\s,]/g,"")?l[0].trim():i.replace(/\n{3,}/g,`
`).trim()}const Xm=["#2563eb","#4f46e5","#7c3aed","#0ea5e9","#14b8a6","#10b981","#f59e0b","#64748b","#ec4899","#06b6d4","#84cc16","#f97316","#a855f7","#2dd4bf","#eab308"],$j=["Open","Raised","Warning","Penalty","Change Requests","Problems","Letter"],hde=30,yc=1380,PF=`
/* Snapshot charts: 4 columns (xl+) / print; 2 columns smxl; 1 column on narrow screens. */
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-charts-section {
width: 100% !important;
max-width: 100% !important;
box-sizing: border-box !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-charts-four {
display: grid !important;
grid-template-columns: minmax(0, 1fr) !important;
gap: 10px !important;
align-items: stretch !important;
padding-top: 10px !important;
padding-bottom: 12px !important;
padding-left: 6px !important;
padding-right: 6px !important;
box-sizing: border-box !important;
}
@media (min-width: 640px) and (max-width: 1279px) {
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-charts-four {
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
}
@media (min-width: 1280px), print {
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-charts-four {
grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-chart-col {
min-width: 0 !important;
min-height: 0 !important;
max-width: 100% !important;
}
/* Clip horizontal bleed only; vertical overflow visible so bar heights are not clipped. */
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart-card {
overflow-x: hidden !important;
overflow-y: visible !important;
max-width: 100% !important;
box-sizing: border-box !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart-card .recharts-wrapper,
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart-card .recharts-surface {
max-width: 100% !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart.reports-chart-plot-shell,
#asm-project-reports-root .reports-project-snapshot .reports-chart-plot-shell.reports-snapshot-weekly-chart {
width: 100% !important;
max-width: 100% !important;
box-sizing: border-box !important;
min-height: 10rem !important;
height: 100% !important;
flex: 1 1 auto !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart .recharts-responsive-container {
width: 100% !important;
max-width: 100% !important;
}
/* Updates | Notes: force two columns from md+ and in print (Tailwind lg: alone stacks in print preview). */
#asm-project-reports-root .reports-snapshot-updates-notes-row {
display: grid !important;
grid-template-columns: minmax(0, 1fr) !important;
gap: 8px !important;
align-items: stretch !important;
}
@media (min-width: 768px), print {
#asm-project-reports-root .reports-snapshot-updates-notes-row {
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
}
/* Bottom task tables: three columns in print like lg: */
@media print {
#asm-project-reports-root .reports-snapshot-bottom-tasks {
display: grid !important;
grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
gap: 6px !important;
align-items: start !important;
}
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-invoice-chart {
min-height: 156px !important;
height: 156px !important;
flex-shrink: 0 !important;
overflow: hidden !important;
max-width: 100% !important;
padding: 0 !important;
}
@media print {
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-invoice-chart {
min-height: 124px !important;
height: 124px !important;
}
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-progress-row {
display: flex !important;
flex-direction: column !important;
align-items: stretch !important;
gap: 8px !important;
}
@media (min-width: 768px), print {
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-progress-row {
flex-direction: row !important;
flex-wrap: nowrap !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-progress-row > * {
flex: 1 1 0 !important;
min-width: 0 !important;
}
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-table-scroll {
max-height: 11rem !important;
overflow-y: auto !important;
overflow-x: auto !important;
}
@media print {
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-table-scroll {
max-height: 10rem !important;
overflow-y: auto !important;
overflow-x: auto !important;
-webkit-overflow-scrolling: touch !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart.reports-chart-plot-shell {
display: block !important;
min-height: 11rem !important;
height: 100% !important;
max-height: none !important;
flex: 1 1 auto !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart .recharts-responsive-container {
width: 100% !important;
height: 100% !important;
min-height: 120px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-invoice-chart .recharts-responsive-container {
width: 100% !important;
height: 100% !important;
min-height: 104px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-donut-inner {
min-height: 132px !important;
height: 132px !important;
min-width: 132px !important;
width: 132px !important;
margin-left: auto !important;
margin-right: auto !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-donut-inner .recharts-responsive-container {
width: 100% !important;
height: 100% !important;
min-height: 132px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart-card {
overflow-x: hidden !important;
overflow-y: visible !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-invoice-chart {
min-height: 128px !important;
height: 128px !important;
overflow: visible !important;
}
/* Donut card uses overflow-x-hidden on screen — some print engines clip the SVG. */
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-overall-card {
overflow: visible !important;
}
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-notes-body {
max-height: 11rem !important;
overflow-y: auto !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-donut-legend {
max-height: none !important;
overflow: visible !important;
}
/* Project Overview row: keep start/end date pills aligned with top of meta column (print/PDF flex/grid stretch) */
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-overview-inner {
align-items: start !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-overview-dates {
align-self: start !important;
justify-content: flex-start !important;
align-content: flex-start !important;
}
/* md+ and print: right-align date rows in the third column (main axis is column → do not use justify-content:end) */
@media (min-width: 768px), print {
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-overview-dates {
align-items: flex-end !important;
}
}
@media screen and (max-width: 767px) {
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-overview-dates {
align-items: flex-start !important;
}
}
/*
* Print: viewport is often < 768px so Tailwind md:grid-cols-12 does not apply — dates fall below.
* Force the same 5 + 4 + 3 column row as the dashboard.
*/
@media print {
#asm-project-reports-root .reports-snapshot-overview-inner {
display: grid !important;
grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
gap: 6px !important;
align-items: start !important;
}
#asm-project-reports-root .reports-snapshot-overview-meta {
grid-column: 1 / span 5 !important;
max-width: none !important;
}
#asm-project-reports-root .reports-snapshot-overview-timeline {
grid-column: 6 / span 4 !important;
max-width: none !important;
border-left: 1px solid #e5e7eb !important;
padding-left: 8px !important;
}
#asm-project-reports-root.dark .reports-snapshot-overview-timeline {
border-left-color: #4b5563 !important;
}
#asm-project-reports-root .reports-snapshot-overview-dates {
grid-column: 10 / span 3 !important;
max-width: none !important;
}
}
`,DF=`
${PF}
#asm-project-reports-root .reports-project-snapshot {
overflow: visible !important;
}
@media print {
/* Let the snapshot span pages so flex/grid does not squash chart cells to 0 height. */
#asm-project-reports-root .reports-project-snapshot {
page-break-inside: auto !important;
break-inside: auto !important;
}
}
@media screen {
#asm-project-reports-root .reports-project-snapshot {
page-break-inside: avoid;
break-inside: avoid;
}
}
#asm-project-reports-root .dashboard-report-project-scope { display: none !important; }
#asm-project-reports-root .reports-selected-project-banner {
display: block !important;
page-break-after: avoid !important;
break-after: avoid !important;
page-break-inside: avoid !important;
break-inside: avoid !important;
margin-bottom: 12px !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
background: #ecfdf5 !important;
border: 1px solid #2dd4bf !important;
box-shadow: none !important;
}
#asm-project-reports-root .reports-selected-project-banner p:nth-child(1) {
color: #0f766e !important;
}
#asm-project-reports-root .reports-selected-project-banner p:nth-child(2) {
color: #0f172a !important;
}
#asm-project-reports-root .reports-selected-project-banner p:nth-child(3) {
color: #475569 !important;
}
#asm-project-reports-root .reports-chart-grid {
display: grid !important;
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
gap: 10px !important;
align-items: start !important;
}
#asm-project-reports-root .reports-chart-grid > * {
min-width: 0 !important;
max-width: 100% !important;
box-sizing: border-box !important;
}
#asm-project-reports-root .reports-snapshot-split {
display: grid !important;
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
gap: 8px !important;
align-items: start !important;
}
#asm-project-reports-root .reports-snapshot-split > * {
min-width: 0 !important;
max-width: 100% !important;
box-sizing: border-box !important;
}
#asm-project-reports-root .reports-chart-grid > * {
page-break-inside: avoid !important;
break-inside: avoid !important;
overflow: hidden !important;
}
#asm-project-reports-root .reports-table-block {
page-break-inside: avoid !important;
break-inside: avoid !important;
overflow: visible !important;
}
#asm-project-reports-root {
padding: 0 !important;
margin: 0 !important;
min-height: 0 !important;
background: #fff !important;
color: #111827 !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
#asm-project-reports-root * { box-shadow: none !important; }
#asm-project-reports-root .min-h-screen { min-height: 0 !important; }
#asm-project-reports-root .mb-6 { margin-bottom: 10px !important; }
#asm-project-reports-root .mb-4 { margin-bottom: 8px !important; }
#asm-project-reports-root .mb-3 { margin-bottom: 6px !important; }
`,RF=`
@media print {
#asm-project-reports-root .reports-project-snapshot .recharts-wrapper {
overflow: visible !important;
}
}
#asm-project-reports-root .reports-chart-grid .recharts-legend-wrapper,
#asm-project-reports-root .reports-project-snapshot .recharts-legend-wrapper {
max-width: calc(100% - 8px) !important;
box-sizing: border-box !important;
}
#asm-project-reports-root .reports-chart-grid .recharts-legend-item-text,
#asm-project-reports-root .reports-project-snapshot .recharts-legend-item-text {
fill: #111827 !important;
color: #111827 !important;
font-size: 8px !important;
}
#asm-project-reports-root .reports-chart-grid .recharts-default-legend,
#asm-project-reports-root .reports-project-snapshot .recharts-default-legend {
display: flex !important;
flex-wrap: wrap !important;
justify-content: center !important;
row-gap: 2px !important;
column-gap: 8px !important;
width: 100% !important;
padding: 0 4px !important;
box-sizing: border-box !important;
}
#asm-project-reports-root .reports-chart-grid .recharts-default-legend li,
#asm-project-reports-root .reports-project-snapshot .recharts-default-legend li {
margin-right: 0 !important;
margin-left: 0 !important;
}
#asm-project-reports-root .reports-chart-grid .recharts-cartesian-axis-tick text,
#asm-project-reports-root .reports-project-snapshot .recharts-cartesian-axis-tick text {
font-size: 8px !important;
}
`,pde=`
@media print and (orientation: landscape) {
/*
* Do not set @page { size: ... } here — it locks orientation in some browsers and hides the
* print dialogs layout control. Margins only; user picks Portrait/Landscape in the dialog.
*/
@page {
margin: 2mm;
}
/*
* One landscape sheet: root scale ~80% + tighter vertical rhythm.
* (Avoid forcing height on .recharts-surface — that breaks layout; scale on the root is OK here.)
*/
#asm-project-reports-root.reports-print-root {
transform: scale(0.8) !important;
transform-origin: top left !important;
width: calc(100% / 0.8) !important;
max-width: none !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-body {
padding: 4px 6px !important;
gap: 4px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-overview-inner {
padding: 4px 6px !important;
gap: 4px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart.reports-chart-plot-shell {
min-height: 8.5rem !important;
height: 100% !important;
flex: 1 1 auto !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart .recharts-responsive-container {
min-height: 112px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-invoice-chart {
min-height: 80px !important;
height: 80px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-invoice-chart .recharts-responsive-container {
min-height: 72px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-donut-inner {
min-height: 88px !important;
height: 88px !important;
min-width: 88px !important;
width: 88px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-donut-inner .recharts-responsive-container {
min-height: 88px !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-donut-legend {
max-height: 1.9rem !important;
overflow: hidden !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-table-scroll {
max-height: 3.75rem !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-notes-body,
#asm-project-reports-root .reports-snapshot-updates-notes-row .reports-snapshot-notes-body {
max-height: 3.5rem !important;
padding: 3px 5px !important;
}
#asm-project-reports-root .reports-snapshot-updates-notes-row {
gap: 2px !important;
}
#asm-project-reports-root .reports-snapshot-bottom-tasks {
gap: 3px !important;
}
#asm-project-reports-root .reports-snapshot-bottom-tasks h3 {
margin-bottom: 1px !important;
line-height: 1 !important;
}
/* Keep each bottom table block together so headers are not orphaned on the previous page. */
#asm-project-reports-root .reports-snapshot-bottom-tasks > div {
break-inside: avoid !important;
page-break-inside: avoid !important;
}
}
`,mde=`
@media print {
@page {
margin: 3mm;
}
html, body {
height: auto !important;
margin: 0 !important;
padding: 0 !important;
overflow: visible !important;
background: #fff !important;
}
/*
* App shell (see asm-app-sidebar / asm-app-main on Sidebar + main column): hide nav chrome
* so only the report (#asm-project-reports-root) prints across the full page width.
*/
.asm-app-sidebar-backdrop {
display: none !important;
}
.asm-app-sidebar {
display: none !important;
}
.asm-app-main {
flex: none !important;
width: 100% !important;
min-width: 0 !important;
max-width: 100% !important;
overflow: visible !important;
}
.asm-app-main > header {
display: none !important;
}
.asm-app-main > div.flex-1.overflow-y-auto {
overflow: visible !important;
width: 100% !important;
max-width: 100% !important;
}
.flex.h-screen.overflow-hidden {
height: auto !important;
min-height: 0 !important;
overflow: visible !important;
}
/* Print should be the report content only (no filter row). KPI strip removed from UI. */
#asm-project-reports-root .dashboard-report-project-scope {
display: none !important;
}
/* Do not use body * visibility:hidden — blank pages in Desk / some browsers. */
/* Do not use CSS zoom on the root — breaks SVG/Recharts in print; 1:1 like dashboard (may span pages). */
#asm-project-reports-root.reports-print-root {
position: relative !important;
left: auto !important;
top: auto !important;
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
min-height: 0 !important;
margin: 0 !important;
padding: 0 !important;
box-sizing: border-box !important;
background: #fff !important;
color: #111827 !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
#asm-project-reports-root .reports-print-chrome-only {
display: none !important;
}
${DF}
${RF}
/*
* REPORT_PRINT_LAYOUT_CSS sets overflow:hidden on chart cards — fine on screen;
* in print it can clip Recharts surfaces (blank plot area with legend still visible).
*/
#asm-project-reports-root .reports-chart-grid > * {
overflow: visible !important;
}
/* Compact “Report project” banner — saves vertical space for single-page print. */
#asm-project-reports-root .reports-selected-project-banner {
padding: 3px 8px !important;
margin-bottom: 6px !important;
border-radius: 6px !important;
}
#asm-project-reports-root .reports-selected-project-banner p:nth-child(1) {
font-size: 7px !important;
letter-spacing: 0.06em !important;
margin: 0 !important;
line-height: 1.05 !important;
}
#asm-project-reports-root .reports-selected-project-banner p:nth-child(2) {
font-size: 13px !important;
margin: 2px 0 0 !important;
line-height: 1.15 !important;
}
#asm-project-reports-root .reports-selected-project-banner p:nth-child(3) {
font-size: 8px !important;
margin: 1px 0 0 !important;
line-height: 1.1 !important;
}
/* Avoid a tall empty “loading” box in print when updates are still fetching. */
#asm-project-reports-root .reports-snapshot-updates-loading {
height: auto !important;
min-height: 0 !important;
padding: 4px 0 !important;
}
}
${pde}
`;function gde(e){const t=e;return`
html { width: ${t}px !important; min-width: ${t}px !important; background: #fff !important; }
body { width: ${t}px !important; min-width: ${t}px !important; overflow: visible !important; margin: 0 !important; background: #fff !important; }
#asm-project-reports-root {
min-width: ${t}px !important;
width: ${t}px !important;
max-width: ${t}px !important;
overflow: visible !important;
box-sizing: border-box !important;
}
#asm-project-reports-root .reports-export-strip-hidden { display: none !important; }
${DF}
${RF}
#asm-project-reports-root.reports-png-export-active .reports-snapshot-split {
grid-template-columns: minmax(0, 1.34fr) minmax(0, 0.66fr) !important;
gap: 14px !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-body {
padding: 12px 14px !important;
gap: 12px !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-overview-inner {
padding: 12px 14px !important;
gap: 12px !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-overview-meta .flex.flex-wrap {
gap: 6px 14px !important;
row-gap: 6px !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-charts-four {
display: grid !important;
grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
gap: 12px !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-budget-metrics {
padding: 4px 0 !important;
line-height: 1.45 !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-invoice-chart {
min-height: 140px !important;
height: 140px !important;
overflow: hidden !important;
max-width: 100% !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-overall-card {
padding: 11px 12px !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-donut-inner {
width: 132px !important;
height: 132px !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-donut-legend {
margin-top: 8px !important;
padding: 4px 4px 10px !important;
gap: 6px 12px !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-donut-legend li {
line-height: 1.45 !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-legend-label {
max-width: 10rem !important;
white-space: normal !important;
overflow: visible !important;
text-overflow: clip !important;
line-height: 1.35 !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot .reports-snapshot-table-scroll {
max-height: 10.5rem !important;
}
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot table th,
#asm-project-reports-root.reports-png-export-active .reports-project-snapshot table td {
padding-left: 7px !important;
padding-right: 7px !important;
}
`}const xde=`
@media screen {
#asm-project-reports-root .reports-selected-project-banner {
display: none !important;
}
}
`,yde=`
@media screen {
#asm-project-reports-root .reports-dashboard-scroll-body {
max-height: min(11rem, 32vh);
overflow: auto;
overscroll-behavior: contain;
}
}
@media print {
#asm-project-reports-root .reports-dashboard-scroll-body {
max-height: 11rem !important;
overflow: auto !important;
}
}
`,vde=`
@media screen {
/* Clip card chrome only — do not set overflow on .recharts-* or charts can measure 0×0 and render blank */
#asm-project-reports-root .reports-chart-grid > * {
overflow: hidden !important;
}
}
`,bde=`
@media screen and (orientation: landscape) and (min-width: 1024px) {
#asm-project-reports-root .reports-chart-grid {
width: 100% !important;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
justify-items: stretch !important;
}
#asm-project-reports-root .reports-chart-grid > * {
min-width: 0 !important;
}
#asm-project-reports-root .reports-chart-plot-shell {
display: block !important;
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
box-sizing: border-box !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-invoice-chart {
display: block !important;
width: 100% !important;
max-width: 100% !important;
min-width: 0 !important;
box-sizing: border-box !important;
}
#asm-project-reports-root .reports-chart-plot-shell > .recharts-responsive-container,
#asm-project-reports-root .reports-snapshot-invoice-chart > .recharts-responsive-container {
width: 100% !important;
min-width: 0 !important;
}
#asm-project-reports-root .reports-project-snapshot .reports-snapshot-weekly-chart {
min-height: 12rem !important;
height: 100% !important;
flex: 1 1 auto !important;
}
}
`,wde=1,ow=500,jde=200;function _de(){return fe(this,null,function*(){const e=[];let t=0;for(let r=0;r<jde;r++){const s=(yield wt.getTasks({limit_start:t,limit_page_length:ow,order_by:"modified desc"})).data||[];if(e.push(...s),s.length<ow)break;t+=ow}return e})}function a8(e){return e.toISOString().slice(0,10)}function n8(e){const t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${a}`}function _h(e){const t=new Date(e);return t.setHours(0,0,0,0),t}function kde(e){return e.reduce((t,r)=>t+r.value,0)}function s8(e){return e.status!=="Completed"&&e.status!=="Cancelled"}function Sde(e){const t=String(e!=null?e:"").trim().toLowerCase();return t==="yes"||t==="y"||t==="1"||t==="true"}function Nde(e){const t=e.trim();if(!t)return"";const r=t.toLowerCase();for(const a of $j)if(a.toLowerCase()===r)return a;return t}function Cde(e){const t=(e||"").trim().toLowerCase();return t?t==="urgent"||t==="high"||/\burgent\b/.test(t)||/\bhigh\b/.test(t)?"High":t==="medium"||/\bmedium\b/.test(t)?"Medium":(t==="low"||/\blow\b/.test(t),"Low"):"Low"}function Tde(e,t){var a;const r=new Map;for(const s of e){const i=t(s)||"Unknown";r.set(i,((a=r.get(i))!=null?a:0)+1)}return[...r.entries()].map(([s,i])=>({name:s,value:i})).sort((s,i)=>i.value-s.value)}function i8(e,t){const r=_h(t).getTime()-_h(e).getTime();return Math.floor(r/(1440*60*1e3))}function Uj(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:_h(t)}function Ede(e,t){const r=Uj(e||void 0),a=Uj(t||void 0);if(!r||!a)return{durationDays:0,elapsedDays:0,pctElapsed:0};const s=Math.max(1,i8(r,a)),i=_h(new Date),l=a<i?a:i,u=l<r?0:i8(r,l),d=Math.min(100,Math.round(u/s*100));return{durationDays:s,elapsedDays:u,pctElapsed:d}}function lw(e){const t=Uj(e||void 0);if(!t)return"—";const r=String(t.getDate()).padStart(2,"0"),a=String(t.getMonth()+1).padStart(2,"0"),s=t.getFullYear();return`${r}/${a}/${s}`}function Ade(e){const t=e.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"2-digit"}).replace(/,/g,"").trim().split(/\s+/);return t.length>=3?`${t[0]}-${t[1]}-${t[2]}`:e.toLocaleDateString("en-GB")}const o8="(orientation: landscape) and (min-width: 1024px)";function Ode(){return y.useSyncExternalStore(e=>{if(typeof window=="undefined")return()=>{};const t=window.matchMedia(o8),r=()=>e();return t.addEventListener("change",r),window.addEventListener("resize",r),()=>{t.removeEventListener("change",r),window.removeEventListener("resize",r)}},()=>typeof window!="undefined"?window.matchMedia(o8).matches:!1,()=>!1)}function Pde(){const[e,t]=y.useState(!1);return y.useEffect(()=>{const r=()=>{let l=!1;try{l=window.matchMedia("print").matches}catch(u){l=!1}t(l)},a=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(!0)})})},s=()=>t(!1);window.addEventListener("beforeprint",a),window.addEventListener("afterprint",s);let i=null;try{i=window.matchMedia("print"),i.addEventListener("change",r)}catch(l){}return()=>{window.removeEventListener("beforeprint",a),window.removeEventListener("afterprint",s),i==null||i.removeEventListener("change",r)}},[]),e}function l8(e,t,r){const[a,s]=y.useState({width:t,height:r});return y.useLayoutEffect(()=>{const i=e.current;if(!i||typeof ResizeObserver=="undefined")return;const l=()=>{const d=i.getBoundingClientRect(),f=Math.floor(d.width),p=Math.floor(d.height);if(f<=0)return;const m=Math.max(96,p);s(x=>x.width===f&&x.height===m?x:{width:f,height:m})};l();const u=new ResizeObserver(l);return u.observe(i),()=>u.disconnect()},[e]),a}const cw=({active:e,payload:t,label:r})=>{var l;if(!e||!(t!=null&&t.length))return null;const a=(l=t[0])==null?void 0:l.payload,s=a==null?void 0:a.docname,i=(a==null?void 0:a.label)!=null?String(a.label):"";return n.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800 px-3 py-2 shadow-lg text-xs",children:[n.jsx("div",{className:"font-semibold text-gray-800 dark:text-gray-100 mb-0.5",children:s||i||r}),t.map((u,d)=>n.jsxs("div",{className:"text-gray-600 dark:text-gray-300",children:[u.name,": ",n.jsx("span",{className:"font-mono font-semibold",children:u.value})]},d))]})};function Dde(e){const t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))return"";const r=Math.abs(t);return r>=1e6?`${(t/1e6).toFixed(r>=1e7?0:1)}M`:r>=1e3?`${Math.round(t/1e3)}k`:`${Math.round(t)}`}const Rde=()=>{var Si,ju,Gl,Yo,Ni,_u,Kl,Qi;const{t:e}=sr(),t=Ode(),r=Pde(),a=y.useRef(null),s=y.useRef(null),i=r?216:t?296:272,l=l8(a,220,i),u=l8(s,220,i),d=Ut(),[f,p]=dn(),m=(Si=f.get("project"))!=null?Si:"",x=y.useMemo(()=>{const Ne=new Date,Qe=new Date;return Qe.setDate(Qe.getDate()-hde),{from:a8(Qe),to:a8(Ne)}},[]),[v,b]=y.useState(!0),[w,j]=y.useState(""),[k,C]=y.useState([]),[N,O]=y.useState([]),[E,A]=y.useState(""),[T,P]=y.useState([]),[D,z]=y.useState(!1),[G,V]=y.useState([]),[ne,ge]=y.useState(!1),[Z,U]=y.useState(0),[ce,xe]=y.useState(!1),[be,me]=y.useState(""),oe=y.useRef(null),L=y.useRef(null),[H,K]=y.useState(!1),[Y,re]=y.useState(null),[de,ie]=y.useState([]),[se,he]=y.useState(!1),_e=y.useCallback(()=>fe(null,null,function*(){b(!0),j("");try{const Ne=yield Promise.allSettled([wt.getProjectCount({status:"Open"}),wt.getTaskCount({status:["!=","Completed"]}),wt.getProjects({filters:{status:"Open"},limit_page_length:2e3,order_by:"modified desc",fields:["name","project_name","status","total_billed_amount","total_sales_amount","estimated_costing","percent_complete","expected_start_date","expected_end_date","department","customer","company","notes"]})]),ht=((Q,ae)=>Ne[Q].status==="fulfilled"?Ne[Q].value:ae)(2,{data:[]}),W=yield _de();C(W||[]),O(ht.data),A(Q=>{var pe;const ue=new URLSearchParams(window.location.search).get("project");return ue&&ht.data.some(Pe=>Pe.name===ue)?ue:Q&&ht.data.some(Pe=>Pe.name===Q)?Q:((pe=ht.data[0])==null?void 0:pe.name)||""});const le=Ne.map((Q,ae)=>Q.status==="rejected"?ae:-1).filter(Q=>Q!==-1);le.length&&j(`Some data failed to load (sources: ${le.join(", ")}).`)}catch(Ne){const Qe=typeof(Ne==null?void 0:Ne.message)=="string"?Ne.message:"Failed to load dashboard data.";j(Qe),O([]),C([])}finally{b(!1)}}),[x.from,x.to]);y.useEffect(()=>{_e()},[_e]),y.useEffect(()=>{if(!E){ie([]);return}let Ne=!1;return he(!0),wt.getMergedProjectProgressUpdates(E).then(Qe=>{Ne||ie(Qe)}).catch(()=>{Ne||ie([])}).finally(()=>{Ne||he(!1)}),()=>{Ne=!0}},[E,Z]);const F=y.useCallback(()=>{U(Ne=>Ne+1),_e()},[_e]),X=y.useCallback(()=>{window.dispatchEvent(new Event("resize")),requestAnimationFrame(()=>{window.print()})},[]),R=y.useCallback(()=>fe(null,null,function*(){const Ne=L.current;if(!Ne)return;K(!0);const Qe=window.scrollY,ht=Ne.style.width,W=Ne.style.maxWidth,le=Ne.style.boxSizing;window.scrollTo(0,0),yield new Promise(Q=>{requestAnimationFrame(()=>requestAnimationFrame(()=>Q()))}),yield new Promise(Q=>setTimeout(Q,450));try{Ne.classList.add("reports-png-export-active"),Ne.style.setProperty("width",`${yc}px`,"important"),Ne.style.setProperty("max-width",`${yc}px`,"important"),Ne.style.setProperty("box-sizing","border-box","important"),window.dispatchEvent(new Event("resize")),yield new Promise(et=>{requestAnimationFrame(()=>requestAnimationFrame(()=>et()))}),yield new Promise(et=>setTimeout(et,200));const Q=(yield Mf(()=>fe(null,null,function*(){const{default:et}=yield import("./html2canvas.esm-CdCzsqWY.js");return{default:et}}),[])).default,ae=et=>{const Je=et.createElement("style");Je.textContent=gde(yc),et.head.appendChild(Je);const it=et.getElementById("asm-project-reports-root");if(it){const lt=it;lt.style.setProperty("overflow","visible","important"),lt.style.setProperty("max-height","none","important")}et.documentElement.style.width=`${yc}px`,et.body.style.width=`${yc}px`,et.querySelectorAll(".print-hidden").forEach(lt=>{var Yt;(Yt=lt.parentNode)==null||Yt.removeChild(lt)}),et.querySelectorAll(".reports-selected-project-banner").forEach(lt=>{lt.style.setProperty("display","block","important")}),et.querySelectorAll("#asm-project-reports-root *").forEach(lt=>{const Yt=lt;if(Yt.closest(".reports-project-snapshot"))return;const or=et.defaultView;if(or)try{const pr=or.getComputedStyle(Yt).overflowY;(pr==="auto"||pr==="scroll")&&(Yt.style.setProperty("overflow","visible","important"),Yt.style.setProperty("max-height","none","important"))}catch(pr){}})},ue=yc,pe=Ne.scrollHeight,Pe=15800;let Ue=Math.min(2.25,Math.max(1,window.devicePixelRatio||1))*wde;for(;pe*Ue>Pe||ue*Ue>Pe;)Ue*=.88;Ue=Math.max(.22,Ue);const Fe=yield Q(Ne,{scale:Ue,width:ue,height:pe,windowWidth:yc,windowHeight:pe,scrollX:0,scrollY:0,x:0,y:0,useCORS:!0,allowTaint:!0,foreignObjectRendering:!1,logging:!1,backgroundColor:"#ffffff",imageTimeout:2e4,onclone:ae}),Me=yield new Promise(et=>{Fe.toBlob(Je=>et(Je),"image/png",.92)});if(!Me)throw new Error("no blob");const Le=URL.createObjectURL(Me),Ye=document.createElement("a"),rt=E?E.replace(/[^a-zA-Z0-9-_]+/g,"_").slice(0,80):"all-projects";Ye.href=Le,Ye.download=`project-reports-${rt}-${new Date().toISOString().slice(0,10)}.png`,Ye.rel="noopener",document.body.appendChild(Ye),Ye.click(),document.body.removeChild(Ye),URL.revokeObjectURL(Le)}catch(Q){window.alert("Could not export an image of this page. Use Print and choose “Save as PDF” instead.")}finally{Ne.classList.remove("reports-png-export-active"),Ne.style.width=ht,Ne.style.maxWidth=W,Ne.style.boxSizing=le,window.dispatchEvent(new Event("resize")),window.scrollTo(0,Qe),K(!1)}}),[E]),I=y.useCallback(Ne=>{A(Ne),p(Qe=>{const ht=new URLSearchParams(Qe);return Ne?ht.set("project",Ne):ht.delete("project"),ht},{replace:!0})},[p]);y.useEffect(()=>{N.length&&m&&N.some(Ne=>Ne.name===m)&&A(Ne=>Ne===m?Ne:m)},[m,N]),y.useEffect(()=>{if(!ce)return;const Ne=Qe=>{const ht=oe.current;ht&&!ht.contains(Qe.target)&&(xe(!1),me(""))};return document.addEventListener("mousedown",Ne),()=>document.removeEventListener("mousedown",Ne)},[ce]),y.useEffect(()=>{if(!E){re(null);return}let Ne=!1;return wt.getProject(E).then(Qe=>{Ne||re(Qe)}).catch(()=>{Ne||re(null)}),()=>{Ne=!0}},[E,Z]);const te=y.useMemo(()=>{const Ne=be.trim().toLowerCase();return Ne?N.filter(Qe=>{const ht=(Qe.project_name||"").toLowerCase(),W=(Qe.name||"").toLowerCase();return ht.includes(Ne)||W.includes(Ne)}):N},[N,be]),q=y.useMemo(()=>E?k.filter(Ne=>String(Ne.project||"")===E):k,[k,E]);y.useEffect(()=>{if(!E){P([]);return}let Ne=!1;return z(!0),wt.getTasksForProject(E,{limit_page_length:500}).then(Qe=>{Ne||P(Qe.data)}).catch(()=>{Ne||P([])}).finally(()=>{Ne||z(!1)}),()=>{Ne=!0}},[E,Z]),y.useEffect(()=>{if(!E){V([]);return}let Ne=!1;ge(!0);const Qe=["name","posting_date","grand_total","currency","docstatus","status"];return Promise.all([cs.getSalesOrderNamesForProject(E,1e3).then(ht=>ht.length?Ii.getSalesInvoicesBySalesOrders({salesOrders:ht,limit:1e3,orderBy:"posting_date asc",fields:[...Qe]}):[]),Ii.getSalesInvoicesLinkedToProject({project:E,limit:1e3,orderBy:"posting_date asc",fields:[...Qe]})]).then(([ht,W])=>{if(Ne)return;const le=new Map;for(const ae of ht)ae!=null&&ae.name&&le.set(ae.name,ae);for(const ae of W)ae!=null&&ae.name&&le.set(ae.name,ae);const Q=[...le.values()].sort((ae,ue)=>String(ae.posting_date||"").localeCompare(String(ue.posting_date||"")));V(Q)}).catch(()=>{Ne||V([])}).finally(()=>{Ne||ge(!1)}),()=>{Ne=!0}},[E,Z]);const B=y.useMemo(()=>N.find(Ne=>Ne.name===E),[N,E]),je=y.useMemo(()=>{if(!E)return null;const Ne=B,Qe=Y;return!Ne&&!Qe?null:ee(ee({},Ne||{}),Qe||{})},[E,B,Y]),Ce=y.useMemo(()=>Ede(je==null?void 0:je.expected_start_date,je==null?void 0:je.expected_end_date),[je==null?void 0:je.expected_start_date,je==null?void 0:je.expected_end_date]),ye=y.useMemo(()=>Ade(new Date),[Z]),Ee=y.useMemo(()=>{var ht,W;const Ne=B;if(!Ne)return 0;const Qe=Number((W=(ht=Ne.estimated_costing)!=null?ht:Ne.total_sales_amount)!=null?W:0);return Number.isFinite(Qe)?Qe:0},[B]),Xe=y.useMemo(()=>{var ht;const Ne=B;if(!Ne)return 0;const Qe=Number((ht=Ne.total_billed_amount)!=null?ht:0);return Number.isFinite(Qe)?Qe:0},[B]),tt=Math.max(0,Ee-Xe),ve=Ee>0?Math.min(100,Math.round(Xe/Ee*100)):0,Oe=y.useMemo(()=>Ee?(G||[]).filter(Qe=>{var ht;return((ht=Qe.docstatus)!=null?ht:0)!==2}).slice(0,12).map((Qe,ht)=>{var Q;const W=Math.max(0,Number((Q=Qe.grand_total)!=null?Q:0)||0),le=Math.max(0,Ee-W);return{name:`INVOICE ${ht+1}`,key:Qe.name,docname:Qe.name,spent:W,remaining:le}}):[],[G,Ee]),st=_h(new Date),ct=new Date(st);ct.setDate(ct.getDate()-7);const ot=n8(st),Ze=n8(ct),St=y.useMemo(()=>Tde(T,Ne=>Ne.status||"Unknown"),[T]),Ir=y.useMemo(()=>kde(St),[St]),Xr=y.useMemo(()=>T.filter(Ne=>{if(Ne.status==="Completed"||Ne.status==="Cancelled")return!1;const Qe=Ne.exp_end_date?String(Ne.exp_end_date).slice(0,10):"";return Qe?Qe>=Ze&&Qe<ot:!1}).slice(0,12),[T,Ze,ot]),jr=y.useMemo(()=>T.filter(Ne=>{if(Ne.status==="Completed"||Ne.status==="Cancelled")return!1;const Qe=Ne.exp_end_date?String(Ne.exp_end_date).slice(0,10):"";return Qe&&Qe>=ot}).sort((Ne,Qe)=>(Ne.exp_end_date||"").localeCompare(Qe.exp_end_date||"")).slice(0,12),[T,ot]),ea=y.useMemo(()=>{const Ne=q.filter(s8).filter(le=>Sde(le.custom_risk));let Qe=0,ht=0,W=0;for(const le of Ne){const Q=Cde(le.priority);Q==="High"?Qe+=1:Q==="Medium"?ht+=1:W+=1}return[{name:"High",count:Qe,fill:"#ef4444"},{name:"Medium",count:ht,fill:"#14b8a6"},{name:"Low",count:W,fill:"#22c55e"}]},[q]),ma=y.useMemo(()=>{var ht;const Ne=q.filter(s8),Qe=new Map;for(const W of $j)Qe.set(W,0);for(const W of Ne){const le=Nde(String(W.custom_action||""));!le||!Qe.has(le)||Qe.set(le,((ht=Qe.get(le))!=null?ht:0)+1)}return $j.map(W=>{var le;return{name:W.length>11?`${W.slice(0,8)}…`:W,fullLabel:W,KPI:(le=Qe.get(W))!=null?le:0}})},[q]),wu=y.useMemo(()=>ea.reduce((Ne,Qe)=>Math.max(Ne,Number(Qe.count)||0),0),[ea]),Wl=y.useMemo(()=>Math.max(5,wu),[wu]),Vl=y.useMemo(()=>ma.reduce((Ne,Qe)=>Math.max(Ne,Number(Qe.KPI)||0),0),[ma]),ki=y.useMemo(()=>Math.max(5,Vl),[Vl]),Js=y.useMemo(()=>T.filter(Ne=>String(Ne.custom_task_obstacle||"").trim()).sort((Ne,Qe)=>String(Ne.exp_end_date||"").localeCompare(String(Qe.exp_end_date||""))).slice(0,40),[T]),Ji=Ne=>{try{if(Ne._assign){const Qe=JSON.parse(Ne._assign);if(Array.isArray(Qe)&&Qe[0])return String(Qe[0])}}catch(Qe){}return Ne.owner||"—"},mn="reports-chart-plot-shell reports-snapshot-weekly-chart w-full min-w-0 flex-1 h-full min-h-[10rem]",ws=r?!1:"auto";return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:mde}}),n.jsx("style",{dangerouslySetInnerHTML:{__html:PF}}),n.jsx("style",{dangerouslySetInnerHTML:{__html:vde}}),n.jsx("style",{dangerouslySetInnerHTML:{__html:bde}}),n.jsx("style",{dangerouslySetInnerHTML:{__html:xde}}),n.jsx("style",{dangerouslySetInnerHTML:{__html:yde}}),n.jsxs("div",{ref:L,id:"asm-project-reports-root",className:"reports-print-root p-6 min-h-screen bg-gray-50 dark:bg-gray-900",children:[n.jsxs("div",{className:"reports-print-chrome-only flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("button",{type:"button",onClick:()=>d("/projects"),className:"mt-1 p-2 rounded-lg text-gray-500 hover:text-gray-800 dark:hover:text-gray-200 border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800",children:n.jsx(da,{size:14})}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-11 h-11 rounded-xl bg-gradient-to-br from-teal-500 to-cyan-600 flex items-center justify-center shadow-md",children:n.jsx(tT,{className:"text-white text-lg"})}),n.jsx("div",{children:n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:e("projects.reportsDashboardTitle","Project reports")})})]})]}),n.jsxs("div",{className:"reports-export-strip-hidden print:hidden flex flex-wrap items-center justify-end gap-2",children:[n.jsxs("button",{type:"button",onClick:X,className:"inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-semibold text-white bg-violet-600 hover:bg-violet-700 shadow-sm border border-violet-700/30",children:[n.jsx(bq,{size:13}),"Print"]}),n.jsxs("button",{type:"button",onClick:R,disabled:H||v,className:"!hidden inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-semibold text-white bg-emerald-600 hover:bg-emerald-700 shadow-sm border border-emerald-700/30 disabled:opacity-50 disabled:pointer-events-none",children:[H?n.jsx(vt,{className:"animate-spin",size:13}):n.jsx(hn,{size:13}),"Export"]}),n.jsx("button",{type:"button",onClick:F,disabled:v,title:e("common.refresh","Refresh"),"aria-label":e("common.refresh","Refresh"),className:"inline-flex items-center justify-center p-2.5 rounded-lg bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-200 hover:border-teal-400 hover:text-teal-700 shadow-sm disabled:opacity-50",children:n.jsx(en,{size:14,className:v?"animate-spin":""})})]})]}),w&&n.jsx("div",{className:"mb-6 rounded-xl border border-rose-200 dark:border-rose-800 bg-rose-50/80 dark:bg-rose-950/30 px-4 py-3 text-sm text-rose-900 dark:text-rose-100",children:n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"font-semibold",children:"Reports couldnt load completely"}),n.jsx("p",{className:"text-xs opacity-80 break-words",children:w})]}),n.jsxs("button",{type:"button",onClick:F,className:"shrink-0 inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-white/90 dark:bg-gray-800/70 border border-rose-200 dark:border-rose-700 text-xs font-semibold hover:shadow",children:[n.jsx(en,{size:11,className:v?"animate-spin":""}),"Retry"]})]})}),n.jsxs("div",{className:"dashboard-report-project-scope mb-6 rounded-2xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 shadow-md px-4 py-3 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:e("projects.reportProjectFilter","Report project")}),n.jsx("p",{className:"text-[11px] text-gray-500 dark:text-gray-400 mt-0.5",children:e("projects.reportProjectFilterHint","Selection applies to charts, KPIs, and tasks. Project snapshot and project updates appear only when a project is selected.")})]}),n.jsxs("div",{ref:oe,className:"relative w-full sm:w-[min(28rem,100%)] shrink-0",children:[n.jsx("label",{htmlFor:"report-project-search-global",className:"text-[11px] font-medium text-gray-600 dark:text-gray-300 sr-only",children:e("projects.reportProjectFilter","Report project")}),n.jsxs("button",{type:"button",onClick:()=>{xe(Ne=>!Ne),ce||me("")},className:"w-full flex items-center justify-between gap-2 text-left text-sm rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-900/50 text-gray-900 dark:text-white px-3 py-2.5 hover:border-teal-400 focus:outline-none focus:ring-2 focus:ring-teal-400/40",children:[n.jsx("span",{className:"truncate",children:E?((ju=N.find(Ne=>Ne.name===E))==null?void 0:ju.project_name)||E:e("projects.selectProjectPlaceholder","Select project…")}),n.jsx(nr,{size:12,className:`shrink-0 opacity-70 transition-transform ${ce?"rotate-180":""}`})]}),ce&&n.jsxs("div",{className:"absolute right-0 z-[70] mt-1 w-full min-w-[16rem] max-h-[min(24rem,70vh)] flex flex-col rounded-lg border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800 shadow-xl overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-2 px-2 py-2 border-b border-gray-100 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx(fn,{className:"text-gray-400 shrink-0 text-xs"}),n.jsx("input",{id:"report-project-search-global",type:"search",value:be,onChange:Ne=>me(Ne.target.value),placeholder:e("projects.searchProjectPlaceholder","Search by name or ID…"),autoComplete:"off",className:"flex-1 min-w-0 bg-transparent text-sm text-gray-900 dark:text-white placeholder:text-gray-400 focus:outline-none"})]}),n.jsxs("ul",{className:"overflow-y-auto max-h-[min(20rem,60vh)] py-1 text-sm",children:[n.jsx("li",{children:n.jsx("button",{type:"button",className:"w-full text-left px-3 py-2 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700",onClick:()=>{I(""),xe(!1),me("")},children:e("projects.clearProjectSelection","Clear selection")})}),te.length===0?n.jsx("li",{className:"px-3 py-4 text-center text-gray-400 text-xs",children:e("projects.noMatchingOpenProjects","No matching open projects.")}):te.map(Ne=>n.jsx("li",{children:n.jsxs("button",{type:"button",className:`w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 ${Ne.name===E?"bg-teal-50 dark:bg-teal-900/30 text-teal-800 dark:text-teal-200 font-medium":"text-gray-800 dark:text-gray-200"}`,onClick:()=>{I(Ne.name),xe(!1),me("")},children:[n.jsx("span",{className:"block truncate",children:Ne.project_name||Ne.name}),n.jsx("span",{className:"block text-[10px] text-gray-400 font-mono truncate",children:Ne.name})]})},Ne.name))]}),N.length>=2e3&&n.jsx("p",{className:"px-3 py-1.5 text-[10px] text-gray-500 border-t border-gray-100 dark:border-gray-700 bg-gray-50/80 dark:bg-gray-900/30",children:e("projects.projectPickerLimitNote","Showing up to 2,000 most recently modified open projects. Refine search to find one.")})]})]})]}),E&&n.jsxs("div",{className:"reports-selected-project-banner mb-5 rounded-xl border border-teal-200 bg-teal-50/95 px-4 py-3 text-center shadow-sm dark:border-teal-800 dark:bg-teal-950/50",children:[n.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-teal-700 dark:text-teal-300",children:e("projects.reportProjectFilter","Report project")}),n.jsx("p",{className:"mt-1 text-lg sm:text-xl font-semibold text-gray-900 dark:text-white",children:((Gl=N.find(Ne=>Ne.name===E))==null?void 0:Gl.project_name)||E}),n.jsx("p",{className:"mt-0.5 text-[11px] text-gray-500 dark:text-gray-400 font-mono tabular-nums",children:E})]}),E?n.jsx(n.Fragment,{children:n.jsxs("div",{className:"reports-project-snapshot bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 shadow-sm overflow-x-auto overflow-y-visible mb-3",children:[n.jsx("div",{className:"flex flex-col gap-0.5 px-2 py-1 bg-gradient-to-r from-teal-600 to-emerald-700 text-white",children:n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n.jsx(Id,{size:12,className:"shrink-0 opacity-95"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"text-[10px] font-bold leading-tight",children:"Project snapshot"}),n.jsxs("p",{className:"text-[9px] text-white/85 leading-snug line-clamp-2",children:[n.jsx("span",{className:"text-white/90",children:"Using "}),n.jsx("span",{className:"font-semibold text-white",children:((Yo=N.find(Ne=>Ne.name===E))==null?void 0:Yo.project_name)||E}),n.jsx("span",{className:"text-white/90",children:" from the report filter."})]})]})]})}),n.jsxs("div",{className:"reports-snapshot-body p-1.5 flex flex-col gap-2.5",children:[E&&je&&n.jsxs("div",{className:"rounded-md border border-gray-200 dark:border-gray-600 overflow-hidden shadow-sm bg-white dark:bg-gray-800",children:[n.jsx("div",{className:"bg-gradient-to-r from-slate-800 to-blue-900 text-white text-center py-0.5 px-2",children:n.jsx("h2",{className:"text-[9px] font-bold tracking-wide leading-none",children:e("projects.projectOverviewBanner","Project Overview")})}),n.jsxs("div",{className:"reports-snapshot-overview-inner p-1.5 grid grid-cols-1 md:grid-cols-12 gap-1.5 items-start",children:[n.jsxs("div",{className:"reports-snapshot-overview-meta md:col-span-5 min-w-0 text-[10px] text-gray-800 dark:text-gray-200 leading-snug space-y-0.5 self-start",children:[n.jsxs("p",{className:"font-semibold line-clamp-2",children:[n.jsx("span",{className:"font-bold",children:e("projects.overviewProjectNameLabel","Project Name :")})," ",je.project_name||je.name]}),n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0 text-[10px]",children:[n.jsxs("span",{children:[n.jsx("span",{className:"font-bold",children:e("projects.overviewDepartmentLabel","Department:")})," ",je.department?String(je.department):"—"]}),n.jsxs("span",{children:[n.jsx("span",{className:"font-bold",children:e("projects.overviewDateLabel","DATE:")})," ",ye]}),n.jsxs("span",{children:[n.jsx("span",{className:"font-bold",children:e("projects.overviewProgressLabel","Progress:")})," ",Ir>0&&(Ni=je.percent_complete)!=null?Ni:0,"%"]}),n.jsxs("span",{children:[n.jsx("span",{className:"font-bold",children:e("projects.overviewCustomerLabel","Customer:")})," ",je.customer||"—"]})]})]}),n.jsxs("div",{className:"reports-snapshot-overview-timeline md:col-span-4 min-w-0 md:border-l md:border-gray-200 dark:md:border-gray-600 md:pl-2 space-y-1 self-start",children:[n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n.jsx("span",{className:"text-[9px] font-semibold underline decoration-gray-400 shrink-0 w-[5.75rem]",children:e("projects.overviewDatesUpToday","Dates up today")}),n.jsxs("div",{className:"flex-1 flex items-center gap-1.5 min-w-0",children:[n.jsx("div",{className:"h-2 flex-1 bg-gray-100 dark:bg-gray-700 rounded-full overflow-hidden min-w-0",children:n.jsx("div",{className:"h-full bg-blue-600 dark:bg-blue-500 rounded-full transition-all",style:{width:`${Ce.durationDays?Ce.pctElapsed:0}%`}})}),n.jsx("span",{className:"text-[9px] font-mono tabular-nums font-semibold text-gray-800 dark:text-gray-100 shrink-0",children:Ce.durationDays?Ce.elapsedDays:"—"})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[n.jsx("span",{className:"text-[9px] font-semibold underline decoration-gray-400 shrink-0 w-[5.75rem]",children:e("projects.overviewProjectDuration","Project Duration")}),n.jsxs("div",{className:"flex-1 flex items-center gap-1.5 min-w-0",children:[n.jsx("div",{className:"h-2 flex-1 bg-gray-100 dark:bg-gray-700 rounded-full overflow-hidden min-w-0",children:n.jsx("div",{className:"h-full bg-blue-600 dark:bg-blue-500 rounded-full w-full"})}),n.jsx("span",{className:"text-[9px] font-mono tabular-nums font-semibold text-gray-800 dark:text-gray-100 shrink-0",children:Ce.durationDays||"—"})]})]})]}),n.jsxs("div",{className:"reports-snapshot-overview-dates md:col-span-3 flex flex-col gap-1.5 self-start items-start md:items-end",children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"text-[9px] font-semibold text-gray-600 dark:text-gray-300 whitespace-nowrap",children:e("projects.overviewStartDateLabel","Start:")}),n.jsx("span",{className:"inline-flex rounded bg-teal-700 dark:bg-teal-800 text-white text-[10px] font-medium px-1.5 py-0.5 tabular-nums",children:lw(je.expected_start_date)})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("span",{className:"text-[9px] font-semibold text-gray-600 dark:text-gray-300 whitespace-nowrap",children:e("projects.overviewEndDateLabel","End:")}),n.jsx("span",{className:"inline-flex rounded bg-teal-700 dark:bg-teal-800 text-white text-[10px] font-medium px-1.5 py-0.5 tabular-nums",children:lw(je.expected_end_date)})]})]})]})]}),n.jsxs("div",{className:"reports-snapshot-charts-section rounded-md border border-gray-200 dark:border-gray-600 overflow-x-auto shadow-sm bg-white dark:bg-gray-800",children:[n.jsx("div",{className:"bg-gradient-to-r from-slate-800 via-slate-800 to-blue-900 text-white text-center py-1.5 px-2",children:n.jsx("h2",{className:"text-[9px] font-bold tracking-wide leading-none",children:e("projects.weeklyProjectStatus","Weekly Project status")})}),n.jsxs("div",{className:"reports-snapshot-charts-four grid min-w-0",children:[n.jsxs("div",{className:"reports-snapshot-chart-col flex flex-col min-w-0 min-h-0 max-w-full rounded-md border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800/90 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-1 px-1.5 py-0.5 bg-gradient-to-r from-teal-600 to-cyan-600 text-white shrink-0",children:[n.jsx(tT,{className:"shrink-0 opacity-95",size:11,"aria-hidden":!0}),n.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wide leading-none",children:e("projects.snapshotProjectBudget","Project budget")})]}),n.jsx("div",{className:"flex flex-1 min-h-0 flex-col gap-1.5 p-1.5 min-w-0",children:B?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"rounded-md border border-gray-200 dark:border-gray-600 p-1.5 bg-white dark:bg-gray-800/90 shadow-sm shrink-0 min-w-0 w-full",children:[n.jsxs("div",{className:"flex items-start justify-between gap-1.5",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-[9px] font-bold uppercase tracking-wide text-gray-600 dark:text-gray-300",children:"Budget & Billing"}),n.jsx("p",{className:"text-[9px] text-gray-500 dark:text-gray-400 leading-tight mt-0.5 line-clamp-2",children:"Budget = estimated / sales · Used = billed"})]}),n.jsxs("span",{className:"text-[9px] font-mono bg-gray-100 dark:bg-gray-700/80 text-gray-800 dark:text-gray-100 px-1 py-0.5 rounded shrink-0",children:[ve,"%"]})]}),n.jsxs("p",{className:"reports-snapshot-budget-metrics mt-1.5 text-[9px] leading-snug text-gray-700 dark:text-gray-200 tabular-nums",children:[n.jsx("span",{className:"text-gray-500",children:"Total"})," ",n.jsx("span",{className:"font-semibold text-gray-900 dark:text-white",children:Ee.toLocaleString()}),n.jsx("span",{className:"mx-1 text-gray-300 dark:text-gray-600",children:"·"}),n.jsx("span",{className:"text-gray-500",children:"Used"})," ",n.jsx("span",{className:"font-semibold text-gray-900 dark:text-white",children:Xe.toLocaleString()}),n.jsx("span",{className:"mx-1 text-gray-300 dark:text-gray-600",children:"·"}),n.jsx("span",{className:"text-gray-500",children:"Balance"})," ",n.jsx("span",{className:"font-semibold text-gray-900 dark:text-white",children:tt.toLocaleString()})]}),n.jsxs("div",{className:"mt-1",children:[n.jsx("div",{className:"h-1 w-full bg-gray-100 dark:bg-gray-700/50 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-gradient-to-r from-teal-500 to-emerald-600 rounded-full transition-all",style:{width:`${ve}%`}})}),n.jsxs("div",{className:"mt-0.5 flex items-center justify-between text-[8px] text-gray-500 leading-none",children:[n.jsx("span",{children:"0"}),n.jsx("span",{children:Ee.toLocaleString()})]})]})]}),n.jsxs("div",{className:"rounded-md border border-gray-200 dark:border-gray-600 p-1.5 flex flex-col min-w-0 min-h-0 flex-1 bg-white dark:bg-gray-800/90 shadow-sm",children:[n.jsx("p",{className:"text-[9px] font-bold uppercase tracking-wide text-gray-600 dark:text-gray-300 leading-none shrink-0",children:"Budget (by invoice)"}),n.jsx("p",{className:"text-[8px] text-gray-500 dark:text-gray-400 mb-0.5 mt-0.5 leading-tight line-clamp-1 shrink-0",children:"Linked via SO lines or Project · stacked per invoice"}),n.jsx("div",{className:`reports-snapshot-invoice-chart mx-auto w-[calc(100%-8px)] max-w-full rounded border border-gray-200 dark:border-gray-600 bg-white/70 dark:bg-gray-800/60 ${t?"min-h-[9.75rem] h-[9.75rem]":"min-h-[9.25rem] h-[9.25rem]"}`,children:ne?n.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:n.jsx(vt,{className:"animate-spin text-sm"})}):Oe.length===0?n.jsx("div",{className:"h-full flex items-center justify-center text-[10px] text-gray-400 text-center px-1",children:"No linked Sales Invoices."}):n.jsx(Im,{width:"100%",height:"100%",minHeight:112,debounce:r?0:32,children:n.jsxs(iw,{data:Oe,margin:r?{top:4,right:6,left:2,bottom:18}:{top:6,right:8,left:4,bottom:20},barCategoryGap:"16%",children:[n.jsx(_g,{strokeDasharray:"3 3",className:"stroke-gray-200 dark:stroke-gray-600"}),n.jsx(kg,{dataKey:"name",tick:{fontSize:7},interval:0,angle:0,textAnchor:"middle",height:18,tickMargin:0,padding:{left:10,right:10}}),n.jsx(Sg,{tick:{fontSize:7},width:r?26:t?28:30,tickMargin:2,tickFormatter:Dde}),n.jsx(Vm,{content:n.jsx(cw,{})}),n.jsx(Uf,{dataKey:"spent",name:"Spent",stackId:"b",fill:"#2563eb",radius:[1,1,0,0],maxBarSize:r?14:t?13:12,isAnimationActive:ws}),n.jsx(Uf,{dataKey:"remaining",name:"Rem.",stackId:"b",fill:"#14b8a6",radius:[1,1,0,0],maxBarSize:r?14:t?13:12,isAnimationActive:ws})]})},`inv-${t}-${r}`)}),Oe.length>0&&n.jsxs("p",{className:"mt-0.5 text-[7px] text-gray-500 text-center leading-tight",children:[n.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-sm bg-[#2563eb] align-middle mr-0.5","aria-hidden":!0}),"Spent",n.jsx("span",{className:"mx-1.5 text-gray-400",children:"·"}),n.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-sm bg-[#14b8a6] align-middle mr-0.5","aria-hidden":!0}),"Remaining (vs budget)"]}),G.length>12&&n.jsxs("p",{className:"mt-0.5 text-[8px] text-gray-500",children:["First 12 of ",G.length," invoices."]})]})]}):n.jsx("div",{className:"flex flex-1 items-center justify-center text-[9px] text-gray-400 border border-dashed rounded-md px-2 text-center py-4",children:"Select a project above."})})]}),n.jsxs("div",{className:"reports-snapshot-chart-col flex flex-col min-w-0 min-h-0 max-w-full rounded-md border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800/90 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-1 px-1.5 py-0.5 bg-gradient-to-r from-teal-600 to-emerald-700 text-white shrink-0",children:[n.jsx(wq,{className:"shrink-0",size:11,"aria-hidden":!0}),n.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wide leading-none",children:"Tasks status"})]}),n.jsx("div",{className:"flex flex-1 min-h-0 flex-col p-1.5 min-w-0",children:n.jsx("div",{className:"reports-snapshot-overall-card rounded-md border border-gray-200 dark:border-gray-600 bg-white/50 dark:bg-gray-800/40 p-1.5 flex flex-col overflow-hidden min-w-0 min-h-0 flex-1",children:n.jsx("div",{className:"flex flex-1 flex-col min-h-0 gap-2 min-w-0 w-full",children:D?n.jsx("div",{className:"w-full h-16 flex items-center justify-center text-gray-400",children:n.jsx(vt,{className:"animate-spin text-sm"})}):E?St.length===0?n.jsx("div",{className:"w-full min-h-16 flex items-center justify-center text-[9px] text-gray-400 border border-dashed rounded-md",children:"No tasks."}):n.jsxs("div",{className:"flex flex-1 flex-col min-h-0 w-full min-w-0",children:[n.jsx("div",{className:"flex flex-1 min-h-[9rem] w-full items-center justify-center",children:n.jsxs("div",{className:`reports-snapshot-donut-inner relative shrink-0 mx-auto ${t?"h-[140px] w-[140px]":"h-[128px] w-[128px]"}`,children:[n.jsx("div",{className:"absolute inset-0",children:n.jsx(Im,{width:"100%",height:"100%",debounce:r?0:32,children:n.jsxs(ude,{margin:{top:0,right:0,bottom:0,left:0},children:[n.jsx(X9,{data:St,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:t?36:30,outerRadius:t?58:48,paddingAngle:.5,label:!1,isAnimationActive:ws,children:St.map((Ne,Qe)=>n.jsx(n0,{fill:Xm[Qe%Xm.length],stroke:"#fff",strokeWidth:1},Qe))}),n.jsx(Vm,{content:n.jsx(cw,{})})]})},`donut-${t}-${r}`)}),n.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center pointer-events-none px-1 text-center",children:[n.jsx("span",{className:"text-[6px] font-bold uppercase tracking-wide text-gray-500 dark:text-gray-400 leading-none",children:e("projects.snapshotOverallShort","Overall")}),n.jsxs("span",{className:"text-sm font-bold text-gray-900 dark:text-white tabular-nums leading-tight",children:[Ir>0&&(Kl=(_u=je==null?void 0:je.percent_complete)!=null?_u:B==null?void 0:B.percent_complete)!=null?Kl:0,"%"]})]})]})}),n.jsx("ul",{className:"reports-snapshot-donut-legend list-none m-0 w-full shrink-0 border-t border-gray-200/90 dark:border-gray-600/80 pt-1.5 pb-0.5 flex flex-wrap justify-center gap-x-1.5 gap-y-1 content-start max-h-[3.5rem] overflow-y-auto",children:St.map((Ne,Qe)=>{const ht=Ir?Math.round(Ne.value/Ir*100):0;return n.jsxs("li",{className:"inline-flex items-center gap-0.5 text-[7px] text-gray-700 dark:text-gray-200 leading-none whitespace-nowrap",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0 border border-white/80 dark:border-gray-600",style:{backgroundColor:Xm[Qe%Xm.length]},"aria-hidden":!0}),n.jsxs("span",{className:"reports-snapshot-legend-label max-w-[5.5rem] truncate",title:`${Ne.name} (${ht}%)`,children:[Ne.name," (",ht,"%)"]})]},Ne.name)})})]}):n.jsx("div",{className:"w-full min-h-16 flex items-center justify-center text-[9px] text-gray-400 border border-dashed rounded-md px-2 text-center",children:"Select a project above."})})})})]}),n.jsx("div",{className:"reports-snapshot-chart-col flex flex-col min-w-0 min-h-0 max-w-full",children:n.jsxs("div",{className:"reports-snapshot-weekly-chart-card rounded-md border border-gray-200 dark:border-gray-600 overflow-x-hidden overflow-y-visible flex flex-col flex-1 min-h-0 w-full min-w-0 max-w-full bg-white dark:bg-gray-800/90 shadow-sm h-full",children:[n.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 bg-gradient-to-r from-amber-500 to-orange-600 text-white shrink-0",children:[n.jsx(So,{size:11,className:"shrink-0","aria-hidden":!0}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"text-[9px] font-bold leading-none",children:"Risks / Issues"}),n.jsx("p",{className:"text-[8px] text-white/90 line-clamp-2 leading-tight",children:"Open tasks with Risk = Yes, by priority (High includes Urgent)."})]})]}),n.jsx("div",{className:"p-1 pb-2 flex flex-1 flex-col min-h-0 items-stretch w-full min-w-0 max-w-full",children:v?n.jsx("div",{className:"flex min-h-[7rem] flex-1 items-center justify-center text-gray-400",children:n.jsx(vt,{className:"animate-spin text-lg"})}):n.jsx("div",{ref:a,className:mn,children:n.jsx(Im,{width:l.width,height:l.height,debounce:r?0:32,children:n.jsxs(iw,{data:ea,margin:r?{top:14,right:0,left:0,bottom:6}:{top:18,right:0,left:0,bottom:8},barCategoryGap:"6%",children:[n.jsx(_g,{vertical:!1,strokeDasharray:"3 3",className:"stroke-gray-200/90 dark:stroke-gray-600/80"}),n.jsx(kg,{dataKey:"name",tick:{fontSize:8},interval:0,height:22,tickMargin:4,tickLine:!1,axisLine:{stroke:"#d1d5db"},padding:{left:0,right:0}}),n.jsx(Sg,{tick:{fontSize:8},width:18,allowDecimals:!1,domain:[0,Wl],ticks:Wl<=5?[0,1,2,3,4,5]:void 0,tickLine:!1,axisLine:{stroke:"#d1d5db"}}),n.jsx(Vm,{content:n.jsx(cw,{})}),n.jsx(hj,{verticalAlign:"bottom",align:"center",wrapperStyle:{paddingTop:4,margin:0,width:"100%"},content:()=>n.jsx("div",{className:"flex flex-wrap justify-center gap-x-3 gap-y-1 text-[7px] leading-none text-gray-700 dark:text-gray-200",children:ea.map(Ne=>n.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[n.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-sm",style:{backgroundColor:Ne.fill},"aria-hidden":!0}),Ne.name]},Ne.name))})}),n.jsxs(Uf,{dataKey:"count",name:"Count",maxBarSize:r?22:t?28:24,radius:[1,1,0,0],isAnimationActive:ws,children:[ea.map(Ne=>n.jsx(n0,{fill:Ne.count>0?Ne.fill:"transparent",stroke:"none"},Ne.name)),n.jsx(Hd,{dataKey:"count",content:Ne=>{const Qe=Number(Ne.x)||0,ht=Number(Ne.y)||0,W=Number(Ne.width)||0,le=Number(Ne.height)||0,Q=Number(Ne.value)||0,ae=Qe+W/2;return Q>0?n.jsx("text",{x:ae,y:ht-4,textAnchor:"middle",fontSize:9,fontWeight:600,className:"fill-gray-900 dark:fill-gray-100",children:Q}):n.jsx("text",{x:ae,y:ht+le+11,textAnchor:"middle",fontSize:8,className:"fill-gray-400 dark:fill-gray-500",children:"0"})}})]})]})},`risk-${t}-${r}-${l.width}-${l.height}`)})})]})}),n.jsx("div",{className:"reports-snapshot-chart-col flex flex-col min-w-0 min-h-0 max-w-full",children:n.jsxs("div",{className:"reports-snapshot-weekly-chart-card rounded-md border border-gray-200 dark:border-gray-600 overflow-x-hidden overflow-y-visible flex flex-col flex-1 min-h-0 w-full min-w-0 max-w-full bg-white dark:bg-gray-800/90 shadow-sm h-full",children:[n.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 bg-gradient-to-r from-sky-600 to-indigo-700 text-white shrink-0",children:[n.jsx(Rq,{size:11,className:"shrink-0","aria-hidden":!0}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"text-[9px] font-bold leading-none",children:"Actions"}),n.jsx("p",{className:"text-[8px] text-white/90 line-clamp-2 leading-tight",children:"Open tasks by Action (custom field)."})]})]}),n.jsx("div",{className:"p-1 pb-2 flex flex-1 flex-col min-h-0 items-stretch w-full min-w-0 max-w-full",children:v?n.jsx("div",{className:"flex min-h-[7rem] flex-1 items-center justify-center text-gray-400",children:n.jsx(vt,{className:"animate-spin text-lg"})}):n.jsx("div",{ref:s,className:mn,children:n.jsx(Im,{width:u.width,height:u.height,debounce:r?0:32,children:n.jsxs(iw,{data:ma,margin:r?{top:14,right:0,left:0,bottom:28}:{top:18,right:0,left:0,bottom:32},barCategoryGap:"4%",children:[n.jsx(_g,{vertical:!1,strokeDasharray:"3 3",className:"stroke-gray-200/90 dark:stroke-gray-600/80"}),n.jsx(kg,{dataKey:"name",tick:{fontSize:6},interval:0,angle:r?-10:-12,textAnchor:"end",height:r?30:t?32:34,tickMargin:2,tickLine:!1,axisLine:{stroke:"#d1d5db"},padding:{left:0,right:0}}),n.jsx(Sg,{tick:{fontSize:8},width:18,allowDecimals:!1,domain:[0,ki],ticks:ki<=5?[0,1,2,3,4,5]:void 0,tickLine:!1,axisLine:{stroke:"#d1d5db"}}),n.jsx(Vm,{content:({payload:Ne})=>{var ht,W;if(!(Ne!=null&&Ne.length))return null;const Qe=(ht=Ne[0])==null?void 0:ht.payload;return n.jsxs("div",{className:"rounded border border-gray-200 bg-white px-2 py-1 text-[10px] shadow dark:bg-gray-800 dark:border-gray-600",children:[n.jsx("div",{className:"font-semibold text-gray-800 dark:text-gray-100",children:Qe.fullLabel}),n.jsxs("div",{className:"text-gray-600 dark:text-gray-300",children:["KPI: ",(W=Qe.KPI)!=null?W:0]})]})}}),n.jsx(hj,{verticalAlign:"bottom",align:"center",wrapperStyle:{paddingTop:4,margin:0,width:"100%"},content:()=>n.jsx("div",{className:"flex flex-wrap justify-center gap-x-3 gap-y-1 text-[7px] leading-none text-gray-700 dark:text-gray-200",children:n.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[n.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-sm bg-[#2563eb]","aria-hidden":!0}),"KPI (open tasks)"]})})}),n.jsx(Uf,{dataKey:"KPI",name:"KPI",fill:"#2563eb",maxBarSize:r?18:t?24:20,radius:[1,1,0,0],isAnimationActive:ws,children:n.jsx(Hd,{dataKey:"KPI",content:Ne=>{const Qe=Number(Ne.x)||0,ht=Number(Ne.y)||0,W=Number(Ne.width)||0,le=Number(Ne.height)||0,Q=Number(Ne.value)||0,ae=Qe+W/2;return Q>0?n.jsx("text",{x:ae,y:ht-4,textAnchor:"middle",fontSize:9,fontWeight:600,className:"fill-gray-900 dark:fill-gray-100",children:Q}):n.jsx("text",{x:ae,y:ht+le+11,textAnchor:"middle",fontSize:8,className:"fill-gray-400 dark:fill-gray-500",children:"0"})}})})]})},`actions-${t}-${r}-${u.width}-${u.height}`)})})]})})]})]}),(je||B)&&n.jsxs("div",{className:"reports-snapshot-updates-notes-row grid gap-1.5 min-w-0",children:[n.jsxs("div",{className:"rounded-md border border-violet-500/30 dark:border-violet-600/40 overflow-hidden shadow-sm bg-white dark:bg-gray-800 min-w-0 flex flex-col",children:[n.jsx("div",{className:"bg-gradient-to-r from-violet-600 to-fuchsia-700 text-white px-2 py-0.5 shrink-0",children:n.jsx("h3",{className:"text-[9px] font-bold uppercase tracking-wide leading-none",children:e("projects.snapshotUpdatesColumn","Updates")})}),n.jsx("div",{className:"reports-snapshot-notes-body p-1.5 flex-1 min-h-0 max-h-[min(12rem,36vh)] overflow-y-auto",children:se?n.jsx("div",{className:"reports-snapshot-updates-loading h-16 flex items-center justify-center text-gray-400",children:n.jsx(vt,{className:"animate-spin text-sm"})}):de.length===0?n.jsx("p",{className:"text-[9px] text-gray-400",children:"No updates for this project."}):n.jsxs("table",{className:"w-full text-[8px] text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-600 text-gray-500 dark:text-gray-400",children:[n.jsx("th",{className:"py-0.5 pr-1 font-semibold",children:"Update"}),n.jsx("th",{className:"py-0.5 px-0.5 font-semibold w-[4.5rem]",children:"Date"}),n.jsx("th",{className:"py-0.5 pl-0.5 font-semibold",children:"Task"})]})}),n.jsx("tbody",{children:de.slice(0,25).map((Ne,Qe)=>n.jsxs("tr",{className:"border-t border-gray-100 dark:border-gray-700 align-top",children:[n.jsx("td",{className:"py-0.5 pr-1 text-gray-800 dark:text-gray-200 break-words",children:Ne.update_||"—"}),n.jsx("td",{className:"py-0.5 px-0.5 font-mono text-gray-600 dark:text-gray-400 whitespace-nowrap",children:Ne.date?lw(String(Ne.date).slice(0,10)):"—"}),n.jsx("td",{className:"py-0.5 pl-0.5",children:Ne.task?n.jsx("button",{type:"button",onClick:()=>d(`/projects/tasks/${encodeURIComponent(Ne.task)}`),className:"text-violet-700 dark:text-violet-300 hover:underline font-mono text-[8px] text-left",children:Ne.task}):"—"})]},`${Ne.name||"n"}-${Ne.task||""}-${Qe}`))})]})})]}),n.jsxs("div",{className:"rounded-md border border-teal-500/35 dark:border-teal-600/45 overflow-hidden shadow-sm bg-white dark:bg-gray-800 min-w-0 flex flex-col",children:[n.jsx("div",{className:"bg-gradient-to-r from-teal-500 to-emerald-600 text-white px-2 py-0.5 shrink-0",children:n.jsx("h3",{className:"text-[9px] font-bold uppercase tracking-wide leading-none",children:e("projects.snapshotNotesColumn","Notes")})}),n.jsx("div",{className:"reports-snapshot-notes-body p-1.5 flex-1 min-h-0 max-h-[min(12rem,36vh)] overflow-y-auto",children:n.jsx("p",{className:"text-[9px] text-gray-700 dark:text-gray-200 whitespace-pre-wrap leading-tight",children:Bj((Qi=je==null?void 0:je.notes)!=null?Qi:B==null?void 0:B.notes)||"No notes for this project."})})]})]}),n.jsxs("div",{className:"reports-snapshot-bottom-tasks grid grid-cols-1 lg:grid-cols-3 gap-1.5 min-w-0",children:[n.jsxs("div",{className:"min-h-0 shrink-0 min-w-0",children:[n.jsxs("h3",{className:"text-[9px] font-bold uppercase tracking-wide text-gray-600 dark:text-gray-300 mb-0.5 leading-none",children:["Last week Tasks",Xr.length>0&&n.jsxs("span",{className:"ml-1 text-[9px] font-mono text-gray-500",children:["(",Xr.length,")"]})]}),n.jsx("div",{className:"rounded-md border border-gray-200 dark:border-gray-600 overflow-hidden",children:n.jsx("div",{className:"reports-snapshot-table-scroll",children:n.jsxs("table",{className:"min-w-full text-[9px] table-fixed w-full",children:[n.jsx("thead",{className:"sticky top-0 z-10",children:n.jsxs("tr",{className:"bg-violet-700 text-white text-left",children:[n.jsx("th",{className:"px-1 py-0.5 w-7",children:"N"}),n.jsx("th",{className:"px-1 py-0.5",children:"Task"}),n.jsx("th",{className:"px-1 py-0.5",children:"Assigned"}),n.jsx("th",{className:"px-1 py-0.5 w-[4.5rem]",children:"Action"})]})}),n.jsx("tbody",{children:Xr.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:4,className:"px-1.5 py-1 text-gray-400 text-center",children:"None"})}):Xr.map((Ne,Qe)=>{const ht=`/projects/tasks/${encodeURIComponent(Ne.name)}`;return n.jsxs("tr",{tabIndex:0,role:"link",className:"border-t border-gray-100 dark:border-gray-700 text-rose-700 dark:text-rose-300 cursor-pointer hover:bg-rose-50/80 dark:hover:bg-rose-950/20",onClick:()=>d(ht),onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),d(ht))},children:[n.jsx("td",{className:"px-1 py-0.5 font-mono tabular-nums text-gray-600 dark:text-gray-400",children:Qe+1}),n.jsx("td",{className:"px-1.5 py-0.5 truncate",title:Ne.subject||Ne.name,children:Ne.subject||Ne.name}),n.jsx("td",{className:"px-1.5 py-0.5 truncate",children:Ji(Ne)}),n.jsx("td",{className:"px-1.5 py-0.5 font-medium text-gray-800 dark:text-gray-200 truncate",title:Ne.status||"",children:Ne.status||"—"})]},Ne.name)})})]})})}),Xr.length>20&&n.jsxs("p",{className:"mt-0.5 text-[9px] text-gray-500",children:["Scroll to see all ",Xr.length," items."]})]}),n.jsxs("div",{className:"min-h-0 shrink-0 min-w-0",children:[n.jsxs("h3",{className:"text-[9px] font-bold uppercase tracking-wide text-gray-600 dark:text-gray-300 mb-0.5 leading-none",children:["Upcoming Tasks",jr.length>0&&n.jsxs("span",{className:"ml-1 text-[9px] font-mono text-gray-500",children:["(",jr.length,")"]})]}),n.jsx("div",{className:"rounded-md border border-gray-200 dark:border-gray-600 overflow-hidden",children:n.jsx("div",{className:"reports-snapshot-table-scroll",children:n.jsxs("table",{className:"min-w-full text-[9px] table-fixed w-full",children:[n.jsx("thead",{className:"sticky top-0 z-10",children:n.jsxs("tr",{className:"bg-violet-700 text-white text-left",children:[n.jsx("th",{className:"px-1 py-0.5 w-7",children:"N"}),n.jsx("th",{className:"px-1 py-0.5 w-[32%]",children:"Task"}),n.jsx("th",{className:"px-1 py-0.5 w-[22%]",children:"Assigned to"}),n.jsx("th",{className:"px-1 py-0.5 w-[17%]",children:"Start Date"}),n.jsx("th",{className:"px-1 py-0.5 w-[17%]",children:"End Date"})]})}),n.jsx("tbody",{children:jr.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"px-1.5 py-1 text-gray-400 text-center",children:"None"})}):jr.map((Ne,Qe)=>{var W,le;const ht=`/projects/tasks/${encodeURIComponent(Ne.name)}`;return n.jsxs("tr",{tabIndex:0,role:"link",className:"border-t border-gray-100 dark:border-gray-700 cursor-pointer hover:bg-slate-100/90 dark:hover:bg-slate-800/60",onClick:()=>d(ht),onKeyDown:Q=>{(Q.key==="Enter"||Q.key===" ")&&(Q.preventDefault(),d(ht))},children:[n.jsx("td",{className:"px-1 py-0.5 font-mono tabular-nums text-gray-600 dark:text-gray-400",children:Qe+1}),n.jsx("td",{className:"px-1.5 py-0.5 text-gray-800 dark:text-gray-200 truncate",title:Ne.subject||Ne.name,children:Ne.subject||Ne.name}),n.jsx("td",{className:"px-1.5 py-0.5 truncate",children:Ji(Ne)}),n.jsx("td",{className:"px-1 py-0.5 font-mono tabular-nums text-gray-600 dark:text-gray-400",children:((W=Ne.exp_start_date)==null?void 0:W.slice(0,10))||"—"}),n.jsx("td",{className:"px-1 py-0.5 font-mono tabular-nums text-gray-600 dark:text-gray-400",children:((le=Ne.exp_end_date)==null?void 0:le.slice(0,10))||"—"})]},Ne.name)})})]})})})]}),n.jsxs("div",{className:"min-h-0 shrink-0 min-w-0",children:[n.jsxs("h3",{className:"text-[9px] font-bold uppercase tracking-wide text-gray-600 dark:text-gray-300 mb-0.5 leading-none",children:["Obstacles",Js.length>0&&n.jsxs("span",{className:"ml-1 text-[9px] font-mono text-gray-500",children:["(",Js.length,")"]})]}),n.jsx("div",{className:"rounded-md border border-gray-200 dark:border-gray-600 overflow-hidden",children:n.jsx("div",{className:"reports-snapshot-table-scroll",children:n.jsxs("table",{className:"min-w-full text-[9px] table-fixed w-full",children:[n.jsx("thead",{className:"sticky top-0 z-10",children:n.jsxs("tr",{className:"bg-violet-700 text-white text-left",children:[n.jsx("th",{className:"px-1 py-0.5 w-7",children:"N"}),n.jsx("th",{className:"px-1 py-0.5",children:"Task"})]})}),n.jsx("tbody",{children:Js.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:2,className:"px-1.5 py-1 text-gray-400 text-center",children:"None"})}):Js.map((Ne,Qe)=>{const ht=`/projects/tasks/${encodeURIComponent(Ne.name)}`,W=String(Ne.custom_task_obstacle||"").trim();return n.jsxs("tr",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsx("td",{className:"px-1 py-0.5 font-mono tabular-nums text-gray-600 dark:text-gray-400 align-top",children:Qe+1}),n.jsxs("td",{className:"px-1.5 py-0.5 align-top text-gray-800 dark:text-gray-200",children:[n.jsx("button",{type:"button",onClick:()=>d(ht),className:"text-left font-medium text-blue-600 dark:text-blue-400 hover:underline block w-full truncate",title:Ne.subject||Ne.name,children:Ne.subject||Ne.name}),W?n.jsx("p",{className:"text-[8px] text-gray-500 dark:text-gray-400 mt-0.5 whitespace-pre-wrap break-words",children:W}):null]})]},Ne.name)})})]})})})]})]})]})]})}):null]})]})};function ap(e){var t,r,a,s,i,l;return JSON.stringify({filters:(t=e.filters)!=null?t:{},appendFilters:(r=e.appendFilters)!=null?r:[],fields:(a=e.fields)!=null?a:null,limit_start:(s=e.limit_start)!=null?s:0,limit_page_length:(i=e.limit_page_length)!=null?i:20,order_by:(l=e.order_by)!=null?l:""})}const Fde=(e={})=>{const[t,r]=y.useState([]),[a,s]=y.useState(!0),[i,l]=y.useState(null),[u,d]=y.useState(0),f=ap(e),p=y.useRef(0);y.useEffect(()=>{const x=++p.current;let v=!1;return fe(null,null,function*(){try{s(!0),l(null);const[b,w]=yield Promise.all([wt.getProjects(e),wt.getProjectCount(e.filters)]);if(v||x!==p.current)return;r(b.data),d(w)}catch(b){if(v||x!==p.current)return;l(b instanceof Error?b.message:"Failed to fetch projects")}finally{!v&&x===p.current&&s(!1)}}),()=>{v=!0}},[f]);const m=y.useCallback(()=>fe(null,null,function*(){const x=++p.current;try{s(!0),l(null);const[v,b]=yield Promise.all([wt.getProjects(e),wt.getProjectCount(e.filters)]);if(x!==p.current)return;r(v.data),d(b)}catch(v){if(x!==p.current)return;l(v instanceof Error?v.message:"Failed to fetch projects")}finally{x===p.current&&s(!1)}}),[f]);return{projects:t,loading:a,error:i,totalCount:u,refetch:m}},Mde=e=>{const[t,r]=y.useState(null),[a,s]=y.useState(!1),[i,l]=y.useState(null),u=y.useCallback(()=>fe(null,null,function*(){if(!e){r(null);return}try{s(!0),l(null),r(yield wt.getProject(e))}catch(d){l(d instanceof Error?d.message:"Failed to fetch project")}finally{s(!1)}}),[e]);return y.useEffect(()=>{u()},[u]),{project:t,loading:a,error:i,refetch:u}},Lde=(e={})=>{const[t,r]=y.useState([]),[a,s]=y.useState(!0),[i,l]=y.useState(null),[u,d]=y.useState(0),f=ap(e),p=y.useRef(0);y.useEffect(()=>{const x=++p.current;let v=!1;return fe(null,null,function*(){try{s(!0),l(null);const[b,w]=yield Promise.all([wt.getTasks(e),wt.getTaskCount(e.filters)]);if(v||x!==p.current)return;r(b.data),d(w)}catch(b){if(v||x!==p.current)return;l(b instanceof Error?b.message:"Failed to fetch tasks")}finally{!v&&x===p.current&&s(!1)}}),()=>{v=!0}},[f]);const m=y.useCallback(()=>fe(null,null,function*(){const x=++p.current;try{s(!0),l(null);const[v,b]=yield Promise.all([wt.getTasks(e),wt.getTaskCount(e.filters)]);if(x!==p.current)return;r(v.data),d(b)}catch(v){if(x!==p.current)return;l(v instanceof Error?v.message:"Failed to fetch tasks")}finally{x===p.current&&s(!1)}}),[f]);return{tasks:t,loading:a,error:i,totalCount:u,refetch:m}},Ide=e=>{const[t,r]=y.useState([]),[a,s]=y.useState(!1),[i,l]=y.useState(null),u=y.useCallback(()=>fe(null,null,function*(){if(!e){r([]);return}try{s(!0),l(null);const{data:d}=yield wt.getTasksForProject(e);r(d)}catch(d){l(d instanceof Error?d.message:"Failed to fetch tasks")}finally{s(!1)}}),[e]);return y.useEffect(()=>{u()},[u]),{tasks:t,loading:a,error:i,refetch:u}},zde=e=>{const[t,r]=y.useState(null),[a,s]=y.useState(!1),[i,l]=y.useState(null),u=y.useCallback(()=>fe(null,null,function*(){if(!e){r(null);return}try{s(!0),l(null),r(yield wt.getTask(e))}catch(d){l(d instanceof Error?d.message:"Failed to fetch task")}finally{s(!1)}}),[e]);return y.useEffect(()=>{u()},[u]),{task:t,loading:a,error:i,refetch:u}},Bde=(e={})=>{const[t,r]=y.useState([]),[a,s]=y.useState(!0),[i,l]=y.useState(null),[u,d]=y.useState(0),f=ap(e),p=y.useRef(0);y.useEffect(()=>{const x=++p.current;let v=!1;return fe(null,null,function*(){try{s(!0),l(null);const[b,w]=yield Promise.all([wt.getTimesheets(e),wt.getTimesheetCount(e.filters||{},e.appendFilters||[])]);if(v||x!==p.current)return;r(b.data),d(w)}catch(b){if(v||x!==p.current)return;l(b instanceof Error?b.message:"Failed to fetch timesheets")}finally{!v&&x===p.current&&s(!1)}}),()=>{v=!0}},[f]);const m=y.useCallback(()=>fe(null,null,function*(){const x=++p.current;try{s(!0),l(null);const[v,b]=yield Promise.all([wt.getTimesheets(e),wt.getTimesheetCount(e.filters||{},e.appendFilters||[])]);if(x!==p.current)return;r(v.data),d(b)}catch(v){if(x!==p.current)return;l(v instanceof Error?v.message:"Failed to fetch timesheets")}finally{x===p.current&&s(!1)}}),[f]);return{timesheets:t,loading:a,error:i,totalCount:u,refetch:m}},$de=e=>{const[t,r]=y.useState([]),[a,s]=y.useState(!1),[i,l]=y.useState(null),u=y.useCallback(()=>fe(null,null,function*(){if(!e){r([]);return}try{s(!0),l(null);const{data:d}=yield wt.getTimesheetsForProject(e);r(d)}catch(d){l(d instanceof Error?d.message:"Failed to fetch timesheets")}finally{s(!1)}}),[e]);return y.useEffect(()=>{u()},[u]),{timesheets:t,loading:a,error:i,refetch:u}},Ude=e=>{const[t,r]=y.useState(null),[a,s]=y.useState(!1),[i,l]=y.useState(null),u=y.useCallback(()=>fe(null,null,function*(){if(!e){r(null);return}try{s(!0),l(null),r(yield wt.getTimesheet(e))}catch(d){l(d instanceof Error?d.message:"Failed to fetch timesheet")}finally{s(!1)}}),[e]);return y.useEffect(()=>{u()},[u]),{timesheet:t,loading:a,error:i,refetch:u}},Hde=(e={})=>{const[t,r]=y.useState([]),[a,s]=y.useState(!0),[i,l]=y.useState(0),u=ap(e),d=y.useRef(0);y.useEffect(()=>{const p=++d.current;let m=!1;return fe(null,null,function*(){try{s(!0);const[x,v]=yield Promise.all([wt.getProjectTemplates(e),wt.getProjectTemplateCount(e.filters||{})]);if(m||p!==d.current)return;r(x.data),l(v)}catch(x){}finally{!m&&p===d.current&&s(!1)}}),()=>{m=!0}},[u]);const f=y.useCallback(()=>fe(null,null,function*(){const p=++d.current;try{s(!0);const[m,x]=yield Promise.all([wt.getProjectTemplates(e),wt.getProjectTemplateCount(e.filters||{})]);if(p!==d.current)return;r(m.data),l(x)}catch(m){}finally{p===d.current&&s(!1)}}),[u]);return{templates:t,loading:a,totalCount:i,refetch:f}},qde=e=>{const[t,r]=y.useState(null),[a,s]=y.useState(!1),[i,l]=y.useState(null),u=y.useCallback(()=>fe(null,null,function*(){if(!e){r(null);return}try{s(!0),l(null),r(yield wt.getProjectTemplate(e))}catch(d){l(d instanceof Error?d.message:"Failed to fetch template")}finally{s(!1)}}),[e]);return y.useEffect(()=>{u()},[u]),{template:t,loading:a,error:i,refetch:u}},Wde=(e={})=>{const[t,r]=y.useState([]),[a,s]=y.useState(!0),[i,l]=y.useState(0),u=ap(e),d=y.useRef(0);y.useEffect(()=>{const p=++d.current;let m=!1;return fe(null,null,function*(){try{s(!0);const[x,v]=yield Promise.all([wt.getActivityTypes(e),wt.getActivityTypeCount(e.filters||{})]);if(m||p!==d.current)return;r(x.data),l(v)}catch(x){}finally{!m&&p===d.current&&s(!1)}}),()=>{m=!0}},[u]);const f=y.useCallback(()=>fe(null,null,function*(){const p=++d.current;try{s(!0);const[m,x]=yield Promise.all([wt.getActivityTypes(e),wt.getActivityTypeCount(e.filters||{})]);if(p!==d.current)return;r(m.data),l(x)}catch(m){}finally{p===d.current&&s(!1)}}),[u]);return{activityTypes:t,loading:a,totalCount:i,refetch:f}},Vde=e=>{const[t,r]=y.useState(null),[a,s]=y.useState(!1),[i,l]=y.useState(null),u=y.useCallback(()=>fe(null,null,function*(){if(!e){r(null);return}try{s(!0),l(null),r(yield wt.getActivityType(e))}catch(d){l(d instanceof Error?d.message:"Failed to fetch activity type")}finally{s(!1)}}),[e]);return y.useEffect(()=>{u()},[u]),{activityType:t,loading:a,error:i,refetch:u}},np=()=>{const[e,t]=y.useState(!1),[r,a]=y.useState(null),s=i=>fe(null,null,function*(){try{return t(!0),a(null),yield i()}catch(l){const u=l instanceof Error?l.message:"Operation failed";throw a(u),l}finally{t(!1)}});return{createProject:i=>s(()=>wt.createProject(i)),updateProject:(i,l)=>s(()=>wt.updateProject(i,l)),createTask:i=>s(()=>wt.createTask(i)),updateTask:(i,l)=>s(()=>wt.updateTask(i,l)),createTimesheet:i=>s(()=>wt.createTimesheet(i)),updateTimesheet:(i,l)=>s(()=>wt.updateTimesheet(i,l)),submitTimesheet:i=>s(()=>wt.submitTimesheet(i)),cancelTimesheet:i=>s(()=>wt.cancelTimesheet(i)),createProjectTemplate:i=>s(()=>wt.createProjectTemplate(i)),updateProjectTemplate:(i,l)=>s(()=>wt.updateProjectTemplate(i,l)),createActivityType:i=>s(()=>wt.createActivityType(i)),updateActivityType:(i,l)=>s(()=>wt.updateActivityType(i,l)),loading:e,error:r}},Wy=({currentPage:e,totalCount:t=0,pageSize:r,hasMore:a=!1,itemLabel:s,onPageChange:i,className:l=""})=>{const{t:u}=sr(),d=s!=null?s:u("listPages.results"),f=t>0?Math.max(1,Math.ceil(t/r)):0,p=t>0,m=(e-1)*r+1,x=p?Math.min(e*r,t):e*r,[v,b]=y.useState(""),w=C=>{C.preventDefault();const N=parseInt(v.trim(),10);if(!Number.isNaN(N)&&N>=1){const O=p?Math.min(N,f):N;i(O),b("")}},j=()=>{if(f<=7)return Array.from({length:f},(N,O)=>O+1);const C=[];C.push(1),e>3&&C.push("ellipsis");for(let N=Math.max(2,e-1);N<=Math.min(f-1,e+1);N++)C.includes(N)||C.push(N);return e<f-2&&C.push("ellipsis"),f>1&&C.push(f),C};return a||e>1||p&&f>1?n.jsxs("div",{className:`flex flex-wrap items-center justify-between gap-3 px-6 py-4 border-t border-gray-200 dark:border-gray-700 ${l}`,children:[n.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:p?u("pagination.showingToOf",{start:m,end:x,total:t,label:d}):u("pagination.showingTo",{start:m,end:x,label:d})}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("button",{type:"button",onClick:()=>i(e-1),disabled:e<=1,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",children:u("pagination.previous")}),p&&f>1&&n.jsx("div",{className:"flex items-center gap-1",children:j().map((C,N)=>C==="ellipsis"?n.jsx("span",{className:"px-2 text-gray-500 dark:text-gray-400",children:"…"},`e-${N}`):n.jsx("button",{type:"button",onClick:()=>i(C),className:`min-w-[2rem] px-2 py-1 text-sm font-medium rounded-lg transition-colors ${C===e?"bg-blue-600 text-white border border-blue-600":"text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600"}`,children:C},C))}),n.jsx("button",{type:"button",onClick:()=>i(e+1),disabled:p?e>=f:!a,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed",children:u("pagination.next")}),n.jsxs("form",{onSubmit:w,className:"flex items-center gap-1 ml-2",children:[n.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 whitespace-nowrap",children:u("pagination.goTo")}),n.jsx("input",{type:"number",min:1,max:p?f:void 0,value:v,onChange:C=>b(C.target.value),placeholder:p?`1-${f}`:u("pagination.page"),className:"w-14 px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),n.jsx("button",{type:"submit",className:"px-2 py-1 text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700",children:u("pagination.go")})]})]})]}):null};function Vn(e,t){const[r,a]=y.useState(new Set);y.useEffect(()=>{a(new Set)},[t]);const s=y.useCallback(d=>{a(f=>{const p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p})},[]),i=y.useCallback(()=>{a(d=>{const f=e.map(m=>m.name);return f.length===0?new Set:f.every(m=>d.has(m))?new Set:new Set(f)})},[e]),l=e.length>0&&e.every(d=>r.has(d.name)),u=e.some(d=>r.has(d.name))&&!l;return{selectedRows:r,toggleRow:s,toggleAllOnPage:i,allOnPageSelected:l,someOnPageSelected:u}}var Ex={};Ex.version="0.18.5";var FF=1252,Gde=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],MF=function(e){Gde.indexOf(e)!=-1&&(FF=e)};function Kde(){MF(1252)}var kh=function(e){MF(e)};function Yde(){kh(1200),Kde()}var Jm=function(t){return String.fromCharCode(t)},c8=function(t){return String.fromCharCode(t)},Ax,El="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Sh(e){for(var t="",r=0,a=0,s=0,i=0,l=0,u=0,d=0,f=0;f<e.length;)r=e.charCodeAt(f++),i=r>>2,a=e.charCodeAt(f++),l=(r&3)<<4|a>>4,s=e.charCodeAt(f++),u=(a&15)<<2|s>>6,d=s&63,isNaN(a)?u=d=64:isNaN(s)&&(d=64),t+=El.charAt(i)+El.charAt(l)+El.charAt(u)+El.charAt(d);return t}function Bo(e){var t="",r=0,a=0,s=0,i=0,l=0,u=0,d=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var f=0;f<e.length;)i=El.indexOf(e.charAt(f++)),l=El.indexOf(e.charAt(f++)),r=i<<2|l>>4,t+=String.fromCharCode(r),u=El.indexOf(e.charAt(f++)),a=(l&15)<<4|u>>2,u!==64&&(t+=String.fromCharCode(a)),d=El.indexOf(e.charAt(f++)),s=(u&3)<<6|d,d!==64&&(t+=String.fromCharCode(s));return t}var ar=(function(){return typeof Buffer!="undefined"&&typeof process!="undefined"&&typeof process.versions!="undefined"&&!!process.versions.node})(),Ko=(function(){if(typeof Buffer!="undefined"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch(t){e=!0}return e?function(t,r){return r?new Buffer(t,r):new Buffer(t)}:Buffer.from.bind(Buffer)}return function(){}})();function iu(e){return ar?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}function u8(e){return ar?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array!="undefined"?new Uint8Array(e):new Array(e)}var di=function(t){return ar?Ko(t,"binary"):t.split("").map(function(r){return r.charCodeAt(0)&255})};function Vy(e){if(typeof ArrayBuffer=="undefined")return di(e);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),a=0;a!=e.length;++a)r[a]=e.charCodeAt(a)&255;return t}function sp(e){if(Array.isArray(e))return e.map(function(a){return String.fromCharCode(a)}).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function Xde(e){if(typeof Uint8Array=="undefined")throw new Error("Unsupported");return new Uint8Array(e)}var Ga=ar?function(e){return Buffer.concat(e.map(function(t){return Buffer.isBuffer(t)?t:Ko(t)}))}:function(e){if(typeof Uint8Array!="undefined"){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var a=new Uint8Array(r),s=0;for(t=0,r=0;t<e.length;r+=s,++t)if(s=e[t].length,e[t]instanceof Uint8Array)a.set(e[t],r);else{if(typeof e[t]=="string")throw"wtf";a.set(new Uint8Array(e[t]),r)}return a}return[].concat.apply([],e.map(function(i){return Array.isArray(i)?i:[].slice.call(i)}))};function Jde(e){for(var t=[],r=0,a=e.length+250,s=iu(e.length+255),i=0;i<e.length;++i){var l=e.charCodeAt(i);if(l<128)s[r++]=l;else if(l<2048)s[r++]=192|l>>6&31,s[r++]=128|l&63;else if(l>=55296&&l<57344){l=(l&1023)+64;var u=e.charCodeAt(++i)&1023;s[r++]=240|l>>8&7,s[r++]=128|l>>2&63,s[r++]=128|u>>6&15|(l&3)<<4,s[r++]=128|u&63}else s[r++]=224|l>>12&15,s[r++]=128|l>>6&63,s[r++]=128|l&63;r>a&&(t.push(s.slice(0,r)),r=0,s=iu(65535),a=65530)}return t.push(s.slice(0,r)),Ga(t)}var Xf=/\u0000/g,Qm=/[\u0001-\u0006]/g;function qd(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function pi(e,t){var r=""+e;return r.length>=t?r:Vr("0",t-r.length)+r}function Zk(e,t){var r=""+e;return r.length>=t?r:Vr(" ",t-r.length)+r}function Ox(e,t){var r=""+e;return r.length>=t?r:r+Vr(" ",t-r.length)}function Qde(e,t){var r=""+Math.round(e);return r.length>=t?r:Vr("0",t-r.length)+r}function Zde(e,t){var r=""+e;return r.length>=t?r:Vr("0",t-r.length)+r}var d8=Math.pow(2,32);function xd(e,t){if(e>d8||e<-d8)return Qde(e,t);var r=Math.round(e);return Zde(r,t)}function Px(e,t){return t=t||0,e.length>=7+t&&(e.charCodeAt(t)|32)===103&&(e.charCodeAt(t+1)|32)===101&&(e.charCodeAt(t+2)|32)===110&&(e.charCodeAt(t+3)|32)===101&&(e.charCodeAt(t+4)|32)===114&&(e.charCodeAt(t+5)|32)===97&&(e.charCodeAt(t+6)|32)===108}var f8=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],uw=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function e0e(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var Kr={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},h8={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},t0e={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function Dx(e,t,r){for(var a=e<0?-1:1,s=e*a,i=0,l=1,u=0,d=1,f=0,p=0,m=Math.floor(s);f<t&&(m=Math.floor(s),u=m*l+i,p=m*f+d,!(s-m<5e-8));)s=1/(s-m),i=l,l=u,d=f,f=p;if(p>t&&(f>t?(p=d,u=i):(p=f,u=l)),!r)return[0,a*u,p];var x=Math.floor(a*u/p);return[x,a*u-x*p,p]}function Zm(e,t,r){if(e>2958465||e<0)return null;var a=e|0,s=Math.floor(86400*(e-a)),i=0,l=[],u={D:a,T:s,u:86400*(e-a)-s,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(u.u)<1e-6&&(u.u=0),t&&t.date1904&&(a+=1462),u.u>.9999&&(u.u=0,++s==86400&&(u.T=s=0,++a,++u.D)),a===60)l=r?[1317,10,29]:[1900,2,29],i=3;else if(a===0)l=r?[1317,8,29]:[1900,1,0],i=6;else{a>60&&--a;var d=new Date(1900,0,1);d.setDate(d.getDate()+a-1),l=[d.getFullYear(),d.getMonth()+1,d.getDate()],i=d.getDay(),a<60&&(i=(i+6)%7),r&&(i=l0e(d,l))}return u.y=l[0],u.m=l[1],u.d=l[2],u.S=s%60,s=Math.floor(s/60),u.M=s%60,s=Math.floor(s/60),u.H=s,u.q=i,u}var LF=new Date(1899,11,31,0,0,0),r0e=LF.getTime(),a0e=new Date(1900,2,1,0,0,0);function IF(e,t){var r=e.getTime();return t?r-=1461*24*60*60*1e3:e>=a0e&&(r+=1440*60*1e3),(r-(r0e+(e.getTimezoneOffset()-LF.getTimezoneOffset())*6e4))/(1440*60*1e3)}function eS(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function n0e(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function s0e(e){var t=e<0?12:11,r=eS(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10),r.length<=t)?r:e.toExponential(5)}function i0e(e){var t=eS(e.toFixed(11));return t.length>(e<0?12:11)||t==="0"||t==="-0"?e.toPrecision(6):t}function o0e(e){var t=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return t>=-4&&t<=-1?r=e.toPrecision(10+t):Math.abs(t)<=9?r=s0e(e):t===10?r=e.toFixed(10).substr(0,12):r=i0e(e),eS(n0e(r.toUpperCase()))}function Hj(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):o0e(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return Ml(14,IF(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function l0e(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function c0e(e,t,r,a){var s="",i=0,l=0,u=r.y,d,f=0;switch(e){case 98:u=r.y+543;case 121:switch(t.length){case 1:case 2:d=u%100,f=2;break;default:d=u%1e4,f=4;break}break;case 109:switch(t.length){case 1:case 2:d=r.m,f=t.length;break;case 3:return uw[r.m-1][1];case 5:return uw[r.m-1][0];default:return uw[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:d=r.d,f=t.length;break;case 3:return f8[r.q][0];default:return f8[r.q][1]}break;case 104:switch(t.length){case 1:case 2:d=1+(r.H+11)%12,f=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:d=r.H,f=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:d=r.M,f=t.length;break;default:throw"bad minute format: "+t}break;case 115:if(t!="s"&&t!="ss"&&t!=".0"&&t!=".00"&&t!=".000")throw"bad second format: "+t;return r.u===0&&(t=="s"||t=="ss")?pi(r.S,t.length):(a>=2?l=a===3?1e3:100:l=a===1?10:1,i=Math.round(l*(r.S+r.u)),i>=60*l&&(i=0),t==="s"?i===0?"0":""+i/l:(s=pi(i,2+a),t==="ss"?s.substr(0,2):"."+s.substr(2,t.length-1)));case 90:switch(t){case"[h]":case"[hh]":d=r.D*24+r.H;break;case"[m]":case"[mm]":d=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":d=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}f=t.length===3?1:2;break;case 101:d=u,f=1;break}var p=f>0?pi(d,f):"";return p}function Al(e){var t=3;if(e.length<=t)return e;for(var r=e.length%t,a=e.substr(0,r);r!=e.length;r+=t)a+=(a.length>0?",":"")+e.substr(r,t);return a}var zF=/%/g;function u0e(e,t,r){var a=t.replace(zF,""),s=t.length-a.length;return Ao(e,a,r*Math.pow(10,2*s))+Vr("%",s)}function d0e(e,t,r){for(var a=t.length-1;t.charCodeAt(a-1)===44;)--a;return Ao(e,t.substr(0,a),r/Math.pow(10,3*(t.length-a)))}function BF(e,t){var r,a=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+BF(e,-t);var s=e.indexOf(".");s===-1&&(s=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%s;if(i<0&&(i+=s),r=(t/Math.pow(10,i)).toPrecision(a+1+(s+i)%s),r.indexOf("e")===-1){var l=Math.floor(Math.log(t)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(l-r.length+i):r+="E+"+(l-i);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,s)+"."+r.substr(2+s),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(u,d,f,p){return d+f+p.substr(0,(s+i)%s)+"."+p.substr(i)+"E"})}else r=t.toExponential(a);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var $F=/# (\?+)( ?)\/( ?)(\d+)/;function f0e(e,t,r){var a=parseInt(e[4],10),s=Math.round(t*a),i=Math.floor(s/a),l=s-i*a,u=a;return r+(i===0?"":""+i)+" "+(l===0?Vr(" ",e[1].length+1+e[4].length):Zk(l,e[1].length)+e[2]+"/"+e[3]+pi(u,e[4].length))}function h0e(e,t,r){return r+(t===0?"":""+t)+Vr(" ",e[1].length+2+e[4].length)}var UF=/^#*0*\.([0#]+)/,HF=/\).*[0#]/,qF=/\(###\) ###\\?-####/;function vn(e){for(var t="",r,a=0;a!=e.length;++a)switch(r=e.charCodeAt(a)){case 35:break;case 63:t+=" ";break;case 48:t+="0";break;default:t+=String.fromCharCode(r)}return t}function p8(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function m8(e,t){var r=e-Math.floor(e),a=Math.pow(10,t);return t<(""+Math.round(r*a)).length?0:Math.round(r*a)}function p0e(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function m0e(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function Is(e,t,r){if(e.charCodeAt(0)===40&&!t.match(HF)){var a=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Is("n",a,r):"("+Is("n",a,-r)+")"}if(t.charCodeAt(t.length-1)===44)return d0e(e,t,r);if(t.indexOf("%")!==-1)return u0e(e,t,r);if(t.indexOf("E")!==-1)return BF(t,r);if(t.charCodeAt(0)===36)return"$"+Is(e,t.substr(t.charAt(1)==" "?2:1),r);var s,i,l,u,d=Math.abs(r),f=r<0?"-":"";if(t.match(/^00+$/))return f+xd(d,t.length);if(t.match(/^[#?]+$/))return s=xd(r,0),s==="0"&&(s=""),s.length>t.length?s:vn(t.substr(0,t.length-s.length))+s;if(i=t.match($F))return f0e(i,d,f);if(t.match(/^#+0+$/))return f+xd(d,t.length-t.indexOf("0"));if(i=t.match(UF))return s=p8(r,i[1].length).replace(/^([^\.]+)$/,"$1."+vn(i[1])).replace(/\.$/,"."+vn(i[1])).replace(/\.(\d*)$/,function(b,w){return"."+w+Vr("0",vn(i[1]).length-w.length)}),t.indexOf("0.")!==-1?s:s.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),i=t.match(/^(0*)\.(#*)$/))return f+p8(d,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=t.match(/^#{1,3},##0(\.?)$/))return f+Al(xd(d,0));if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Is(e,t,-r):Al(""+(Math.floor(r)+p0e(r,i[1].length)))+"."+pi(m8(r,i[1].length),i[1].length);if(i=t.match(/^#,#*,#0/))return Is(e,t.replace(/^#,#*,/,""),r);if(i=t.match(/^([0#]+)(\\?-([0#]+))+$/))return s=qd(Is(e,t.replace(/[\\-]/g,""),r)),l=0,qd(qd(t.replace(/\\/g,"")).replace(/[0#]/g,function(b){return l<s.length?s.charAt(l++):b==="0"?"0":""}));if(t.match(qF))return s=Is(e,"##########",r),"("+s.substr(0,3)+") "+s.substr(3,3)+"-"+s.substr(6);var p="";if(i=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(i[4].length,7),u=Dx(d,Math.pow(10,l)-1,!1),s=""+f,p=Ao("n",i[1],u[1]),p.charAt(p.length-1)==" "&&(p=p.substr(0,p.length-1)+"0"),s+=p+i[2]+"/"+i[3],p=Ox(u[2],l),p.length<i[4].length&&(p=vn(i[4].substr(i[4].length-p.length))+p),s+=p,s;if(i=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(Math.max(i[1].length,i[4].length),7),u=Dx(d,Math.pow(10,l)-1,!0),f+(u[0]||(u[1]?"":"0"))+" "+(u[1]?Zk(u[1],l)+i[2]+"/"+i[3]+Ox(u[2],l):Vr(" ",2*l+1+i[2].length+i[3].length));if(i=t.match(/^[#0?]+$/))return s=xd(r,0),t.length<=s.length?s:vn(t.substr(0,t.length-s.length))+s;if(i=t.match(/^([#0?]+)\.([#0]+)$/)){s=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),l=s.indexOf(".");var m=t.indexOf(".")-l,x=t.length-s.length-m;return vn(t.substr(0,m)+s+t.substr(t.length-x))}if(i=t.match(/^00,000\.([#0]*0)$/))return l=m8(r,i[1].length),r<0?"-"+Is(e,t,-r):Al(m0e(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(b){return"00,"+(b.length<3?pi(0,3-b.length):"")+b})+"."+pi(l,i[1].length);switch(t){case"###,##0.00":return Is(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var v=Al(xd(d,0));return v!=="0"?f+v:"";case"###,###.00":return Is(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return Is(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function g0e(e,t,r){for(var a=t.length-1;t.charCodeAt(a-1)===44;)--a;return Ao(e,t.substr(0,a),r/Math.pow(10,3*(t.length-a)))}function x0e(e,t,r){var a=t.replace(zF,""),s=t.length-a.length;return Ao(e,a,r*Math.pow(10,2*s))+Vr("%",s)}function WF(e,t){var r,a=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+WF(e,-t);var s=e.indexOf(".");s===-1&&(s=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%s;if(i<0&&(i+=s),r=(t/Math.pow(10,i)).toPrecision(a+1+(s+i)%s),!r.match(/[Ee]/)){var l=Math.floor(Math.log(t)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(l-r.length+i):r+="E+"+(l-i),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(u,d,f,p){return d+f+p.substr(0,(s+i)%s)+"."+p.substr(i)+"E"})}else r=t.toExponential(a);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function Fi(e,t,r){if(e.charCodeAt(0)===40&&!t.match(HF)){var a=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Fi("n",a,r):"("+Fi("n",a,-r)+")"}if(t.charCodeAt(t.length-1)===44)return g0e(e,t,r);if(t.indexOf("%")!==-1)return x0e(e,t,r);if(t.indexOf("E")!==-1)return WF(t,r);if(t.charCodeAt(0)===36)return"$"+Fi(e,t.substr(t.charAt(1)==" "?2:1),r);var s,i,l,u,d=Math.abs(r),f=r<0?"-":"";if(t.match(/^00+$/))return f+pi(d,t.length);if(t.match(/^[#?]+$/))return s=""+r,r===0&&(s=""),s.length>t.length?s:vn(t.substr(0,t.length-s.length))+s;if(i=t.match($F))return h0e(i,d,f);if(t.match(/^#+0+$/))return f+pi(d,t.length-t.indexOf("0"));if(i=t.match(UF))return s=(""+r).replace(/^([^\.]+)$/,"$1."+vn(i[1])).replace(/\.$/,"."+vn(i[1])),s=s.replace(/\.(\d*)$/,function(b,w){return"."+w+Vr("0",vn(i[1]).length-w.length)}),t.indexOf("0.")!==-1?s:s.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),i=t.match(/^(0*)\.(#*)$/))return f+(""+d).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=t.match(/^#{1,3},##0(\.?)$/))return f+Al(""+d);if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Fi(e,t,-r):Al(""+r)+"."+Vr("0",i[1].length);if(i=t.match(/^#,#*,#0/))return Fi(e,t.replace(/^#,#*,/,""),r);if(i=t.match(/^([0#]+)(\\?-([0#]+))+$/))return s=qd(Fi(e,t.replace(/[\\-]/g,""),r)),l=0,qd(qd(t.replace(/\\/g,"")).replace(/[0#]/g,function(b){return l<s.length?s.charAt(l++):b==="0"?"0":""}));if(t.match(qF))return s=Fi(e,"##########",r),"("+s.substr(0,3)+") "+s.substr(3,3)+"-"+s.substr(6);var p="";if(i=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(i[4].length,7),u=Dx(d,Math.pow(10,l)-1,!1),s=""+f,p=Ao("n",i[1],u[1]),p.charAt(p.length-1)==" "&&(p=p.substr(0,p.length-1)+"0"),s+=p+i[2]+"/"+i[3],p=Ox(u[2],l),p.length<i[4].length&&(p=vn(i[4].substr(i[4].length-p.length))+p),s+=p,s;if(i=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(Math.max(i[1].length,i[4].length),7),u=Dx(d,Math.pow(10,l)-1,!0),f+(u[0]||(u[1]?"":"0"))+" "+(u[1]?Zk(u[1],l)+i[2]+"/"+i[3]+Ox(u[2],l):Vr(" ",2*l+1+i[2].length+i[3].length));if(i=t.match(/^[#0?]+$/))return s=""+r,t.length<=s.length?s:vn(t.substr(0,t.length-s.length))+s;if(i=t.match(/^([#0]+)\.([#0]+)$/)){s=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),l=s.indexOf(".");var m=t.indexOf(".")-l,x=t.length-s.length-m;return vn(t.substr(0,m)+s+t.substr(t.length-x))}if(i=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+Fi(e,t,-r):Al(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(b){return"00,"+(b.length<3?pi(0,3-b.length):"")+b})+"."+pi(0,i[1].length);switch(t){case"###,###":case"##,###":case"#,###":var v=Al(""+d);return v!=="0"?f+v:"";default:if(t.match(/\.[0#?]*$/))return Fi(e,t.slice(0,t.lastIndexOf(".")),r)+vn(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function Ao(e,t,r){return(r|0)===r?Fi(e,t,r):Is(e,t,r)}function y0e(e){for(var t=[],r=!1,a=0,s=0;a<e.length;++a)switch(e.charCodeAt(a)){case 34:r=!r;break;case 95:case 42:case 92:++a;break;case 59:t[t.length]=e.substr(s,a-s),s=a+1}if(t[t.length]=e.substr(s),r===!0)throw new Error("Format |"+e+"| unterminated string ");return t}var VF=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function GF(e){for(var t=0,r="",a="";t<e.length;)switch(r=e.charAt(t)){case"G":Px(e,t)&&(t+=6),t++;break;case'"':for(;e.charCodeAt(++t)!==34&&t<e.length;);++t;break;case"\\":t+=2;break;case"_":t+=2;break;case"@":++t;break;case"B":case"b":if(e.charAt(t+1)==="1"||e.charAt(t+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(e.substr(t,3).toUpperCase()==="A/P"||e.substr(t,5).toUpperCase()==="AM/PM"||e.substr(t,5).toUpperCase()==="上午/下午")return!0;++t;break;case"[":for(a=r;e.charAt(t++)!=="]"&&t<e.length;)a+=e.charAt(t);if(a.match(VF))return!0;break;case".":case"0":case"#":for(;t<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++t))>-1||r=="\\"&&e.charAt(t+1)=="-"&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===r;);break;case"*":++t,(e.charAt(t)==" "||e.charAt(t)=="*")&&++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&"0123456789".indexOf(e.charAt(++t))>-1;);break;case" ":++t;break;default:++t;break}return!1}function v0e(e,t,r,a){for(var s=[],i="",l=0,u="",d="t",f,p,m,x="H";l<e.length;)switch(u=e.charAt(l)){case"G":if(!Px(e,l))throw new Error("unrecognized character "+u+" in "+e);s[s.length]={t:"G",v:"General"},l+=7;break;case'"':for(i="";(m=e.charCodeAt(++l))!==34&&l<e.length;)i+=String.fromCharCode(m);s[s.length]={t:"t",v:i},++l;break;case"\\":var v=e.charAt(++l),b=v==="("||v===")"?v:"t";s[s.length]={t:b,v},++l;break;case"_":s[s.length]={t:"t",v:" "},l+=2;break;case"@":s[s.length]={t:"T",v:t},++l;break;case"B":case"b":if(e.charAt(l+1)==="1"||e.charAt(l+1)==="2"){if(f==null&&(f=Zm(t,r,e.charAt(l+1)==="2"),f==null))return"";s[s.length]={t:"X",v:e.substr(l,2)},d=u,l+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":u=u.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0||f==null&&(f=Zm(t,r),f==null))return"";for(i=u;++l<e.length&&e.charAt(l).toLowerCase()===u;)i+=u;u==="m"&&d.toLowerCase()==="h"&&(u="M"),u==="h"&&(u=x),s[s.length]={t:u,v:i},d=u;break;case"A":case"a":case"上":var w={t:u,v:u};if(f==null&&(f=Zm(t,r)),e.substr(l,3).toUpperCase()==="A/P"?(f!=null&&(w.v=f.H>=12?"P":"A"),w.t="T",x="h",l+=3):e.substr(l,5).toUpperCase()==="AM/PM"?(f!=null&&(w.v=f.H>=12?"PM":"AM"),w.t="T",l+=5,x="h"):e.substr(l,5).toUpperCase()==="上午/下午"?(f!=null&&(w.v=f.H>=12?"下午":"上午"),w.t="T",l+=5,x="h"):(w.t="t",++l),f==null&&w.t==="T")return"";s[s.length]=w,d=u;break;case"[":for(i=u;e.charAt(l++)!=="]"&&l<e.length;)i+=e.charAt(l);if(i.slice(-1)!=="]")throw'unterminated "[" block: |'+i+"|";if(i.match(VF)){if(f==null&&(f=Zm(t,r),f==null))return"";s[s.length]={t:"Z",v:i.toLowerCase()},d=i.charAt(1)}else i.indexOf("$")>-1&&(i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$",GF(e)||(s[s.length]={t:"t",v:i}));break;case".":if(f!=null){for(i=u;++l<e.length&&(u=e.charAt(l))==="0";)i+=u;s[s.length]={t:"s",v:i};break}case"0":case"#":for(i=u;++l<e.length&&"0#?.,E+-%".indexOf(u=e.charAt(l))>-1;)i+=u;s[s.length]={t:"n",v:i};break;case"?":for(i=u;e.charAt(++l)===u;)i+=u;s[s.length]={t:u,v:i},d=u;break;case"*":++l,(e.charAt(l)==" "||e.charAt(l)=="*")&&++l;break;case"(":case")":s[s.length]={t:a===1?"t":u,v:u},++l;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(i=u;l<e.length&&"0123456789".indexOf(e.charAt(++l))>-1;)i+=e.charAt(l);s[s.length]={t:"D",v:i};break;case" ":s[s.length]={t:u,v:u},++l;break;case"$":s[s.length]={t:"t",v:"$"},++l;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(u)===-1)throw new Error("unrecognized character "+u+" in "+e);s[s.length]={t:"t",v:u},++l;break}var j=0,k=0,C;for(l=s.length-1,d="t";l>=0;--l)switch(s[l].t){case"h":case"H":s[l].t=x,d="h",j<1&&(j=1);break;case"s":(C=s[l].v.match(/\.0+$/))&&(k=Math.max(k,C[0].length-1)),j<3&&(j=3);case"d":case"y":case"M":case"e":d=s[l].t;break;case"m":d==="s"&&(s[l].t="M",j<2&&(j=2));break;case"X":break;case"Z":j<1&&s[l].v.match(/[Hh]/)&&(j=1),j<2&&s[l].v.match(/[Mm]/)&&(j=2),j<3&&s[l].v.match(/[Ss]/)&&(j=3)}switch(j){case 0:break;case 1:f.u>=.5&&(f.u=0,++f.S),f.S>=60&&(f.S=0,++f.M),f.M>=60&&(f.M=0,++f.H);break;case 2:f.u>=.5&&(f.u=0,++f.S),f.S>=60&&(f.S=0,++f.M);break}var N="",O;for(l=0;l<s.length;++l)switch(s[l].t){case"t":case"T":case" ":case"D":break;case"X":s[l].v="",s[l].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":s[l].v=c0e(s[l].t.charCodeAt(0),s[l].v,f,k),s[l].t="t";break;case"n":case"?":for(O=l+1;s[O]!=null&&((u=s[O].t)==="?"||u==="D"||(u===" "||u==="t")&&s[O+1]!=null&&(s[O+1].t==="?"||s[O+1].t==="t"&&s[O+1].v==="/")||s[l].t==="("&&(u===" "||u==="n"||u===")")||u==="t"&&(s[O].v==="/"||s[O].v===" "&&s[O+1]!=null&&s[O+1].t=="?"));)s[l].v+=s[O].v,s[O]={v:"",t:";"},++O;N+=s[l].v,l=O-1;break;case"G":s[l].t="t",s[l].v=Hj(t,r);break}var E="",A,T;if(N.length>0){N.charCodeAt(0)==40?(A=t<0&&N.charCodeAt(0)===45?-t:t,T=Ao("n",N,A)):(A=t<0&&a>1?-t:t,T=Ao("n",N,A),A<0&&s[0]&&s[0].t=="t"&&(T=T.substr(1),s[0].v="-"+s[0].v)),O=T.length-1;var P=s.length;for(l=0;l<s.length;++l)if(s[l]!=null&&s[l].t!="t"&&s[l].v.indexOf(".")>-1){P=l;break}var D=s.length;if(P===s.length&&T.indexOf("E")===-1){for(l=s.length-1;l>=0;--l)s[l]==null||"n?".indexOf(s[l].t)===-1||(O>=s[l].v.length-1?(O-=s[l].v.length,s[l].v=T.substr(O+1,s[l].v.length)):O<0?s[l].v="":(s[l].v=T.substr(0,O+1),O=-1),s[l].t="t",D=l);O>=0&&D<s.length&&(s[D].v=T.substr(0,O+1)+s[D].v)}else if(P!==s.length&&T.indexOf("E")===-1){for(O=T.indexOf(".")-1,l=P;l>=0;--l)if(!(s[l]==null||"n?".indexOf(s[l].t)===-1)){for(p=s[l].v.indexOf(".")>-1&&l===P?s[l].v.indexOf(".")-1:s[l].v.length-1,E=s[l].v.substr(p+1);p>=0;--p)O>=0&&(s[l].v.charAt(p)==="0"||s[l].v.charAt(p)==="#")&&(E=T.charAt(O--)+E);s[l].v=E,s[l].t="t",D=l}for(O>=0&&D<s.length&&(s[D].v=T.substr(0,O+1)+s[D].v),O=T.indexOf(".")+1,l=P;l<s.length;++l)if(!(s[l]==null||"n?(".indexOf(s[l].t)===-1&&l!==P)){for(p=s[l].v.indexOf(".")>-1&&l===P?s[l].v.indexOf(".")+1:0,E=s[l].v.substr(0,p);p<s[l].v.length;++p)O<T.length&&(E+=T.charAt(O++));s[l].v=E,s[l].t="t",D=l}}}for(l=0;l<s.length;++l)s[l]!=null&&"n?".indexOf(s[l].t)>-1&&(A=a>1&&t<0&&l>0&&s[l-1].v==="-"?-t:t,s[l].v=Ao(s[l].t,s[l].v,A),s[l].t="t");var z="";for(l=0;l!==s.length;++l)s[l]!=null&&(z+=s[l].v);return z}var g8=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function x8(e,t){if(t==null)return!1;var r=parseFloat(t[2]);switch(t[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0;break}return!1}function b0e(e,t){var r=y0e(e),a=r.length,s=r[a-1].indexOf("@");if(a<4&&s>-1&&--a,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof t!="number")return[4,r.length===4||s>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=s>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=s>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=s>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var i=t>0?r[0]:t<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[a,i];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var l=r[0].match(g8),u=r[1].match(g8);return x8(t,l)?[a,r[0]]:x8(t,u)?[a,r[1]]:[a,r[l!=null&&u!=null?2:1]]}return[a,i]}function Ml(e,t,r){r==null&&(r={});var a="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?a=r.dateNF:a=e;break;case"number":e==14&&r.dateNF?a=r.dateNF:a=(r.table!=null?r.table:Kr)[e],a==null&&(a=r.table&&r.table[h8[e]]||Kr[h8[e]]),a==null&&(a=t0e[e]||"General");break}if(Px(a,0))return Hj(t,r);t instanceof Date&&(t=IF(t,r.date1904));var s=b0e(a,t);if(Px(s[1]))return Hj(t,r);if(t===!0)t="TRUE";else if(t===!1)t="FALSE";else if(t===""||t==null)return"";return v0e(s[1],t,r,s[0])}function KF(e,t){if(typeof t!="number"){t=+t||-1;for(var r=0;r<392;++r){if(Kr[r]==null){t<0&&(t=r);continue}if(Kr[r]==e){t=r;break}}t<0&&(t=391)}return Kr[t]=e,t}function Gy(e){for(var t=0;t!=392;++t)e[t]!==void 0&&KF(e[t],t)}function Ky(){Kr=e0e()}var YF=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function w0e(e){var t=typeof e=="number"?Kr[e]:e;return t=t.replace(YF,"(\\d+)"),new RegExp("^"+t+"$")}function j0e(e,t,r){var a=-1,s=-1,i=-1,l=-1,u=-1,d=-1;(t.match(YF)||[]).forEach(function(m,x){var v=parseInt(r[x+1],10);switch(m.toLowerCase().charAt(0)){case"y":a=v;break;case"d":i=v;break;case"h":l=v;break;case"s":d=v;break;case"m":l>=0?u=v:s=v;break}}),d>=0&&u==-1&&s>=0&&(u=s,s=-1);var f=(""+(a>=0?a:new Date().getFullYear())).slice(-4)+"-"+("00"+(s>=1?s:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);f.length==7&&(f="0"+f),f.length==8&&(f="20"+f);var p=("00"+(l>=0?l:0)).slice(-2)+":"+("00"+(u>=0?u:0)).slice(-2)+":"+("00"+(d>=0?d:0)).slice(-2);return l==-1&&u==-1&&d==-1?f:a==-1&&s==-1&&i==-1?p:f+"T"+p}var _0e=(function(){var e={};e.version="1.2.0";function t(){for(var T=0,P=new Array(256),D=0;D!=256;++D)T=D,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,T=T&1?-306674912^T>>>1:T>>>1,P[D]=T;return typeof Int32Array!="undefined"?new Int32Array(P):P}var r=t();function a(T){var P=0,D=0,z=0,G=typeof Int32Array!="undefined"?new Int32Array(4096):new Array(4096);for(z=0;z!=256;++z)G[z]=T[z];for(z=0;z!=256;++z)for(D=T[z],P=256+z;P<4096;P+=256)D=G[P]=D>>>8^T[D&255];var V=[];for(z=1;z!=16;++z)V[z-1]=typeof Int32Array!="undefined"?G.subarray(z*256,z*256+256):G.slice(z*256,z*256+256);return V}var s=a(r),i=s[0],l=s[1],u=s[2],d=s[3],f=s[4],p=s[5],m=s[6],x=s[7],v=s[8],b=s[9],w=s[10],j=s[11],k=s[12],C=s[13],N=s[14];function O(T,P){for(var D=P^-1,z=0,G=T.length;z<G;)D=D>>>8^r[(D^T.charCodeAt(z++))&255];return~D}function E(T,P){for(var D=P^-1,z=T.length-15,G=0;G<z;)D=N[T[G++]^D&255]^C[T[G++]^D>>8&255]^k[T[G++]^D>>16&255]^j[T[G++]^D>>>24]^w[T[G++]]^b[T[G++]]^v[T[G++]]^x[T[G++]]^m[T[G++]]^p[T[G++]]^f[T[G++]]^d[T[G++]]^u[T[G++]]^l[T[G++]]^i[T[G++]]^r[T[G++]];for(z+=15;G<z;)D=D>>>8^r[(D^T[G++])&255];return~D}function A(T,P){for(var D=P^-1,z=0,G=T.length,V=0,ne=0;z<G;)V=T.charCodeAt(z++),V<128?D=D>>>8^r[(D^V)&255]:V<2048?(D=D>>>8^r[(D^(192|V>>6&31))&255],D=D>>>8^r[(D^(128|V&63))&255]):V>=55296&&V<57344?(V=(V&1023)+64,ne=T.charCodeAt(z++)&1023,D=D>>>8^r[(D^(240|V>>8&7))&255],D=D>>>8^r[(D^(128|V>>2&63))&255],D=D>>>8^r[(D^(128|ne>>6&15|(V&3)<<4))&255],D=D>>>8^r[(D^(128|ne&63))&255]):(D=D>>>8^r[(D^(224|V>>12&15))&255],D=D>>>8^r[(D^(128|V>>6&63))&255],D=D>>>8^r[(D^(128|V&63))&255]);return~D}return e.table=r,e.bstr=O,e.buf=E,e.str=A,e})(),br=(function(){var t={};t.version="1.2.1";function r(W,le){for(var Q=W.split("/"),ae=le.split("/"),ue=0,pe=0,Pe=Math.min(Q.length,ae.length);ue<Pe;++ue){if(pe=Q[ue].length-ae[ue].length)return pe;if(Q[ue]!=ae[ue])return Q[ue]<ae[ue]?-1:1}return Q.length-ae.length}function a(W){if(W.charAt(W.length-1)=="/")return W.slice(0,-1).indexOf("/")===-1?W:a(W.slice(0,-1));var le=W.lastIndexOf("/");return le===-1?W:W.slice(0,le+1)}function s(W){if(W.charAt(W.length-1)=="/")return s(W.slice(0,-1));var le=W.lastIndexOf("/");return le===-1?W:W.slice(le+1)}function i(W,le){typeof le=="string"&&(le=new Date(le));var Q=le.getHours();Q=Q<<6|le.getMinutes(),Q=Q<<5|le.getSeconds()>>>1,W.write_shift(2,Q);var ae=le.getFullYear()-1980;ae=ae<<4|le.getMonth()+1,ae=ae<<5|le.getDate(),W.write_shift(2,ae)}function l(W){var le=W.read_shift(2)&65535,Q=W.read_shift(2)&65535,ae=new Date,ue=Q&31;Q>>>=5;var pe=Q&15;Q>>>=4,ae.setMilliseconds(0),ae.setFullYear(Q+1980),ae.setMonth(pe-1),ae.setDate(ue);var Pe=le&31;le>>>=5;var Ue=le&63;return le>>>=6,ae.setHours(le),ae.setMinutes(Ue),ae.setSeconds(Pe<<1),ae}function u(W){is(W,0);for(var le={},Q=0;W.l<=W.length-4;){var ae=W.read_shift(2),ue=W.read_shift(2),pe=W.l+ue,Pe={};ae===21589&&(Q=W.read_shift(1),Q&1&&(Pe.mtime=W.read_shift(4)),ue>5&&(Q&2&&(Pe.atime=W.read_shift(4)),Q&4&&(Pe.ctime=W.read_shift(4))),Pe.mtime&&(Pe.mt=new Date(Pe.mtime*1e3))),W.l=pe,le[ae]=Pe}return le}var d;function f(){return d||(d={})}function p(W,le){if(W[0]==80&&W[1]==75)return ki(W,le);if((W[0]|32)==109&&(W[1]|32)==105)return Ni(W,le);if(W.length<512)throw new Error("CFB file size "+W.length+" < 512");var Q=3,ae=512,ue=0,pe=0,Pe=0,Ue=0,Fe=0,Me=[],Le=W.slice(0,512);is(Le,0);var Ye=m(Le);switch(Q=Ye[0],Q){case 3:ae=512;break;case 4:ae=4096;break;case 0:if(Ye[1]==0)return ki(W,le);default:throw new Error("Major Version: Expected 3 or 4 saw "+Q)}ae!==512&&(Le=W.slice(0,ae),is(Le,28));var rt=W.slice(0,ae);x(Le,Q);var et=Le.read_shift(4,"i");if(Q===3&&et!==0)throw new Error("# Directory Sectors: Expected 0 saw "+et);Le.l+=4,Pe=Le.read_shift(4,"i"),Le.l+=4,Le.chk("00100000","Mini Stream Cutoff Size: "),Ue=Le.read_shift(4,"i"),ue=Le.read_shift(4,"i"),Fe=Le.read_shift(4,"i"),pe=Le.read_shift(4,"i");for(var Je=-1,it=0;it<109&&(Je=Le.read_shift(4,"i"),!(Je<0));++it)Me[it]=Je;var lt=v(W,ae);j(Fe,pe,lt,ae,Me);var Yt=C(lt,Pe,Me,ae);Yt[Pe].name="!Directory",ue>0&&Ue!==ne&&(Yt[Ue].name="!MiniFAT"),Yt[Me[0]].name="!FAT",Yt.fat_addrs=Me,Yt.ssz=ae;var or={},pr=[],js=[],Yl=[];N(Pe,Yt,lt,pr,ue,or,js,Ue),b(js,Yl,pr),pr.shift();var Xo={FileIndex:js,FullPaths:Yl};return le&&le.raw&&(Xo.raw={header:rt,sectors:lt}),Xo}function m(W){if(W[W.l]==80&&W[W.l+1]==75)return[0,0];W.chk(ge,"Header Signature: "),W.l+=16;var le=W.read_shift(2,"u");return[W.read_shift(2,"u"),le]}function x(W,le){var Q=9;switch(W.l+=2,Q=W.read_shift(2)){case 9:if(le!=3)throw new Error("Sector Shift: Expected 9 saw "+Q);break;case 12:if(le!=4)throw new Error("Sector Shift: Expected 12 saw "+Q);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+Q)}W.chk("0600","Mini Sector Shift: "),W.chk("000000000000","Reserved: ")}function v(W,le){for(var Q=Math.ceil(W.length/le)-1,ae=[],ue=1;ue<Q;++ue)ae[ue-1]=W.slice(ue*le,(ue+1)*le);return ae[Q-1]=W.slice(Q*le),ae}function b(W,le,Q){for(var ae=0,ue=0,pe=0,Pe=0,Ue=0,Fe=Q.length,Me=[],Le=[];ae<Fe;++ae)Me[ae]=Le[ae]=ae,le[ae]=Q[ae];for(;Ue<Le.length;++Ue)ae=Le[Ue],ue=W[ae].L,pe=W[ae].R,Pe=W[ae].C,Me[ae]===ae&&(ue!==-1&&Me[ue]!==ue&&(Me[ae]=Me[ue]),pe!==-1&&Me[pe]!==pe&&(Me[ae]=Me[pe])),Pe!==-1&&(Me[Pe]=ae),ue!==-1&&ae!=Me[ae]&&(Me[ue]=Me[ae],Le.lastIndexOf(ue)<Ue&&Le.push(ue)),pe!==-1&&ae!=Me[ae]&&(Me[pe]=Me[ae],Le.lastIndexOf(pe)<Ue&&Le.push(pe));for(ae=1;ae<Fe;++ae)Me[ae]===ae&&(pe!==-1&&Me[pe]!==pe?Me[ae]=Me[pe]:ue!==-1&&Me[ue]!==ue&&(Me[ae]=Me[ue]));for(ae=1;ae<Fe;++ae)if(W[ae].type!==0){if(Ue=ae,Ue!=Me[Ue])do Ue=Me[Ue],le[ae]=le[Ue]+"/"+le[ae];while(Ue!==0&&Me[Ue]!==-1&&Ue!=Me[Ue]);Me[ae]=-1}for(le[0]+="/",ae=1;ae<Fe;++ae)W[ae].type!==2&&(le[ae]+="/")}function w(W,le,Q){for(var ae=W.start,ue=W.size,pe=[],Pe=ae;Q&&ue>0&&Pe>=0;)pe.push(le.slice(Pe*V,Pe*V+V)),ue-=V,Pe=Oc(Q,Pe*4);return pe.length===0?He(0):Ga(pe).slice(0,W.size)}function j(W,le,Q,ae,ue){var pe=ne;if(W===ne){if(le!==0)throw new Error("DIFAT chain shorter than expected")}else if(W!==-1){var Pe=Q[W],Ue=(ae>>>2)-1;if(!Pe)return;for(var Fe=0;Fe<Ue&&(pe=Oc(Pe,Fe*4))!==ne;++Fe)ue.push(pe);j(Oc(Pe,ae-4),le-1,Q,ae,ue)}}function k(W,le,Q,ae,ue){var pe=[],Pe=[];ue||(ue=[]);var Ue=ae-1,Fe=0,Me=0;for(Fe=le;Fe>=0;){ue[Fe]=!0,pe[pe.length]=Fe,Pe.push(W[Fe]);var Le=Q[Math.floor(Fe*4/ae)];if(Me=Fe*4&Ue,ae<4+Me)throw new Error("FAT boundary crossed: "+Fe+" 4 "+ae);if(!W[Le])break;Fe=Oc(W[Le],Me)}return{nodes:pe,data:S8([Pe])}}function C(W,le,Q,ae){var ue=W.length,pe=[],Pe=[],Ue=[],Fe=[],Me=ae-1,Le=0,Ye=0,rt=0,et=0;for(Le=0;Le<ue;++Le)if(Ue=[],rt=Le+le,rt>=ue&&(rt-=ue),!Pe[rt]){Fe=[];var Je=[];for(Ye=rt;Ye>=0;){Je[Ye]=!0,Pe[Ye]=!0,Ue[Ue.length]=Ye,Fe.push(W[Ye]);var it=Q[Math.floor(Ye*4/ae)];if(et=Ye*4&Me,ae<4+et)throw new Error("FAT boundary crossed: "+Ye+" 4 "+ae);if(!W[it]||(Ye=Oc(W[it],et),Je[Ye]))break}pe[rt]={nodes:Ue,data:S8([Fe])}}return pe}function N(W,le,Q,ae,ue,pe,Pe,Ue){for(var Fe=0,Me=ae.length?2:0,Le=le[W].data,Ye=0,rt=0,et;Ye<Le.length;Ye+=128){var Je=Le.slice(Ye,Ye+128);is(Je,64),rt=Je.read_shift(2),et=sS(Je,0,rt-Me),ae.push(et);var it={name:et,type:Je.read_shift(1),color:Je.read_shift(1),L:Je.read_shift(4,"i"),R:Je.read_shift(4,"i"),C:Je.read_shift(4,"i"),clsid:Je.read_shift(16),state:Je.read_shift(4,"i"),start:0,size:0},lt=Je.read_shift(2)+Je.read_shift(2)+Je.read_shift(2)+Je.read_shift(2);lt!==0&&(it.ct=O(Je,Je.l-8));var Yt=Je.read_shift(2)+Je.read_shift(2)+Je.read_shift(2)+Je.read_shift(2);Yt!==0&&(it.mt=O(Je,Je.l-8)),it.start=Je.read_shift(4,"i"),it.size=Je.read_shift(4,"i"),it.size<0&&it.start<0&&(it.size=it.type=0,it.start=ne,it.name=""),it.type===5?(Fe=it.start,ue>0&&Fe!==ne&&(le[Fe].name="!StreamData")):it.size>=4096?(it.storage="fat",le[it.start]===void 0&&(le[it.start]=k(Q,it.start,le.fat_addrs,le.ssz)),le[it.start].name=it.name,it.content=le[it.start].data.slice(0,it.size)):(it.storage="minifat",it.size<0?it.size=0:Fe!==ne&&it.start!==ne&&le[Fe]&&(it.content=w(it,le[Fe].data,(le[Ue]||{}).data))),it.content&&is(it.content,0),pe[et]=it,Pe.push(it)}}function O(W,le){return new Date((ls(W,le+4)/1e7*Math.pow(2,32)+ls(W,le)/1e7-11644473600)*1e3)}function E(W,le){return f(),p(d.readFileSync(W),le)}function A(W,le){var Q=le&&le.type;switch(Q||ar&&Buffer.isBuffer(W)&&(Q="buffer"),Q||"base64"){case"file":return E(W,le);case"base64":return p(di(Bo(W)),le);case"binary":return p(di(W),le)}return p(W,le)}function T(W,le){var Q=le||{},ae=Q.root||"Root Entry";if(W.FullPaths||(W.FullPaths=[]),W.FileIndex||(W.FileIndex=[]),W.FullPaths.length!==W.FileIndex.length)throw new Error("inconsistent CFB structure");W.FullPaths.length===0&&(W.FullPaths[0]=ae+"/",W.FileIndex[0]={name:ae,type:5}),Q.CLSID&&(W.FileIndex[0].clsid=Q.CLSID),P(W)}function P(W){var le="Sh33tJ5";if(!br.find(W,"/"+le)){var Q=He(4);Q[0]=55,Q[1]=Q[3]=50,Q[2]=54,W.FileIndex.push({name:le,type:2,content:Q,size:4,L:69,R:69,C:69}),W.FullPaths.push(W.FullPaths[0]+le),D(W)}}function D(W,le){T(W);for(var Q=!1,ae=!1,ue=W.FullPaths.length-1;ue>=0;--ue){var pe=W.FileIndex[ue];switch(pe.type){case 0:ae?Q=!0:(W.FileIndex.pop(),W.FullPaths.pop());break;case 1:case 2:case 5:ae=!0,isNaN(pe.R*pe.L*pe.C)&&(Q=!0),pe.R>-1&&pe.L>-1&&pe.R==pe.L&&(Q=!0);break;default:Q=!0;break}}if(!(!Q&&!le)){var Pe=new Date(1987,1,19),Ue=0,Fe=Object.create?Object.create(null):{},Me=[];for(ue=0;ue<W.FullPaths.length;++ue)Fe[W.FullPaths[ue]]=!0,W.FileIndex[ue].type!==0&&Me.push([W.FullPaths[ue],W.FileIndex[ue]]);for(ue=0;ue<Me.length;++ue){var Le=a(Me[ue][0]);ae=Fe[Le],ae||(Me.push([Le,{name:s(Le).replace("/",""),type:1,clsid:U,ct:Pe,mt:Pe,content:null}]),Fe[Le]=!0)}for(Me.sort(function(et,Je){return r(et[0],Je[0])}),W.FullPaths=[],W.FileIndex=[],ue=0;ue<Me.length;++ue)W.FullPaths[ue]=Me[ue][0],W.FileIndex[ue]=Me[ue][1];for(ue=0;ue<Me.length;++ue){var Ye=W.FileIndex[ue],rt=W.FullPaths[ue];if(Ye.name=s(rt).replace("/",""),Ye.L=Ye.R=Ye.C=-(Ye.color=1),Ye.size=Ye.content?Ye.content.length:0,Ye.start=0,Ye.clsid=Ye.clsid||U,ue===0)Ye.C=Me.length>1?1:-1,Ye.size=0,Ye.type=5;else if(rt.slice(-1)=="/"){for(Ue=ue+1;Ue<Me.length&&a(W.FullPaths[Ue])!=rt;++Ue);for(Ye.C=Ue>=Me.length?-1:Ue,Ue=ue+1;Ue<Me.length&&a(W.FullPaths[Ue])!=a(rt);++Ue);Ye.R=Ue>=Me.length?-1:Ue,Ye.type=1}else a(W.FullPaths[ue+1]||"")==a(rt)&&(Ye.R=ue+1),Ye.type=2}}}function z(W,le){var Q=le||{};if(Q.fileType=="mad")return _u(W,Q);if(D(W),Q.fileType==="zip")return Ji(W,Q);var ae=(function(et){for(var Je=0,it=0,lt=0;lt<et.FileIndex.length;++lt){var Yt=et.FileIndex[lt];if(Yt.content){var or=Yt.content.length;or>0&&(or<4096?Je+=or+63>>6:it+=or+511>>9)}}for(var pr=et.FullPaths.length+3>>2,js=Je+7>>3,Yl=Je+127>>7,Xo=js+it+pr+Yl,Ci=Xo+127>>7,S0=Ci<=109?0:Math.ceil((Ci-109)/127);Xo+Ci+S0+127>>7>Ci;)S0=++Ci<=109?0:Math.ceil((Ci-109)/127);var Tn=[1,S0,Ci,Yl,pr,it,Je,0];return et.FileIndex[0].size=Je<<6,Tn[7]=(et.FileIndex[0].start=Tn[0]+Tn[1]+Tn[2]+Tn[3]+Tn[4]+Tn[5])+(Tn[6]+7>>3),Tn})(W),ue=He(ae[7]<<9),pe=0,Pe=0;{for(pe=0;pe<8;++pe)ue.write_shift(1,Z[pe]);for(pe=0;pe<8;++pe)ue.write_shift(2,0);for(ue.write_shift(2,62),ue.write_shift(2,3),ue.write_shift(2,65534),ue.write_shift(2,9),ue.write_shift(2,6),pe=0;pe<3;++pe)ue.write_shift(2,0);for(ue.write_shift(4,0),ue.write_shift(4,ae[2]),ue.write_shift(4,ae[0]+ae[1]+ae[2]+ae[3]-1),ue.write_shift(4,0),ue.write_shift(4,4096),ue.write_shift(4,ae[3]?ae[0]+ae[1]+ae[2]-1:ne),ue.write_shift(4,ae[3]),ue.write_shift(-4,ae[1]?ae[0]-1:ne),ue.write_shift(4,ae[1]),pe=0;pe<109;++pe)ue.write_shift(-4,pe<ae[2]?ae[1]+pe:-1)}if(ae[1])for(Pe=0;Pe<ae[1];++Pe){for(;pe<236+Pe*127;++pe)ue.write_shift(-4,pe<ae[2]?ae[1]+pe:-1);ue.write_shift(-4,Pe===ae[1]-1?ne:Pe+1)}var Ue=function(et){for(Pe+=et;pe<Pe-1;++pe)ue.write_shift(-4,pe+1);et&&(++pe,ue.write_shift(-4,ne))};for(Pe=pe=0,Pe+=ae[1];pe<Pe;++pe)ue.write_shift(-4,ce.DIFSECT);for(Pe+=ae[2];pe<Pe;++pe)ue.write_shift(-4,ce.FATSECT);Ue(ae[3]),Ue(ae[4]);for(var Fe=0,Me=0,Le=W.FileIndex[0];Fe<W.FileIndex.length;++Fe)Le=W.FileIndex[Fe],Le.content&&(Me=Le.content.length,!(Me<4096)&&(Le.start=Pe,Ue(Me+511>>9)));for(Ue(ae[6]+7>>3);ue.l&511;)ue.write_shift(-4,ce.ENDOFCHAIN);for(Pe=pe=0,Fe=0;Fe<W.FileIndex.length;++Fe)Le=W.FileIndex[Fe],Le.content&&(Me=Le.content.length,!(!Me||Me>=4096)&&(Le.start=Pe,Ue(Me+63>>6)));for(;ue.l&511;)ue.write_shift(-4,ce.ENDOFCHAIN);for(pe=0;pe<ae[4]<<2;++pe){var Ye=W.FullPaths[pe];if(!Ye||Ye.length===0){for(Fe=0;Fe<17;++Fe)ue.write_shift(4,0);for(Fe=0;Fe<3;++Fe)ue.write_shift(4,-1);for(Fe=0;Fe<12;++Fe)ue.write_shift(4,0);continue}Le=W.FileIndex[pe],pe===0&&(Le.start=Le.size?Le.start-1:ne);var rt=pe===0&&Q.root||Le.name;if(Me=2*(rt.length+1),ue.write_shift(64,rt,"utf16le"),ue.write_shift(2,Me),ue.write_shift(1,Le.type),ue.write_shift(1,Le.color),ue.write_shift(-4,Le.L),ue.write_shift(-4,Le.R),ue.write_shift(-4,Le.C),Le.clsid)ue.write_shift(16,Le.clsid,"hex");else for(Fe=0;Fe<4;++Fe)ue.write_shift(4,0);ue.write_shift(4,Le.state||0),ue.write_shift(4,0),ue.write_shift(4,0),ue.write_shift(4,0),ue.write_shift(4,0),ue.write_shift(4,Le.start),ue.write_shift(4,Le.size),ue.write_shift(4,0)}for(pe=1;pe<W.FileIndex.length;++pe)if(Le=W.FileIndex[pe],Le.size>=4096)if(ue.l=Le.start+1<<9,ar&&Buffer.isBuffer(Le.content))Le.content.copy(ue,ue.l,0,Le.size),ue.l+=Le.size+511&-512;else{for(Fe=0;Fe<Le.size;++Fe)ue.write_shift(1,Le.content[Fe]);for(;Fe&511;++Fe)ue.write_shift(1,0)}for(pe=1;pe<W.FileIndex.length;++pe)if(Le=W.FileIndex[pe],Le.size>0&&Le.size<4096)if(ar&&Buffer.isBuffer(Le.content))Le.content.copy(ue,ue.l,0,Le.size),ue.l+=Le.size+63&-64;else{for(Fe=0;Fe<Le.size;++Fe)ue.write_shift(1,Le.content[Fe]);for(;Fe&63;++Fe)ue.write_shift(1,0)}if(ar)ue.l=ue.length;else for(;ue.l<ue.length;)ue.write_shift(1,0);return ue}function G(W,le){var Q=W.FullPaths.map(function(Fe){return Fe.toUpperCase()}),ae=Q.map(function(Fe){var Me=Fe.split("/");return Me[Me.length-(Fe.slice(-1)=="/"?2:1)]}),ue=!1;le.charCodeAt(0)===47?(ue=!0,le=Q[0].slice(0,-1)+le):ue=le.indexOf("/")!==-1;var pe=le.toUpperCase(),Pe=ue===!0?Q.indexOf(pe):ae.indexOf(pe);if(Pe!==-1)return W.FileIndex[Pe];var Ue=!pe.match(Qm);for(pe=pe.replace(Xf,""),Ue&&(pe=pe.replace(Qm,"!")),Pe=0;Pe<Q.length;++Pe)if((Ue?Q[Pe].replace(Qm,"!"):Q[Pe]).replace(Xf,"")==pe||(Ue?ae[Pe].replace(Qm,"!"):ae[Pe]).replace(Xf,"")==pe)return W.FileIndex[Pe];return null}var V=64,ne=-2,ge="d0cf11e0a1b11ae1",Z=[208,207,17,224,161,177,26,225],U="00000000000000000000000000000000",ce={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:ne,FREESECT:-1,HEADER_SIGNATURE:ge,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:U,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function xe(W,le,Q){f();var ae=z(W,Q);d.writeFileSync(le,ae)}function be(W){for(var le=new Array(W.length),Q=0;Q<W.length;++Q)le[Q]=String.fromCharCode(W[Q]);return le.join("")}function me(W,le){var Q=z(W,le);switch(le&&le.type||"buffer"){case"file":return f(),d.writeFileSync(le.filename,Q),Q;case"binary":return typeof Q=="string"?Q:be(Q);case"base64":return Sh(typeof Q=="string"?Q:be(Q));case"buffer":if(ar)return Buffer.isBuffer(Q)?Q:Ko(Q);case"array":return typeof Q=="string"?di(Q):Q}return Q}var oe;function L(W){try{var le=W.InflateRaw,Q=new le;if(Q._processChunk(new Uint8Array([3,0]),Q._finishFlushFlag),Q.bytesRead)oe=W;else throw new Error("zlib does not expose bytesRead")}catch(ae){console.error("cannot use native zlib: "+(ae.message||ae))}}function H(W,le){if(!oe)return Wl(W,le);var Q=oe.InflateRaw,ae=new Q,ue=ae._processChunk(W.slice(W.l),ae._finishFlushFlag);return W.l+=ae.bytesRead,ue}function K(W){return oe?oe.deflateRawSync(W):Ze(W)}var Y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],re=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],de=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ie(W){var le=(W<<1|W<<11)&139536|(W<<5|W<<15)&558144;return(le>>16|le>>8|le)&255}for(var se=typeof Uint8Array!="undefined",he=se?new Uint8Array(256):[],_e=0;_e<256;++_e)he[_e]=ie(_e);function F(W,le){var Q=he[W&255];return le<=8?Q>>>8-le:(Q=Q<<8|he[W>>8&255],le<=16?Q>>>16-le:(Q=Q<<8|he[W>>16&255],Q>>>24-le))}function X(W,le){var Q=le&7,ae=le>>>3;return(W[ae]|(Q<=6?0:W[ae+1]<<8))>>>Q&3}function R(W,le){var Q=le&7,ae=le>>>3;return(W[ae]|(Q<=5?0:W[ae+1]<<8))>>>Q&7}function I(W,le){var Q=le&7,ae=le>>>3;return(W[ae]|(Q<=4?0:W[ae+1]<<8))>>>Q&15}function te(W,le){var Q=le&7,ae=le>>>3;return(W[ae]|(Q<=3?0:W[ae+1]<<8))>>>Q&31}function q(W,le){var Q=le&7,ae=le>>>3;return(W[ae]|(Q<=1?0:W[ae+1]<<8))>>>Q&127}function B(W,le,Q){var ae=le&7,ue=le>>>3,pe=(1<<Q)-1,Pe=W[ue]>>>ae;return Q<8-ae||(Pe|=W[ue+1]<<8-ae,Q<16-ae)||(Pe|=W[ue+2]<<16-ae,Q<24-ae)||(Pe|=W[ue+3]<<24-ae),Pe&pe}function je(W,le,Q){var ae=le&7,ue=le>>>3;return ae<=5?W[ue]|=(Q&7)<<ae:(W[ue]|=Q<<ae&255,W[ue+1]=(Q&7)>>8-ae),le+3}function Ce(W,le,Q){var ae=le&7,ue=le>>>3;return Q=(Q&1)<<ae,W[ue]|=Q,le+1}function ye(W,le,Q){var ae=le&7,ue=le>>>3;return Q<<=ae,W[ue]|=Q&255,Q>>>=8,W[ue+1]=Q,le+8}function Ee(W,le,Q){var ae=le&7,ue=le>>>3;return Q<<=ae,W[ue]|=Q&255,Q>>>=8,W[ue+1]=Q&255,W[ue+2]=Q>>>8,le+16}function Xe(W,le){var Q=W.length,ae=2*Q>le?2*Q:le+5,ue=0;if(Q>=le)return W;if(ar){var pe=u8(ae);if(W.copy)W.copy(pe);else for(;ue<W.length;++ue)pe[ue]=W[ue];return pe}else if(se){var Pe=new Uint8Array(ae);if(Pe.set)Pe.set(W);else for(;ue<Q;++ue)Pe[ue]=W[ue];return Pe}return W.length=ae,W}function tt(W){for(var le=new Array(W),Q=0;Q<W;++Q)le[Q]=0;return le}function ve(W,le,Q){var ae=1,ue=0,pe=0,Pe=0,Ue=0,Fe=W.length,Me=se?new Uint16Array(32):tt(32);for(pe=0;pe<32;++pe)Me[pe]=0;for(pe=Fe;pe<Q;++pe)W[pe]=0;Fe=W.length;var Le=se?new Uint16Array(Fe):tt(Fe);for(pe=0;pe<Fe;++pe)Me[ue=W[pe]]++,ae<ue&&(ae=ue),Le[pe]=0;for(Me[0]=0,pe=1;pe<=ae;++pe)Me[pe+16]=Ue=Ue+Me[pe-1]<<1;for(pe=0;pe<Fe;++pe)Ue=W[pe],Ue!=0&&(Le[pe]=Me[Ue+16]++);var Ye=0;for(pe=0;pe<Fe;++pe)if(Ye=W[pe],Ye!=0)for(Ue=F(Le[pe],ae)>>ae-Ye,Pe=(1<<ae+4-Ye)-1;Pe>=0;--Pe)le[Ue|Pe<<Ye]=Ye&15|pe<<4;return ae}var Oe=se?new Uint16Array(512):tt(512),st=se?new Uint16Array(32):tt(32);if(!se){for(var ct=0;ct<512;++ct)Oe[ct]=0;for(ct=0;ct<32;++ct)st[ct]=0}(function(){for(var W=[],le=0;le<32;le++)W.push(5);ve(W,st,32);var Q=[];for(le=0;le<=143;le++)Q.push(8);for(;le<=255;le++)Q.push(9);for(;le<=279;le++)Q.push(7);for(;le<=287;le++)Q.push(8);ve(Q,Oe,288)})();var ot=(function(){for(var le=se?new Uint8Array(32768):[],Q=0,ae=0;Q<de.length-1;++Q)for(;ae<de[Q+1];++ae)le[ae]=Q;for(;ae<32768;++ae)le[ae]=29;var ue=se?new Uint8Array(259):[];for(Q=0,ae=0;Q<re.length-1;++Q)for(;ae<re[Q+1];++ae)ue[ae]=Q;function pe(Ue,Fe){for(var Me=0;Me<Ue.length;){var Le=Math.min(65535,Ue.length-Me),Ye=Me+Le==Ue.length;for(Fe.write_shift(1,+Ye),Fe.write_shift(2,Le),Fe.write_shift(2,~Le&65535);Le-- >0;)Fe[Fe.l++]=Ue[Me++]}return Fe.l}function Pe(Ue,Fe){for(var Me=0,Le=0,Ye=se?new Uint16Array(32768):[];Le<Ue.length;){var rt=Math.min(65535,Ue.length-Le);if(rt<10){for(Me=je(Fe,Me,+(Le+rt==Ue.length)),Me&7&&(Me+=8-(Me&7)),Fe.l=Me/8|0,Fe.write_shift(2,rt),Fe.write_shift(2,~rt&65535);rt-- >0;)Fe[Fe.l++]=Ue[Le++];Me=Fe.l*8;continue}Me=je(Fe,Me,+(Le+rt==Ue.length)+2);for(var et=0;rt-- >0;){var Je=Ue[Le];et=(et<<5^Je)&32767;var it=-1,lt=0;if((it=Ye[et])&&(it|=Le&-32768,it>Le&&(it-=32768),it<Le))for(;Ue[it+lt]==Ue[Le+lt]&&lt<250;)++lt;if(lt>2){Je=ue[lt],Je<=22?Me=ye(Fe,Me,he[Je+1]>>1)-1:(ye(Fe,Me,3),Me+=5,ye(Fe,Me,he[Je-23]>>5),Me+=3);var Yt=Je<8?0:Je-4>>2;Yt>0&&(Ee(Fe,Me,lt-re[Je]),Me+=Yt),Je=le[Le-it],Me=ye(Fe,Me,he[Je]>>3),Me-=3;var or=Je<4?0:Je-2>>1;or>0&&(Ee(Fe,Me,Le-it-de[Je]),Me+=or);for(var pr=0;pr<lt;++pr)Ye[et]=Le&32767,et=(et<<5^Ue[Le])&32767,++Le;rt-=lt-1}else Je<=143?Je=Je+48:Me=Ce(Fe,Me,1),Me=ye(Fe,Me,he[Je]),Ye[et]=Le&32767,++Le}Me=ye(Fe,Me,0)-1}return Fe.l=(Me+7)/8|0,Fe.l}return function(Fe,Me){return Fe.length<8?pe(Fe,Me):Pe(Fe,Me)}})();function Ze(W){var le=He(50+Math.floor(W.length*1.1)),Q=ot(W,le);return le.slice(0,Q)}var St=se?new Uint16Array(32768):tt(32768),Ir=se?new Uint16Array(32768):tt(32768),Xr=se?new Uint16Array(128):tt(128),jr=1,ea=1;function ma(W,le){var Q=te(W,le)+257;le+=5;var ae=te(W,le)+1;le+=5;var ue=I(W,le)+4;le+=4;for(var pe=0,Pe=se?new Uint8Array(19):tt(19),Ue=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],Fe=1,Me=se?new Uint8Array(8):tt(8),Le=se?new Uint8Array(8):tt(8),Ye=Pe.length,rt=0;rt<ue;++rt)Pe[Y[rt]]=pe=R(W,le),Fe<pe&&(Fe=pe),Me[pe]++,le+=3;var et=0;for(Me[0]=0,rt=1;rt<=Fe;++rt)Le[rt]=et=et+Me[rt-1]<<1;for(rt=0;rt<Ye;++rt)(et=Pe[rt])!=0&&(Ue[rt]=Le[et]++);var Je=0;for(rt=0;rt<Ye;++rt)if(Je=Pe[rt],Je!=0){et=he[Ue[rt]]>>8-Je;for(var it=(1<<7-Je)-1;it>=0;--it)Xr[et|it<<Je]=Je&7|rt<<3}var lt=[];for(Fe=1;lt.length<Q+ae;)switch(et=Xr[q(W,le)],le+=et&7,et>>>=3){case 16:for(pe=3+X(W,le),le+=2,et=lt[lt.length-1];pe-- >0;)lt.push(et);break;case 17:for(pe=3+R(W,le),le+=3;pe-- >0;)lt.push(0);break;case 18:for(pe=11+q(W,le),le+=7;pe-- >0;)lt.push(0);break;default:lt.push(et),Fe<et&&(Fe=et);break}var Yt=lt.slice(0,Q),or=lt.slice(Q);for(rt=Q;rt<286;++rt)Yt[rt]=0;for(rt=ae;rt<30;++rt)or[rt]=0;return jr=ve(Yt,St,286),ea=ve(or,Ir,30),le}function wu(W,le){if(W[0]==3&&!(W[1]&3))return[iu(le),2];for(var Q=0,ae=0,ue=u8(le||1<<18),pe=0,Pe=ue.length>>>0,Ue=0,Fe=0;(ae&1)==0;){if(ae=R(W,Q),Q+=3,ae>>>1)ae>>1==1?(Ue=9,Fe=5):(Q=ma(W,Q),Ue=jr,Fe=ea);else{Q&7&&(Q+=8-(Q&7));var Me=W[Q>>>3]|W[(Q>>>3)+1]<<8;if(Q+=32,Me>0)for(!le&&Pe<pe+Me&&(ue=Xe(ue,pe+Me),Pe=ue.length);Me-- >0;)ue[pe++]=W[Q>>>3],Q+=8;continue}for(;;){!le&&Pe<pe+32767&&(ue=Xe(ue,pe+32767),Pe=ue.length);var Le=B(W,Q,Ue),Ye=ae>>>1==1?Oe[Le]:St[Le];if(Q+=Ye&15,Ye>>>=4,(Ye>>>8&255)===0)ue[pe++]=Ye;else{if(Ye==256)break;Ye-=257;var rt=Ye<8?0:Ye-4>>2;rt>5&&(rt=0);var et=pe+re[Ye];rt>0&&(et+=B(W,Q,rt),Q+=rt),Le=B(W,Q,Fe),Ye=ae>>>1==1?st[Le]:Ir[Le],Q+=Ye&15,Ye>>>=4;var Je=Ye<4?0:Ye-2>>1,it=de[Ye];for(Je>0&&(it+=B(W,Q,Je),Q+=Je),!le&&Pe<et&&(ue=Xe(ue,et+100),Pe=ue.length);pe<et;)ue[pe]=ue[pe-it],++pe}}}return le?[ue,Q+7>>>3]:[ue.slice(0,pe),Q+7>>>3]}function Wl(W,le){var Q=W.slice(W.l||0),ae=wu(Q,le);return W.l+=ae[1],ae[0]}function Vl(W,le){if(W)typeof console!="undefined"&&console.error(le);else throw new Error(le)}function ki(W,le){var Q=W;is(Q,0);var ae=[],ue=[],pe={FileIndex:ae,FullPaths:ue};T(pe,{root:le.root});for(var Pe=Q.length-4;(Q[Pe]!=80||Q[Pe+1]!=75||Q[Pe+2]!=5||Q[Pe+3]!=6)&&Pe>=0;)--Pe;Q.l=Pe+4,Q.l+=4;var Ue=Q.read_shift(2);Q.l+=6;var Fe=Q.read_shift(4);for(Q.l=Fe,Pe=0;Pe<Ue;++Pe){Q.l+=20;var Me=Q.read_shift(4),Le=Q.read_shift(4),Ye=Q.read_shift(2),rt=Q.read_shift(2),et=Q.read_shift(2);Q.l+=8;var Je=Q.read_shift(4),it=u(Q.slice(Q.l+Ye,Q.l+Ye+rt));Q.l+=Ye+rt+et;var lt=Q.l;Q.l=Je+4,Js(Q,Me,Le,pe,it),Q.l=lt}return pe}function Js(W,le,Q,ae,ue){W.l+=2;var pe=W.read_shift(2),Pe=W.read_shift(2),Ue=l(W);if(pe&8257)throw new Error("Unsupported ZIP encryption");for(var Fe=W.read_shift(4),Me=W.read_shift(4),Le=W.read_shift(4),Ye=W.read_shift(2),rt=W.read_shift(2),et="",Je=0;Je<Ye;++Je)et+=String.fromCharCode(W[W.l++]);if(rt){var it=u(W.slice(W.l,W.l+rt));(it[21589]||{}).mt&&(Ue=it[21589].mt),((ue||{})[21589]||{}).mt&&(Ue=ue[21589].mt)}W.l+=rt;var lt=W.slice(W.l,W.l+Me);switch(Pe){case 8:lt=H(W,Le);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+Pe)}var Yt=!1;pe&8&&(Fe=W.read_shift(4),Fe==134695760&&(Fe=W.read_shift(4),Yt=!0),Me=W.read_shift(4),Le=W.read_shift(4)),Me!=le&&Vl(Yt,"Bad compressed size: "+le+" != "+Me),Le!=Q&&Vl(Yt,"Bad uncompressed size: "+Q+" != "+Le),Qi(ae,et,lt,{unsafe:!0,mt:Ue})}function Ji(W,le){var Q=le||{},ae=[],ue=[],pe=He(1),Pe=Q.compression?8:0,Ue=0,Fe=0,Me=0,Le=0,Ye=0,rt=W.FullPaths[0],et=rt,Je=W.FileIndex[0],it=[],lt=0;for(Fe=1;Fe<W.FullPaths.length;++Fe)if(et=W.FullPaths[Fe].slice(rt.length),Je=W.FileIndex[Fe],!(!Je.size||!Je.content||et=="Sh33tJ5")){var Yt=Le,or=He(et.length);for(Me=0;Me<et.length;++Me)or.write_shift(1,et.charCodeAt(Me)&127);or=or.slice(0,or.l),it[Ye]=_0e.buf(Je.content,0);var pr=Je.content;Pe==8&&(pr=K(pr)),pe=He(30),pe.write_shift(4,67324752),pe.write_shift(2,20),pe.write_shift(2,Ue),pe.write_shift(2,Pe),Je.mt?i(pe,Je.mt):pe.write_shift(4,0),pe.write_shift(-4,it[Ye]),pe.write_shift(4,pr.length),pe.write_shift(4,Je.content.length),pe.write_shift(2,or.length),pe.write_shift(2,0),Le+=pe.length,ae.push(pe),Le+=or.length,ae.push(or),Le+=pr.length,ae.push(pr),pe=He(46),pe.write_shift(4,33639248),pe.write_shift(2,0),pe.write_shift(2,20),pe.write_shift(2,Ue),pe.write_shift(2,Pe),pe.write_shift(4,0),pe.write_shift(-4,it[Ye]),pe.write_shift(4,pr.length),pe.write_shift(4,Je.content.length),pe.write_shift(2,or.length),pe.write_shift(2,0),pe.write_shift(2,0),pe.write_shift(2,0),pe.write_shift(2,0),pe.write_shift(4,0),pe.write_shift(4,Yt),lt+=pe.l,ue.push(pe),lt+=or.length,ue.push(or),++Ye}return pe=He(22),pe.write_shift(4,101010256),pe.write_shift(2,0),pe.write_shift(2,0),pe.write_shift(2,Ye),pe.write_shift(2,Ye),pe.write_shift(4,lt),pe.write_shift(4,Le),pe.write_shift(2,0),Ga([Ga(ae),Ga(ue),pe])}var mn={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function ws(W,le){if(W.ctype)return W.ctype;var Q=W.name||"",ae=Q.match(/\.([^\.]+)$/);return ae&&mn[ae[1]]||le&&(ae=(Q=le).match(/[\.\\]([^\.\\])+$/),ae&&mn[ae[1]])?mn[ae[1]]:"application/octet-stream"}function Si(W){for(var le=Sh(W),Q=[],ae=0;ae<le.length;ae+=76)Q.push(le.slice(ae,ae+76));return Q.join(`\r
`)+`\r
`}function ju(W){var le=W.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(Me){var Le=Me.charCodeAt(0).toString(16).toUpperCase();return"="+(Le.length==1?"0"+Le:Le)});le=le.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),le.charAt(0)==`
`&&(le="=0D"+le.slice(1)),le=le.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var Q=[],ae=le.split(`\r
`),ue=0;ue<ae.length;++ue){var pe=ae[ue];if(pe.length==0){Q.push("");continue}for(var Pe=0;Pe<pe.length;){var Ue=76,Fe=pe.slice(Pe,Pe+Ue);Fe.charAt(Ue-1)=="="?Ue--:Fe.charAt(Ue-2)=="="?Ue-=2:Fe.charAt(Ue-3)=="="&&(Ue-=3),Fe=pe.slice(Pe,Pe+Ue),Pe+=Ue,Pe<pe.length&&(Fe+="="),Q.push(Fe)}}return Q.join(`\r
`)}function Gl(W){for(var le=[],Q=0;Q<W.length;++Q){for(var ae=W[Q];Q<=W.length&&ae.charAt(ae.length-1)=="=";)ae=ae.slice(0,ae.length-1)+W[++Q];le.push(ae)}for(var ue=0;ue<le.length;++ue)le[ue]=le[ue].replace(/[=][0-9A-Fa-f]{2}/g,function(pe){return String.fromCharCode(parseInt(pe.slice(1),16))});return di(le.join(`\r
`))}function Yo(W,le,Q){for(var ae="",ue="",pe="",Pe,Ue=0;Ue<10;++Ue){var Fe=le[Ue];if(!Fe||Fe.match(/^\s*$/))break;var Me=Fe.match(/^(.*?):\s*([^\s].*)$/);if(Me)switch(Me[1].toLowerCase()){case"content-location":ae=Me[2].trim();break;case"content-type":pe=Me[2].trim();break;case"content-transfer-encoding":ue=Me[2].trim();break}}switch(++Ue,ue.toLowerCase()){case"base64":Pe=di(Bo(le.slice(Ue).join("")));break;case"quoted-printable":Pe=Gl(le.slice(Ue));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+ue)}var Le=Qi(W,ae.slice(Q.length),Pe,{unsafe:!0});pe&&(Le.ctype=pe)}function Ni(W,le){if(be(W.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var Q=le&&le.root||"",ae=(ar&&Buffer.isBuffer(W)?W.toString("binary"):be(W)).split(`\r
`),ue=0,pe="";for(ue=0;ue<ae.length;++ue)if(pe=ae[ue],!!/^Content-Location:/i.test(pe)&&(pe=pe.slice(pe.indexOf("file")),Q||(Q=pe.slice(0,pe.lastIndexOf("/")+1)),pe.slice(0,Q.length)!=Q))for(;Q.length>0&&(Q=Q.slice(0,Q.length-1),Q=Q.slice(0,Q.lastIndexOf("/")+1),pe.slice(0,Q.length)!=Q););var Pe=(ae[1]||"").match(/boundary="(.*?)"/);if(!Pe)throw new Error("MAD cannot find boundary");var Ue="--"+(Pe[1]||""),Fe=[],Me=[],Le={FileIndex:Fe,FullPaths:Me};T(Le);var Ye,rt=0;for(ue=0;ue<ae.length;++ue){var et=ae[ue];et!==Ue&&et!==Ue+"--"||(rt++&&Yo(Le,ae.slice(Ye,ue),Q),Ye=ue)}return Le}function _u(W,le){var Q=le||{},ae=Q.boundary||"SheetJS";ae="------="+ae;for(var ue=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+ae.slice(2)+'"',"","",""],pe=W.FullPaths[0],Pe=pe,Ue=W.FileIndex[0],Fe=1;Fe<W.FullPaths.length;++Fe)if(Pe=W.FullPaths[Fe].slice(pe.length),Ue=W.FileIndex[Fe],!(!Ue.size||!Ue.content||Pe=="Sh33tJ5")){Pe=Pe.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(lt){return"_x"+lt.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(lt){return"_u"+lt.charCodeAt(0).toString(16)+"_"});for(var Me=Ue.content,Le=ar&&Buffer.isBuffer(Me)?Me.toString("binary"):be(Me),Ye=0,rt=Math.min(1024,Le.length),et=0,Je=0;Je<=rt;++Je)(et=Le.charCodeAt(Je))>=32&&et<128&&++Ye;var it=Ye>=rt*4/5;ue.push(ae),ue.push("Content-Location: "+(Q.root||"file:///C:/SheetJS/")+Pe),ue.push("Content-Transfer-Encoding: "+(it?"quoted-printable":"base64")),ue.push("Content-Type: "+ws(Ue,Pe)),ue.push(""),ue.push(it?ju(Le):Si(Le))}return ue.push(ae+`--\r
`),ue.join(`\r
`)}function Kl(W){var le={};return T(le,W),le}function Qi(W,le,Q,ae){var ue=ae&&ae.unsafe;ue||T(W);var pe=!ue&&br.find(W,le);if(!pe){var Pe=W.FullPaths[0];le.slice(0,Pe.length)==Pe?Pe=le:(Pe.slice(-1)!="/"&&(Pe+="/"),Pe=(Pe+le).replace("//","/")),pe={name:s(le),type:2},W.FileIndex.push(pe),W.FullPaths.push(Pe),ue||br.utils.cfb_gc(W)}return pe.content=Q,pe.size=Q?Q.length:0,ae&&(ae.CLSID&&(pe.clsid=ae.CLSID),ae.mt&&(pe.mt=ae.mt),ae.ct&&(pe.ct=ae.ct)),pe}function Ne(W,le){T(W);var Q=br.find(W,le);if(Q){for(var ae=0;ae<W.FileIndex.length;++ae)if(W.FileIndex[ae]==Q)return W.FileIndex.splice(ae,1),W.FullPaths.splice(ae,1),!0}return!1}function Qe(W,le,Q){T(W);var ae=br.find(W,le);if(ae){for(var ue=0;ue<W.FileIndex.length;++ue)if(W.FileIndex[ue]==ae)return W.FileIndex[ue].name=s(Q),W.FullPaths[ue]=Q,!0}return!1}function ht(W){D(W,!0)}return t.find=G,t.read=A,t.parse=p,t.write=me,t.writeFile=xe,t.utils={cfb_new:Kl,cfb_add:Qi,cfb_del:Ne,cfb_mov:Qe,cfb_gc:ht,ReadShift:Qf,CheckField:hM,prep_blob:is,bconcat:Ga,use_zlib:L,_deflateRaw:Ze,_inflateRaw:Wl,consts:ce},t})();function k0e(e){return typeof e=="string"?Vy(e):Array.isArray(e)?Xde(e):e}function ip(e,t,r){if(typeof Deno!="undefined"){if(r&&typeof t=="string")switch(r){case"utf8":t=new TextEncoder(r).encode(t);break;case"binary":t=Vy(t);break;default:throw new Error("Unsupported encoding "+r)}return Deno.writeFileSync(e,t)}var a=r=="utf8"?Ch(t):t;if(typeof IE_SaveFile!="undefined")return IE_SaveFile(a,e);if(typeof Blob!="undefined"){var s=new Blob([k0e(a)],{type:"application/octet-stream"});if(typeof navigator!="undefined"&&navigator.msSaveBlob)return navigator.msSaveBlob(s,e);if(typeof saveAs!="undefined")return saveAs(s,e);if(typeof URL!="undefined"&&typeof document!="undefined"&&document.createElement&&URL.createObjectURL){var i=URL.createObjectURL(s);if(typeof chrome=="object"&&typeof(chrome.downloads||{}).download=="function")return URL.revokeObjectURL&&typeof setTimeout!="undefined"&&setTimeout(function(){URL.revokeObjectURL(i)},6e4),chrome.downloads.download({url:i,filename:e,saveAs:!0});var l=document.createElement("a");if(l.download!=null)return l.download=e,l.href=i,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL&&typeof setTimeout!="undefined"&&setTimeout(function(){URL.revokeObjectURL(i)},6e4),i}}if(typeof $!="undefined"&&typeof File!="undefined"&&typeof Folder!="undefined")try{var u=File(e);return u.open("w"),u.encoding="binary",Array.isArray(t)&&(t=sp(t)),u.write(t),u.close(),t}catch(d){if(!d.message||!d.message.match(/onstruct/))throw d}throw new Error("cannot save file "+e)}function tn(e){for(var t=Object.keys(e),r=[],a=0;a<t.length;++a)Object.prototype.hasOwnProperty.call(e,t[a])&&r.push(t[a]);return r}function y8(e,t){for(var r=[],a=tn(e),s=0;s!==a.length;++s)r[e[a[s]][t]]==null&&(r[e[a[s]][t]]=a[s]);return r}function tS(e){for(var t=[],r=tn(e),a=0;a!==r.length;++a)t[e[r[a]]]=r[a];return t}function Yy(e){for(var t=[],r=tn(e),a=0;a!==r.length;++a)t[e[r[a]]]=parseInt(r[a],10);return t}function S0e(e){for(var t=[],r=tn(e),a=0;a!==r.length;++a)t[e[r[a]]]==null&&(t[e[r[a]]]=[]),t[e[r[a]]].push(r[a]);return t}var Rx=new Date(1899,11,30,0,0,0);function $n(e,t){var r=e.getTime(),a=Rx.getTime()+(e.getTimezoneOffset()-Rx.getTimezoneOffset())*6e4;return(r-a)/(1440*60*1e3)}var XF=new Date,N0e=Rx.getTime()+(XF.getTimezoneOffset()-Rx.getTimezoneOffset())*6e4,v8=XF.getTimezoneOffset();function JF(e){var t=new Date;return t.setTime(e*24*60*60*1e3+N0e),t.getTimezoneOffset()!==v8&&t.setTime(t.getTime()+(t.getTimezoneOffset()-v8)*6e4),t}var b8=new Date("2017-02-19T19:06:09.000Z"),QF=isNaN(b8.getFullYear())?new Date("2/19/17"):b8,C0e=QF.getFullYear()==2017;function kn(e,t){var r=new Date(e);if(C0e)return t>0?r.setTime(r.getTime()+r.getTimezoneOffset()*60*1e3):t<0&&r.setTime(r.getTime()-r.getTimezoneOffset()*60*1e3),r;if(e instanceof Date)return e;if(QF.getFullYear()==1917&&!isNaN(r.getFullYear())){var a=r.getFullYear();return e.indexOf(""+a)>-1||r.setFullYear(r.getFullYear()+100),r}var s=e.match(/\d+/g)||["2017","2","19","0","0","0"],i=new Date(+s[0],+s[1]-1,+s[2],+s[3]||0,+s[4]||0,+s[5]||0);return e.indexOf("Z")>-1&&(i=new Date(i.getTime()-i.getTimezoneOffset()*60*1e3)),i}function Xy(e,t){if(ar&&Buffer.isBuffer(e))return e.toString("binary");if(typeof TextDecoder!="undefined")try{var r={"€":"€","":"‚",ƒ:"ƒ","„":"„","…":"…","†":"†","‡":"‡","ˆ":"ˆ","‰":"‰",Š:"Š","":"‹",Œ:"Œ",Ž:"Ž","":"‘","":"’","“":"“","”":"”","•":"•","":"–","—":"—","˜":"˜","™":"™",š:"š","":"›",œ:"œ",ž:"ž",Ÿ:"Ÿ"};return Array.isArray(e)&&(e=new Uint8Array(e)),new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(i){return r[i]||i})}catch(i){}for(var a=[],s=0;s!=e.length;++s)a.push(String.fromCharCode(e[s]));return a.join("")}function Un(e){if(typeof JSON!="undefined"&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if(typeof e!="object"||e==null)return e;if(e instanceof Date)return new Date(e.getTime());var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=Un(e[r]));return t}function Vr(e,t){for(var r="";r.length<t;)r+=e;return r}function Oo(e){var t=Number(e);if(!isNaN(t))return isFinite(t)?t:NaN;if(!/\d/.test(e))return t;var r=1,a=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return r*=100,""});return!isNaN(t=Number(a))||(a=a.replace(/[(](.*)[)]/,function(s,i){return r=-r,i}),!isNaN(t=Number(a)))?t/r:t}var T0e=["january","february","march","april","may","june","july","august","september","october","november","december"];function Nh(e){var t=new Date(e),r=new Date(NaN),a=t.getYear(),s=t.getMonth(),i=t.getDate();if(isNaN(i))return r;var l=e.toLowerCase();if(l.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(l=l.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),l.length>3&&T0e.indexOf(l)==-1)return r}else if(l.match(/[a-z]/))return r;return a<0||a>8099?r:(s>0||i>1)&&a!=101?t:e.match(/[^-0-9:,\/\\]/)?r:t}function Ft(e,t,r){if(e.FullPaths){if(typeof r=="string"){var a;return ar?a=Ko(r):a=Jde(r),br.utils.cfb_add(e,t,a)}br.utils.cfb_add(e,t,r)}else e.file(t,r)}function rS(){return br.utils.cfb_new()}var pa=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
`,E0e={"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"},aS=tS(E0e),nS=/[&<>'"]/g,A0e=/[\u0000-\u0008\u000b-\u001f]/g;function fr(e){var t=e+"";return t.replace(nS,function(r){return aS[r]}).replace(A0e,function(r){return"_x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+"_"})}function w8(e){return fr(e).replace(/ /g,"_x0020_")}var ZF=/[\u0000-\u001f]/g;function O0e(e){var t=e+"";return t.replace(nS,function(r){return aS[r]}).replace(/\n/g,"<br/>").replace(ZF,function(r){return"&#x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+";"})}function P0e(e){var t=e+"";return t.replace(nS,function(r){return aS[r]}).replace(ZF,function(r){return"&#x"+r.charCodeAt(0).toString(16).toUpperCase()+";"})}function D0e(e){return e.replace(/(\r\n|[\r\n])/g,"&#10;")}function R0e(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function dw(e){for(var t="",r=0,a=0,s=0,i=0,l=0,u=0;r<e.length;){if(a=e.charCodeAt(r++),a<128){t+=String.fromCharCode(a);continue}if(s=e.charCodeAt(r++),a>191&&a<224){l=(a&31)<<6,l|=s&63,t+=String.fromCharCode(l);continue}if(i=e.charCodeAt(r++),a<240){t+=String.fromCharCode((a&15)<<12|(s&63)<<6|i&63);continue}l=e.charCodeAt(r++),u=((a&7)<<18|(s&63)<<12|(i&63)<<6|l&63)-65536,t+=String.fromCharCode(55296+(u>>>10&1023)),t+=String.fromCharCode(56320+(u&1023))}return t}function j8(e){var t=iu(2*e.length),r,a,s=1,i=0,l=0,u;for(a=0;a<e.length;a+=s)s=1,(u=e.charCodeAt(a))<128?r=u:u<224?(r=(u&31)*64+(e.charCodeAt(a+1)&63),s=2):u<240?(r=(u&15)*4096+(e.charCodeAt(a+1)&63)*64+(e.charCodeAt(a+2)&63),s=3):(s=4,r=(u&7)*262144+(e.charCodeAt(a+1)&63)*4096+(e.charCodeAt(a+2)&63)*64+(e.charCodeAt(a+3)&63),r-=65536,l=55296+(r>>>10&1023),r=56320+(r&1023)),l!==0&&(t[i++]=l&255,t[i++]=l>>>8,l=0),t[i++]=r%256,t[i++]=r>>>8;return t.slice(0,i).toString("ucs2")}function _8(e){return Ko(e,"binary").toString("utf8")}var eg="foo bar baz☃🍣",Jf=ar&&(_8(eg)==dw(eg)&&_8||j8(eg)==dw(eg)&&j8)||dw,Ch=ar?function(e){return Ko(e,"utf8").toString("binary")}:function(e){for(var t=[],r=0,a=0,s=0;r<e.length;)switch(a=e.charCodeAt(r++),!0){case a<128:t.push(String.fromCharCode(a));break;case a<2048:t.push(String.fromCharCode(192+(a>>6))),t.push(String.fromCharCode(128+(a&63)));break;case(a>=55296&&a<57344):a-=55296,s=e.charCodeAt(r++)-56320+(a<<10),t.push(String.fromCharCode(240+(s>>18&7))),t.push(String.fromCharCode(144+(s>>12&63))),t.push(String.fromCharCode(128+(s>>6&63))),t.push(String.fromCharCode(128+(s&63)));break;default:t.push(String.fromCharCode(224+(a>>12))),t.push(String.fromCharCode(128+(a>>6&63))),t.push(String.fromCharCode(128+(a&63)))}return t.join("")},F0e=(function(){var e=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(t){return[new RegExp("&"+t[0]+";","ig"),t[1]]});return function(r){for(var a=r.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,`
`).replace(/<[^>]*>/g,""),s=0;s<e.length;++s)a=a.replace(e[s][0],e[s][1]);return a}})(),eM=/(^\s|\s$|\n)/;function Ka(e,t){return"<"+e+(t.match(eM)?' xml:space="preserve"':"")+">"+t+"</"+e+">"}function Th(e){return tn(e).map(function(t){return" "+t+'="'+e[t]+'"'}).join("")}function at(e,t,r){return"<"+e+(r!=null?Th(r):"")+(t!=null?(t.match(eM)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function qj(e,t){try{return e.toISOString().replace(/\.\d*/,"")}catch(r){if(t)throw r}return""}function M0e(e,t){switch(typeof e){case"string":var r=at("vt:lpwstr",fr(e));return r=r.replace(/&quot;/g,"_x0022_"),r;case"number":return at((e|0)==e?"vt:i4":"vt:r8",fr(String(e)));case"boolean":return at("vt:bool",e?"true":"false")}if(e instanceof Date)return at("vt:filetime",qj(e));throw new Error("Unable to serialize "+e)}var Aa={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},w0=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],os={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function L0e(e,t){for(var r=1-2*(e[t+7]>>>7),a=((e[t+7]&127)<<4)+(e[t+6]>>>4&15),s=e[t+6]&15,i=5;i>=0;--i)s=s*256+e[t+i];return a==2047?s==0?r*(1/0):NaN:(a==0?a=-1022:(a-=1023,s+=Math.pow(2,52)),r*Math.pow(2,a-52)*s)}function I0e(e,t,r){var a=(t<0||1/t==-1/0?1:0)<<7,s=0,i=0,l=a?-t:t;isFinite(l)?l==0?s=i=0:(s=Math.floor(Math.log(l)/Math.LN2),i=l*Math.pow(2,52-s),s<=-1023&&(!isFinite(i)||i<Math.pow(2,52))?s=-1022:(i-=Math.pow(2,52),s+=1023)):(s=2047,i=isNaN(t)?26985:0);for(var u=0;u<=5;++u,i/=256)e[r+u]=i&255;e[r+6]=(s&15)<<4|i&15,e[r+7]=s>>4|a}var k8=function(e){for(var t=[],r=10240,a=0;a<e[0].length;++a)if(e[0][a])for(var s=0,i=e[0][a].length;s<i;s+=r)t.push.apply(t,e[0][a].slice(s,s+r));return t},S8=ar?function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map(function(t){return Buffer.isBuffer(t)?t:Ko(t)})):k8(e)}:k8,N8=function(e,t,r){for(var a=[],s=t;s<r;s+=2)a.push(String.fromCharCode(Hf(e,s)));return a.join("").replace(Xf,"")},sS=ar?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(Xf,""):N8(e,t,r)}:N8,C8=function(e,t,r){for(var a=[],s=t;s<t+r;++s)a.push(("0"+e[s].toString(16)).slice(-2));return a.join("")},tM=ar?function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):C8(e,t,r)}:C8,T8=function(e,t,r){for(var a=[],s=t;s<r;s++)a.push(String.fromCharCode(Cd(e,s)));return a.join("")},op=ar?function(t,r,a){return Buffer.isBuffer(t)?t.toString("utf8",r,a):T8(t,r,a)}:T8,rM=function(e,t){var r=ls(e,t);return r>0?op(e,t+4,t+4+r-1):""},aM=rM,nM=function(e,t){var r=ls(e,t);return r>0?op(e,t+4,t+4+r-1):""},sM=nM,iM=function(e,t){var r=2*ls(e,t);return r>0?op(e,t+4,t+4+r-1):""},oM=iM,lM=function(t,r){var a=ls(t,r);return a>0?sS(t,r+4,r+4+a):""},cM=lM,uM=function(e,t){var r=ls(e,t);return r>0?op(e,t+4,t+4+r):""},dM=uM,fM=function(e,t){return L0e(e,t)},Fx=fM,iS=function(t){return Array.isArray(t)||typeof Uint8Array!="undefined"&&t instanceof Uint8Array};ar&&(aM=function(t,r){if(!Buffer.isBuffer(t))return rM(t,r);var a=t.readUInt32LE(r);return a>0?t.toString("utf8",r+4,r+4+a-1):""},sM=function(t,r){if(!Buffer.isBuffer(t))return nM(t,r);var a=t.readUInt32LE(r);return a>0?t.toString("utf8",r+4,r+4+a-1):""},oM=function(t,r){if(!Buffer.isBuffer(t))return iM(t,r);var a=2*t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+a-1)},cM=function(t,r){if(!Buffer.isBuffer(t))return lM(t,r);var a=t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+a)},dM=function(t,r){if(!Buffer.isBuffer(t))return uM(t,r);var a=t.readUInt32LE(r);return t.toString("utf8",r+4,r+4+a)},Fx=function(t,r){return Buffer.isBuffer(t)?t.readDoubleLE(r):fM(t,r)},iS=function(t){return Buffer.isBuffer(t)||Array.isArray(t)||typeof Uint8Array!="undefined"&&t instanceof Uint8Array});var Cd=function(e,t){return e[t]},Hf=function(e,t){return e[t+1]*256+e[t]},z0e=function(e,t){var r=e[t+1]*256+e[t];return r<32768?r:(65535-r+1)*-1},ls=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},Oc=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},B0e=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function Qf(e,t){var r="",a,s,i=[],l,u,d,f;switch(t){case"dbcs":if(f=this.l,ar&&Buffer.isBuffer(this))r=this.slice(this.l,this.l+2*e).toString("utf16le");else for(d=0;d<e;++d)r+=String.fromCharCode(Hf(this,f)),f+=2;e*=2;break;case"utf8":r=op(this,this.l,this.l+e);break;case"utf16le":e*=2,r=sS(this,this.l,this.l+e);break;case"wstr":return Qf.call(this,e,"dbcs");case"lpstr-ansi":r=aM(this,this.l),e=4+ls(this,this.l);break;case"lpstr-cp":r=sM(this,this.l),e=4+ls(this,this.l);break;case"lpwstr":r=oM(this,this.l),e=4+2*ls(this,this.l);break;case"lpp4":e=4+ls(this,this.l),r=cM(this,this.l),e&2&&(e+=2);break;case"8lpp4":e=4+ls(this,this.l),r=dM(this,this.l),e&3&&(e+=4-(e&3));break;case"cstr":for(e=0,r="";(l=Cd(this,this.l+e++))!==0;)i.push(Jm(l));r=i.join("");break;case"_wstr":for(e=0,r="";(l=Hf(this,this.l+e))!==0;)i.push(Jm(l)),e+=2;e+=2,r=i.join("");break;case"dbcs-cont":for(r="",f=this.l,d=0;d<e;++d){if(this.lens&&this.lens.indexOf(f)!==-1)return l=Cd(this,f),this.l=f+1,u=Qf.call(this,e-d,l?"dbcs-cont":"sbcs-cont"),i.join("")+u;i.push(Jm(Hf(this,f))),f+=2}r=i.join(""),e*=2;break;case"cpstr":case"sbcs-cont":for(r="",f=this.l,d=0;d!=e;++d){if(this.lens&&this.lens.indexOf(f)!==-1)return l=Cd(this,f),this.l=f+1,u=Qf.call(this,e-d,l?"dbcs-cont":"sbcs-cont"),i.join("")+u;i.push(Jm(Cd(this,f))),f+=1}r=i.join("");break;default:switch(e){case 1:return a=Cd(this,this.l),this.l++,a;case 2:return a=(t==="i"?z0e:Hf)(this,this.l),this.l+=2,a;case 4:case-4:return t==="i"||(this[this.l+3]&128)===0?(a=(e>0?Oc:B0e)(this,this.l),this.l+=4,a):(s=ls(this,this.l),this.l+=4,s);case 8:case-8:if(t==="f")return e==8?s=Fx(this,this.l):s=Fx([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,s;e=8;case 16:r=tM(this,this.l,e);break}}return this.l+=e,r}var $0e=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24&255},U0e=function(e,t,r){e[r]=t&255,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},H0e=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255};function q0e(e,t,r){var a=0,s=0;if(r==="dbcs"){for(s=0;s!=t.length;++s)H0e(this,t.charCodeAt(s),this.l+2*s);a=2*t.length}else if(r==="sbcs"){for(t=t.replace(/[^\x00-\x7F]/g,"_"),s=0;s!=t.length;++s)this[this.l+s]=t.charCodeAt(s)&255;a=t.length}else if(r==="hex"){for(;s<e;++s)this[this.l++]=parseInt(t.slice(2*s,2*s+2),16)||0;return this}else if(r==="utf16le"){var i=Math.min(this.l+e,this.length);for(s=0;s<Math.min(t.length,e);++s){var l=t.charCodeAt(s);this[this.l++]=l&255,this[this.l++]=l>>8}for(;this.l<i;)this[this.l++]=0;return this}else switch(e){case 1:a=1,this[this.l]=t&255;break;case 2:a=2,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255;break;case 3:a=3,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255,t>>>=8,this[this.l+2]=t&255;break;case 4:a=4,$0e(this,t,this.l);break;case 8:if(a=8,r==="f"){I0e(this,t,this.l);break}case 16:break;case-4:a=4,U0e(this,t,this.l);break}return this.l+=a,this}function hM(e,t){var r=tM(this,this.l,e.length>>1);if(r!==e)throw new Error(t+"Expected "+e+" saw "+r);this.l+=e.length>>1}function is(e,t){e.l=t,e.read_shift=Qf,e.chk=hM,e.write_shift=q0e}function Xi(e,t){e.l+=t}function He(e){var t=iu(e);return is(t,0),t}function Bn(){var e=[],t=ar?256:2048,r=function(f){var p=He(f);return is(p,0),p},a=r(t),s=function(){a&&(a.length>a.l&&(a=a.slice(0,a.l),a.l=a.length),a.length>0&&e.push(a),a=null)},i=function(f){return a&&f<a.length-a.l?a:(s(),a=r(Math.max(f+1,t)))},l=function(){return s(),Ga(e)},u=function(f){s(),a=f,a.l==null&&(a.l=a.length),i(t)};return{next:i,push:u,end:l,_bufs:e}}function Ke(e,t,r,a){var s=+t,i;if(!isNaN(s)){a||(a=Lxe[s].p||(r||[]).length||0),i=1+(s>=128?1:0)+1,a>=128&&++i,a>=16384&&++i,a>=2097152&&++i;var l=e.next(i);s<=127?l.write_shift(1,s):(l.write_shift(1,(s&127)+128),l.write_shift(1,s>>7));for(var u=0;u!=4;++u)if(a>=128)l.write_shift(1,(a&127)+128),a>>=7;else{l.write_shift(1,a);break}a>0&&iS(r)&&e.push(r)}}function Zf(e,t,r){var a=Un(e);if(t.s?(a.cRel&&(a.c+=t.s.c),a.rRel&&(a.r+=t.s.r)):(a.cRel&&(a.c+=t.c),a.rRel&&(a.r+=t.r)),!r||r.biff<12){for(;a.c>=256;)a.c-=256;for(;a.r>=65536;)a.r-=65536}return a}function E8(e,t,r){var a=Un(e);return a.s=Zf(a.s,t.s,r),a.e=Zf(a.e,t.s,r),a}function eh(e,t){if(e.cRel&&e.c<0)for(e=Un(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=Un(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=hr(e);return!e.cRel&&e.cRel!=null&&(r=G0e(r)),!e.rRel&&e.rRel!=null&&(r=W0e(r)),r}function fw(e,t){return e.s.r==0&&!e.s.rRel&&e.e.r==(t.biff>=12?1048575:t.biff>=8?65536:16384)&&!e.e.rRel?(e.s.cRel?"":"$")+ln(e.s.c)+":"+(e.e.cRel?"":"$")+ln(e.e.c):e.s.c==0&&!e.s.cRel&&e.e.c==(t.biff>=12?16383:255)&&!e.e.cRel?(e.s.rRel?"":"$")+Qa(e.s.r)+":"+(e.e.rRel?"":"$")+Qa(e.e.r):eh(e.s,t.biff)+":"+eh(e.e,t.biff)}function oS(e){return parseInt(V0e(e),10)-1}function Qa(e){return""+(e+1)}function W0e(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function V0e(e){return e.replace(/\$(\d+)$/,"$1")}function lS(e){for(var t=K0e(e),r=0,a=0;a!==t.length;++a)r=26*r+t.charCodeAt(a)-64;return r-1}function ln(e){if(e<0)throw new Error("invalid column "+e);var t="";for(++e;e;e=Math.floor((e-1)/26))t=String.fromCharCode((e-1)%26+65)+t;return t}function G0e(e){return e.replace(/^([A-Z])/,"$$$1")}function K0e(e){return e.replace(/^\$([A-Z])/,"$1")}function Y0e(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function Pa(e){for(var t=0,r=0,a=0;a<e.length;++a){var s=e.charCodeAt(a);s>=48&&s<=57?t=10*t+(s-48):s>=65&&s<=90&&(r=26*r+(s-64))}return{c:r-1,r:t-1}}function hr(e){for(var t=e.c+1,r="";t;t=(t-1)/26|0)r=String.fromCharCode((t-1)%26+65)+r;return r+(e.r+1)}function xs(e){var t=e.indexOf(":");return t==-1?{s:Pa(e),e:Pa(e)}:{s:Pa(e.slice(0,t)),e:Pa(e.slice(t+1))}}function ua(e,t){return typeof t=="undefined"||typeof t=="number"?ua(e.s,e.e):(typeof e!="string"&&(e=hr(e)),typeof t!="string"&&(t=hr(t)),e==t?e:e+":"+t)}function Pr(e){var t={s:{c:0,r:0},e:{c:0,r:0}},r=0,a=0,s=0,i=e.length;for(r=0;a<i&&!((s=e.charCodeAt(a)-64)<1||s>26);++a)r=26*r+s;for(t.s.c=--r,r=0;a<i&&!((s=e.charCodeAt(a)-48)<0||s>9);++a)r=10*r+s;if(t.s.r=--r,a===i||s!=10)return t.e.c=t.s.c,t.e.r=t.s.r,t;for(++a,r=0;a!=i&&!((s=e.charCodeAt(a)-64)<1||s>26);++a)r=26*r+s;for(t.e.c=--r,r=0;a!=i&&!((s=e.charCodeAt(a)-48)<0||s>9);++a)r=10*r+s;return t.e.r=--r,t}function A8(e,t){var r=e.t=="d"&&t instanceof Date;if(e.z!=null)try{return e.w=Ml(e.z,r?$n(t):t)}catch(a){}try{return e.w=Ml((e.XF||{}).numFmtId||(r?14:0),r?$n(t):t)}catch(a){return""+t}}function $o(e,t,r){return e==null||e.t==null||e.t=="z"?"":e.w!==void 0?e.w:(e.t=="d"&&!e.z&&r&&r.dateNF&&(e.z=r.dateNF),e.t=="e"?lp[e.v]||e.v:t==null?A8(e,e.v):A8(e,t))}function gu(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",a={};return a[r]=e,{SheetNames:[r],Sheets:a}}function pM(e,t,r){var a=r||{},s=e?Array.isArray(e):a.dense,i=e||(s?[]:{}),l=0,u=0;if(i&&a.origin!=null){if(typeof a.origin=="number")l=a.origin;else{var d=typeof a.origin=="string"?Pa(a.origin):a.origin;l=d.r,u=d.c}i["!ref"]||(i["!ref"]="A1:A1")}var f={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(i["!ref"]){var p=Pr(i["!ref"]);f.s.c=p.s.c,f.s.r=p.s.r,f.e.c=Math.max(f.e.c,p.e.c),f.e.r=Math.max(f.e.r,p.e.r),l==-1&&(f.e.r=l=p.e.r+1)}for(var m=0;m!=t.length;++m)if(t[m]){if(!Array.isArray(t[m]))throw new Error("aoa_to_sheet expects an array of arrays");for(var x=0;x!=t[m].length;++x)if(typeof t[m][x]!="undefined"){var v={v:t[m][x]},b=l+m,w=u+x;if(f.s.r>b&&(f.s.r=b),f.s.c>w&&(f.s.c=w),f.e.r<b&&(f.e.r=b),f.e.c<w&&(f.e.c=w),t[m][x]&&typeof t[m][x]=="object"&&!Array.isArray(t[m][x])&&!(t[m][x]instanceof Date))v=t[m][x];else if(Array.isArray(v.v)&&(v.f=t[m][x][1],v.v=v.v[0]),v.v===null)if(v.f)v.t="n";else if(a.nullError)v.t="e",v.v=0;else if(a.sheetStubs)v.t="z";else continue;else typeof v.v=="number"?v.t="n":typeof v.v=="boolean"?v.t="b":v.v instanceof Date?(v.z=a.dateNF||Kr[14],a.cellDates?(v.t="d",v.w=Ml(v.z,$n(v.v))):(v.t="n",v.v=$n(v.v),v.w=Ml(v.z,v.v))):v.t="s";if(s)i[b]||(i[b]=[]),i[b][w]&&i[b][w].z&&(v.z=i[b][w].z),i[b][w]=v;else{var j=hr({c:w,r:b});i[j]&&i[j].z&&(v.z=i[j].z),i[j]=v}}}return f.s.c<1e7&&(i["!ref"]=ua(f)),i}function j0(e,t){return pM(null,e,t)}function X0e(e){return e.read_shift(4,"i")}function xi(e,t){return t||(t=He(4)),t.write_shift(4,e),t}function cn(e){var t=e.read_shift(4);return t===0?"":e.read_shift(t,"dbcs")}function Da(e,t){var r=!1;return t==null&&(r=!0,t=He(4+2*e.length)),t.write_shift(4,e.length),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}function J0e(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function Q0e(e,t){return t||(t=He(4)),t.write_shift(2,0),t.write_shift(2,0),t}function cS(e,t){var r=e.l,a=e.read_shift(1),s=cn(e),i=[],l={t:s,h:s};if((a&1)!==0){for(var u=e.read_shift(4),d=0;d!=u;++d)i.push(J0e(e));l.r=i}else l.r=[{ich:0,ifnt:0}];return e.l=r+t,l}function Z0e(e,t){var r=!1;return t==null&&(r=!0,t=He(15+4*e.t.length)),t.write_shift(1,0),Da(e.t,t),r?t.slice(0,t.l):t}var efe=cS;function tfe(e,t){var r=!1;return t==null&&(r=!0,t=He(23+4*e.t.length)),t.write_shift(1,1),Da(e.t,t),t.write_shift(4,1),Q0e({},t),r?t.slice(0,t.l):t}function Xs(e){var t=e.read_shift(4),r=e.read_shift(2);return r+=e.read_shift(1)<<16,e.l++,{c:t,iStyleRef:r}}function xu(e,t){return t==null&&(t=He(8)),t.write_shift(-4,e.c),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}function yu(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}function vu(e,t){return t==null&&(t=He(4)),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}var rfe=cn,mM=Da;function uS(e){var t=e.read_shift(4);return t===0||t===4294967295?"":e.read_shift(t,"dbcs")}function Mx(e,t){var r=!1;return t==null&&(r=!0,t=He(127)),t.write_shift(4,e.length>0?e.length:4294967295),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}var afe=cn,Wj=uS,dS=Mx;function gM(e){var t=e.slice(e.l,e.l+4),r=t[0]&1,a=t[0]&2;e.l+=4;var s=a===0?Fx([0,0,0,0,t[0]&252,t[1],t[2],t[3]],0):Oc(t,0)>>2;return r?s/100:s}function xM(e,t){t==null&&(t=He(4));var r=0,a=0,s=e*100;if(e==(e|0)&&e>=-536870912&&e<1<<29?a=1:s==(s|0)&&s>=-536870912&&s<1<<29&&(a=1,r=1),a)t.write_shift(-4,((r?s:e)<<2)+(r+2));else throw new Error("unsupported RkNumber "+e)}function yM(e){var t={s:{},e:{}};return t.s.r=e.read_shift(4),t.e.r=e.read_shift(4),t.s.c=e.read_shift(4),t.e.c=e.read_shift(4),t}function nfe(e,t){return t||(t=He(16)),t.write_shift(4,e.s.r),t.write_shift(4,e.e.r),t.write_shift(4,e.s.c),t.write_shift(4,e.e.c),t}var bu=yM,_0=nfe;function k0(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function ou(e,t){return(t||He(8)).write_shift(8,e,"f")}function sfe(e){var t={},r=e.read_shift(1),a=r>>>1,s=e.read_shift(1),i=e.read_shift(2,"i"),l=e.read_shift(1),u=e.read_shift(1),d=e.read_shift(1);switch(e.l++,a){case 0:t.auto=1;break;case 1:t.index=s;var f=pfe[s];f&&(t.rgb=$8(f));break;case 2:t.rgb=$8([l,u,d]);break;case 3:t.theme=s;break}return i!=0&&(t.tint=i>0?i/32767:i/32768),t}function Lx(e,t){if(t||(t=He(8)),!e||e.auto)return t.write_shift(4,0),t.write_shift(4,0),t;e.index!=null?(t.write_shift(1,2),t.write_shift(1,e.index)):e.theme!=null?(t.write_shift(1,6),t.write_shift(1,e.theme)):(t.write_shift(1,5),t.write_shift(1,0));var r=e.tint||0;if(r>0?r*=32767:r<0&&(r*=32768),t.write_shift(2,r),!e.rgb||e.theme!=null)t.write_shift(2,0),t.write_shift(1,0),t.write_shift(1,0);else{var a=e.rgb||"FFFFFF";typeof a=="number"&&(a=("000000"+a.toString(16)).slice(-6)),t.write_shift(1,parseInt(a.slice(0,2),16)),t.write_shift(1,parseInt(a.slice(2,4),16)),t.write_shift(1,parseInt(a.slice(4,6),16)),t.write_shift(1,255)}return t}function ife(e){var t=e.read_shift(1);e.l++;var r={fBold:t&1,fItalic:t&2,fUnderline:t&4,fStrikeout:t&8,fOutline:t&16,fShadow:t&32,fCondense:t&64,fExtend:t&128};return r}function ofe(e,t){t||(t=He(2));var r=(e.italic?2:0)|(e.strike?8:0)|(e.outline?16:0)|(e.shadow?32:0)|(e.condense?64:0)|(e.extend?128:0);return t.write_shift(1,r),t.write_shift(1,0),t}var vM=2,ss=3,tg=11,Ix=19,rg=64,lfe=65,cfe=71,ufe=4108,dfe=4126,Wa=80,O8={1:{n:"CodePage",t:vM},2:{n:"Category",t:Wa},3:{n:"PresentationFormat",t:Wa},4:{n:"ByteCount",t:ss},5:{n:"LineCount",t:ss},6:{n:"ParagraphCount",t:ss},7:{n:"SlideCount",t:ss},8:{n:"NoteCount",t:ss},9:{n:"HiddenCount",t:ss},10:{n:"MultimediaClipCount",t:ss},11:{n:"ScaleCrop",t:tg},12:{n:"HeadingPairs",t:ufe},13:{n:"TitlesOfParts",t:dfe},14:{n:"Manager",t:Wa},15:{n:"Company",t:Wa},16:{n:"LinksUpToDate",t:tg},17:{n:"CharacterCount",t:ss},19:{n:"SharedDoc",t:tg},22:{n:"HyperlinksChanged",t:tg},23:{n:"AppVersion",t:ss,p:"version"},24:{n:"DigSig",t:lfe},26:{n:"ContentType",t:Wa},27:{n:"ContentStatus",t:Wa},28:{n:"Language",t:Wa},29:{n:"Version",t:Wa},255:{},2147483648:{n:"Locale",t:Ix},2147483651:{n:"Behavior",t:Ix},1919054434:{}},P8={1:{n:"CodePage",t:vM},2:{n:"Title",t:Wa},3:{n:"Subject",t:Wa},4:{n:"Author",t:Wa},5:{n:"Keywords",t:Wa},6:{n:"Comments",t:Wa},7:{n:"Template",t:Wa},8:{n:"LastAuthor",t:Wa},9:{n:"RevNumber",t:Wa},10:{n:"EditTime",t:rg},11:{n:"LastPrinted",t:rg},12:{n:"CreatedDate",t:rg},13:{n:"ModifiedDate",t:rg},14:{n:"PageCount",t:ss},15:{n:"WordCount",t:ss},16:{n:"CharCount",t:ss},17:{n:"Thumbnail",t:cfe},18:{n:"Application",t:Wa},19:{n:"DocSecurity",t:ss},255:{},2147483648:{n:"Locale",t:Ix},2147483651:{n:"Behavior",t:Ix},1919054434:{}};function ffe(e){return e.map(function(t){return[t>>16&255,t>>8&255,t&255]})}var hfe=ffe([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),pfe=Un(hfe),lp={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},mfe={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},ag={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function bM(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function wM(e,t){var r=S0e(mfe),a=[],s;a[a.length]=pa,a[a.length]=at("Types",null,{xmlns:Aa.CT,"xmlns:xsd":Aa.xsd,"xmlns:xsi":Aa.xsi}),a=a.concat([["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map(function(d){return at("Default",null,{Extension:d[0],ContentType:d[1]})}));var i=function(d){e[d]&&e[d].length>0&&(s=e[d][0],a[a.length]=at("Override",null,{PartName:(s[0]=="/"?"":"/")+s,ContentType:ag[d][t.bookType]||ag[d].xlsx}))},l=function(d){(e[d]||[]).forEach(function(f){a[a.length]=at("Override",null,{PartName:(f[0]=="/"?"":"/")+f,ContentType:ag[d][t.bookType]||ag[d].xlsx})})},u=function(d){(e[d]||[]).forEach(function(f){a[a.length]=at("Override",null,{PartName:(f[0]=="/"?"":"/")+f,ContentType:r[d][0]})})};return i("workbooks"),l("sheets"),l("charts"),u("themes"),["strs","styles"].forEach(i),["coreprops","extprops","custprops"].forEach(u),u("vba"),u("comments"),u("threadedcomments"),u("drawings"),l("metadata"),u("people"),a.length>2&&(a[a.length]="</Types>",a[1]=a[1].replace("/>",">")),a.join("")}var Qt={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function jM(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function Wd(e){var t=[pa,at("Relationships",null,{xmlns:Aa.RELS})];return tn(e["!id"]).forEach(function(r){t[t.length]=at("Relationship",null,e["!id"][r])}),t.length>2&&(t[t.length]="</Relationships>",t[1]=t[1].replace("/>",">")),t.join("")}function dr(e,t,r,a,s,i){if(s||(s={}),e["!id"]||(e["!id"]={}),e["!idx"]||(e["!idx"]=1),t<0)for(t=e["!idx"];e["!id"]["rId"+t];++t);if(e["!idx"]=t+1,s.Id="rId"+t,s.Type=a,s.Target=r,[Qt.HLINK,Qt.XPATH,Qt.XMISS].indexOf(s.Type)>-1&&(s.TargetMode="External"),e["!id"][s.Id])throw new Error("Cannot rewrite rId "+t);return e["!id"][s.Id]=s,e[("/"+s.Target).replace("//","/")]=s,t}function gfe(e){var t=[pa];t.push(`<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">
`),t.push(` <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>
`);for(var r=0;r<e.length;++r)t.push(' <manifest:file-entry manifest:full-path="'+e[r][0]+'" manifest:media-type="'+e[r][1]+`"/>
`);return t.push("</manifest:manifest>"),t.join("")}function D8(e,t,r){return[' <rdf:Description rdf:about="'+e+`">
`,' <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/'+(r||"odf")+"#"+t+`"/>
`,` </rdf:Description>
`].join("")}function xfe(e,t){return[' <rdf:Description rdf:about="'+e+`">
`,' <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="'+t+`"/>
`,` </rdf:Description>
`].join("")}function yfe(e){var t=[pa];t.push(`<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
`);for(var r=0;r!=e.length;++r)t.push(D8(e[r][0],e[r][1])),t.push(xfe("",e[r][0]));return t.push(D8("","Document","pkg")),t.push("</rdf:RDF>"),t.join("")}function _M(){return'<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS '+Ex.version+"</meta:generator></office:meta></office:document-meta>"}var Wc=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]];function hw(e,t,r,a,s){s[e]!=null||t==null||t===""||(s[e]=t,t=fr(t),a[a.length]=r?at(e,t,r):Ka(e,t))}function kM(e,t){var r=t||{},a=[pa,at("cp:coreProperties",null,{"xmlns:cp":Aa.CORE_PROPS,"xmlns:dc":Aa.dc,"xmlns:dcterms":Aa.dcterms,"xmlns:dcmitype":Aa.dcmitype,"xmlns:xsi":Aa.xsi})],s={};if(!e&&!r.Props)return a.join("");e&&(e.CreatedDate!=null&&hw("dcterms:created",typeof e.CreatedDate=="string"?e.CreatedDate:qj(e.CreatedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},a,s),e.ModifiedDate!=null&&hw("dcterms:modified",typeof e.ModifiedDate=="string"?e.ModifiedDate:qj(e.ModifiedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},a,s));for(var i=0;i!=Wc.length;++i){var l=Wc[i],u=r.Props&&r.Props[l[1]]!=null?r.Props[l[1]]:e?e[l[1]]:null;u===!0?u="1":u===!1?u="0":typeof u=="number"&&(u=String(u)),u!=null&&hw(l[0],u,null,a,s)}return a.length>2&&(a[a.length]="</cp:coreProperties>",a[1]=a[1].replace("/>",">")),a.join("")}var Vd=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]],SM=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function NM(e){var t=[],r=at;return e||(e={}),e.Application="SheetJS",t[t.length]=pa,t[t.length]=at("Properties",null,{xmlns:Aa.EXT_PROPS,"xmlns:vt":Aa.vt}),Vd.forEach(function(a){if(e[a[1]]!==void 0){var s;switch(a[2]){case"string":s=fr(String(e[a[1]]));break;case"bool":s=e[a[1]]?"true":"false";break}s!==void 0&&(t[t.length]=r(a[0],s))}}),t[t.length]=r("HeadingPairs",r("vt:vector",r("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+r("vt:variant",r("vt:i4",String(e.Worksheets))),{size:2,baseType:"variant"})),t[t.length]=r("TitlesOfParts",r("vt:vector",e.SheetNames.map(function(a){return"<vt:lpstr>"+fr(a)+"</vt:lpstr>"}).join(""),{size:e.Worksheets,baseType:"lpstr"})),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}function CM(e){var t=[pa,at("Properties",null,{xmlns:Aa.CUST_PROPS,"xmlns:vt":Aa.vt})];if(!e)return t.join("");var r=1;return tn(e).forEach(function(s){++r,t[t.length]=at("property",M0e(e[s]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:r,name:fr(s)})}),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}var R8={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"};function vfe(e,t){var r=[];return tn(R8).map(function(a){for(var s=0;s<Wc.length;++s)if(Wc[s][1]==a)return Wc[s];for(s=0;s<Vd.length;++s)if(Vd[s][1]==a)return Vd[s];throw a}).forEach(function(a){if(e[a[1]]!=null){var s=t&&t.Props&&t.Props[a[1]]!=null?t.Props[a[1]]:e[a[1]];a[2]==="date"&&(s=new Date(s).toISOString().replace(/\.\d*Z/,"Z")),typeof s=="number"?s=String(s):s===!0||s===!1?s=s?"1":"0":s instanceof Date&&(s=new Date(s).toISOString().replace(/\.\d*Z/,"")),r.push(Ka(R8[a[1]]||a[1],s))}}),at("DocumentProperties",r.join(""),{xmlns:os.o})}function bfe(e,t){var r=["Worksheets","SheetNames"],a="CustomDocumentProperties",s=[];return e&&tn(e).forEach(function(i){if(Object.prototype.hasOwnProperty.call(e,i)){for(var l=0;l<Wc.length;++l)if(i==Wc[l][1])return;for(l=0;l<Vd.length;++l)if(i==Vd[l][1])return;for(l=0;l<r.length;++l)if(i==r[l])return;var u=e[i],d="string";typeof u=="number"?(d="float",u=String(u)):u===!0||u===!1?(d="boolean",u=u?"1":"0"):u=String(u),s.push(at(w8(i),u,{"dt:dt":d}))}}),t&&tn(t).forEach(function(i){if(Object.prototype.hasOwnProperty.call(t,i)&&!(e&&Object.prototype.hasOwnProperty.call(e,i))){var l=t[i],u="string";typeof l=="number"?(u="float",l=String(l)):l===!0||l===!1?(u="boolean",l=l?"1":"0"):l instanceof Date?(u="dateTime.tz",l=l.toISOString()):l=String(l),s.push(at(w8(i),l,{"dt:dt":u}))}}),"<"+a+' xmlns="'+os.o+'">'+s.join("")+"</"+a+">"}function wfe(e){var t=typeof e=="string"?new Date(Date.parse(e)):e,r=t.getTime()/1e3+11644473600,a=r%Math.pow(2,32),s=(r-a)/Math.pow(2,32);a*=1e7,s*=1e7;var i=a/Math.pow(2,32)|0;i>0&&(a=a%Math.pow(2,32),s+=i);var l=He(8);return l.write_shift(4,a),l.write_shift(4,s),l}function F8(e,t){var r=He(4),a=He(4);switch(r.write_shift(4,e==80?31:e),e){case 3:a.write_shift(-4,t);break;case 5:a=He(8),a.write_shift(8,t,"f");break;case 11:a.write_shift(4,t?1:0);break;case 64:a=wfe(t);break;case 31:case 80:for(a=He(4+2*(t.length+1)+(t.length%2?0:2)),a.write_shift(4,t.length+1),a.write_shift(0,t,"dbcs");a.l!=a.length;)a.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+t)}return Ga([r,a])}var TM=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function jfe(e){switch(typeof e){case"boolean":return 11;case"number":return(e|0)==e?3:5;case"string":return 31;case"object":if(e instanceof Date)return 64;break}return-1}function M8(e,t,r){var a=He(8),s=[],i=[],l=8,u=0,d=He(8),f=He(8);if(d.write_shift(4,2),d.write_shift(4,1200),f.write_shift(4,1),i.push(d),s.push(f),l+=8+d.length,!t){f=He(8),f.write_shift(4,0),s.unshift(f);var p=[He(4)];for(p[0].write_shift(4,e.length),u=0;u<e.length;++u){var m=e[u][0];for(d=He(8+2*(m.length+1)+(m.length%2?0:2)),d.write_shift(4,u+2),d.write_shift(4,m.length+1),d.write_shift(0,m,"dbcs");d.l!=d.length;)d.write_shift(1,0);p.push(d)}d=Ga(p),i.unshift(d),l+=8+d.length}for(u=0;u<e.length;++u)if(!(t&&!t[e[u][0]])&&!(TM.indexOf(e[u][0])>-1||SM.indexOf(e[u][0])>-1)&&e[u][1]!=null){var x=e[u][1],v=0;if(t){v=+t[e[u][0]];var b=r[v];if(b.p=="version"&&typeof x=="string"){var w=x.split(".");x=(+w[0]<<16)+(+w[1]||0)}d=F8(b.t,x)}else{var j=jfe(x);j==-1&&(j=31,x=String(x)),d=F8(j,x)}i.push(d),f=He(8),f.write_shift(4,t?v:2+u),s.push(f),l+=8+d.length}var k=8*(i.length+1);for(u=0;u<i.length;++u)s[u].write_shift(4,k),k+=i[u].length;return a.write_shift(4,l),a.write_shift(4,i.length),Ga([a].concat(s).concat(i))}function L8(e,t,r,a,s,i){var l=He(s?68:48),u=[l];l.write_shift(2,65534),l.write_shift(2,0),l.write_shift(4,842412599),l.write_shift(16,br.utils.consts.HEADER_CLSID,"hex"),l.write_shift(4,s?2:1),l.write_shift(16,t,"hex"),l.write_shift(4,s?68:48);var d=M8(e,r,a);if(u.push(d),s){var f=M8(s,null,null);l.write_shift(16,i,"hex"),l.write_shift(4,68+d.length),u.push(f)}return Ga(u)}function _fe(e,t){t||(t=He(e));for(var r=0;r<e;++r)t.write_shift(1,0);return t}function kfe(e,t){return e.read_shift(t)===1}function bn(e,t){return t||(t=He(2)),t.write_shift(2,+!!e),t}function EM(e){return e.read_shift(2,"u")}function Bs(e,t){return t||(t=He(2)),t.write_shift(2,e),t}function AM(e,t,r){return r||(r=He(2)),r.write_shift(1,t=="e"?+e:+!!e),r.write_shift(1,t=="e"?1:0),r}function OM(e,t,r){var a=e.read_shift(r&&r.biff>=12?2:1),s="sbcs-cont";if(r&&r.biff>=8,!r||r.biff==8){var i=e.read_shift(1);i&&(s="dbcs-cont")}else r.biff==12&&(s="wstr");r.biff>=2&&r.biff<=5&&(s="cpstr");var l=a?e.read_shift(a,s):"";return l}function Sfe(e){var t=e.t||"",r=He(3);r.write_shift(2,t.length),r.write_shift(1,1);var a=He(2*t.length);a.write_shift(2*t.length,t,"utf16le");var s=[r,a];return Ga(s)}function Nfe(e,t,r){var a;if(r){if(r.biff>=2&&r.biff<=5)return e.read_shift(t,"cpstr");if(r.biff>=12)return e.read_shift(t,"dbcs-cont")}var s=e.read_shift(1);return s===0?a=e.read_shift(t,"sbcs-cont"):a=e.read_shift(t,"dbcs-cont"),a}function Cfe(e,t,r){var a=e.read_shift(r&&r.biff==2?1:2);return a===0?(e.l++,""):Nfe(e,a,r)}function Tfe(e,t,r){if(r.biff>5)return Cfe(e,t,r);var a=e.read_shift(1);return a===0?(e.l++,""):e.read_shift(a,r.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function PM(e,t,r){return r||(r=He(3+2*e.length)),r.write_shift(2,e.length),r.write_shift(1,1),r.write_shift(31,e,"utf16le"),r}function I8(e,t){t||(t=He(6+e.length*2)),t.write_shift(4,1+e.length);for(var r=0;r<e.length;++r)t.write_shift(2,e.charCodeAt(r));return t.write_shift(2,0),t}function Efe(e){var t=He(512),r=0,a=e.Target;a.slice(0,7)=="file://"&&(a=a.slice(7));var s=a.indexOf("#"),i=s>-1?31:23;switch(a.charAt(0)){case"#":i=28;break;case".":i&=-3;break}t.write_shift(4,2),t.write_shift(4,i);var l=[8,6815827,6619237,4849780,83];for(r=0;r<l.length;++r)t.write_shift(4,l[r]);if(i==28)a=a.slice(1),I8(a,t);else if(i&2){for(l="e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),r=0;r<l.length;++r)t.write_shift(1,parseInt(l[r],16));var u=s>-1?a.slice(0,s):a;for(t.write_shift(4,2*(u.length+1)),r=0;r<u.length;++r)t.write_shift(2,u.charCodeAt(r));t.write_shift(2,0),i&8&&I8(s>-1?a.slice(s+1):"",t)}else{for(l="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),r=0;r<l.length;++r)t.write_shift(1,parseInt(l[r],16));for(var d=0;a.slice(d*3,d*3+3)=="../"||a.slice(d*3,d*3+3)=="..\\";)++d;for(t.write_shift(2,d),t.write_shift(4,a.length-3*d+1),r=0;r<a.length-3*d;++r)t.write_shift(1,a.charCodeAt(r+3*d)&255);for(t.write_shift(1,0),t.write_shift(2,65535),t.write_shift(2,57005),r=0;r<6;++r)t.write_shift(4,0)}return t.slice(0,t.l)}function lu(e,t,r,a){return a||(a=He(6)),a.write_shift(2,e),a.write_shift(2,t),a.write_shift(2,r||0),a}function Afe(e,t,r){var a=r.biff>8?4:2,s=e.read_shift(a),i=e.read_shift(a,"i"),l=e.read_shift(a,"i");return[s,i,l]}function Ofe(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2),s=e.read_shift(2);return{s:{c:a,r:t},e:{c:s,r}}}function DM(e,t){return t||(t=He(8)),t.write_shift(2,e.s.r),t.write_shift(2,e.e.r),t.write_shift(2,e.s.c),t.write_shift(2,e.e.c),t}function fS(e,t,r){var a=1536,s=16;switch(r.bookType){case"biff8":break;case"biff5":a=1280,s=8;break;case"biff4":a=4,s=6;break;case"biff3":a=3,s=6;break;case"biff2":a=2,s=4;break;case"xla":break;default:throw new Error("unsupported BIFF version")}var i=He(s);return i.write_shift(2,a),i.write_shift(2,t),s>4&&i.write_shift(2,29282),s>6&&i.write_shift(2,1997),s>8&&(i.write_shift(2,49161),i.write_shift(2,1),i.write_shift(2,1798),i.write_shift(2,0)),i}function Pfe(e,t){var r=!t||t.biff==8,a=He(r?112:54);for(a.write_shift(t.biff==8?2:1,7),r&&a.write_shift(1,0),a.write_shift(4,859007059),a.write_shift(4,5458548|(r?0:536870912));a.l<a.length;)a.write_shift(1,r?0:32);return a}function Dfe(e,t){var r=!t||t.biff>=8?2:1,a=He(8+r*e.name.length);a.write_shift(4,e.pos),a.write_shift(1,e.hs||0),a.write_shift(1,e.dt),a.write_shift(1,e.name.length),t.biff>=8&&a.write_shift(1,1),a.write_shift(r*e.name.length,e.name,t.biff<8?"sbcs":"utf16le");var s=a.slice(0,a.l);return s.l=a.l,s}function Rfe(e,t){var r=He(8);r.write_shift(4,e.Count),r.write_shift(4,e.Unique);for(var a=[],s=0;s<e.length;++s)a[s]=Sfe(e[s]);var i=Ga([r].concat(a));return i.parts=[r.length].concat(a.map(function(l){return l.length})),i}function Ffe(){var e=He(18);return e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,29280),e.write_shift(2,17600),e.write_shift(2,56),e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,1),e.write_shift(2,500),e}function Mfe(e){var t=He(18),r=1718;return e&&e.RTL&&(r|=64),t.write_shift(2,r),t.write_shift(4,0),t.write_shift(4,64),t.write_shift(4,0),t.write_shift(4,0),t}function Lfe(e,t){var r=e.name||"Arial",a=t&&t.biff==5,s=a?15+r.length:16+2*r.length,i=He(s);return i.write_shift(2,e.sz*20),i.write_shift(4,0),i.write_shift(2,400),i.write_shift(4,0),i.write_shift(2,0),i.write_shift(1,r.length),a||i.write_shift(1,1),i.write_shift((a?1:2)*r.length,r,a?"sbcs":"utf16le"),i}function Ife(e,t,r,a){var s=He(10);return lu(e,t,a,s),s.write_shift(4,r),s}function zfe(e,t,r,a,s){var i=!s||s.biff==8,l=He(8+ +i+(1+i)*r.length);return lu(e,t,a,l),l.write_shift(2,r.length),i&&l.write_shift(1,1),l.write_shift((1+i)*r.length,r,i?"utf16le":"sbcs"),l}function Bfe(e,t,r,a){var s=r&&r.biff==5;a||(a=He(s?3+t.length:5+2*t.length)),a.write_shift(2,e),a.write_shift(s?1:2,t.length),s||a.write_shift(1,1),a.write_shift((s?1:2)*t.length,t,s?"sbcs":"utf16le");var i=a.length>a.l?a.slice(0,a.l):a;return i.l==null&&(i.l=i.length),i}function $fe(e,t){var r=t.biff==8||!t.biff?4:2,a=He(2*r+6);return a.write_shift(r,e.s.r),a.write_shift(r,e.e.r+1),a.write_shift(2,e.s.c),a.write_shift(2,e.e.c+1),a.write_shift(2,0),a}function z8(e,t,r,a){var s=r&&r.biff==5;a||(a=He(s?16:20)),a.write_shift(2,0),e.style?(a.write_shift(2,e.numFmtId||0),a.write_shift(2,65524)):(a.write_shift(2,e.numFmtId||0),a.write_shift(2,t<<4));var i=0;return e.numFmtId>0&&s&&(i|=1024),a.write_shift(4,i),a.write_shift(4,0),s||a.write_shift(4,0),a.write_shift(2,0),a}function Ufe(e){var t=He(8);return t.write_shift(4,0),t.write_shift(2,0),t.write_shift(2,0),t}function Hfe(e,t,r,a,s,i){var l=He(8);return lu(e,t,a,l),AM(r,i,l),l}function qfe(e,t,r,a){var s=He(14);return lu(e,t,a,s),ou(r,s),s}function Wfe(e,t,r){if(r.biff<8)return Vfe(e,t,r);for(var a=[],s=e.l+t,i=e.read_shift(r.biff>8?4:2);i--!==0;)a.push(Afe(e,r.biff>8?12:6,r));if(e.l!=s)throw new Error("Bad ExternSheet: "+e.l+" != "+s);return a}function Vfe(e,t,r){e[e.l+1]==3&&e[e.l]++;var a=OM(e,t,r);return a.charCodeAt(0)==3?a.slice(1):a}function Gfe(e){var t=He(2+e.length*8);t.write_shift(2,e.length);for(var r=0;r<e.length;++r)DM(e[r],t);return t}function Kfe(e){var t=He(24),r=Pa(e[0]);t.write_shift(2,r.r),t.write_shift(2,r.r),t.write_shift(2,r.c),t.write_shift(2,r.c);for(var a="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),s=0;s<16;++s)t.write_shift(1,parseInt(a[s],16));return Ga([t,Efe(e[1])])}function Yfe(e){var t=e[1].Tooltip,r=He(10+2*(t.length+1));r.write_shift(2,2048);var a=Pa(e[0]);r.write_shift(2,a.r),r.write_shift(2,a.r),r.write_shift(2,a.c),r.write_shift(2,a.c);for(var s=0;s<t.length;++s)r.write_shift(2,t.charCodeAt(s));return r.write_shift(2,0),r}function Xfe(e){return e||(e=He(4)),e.write_shift(2,1),e.write_shift(2,1),e}function Jfe(e,t,r){if(!r.cellStyles)return Xi(e,t);var a=r&&r.biff>=12?4:2,s=e.read_shift(a),i=e.read_shift(a),l=e.read_shift(a),u=e.read_shift(a),d=e.read_shift(2);a==2&&(e.l+=2);var f={s,e:i,w:l,ixfe:u,flags:d};return(r.biff>=5||!r.biff)&&(f.level=d>>8&7),f}function Qfe(e,t){var r=He(12);r.write_shift(2,t),r.write_shift(2,t),r.write_shift(2,e.width*256),r.write_shift(2,0);var a=0;return e.hidden&&(a|=1),r.write_shift(1,a),a=e.level||0,r.write_shift(1,a),r.write_shift(2,0),r}function Zfe(e){for(var t=He(2*e),r=0;r<e;++r)t.write_shift(2,r+1);return t}function ehe(e,t,r){var a=He(15);return up(a,e,t),a.write_shift(8,r,"f"),a}function the(e,t,r){var a=He(9);return up(a,e,t),a.write_shift(2,r),a}var rhe=(function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},t=tS({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(u,d){var f=[],p=iu(1);switch(d.type){case"base64":p=di(Bo(u));break;case"binary":p=di(u);break;case"buffer":case"array":p=u;break}is(p,0);var m=p.read_shift(1),x=!!(m&136),v=!1,b=!1;switch(m){case 2:break;case 3:break;case 48:v=!0,x=!0;break;case 49:v=!0,x=!0;break;case 131:break;case 139:break;case 140:b=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+m.toString(16))}var w=0,j=521;m==2&&(w=p.read_shift(2)),p.l+=3,m!=2&&(w=p.read_shift(4)),w>1048576&&(w=1e6),m!=2&&(j=p.read_shift(2));var k=p.read_shift(2),C=d.codepage||1252;m!=2&&(p.l+=16,p.read_shift(1),p[p.l]!==0&&(C=e[p[p.l]]),p.l+=1,p.l+=2),b&&(p.l+=36);for(var N=[],O={},E=Math.min(p.length,m==2?521:j-10-(v?264:0)),A=b?32:11;p.l<E&&p[p.l]!=13;)switch(O={},O.name=Ax.utils.decode(C,p.slice(p.l,p.l+A)).replace(/[\u0000\r\n].*$/g,""),p.l+=A,O.type=String.fromCharCode(p.read_shift(1)),m!=2&&!b&&(O.offset=p.read_shift(4)),O.len=p.read_shift(1),m==2&&(O.offset=p.read_shift(2)),O.dec=p.read_shift(1),O.name.length&&N.push(O),m!=2&&(p.l+=b?13:14),O.type){case"B":(!v||O.len!=8)&&d.WTF&&console.log("Skipping "+O.name+":"+O.type);break;case"G":case"P":d.WTF&&console.log("Skipping "+O.name+":"+O.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+O.type)}if(p[p.l]!==13&&(p.l=j-1),p.read_shift(1)!==13)throw new Error("DBF Terminator not found "+p.l+" "+p[p.l]);p.l=j;var T=0,P=0;for(f[0]=[],P=0;P!=N.length;++P)f[0][P]=N[P].name;for(;w-- >0;){if(p[p.l]===42){p.l+=k;continue}for(++p.l,f[++T]=[],P=0,P=0;P!=N.length;++P){var D=p.slice(p.l,p.l+N[P].len);p.l+=N[P].len,is(D,0);var z=Ax.utils.decode(C,D);switch(N[P].type){case"C":z.trim().length&&(f[T][P]=z.replace(/\s+$/,""));break;case"D":z.length===8?f[T][P]=new Date(+z.slice(0,4),+z.slice(4,6)-1,+z.slice(6,8)):f[T][P]=z;break;case"F":f[T][P]=parseFloat(z.trim());break;case"+":case"I":f[T][P]=b?D.read_shift(-4,"i")^2147483648:D.read_shift(4,"i");break;case"L":switch(z.trim().toUpperCase()){case"Y":case"T":f[T][P]=!0;break;case"N":case"F":f[T][P]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+z+"|")}break;case"M":if(!x)throw new Error("DBF Unexpected MEMO for type "+m.toString(16));f[T][P]="##MEMO##"+(b?parseInt(z.trim(),10):D.read_shift(4));break;case"N":z=z.replace(/\u0000/g,"").trim(),z&&z!="."&&(f[T][P]=+z||0);break;case"@":f[T][P]=new Date(D.read_shift(-8,"f")-621356832e5);break;case"T":f[T][P]=new Date((D.read_shift(4)-2440588)*864e5+D.read_shift(4));break;case"Y":f[T][P]=D.read_shift(4,"i")/1e4+D.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":f[T][P]=-D.read_shift(-8,"f");break;case"B":if(v&&N[P].len==8){f[T][P]=D.read_shift(8,"f");break}case"G":case"P":D.l+=N[P].len;break;case"0":if(N[P].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+N[P].type)}}}if(m!=2&&p.l<p.length&&p[p.l++]!=26)throw new Error("DBF EOF Marker missing "+(p.l-1)+" of "+p.length+" "+p[p.l-1].toString(16));return d&&d.sheetRows&&(f=f.slice(0,d.sheetRows)),d.DBF=N,f}function a(u,d){var f=d||{};f.dateNF||(f.dateNF="yyyymmdd");var p=j0(r(u,f),f);return p["!cols"]=f.DBF.map(function(m){return{wch:m.len,DBF:m}}),delete f.DBF,p}function s(u,d){try{return gu(a(u,d),d)}catch(f){if(d&&d.WTF)throw f}return{SheetNames:[],Sheets:{}}}var i={B:8,C:250,L:1,D:8,"?":0,"":0};function l(u,d){var f=d||{};if(+f.codepage>=0&&kh(+f.codepage),f.type=="string")throw new Error("Cannot write DBF to JS string");var p=Bn(),m=Hx(u,{header:1,raw:!0,cellDates:!0}),x=m[0],v=m.slice(1),b=u["!cols"]||[],w=0,j=0,k=0,C=1;for(w=0;w<x.length;++w){if(((b[w]||{}).DBF||{}).name){x[w]=b[w].DBF.name,++k;continue}if(x[w]!=null){if(++k,typeof x[w]=="number"&&(x[w]=x[w].toString(10)),typeof x[w]!="string")throw new Error("DBF Invalid column name "+x[w]+" |"+typeof x[w]+"|");if(x.indexOf(x[w])!==w){for(j=0;j<1024;++j)if(x.indexOf(x[w]+"_"+j)==-1){x[w]+="_"+j;break}}}}var N=Pr(u["!ref"]),O=[],E=[],A=[];for(w=0;w<=N.e.c-N.s.c;++w){var T="",P="",D=0,z=[];for(j=0;j<v.length;++j)v[j][w]!=null&&z.push(v[j][w]);if(z.length==0||x[w]==null){O[w]="?";continue}for(j=0;j<z.length;++j){switch(typeof z[j]){case"number":P="B";break;case"string":P="C";break;case"boolean":P="L";break;case"object":P=z[j]instanceof Date?"D":"C";break;default:P="C"}D=Math.max(D,String(z[j]).length),T=T&&T!=P?"C":P}D>250&&(D=250),P=((b[w]||{}).DBF||{}).type,P=="C"&&b[w].DBF.len>D&&(D=b[w].DBF.len),T=="B"&&P=="N"&&(T="N",A[w]=b[w].DBF.dec,D=b[w].DBF.len),E[w]=T=="C"||P=="N"?D:i[T]||0,C+=E[w],O[w]=T}var G=p.next(32);for(G.write_shift(4,318902576),G.write_shift(4,v.length),G.write_shift(2,296+32*k),G.write_shift(2,C),w=0;w<4;++w)G.write_shift(4,0);for(G.write_shift(4,0|(+t[FF]||3)<<8),w=0,j=0;w<x.length;++w)if(x[w]!=null){var V=p.next(32),ne=(x[w].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);V.write_shift(1,ne,"sbcs"),V.write_shift(1,O[w]=="?"?"C":O[w],"sbcs"),V.write_shift(4,j),V.write_shift(1,E[w]||i[O[w]]||0),V.write_shift(1,A[w]||0),V.write_shift(1,2),V.write_shift(4,0),V.write_shift(1,0),V.write_shift(4,0),V.write_shift(4,0),j+=E[w]||i[O[w]]||0}var ge=p.next(264);for(ge.write_shift(4,13),w=0;w<65;++w)ge.write_shift(4,0);for(w=0;w<v.length;++w){var Z=p.next(C);for(Z.write_shift(1,0),j=0;j<x.length;++j)if(x[j]!=null)switch(O[j]){case"L":Z.write_shift(1,v[w][j]==null?63:v[w][j]?84:70);break;case"B":Z.write_shift(8,v[w][j]||0,"f");break;case"N":var U="0";for(typeof v[w][j]=="number"&&(U=v[w][j].toFixed(A[j]||0)),k=0;k<E[j]-U.length;++k)Z.write_shift(1,32);Z.write_shift(1,U,"sbcs");break;case"D":v[w][j]?(Z.write_shift(4,("0000"+v[w][j].getFullYear()).slice(-4),"sbcs"),Z.write_shift(2,("00"+(v[w][j].getMonth()+1)).slice(-2),"sbcs"),Z.write_shift(2,("00"+v[w][j].getDate()).slice(-2),"sbcs")):Z.write_shift(8,"00000000","sbcs");break;case"C":var ce=String(v[w][j]!=null?v[w][j]:"").slice(0,E[j]);for(Z.write_shift(1,ce,"sbcs"),k=0;k<E[j]-ce.length;++k)Z.write_shift(1,32);break}}return p.next(1).write_shift(1,26),p.end()}return{to_workbook:s,to_sheet:a,from_sheet:l}})(),ahe=(function(){var e={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},t=new RegExp("\x1BN("+tn(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(x,v){var b=e[v];return typeof b=="number"?c8(b):b},a=function(x,v,b){var w=v.charCodeAt(0)-32<<4|b.charCodeAt(0)-48;return w==59?x:c8(w)};e["|"]=254;function s(x,v){switch(v.type){case"base64":return i(Bo(x),v);case"binary":return i(x,v);case"buffer":return i(ar&&Buffer.isBuffer(x)?x.toString("binary"):sp(x),v);case"array":return i(Xy(x),v)}throw new Error("Unrecognized type "+v.type)}function i(x,v){var b=x.split(/[\n\r]+/),w=-1,j=-1,k=0,C=0,N=[],O=[],E=null,A={},T=[],P=[],D=[],z=0,G;for(+v.codepage>=0&&kh(+v.codepage);k!==b.length;++k){z=0;var V=b[k].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,a).replace(t,r),ne=V.replace(/;;/g,"\0").split(";").map(function(Y){return Y.replace(/\u0000/g,";")}),ge=ne[0],Z;if(V.length>0)switch(ge){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":ne[1].charAt(0)=="P"&&O.push(V.slice(3).replace(/;;/g,";"));break;case"C":var U=!1,ce=!1,xe=!1,be=!1,me=-1,oe=-1;for(C=1;C<ne.length;++C)switch(ne[C].charAt(0)){case"A":break;case"X":j=parseInt(ne[C].slice(1))-1,ce=!0;break;case"Y":for(w=parseInt(ne[C].slice(1))-1,ce||(j=0),G=N.length;G<=w;++G)N[G]=[];break;case"K":Z=ne[C].slice(1),Z.charAt(0)==='"'?Z=Z.slice(1,Z.length-1):Z==="TRUE"?Z=!0:Z==="FALSE"?Z=!1:isNaN(Oo(Z))?isNaN(Nh(Z).getDate())||(Z=kn(Z)):(Z=Oo(Z),E!==null&&GF(E)&&(Z=JF(Z))),U=!0;break;case"E":be=!0;var L=tpe(ne[C].slice(1),{r:w,c:j});N[w][j]=[N[w][j],L];break;case"S":xe=!0,N[w][j]=[N[w][j],"S5S"];break;case"G":break;case"R":me=parseInt(ne[C].slice(1))-1;break;case"C":oe=parseInt(ne[C].slice(1))-1;break;default:if(v&&v.WTF)throw new Error("SYLK bad record "+V)}if(U&&(N[w][j]&&N[w][j].length==2?N[w][j][0]=Z:N[w][j]=Z,E=null),xe){if(be)throw new Error("SYLK shared formula cannot have own formula");var H=me>-1&&N[me][oe];if(!H||!H[1])throw new Error("SYLK shared formula cannot find base");N[w][j][1]=rpe(H[1],{r:w-me,c:j-oe})}break;case"F":var K=0;for(C=1;C<ne.length;++C)switch(ne[C].charAt(0)){case"X":j=parseInt(ne[C].slice(1))-1,++K;break;case"Y":for(w=parseInt(ne[C].slice(1))-1,G=N.length;G<=w;++G)N[G]=[];break;case"M":z=parseInt(ne[C].slice(1))/20;break;case"F":break;case"G":break;case"P":E=O[parseInt(ne[C].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(D=ne[C].slice(1).split(" "),G=parseInt(D[0],10);G<=parseInt(D[1],10);++G)z=parseInt(D[2],10),P[G-1]=z===0?{hidden:!0}:{wch:z},hS(P[G-1]);break;case"C":j=parseInt(ne[C].slice(1))-1,P[j]||(P[j]={});break;case"R":w=parseInt(ne[C].slice(1))-1,T[w]||(T[w]={}),z>0?(T[w].hpt=z,T[w].hpx=IM(z)):z===0&&(T[w].hidden=!0);break;default:if(v&&v.WTF)throw new Error("SYLK bad record "+V)}K<1&&(E=null);break;default:if(v&&v.WTF)throw new Error("SYLK bad record "+V)}}return T.length>0&&(A["!rows"]=T),P.length>0&&(A["!cols"]=P),v&&v.sheetRows&&(N=N.slice(0,v.sheetRows)),[N,A]}function l(x,v){var b=s(x,v),w=b[0],j=b[1],k=j0(w,v);return tn(j).forEach(function(C){k[C]=j[C]}),k}function u(x,v){return gu(l(x,v),v)}function d(x,v,b,w){var j="C;Y"+(b+1)+";X"+(w+1)+";K";switch(x.t){case"n":j+=x.v||0,x.f&&!x.F&&(j+=";E"+mS(x.f,{r:b,c:w}));break;case"b":j+=x.v?"TRUE":"FALSE";break;case"e":j+=x.w||x.v;break;case"d":j+='"'+(x.w||x.v)+'"';break;case"s":j+='"'+x.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return j}function f(x,v){v.forEach(function(b,w){var j="F;W"+(w+1)+" "+(w+1)+" ";b.hidden?j+="0":(typeof b.width=="number"&&!b.wpx&&(b.wpx=zx(b.width)),typeof b.wpx=="number"&&!b.wch&&(b.wch=Bx(b.wpx)),typeof b.wch=="number"&&(j+=Math.round(b.wch))),j.charAt(j.length-1)!=" "&&x.push(j)})}function p(x,v){v.forEach(function(b,w){var j="F;";b.hidden?j+="M0;":b.hpt?j+="M"+20*b.hpt+";":b.hpx&&(j+="M"+20*$x(b.hpx)+";"),j.length>2&&x.push(j+"R"+(w+1))})}function m(x,v){var b=["ID;PWXL;N;E"],w=[],j=Pr(x["!ref"]),k,C=Array.isArray(x),N=`\r
`;b.push("P;PGeneral"),b.push("F;P0;DG0G8;M255"),x["!cols"]&&f(b,x["!cols"]),x["!rows"]&&p(b,x["!rows"]),b.push("B;Y"+(j.e.r-j.s.r+1)+";X"+(j.e.c-j.s.c+1)+";D"+[j.s.c,j.s.r,j.e.c,j.e.r].join(" "));for(var O=j.s.r;O<=j.e.r;++O)for(var E=j.s.c;E<=j.e.c;++E){var A=hr({r:O,c:E});k=C?(x[O]||[])[E]:x[A],!(!k||k.v==null&&(!k.f||k.F))&&w.push(d(k,x,O,E))}return b.join(N)+N+w.join(N)+N+"E"+N}return{to_workbook:u,to_sheet:l,from_sheet:m}})(),nhe=(function(){function e(i,l){switch(l.type){case"base64":return t(Bo(i),l);case"binary":return t(i,l);case"buffer":return t(ar&&Buffer.isBuffer(i)?i.toString("binary"):sp(i),l);case"array":return t(Xy(i),l)}throw new Error("Unrecognized type "+l.type)}function t(i,l){for(var u=i.split(`
`),d=-1,f=-1,p=0,m=[];p!==u.length;++p){if(u[p].trim()==="BOT"){m[++d]=[],f=0;continue}if(!(d<0)){var x=u[p].trim().split(","),v=x[0],b=x[1];++p;for(var w=u[p]||"";(w.match(/["]/g)||[]).length&1&&p<u.length-1;)w+=`
`+u[++p];switch(w=w.trim(),+v){case-1:if(w==="BOT"){m[++d]=[],f=0;continue}else if(w!=="EOD")throw new Error("Unrecognized DIF special command "+w);break;case 0:w==="TRUE"?m[d][f]=!0:w==="FALSE"?m[d][f]=!1:isNaN(Oo(b))?isNaN(Nh(b).getDate())?m[d][f]=b:m[d][f]=kn(b):m[d][f]=Oo(b),++f;break;case 1:w=w.slice(1,w.length-1),w=w.replace(/""/g,'"'),w&&w.match(/^=".*"$/)&&(w=w.slice(2,-1)),m[d][f++]=w!==""?w:null;break}if(w==="EOD")break}}return l&&l.sheetRows&&(m=m.slice(0,l.sheetRows)),m}function r(i,l){return j0(e(i,l),l)}function a(i,l){return gu(r(i,l),l)}var s=(function(){var i=function(d,f,p,m,x){d.push(f),d.push(p+","+m),d.push('"'+x.replace(/"/g,'""')+'"')},l=function(d,f,p,m){d.push(f+","+p),d.push(f==1?'"'+m.replace(/"/g,'""')+'"':m)};return function(d){var f=[],p=Pr(d["!ref"]),m,x=Array.isArray(d);i(f,"TABLE",0,1,"sheetjs"),i(f,"VECTORS",0,p.e.r-p.s.r+1,""),i(f,"TUPLES",0,p.e.c-p.s.c+1,""),i(f,"DATA",0,0,"");for(var v=p.s.r;v<=p.e.r;++v){l(f,-1,0,"BOT");for(var b=p.s.c;b<=p.e.c;++b){var w=hr({r:v,c:b});if(m=x?(d[v]||[])[b]:d[w],!m){l(f,1,0,"");continue}switch(m.t){case"n":var j=m.w;!j&&m.v!=null&&(j=m.v),j==null?m.f&&!m.F?l(f,1,0,"="+m.f):l(f,1,0,""):l(f,0,j,"V");break;case"b":l(f,0,m.v?1:0,m.v?"TRUE":"FALSE");break;case"s":l(f,1,0,isNaN(m.v)?m.v:'="'+m.v+'"');break;case"d":m.w||(m.w=Ml(m.z||Kr[14],$n(kn(m.v)))),l(f,0,m.w,"V");break;default:l(f,1,0,"")}}}l(f,-1,0,"EOD");var k=`\r
`,C=f.join(k);return C}})();return{to_workbook:a,to_sheet:r,from_sheet:s}})(),RM=(function(){function e(m){return m.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,`
`)}function t(m){return m.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function r(m,x){for(var v=m.split(`
`),b=-1,w=-1,j=0,k=[];j!==v.length;++j){var C=v[j].trim().split(":");if(C[0]==="cell"){var N=Pa(C[1]);if(k.length<=N.r)for(b=k.length;b<=N.r;++b)k[b]||(k[b]=[]);switch(b=N.r,w=N.c,C[2]){case"t":k[b][w]=e(C[3]);break;case"v":k[b][w]=+C[3];break;case"vtf":var O=C[C.length-1];case"vtc":C[3]==="nl"?k[b][w]=!!+C[4]:k[b][w]=+C[4],C[2]=="vtf"&&(k[b][w]=[k[b][w],O])}}}return x&&x.sheetRows&&(k=k.slice(0,x.sheetRows)),k}function a(m,x){return j0(r(m,x),x)}function s(m,x){return gu(a(m,x),x)}var i=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(`
`),l=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(`
`)+`
`,u=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(`
`),d="--SocialCalcSpreadsheetControlSave--";function f(m){if(!m||!m["!ref"])return"";for(var x=[],v=[],b,w="",j=xs(m["!ref"]),k=Array.isArray(m),C=j.s.r;C<=j.e.r;++C)for(var N=j.s.c;N<=j.e.c;++N)if(w=hr({r:C,c:N}),b=k?(m[C]||[])[N]:m[w],!(!b||b.v==null||b.t==="z")){switch(v=["cell",w,"t"],b.t){case"s":case"str":v.push(t(b.v));break;case"n":b.f?(v[2]="vtf",v[3]="n",v[4]=b.v,v[5]=t(b.f)):(v[2]="v",v[3]=b.v);break;case"b":v[2]="vt"+(b.f?"f":"c"),v[3]="nl",v[4]=b.v?"1":"0",v[5]=t(b.f||(b.v?"TRUE":"FALSE"));break;case"d":var O=$n(kn(b.v));v[2]="vtc",v[3]="nd",v[4]=""+O,v[5]=b.w||Ml(b.z||Kr[14],O);break;case"e":continue}x.push(v.join(":"))}return x.push("sheet:c:"+(j.e.c-j.s.c+1)+":r:"+(j.e.r-j.s.r+1)+":tvf:1"),x.push("valueformat:1:text-wiki"),x.join(`
`)}function p(m){return[i,l,u,l,f(m),d].join(`
`)}return{to_workbook:s,to_sheet:a,from_sheet:p}})(),she=(function(){function e(p,m,x,v,b){b.raw?m[x][v]=p:p===""||(p==="TRUE"?m[x][v]=!0:p==="FALSE"?m[x][v]=!1:isNaN(Oo(p))?isNaN(Nh(p).getDate())?m[x][v]=p:m[x][v]=kn(p):m[x][v]=Oo(p))}function t(p,m){var x=m||{},v=[];if(!p||p.length===0)return v;for(var b=p.split(/[\r\n]/),w=b.length-1;w>=0&&b[w].length===0;)--w;for(var j=10,k=0,C=0;C<=w;++C)k=b[C].indexOf(" "),k==-1?k=b[C].length:k++,j=Math.max(j,k);for(C=0;C<=w;++C){v[C]=[];var N=0;for(e(b[C].slice(0,j).trim(),v,C,N,x),N=1;N<=(b[C].length-j)/10+1;++N)e(b[C].slice(j+(N-1)*10,j+N*10).trim(),v,C,N,x)}return x.sheetRows&&(v=v.slice(0,x.sheetRows)),v}var r={44:",",9:" ",59:";",124:"|"},a={44:3,9:2,59:1,124:0};function s(p){for(var m={},x=!1,v=0,b=0;v<p.length;++v)(b=p.charCodeAt(v))==34?x=!x:!x&&b in r&&(m[b]=(m[b]||0)+1);b=[];for(v in m)Object.prototype.hasOwnProperty.call(m,v)&&b.push([m[v],v]);if(!b.length){m=a;for(v in m)Object.prototype.hasOwnProperty.call(m,v)&&b.push([m[v],v])}return b.sort(function(w,j){return w[0]-j[0]||a[w[1]]-a[j[1]]}),r[b.pop()[1]]||44}function i(p,m){var x=m||{},v="",b=x.dense?[]:{},w={s:{c:0,r:0},e:{c:0,r:0}};p.slice(0,4)=="sep="?p.charCodeAt(5)==13&&p.charCodeAt(6)==10?(v=p.charAt(4),p=p.slice(7)):p.charCodeAt(5)==13||p.charCodeAt(5)==10?(v=p.charAt(4),p=p.slice(6)):v=s(p.slice(0,1024)):x&&x.FS?v=x.FS:v=s(p.slice(0,1024));var j=0,k=0,C=0,N=0,O=0,E=v.charCodeAt(0),A=!1,T=0,P=p.charCodeAt(0);p=p.replace(/\r\n/mg,`
`);var D=x.dateNF!=null?w0e(x.dateNF):null;function z(){var G=p.slice(N,O),V={};if(G.charAt(0)=='"'&&G.charAt(G.length-1)=='"'&&(G=G.slice(1,-1).replace(/""/g,'"')),G.length===0)V.t="z";else if(x.raw)V.t="s",V.v=G;else if(G.trim().length===0)V.t="s",V.v=G;else if(G.charCodeAt(0)==61)G.charCodeAt(1)==34&&G.charCodeAt(G.length-1)==34?(V.t="s",V.v=G.slice(2,-1).replace(/""/g,'"')):ape(G)?(V.t="n",V.f=G.slice(1)):(V.t="s",V.v=G);else if(G=="TRUE")V.t="b",V.v=!0;else if(G=="FALSE")V.t="b",V.v=!1;else if(!isNaN(C=Oo(G)))V.t="n",x.cellText!==!1&&(V.w=G),V.v=C;else if(!isNaN(Nh(G).getDate())||D&&G.match(D)){V.z=x.dateNF||Kr[14];var ne=0;D&&G.match(D)&&(G=j0e(G,x.dateNF,G.match(D)||[]),ne=1),x.cellDates?(V.t="d",V.v=kn(G,ne)):(V.t="n",V.v=$n(kn(G,ne))),x.cellText!==!1&&(V.w=Ml(V.z,V.v instanceof Date?$n(V.v):V.v)),x.cellNF||delete V.z}else V.t="s",V.v=G;if(V.t=="z"||(x.dense?(b[j]||(b[j]=[]),b[j][k]=V):b[hr({c:k,r:j})]=V),N=O+1,P=p.charCodeAt(N),w.e.c<k&&(w.e.c=k),w.e.r<j&&(w.e.r=j),T==E)++k;else if(k=0,++j,x.sheetRows&&x.sheetRows<=j)return!0}e:for(;O<p.length;++O)switch(T=p.charCodeAt(O)){case 34:P===34&&(A=!A);break;case E:case 10:case 13:if(!A&&z())break e;break}return O-N>0&&z(),b["!ref"]=ua(w),b}function l(p,m){return!(m&&m.PRN)||m.FS||p.slice(0,4)=="sep="||p.indexOf(" ")>=0||p.indexOf(",")>=0||p.indexOf(";")>=0?i(p,m):j0(t(p,m),m)}function u(p,m){var x="",v=m.type=="string"?[0,0,0,0]:xye(p,m);switch(m.type){case"base64":x=Bo(p);break;case"binary":x=p;break;case"buffer":m.codepage==65001?x=p.toString("utf8"):m.codepage&&typeof Ax!="undefined"||(x=ar&&Buffer.isBuffer(p)?p.toString("binary"):sp(p));break;case"array":x=Xy(p);break;case"string":x=p;break;default:throw new Error("Unrecognized type "+m.type)}return v[0]==239&&v[1]==187&&v[2]==191?x=Jf(x.slice(3)):m.type!="string"&&m.type!="buffer"&&m.codepage==65001?x=Jf(x):m.type=="binary",x.slice(0,19)=="socialcalc:version:"?RM.to_sheet(m.type=="string"?x:Jf(x),m):l(x,m)}function d(p,m){return gu(u(p,m),m)}function f(p){for(var m=[],x=Pr(p["!ref"]),v,b=Array.isArray(p),w=x.s.r;w<=x.e.r;++w){for(var j=[],k=x.s.c;k<=x.e.c;++k){var C=hr({r:w,c:k});if(v=b?(p[w]||[])[k]:p[C],!v||v.v==null){j.push(" ");continue}for(var N=(v.w||($o(v),v.w)||"").slice(0,10);N.length<10;)N+=" ";j.push(N+(k===0?" ":""))}m.push(j.join(""))}return m.join(`
`)}return{to_workbook:d,to_sheet:u,from_sheet:f}})(),B8=(function(){function e(L,H,K){if(L){is(L,L.l||0);for(var Y=K.Enum||me;L.l<L.length;){var re=L.read_shift(2),de=Y[re]||Y[65535],ie=L.read_shift(2),se=L.l+ie,he=de.f&&de.f(L,ie,K);if(L.l=se,H(he,de,re))return}}}function t(L,H){switch(H.type){case"base64":return r(di(Bo(L)),H);case"binary":return r(di(L),H);case"buffer":case"array":return r(L,H)}throw"Unsupported type "+H.type}function r(L,H){if(!L)return L;var K=H||{},Y=K.dense?[]:{},re="Sheet1",de="",ie=0,se={},he=[],_e=[],F={s:{r:0,c:0},e:{r:0,c:0}},X=K.sheetRows||0;if(L[2]==0&&(L[3]==8||L[3]==9)&&L.length>=16&&L[14]==5&&L[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(L[2]==2)K.Enum=me,e(L,function(q,B,je){switch(je){case 0:K.vers=q,q>=4096&&(K.qpro=!0);break;case 6:F=q;break;case 204:q&&(de=q);break;case 222:de=q;break;case 15:case 51:K.qpro||(q[1].v=q[1].v.slice(1));case 13:case 14:case 16:je==14&&(q[2]&112)==112&&(q[2]&15)>1&&(q[2]&15)<15&&(q[1].z=K.dateNF||Kr[14],K.cellDates&&(q[1].t="d",q[1].v=JF(q[1].v))),K.qpro&&q[3]>ie&&(Y["!ref"]=ua(F),se[re]=Y,he.push(re),Y=K.dense?[]:{},F={s:{r:0,c:0},e:{r:0,c:0}},ie=q[3],re=de||"Sheet"+(ie+1),de="");var Ce=K.dense?(Y[q[0].r]||[])[q[0].c]:Y[hr(q[0])];if(Ce){Ce.t=q[1].t,Ce.v=q[1].v,q[1].z!=null&&(Ce.z=q[1].z),q[1].f!=null&&(Ce.f=q[1].f);break}K.dense?(Y[q[0].r]||(Y[q[0].r]=[]),Y[q[0].r][q[0].c]=q[1]):Y[hr(q[0])]=q[1];break}},K);else if(L[2]==26||L[2]==14)K.Enum=oe,L[2]==14&&(K.qpro=!0,L.l=0),e(L,function(q,B,je){switch(je){case 204:re=q;break;case 22:q[1].v=q[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(q[3]>ie&&(Y["!ref"]=ua(F),se[re]=Y,he.push(re),Y=K.dense?[]:{},F={s:{r:0,c:0},e:{r:0,c:0}},ie=q[3],re="Sheet"+(ie+1)),X>0&&q[0].r>=X)break;K.dense?(Y[q[0].r]||(Y[q[0].r]=[]),Y[q[0].r][q[0].c]=q[1]):Y[hr(q[0])]=q[1],F.e.c<q[0].c&&(F.e.c=q[0].c),F.e.r<q[0].r&&(F.e.r=q[0].r);break;case 27:q[14e3]&&(_e[q[14e3][0]]=q[14e3][1]);break;case 1537:_e[q[0]]=q[1],q[0]==ie&&(re=q[1]);break}},K);else throw new Error("Unrecognized LOTUS BOF "+L[2]);if(Y["!ref"]=ua(F),se[de||re]=Y,he.push(de||re),!_e.length)return{SheetNames:he,Sheets:se};for(var R={},I=[],te=0;te<_e.length;++te)se[he[te]]?(I.push(_e[te]||he[te]),R[_e[te]]=se[_e[te]]||se[he[te]]):(I.push(_e[te]),R[_e[te]]={"!ref":"A1"});return{SheetNames:I,Sheets:R}}function a(L,H){var K=H||{};if(+K.codepage>=0&&kh(+K.codepage),K.type=="string")throw new Error("Cannot write WK1 to JS string");var Y=Bn(),re=Pr(L["!ref"]),de=Array.isArray(L),ie=[];nt(Y,0,i(1030)),nt(Y,6,d(re));for(var se=Math.min(re.e.r,8191),he=re.s.r;he<=se;++he)for(var _e=Qa(he),F=re.s.c;F<=re.e.c;++F){he===re.s.r&&(ie[F]=ln(F));var X=ie[F]+_e,R=de?(L[he]||[])[F]:L[X];if(!(!R||R.t=="z"))if(R.t=="n")(R.v|0)==R.v&&R.v>=-32768&&R.v<=32767?nt(Y,13,v(he,F,R.v)):nt(Y,14,w(he,F,R.v));else{var I=$o(R);nt(Y,15,m(he,F,I.slice(0,239)))}}return nt(Y,1),Y.end()}function s(L,H){var K=H||{};if(+K.codepage>=0&&kh(+K.codepage),K.type=="string")throw new Error("Cannot write WK3 to JS string");var Y=Bn();nt(Y,0,l(L));for(var re=0,de=0;re<L.SheetNames.length;++re)(L.Sheets[L.SheetNames[re]]||{})["!ref"]&&nt(Y,27,be(L.SheetNames[re],de++));var ie=0;for(re=0;re<L.SheetNames.length;++re){var se=L.Sheets[L.SheetNames[re]];if(!(!se||!se["!ref"])){for(var he=Pr(se["!ref"]),_e=Array.isArray(se),F=[],X=Math.min(he.e.r,8191),R=he.s.r;R<=X;++R)for(var I=Qa(R),te=he.s.c;te<=he.e.c;++te){R===he.s.r&&(F[te]=ln(te));var q=F[te]+I,B=_e?(se[R]||[])[te]:se[q];if(!(!B||B.t=="z"))if(B.t=="n")nt(Y,23,z(R,te,ie,B.v));else{var je=$o(B);nt(Y,22,T(R,te,ie,je.slice(0,239)))}}++ie}}return nt(Y,1),Y.end()}function i(L){var H=He(2);return H.write_shift(2,L),H}function l(L){var H=He(26);H.write_shift(2,4096),H.write_shift(2,4),H.write_shift(4,0);for(var K=0,Y=0,re=0,de=0;de<L.SheetNames.length;++de){var ie=L.SheetNames[de],se=L.Sheets[ie];if(!(!se||!se["!ref"])){++re;var he=xs(se["!ref"]);K<he.e.r&&(K=he.e.r),Y<he.e.c&&(Y=he.e.c)}}return K>8191&&(K=8191),H.write_shift(2,K),H.write_shift(1,re),H.write_shift(1,Y),H.write_shift(2,0),H.write_shift(2,0),H.write_shift(1,1),H.write_shift(1,2),H.write_shift(4,0),H.write_shift(4,0),H}function u(L,H,K){var Y={s:{c:0,r:0},e:{c:0,r:0}};return H==8&&K.qpro?(Y.s.c=L.read_shift(1),L.l++,Y.s.r=L.read_shift(2),Y.e.c=L.read_shift(1),L.l++,Y.e.r=L.read_shift(2),Y):(Y.s.c=L.read_shift(2),Y.s.r=L.read_shift(2),H==12&&K.qpro&&(L.l+=2),Y.e.c=L.read_shift(2),Y.e.r=L.read_shift(2),H==12&&K.qpro&&(L.l+=2),Y.s.c==65535&&(Y.s.c=Y.e.c=Y.s.r=Y.e.r=0),Y)}function d(L){var H=He(8);return H.write_shift(2,L.s.c),H.write_shift(2,L.s.r),H.write_shift(2,L.e.c),H.write_shift(2,L.e.r),H}function f(L,H,K){var Y=[{c:0,r:0},{t:"n",v:0},0,0];return K.qpro&&K.vers!=20768?(Y[0].c=L.read_shift(1),Y[3]=L.read_shift(1),Y[0].r=L.read_shift(2),L.l+=2):(Y[2]=L.read_shift(1),Y[0].c=L.read_shift(2),Y[0].r=L.read_shift(2)),Y}function p(L,H,K){var Y=L.l+H,re=f(L,H,K);if(re[1].t="s",K.vers==20768){L.l++;var de=L.read_shift(1);return re[1].v=L.read_shift(de,"utf8"),re}return K.qpro&&L.l++,re[1].v=L.read_shift(Y-L.l,"cstr"),re}function m(L,H,K){var Y=He(7+K.length);Y.write_shift(1,255),Y.write_shift(2,H),Y.write_shift(2,L),Y.write_shift(1,39);for(var re=0;re<Y.length;++re){var de=K.charCodeAt(re);Y.write_shift(1,de>=128?95:de)}return Y.write_shift(1,0),Y}function x(L,H,K){var Y=f(L,H,K);return Y[1].v=L.read_shift(2,"i"),Y}function v(L,H,K){var Y=He(7);return Y.write_shift(1,255),Y.write_shift(2,H),Y.write_shift(2,L),Y.write_shift(2,K,"i"),Y}function b(L,H,K){var Y=f(L,H,K);return Y[1].v=L.read_shift(8,"f"),Y}function w(L,H,K){var Y=He(13);return Y.write_shift(1,255),Y.write_shift(2,H),Y.write_shift(2,L),Y.write_shift(8,K,"f"),Y}function j(L,H,K){var Y=L.l+H,re=f(L,H,K);if(re[1].v=L.read_shift(8,"f"),K.qpro)L.l=Y;else{var de=L.read_shift(2);O(L.slice(L.l,L.l+de),re),L.l+=de}return re}function k(L,H,K){var Y=H&32768;return H&=-32769,H=(Y?L:0)+(H>=8192?H-16384:H),(Y?"":"$")+(K?ln(H):Qa(H))}var C={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},N=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function O(L,H){is(L,0);for(var K=[],Y=0,re="",de="",ie="",se="";L.l<L.length;){var he=L[L.l++];switch(he){case 0:K.push(L.read_shift(8,"f"));break;case 1:de=k(H[0].c,L.read_shift(2),!0),re=k(H[0].r,L.read_shift(2),!1),K.push(de+re);break;case 2:{var _e=k(H[0].c,L.read_shift(2),!0),F=k(H[0].r,L.read_shift(2),!1);de=k(H[0].c,L.read_shift(2),!0),re=k(H[0].r,L.read_shift(2),!1),K.push(_e+F+":"+de+re)}break;case 3:if(L.l<L.length){console.error("WK1 premature formula end");return}break;case 4:K.push("("+K.pop()+")");break;case 5:K.push(L.read_shift(2));break;case 6:{for(var X="";he=L[L.l++];)X+=String.fromCharCode(he);K.push('"'+X.replace(/"/g,'""')+'"')}break;case 8:K.push("-"+K.pop());break;case 23:K.push("+"+K.pop());break;case 22:K.push("NOT("+K.pop()+")");break;case 20:case 21:se=K.pop(),ie=K.pop(),K.push(["AND","OR"][he-20]+"("+ie+","+se+")");break;default:if(he<32&&N[he])se=K.pop(),ie=K.pop(),K.push(ie+N[he]+se);else if(C[he]){if(Y=C[he][1],Y==69&&(Y=L[L.l++]),Y>K.length){console.error("WK1 bad formula parse 0x"+he.toString(16)+":|"+K.join("|")+"|");return}var R=K.slice(-Y);K.length-=Y,K.push(C[he][0]+"("+R.join(",")+")")}else return he<=7?console.error("WK1 invalid opcode "+he.toString(16)):he<=24?console.error("WK1 unsupported op "+he.toString(16)):he<=30?console.error("WK1 invalid opcode "+he.toString(16)):he<=115?console.error("WK1 unsupported function opcode "+he.toString(16)):console.error("WK1 unrecognized opcode "+he.toString(16))}}K.length==1?H[1].f=""+K[0]:console.error("WK1 bad formula parse |"+K.join("|")+"|")}function E(L){var H=[{c:0,r:0},{t:"n",v:0},0];return H[0].r=L.read_shift(2),H[3]=L[L.l++],H[0].c=L[L.l++],H}function A(L,H){var K=E(L);return K[1].t="s",K[1].v=L.read_shift(H-4,"cstr"),K}function T(L,H,K,Y){var re=He(6+Y.length);re.write_shift(2,L),re.write_shift(1,K),re.write_shift(1,H),re.write_shift(1,39);for(var de=0;de<Y.length;++de){var ie=Y.charCodeAt(de);re.write_shift(1,ie>=128?95:ie)}return re.write_shift(1,0),re}function P(L,H){var K=E(L);K[1].v=L.read_shift(2);var Y=K[1].v>>1;if(K[1].v&1)switch(Y&7){case 0:Y=(Y>>3)*5e3;break;case 1:Y=(Y>>3)*500;break;case 2:Y=(Y>>3)/20;break;case 3:Y=(Y>>3)/200;break;case 4:Y=(Y>>3)/2e3;break;case 5:Y=(Y>>3)/2e4;break;case 6:Y=(Y>>3)/16;break;case 7:Y=(Y>>3)/64;break}return K[1].v=Y,K}function D(L,H){var K=E(L),Y=L.read_shift(4),re=L.read_shift(4),de=L.read_shift(2);if(de==65535)return Y===0&&re===3221225472?(K[1].t="e",K[1].v=15):Y===0&&re===3489660928?(K[1].t="e",K[1].v=42):K[1].v=0,K;var ie=de&32768;return de=(de&32767)-16446,K[1].v=(1-ie*2)*(re*Math.pow(2,de+32)+Y*Math.pow(2,de)),K}function z(L,H,K,Y){var re=He(14);if(re.write_shift(2,L),re.write_shift(1,K),re.write_shift(1,H),Y==0)return re.write_shift(4,0),re.write_shift(4,0),re.write_shift(2,65535),re;var de=0,ie=0,se=0,he=0;return Y<0&&(de=1,Y=-Y),ie=Math.log2(Y)|0,Y/=Math.pow(2,ie-31),he=Y>>>0,(he&2147483648)==0&&(Y/=2,++ie,he=Y>>>0),Y-=he,he|=2147483648,he>>>=0,Y*=Math.pow(2,32),se=Y>>>0,re.write_shift(4,se),re.write_shift(4,he),ie+=16383+(de?32768:0),re.write_shift(2,ie),re}function G(L,H){var K=D(L);return L.l+=H-14,K}function V(L,H){var K=E(L),Y=L.read_shift(4);return K[1].v=Y>>6,K}function ne(L,H){var K=E(L),Y=L.read_shift(8,"f");return K[1].v=Y,K}function ge(L,H){var K=ne(L);return L.l+=H-10,K}function Z(L,H){return L[L.l+H-1]==0?L.read_shift(H,"cstr"):""}function U(L,H){var K=L[L.l++];K>H-1&&(K=H-1);for(var Y="";Y.length<K;)Y+=String.fromCharCode(L[L.l++]);return Y}function ce(L,H,K){if(!(!K.qpro||H<21)){var Y=L.read_shift(1);L.l+=17,L.l+=1,L.l+=2;var re=L.read_shift(H-21,"cstr");return[Y,re]}}function xe(L,H){for(var K={},Y=L.l+H;L.l<Y;){var re=L.read_shift(2);if(re==14e3){for(K[re]=[0,""],K[re][0]=L.read_shift(2);L[L.l];)K[re][1]+=String.fromCharCode(L[L.l]),L.l++;L.l++}}return K}function be(L,H){var K=He(5+L.length);K.write_shift(2,14e3),K.write_shift(2,H);for(var Y=0;Y<L.length;++Y){var re=L.charCodeAt(Y);K[K.l++]=re>127?95:re}return K[K.l++]=0,K}var me={0:{n:"BOF",f:EM},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:u},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:x},14:{n:"NUMBER",f:b},15:{n:"LABEL",f:p},16:{n:"FORMULA",f:j},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f:p},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:Z},222:{n:"SHEETNAMELP",f:U},65535:{n:""}},oe={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:A},23:{n:"NUMBER17",f:D},24:{n:"NUMBER18",f:P},25:{n:"FORMULA19",f:G},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:xe},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:V},38:{n:"??"},39:{n:"NUMBER27",f:ne},40:{n:"FORMULA28",f:ge},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:Z},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:ce},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:a,book_to_wk3:s,to_workbook:t}})(),ihe=/^\s|\s$|[\t\n\r]/;function FM(e,t){if(!t.bookSST)return"";var r=[pa];r[r.length]=at("sst",null,{xmlns:w0[0],count:e.Count,uniqueCount:e.Unique});for(var a=0;a!=e.length;++a)if(e[a]!=null){var s=e[a],i="<si>";s.r?i+=s.r:(i+="<t",s.t||(s.t=""),s.t.match(ihe)&&(i+=' xml:space="preserve"'),i+=">"+fr(s.t)+"</t>"),i+="</si>",r[r.length]=i}return r.length>2&&(r[r.length]="</sst>",r[1]=r[1].replace("/>",">")),r.join("")}function ohe(e){return[e.read_shift(4),e.read_shift(4)]}function lhe(e,t){return t||(t=He(8)),t.write_shift(4,e.Count),t.write_shift(4,e.Unique),t}var che=Z0e;function uhe(e){var t=Bn();Ke(t,159,lhe(e));for(var r=0;r<e.length;++r)Ke(t,19,che(e[r]));return Ke(t,160),t.end()}function dhe(e){for(var t=[],r=e.split(""),a=0;a<r.length;++a)t[a]=r[a].charCodeAt(0);return t}function MM(e){var t=0,r,a=dhe(e),s=a.length+1,i,l,u,d,f;for(r=iu(s),r[0]=a.length,i=1;i!=s;++i)r[i]=a[i-1];for(i=s-1;i>=0;--i)l=r[i],u=(t&16384)===0?0:1,d=t<<1&32767,f=u|d,t=f^l;return t^52811}var fhe=(function(){function e(s,i){switch(i.type){case"base64":return t(Bo(s),i);case"binary":return t(s,i);case"buffer":return t(ar&&Buffer.isBuffer(s)?s.toString("binary"):sp(s),i);case"array":return t(Xy(s),i)}throw new Error("Unrecognized type "+i.type)}function t(s,i){var l=i||{},u=l.dense?[]:{},d=s.match(/\\trowd.*?\\row\b/g);if(!d.length)throw new Error("RTF missing table");var f={s:{c:0,r:0},e:{c:0,r:d.length-1}};return d.forEach(function(p,m){Array.isArray(u)&&(u[m]=[]);for(var x=/\\\w+\b/g,v=0,b,w=-1;b=x.exec(p);){switch(b[0]){case"\\cell":var j=p.slice(v,x.lastIndex-b[0].length);if(j[0]==" "&&(j=j.slice(1)),++w,j.length){var k={v:j,t:"s"};Array.isArray(u)?u[m][w]=k:u[hr({r:m,c:w})]=k}break}v=x.lastIndex}w>f.e.c&&(f.e.c=w)}),u["!ref"]=ua(f),u}function r(s,i){return gu(e(s,i),i)}function a(s){for(var i=["{\\rtf1\\ansi"],l=Pr(s["!ref"]),u,d=Array.isArray(s),f=l.s.r;f<=l.e.r;++f){i.push("\\trowd\\trautofit1");for(var p=l.s.c;p<=l.e.c;++p)i.push("\\cellx"+(p+1));for(i.push("\\pard\\intbl"),p=l.s.c;p<=l.e.c;++p){var m=hr({r:f,c:p});u=d?(s[f]||[])[p]:s[m],!(!u||u.v==null&&(!u.f||u.F))&&(i.push(" "+(u.w||($o(u),u.w))),i.push("\\cell"))}i.push("\\pard\\intbl\\row")}return i.join("")+"}"}return{to_workbook:r,to_sheet:e,from_sheet:a}})();function $8(e){for(var t=0,r=1;t!=3;++t)r=r*256+(e[t]>255?255:e[t]<0?0:e[t]);return r.toString(16).toUpperCase().slice(1)}var hhe=6,Po=hhe;function zx(e){return Math.floor((e+Math.round(128/Po)/256)*Po)}function Bx(e){return Math.floor((e-5)/Po*100+.5)/100}function Vj(e){return Math.round((e*Po+5)/Po*256)/256}function hS(e){e.width?(e.wpx=zx(e.width),e.wch=Bx(e.wpx),e.MDW=Po):e.wpx?(e.wch=Bx(e.wpx),e.width=Vj(e.wch),e.MDW=Po):typeof e.wch=="number"&&(e.width=Vj(e.wch),e.wpx=zx(e.width),e.MDW=Po),e.customWidth&&delete e.customWidth}var phe=96,LM=phe;function $x(e){return e*96/LM}function IM(e){return e*LM/96}function mhe(e){var t=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach(function(r){for(var a=r[0];a<=r[1];++a)e[a]!=null&&(t[t.length]=at("numFmt",null,{numFmtId:a,formatCode:fr(e[a])}))}),t.length===1?"":(t[t.length]="</numFmts>",t[0]=at("numFmts",null,{count:t.length-2}).replace("/>",">"),t.join(""))}function ghe(e){var t=[];return t[t.length]=at("cellXfs",null),e.forEach(function(r){t[t.length]=at("xf",null,r)}),t[t.length]="</cellXfs>",t.length===2?"":(t[0]=at("cellXfs",null,{count:t.length-2}).replace("/>",">"),t.join(""))}function zM(e,t){var r=[pa,at("styleSheet",null,{xmlns:w0[0],"xmlns:vt":Aa.vt})],a;return e.SSF&&(a=mhe(e.SSF))!=null&&(r[r.length]=a),r[r.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>',r[r.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>',r[r.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>',r[r.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>',(a=ghe(t.cellXfs))&&(r[r.length]=a),r[r.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>',r[r.length]='<dxfs count="0"/>',r[r.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>',r.length>2&&(r[r.length]="</styleSheet>",r[1]=r[1].replace("/>",">")),r.join("")}function xhe(e,t){var r=e.read_shift(2),a=cn(e);return[r,a]}function yhe(e,t,r){r||(r=He(6+4*t.length)),r.write_shift(2,e),Da(t,r);var a=r.length>r.l?r.slice(0,r.l):r;return r.l==null&&(r.l=r.length),a}function vhe(e,t,r){var a={};a.sz=e.read_shift(2)/20;var s=ife(e);s.fItalic&&(a.italic=1),s.fCondense&&(a.condense=1),s.fExtend&&(a.extend=1),s.fShadow&&(a.shadow=1),s.fOutline&&(a.outline=1),s.fStrikeout&&(a.strike=1);var i=e.read_shift(2);switch(i===700&&(a.bold=1),e.read_shift(2)){case 1:a.vertAlign="superscript";break;case 2:a.vertAlign="subscript";break}var l=e.read_shift(1);l!=0&&(a.underline=l);var u=e.read_shift(1);u>0&&(a.family=u);var d=e.read_shift(1);switch(d>0&&(a.charset=d),e.l++,a.color=sfe(e),e.read_shift(1)){case 1:a.scheme="major";break;case 2:a.scheme="minor";break}return a.name=cn(e),a}function bhe(e,t){t||(t=He(153)),t.write_shift(2,e.sz*20),ofe(e,t),t.write_shift(2,e.bold?700:400);var r=0;e.vertAlign=="superscript"?r=1:e.vertAlign=="subscript"&&(r=2),t.write_shift(2,r),t.write_shift(1,e.underline||0),t.write_shift(1,e.family||0),t.write_shift(1,e.charset||0),t.write_shift(1,0),Lx(e.color,t);var a=0;return a=2,t.write_shift(1,a),Da(e.name,t),t.length>t.l?t.slice(0,t.l):t}var whe=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],pw,jhe=Xi;function U8(e,t){t||(t=He(84)),pw||(pw=tS(whe));var r=pw[e.patternType];r==null&&(r=40),t.write_shift(4,r);var a=0;if(r!=40)for(Lx({auto:1},t),Lx({auto:1},t);a<12;++a)t.write_shift(4,0);else{for(;a<4;++a)t.write_shift(4,0);for(;a<12;++a)t.write_shift(4,0)}return t.length>t.l?t.slice(0,t.l):t}function _he(e,t){var r=e.l+t,a=e.read_shift(2),s=e.read_shift(2);return e.l=r,{ixfe:a,numFmtId:s}}function BM(e,t,r){r||(r=He(16)),r.write_shift(2,t||0),r.write_shift(2,e.numFmtId||0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(1,0),r.write_shift(1,0);var a=0;return r.write_shift(1,a),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(1,0),r}function Of(e,t){return t||(t=He(10)),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(4,0),t.write_shift(4,0),t}var khe=Xi;function She(e,t){return t||(t=He(51)),t.write_shift(1,0),Of(null,t),Of(null,t),Of(null,t),Of(null,t),Of(null,t),t.length>t.l?t.slice(0,t.l):t}function Nhe(e,t){return t||(t=He(52)),t.write_shift(4,e.xfId),t.write_shift(2,1),t.write_shift(1,0),t.write_shift(1,0),Mx(e.name||"",t),t.length>t.l?t.slice(0,t.l):t}function Che(e,t,r){var a=He(2052);return a.write_shift(4,e),Mx(t,a),Mx(r,a),a.length>a.l?a.slice(0,a.l):a}function The(e,t){if(t){var r=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(a){for(var s=a[0];s<=a[1];++s)t[s]!=null&&++r}),r!=0&&(Ke(e,615,xi(r)),[[5,8],[23,26],[41,44],[50,392]].forEach(function(a){for(var s=a[0];s<=a[1];++s)t[s]!=null&&Ke(e,44,yhe(s,t[s]))}),Ke(e,616))}}function Ehe(e){var t=1;Ke(e,611,xi(t)),Ke(e,43,bhe({sz:12,color:{theme:1},name:"Calibri",family:2})),Ke(e,612)}function Ahe(e){var t=2;Ke(e,603,xi(t)),Ke(e,45,U8({patternType:"none"})),Ke(e,45,U8({patternType:"gray125"})),Ke(e,604)}function Ohe(e){var t=1;Ke(e,613,xi(t)),Ke(e,46,She()),Ke(e,614)}function Phe(e){var t=1;Ke(e,626,xi(t)),Ke(e,47,BM({numFmtId:0},65535)),Ke(e,627)}function Dhe(e,t){Ke(e,617,xi(t.length)),t.forEach(function(r){Ke(e,47,BM(r,0))}),Ke(e,618)}function Rhe(e){var t=1;Ke(e,619,xi(t)),Ke(e,48,Nhe({xfId:0,name:"Normal"})),Ke(e,620)}function Fhe(e){var t=0;Ke(e,505,xi(t)),Ke(e,506)}function Mhe(e){var t=0;Ke(e,508,Che(t,"TableStyleMedium9","PivotStyleMedium4")),Ke(e,509)}function Lhe(e,t){var r=Bn();return Ke(r,278),The(r,e.SSF),Ehe(r),Ahe(r),Ohe(r),Phe(r),Dhe(r,t.cellXfs),Rhe(r),Fhe(r),Mhe(r),Ke(r,279),r.end()}function $M(e,t){if(t&&t.themeXLSX)return t.themeXLSX;if(e&&typeof e.raw=="string")return e.raw;var r=[pa];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface=" Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface=" Pゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function Ihe(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:cn(e)}}function zhe(e){var t=He(12+2*e.name.length);return t.write_shift(4,e.flags),t.write_shift(4,e.version),Da(e.name,t),t.slice(0,t.l)}function Bhe(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function $he(e){var t=He(4+8*e.length);t.write_shift(4,e.length);for(var r=0;r<e.length;++r)t.write_shift(4,e[r][0]),t.write_shift(4,e[r][1]);return t}function Uhe(e,t){var r=He(8+2*t.length);return r.write_shift(4,e),Da(t,r),r.slice(0,r.l)}function Hhe(e){return e.l+=4,e.read_shift(4)!=0}function qhe(e,t){var r=He(8);return r.write_shift(4,e),r.write_shift(4,1),r}function Whe(){var e=Bn();return Ke(e,332),Ke(e,334,xi(1)),Ke(e,335,zhe({name:"XLDAPR",version:12e4,flags:3496657072})),Ke(e,336),Ke(e,339,Uhe(1,"XLDAPR")),Ke(e,52),Ke(e,35,xi(514)),Ke(e,4096,xi(0)),Ke(e,4097,Bs(1)),Ke(e,36),Ke(e,53),Ke(e,340),Ke(e,337,qhe(1)),Ke(e,51,$he([[1,0]])),Ke(e,338),Ke(e,333),e.end()}function UM(){var e=[pa];return e.push(`<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">
<metadataTypes count="1">
<metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/>
</metadataTypes>
<futureMetadata name="XLDAPR" count="1">
<bk>
<extLst>
<ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}">
<xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/>
</ext>
</extLst>
</bk>
</futureMetadata>
<cellMetadata count="1">
<bk>
<rc t="1" v="0"/>
</bk>
</cellMetadata>
</metadata>`),e.join("")}function Vhe(e){var t={};t.i=e.read_shift(4);var r={};r.r=e.read_shift(4),r.c=e.read_shift(4),t.r=hr(r);var a=e.read_shift(1);return a&2&&(t.l="1"),a&8&&(t.a="1"),t}var Dd=1024;function HM(e,t){for(var r=[21600,21600],a=["m0,0l0",r[1],r[0],r[1],r[0],"0xe"].join(","),s=[at("xml",null,{"xmlns:v":os.v,"xmlns:o":os.o,"xmlns:x":os.x,"xmlns:mv":os.mv}).replace(/\/>/,">"),at("o:shapelayout",at("o:idmap",null,{"v:ext":"edit",data:e}),{"v:ext":"edit"}),at("v:shapetype",[at("v:stroke",null,{joinstyle:"miter"}),at("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:r.join(","),path:a})];Dd<e*1e3;)Dd+=1e3;return t.forEach(function(i){var l=Pa(i[0]),u={color2:"#BEFF82",type:"gradient"};u.type=="gradient"&&(u.angle="-180");var d=u.type=="gradient"?at("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,f=at("v:fill",d,u),p={on:"t",obscured:"t"};++Dd,s=s.concat(["<v:shape"+Th({id:"_x0000_s"+Dd,type:"#_x0000_t202",style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10"+(i[1].hidden?";visibility:hidden":""),fillcolor:"#ECFAD4",strokecolor:"#edeaa1"})+">",f,at("v:shadow",null,p),at("v:path",null,{"o:connecttype":"none"}),'<v:textbox><div style="text-align:left"></div></v:textbox>','<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",Ka("x:Anchor",[l.c+1,0,l.r+1,0,l.c+3,20,l.r+5,20].join(",")),Ka("x:AutoFill","False"),Ka("x:Row",String(l.r)),Ka("x:Column",String(l.c)),i[1].hidden?"":"<x:Visible/>","</x:ClientData>","</v:shape>"])}),s.push("</xml>"),s.join("")}function qM(e){var t=[pa,at("comments",null,{xmlns:w0[0]})],r=[];return t.push("<authors>"),e.forEach(function(a){a[1].forEach(function(s){var i=fr(s.a);r.indexOf(i)==-1&&(r.push(i),t.push("<author>"+i+"</author>")),s.T&&s.ID&&r.indexOf("tc="+s.ID)==-1&&(r.push("tc="+s.ID),t.push("<author>tc="+s.ID+"</author>"))})}),r.length==0&&(r.push("SheetJ5"),t.push("<author>SheetJ5</author>")),t.push("</authors>"),t.push("<commentList>"),e.forEach(function(a){var s=0,i=[];if(a[1][0]&&a[1][0].T&&a[1][0].ID?s=r.indexOf("tc="+a[1][0].ID):a[1].forEach(function(d){d.a&&(s=r.indexOf(fr(d.a))),i.push(d.t||"")}),t.push('<comment ref="'+a[0]+'" authorId="'+s+'"><text>'),i.length<=1)t.push(Ka("t",fr(i[0]||"")));else{for(var l=`Comment:
`+i[0]+`
`,u=1;u<i.length;++u)l+=`Reply:
`+i[u]+`
`;t.push(Ka("t",fr(l)))}t.push("</text></comment>")}),t.push("</commentList>"),t.length>2&&(t[t.length]="</comments>",t[1]=t[1].replace("/>",">")),t.join("")}function Ghe(e,t,r){var a=[pa,at("ThreadedComments",null,{xmlns:Aa.TCMNT}).replace(/[\/]>/,">")];return e.forEach(function(s){var i="";(s[1]||[]).forEach(function(l,u){if(!l.T){delete l.ID;return}l.a&&t.indexOf(l.a)==-1&&t.push(l.a);var d={ref:s[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+r.tcid++).slice(-12)+"}"};u==0?i=d.id:d.parentId=i,l.ID=d.id,l.a&&(d.personId="{54EE7950-7262-4200-6969-"+("000000000000"+t.indexOf(l.a)).slice(-12)+"}"),a.push(at("threadedComment",Ka("text",l.t||""),d))})}),a.push("</ThreadedComments>"),a.join("")}function Khe(e){var t=[pa,at("personList",null,{xmlns:Aa.TCMNT,"xmlns:x":w0[0]}).replace(/[\/]>/,">")];return e.forEach(function(r,a){t.push(at("person",null,{displayName:r,id:"{54EE7950-7262-4200-6969-"+("000000000000"+a).slice(-12)+"}",userId:r,providerId:"None"}))}),t.push("</personList>"),t.join("")}function Yhe(e){var t={};t.iauthor=e.read_shift(4);var r=bu(e);return t.rfx=r.s,t.ref=hr(r.s),e.l+=16,t}function Xhe(e,t){return t==null&&(t=He(36)),t.write_shift(4,e[1].iauthor),_0(e[0],t),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t}var Jhe=cn;function Qhe(e){return Da(e.slice(0,54))}function Zhe(e){var t=Bn(),r=[];return Ke(t,628),Ke(t,630),e.forEach(function(a){a[1].forEach(function(s){r.indexOf(s.a)>-1||(r.push(s.a.slice(0,54)),Ke(t,632,Qhe(s.a)))})}),Ke(t,631),Ke(t,633),e.forEach(function(a){a[1].forEach(function(s){s.iauthor=r.indexOf(s.a);var i={s:Pa(a[0]),e:Pa(a[0])};Ke(t,635,Xhe([i,s])),s.t&&s.t.length>0&&Ke(t,637,tfe(s)),Ke(t,636),delete s.iauthor})}),Ke(t,634),Ke(t,629),t.end()}function epe(e,t){t.FullPaths.forEach(function(r,a){if(a!=0){var s=r.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");s.slice(-1)!=="/"&&br.utils.cfb_add(e,s,t.FileIndex[a].content)}})}var WM=["xlsb","xlsm","xlam","biff8","xla"],tpe=(function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(a,s,i,l){var u=!1,d=!1;i.length==0?d=!0:i.charAt(0)=="["&&(d=!0,i=i.slice(1,-1)),l.length==0?u=!0:l.charAt(0)=="["&&(u=!0,l=l.slice(1,-1));var f=i.length>0?parseInt(i,10)|0:0,p=l.length>0?parseInt(l,10)|0:0;return u?p+=t.c:--p,d?f+=t.r:--f,s+(u?"":"$")+ln(p)+(d?"":"$")+Qa(f)}return function(s,i){return t=i,s.replace(e,r)}})(),pS=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,mS=(function(){return function(t,r){return t.replace(pS,function(a,s,i,l,u,d){var f=lS(l)-(i?0:r.c),p=oS(d)-(u?0:r.r),m=p==0?"":u?p+1:"["+p+"]",x=f==0?"":i?f+1:"["+f+"]";return s+"R"+m+"C"+x})}})();function rpe(e,t){return e.replace(pS,function(r,a,s,i,l,u){return a+(s=="$"?s+i:ln(lS(i)+t.c))+(l=="$"?l+u:Qa(oS(u)+t.r))})}function ape(e){return e.length!=1}function sa(e){e.l+=1}function Ll(e,t){var r=e.read_shift(2);return[r&16383,r>>14&1,r>>15&1]}function VM(e,t,r){var a=2;if(r){if(r.biff>=2&&r.biff<=5)return GM(e);r.biff==12&&(a=4)}var s=e.read_shift(a),i=e.read_shift(a),l=Ll(e),u=Ll(e);return{s:{r:s,c:l[0],cRel:l[1],rRel:l[2]},e:{r:i,c:u[0],cRel:u[1],rRel:u[2]}}}function GM(e){var t=Ll(e),r=Ll(e),a=e.read_shift(1),s=e.read_shift(1);return{s:{r:t[0],c:a,cRel:t[1],rRel:t[2]},e:{r:r[0],c:s,cRel:r[1],rRel:r[2]}}}function npe(e,t,r){if(r.biff<8)return GM(e);var a=e.read_shift(r.biff==12?4:2),s=e.read_shift(r.biff==12?4:2),i=Ll(e),l=Ll(e);return{s:{r:a,c:i[0],cRel:i[1],rRel:i[2]},e:{r:s,c:l[0],cRel:l[1],rRel:l[2]}}}function KM(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return spe(e);var a=e.read_shift(r&&r.biff==12?4:2),s=Ll(e);return{r:a,c:s[0],cRel:s[1],rRel:s[2]}}function spe(e){var t=Ll(e),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function ipe(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:r&255,fQuoted:!!(r&16384),cRel:r>>15,rRel:r>>15}}function ope(e,t,r){var a=r&&r.biff?r.biff:8;if(a>=2&&a<=5)return lpe(e);var s=e.read_shift(a>=12?4:2),i=e.read_shift(2),l=(i&16384)>>14,u=(i&32768)>>15;if(i&=16383,u==1)for(;s>524287;)s-=1048576;if(l==1)for(;i>8191;)i=i-16384;return{r:s,c:i,cRel:l,rRel:u}}function lpe(e){var t=e.read_shift(2),r=e.read_shift(1),a=(t&32768)>>15,s=(t&16384)>>14;return t&=16383,a==1&&t>=8192&&(t=t-16384),s==1&&r>=128&&(r=r-256),{r:t,c:r,cRel:s,rRel:a}}function cpe(e,t,r){var a=(e[e.l++]&96)>>5,s=VM(e,r.biff>=2&&r.biff<=5?6:8,r);return[a,s]}function upe(e,t,r){var a=(e[e.l++]&96)>>5,s=e.read_shift(2,"i"),i=8;if(r)switch(r.biff){case 5:e.l+=12,i=6;break;case 12:i=12;break}var l=VM(e,i,r);return[a,s,l]}function dpe(e,t,r){var a=(e[e.l++]&96)>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[a]}function fpe(e,t,r){var a=(e[e.l++]&96)>>5,s=e.read_shift(2),i=8;if(r)switch(r.biff){case 5:e.l+=12,i=6;break;case 12:i=12;break}return e.l+=i,[a,s]}function hpe(e,t,r){var a=(e[e.l++]&96)>>5,s=npe(e,t-1,r);return[a,s]}function ppe(e,t,r){var a=(e[e.l++]&96)>>5;return e.l+=r.biff==2?6:r.biff==12?14:7,[a]}function H8(e){var t=e[e.l+1]&1,r=1;return e.l+=4,[t,r]}function mpe(e,t,r){e.l+=2;for(var a=e.read_shift(r&&r.biff==2?1:2),s=[],i=0;i<=a;++i)s.push(e.read_shift(r&&r.biff==2?1:2));return s}function gpe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=2,[a,e.read_shift(r&&r.biff==2?1:2)]}function xpe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=2,[a,e.read_shift(r&&r.biff==2?1:2)]}function ype(e){var t=e[e.l+1]&255?1:0;return e.l+=2,[t,e.read_shift(2)]}function vpe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=r&&r.biff==2?3:4,[a]}function YM(e){var t=e.read_shift(1),r=e.read_shift(1);return[t,r]}function bpe(e){return e.read_shift(2),YM(e)}function wpe(e){return e.read_shift(2),YM(e)}function jpe(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=KM(e,0,r);return[a,s]}function _pe(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=ope(e,0,r);return[a,s]}function kpe(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=e.read_shift(2);r&&r.biff==5&&(e.l+=12);var i=KM(e,0,r);return[a,s,i]}function Spe(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=e.read_shift(r&&r.biff<=3?1:2);return[Sme[s],QM[s],a]}function Npe(e,t,r){var a=e[e.l++],s=e.read_shift(1),i=r&&r.biff<=3?[a==88?-1:0,e.read_shift(1)]:Cpe(e);return[s,(i[0]===0?QM:kme)[i[1]]]}function Cpe(e){return[e[e.l+1]>>7,e.read_shift(2)&32767]}function Tpe(e,t,r){e.l+=r&&r.biff==2?3:4}function Epe(e,t,r){if(e.l++,r&&r.biff==12)return[e.read_shift(4,"i"),0];var a=e.read_shift(2),s=e.read_shift(r&&r.biff==2?1:2);return[a,s]}function Ape(e){return e.l++,lp[e.read_shift(1)]}function Ope(e){return e.l++,e.read_shift(2)}function Ppe(e){return e.l++,e.read_shift(1)!==0}function Dpe(e){return e.l++,k0(e)}function Rpe(e,t,r){return e.l++,OM(e,t-1,r)}function Fpe(e,t){var r=[e.read_shift(1)];if(t==12)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2;break}switch(r[0]){case 4:r[1]=kfe(e,1)?"TRUE":"FALSE",t!=12&&(e.l+=7);break;case 37:case 16:r[1]=lp[e[e.l]],e.l+=t==12?4:8;break;case 0:e.l+=8;break;case 1:r[1]=k0(e);break;case 2:r[1]=Tfe(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function Mpe(e,t,r){for(var a=e.read_shift(r.biff==12?4:2),s=[],i=0;i!=a;++i)s.push((r.biff==12?bu:Ofe)(e));return s}function Lpe(e,t,r){var a=0,s=0;r.biff==12?(a=e.read_shift(4),s=e.read_shift(4)):(s=1+e.read_shift(1),a=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--a,--s==0&&(s=256));for(var i=0,l=[];i!=a&&(l[i]=[]);++i)for(var u=0;u!=s;++u)l[i][u]=Fpe(e,r.biff);return l}function Ipe(e,t,r){var a=e.read_shift(1)>>>5&3,s=!r||r.biff>=8?4:2,i=e.read_shift(s);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12;break}return[a,0,i]}function zpe(e,t,r){if(r.biff==5)return Bpe(e);var a=e.read_shift(1)>>>5&3,s=e.read_shift(2),i=e.read_shift(4);return[a,s,i]}function Bpe(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var a=e.read_shift(2);return e.l+=12,[t,r,a]}function $pe(e,t,r){var a=e.read_shift(1)>>>5&3;e.l+=r&&r.biff==2?3:4;var s=e.read_shift(r&&r.biff==2?1:2);return[a,s]}function Upe(e,t,r){var a=e.read_shift(1)>>>5&3,s=e.read_shift(r&&r.biff==2?1:2);return[a,s]}function Hpe(e,t,r){var a=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,r.biff==12&&(e.l+=2),[a]}function qpe(e,t,r){var a=(e[e.l++]&96)>>5,s=e.read_shift(2),i=4;if(r)switch(r.biff){case 5:i=15;break;case 12:i=6;break}return e.l+=i,[a,s]}var Wpe=Xi,Vpe=Xi,Gpe=Xi;function cp(e,t,r){return e.l+=2,[ipe(e)]}function gS(e){return e.l+=6,[]}var Kpe=cp,Ype=gS,Xpe=gS,Jpe=cp;function XM(e){return e.l+=2,[EM(e),e.read_shift(2)&1]}var Qpe=cp,Zpe=XM,eme=gS,tme=cp,rme=cp,ame=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function nme(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(4),s=e.read_shift(2),i=e.read_shift(2),l=ame[r>>2&31];return{ixti:t,coltype:r&3,rt:l,idx:a,c:s,C:i}}function sme(e){return e.l+=2,[e.read_shift(4)]}function ime(e,t,r){return e.l+=5,e.l+=2,e.l+=r.biff==2?1:4,["PTGSHEET"]}function ome(e,t,r){return e.l+=r.biff==2?4:5,["PTGENDSHEET"]}function lme(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function cme(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function ume(e){return e.l+=4,[0,0]}var q8={1:{n:"PtgExp",f:Epe},2:{n:"PtgTbl",f:Gpe},3:{n:"PtgAdd",f:sa},4:{n:"PtgSub",f:sa},5:{n:"PtgMul",f:sa},6:{n:"PtgDiv",f:sa},7:{n:"PtgPower",f:sa},8:{n:"PtgConcat",f:sa},9:{n:"PtgLt",f:sa},10:{n:"PtgLe",f:sa},11:{n:"PtgEq",f:sa},12:{n:"PtgGe",f:sa},13:{n:"PtgGt",f:sa},14:{n:"PtgNe",f:sa},15:{n:"PtgIsect",f:sa},16:{n:"PtgUnion",f:sa},17:{n:"PtgRange",f:sa},18:{n:"PtgUplus",f:sa},19:{n:"PtgUminus",f:sa},20:{n:"PtgPercent",f:sa},21:{n:"PtgParen",f:sa},22:{n:"PtgMissArg",f:sa},23:{n:"PtgStr",f:Rpe},26:{n:"PtgSheet",f:ime},27:{n:"PtgEndSheet",f:ome},28:{n:"PtgErr",f:Ape},29:{n:"PtgBool",f:Ppe},30:{n:"PtgInt",f:Ope},31:{n:"PtgNum",f:Dpe},32:{n:"PtgArray",f:ppe},33:{n:"PtgFunc",f:Spe},34:{n:"PtgFuncVar",f:Npe},35:{n:"PtgName",f:Ipe},36:{n:"PtgRef",f:jpe},37:{n:"PtgArea",f:cpe},38:{n:"PtgMemArea",f:$pe},39:{n:"PtgMemErr",f:Wpe},40:{n:"PtgMemNoMem",f:Vpe},41:{n:"PtgMemFunc",f:Upe},42:{n:"PtgRefErr",f:Hpe},43:{n:"PtgAreaErr",f:dpe},44:{n:"PtgRefN",f:_pe},45:{n:"PtgAreaN",f:hpe},46:{n:"PtgMemAreaN",f:lme},47:{n:"PtgMemNoMemN",f:cme},57:{n:"PtgNameX",f:zpe},58:{n:"PtgRef3d",f:kpe},59:{n:"PtgArea3d",f:upe},60:{n:"PtgRefErr3d",f:qpe},61:{n:"PtgAreaErr3d",f:fpe},255:{}},dme={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},fme={1:{n:"PtgElfLel",f:XM},2:{n:"PtgElfRw",f:tme},3:{n:"PtgElfCol",f:Kpe},6:{n:"PtgElfRwV",f:rme},7:{n:"PtgElfColV",f:Jpe},10:{n:"PtgElfRadical",f:Qpe},11:{n:"PtgElfRadicalS",f:eme},13:{n:"PtgElfColS",f:Ype},15:{n:"PtgElfColSV",f:Xpe},16:{n:"PtgElfRadicalLel",f:Zpe},25:{n:"PtgList",f:nme},29:{n:"PtgSxName",f:sme},255:{}},hme={0:{n:"PtgAttrNoop",f:ume},1:{n:"PtgAttrSemi",f:vpe},2:{n:"PtgAttrIf",f:xpe},4:{n:"PtgAttrChoose",f:mpe},8:{n:"PtgAttrGoto",f:gpe},16:{n:"PtgAttrSum",f:Tpe},32:{n:"PtgAttrBaxcel",f:H8},33:{n:"PtgAttrBaxcel",f:H8},64:{n:"PtgAttrSpace",f:bpe},65:{n:"PtgAttrSpaceSemi",f:wpe},128:{n:"PtgAttrIfError",f:ype},255:{}};function pme(e,t,r,a){if(a.biff<8)return Xi(e,t);for(var s=e.l+t,i=[],l=0;l!==r.length;++l)switch(r[l][0]){case"PtgArray":r[l][1]=Lpe(e,0,a),i.push(r[l][1]);break;case"PtgMemArea":r[l][2]=Mpe(e,r[l][1],a),i.push(r[l][2]);break;case"PtgExp":a&&a.biff==12&&(r[l][1][1]=e.read_shift(4),i.push(r[l][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[l][0]}return t=s-e.l,t!==0&&i.push(Xi(e,t)),i}function mme(e,t,r){for(var a=e.l+t,s,i,l=[];a!=e.l;)t=a-e.l,i=e[e.l],s=q8[i]||q8[dme[i]],(i===24||i===25)&&(s=(i===24?fme:hme)[e[e.l+1]]),!s||!s.f?Xi(e,t):l.push([s.n,s.f(e,t,r)]);return l}function gme(e){for(var t=[],r=0;r<e.length;++r){for(var a=e[r],s=[],i=0;i<a.length;++i){var l=a[i];l?l[0]===2?s.push('"'+l[1].replace(/"/g,'""')+'"'):s.push(l[1]):s.push("")}t.push(s.join(","))}return t.join(";")}var xme={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function yme(e,t){if(!e&&!(t&&t.biff<=5&&t.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(e)?"'"+e+"'":e}function JM(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var a=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),t==0?"":e.XTI[t-1];if(!a)return"SH33TJSERR1";var s="";if(r.biff>8)switch(e[a[0]][0]){case 357:return s=a[1]==-1?"#REF":e.SheetNames[a[1]],a[1]==a[2]?s:s+":"+e.SheetNames[a[2]];case 358:return r.SID!=null?e.SheetNames[r.SID]:"SH33TJSSAME"+e[a[0]][0];default:return"SH33TJSSRC"+e[a[0]][0]}switch(e[a[0]][0][0]){case 1025:return s=a[1]==-1?"#REF":e.SheetNames[a[1]]||"SH33TJSERR3",a[1]==a[2]?s:s+":"+e.SheetNames[a[2]];case 14849:return e[a[0]].slice(1).map(function(i){return i.Name}).join(";;");default:return e[a[0]][0][3]?(s=a[1]==-1?"#REF":e[a[0]][0][3][a[1]]||"SH33TJSERR4",a[1]==a[2]?s:s+":"+e[a[0]][0][3][a[2]]):"SH33TJSERR2"}}function W8(e,t,r){var a=JM(e,t,r);return a=="#REF"?a:yme(a,r)}function s0(e,t,r,a,s){var i=s&&s.biff||8,l={s:{c:0,r:0}},u=[],d,f,p,m=0,x=0,v,b="";if(!e[0]||!e[0][0])return"";for(var w=-1,j="",k=0,C=e[0].length;k<C;++k){var N=e[0][k];switch(N[0]){case"PtgUminus":u.push("-"+u.pop());break;case"PtgUplus":u.push("+"+u.pop());break;case"PtgPercent":u.push(u.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(d=u.pop(),f=u.pop(),w>=0){switch(e[0][w][1][0]){case 0:j=Vr(" ",e[0][w][1][1]);break;case 1:j=Vr("\r",e[0][w][1][1]);break;default:if(j="",s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][w][1][0])}f=f+j,w=-1}u.push(f+xme[N[0]]+d);break;case"PtgIsect":d=u.pop(),f=u.pop(),u.push(f+" "+d);break;case"PtgUnion":d=u.pop(),f=u.pop(),u.push(f+","+d);break;case"PtgRange":d=u.pop(),f=u.pop(),u.push(f+":"+d);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":p=Zf(N[1][1],l,s),u.push(eh(p,i));break;case"PtgRefN":p=r?Zf(N[1][1],r,s):N[1][1],u.push(eh(p,i));break;case"PtgRef3d":m=N[1][1],p=Zf(N[1][2],l,s),b=W8(a,m,s),u.push(b+"!"+eh(p,i));break;case"PtgFunc":case"PtgFuncVar":var O=N[1][0],E=N[1][1];O||(O=0),O&=127;var A=O==0?[]:u.slice(-O);u.length-=O,E==="User"&&(E=A.shift()),u.push(E+"("+A.join(",")+")");break;case"PtgBool":u.push(N[1]?"TRUE":"FALSE");break;case"PtgInt":u.push(N[1]);break;case"PtgNum":u.push(String(N[1]));break;case"PtgStr":u.push('"'+N[1].replace(/"/g,'""')+'"');break;case"PtgErr":u.push(N[1]);break;case"PtgAreaN":v=E8(N[1][1],r?{s:r}:l,s),u.push(fw(v,s));break;case"PtgArea":v=E8(N[1][1],l,s),u.push(fw(v,s));break;case"PtgArea3d":m=N[1][1],v=N[1][2],b=W8(a,m,s),u.push(b+"!"+fw(v,s));break;case"PtgAttrSum":u.push("SUM("+u.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":x=N[1][2];var T=(a.names||[])[x-1]||(a[0]||[])[x],P=T?T.Name:"SH33TJSNAME"+String(x);P&&P.slice(0,6)=="_xlfn."&&!s.xlfn&&(P=P.slice(6)),u.push(P);break;case"PtgNameX":var D=N[1][1];x=N[1][2];var z;if(s.biff<=5)D<0&&(D=-D),a[D]&&(z=a[D][x]);else{var G="";if(((a[D]||[])[0]||[])[0]==14849||(((a[D]||[])[0]||[])[0]==1025?a[D][x]&&a[D][x].itab>0&&(G=a.SheetNames[a[D][x].itab-1]+"!"):G=a.SheetNames[x-1]+"!"),a[D]&&a[D][x])G+=a[D][x].Name;else if(a[0]&&a[0][x])G+=a[0][x].Name;else{var V=(JM(a,D,s)||"").split(";;");V[x-1]?G=V[x-1]:G+="SH33TJSERRX"}u.push(G);break}z||(z={Name:"SH33TJSERRY"}),u.push(z.Name);break;case"PtgParen":var ne="(",ge=")";if(w>=0){switch(j="",e[0][w][1][0]){case 2:ne=Vr(" ",e[0][w][1][1])+ne;break;case 3:ne=Vr("\r",e[0][w][1][1])+ne;break;case 4:ge=Vr(" ",e[0][w][1][1])+ge;break;case 5:ge=Vr("\r",e[0][w][1][1])+ge;break;default:if(s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][w][1][0])}w=-1}u.push(ne+u.pop()+ge);break;case"PtgRefErr":u.push("#REF!");break;case"PtgRefErr3d":u.push("#REF!");break;case"PtgExp":p={c:N[1][1],r:N[1][0]};var Z={c:r.c,r:r.r};if(a.sharedf[hr(p)]){var U=a.sharedf[hr(p)];u.push(s0(U,l,Z,a,s))}else{var ce=!1;for(d=0;d!=a.arrayf.length;++d)if(f=a.arrayf[d],!(p.c<f[0].s.c||p.c>f[0].e.c)&&!(p.r<f[0].s.r||p.r>f[0].e.r)){u.push(s0(f[1],l,Z,a,s)),ce=!0;break}ce||u.push(N[1])}break;case"PtgArray":u.push("{"+gme(N[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":w=k;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":u.push("");break;case"PtgAreaErr":u.push("#REF!");break;case"PtgAreaErr3d":u.push("#REF!");break;case"PtgList":u.push("Table"+N[1].idx+"[#"+N[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(N));default:throw new Error("Unrecognized Formula Token: "+String(N))}var xe=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(s.biff!=3&&w>=0&&xe.indexOf(e[0][k][0])==-1){N=e[0][w];var be=!0;switch(N[1][0]){case 4:be=!1;case 0:j=Vr(" ",N[1][1]);break;case 5:be=!1;case 1:j=Vr("\r",N[1][1]);break;default:if(j="",s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+N[1][0])}u.push((be?j:"")+u.pop()+(be?"":j)),w=-1}}if(u.length>1&&s.WTF)throw new Error("bad formula stack");return u[0]}function vme(e){if(e==null){var t=He(8);return t.write_shift(1,3),t.write_shift(1,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,65535),t}else if(typeof e=="number")return ou(e);return ou(0)}function bme(e,t,r,a,s){var i=lu(t,r,s),l=vme(e.v),u=He(6),d=33;u.write_shift(2,d),u.write_shift(4,0);for(var f=He(e.bf.length),p=0;p<e.bf.length;++p)f[p]=e.bf[p];var m=Ga([i,l,u,f]);return m}function Jy(e,t,r){var a=e.read_shift(4),s=mme(e,a,r),i=e.read_shift(4),l=i>0?pme(e,i,s,r):null;return[s,l]}var wme=Jy,Qy=Jy,jme=Jy,_me=Jy,kme={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},QM={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},Sme={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function Nme(e){var t="of:="+e.replace(pS,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return t.replace(/;/g,"|").replace(/,/g,";")}function Cme(e){return e.replace(/\./,"!")}var th=typeof Map!="undefined";function xS(e,t,r){var a=0,s=e.length;if(r){if(th?r.has(t):Object.prototype.hasOwnProperty.call(r,t)){for(var i=th?r.get(t):r[t];a<i.length;++a)if(e[i[a]].t===t)return e.Count++,i[a]}}else for(;a<s;++a)if(e[a].t===t)return e.Count++,a;return e[s]={t},e.Count++,e.Unique++,r&&(th?(r.has(t)||r.set(t,[]),r.get(t).push(s)):(Object.prototype.hasOwnProperty.call(r,t)||(r[t]=[]),r[t].push(s))),s}function Zy(e,t){var r={min:e+1,max:e+1},a=-1;return t.MDW&&(Po=t.MDW),t.width!=null?r.customWidth=1:t.wpx!=null?a=Bx(t.wpx):t.wch!=null&&(a=t.wch),a>-1?(r.width=Vj(a),r.customWidth=1):t.width!=null&&(r.width=t.width),t.hidden&&(r.hidden=!0),t.level!=null&&(r.outlineLevel=r.level=t.level),r}function ZM(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];e.left==null&&(e.left=r[0]),e.right==null&&(e.right=r[1]),e.top==null&&(e.top=r[2]),e.bottom==null&&(e.bottom=r[3]),e.header==null&&(e.header=r[4]),e.footer==null&&(e.footer=r[5])}}function ql(e,t,r){var a=r.revssf[t.z!=null?t.z:"General"],s=60,i=e.length;if(a==null&&r.ssf){for(;s<392;++s)if(r.ssf[s]==null){KF(t.z,s),r.ssf[s]=t.z,r.revssf[t.z]=a=s;break}}for(s=0;s!=i;++s)if(e[s].numFmtId===a)return s;return e[i]={numFmtId:a,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},i}function Tme(e,t,r){if(e&&e["!ref"]){var a=Pr(e["!ref"]);if(a.e.c<a.s.c||a.e.r<a.s.r)throw new Error("Bad range ("+r+"): "+e["!ref"])}}function Eme(e){if(e.length===0)return"";for(var t='<mergeCells count="'+e.length+'">',r=0;r!=e.length;++r)t+='<mergeCell ref="'+ua(e[r])+'"/>';return t+"</mergeCells>"}function Ame(e,t,r,a,s){var i=!1,l={},u=null;if(a.bookType!=="xlsx"&&t.vbaraw){var d=t.SheetNames[r];try{t.Workbook&&(d=t.Workbook.Sheets[r].CodeName||d)}catch(p){}i=!0,l.codeName=Ch(fr(d))}if(e&&e["!outline"]){var f={summaryBelow:1,summaryRight:1};e["!outline"].above&&(f.summaryBelow=0),e["!outline"].left&&(f.summaryRight=0),u=(u||"")+at("outlinePr",null,f)}!i&&!u||(s[s.length]=at("sheetPr",u,l))}var Ome=["objects","scenarios","selectLockedCells","selectUnlockedCells"],Pme=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function Dme(e){var t={sheet:1};return Ome.forEach(function(r){e[r]!=null&&e[r]&&(t[r]="1")}),Pme.forEach(function(r){e[r]!=null&&!e[r]&&(t[r]="0")}),e.password&&(t.password=MM(e.password).toString(16).toUpperCase()),at("sheetProtection",null,t)}function Rme(e){return ZM(e),at("pageMargins",null,e)}function Fme(e,t){for(var r=["<cols>"],a,s=0;s!=t.length;++s)(a=t[s])&&(r[r.length]=at("col",null,Zy(s,a)));return r[r.length]="</cols>",r.join("")}function Mme(e,t,r,a){var s=typeof e.ref=="string"?e.ref:ua(e.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var i=r.Workbook.Names,l=xs(s);l.s.r==l.e.r&&(l.e.r=xs(t["!ref"]).e.r,s=ua(l));for(var u=0;u<i.length;++u){var d=i[u];if(d.Name=="_xlnm._FilterDatabase"&&d.Sheet==a){d.Ref="'"+r.SheetNames[a]+"'!"+s;break}}return u==i.length&&i.push({Name:"_xlnm._FilterDatabase",Sheet:a,Ref:"'"+r.SheetNames[a]+"'!"+s}),at("autoFilter",null,{ref:s})}function Lme(e,t,r,a){var s={workbookViewId:"0"};return(((a||{}).Workbook||{}).Views||[])[0]&&(s.rightToLeft=a.Workbook.Views[0].RTL?"1":"0"),at("sheetViews",at("sheetView",null,s),{})}function Ime(e,t,r,a){if(e.c&&r["!comments"].push([t,e.c]),e.v===void 0&&typeof e.f!="string"||e.t==="z"&&!e.f)return"";var s="",i=e.t,l=e.v;if(e.t!=="z")switch(e.t){case"b":s=e.v?"1":"0";break;case"n":s=""+e.v;break;case"e":s=lp[e.v];break;case"d":a&&a.cellDates?s=kn(e.v,-1).toISOString():(e=Un(e),e.t="n",s=""+(e.v=$n(kn(e.v)))),typeof e.z=="undefined"&&(e.z=Kr[14]);break;default:s=e.v;break}var u=Ka("v",fr(s)),d={r:t},f=ql(a.cellXfs,e,a);switch(f!==0&&(d.s=f),e.t){case"n":break;case"d":d.t="d";break;case"b":d.t="b";break;case"e":d.t="e";break;case"z":break;default:if(e.v==null){delete e.t;break}if(e.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(a&&a.bookSST){u=Ka("v",""+xS(a.Strings,e.v,a.revStrings)),d.t="s";break}d.t="str";break}if(e.t!=i&&(e.t=i,e.v=l),typeof e.f=="string"&&e.f){var p=e.F&&e.F.slice(0,t.length)==t?{t:"array",ref:e.F}:null;u=at("f",fr(e.f),p)+(e.v!=null?u:"")}return e.l&&r["!links"].push([t,e.l]),e.D&&(d.cm=1),at("c",u,d)}function zme(e,t,r,a){var s=[],i=[],l=Pr(e["!ref"]),u="",d,f="",p=[],m=0,x=0,v=e["!rows"],b=Array.isArray(e),w={r:f},j,k=-1;for(x=l.s.c;x<=l.e.c;++x)p[x]=ln(x);for(m=l.s.r;m<=l.e.r;++m){for(i=[],f=Qa(m),x=l.s.c;x<=l.e.c;++x){d=p[x]+f;var C=b?(e[m]||[])[x]:e[d];C!==void 0&&(u=Ime(C,d,e,t))!=null&&i.push(u)}(i.length>0||v&&v[m])&&(w={r:f},v&&v[m]&&(j=v[m],j.hidden&&(w.hidden=1),k=-1,j.hpx?k=$x(j.hpx):j.hpt&&(k=j.hpt),k>-1&&(w.ht=k,w.customHeight=1),j.level&&(w.outlineLevel=j.level)),s[s.length]=at("row",i.join(""),w))}if(v)for(;m<v.length;++m)v&&v[m]&&(w={r:m+1},j=v[m],j.hidden&&(w.hidden=1),k=-1,j.hpx?k=$x(j.hpx):j.hpt&&(k=j.hpt),k>-1&&(w.ht=k,w.customHeight=1),j.level&&(w.outlineLevel=j.level),s[s.length]=at("row","",w));return s.join("")}function eL(e,t,r,a){var s=[pa,at("worksheet",null,{xmlns:w0[0],"xmlns:r":Aa.r})],i=r.SheetNames[e],l=0,u="",d=r.Sheets[i];d==null&&(d={});var f=d["!ref"]||"A1",p=Pr(f);if(p.e.c>16383||p.e.r>1048575){if(t.WTF)throw new Error("Range "+f+" exceeds format limit A1:XFD1048576");p.e.c=Math.min(p.e.c,16383),p.e.r=Math.min(p.e.c,1048575),f=ua(p)}a||(a={}),d["!comments"]=[];var m=[];Ame(d,r,e,t,s),s[s.length]=at("dimension",null,{ref:f}),s[s.length]=Lme(d,t,e,r),t.sheetFormat&&(s[s.length]=at("sheetFormatPr",null,{defaultRowHeight:t.sheetFormat.defaultRowHeight||"16",baseColWidth:t.sheetFormat.baseColWidth||"10",outlineLevelRow:t.sheetFormat.outlineLevelRow||"7"})),d["!cols"]!=null&&d["!cols"].length>0&&(s[s.length]=Fme(d,d["!cols"])),s[l=s.length]="<sheetData/>",d["!links"]=[],d["!ref"]!=null&&(u=zme(d,t),u.length>0&&(s[s.length]=u)),s.length>l+1&&(s[s.length]="</sheetData>",s[l]=s[l].replace("/>",">")),d["!protect"]&&(s[s.length]=Dme(d["!protect"])),d["!autofilter"]!=null&&(s[s.length]=Mme(d["!autofilter"],d,r,e)),d["!merges"]!=null&&d["!merges"].length>0&&(s[s.length]=Eme(d["!merges"]));var x=-1,v,b=-1;return d["!links"].length>0&&(s[s.length]="<hyperlinks>",d["!links"].forEach(function(w){w[1].Target&&(v={ref:w[0]},w[1].Target.charAt(0)!="#"&&(b=dr(a,-1,fr(w[1].Target).replace(/#.*$/,""),Qt.HLINK),v["r:id"]="rId"+b),(x=w[1].Target.indexOf("#"))>-1&&(v.location=fr(w[1].Target.slice(x+1))),w[1].Tooltip&&(v.tooltip=fr(w[1].Tooltip)),s[s.length]=at("hyperlink",null,v))}),s[s.length]="</hyperlinks>"),delete d["!links"],d["!margins"]!=null&&(s[s.length]=Rme(d["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&(s[s.length]=Ka("ignoredErrors",at("ignoredError",null,{numberStoredAsText:1,sqref:f}))),m.length>0&&(b=dr(a,-1,"../drawings/drawing"+(e+1)+".xml",Qt.DRAW),s[s.length]=at("drawing",null,{"r:id":"rId"+b}),d["!drawing"]=m),d["!comments"].length>0&&(b=dr(a,-1,"../drawings/vmlDrawing"+(e+1)+".vml",Qt.VML),s[s.length]=at("legacyDrawing",null,{"r:id":"rId"+b}),d["!legacy"]=b),s.length>1&&(s[s.length]="</worksheet>",s[1]=s[1].replace("/>",">")),s.join("")}function Bme(e,t){var r={},a=e.l+t;r.r=e.read_shift(4),e.l+=4;var s=e.read_shift(2);e.l+=1;var i=e.read_shift(1);return e.l=a,i&7&&(r.level=i&7),i&16&&(r.hidden=!0),i&32&&(r.hpt=s/20),r}function $me(e,t,r){var a=He(145),s=(r["!rows"]||[])[e]||{};a.write_shift(4,e),a.write_shift(4,0);var i=320;s.hpx?i=$x(s.hpx)*20:s.hpt&&(i=s.hpt*20),a.write_shift(2,i),a.write_shift(1,0);var l=0;s.level&&(l|=s.level),s.hidden&&(l|=16),(s.hpx||s.hpt)&&(l|=32),a.write_shift(1,l),a.write_shift(1,0);var u=0,d=a.l;a.l+=4;for(var f={r:e,c:0},p=0;p<16;++p)if(!(t.s.c>p+1<<10||t.e.c<p<<10)){for(var m=-1,x=-1,v=p<<10;v<p+1<<10;++v){f.c=v;var b=Array.isArray(r)?(r[f.r]||[])[f.c]:r[hr(f)];b&&(m<0&&(m=v),x=v)}m<0||(++u,a.write_shift(4,m),a.write_shift(4,x))}var w=a.l;return a.l=d,a.write_shift(4,u),a.l=w,a.length>a.l?a.slice(0,a.l):a}function Ume(e,t,r,a){var s=$me(a,r,t);(s.length>17||(t["!rows"]||[])[a])&&Ke(e,0,s)}var Hme=bu,qme=_0;function Wme(){}function Vme(e,t){var r={},a=e[e.l];return++e.l,r.above=!(a&64),r.left=!(a&128),e.l+=18,r.name=rfe(e),r}function Gme(e,t,r){r==null&&(r=He(84+4*e.length));var a=192;t&&(t.above&&(a&=-65),t.left&&(a&=-129)),r.write_shift(1,a);for(var s=1;s<3;++s)r.write_shift(1,0);return Lx({auto:1},r),r.write_shift(-4,-1),r.write_shift(-4,-1),mM(e,r),r.slice(0,r.l)}function Kme(e){var t=Xs(e);return[t]}function Yme(e,t,r){return r==null&&(r=He(8)),xu(t,r)}function Xme(e){var t=yu(e);return[t]}function Jme(e,t,r){return r==null&&(r=He(4)),vu(t,r)}function Qme(e){var t=Xs(e),r=e.read_shift(1);return[t,r,"b"]}function Zme(e,t,r){return r==null&&(r=He(9)),xu(t,r),r.write_shift(1,e.v?1:0),r}function ege(e){var t=yu(e),r=e.read_shift(1);return[t,r,"b"]}function tge(e,t,r){return r==null&&(r=He(5)),vu(t,r),r.write_shift(1,e.v?1:0),r}function rge(e){var t=Xs(e),r=e.read_shift(1);return[t,r,"e"]}function age(e,t,r){return r==null&&(r=He(9)),xu(t,r),r.write_shift(1,e.v),r}function nge(e){var t=yu(e),r=e.read_shift(1);return[t,r,"e"]}function sge(e,t,r){return r==null&&(r=He(8)),vu(t,r),r.write_shift(1,e.v),r.write_shift(2,0),r.write_shift(1,0),r}function ige(e){var t=Xs(e),r=e.read_shift(4);return[t,r,"s"]}function oge(e,t,r){return r==null&&(r=He(12)),xu(t,r),r.write_shift(4,t.v),r}function lge(e){var t=yu(e),r=e.read_shift(4);return[t,r,"s"]}function cge(e,t,r){return r==null&&(r=He(8)),vu(t,r),r.write_shift(4,t.v),r}function uge(e){var t=Xs(e),r=k0(e);return[t,r,"n"]}function dge(e,t,r){return r==null&&(r=He(16)),xu(t,r),ou(e.v,r),r}function fge(e){var t=yu(e),r=k0(e);return[t,r,"n"]}function hge(e,t,r){return r==null&&(r=He(12)),vu(t,r),ou(e.v,r),r}function pge(e){var t=Xs(e),r=gM(e);return[t,r,"n"]}function mge(e,t,r){return r==null&&(r=He(12)),xu(t,r),xM(e.v,r),r}function gge(e){var t=yu(e),r=gM(e);return[t,r,"n"]}function xge(e,t,r){return r==null&&(r=He(8)),vu(t,r),xM(e.v,r),r}function yge(e){var t=Xs(e),r=cS(e);return[t,r,"is"]}function vge(e){var t=Xs(e),r=cn(e);return[t,r,"str"]}function bge(e,t,r){return r==null&&(r=He(12+4*e.v.length)),xu(t,r),Da(e.v,r),r.length>r.l?r.slice(0,r.l):r}function wge(e){var t=yu(e),r=cn(e);return[t,r,"str"]}function jge(e,t,r){return r==null&&(r=He(8+4*e.v.length)),vu(t,r),Da(e.v,r),r.length>r.l?r.slice(0,r.l):r}function _ge(e,t,r){var a=e.l+t,s=Xs(e);s.r=r["!row"];var i=e.read_shift(1),l=[s,i,"b"];if(r.cellFormula){e.l+=2;var u=Qy(e,a-e.l,r);l[3]=s0(u,null,s,r.supbooks,r)}else e.l=a;return l}function kge(e,t,r){var a=e.l+t,s=Xs(e);s.r=r["!row"];var i=e.read_shift(1),l=[s,i,"e"];if(r.cellFormula){e.l+=2;var u=Qy(e,a-e.l,r);l[3]=s0(u,null,s,r.supbooks,r)}else e.l=a;return l}function Sge(e,t,r){var a=e.l+t,s=Xs(e);s.r=r["!row"];var i=k0(e),l=[s,i,"n"];if(r.cellFormula){e.l+=2;var u=Qy(e,a-e.l,r);l[3]=s0(u,null,s,r.supbooks,r)}else e.l=a;return l}function Nge(e,t,r){var a=e.l+t,s=Xs(e);s.r=r["!row"];var i=cn(e),l=[s,i,"str"];if(r.cellFormula){e.l+=2;var u=Qy(e,a-e.l,r);l[3]=s0(u,null,s,r.supbooks,r)}else e.l=a;return l}var Cge=bu,Tge=_0;function Ege(e,t){return t==null&&(t=He(4)),t.write_shift(4,e),t}function Age(e,t){var r=e.l+t,a=bu(e),s=uS(e),i=cn(e),l=cn(e),u=cn(e);e.l=r;var d={rfx:a,relId:s,loc:i,display:u};return l&&(d.Tooltip=l),d}function Oge(e,t){var r=He(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));_0({s:Pa(e[0]),e:Pa(e[0])},r),dS("rId"+t,r);var a=e[1].Target.indexOf("#"),s=a==-1?"":e[1].Target.slice(a+1);return Da(s||"",r),Da(e[1].Tooltip||"",r),Da("",r),r.slice(0,r.l)}function Pge(){}function Dge(e,t,r){var a=e.l+t,s=yM(e),i=e.read_shift(1),l=[s];if(l[2]=i,r.cellFormula){var u=wme(e,a-e.l,r);l[1]=u}else e.l=a;return l}function Rge(e,t,r){var a=e.l+t,s=bu(e),i=[s];if(r.cellFormula){var l=_me(e,a-e.l,r);i[1]=l,e.l=a}else e.l=a;return i}function Fge(e,t,r){r==null&&(r=He(18));var a=Zy(e,t);r.write_shift(-4,e),r.write_shift(-4,e),r.write_shift(4,(a.width||10)*256),r.write_shift(4,0);var s=0;return t.hidden&&(s|=1),typeof a.width=="number"&&(s|=2),t.level&&(s|=t.level<<8),r.write_shift(2,s),r}var tL=["left","right","top","bottom","header","footer"];function Mge(e){var t={};return tL.forEach(function(r){t[r]=k0(e)}),t}function Lge(e,t){return t==null&&(t=He(48)),ZM(e),tL.forEach(function(r){ou(e[r],t)}),t}function Ige(e){var t=e.read_shift(2);return e.l+=28,{RTL:t&32}}function zge(e,t,r){r==null&&(r=He(30));var a=924;return(((t||{}).Views||[])[0]||{}).RTL&&(a|=32),r.write_shift(2,a),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(2,0),r.write_shift(2,100),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(4,0),r}function Bge(e){var t=He(24);return t.write_shift(4,4),t.write_shift(4,1),_0(e,t),t}function $ge(e,t){return t==null&&(t=He(66)),t.write_shift(2,e.password?MM(e.password):0),t.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach(function(r){r[1]?t.write_shift(4,e[r[0]]!=null&&!e[r[0]]?1:0):t.write_shift(4,e[r[0]]!=null&&e[r[0]]?0:1)}),t}function Uge(){}function Hge(){}function qge(e,t,r,a,s,i,l){if(t.v===void 0)return!1;var u="";switch(t.t){case"b":u=t.v?"1":"0";break;case"d":t=Un(t),t.z=t.z||Kr[14],t.v=$n(kn(t.v)),t.t="n";break;case"n":case"e":u=""+t.v;break;default:u=t.v;break}var d={r,c:a};switch(d.s=ql(s.cellXfs,t,s),t.l&&i["!links"].push([hr(d),t.l]),t.c&&i["!comments"].push([hr(d),t.c]),t.t){case"s":case"str":return s.bookSST?(u=xS(s.Strings,t.v,s.revStrings),d.t="s",d.v=u,l?Ke(e,18,cge(t,d)):Ke(e,7,oge(t,d))):(d.t="str",l?Ke(e,17,jge(t,d)):Ke(e,6,bge(t,d))),!0;case"n":return t.v==(t.v|0)&&t.v>-1e3&&t.v<1e3?l?Ke(e,13,xge(t,d)):Ke(e,2,mge(t,d)):l?Ke(e,16,hge(t,d)):Ke(e,5,dge(t,d)),!0;case"b":return d.t="b",l?Ke(e,15,tge(t,d)):Ke(e,4,Zme(t,d)),!0;case"e":return d.t="e",l?Ke(e,14,sge(t,d)):Ke(e,3,age(t,d)),!0}return l?Ke(e,12,Jme(t,d)):Ke(e,1,Yme(t,d)),!0}function Wge(e,t,r,a){var s=Pr(t["!ref"]||"A1"),i,l="",u=[];Ke(e,145);var d=Array.isArray(t),f=s.e.r;t["!rows"]&&(f=Math.max(s.e.r,t["!rows"].length-1));for(var p=s.s.r;p<=f;++p){l=Qa(p),Ume(e,t,s,p);var m=!1;if(p<=s.e.r)for(var x=s.s.c;x<=s.e.c;++x){p===s.s.r&&(u[x]=ln(x)),i=u[x]+l;var v=d?(t[p]||[])[x]:t[i];if(!v){m=!1;continue}m=qge(e,v,p,x,a,t,m)}}Ke(e,146)}function Vge(e,t){!t||!t["!merges"]||(Ke(e,177,Ege(t["!merges"].length)),t["!merges"].forEach(function(r){Ke(e,176,Tge(r))}),Ke(e,178))}function Gge(e,t){!t||!t["!cols"]||(Ke(e,390),t["!cols"].forEach(function(r,a){r&&Ke(e,60,Fge(a,r))}),Ke(e,391))}function Kge(e,t){!t||!t["!ref"]||(Ke(e,648),Ke(e,649,Bge(Pr(t["!ref"]))),Ke(e,650))}function Yge(e,t,r){t["!links"].forEach(function(a){if(a[1].Target){var s=dr(r,-1,a[1].Target.replace(/#.*$/,""),Qt.HLINK);Ke(e,494,Oge(a,s))}}),delete t["!links"]}function Xge(e,t,r,a){if(t["!comments"].length>0){var s=dr(a,-1,"../drawings/vmlDrawing"+(r+1)+".vml",Qt.VML);Ke(e,551,dS("rId"+s)),t["!legacy"]=s}}function Jge(e,t,r,a){if(t["!autofilter"]){var s=t["!autofilter"],i=typeof s.ref=="string"?s.ref:ua(s.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var l=r.Workbook.Names,u=xs(i);u.s.r==u.e.r&&(u.e.r=xs(t["!ref"]).e.r,i=ua(u));for(var d=0;d<l.length;++d){var f=l[d];if(f.Name=="_xlnm._FilterDatabase"&&f.Sheet==a){f.Ref="'"+r.SheetNames[a]+"'!"+i;break}}d==l.length&&l.push({Name:"_xlnm._FilterDatabase",Sheet:a,Ref:"'"+r.SheetNames[a]+"'!"+i}),Ke(e,161,_0(Pr(i))),Ke(e,162)}}function Qge(e,t,r){Ke(e,133),Ke(e,137,zge(t,r)),Ke(e,138),Ke(e,134)}function Zge(e,t){t["!protect"]&&Ke(e,535,$ge(t["!protect"]))}function exe(e,t,r,a){var s=Bn(),i=r.SheetNames[e],l=r.Sheets[i]||{},u=i;try{r&&r.Workbook&&(u=r.Workbook.Sheets[e].CodeName||u)}catch(f){}var d=Pr(l["!ref"]||"A1");if(d.e.c>16383||d.e.r>1048575){if(t.WTF)throw new Error("Range "+(l["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");d.e.c=Math.min(d.e.c,16383),d.e.r=Math.min(d.e.c,1048575)}return l["!links"]=[],l["!comments"]=[],Ke(s,129),(r.vbaraw||l["!outline"])&&Ke(s,147,Gme(u,l["!outline"])),Ke(s,148,qme(d)),Qge(s,l,r.Workbook),Gge(s,l),Wge(s,l,e,t),Zge(s,l),Jge(s,l,r,e),Vge(s,l),Yge(s,l,a),l["!margins"]&&Ke(s,476,Lge(l["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&Kge(s,l),Xge(s,l,e,a),Ke(s,130),s.end()}function txe(e,t){e.l+=10;var r=cn(e);return{name:r}}var rxe=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]];function axe(e){return!e.Workbook||!e.Workbook.WBProps?"false":R0e(e.Workbook.WBProps.date1904)?"true":"false"}var nxe="][*?/\\".split("");function rL(e,t){if(e.length>31)throw new Error("Sheet names cannot exceed 31 chars");var r=!0;return nxe.forEach(function(a){if(e.indexOf(a)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),r}function sxe(e,t,r){e.forEach(function(a,s){rL(a);for(var i=0;i<s;++i)if(a==e[i])throw new Error("Duplicate Sheet Name: "+a);if(r){var l=t&&t[s]&&t[s].CodeName||a;if(l.charCodeAt(0)==95&&l.length>22)throw new Error("Bad Code Name: Worksheet"+l)}})}function ixe(e){if(!e||!e.SheetNames||!e.Sheets)throw new Error("Invalid Workbook");if(!e.SheetNames.length)throw new Error("Workbook is empty");var t=e.Workbook&&e.Workbook.Sheets||[];sxe(e.SheetNames,t,!!e.vbaraw);for(var r=0;r<e.SheetNames.length;++r)Tme(e.Sheets[e.SheetNames[r]],e.SheetNames[r],r)}function aL(e){var t=[pa];t[t.length]=at("workbook",null,{xmlns:w0[0],"xmlns:r":Aa.r});var r=e.Workbook&&(e.Workbook.Names||[]).length>0,a={codeName:"ThisWorkbook"};e.Workbook&&e.Workbook.WBProps&&(rxe.forEach(function(u){e.Workbook.WBProps[u[0]]!=null&&e.Workbook.WBProps[u[0]]!=u[1]&&(a[u[0]]=e.Workbook.WBProps[u[0]])}),e.Workbook.WBProps.CodeName&&(a.codeName=e.Workbook.WBProps.CodeName,delete a.CodeName)),t[t.length]=at("workbookPr",null,a);var s=e.Workbook&&e.Workbook.Sheets||[],i=0;if(s&&s[0]&&s[0].Hidden){for(t[t.length]="<bookViews>",i=0;i!=e.SheetNames.length&&!(!s[i]||!s[i].Hidden);++i);i==e.SheetNames.length&&(i=0),t[t.length]='<workbookView firstSheet="'+i+'" activeTab="'+i+'"/>',t[t.length]="</bookViews>"}for(t[t.length]="<sheets>",i=0;i!=e.SheetNames.length;++i){var l={name:fr(e.SheetNames[i].slice(0,31))};if(l.sheetId=""+(i+1),l["r:id"]="rId"+(i+1),s[i])switch(s[i].Hidden){case 1:l.state="hidden";break;case 2:l.state="veryHidden";break}t[t.length]=at("sheet",null,l)}return t[t.length]="</sheets>",r&&(t[t.length]="<definedNames>",e.Workbook&&e.Workbook.Names&&e.Workbook.Names.forEach(function(u){var d={name:u.Name};u.Comment&&(d.comment=u.Comment),u.Sheet!=null&&(d.localSheetId=""+u.Sheet),u.Hidden&&(d.hidden="1"),u.Ref&&(t[t.length]=at("definedName",fr(u.Ref),d))}),t[t.length]="</definedNames>"),t.length>2&&(t[t.length]="</workbook>",t[1]=t[1].replace("/>",">")),t.join("")}function oxe(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=Wj(e),r.name=cn(e),r}function lxe(e,t){return t||(t=He(127)),t.write_shift(4,e.Hidden),t.write_shift(4,e.iTabID),dS(e.strRelID,t),Da(e.name.slice(0,31),t),t.length>t.l?t.slice(0,t.l):t}function cxe(e,t){var r={},a=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var s=t>8?cn(e):"";return s.length>0&&(r.CodeName=s),r.autoCompressPictures=!!(a&65536),r.backupFile=!!(a&64),r.checkCompatibility=!!(a&4096),r.date1904=!!(a&1),r.filterPrivacy=!!(a&8),r.hidePivotFieldList=!!(a&1024),r.promptedSolutions=!!(a&16),r.publishItems=!!(a&2048),r.refreshAllConnections=!!(a&262144),r.saveExternalLinkValues=!!(a&128),r.showBorderUnselectedTables=!!(a&4),r.showInkAnnotation=!!(a&32),r.showObjects=["all","placeholders","none"][a>>13&3],r.showPivotChartFilter=!!(a&32768),r.updateLinks=["userSet","never","always"][a>>8&3],r}function uxe(e,t){t||(t=He(72));var r=0;return e&&e.filterPrivacy&&(r|=8),t.write_shift(4,r),t.write_shift(4,0),mM(e&&e.CodeName||"ThisWorkbook",t),t.slice(0,t.l)}function dxe(e,t,r){var a=e.l+t;e.l+=4,e.l+=1;var s=e.read_shift(4),i=afe(e),l=jme(e,0,r),u=uS(e);e.l=a;var d={Name:i,Ptg:l};return s<268435455&&(d.Sheet=s),u&&(d.Comment=u),d}function fxe(e,t){Ke(e,143);for(var r=0;r!=t.SheetNames.length;++r){var a=t.Workbook&&t.Workbook.Sheets&&t.Workbook.Sheets[r]&&t.Workbook.Sheets[r].Hidden||0,s={Hidden:a,iTabID:r+1,strRelID:"rId"+(r+1),name:t.SheetNames[r]};Ke(e,156,lxe(s))}Ke(e,144)}function hxe(e,t){t||(t=He(127));for(var r=0;r!=4;++r)t.write_shift(4,0);return Da("SheetJS",t),Da(Ex.version,t),Da(Ex.version,t),Da("7262",t),t.length>t.l?t.slice(0,t.l):t}function pxe(e,t){t||(t=He(29)),t.write_shift(-4,0),t.write_shift(-4,460),t.write_shift(4,28800),t.write_shift(4,17600),t.write_shift(4,500),t.write_shift(4,e),t.write_shift(4,e);var r=120;return t.write_shift(1,r),t.length>t.l?t.slice(0,t.l):t}function mxe(e,t){if(!(!t.Workbook||!t.Workbook.Sheets)){for(var r=t.Workbook.Sheets,a=0,s=-1,i=-1;a<r.length;++a)!r[a]||!r[a].Hidden&&s==-1?s=a:r[a].Hidden==1&&i==-1&&(i=a);i>s||(Ke(e,135),Ke(e,158,pxe(s)),Ke(e,136))}}function gxe(e,t){var r=Bn();return Ke(r,131),Ke(r,128,hxe()),Ke(r,153,uxe(e.Workbook&&e.Workbook.WBProps||null)),mxe(r,e),fxe(r,e),Ke(r,132),r.end()}function xxe(e,t,r){return(t.slice(-4)===".bin"?gxe:aL)(e)}function yxe(e,t,r,a,s){return(t.slice(-4)===".bin"?exe:eL)(e,r,a,s)}function vxe(e,t,r){return(t.slice(-4)===".bin"?Lhe:zM)(e,r)}function bxe(e,t,r){return(t.slice(-4)===".bin"?uhe:FM)(e,r)}function wxe(e,t,r){return(t.slice(-4)===".bin"?Zhe:qM)(e)}function jxe(e){return(e.slice(-4)===".bin"?Whe:UM)()}function _xe(e,t){var r=[];return e.Props&&r.push(vfe(e.Props,t)),e.Custprops&&r.push(bfe(e.Props,e.Custprops)),r.join("")}function kxe(){return""}function Sxe(e,t){var r=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return t.cellXfs.forEach(function(a,s){var i=[];i.push(at("NumberFormat",null,{"ss:Format":fr(Kr[a.numFmtId])}));var l={"ss:ID":"s"+(21+s)};r.push(at("Style",i.join(""),l))}),at("Styles",r.join(""))}function nL(e){return at("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+mS(e.Ref,{r:0,c:0})})}function Nxe(e){if(!((e||{}).Workbook||{}).Names)return"";for(var t=e.Workbook.Names,r=[],a=0;a<t.length;++a){var s=t[a];s.Sheet==null&&(s.Name.match(/^_xlfn\./)||r.push(nL(s)))}return at("Names",r.join(""))}function Cxe(e,t,r,a){if(!e||!((a||{}).Workbook||{}).Names)return"";for(var s=a.Workbook.Names,i=[],l=0;l<s.length;++l){var u=s[l];u.Sheet==r&&(u.Name.match(/^_xlfn\./)||i.push(nL(u)))}return i.join("")}function Txe(e,t,r,a){if(!e)return"";var s=[];if(e["!margins"]&&(s.push("<PageSetup>"),e["!margins"].header&&s.push(at("Header",null,{"x:Margin":e["!margins"].header})),e["!margins"].footer&&s.push(at("Footer",null,{"x:Margin":e["!margins"].footer})),s.push(at("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"})),s.push("</PageSetup>")),a&&a.Workbook&&a.Workbook.Sheets&&a.Workbook.Sheets[r])if(a.Workbook.Sheets[r].Hidden)s.push(at("Visible",a.Workbook.Sheets[r].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var i=0;i<r&&!(a.Workbook.Sheets[i]&&!a.Workbook.Sheets[i].Hidden);++i);i==r&&s.push("<Selected/>")}return((((a||{}).Workbook||{}).Views||[])[0]||{}).RTL&&s.push("<DisplayRightToLeft/>"),e["!protect"]&&(s.push(Ka("ProtectContents","True")),e["!protect"].objects&&s.push(Ka("ProtectObjects","True")),e["!protect"].scenarios&&s.push(Ka("ProtectScenarios","True")),e["!protect"].selectLockedCells!=null&&!e["!protect"].selectLockedCells?s.push(Ka("EnableSelection","NoSelection")):e["!protect"].selectUnlockedCells!=null&&!e["!protect"].selectUnlockedCells&&s.push(Ka("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(l){e["!protect"][l[0]]&&s.push("<"+l[1]+"/>")})),s.length==0?"":at("WorksheetOptions",s.join(""),{xmlns:os.x})}function Exe(e){return e.map(function(t){var r=D0e(t.t||""),a=at("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return at("Comment",a,{"ss:Author":t.a})}).join("")}function Axe(e,t,r,a,s,i,l){if(!e||e.v==null&&e.f==null)return"";var u={};if(e.f&&(u["ss:Formula"]="="+fr(mS(e.f,l))),e.F&&e.F.slice(0,t.length)==t){var d=Pa(e.F.slice(t.length+1));u["ss:ArrayRange"]="RC:R"+(d.r==l.r?"":"["+(d.r-l.r)+"]")+"C"+(d.c==l.c?"":"["+(d.c-l.c)+"]")}if(e.l&&e.l.Target&&(u["ss:HRef"]=fr(e.l.Target),e.l.Tooltip&&(u["x:HRefScreenTip"]=fr(e.l.Tooltip))),r["!merges"])for(var f=r["!merges"],p=0;p!=f.length;++p)f[p].s.c!=l.c||f[p].s.r!=l.r||(f[p].e.c>f[p].s.c&&(u["ss:MergeAcross"]=f[p].e.c-f[p].s.c),f[p].e.r>f[p].s.r&&(u["ss:MergeDown"]=f[p].e.r-f[p].s.r));var m="",x="";switch(e.t){case"z":if(!a.sheetStubs)return"";break;case"n":m="Number",x=String(e.v);break;case"b":m="Boolean",x=e.v?"1":"0";break;case"e":m="Error",x=lp[e.v];break;case"d":m="DateTime",x=new Date(e.v).toISOString(),e.z==null&&(e.z=e.z||Kr[14]);break;case"s":m="String",x=P0e(e.v||"");break}var v=ql(a.cellXfs,e,a);u["ss:StyleID"]="s"+(21+v),u["ss:Index"]=l.c+1;var b=e.v!=null?x:"",w=e.t=="z"?"":'<Data ss:Type="'+m+'">'+b+"</Data>";return(e.c||[]).length>0&&(w+=Exe(e.c)),at("Cell",w,u)}function Oxe(e,t){var r='<Row ss:Index="'+(e+1)+'"';return t&&(t.hpt&&!t.hpx&&(t.hpx=IM(t.hpt)),t.hpx&&(r+=' ss:AutoFitHeight="0" ss:Height="'+t.hpx+'"'),t.hidden&&(r+=' ss:Hidden="1"')),r+">"}function Pxe(e,t,r,a){if(!e["!ref"])return"";var s=Pr(e["!ref"]),i=e["!merges"]||[],l=0,u=[];e["!cols"]&&e["!cols"].forEach(function(j,k){hS(j);var C=!!j.width,N=Zy(k,j),O={"ss:Index":k+1};C&&(O["ss:Width"]=zx(N.width)),j.hidden&&(O["ss:Hidden"]="1"),u.push(at("Column",null,O))});for(var d=Array.isArray(e),f=s.s.r;f<=s.e.r;++f){for(var p=[Oxe(f,(e["!rows"]||[])[f])],m=s.s.c;m<=s.e.c;++m){var x=!1;for(l=0;l!=i.length;++l)if(!(i[l].s.c>m)&&!(i[l].s.r>f)&&!(i[l].e.c<m)&&!(i[l].e.r<f)){(i[l].s.c!=m||i[l].s.r!=f)&&(x=!0);break}if(!x){var v={r:f,c:m},b=hr(v),w=d?(e[f]||[])[m]:e[b];p.push(Axe(w,b,e,t,r,a,v))}}p.push("</Row>"),p.length>2&&u.push(p.join(""))}return u.join("")}function Dxe(e,t,r){var a=[],s=r.SheetNames[e],i=r.Sheets[s],l=i?Cxe(i,t,e,r):"";return l.length>0&&a.push("<Names>"+l+"</Names>"),l=i?Pxe(i,t,e,r):"",l.length>0&&a.push("<Table>"+l+"</Table>"),a.push(Txe(i,t,e,r)),a.join("")}function Rxe(e,t){t||(t={}),e.SSF||(e.SSF=Un(Kr)),e.SSF&&(Ky(),Gy(e.SSF),t.revssf=Yy(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF,t.cellXfs=[],ql(t.cellXfs,{},{revssf:{General:0}}));var r=[];r.push(_xe(e,t)),r.push(kxe()),r.push(""),r.push("");for(var a=0;a<e.SheetNames.length;++a)r.push(at("Worksheet",Dxe(a,t,e),{"ss:Name":fr(e.SheetNames[a])}));return r[2]=Sxe(e,t),r[3]=Nxe(e),pa+at("Workbook",r.join(""),{xmlns:os.ss,"xmlns:o":os.o,"xmlns:x":os.x,"xmlns:ss":os.ss,"xmlns:dt":os.dt,"xmlns:html":os.html})}var mw={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function Fxe(e,t){var r=[],a=[],s=[],i=0,l,u=y8(O8,"n"),d=y8(P8,"n");if(e.Props)for(l=tn(e.Props),i=0;i<l.length;++i)(Object.prototype.hasOwnProperty.call(u,l[i])?r:Object.prototype.hasOwnProperty.call(d,l[i])?a:s).push([l[i],e.Props[l[i]]]);if(e.Custprops)for(l=tn(e.Custprops),i=0;i<l.length;++i)Object.prototype.hasOwnProperty.call(e.Props||{},l[i])||(Object.prototype.hasOwnProperty.call(u,l[i])?r:Object.prototype.hasOwnProperty.call(d,l[i])?a:s).push([l[i],e.Custprops[l[i]]]);var f=[];for(i=0;i<s.length;++i)TM.indexOf(s[i][0])>-1||SM.indexOf(s[i][0])>-1||s[i][1]!=null&&f.push(s[i]);a.length&&br.utils.cfb_add(t,"/SummaryInformation",L8(a,mw.SI,d,P8)),(r.length||f.length)&&br.utils.cfb_add(t,"/DocumentSummaryInformation",L8(r,mw.DSI,u,O8,f.length?f:null,mw.UDI))}function Mxe(e,t){var r=t||{},a=br.utils.cfb_new({root:"R"}),s="/Workbook";switch(r.bookType||"xls"){case"xls":r.bookType="biff8";case"xla":r.bookType||(r.bookType="xla");case"biff8":s="/Workbook",r.biff=8;break;case"biff5":s="/Book",r.biff=5;break;default:throw new Error("invalid type "+r.bookType+" for XLS CFB")}return br.utils.cfb_add(a,s,sL(e,r)),r.biff==8&&(e.Props||e.Custprops)&&Fxe(e,a),r.biff==8&&e.vbaraw&&epe(a,br.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"})),a}var Lxe={0:{f:Bme},1:{f:Kme},2:{f:pge},3:{f:rge},4:{f:Qme},5:{f:uge},6:{f:vge},7:{f:ige},8:{f:Nge},9:{f:Sge},10:{f:_ge},11:{f:kge},12:{f:Xme},13:{f:gge},14:{f:nge},15:{f:ege},16:{f:fge},17:{f:wge},18:{f:lge},19:{f:cS},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:dxe},40:{},42:{},43:{f:vhe},44:{f:xhe},45:{f:jhe},46:{f:khe},47:{f:_he},48:{},49:{f:X0e},50:{},51:{f:Bhe},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:Jfe},62:{f:yge},63:{f:Vhe},64:{f:Uge},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Xi,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:Ige},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:Vme},148:{f:Hme,p:16},151:{f:Pge},152:{},153:{f:cxe},154:{},155:{},156:{f:oxe},157:{},158:{},159:{T:1,f:ohe},160:{T:-1},161:{T:1,f:bu},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:Cge},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:Ihe},336:{T:-1},337:{f:Hhe,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:Wj},357:{},358:{},359:{},360:{T:1},361:{},362:{f:Wfe},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:Dge},427:{f:Rge},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:Mge},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:Wme},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:Age},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:Wj},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:Jhe},633:{T:1},634:{T:-1},635:{T:1,f:Yhe},636:{T:-1},637:{f:efe},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:txe},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:Hge},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};function nt(e,t,r,a){var s=t;if(!isNaN(s)){var i=a||(r||[]).length||0,l=e.next(4);l.write_shift(2,s),l.write_shift(2,i),i>0&&iS(r)&&e.push(r)}}function Ixe(e,t,r,a){var s=(r||[]).length||0;if(s<=8224)return nt(e,t,r,s);var i=t;if(!isNaN(i)){for(var l=r.parts||[],u=0,d=0,f=0;f+(l[u]||8224)<=8224;)f+=l[u]||8224,u++;var p=e.next(4);for(p.write_shift(2,i),p.write_shift(2,f),e.push(r.slice(d,d+f)),d+=f;d<s;){for(p=e.next(4),p.write_shift(2,60),f=0;f+(l[u]||8224)<=8224;)f+=l[u]||8224,u++;p.write_shift(2,f),e.push(r.slice(d,d+f)),d+=f}}}function up(e,t,r){return e||(e=He(7)),e.write_shift(2,t),e.write_shift(2,r),e.write_shift(2,0),e.write_shift(1,0),e}function zxe(e,t,r,a){var s=He(9);return up(s,e,t),AM(r,a||"b",s),s}function Bxe(e,t,r){var a=He(8+2*r.length);return up(a,e,t),a.write_shift(1,r.length),a.write_shift(r.length,r,"sbcs"),a.l<a.length?a.slice(0,a.l):a}function $xe(e,t,r,a){if(t.v!=null)switch(t.t){case"d":case"n":var s=t.t=="d"?$n(kn(t.v)):t.v;s==(s|0)&&s>=0&&s<65536?nt(e,2,the(r,a,s)):nt(e,3,ehe(r,a,s));return;case"b":case"e":nt(e,5,zxe(r,a,t.v,t.t));return;case"s":case"str":nt(e,4,Bxe(r,a,(t.v||"").slice(0,255)));return}nt(e,1,up(null,r,a))}function Uxe(e,t,r,a){var s=Array.isArray(t),i=Pr(t["!ref"]||"A1"),l,u="",d=[];if(i.e.c>255||i.e.r>16383){if(a.WTF)throw new Error("Range "+(t["!ref"]||"A1")+" exceeds format limit A1:IV16384");i.e.c=Math.min(i.e.c,255),i.e.r=Math.min(i.e.c,16383),l=ua(i)}for(var f=i.s.r;f<=i.e.r;++f){u=Qa(f);for(var p=i.s.c;p<=i.e.c;++p){f===i.s.r&&(d[p]=ln(p)),l=d[p]+u;var m=s?(t[f]||[])[p]:t[l];m&&$xe(e,m,f,p)}}}function Hxe(e,t){for(var r=t||{},a=Bn(),s=0,i=0;i<e.SheetNames.length;++i)e.SheetNames[i]==r.sheet&&(s=i);if(s==0&&r.sheet&&e.SheetNames[0]!=r.sheet)throw new Error("Sheet not found: "+r.sheet);return nt(a,r.biff==4?1033:r.biff==3?521:9,fS(e,16,r)),Uxe(a,e.Sheets[e.SheetNames[s]],s,r),nt(a,10),a.end()}function qxe(e,t,r){nt(e,49,Lfe({sz:12,name:"Arial"},r))}function Wxe(e,t,r){t&&[[5,8],[23,26],[41,44],[50,392]].forEach(function(a){for(var s=a[0];s<=a[1];++s)t[s]!=null&&nt(e,1054,Bfe(s,t[s],r))})}function Vxe(e,t){var r=He(19);r.write_shift(4,2151),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,1),r.write_shift(4,0),nt(e,2151,r),r=He(39),r.write_shift(4,2152),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,0),r.write_shift(4,0),r.write_shift(2,1),r.write_shift(4,4),r.write_shift(2,0),DM(Pr(t["!ref"]||"A1"),r),r.write_shift(4,4),nt(e,2152,r)}function Gxe(e,t){for(var r=0;r<16;++r)nt(e,224,z8({numFmtId:0,style:!0},0,t));t.cellXfs.forEach(function(a){nt(e,224,z8(a,0,t))})}function Kxe(e,t){for(var r=0;r<t["!links"].length;++r){var a=t["!links"][r];nt(e,440,Kfe(a)),a[1].Tooltip&&nt(e,2048,Yfe(a))}delete t["!links"]}function Yxe(e,t){if(t){var r=0;t.forEach(function(a,s){++r<=256&&a&&nt(e,125,Qfe(Zy(s,a),s))})}}function Xxe(e,t,r,a,s){var i=16+ql(s.cellXfs,t,s);if(t.v==null&&!t.bf){nt(e,513,lu(r,a,i));return}if(t.bf)nt(e,6,bme(t,r,a,s,i));else switch(t.t){case"d":case"n":var l=t.t=="d"?$n(kn(t.v)):t.v;nt(e,515,qfe(r,a,l,i));break;case"b":case"e":nt(e,517,Hfe(r,a,t.v,i,s,t.t));break;case"s":case"str":if(s.bookSST){var u=xS(s.Strings,t.v,s.revStrings);nt(e,253,Ife(r,a,u,i))}else nt(e,516,zfe(r,a,(t.v||"").slice(0,255),i,s));break;default:nt(e,513,lu(r,a,i))}}function Jxe(e,t,r){var a=Bn(),s=r.SheetNames[e],i=r.Sheets[s]||{},l=(r||{}).Workbook||{},u=(l.Sheets||[])[e]||{},d=Array.isArray(i),f=t.biff==8,p,m="",x=[],v=Pr(i["!ref"]||"A1"),b=f?65536:16384;if(v.e.c>255||v.e.r>=b){if(t.WTF)throw new Error("Range "+(i["!ref"]||"A1")+" exceeds format limit A1:IV16384");v.e.c=Math.min(v.e.c,255),v.e.r=Math.min(v.e.c,b-1)}nt(a,2057,fS(r,16,t)),nt(a,13,Bs(1)),nt(a,12,Bs(100)),nt(a,15,bn(!0)),nt(a,17,bn(!1)),nt(a,16,ou(.001)),nt(a,95,bn(!0)),nt(a,42,bn(!1)),nt(a,43,bn(!1)),nt(a,130,Bs(1)),nt(a,128,Ufe()),nt(a,131,bn(!1)),nt(a,132,bn(!1)),f&&Yxe(a,i["!cols"]),nt(a,512,$fe(v,t)),f&&(i["!links"]=[]);for(var w=v.s.r;w<=v.e.r;++w){m=Qa(w);for(var j=v.s.c;j<=v.e.c;++j){w===v.s.r&&(x[j]=ln(j)),p=x[j]+m;var k=d?(i[w]||[])[j]:i[p];k&&(Xxe(a,k,w,j,t),f&&k.l&&i["!links"].push([p,k.l]))}}var C=u.CodeName||u.name||s;return f&&nt(a,574,Mfe((l.Views||[])[0])),f&&(i["!merges"]||[]).length&&nt(a,229,Gfe(i["!merges"])),f&&Kxe(a,i),nt(a,442,PM(C)),f&&Vxe(a,i),nt(a,10),a.end()}function Qxe(e,t,r){var a=Bn(),s=(e||{}).Workbook||{},i=s.Sheets||[],l=s.WBProps||{},u=r.biff==8,d=r.biff==5;if(nt(a,2057,fS(e,5,r)),r.bookType=="xla"&&nt(a,135),nt(a,225,u?Bs(1200):null),nt(a,193,_fe(2)),d&&nt(a,191),d&&nt(a,192),nt(a,226),nt(a,92,Pfe("SheetJS",r)),nt(a,66,Bs(u?1200:1252)),u&&nt(a,353,Bs(0)),u&&nt(a,448),nt(a,317,Zfe(e.SheetNames.length)),u&&e.vbaraw&&nt(a,211),u&&e.vbaraw){var f=l.CodeName||"ThisWorkbook";nt(a,442,PM(f))}nt(a,156,Bs(17)),nt(a,25,bn(!1)),nt(a,18,bn(!1)),nt(a,19,Bs(0)),u&&nt(a,431,bn(!1)),u&&nt(a,444,Bs(0)),nt(a,61,Ffe()),nt(a,64,bn(!1)),nt(a,141,Bs(0)),nt(a,34,bn(axe(e)=="true")),nt(a,14,bn(!0)),u&&nt(a,439,bn(!1)),nt(a,218,Bs(0)),qxe(a,e,r),Wxe(a,e.SSF,r),Gxe(a,r),u&&nt(a,352,bn(!1));var p=a.end(),m=Bn();u&&nt(m,140,Xfe()),u&&r.Strings&&Ixe(m,252,Rfe(r.Strings)),nt(m,10);var x=m.end(),v=Bn(),b=0,w=0;for(w=0;w<e.SheetNames.length;++w)b+=(u?12:11)+(u?2:1)*e.SheetNames[w].length;var j=p.length+b+x.length;for(w=0;w<e.SheetNames.length;++w){var k=i[w]||{};nt(v,133,Dfe({pos:j,hs:k.Hidden||0,dt:0,name:e.SheetNames[w]},r)),j+=t[w].length}var C=v.end();if(b!=C.length)throw new Error("BS8 "+b+" != "+C.length);var N=[];return p.length&&N.push(p),C.length&&N.push(C),x.length&&N.push(x),Ga(N)}function Zxe(e,t){var r=t||{},a=[];e&&!e.SSF&&(e.SSF=Un(Kr)),e&&e.SSF&&(Ky(),Gy(e.SSF),r.revssf=Yy(e.SSF),r.revssf[e.SSF[65535]]=0,r.ssf=e.SSF),r.Strings=[],r.Strings.Count=0,r.Strings.Unique=0,yS(r),r.cellXfs=[],ql(r.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={});for(var s=0;s<e.SheetNames.length;++s)a[a.length]=Jxe(s,r,e);return a.unshift(Qxe(e,a,r)),Ga(a)}function sL(e,t){for(var r=0;r<=e.SheetNames.length;++r){var a=e.Sheets[e.SheetNames[r]];if(!(!a||!a["!ref"])){var s=xs(a["!ref"]);s.e.c>255&&typeof console!="undefined"&&console.error&&console.error("Worksheet '"+e.SheetNames[r]+"' extends beyond column IV (255). Data may be lost.")}}var i=t||{};switch(i.biff||2){case 8:case 5:return Zxe(e,t);case 4:case 3:case 2:return Hxe(e,t)}throw new Error("invalid type "+i.bookType+" for BIFF")}function eye(e,t,r,a){for(var s=e["!merges"]||[],i=[],l=t.s.c;l<=t.e.c;++l){for(var u=0,d=0,f=0;f<s.length;++f)if(!(s[f].s.r>r||s[f].s.c>l)&&!(s[f].e.r<r||s[f].e.c<l)){if(s[f].s.r<r||s[f].s.c<l){u=-1;break}u=s[f].e.r-s[f].s.r+1,d=s[f].e.c-s[f].s.c+1;break}if(!(u<0)){var p=hr({r,c:l}),m=a.dense?(e[r]||[])[l]:e[p],x=m&&m.v!=null&&(m.h||O0e(m.w||($o(m),m.w)||""))||"",v={};u>1&&(v.rowspan=u),d>1&&(v.colspan=d),a.editable?x='<span contenteditable="true">'+x+"</span>":m&&(v["data-t"]=m&&m.t||"z",m.v!=null&&(v["data-v"]=m.v),m.z!=null&&(v["data-z"]=m.z),m.l&&(m.l.Target||"#").charAt(0)!="#"&&(x='<a href="'+m.l.Target+'">'+x+"</a>")),v.id=(a.id||"sjs")+"-"+p,i.push(at("td",x,v))}}var b="<tr>";return b+i.join("")+"</tr>"}var tye='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',rye="</body></html>";function aye(e,t,r){var a=[];return a.join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function iL(e,t){var r=t||{},a=r.header!=null?r.header:tye,s=r.footer!=null?r.footer:rye,i=[a],l=xs(e["!ref"]);r.dense=Array.isArray(e),i.push(aye(e,l,r));for(var u=l.s.r;u<=l.e.r;++u)i.push(eye(e,l,u,r));return i.push("</table>"+s),i.join("")}function oL(e,t,r){var a=r||{},s=0,i=0;if(a.origin!=null)if(typeof a.origin=="number")s=a.origin;else{var l=typeof a.origin=="string"?Pa(a.origin):a.origin;s=l.r,i=l.c}var u=t.getElementsByTagName("tr"),d=Math.min(a.sheetRows||1e7,u.length),f={s:{r:0,c:0},e:{r:s,c:i}};if(e["!ref"]){var p=xs(e["!ref"]);f.s.r=Math.min(f.s.r,p.s.r),f.s.c=Math.min(f.s.c,p.s.c),f.e.r=Math.max(f.e.r,p.e.r),f.e.c=Math.max(f.e.c,p.e.c),s==-1&&(f.e.r=s=p.e.r+1)}var m=[],x=0,v=e["!rows"]||(e["!rows"]=[]),b=0,w=0,j=0,k=0,C=0,N=0;for(e["!cols"]||(e["!cols"]=[]);b<u.length&&w<d;++b){var O=u[b];if(V8(O)){if(a.display)continue;v[w]={hidden:!0}}var E=O.children;for(j=k=0;j<E.length;++j){var A=E[j];if(!(a.display&&V8(A))){var T=A.hasAttribute("data-v")?A.getAttribute("data-v"):A.hasAttribute("v")?A.getAttribute("v"):F0e(A.innerHTML),P=A.getAttribute("data-z")||A.getAttribute("z");for(x=0;x<m.length;++x){var D=m[x];D.s.c==k+i&&D.s.r<w+s&&w+s<=D.e.r&&(k=D.e.c+1-i,x=-1)}N=+A.getAttribute("colspan")||1,((C=+A.getAttribute("rowspan")||1)>1||N>1)&&m.push({s:{r:w+s,c:k+i},e:{r:w+s+(C||1)-1,c:k+i+(N||1)-1}});var z={t:"s",v:T},G=A.getAttribute("data-t")||A.getAttribute("t")||"";T!=null&&(T.length==0?z.t=G||"z":a.raw||T.trim().length==0||G=="s"||(T==="TRUE"?z={t:"b",v:!0}:T==="FALSE"?z={t:"b",v:!1}:isNaN(Oo(T))?isNaN(Nh(T).getDate())||(z={t:"d",v:kn(T)},a.cellDates||(z={t:"n",v:$n(z.v)}),z.z=a.dateNF||Kr[14]):z={t:"n",v:Oo(T)})),z.z===void 0&&P!=null&&(z.z=P);var V="",ne=A.getElementsByTagName("A");if(ne&&ne.length)for(var ge=0;ge<ne.length&&!(ne[ge].hasAttribute("href")&&(V=ne[ge].getAttribute("href"),V.charAt(0)!="#"));++ge);V&&V.charAt(0)!="#"&&(z.l={Target:V}),a.dense?(e[w+s]||(e[w+s]=[]),e[w+s][k+i]=z):e[hr({c:k+i,r:w+s})]=z,f.e.c<k+i&&(f.e.c=k+i),k+=N}}++w}return m.length&&(e["!merges"]=(e["!merges"]||[]).concat(m)),f.e.r=Math.max(f.e.r,w-1+s),e["!ref"]=ua(f),w>=d&&(e["!fullref"]=ua((f.e.r=u.length-b+w-1+s,f))),e}function lL(e,t){var r=t||{},a=r.dense?[]:{};return oL(a,e,t)}function nye(e,t){return gu(lL(e,t),t)}function V8(e){var t="",r=sye(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),t==="none"}function sye(e){return e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle=="function"?e.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}var iye=(function(){var e=["<office:master-styles>",'<style:master-page style:name="mp1" style:page-layout-name="mp1">',"<style:header/>",'<style:header-left style:display="false"/>',"<style:footer/>",'<style:footer-left style:display="false"/>',"</style:master-page>","</office:master-styles>"].join(""),t="<office:document-styles "+Th({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","office:version":"1.2"})+">"+e+"</office:document-styles>";return function(){return pa+t}})(),G8=(function(){var e=function(i){return fr(i).replace(/ +/g,function(l){return'<text:s text:c="'+l.length+'"/>'}).replace(/\t/g,"<text:tab/>").replace(/\n/g,"</text:p><text:p>").replace(/^ /,"<text:s/>").replace(/ $/,"<text:s/>")},t=` <table:table-cell />
`,r=` <table:covered-table-cell/>
`,a=function(i,l,u){var d=[];d.push(' <table:table table:name="'+fr(l.SheetNames[u])+`" table:style-name="ta1">
`);var f=0,p=0,m=xs(i["!ref"]||"A1"),x=i["!merges"]||[],v=0,b=Array.isArray(i);if(i["!cols"])for(p=0;p<=m.e.c;++p)d.push(" <table:table-column"+(i["!cols"][p]?' table:style-name="co'+i["!cols"][p].ods+'"':"")+`></table:table-column>
`);var w="",j=i["!rows"]||[];for(f=0;f<m.s.r;++f)w=j[f]?' table:style-name="ro'+j[f].ods+'"':"",d.push(" <table:table-row"+w+`></table:table-row>
`);for(;f<=m.e.r;++f){for(w=j[f]?' table:style-name="ro'+j[f].ods+'"':"",d.push(" <table:table-row"+w+`>
`),p=0;p<m.s.c;++p)d.push(t);for(;p<=m.e.c;++p){var k=!1,C={},N="";for(v=0;v!=x.length;++v)if(!(x[v].s.c>p)&&!(x[v].s.r>f)&&!(x[v].e.c<p)&&!(x[v].e.r<f)){(x[v].s.c!=p||x[v].s.r!=f)&&(k=!0),C["table:number-columns-spanned"]=x[v].e.c-x[v].s.c+1,C["table:number-rows-spanned"]=x[v].e.r-x[v].s.r+1;break}if(k){d.push(r);continue}var O=hr({r:f,c:p}),E=b?(i[f]||[])[p]:i[O];if(E&&E.f&&(C["table:formula"]=fr(Nme(E.f)),E.F&&E.F.slice(0,O.length)==O)){var A=xs(E.F);C["table:number-matrix-columns-spanned"]=A.e.c-A.s.c+1,C["table:number-matrix-rows-spanned"]=A.e.r-A.s.r+1}if(!E){d.push(t);continue}switch(E.t){case"b":N=E.v?"TRUE":"FALSE",C["office:value-type"]="boolean",C["office:boolean-value"]=E.v?"true":"false";break;case"n":N=E.w||String(E.v||0),C["office:value-type"]="float",C["office:value"]=E.v||0;break;case"s":case"str":N=E.v==null?"":E.v,C["office:value-type"]="string";break;case"d":N=E.w||kn(E.v).toISOString(),C["office:value-type"]="date",C["office:date-value"]=kn(E.v).toISOString(),C["table:style-name"]="ce1";break;default:d.push(t);continue}var T=e(N);if(E.l&&E.l.Target){var P=E.l.Target;P=P.charAt(0)=="#"?"#"+Cme(P.slice(1)):P,P.charAt(0)!="#"&&!P.match(/^\w+:/)&&(P="../"+P),T=at("text:a",T,{"xlink:href":P.replace(/&/g,"&amp;")})}d.push(" "+at("table:table-cell",at("text:p",T,{}),C)+`
`)}d.push(` </table:table-row>
`)}return d.push(` </table:table>
`),d.join("")},s=function(i,l){i.push(` <office:automatic-styles>
`),i.push(` <number:date-style style:name="N37" number:automatic-order="true">
`),i.push(` <number:month number:style="long"/>
`),i.push(` <number:text>/</number:text>
`),i.push(` <number:day number:style="long"/>
`),i.push(` <number:text>/</number:text>
`),i.push(` <number:year/>
`),i.push(` </number:date-style>
`);var u=0;l.SheetNames.map(function(f){return l.Sheets[f]}).forEach(function(f){if(f&&f["!cols"]){for(var p=0;p<f["!cols"].length;++p)if(f["!cols"][p]){var m=f["!cols"][p];if(m.width==null&&m.wpx==null&&m.wch==null)continue;hS(m),m.ods=u;var x=f["!cols"][p].wpx+"px";i.push(' <style:style style:name="co'+u+`" style:family="table-column">
`),i.push(' <style:table-column-properties fo:break-before="auto" style:column-width="'+x+`"/>
`),i.push(` </style:style>
`),++u}}});var d=0;l.SheetNames.map(function(f){return l.Sheets[f]}).forEach(function(f){if(f&&f["!rows"]){for(var p=0;p<f["!rows"].length;++p)if(f["!rows"][p]){f["!rows"][p].ods=d;var m=f["!rows"][p].hpx+"px";i.push(' <style:style style:name="ro'+d+`" style:family="table-row">
`),i.push(' <style:table-row-properties fo:break-before="auto" style:row-height="'+m+`"/>
`),i.push(` </style:style>
`),++d}}}),i.push(` <style:style style:name="ta1" style:family="table" style:master-page-name="mp1">
`),i.push(` <style:table-properties table:display="true" style:writing-mode="lr-tb"/>
`),i.push(` </style:style>
`),i.push(` <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>
`),i.push(` </office:automatic-styles>
`)};return function(l,u){var d=[pa],f=Th({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),p=Th({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});u.bookType=="fods"?(d.push("<office:document"+f+p+`>
`),d.push(_M().replace(/office:document-meta/g,"office:meta"))):d.push("<office:document-content"+f+`>
`),s(d,l),d.push(` <office:body>
`),d.push(` <office:spreadsheet>
`);for(var m=0;m!=l.SheetNames.length;++m)d.push(a(l.Sheets[l.SheetNames[m]],l,m));return d.push(` </office:spreadsheet>
`),d.push(` </office:body>
`),u.bookType=="fods"?d.push("</office:document>"):d.push("</office:document-content>"),d.join("")}})();function cL(e,t){if(t.bookType=="fods")return G8(e,t);var r=rS(),a="",s=[],i=[];return a="mimetype",Ft(r,a,"application/vnd.oasis.opendocument.spreadsheet"),a="content.xml",Ft(r,a,G8(e,t)),s.push([a,"text/xml"]),i.push([a,"ContentFile"]),a="styles.xml",Ft(r,a,iye(e,t)),s.push([a,"text/xml"]),i.push([a,"StylesFile"]),a="meta.xml",Ft(r,a,pa+_M()),s.push([a,"text/xml"]),i.push([a,"MetadataFile"]),a="manifest.rdf",Ft(r,a,yfe(i)),s.push([a,"application/rdf+xml"]),a="META-INF/manifest.xml",Ft(r,a,gfe(s)),r}function Ux(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function oye(e){return typeof TextEncoder!="undefined"?new TextEncoder().encode(e):di(Ch(e))}function lye(e,t){e:for(var r=0;r<=e.length-t.length;++r){for(var a=0;a<t.length;++a)if(e[r+a]!=t[a])continue e;return!0}return!1}function Il(e){var t=e.reduce(function(s,i){return s+i.length},0),r=new Uint8Array(t),a=0;return e.forEach(function(s){r.set(s,a),a+=s.length}),r}function cye(e,t,r){var a=Math.floor(r==0?0:Math.LOG10E*Math.log(Math.abs(r)))+6176-20,s=r/Math.pow(10,a-6176);e[t+15]|=a>>7,e[t+14]|=(a&127)<<1;for(var i=0;s>=1;++i,s/=256)e[t+i]=s&255;e[t+15]|=r>=0?0:128}function Eh(e,t){var r=t?t[0]:0,a=e[r]&127;e:if(e[r++]>=128&&(a|=(e[r]&127)<<7,e[r++]<128||(a|=(e[r]&127)<<14,e[r++]<128)||(a|=(e[r]&127)<<21,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),a}function ur(e){var t=new Uint8Array(7);t[0]=e&127;var r=1;e:if(e>127){if(t[r-1]|=128,t[r]=e>>7&127,++r,e<=16383||(t[r-1]|=128,t[r]=e>>14&127,++r,e<=2097151)||(t[r-1]|=128,t[r]=e>>21&127,++r,e<=268435455)||(t[r-1]|=128,t[r]=e/256>>>21&127,++r,e<=34359738367)||(t[r-1]|=128,t[r]=e/65536>>>21&127,++r,e<=4398046511103))break e;t[r-1]|=128,t[r]=e/16777216>>>21&127,++r}return t.slice(0,r)}function Gd(e){var t=0,r=e[t]&127;e:if(e[t++]>=128){if(r|=(e[t]&127)<<7,e[t++]<128||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128))break e;r|=(e[t]&127)<<28}return r}function va(e){for(var t=[],r=[0];r[0]<e.length;){var a=r[0],s=Eh(e,r),i=s&7;s=Math.floor(s/8);var l=0,u;if(s==0)break;switch(i){case 0:{for(var d=r[0];e[r[0]++]>=128;);u=e.slice(d,r[0])}break;case 5:l=4,u=e.slice(r[0],r[0]+l),r[0]+=l;break;case 1:l=8,u=e.slice(r[0],r[0]+l),r[0]+=l;break;case 2:l=Eh(e,r),u=e.slice(r[0],r[0]+l),r[0]+=l;break;default:throw new Error("PB Type ".concat(i," for Field ").concat(s," at offset ").concat(a))}var f={data:u,type:i};t[s]==null?t[s]=[f]:t[s].push(f)}return t}function Ua(e){var t=[];return e.forEach(function(r,a){r.forEach(function(s){s.data&&(t.push(ur(a*8+s.type)),s.type==2&&t.push(ur(s.data.length)),t.push(s.data))})}),Il(t)}function ri(e){for(var t,r=[],a=[0];a[0]<e.length;){var s=Eh(e,a),i=va(e.slice(a[0],a[0]+s));a[0]+=s;var l={id:Gd(i[1][0].data),messages:[]};i[2].forEach(function(u){var d=va(u.data),f=Gd(d[3][0].data);l.messages.push({meta:d,data:e.slice(a[0],a[0]+f)}),a[0]+=f}),(t=i[3])!=null&&t[0]&&(l.merge=Gd(i[3][0].data)>>>0>0),r.push(l)}return r}function yd(e){var t=[];return e.forEach(function(r){var a=[];a[1]=[{data:ur(r.id),type:0}],a[2]=[],r.merge!=null&&(a[3]=[{data:ur(+!!r.merge),type:0}]);var s=[];r.messages.forEach(function(l){s.push(l.data),l.meta[3]=[{type:0,data:ur(l.data.length)}],a[2].push({data:Ua(l.meta),type:2})});var i=Ua(a);t.push(ur(i.length)),t.push(i),s.forEach(function(l){return t.push(l)})}),Il(t)}function uye(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],a=Eh(t,r),s=[];r[0]<t.length;){var i=t[r[0]]&3;if(i==0){var l=t[r[0]++]>>2;if(l<60)++l;else{var u=l-59;l=t[r[0]],u>1&&(l|=t[r[0]+1]<<8),u>2&&(l|=t[r[0]+2]<<16),u>3&&(l|=t[r[0]+3]<<24),l>>>=0,l++,r[0]+=u}s.push(t.slice(r[0],r[0]+l)),r[0]+=l;continue}else{var d=0,f=0;if(i==1?(f=(t[r[0]]>>2&7)+4,d=(t[r[0]++]&224)<<3,d|=t[r[0]++]):(f=(t[r[0]++]>>2)+1,i==2?(d=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(d=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),s=[Il(s)],d==0)throw new Error("Invalid offset 0");if(d>s[0].length)throw new Error("Invalid offset beyond length");if(f>=d)for(s.push(s[0].slice(-d)),f-=d;f>=s[s.length-1].length;)s.push(s[s.length-1]),f-=s[s.length-1].length;s.push(s[0].slice(-d,-d+f))}}var p=Il(s);if(p.length!=a)throw new Error("Unexpected length: ".concat(p.length," != ").concat(a));return p}function ai(e){for(var t=[],r=0;r<e.length;){var a=e[r++],s=e[r]|e[r+1]<<8|e[r+2]<<16;r+=3,t.push(uye(a,e.slice(r,r+s))),r+=s}if(r!==e.length)throw new Error("data is not a valid framed stream!");return Il(t)}function vd(e){for(var t=[],r=0;r<e.length;){var a=Math.min(e.length-r,268435455),s=new Uint8Array(4);t.push(s);var i=ur(a),l=i.length;t.push(i),a<=60?(l++,t.push(new Uint8Array([a-1<<2]))):a<=256?(l+=2,t.push(new Uint8Array([240,a-1&255]))):a<=65536?(l+=3,t.push(new Uint8Array([244,a-1&255,a-1>>8&255]))):a<=16777216?(l+=4,t.push(new Uint8Array([248,a-1&255,a-1>>8&255,a-1>>16&255]))):a<=4294967296&&(l+=5,t.push(new Uint8Array([252,a-1&255,a-1>>8&255,a-1>>16&255,a-1>>>24&255]))),t.push(e.slice(r,r+a)),l+=a,s[0]=0,s[1]=l&255,s[2]=l>>8&255,s[3]=l>>16&255,r+=a}return Il(t)}function gw(e,t){var r=new Uint8Array(32),a=Ux(r),s=12,i=0;switch(r[0]=5,e.t){case"n":r[1]=2,cye(r,s,e.v),i|=1,s+=16;break;case"b":r[1]=6,a.setFloat64(s,e.v?1:0,!0),i|=2,s+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[1]=3,a.setUint32(s,t.indexOf(e.v),!0),i|=8,s+=4;break;default:throw"unsupported cell type "+e.t}return a.setUint32(8,i,!0),r.slice(0,s)}function xw(e,t){var r=new Uint8Array(32),a=Ux(r),s=12,i=0;switch(r[0]=3,e.t){case"n":r[2]=2,a.setFloat64(s,e.v,!0),i|=32,s+=8;break;case"b":r[2]=6,a.setFloat64(s,e.v?1:0,!0),i|=32,s+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[2]=3,a.setUint32(s,t.indexOf(e.v),!0),i|=16,s+=4;break;default:throw"unsupported cell type "+e.t}return a.setUint32(4,i,!0),r.slice(0,s)}function wl(e){var t=va(e);return Eh(t[1][0].data)}function dye(e,t,r){var a,s,i,l;if(!((a=e[6])!=null&&a[0])||!((s=e[7])!=null&&s[0]))throw"Mutation only works on post-BNC storages!";var u=((l=(i=e[8])==null?void 0:i[0])==null?void 0:l.data)&&Gd(e[8][0].data)>0||!1;if(u)throw"Math only works with normal offsets";for(var d=0,f=Ux(e[7][0].data),p=0,m=[],x=Ux(e[4][0].data),v=0,b=[],w=0;w<t.length;++w){if(t[w]==null){f.setUint16(w*2,65535,!0),x.setUint16(w*2,65535);continue}f.setUint16(w*2,p,!0),x.setUint16(w*2,v,!0);var j,k;switch(typeof t[w]){case"string":j=gw({t:"s",v:t[w]},r),k=xw({t:"s",v:t[w]},r);break;case"number":j=gw({t:"n",v:t[w]},r),k=xw({t:"n",v:t[w]},r);break;case"boolean":j=gw({t:"b",v:t[w]},r),k=xw({t:"b",v:t[w]},r);break;default:throw new Error("Unsupported value "+t[w])}m.push(j),p+=j.length,b.push(k),v+=k.length,++d}for(e[2][0].data=ur(d);w<e[7][0].data.length/2;++w)f.setUint16(w*2,65535,!0),x.setUint16(w*2,65535,!0);return e[6][0].data=Il(m),e[3][0].data=Il(b),d}function fye(e,t){if(!t||!t.numbers)throw new Error("Must pass a `numbers` option -- check the README");var r=e.Sheets[e.SheetNames[0]];e.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var a=xs(r["!ref"]);a.s.r=a.s.c=0;var s=!1;a.e.c>9&&(s=!0,a.e.c=9),a.e.r>49&&(s=!0,a.e.r=49),s&&console.error("The Numbers writer is currently limited to ".concat(ua(a)));var i=Hx(r,{range:a,header:1}),l=["~Sh33tJ5~"];i.forEach(function(H){return H.forEach(function(K){typeof K=="string"&&l.push(K)})});var u={},d=[],f=br.read(t.numbers,{type:"base64"});f.FileIndex.map(function(H,K){return[H,f.FullPaths[K]]}).forEach(function(H){var K=H[0],Y=H[1];if(K.type==2&&K.name.match(/\.iwa/)){var re=K.content,de=ai(re),ie=ri(de);ie.forEach(function(se){d.push(se.id),u[se.id]={deps:[],location:Y,type:Gd(se.messages[0].meta[1][0].data)}})}}),d.sort(function(H,K){return H-K});var p=d.filter(function(H){return H>1}).map(function(H){return[H,ur(H)]});f.FileIndex.map(function(H,K){return[H,f.FullPaths[K]]}).forEach(function(H){var K=H[0];if(H[1],!!K.name.match(/\.iwa/)){var Y=ri(ai(K.content));Y.forEach(function(re){re.messages.forEach(function(de){p.forEach(function(ie){re.messages.some(function(se){return Gd(se.meta[1][0].data)!=11006&&lye(se.data,ie[1])})&&u[ie[0]].deps.push(re.id)})})})}});for(var m=br.find(f,u[1].location),x=ri(ai(m.content)),v,b=0;b<x.length;++b){var w=x[b];w.id==1&&(v=w)}var j=wl(va(v.messages[0].data)[1][0].data);for(m=br.find(f,u[j].location),x=ri(ai(m.content)),b=0;b<x.length;++b)w=x[b],w.id==j&&(v=w);for(j=wl(va(v.messages[0].data)[2][0].data),m=br.find(f,u[j].location),x=ri(ai(m.content)),b=0;b<x.length;++b)w=x[b],w.id==j&&(v=w);for(j=wl(va(v.messages[0].data)[2][0].data),m=br.find(f,u[j].location),x=ri(ai(m.content)),b=0;b<x.length;++b)w=x[b],w.id==j&&(v=w);var k=va(v.messages[0].data);{k[6][0].data=ur(a.e.r+1),k[7][0].data=ur(a.e.c+1);var C=wl(k[46][0].data),N=br.find(f,u[C].location),O=ri(ai(N.content));{for(var E=0;E<O.length&&O[E].id!=C;++E);if(O[E].id!=C)throw"Bad ColumnRowUIDMapArchive";var A=va(O[E].messages[0].data);A[1]=[],A[2]=[],A[3]=[];for(var T=0;T<=a.e.c;++T){var P=[];P[1]=P[2]=[{type:0,data:ur(T+420690)}],A[1].push({type:2,data:Ua(P)}),A[2].push({type:0,data:ur(T)}),A[3].push({type:0,data:ur(T)})}A[4]=[],A[5]=[],A[6]=[];for(var D=0;D<=a.e.r;++D)P=[],P[1]=P[2]=[{type:0,data:ur(D+726270)}],A[4].push({type:2,data:Ua(P)}),A[5].push({type:0,data:ur(D)}),A[6].push({type:0,data:ur(D)});O[E].messages[0].data=Ua(A)}N.content=vd(yd(O)),N.size=N.content.length,delete k[46];var z=va(k[4][0].data);{z[7][0].data=ur(a.e.r+1);var G=va(z[1][0].data),V=wl(G[2][0].data);N=br.find(f,u[V].location),O=ri(ai(N.content));{if(O[0].id!=V)throw"Bad HeaderStorageBucket";var ne=va(O[0].messages[0].data);for(D=0;D<i.length;++D){var ge=va(ne[2][0].data);ge[1][0].data=ur(D),ge[4][0].data=ur(i[D].length),ne[2][D]={type:ne[2][0].type,data:Ua(ge)}}O[0].messages[0].data=Ua(ne)}N.content=vd(yd(O)),N.size=N.content.length;var Z=wl(z[2][0].data);N=br.find(f,u[Z].location),O=ri(ai(N.content));{if(O[0].id!=Z)throw"Bad HeaderStorageBucket";for(ne=va(O[0].messages[0].data),T=0;T<=a.e.c;++T)ge=va(ne[2][0].data),ge[1][0].data=ur(T),ge[4][0].data=ur(a.e.r+1),ne[2][T]={type:ne[2][0].type,data:Ua(ge)};O[0].messages[0].data=Ua(ne)}N.content=vd(yd(O)),N.size=N.content.length;var U=wl(z[4][0].data);(function(){for(var H=br.find(f,u[U].location),K=ri(ai(H.content)),Y,re=0;re<K.length;++re){var de=K[re];de.id==U&&(Y=de)}var ie=va(Y.messages[0].data);{ie[3]=[];var se=[];l.forEach(function(F,X){se[1]=[{type:0,data:ur(X)}],se[2]=[{type:0,data:ur(1)}],se[3]=[{type:2,data:oye(F)}],ie[3].push({type:2,data:Ua(se)})})}Y.messages[0].data=Ua(ie);var he=yd(K),_e=vd(he);H.content=_e,H.size=H.content.length})();var ce=va(z[3][0].data);{var xe=ce[1][0];delete ce[2];var be=va(xe.data);{var me=wl(be[2][0].data);(function(){for(var H=br.find(f,u[me].location),K=ri(ai(H.content)),Y,re=0;re<K.length;++re){var de=K[re];de.id==me&&(Y=de)}var ie=va(Y.messages[0].data);{delete ie[6],delete ce[7];var se=new Uint8Array(ie[5][0].data);ie[5]=[];for(var he=0,_e=0;_e<=a.e.r;++_e){var F=va(se);he+=dye(F,i[_e],l),F[1][0].data=ur(_e),ie[5].push({data:Ua(F),type:2})}ie[1]=[{type:0,data:ur(a.e.c+1)}],ie[2]=[{type:0,data:ur(a.e.r+1)}],ie[3]=[{type:0,data:ur(he)}],ie[4]=[{type:0,data:ur(a.e.r+1)}]}Y.messages[0].data=Ua(ie);var X=yd(K),R=vd(X);H.content=R,H.size=H.content.length})()}xe.data=Ua(be)}z[3][0].data=Ua(ce)}k[4][0].data=Ua(z)}v.messages[0].data=Ua(k);var oe=yd(x),L=vd(oe);return m.content=L,m.size=m.content.length,f}function hye(e){return function(r){for(var a=0;a!=e.length;++a){var s=e[a];r[s[0]]===void 0&&(r[s[0]]=s[1]),s[2]==="n"&&(r[s[0]]=Number(r[s[0]]))}}}function yS(e){hye([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(e)}function pye(e,t){return t.bookType=="ods"?cL(e,t):t.bookType=="numbers"?fye(e,t):t.bookType=="xlsb"?mye(e,t):gye(e,t)}function mye(e,t){Dd=1024,e&&!e.SSF&&(e.SSF=Un(Kr)),e&&e.SSF&&(Ky(),Gy(e.SSF),t.revssf=Yy(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,th?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r=t.bookType=="xlsb"?"bin":"xml",a=WM.indexOf(t.bookType)>-1,s=bM();yS(t=t||{});var i=rS(),l="",u=0;if(t.cellXfs=[],ql(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),l="docProps/core.xml",Ft(i,l,kM(e.Props,t)),s.coreprops.push(l),dr(t.rels,2,l,Qt.CORE_PROPS),l="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var d=[],f=0;f<e.SheetNames.length;++f)(e.Workbook.Sheets[f]||{}).Hidden!=2&&d.push(e.SheetNames[f]);e.Props.SheetNames=d}for(e.Props.Worksheets=e.Props.SheetNames.length,Ft(i,l,NM(e.Props)),s.extprops.push(l),dr(t.rels,3,l,Qt.EXT_PROPS),e.Custprops!==e.Props&&tn(e.Custprops||{}).length>0&&(l="docProps/custom.xml",Ft(i,l,CM(e.Custprops)),s.custprops.push(l),dr(t.rels,4,l,Qt.CUST_PROPS)),u=1;u<=e.SheetNames.length;++u){var p={"!id":{}},m=e.Sheets[e.SheetNames[u-1]],x=(m||{})["!type"]||"sheet";if(l="xl/worksheets/sheet"+u+"."+r,Ft(i,l,yxe(u-1,l,t,e,p)),s.sheets.push(l),dr(t.wbrels,-1,"worksheets/sheet"+u+"."+r,Qt.WS[0]),m){var v=m["!comments"],b=!1,w="";v&&v.length>0&&(w="xl/comments"+u+"."+r,Ft(i,w,wxe(v,w)),s.comments.push(w),dr(p,-1,"../comments"+u+"."+r,Qt.CMNT),b=!0),m["!legacy"]&&b&&Ft(i,"xl/drawings/vmlDrawing"+u+".vml",HM(u,m["!comments"])),delete m["!comments"],delete m["!legacy"]}p["!id"].rId1&&Ft(i,jM(l),Wd(p))}return t.Strings!=null&&t.Strings.length>0&&(l="xl/sharedStrings."+r,Ft(i,l,bxe(t.Strings,l,t)),s.strs.push(l),dr(t.wbrels,-1,"sharedStrings."+r,Qt.SST)),l="xl/workbook."+r,Ft(i,l,xxe(e,l)),s.workbooks.push(l),dr(t.rels,1,l,Qt.WB),l="xl/theme/theme1.xml",Ft(i,l,$M(e.Themes,t)),s.themes.push(l),dr(t.wbrels,-1,"theme/theme1.xml",Qt.THEME),l="xl/styles."+r,Ft(i,l,vxe(e,l,t)),s.styles.push(l),dr(t.wbrels,-1,"styles."+r,Qt.STY),e.vbaraw&&a&&(l="xl/vbaProject.bin",Ft(i,l,e.vbaraw),s.vba.push(l),dr(t.wbrels,-1,"vbaProject.bin",Qt.VBA)),l="xl/metadata."+r,Ft(i,l,jxe(l)),s.metadata.push(l),dr(t.wbrels,-1,"metadata."+r,Qt.XLMETA),Ft(i,"[Content_Types].xml",wM(s,t)),Ft(i,"_rels/.rels",Wd(t.rels)),Ft(i,"xl/_rels/workbook."+r+".rels",Wd(t.wbrels)),delete t.revssf,delete t.ssf,i}function gye(e,t){Dd=1024,e&&!e.SSF&&(e.SSF=Un(Kr)),e&&e.SSF&&(Ky(),Gy(e.SSF),t.revssf=Yy(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,th?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",a=WM.indexOf(t.bookType)>-1,s=bM();yS(t=t||{});var i=rS(),l="",u=0;if(t.cellXfs=[],ql(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),l="docProps/core.xml",Ft(i,l,kM(e.Props,t)),s.coreprops.push(l),dr(t.rels,2,l,Qt.CORE_PROPS),l="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var d=[],f=0;f<e.SheetNames.length;++f)(e.Workbook.Sheets[f]||{}).Hidden!=2&&d.push(e.SheetNames[f]);e.Props.SheetNames=d}e.Props.Worksheets=e.Props.SheetNames.length,Ft(i,l,NM(e.Props)),s.extprops.push(l),dr(t.rels,3,l,Qt.EXT_PROPS),e.Custprops!==e.Props&&tn(e.Custprops||{}).length>0&&(l="docProps/custom.xml",Ft(i,l,CM(e.Custprops)),s.custprops.push(l),dr(t.rels,4,l,Qt.CUST_PROPS));var p=["SheetJ5"];for(t.tcid=0,u=1;u<=e.SheetNames.length;++u){var m={"!id":{}},x=e.Sheets[e.SheetNames[u-1]],v=(x||{})["!type"]||"sheet";if(l="xl/worksheets/sheet"+u+"."+r,Ft(i,l,eL(u-1,t,e,m)),s.sheets.push(l),dr(t.wbrels,-1,"worksheets/sheet"+u+"."+r,Qt.WS[0]),x){var b=x["!comments"],w=!1,j="";if(b&&b.length>0){var k=!1;b.forEach(function(C){C[1].forEach(function(N){N.T==!0&&(k=!0)})}),k&&(j="xl/threadedComments/threadedComment"+u+"."+r,Ft(i,j,Ghe(b,p,t)),s.threadedcomments.push(j),dr(m,-1,"../threadedComments/threadedComment"+u+"."+r,Qt.TCMNT)),j="xl/comments"+u+"."+r,Ft(i,j,qM(b)),s.comments.push(j),dr(m,-1,"../comments"+u+"."+r,Qt.CMNT),w=!0}x["!legacy"]&&w&&Ft(i,"xl/drawings/vmlDrawing"+u+".vml",HM(u,x["!comments"])),delete x["!comments"],delete x["!legacy"]}m["!id"].rId1&&Ft(i,jM(l),Wd(m))}return t.Strings!=null&&t.Strings.length>0&&(l="xl/sharedStrings."+r,Ft(i,l,FM(t.Strings,t)),s.strs.push(l),dr(t.wbrels,-1,"sharedStrings."+r,Qt.SST)),l="xl/workbook."+r,Ft(i,l,aL(e)),s.workbooks.push(l),dr(t.rels,1,l,Qt.WB),l="xl/theme/theme1.xml",Ft(i,l,$M(e.Themes,t)),s.themes.push(l),dr(t.wbrels,-1,"theme/theme1.xml",Qt.THEME),l="xl/styles."+r,Ft(i,l,zM(e,t)),s.styles.push(l),dr(t.wbrels,-1,"styles."+r,Qt.STY),e.vbaraw&&a&&(l="xl/vbaProject.bin",Ft(i,l,e.vbaraw),s.vba.push(l),dr(t.wbrels,-1,"vbaProject.bin",Qt.VBA)),l="xl/metadata."+r,Ft(i,l,UM()),s.metadata.push(l),dr(t.wbrels,-1,"metadata."+r,Qt.XLMETA),p.length>1&&(l="xl/persons/person.xml",Ft(i,l,Khe(p)),s.people.push(l),dr(t.wbrels,-1,"persons/person.xml",Qt.PEOPLE)),Ft(i,"[Content_Types].xml",wM(s,t)),Ft(i,"_rels/.rels",Wd(t.rels)),Ft(i,"xl/_rels/workbook."+r+".rels",Wd(t.wbrels)),delete t.revssf,delete t.ssf,i}function xye(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=Bo(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function uL(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return ip(t.file,br.write(e,{type:ar?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return br.write(e,t)}function yye(e,t){var r=Un(t||{}),a=pye(e,r);return vye(a,r)}function vye(e,t){var r={},a=ar?"nodebuffer":typeof Uint8Array!="undefined"?"array":"string";if(t.compression&&(r.compression="DEFLATE"),t.password)r.type=a;else switch(t.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":case"file":r.type=a;break;default:throw new Error("Unrecognized type "+t.type)}var s=e.FullPaths?br.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!t.compression}):e.generate(r);if(typeof Deno!="undefined"&&typeof s=="string"){if(t.type=="binary"||t.type=="base64")return s;s=new Uint8Array(Vy(s))}return t.password&&typeof encrypt_agile!="undefined"?uL(encrypt_agile(s,t.password),t):t.type==="file"?ip(t.file,s):t.type=="string"?Jf(s):s}function bye(e,t){var r=t||{},a=Mxe(e,r);return uL(a,r)}function Mi(e,t,r){r||(r="");var a=r+e;switch(t.type){case"base64":return Sh(Ch(a));case"binary":return Ch(a);case"string":return e;case"file":return ip(t.file,a,"utf8");case"buffer":return ar?Ko(a,"utf8"):typeof TextEncoder!="undefined"?new TextEncoder().encode(a):Mi(a,{type:"binary"}).split("").map(function(s){return s.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function wye(e,t){switch(t.type){case"base64":return Sh(e);case"binary":return e;case"string":return e;case"file":return ip(t.file,e,"binary");case"buffer":return ar?Ko(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function ng(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",a=0;a<e.length;++a)r+=String.fromCharCode(e[a]);return t.type=="base64"?Sh(r):t.type=="string"?Jf(r):r;case"file":return ip(t.file,e);case"buffer":return e;default:throw new Error("Unrecognized type "+t.type)}}function dL(e,t){Yde(),ixe(e);var r=Un(t||{});if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),r.type=="array"){r.type="binary";var a=dL(e,r);return r.type="array",Vy(a)}var s=0;if(r.sheet&&(typeof r.sheet=="number"?s=r.sheet:s=e.SheetNames.indexOf(r.sheet),!e.SheetNames[s]))throw new Error("Sheet not found: "+r.sheet+" : "+typeof r.sheet);switch(r.bookType||"xlsb"){case"xml":case"xlml":return Mi(Rxe(e,r),r);case"slk":case"sylk":return Mi(ahe.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"htm":case"html":return Mi(iL(e.Sheets[e.SheetNames[s]],r),r);case"txt":return wye(fL(e.Sheets[e.SheetNames[s]],r),r);case"csv":return Mi(vS(e.Sheets[e.SheetNames[s]],r),r,"\uFEFF");case"dif":return Mi(nhe.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"dbf":return ng(rhe.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"prn":return Mi(she.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"rtf":return Mi(fhe.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"eth":return Mi(RM.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"fods":return Mi(cL(e,r),r);case"wk1":return ng(B8.sheet_to_wk1(e.Sheets[e.SheetNames[s]],r),r);case"wk3":return ng(B8.book_to_wk3(e,r),r);case"biff2":r.biff||(r.biff=2);case"biff3":r.biff||(r.biff=3);case"biff4":return r.biff||(r.biff=4),ng(sL(e,r),r);case"biff5":r.biff||(r.biff=5);case"biff8":case"xla":case"xls":return r.biff||(r.biff=8),bye(e,r);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return yye(e,r);default:throw new Error("Unrecognized bookType |"+r.bookType+"|")}}function jye(e){if(!e.bookType){var t={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"},r=e.file.slice(e.file.lastIndexOf(".")).toLowerCase();r.match(/^\.[a-z]+$/)&&(e.bookType=r.slice(1)),e.bookType=t[e.bookType]||e.bookType}}function _ye(e,t,r){var a={};return a.type="file",a.file=t,jye(a),dL(e,a)}function kye(e,t,r,a,s,i,l,u){var d=Qa(r),f=u.defval,p=u.raw||!Object.prototype.hasOwnProperty.call(u,"raw"),m=!0,x=s===1?[]:{};if(s!==1)if(Object.defineProperty)try{Object.defineProperty(x,"__rowNum__",{value:r,enumerable:!1})}catch(j){x.__rowNum__=r}else x.__rowNum__=r;if(!l||e[r])for(var v=t.s.c;v<=t.e.c;++v){var b=l?e[r][v]:e[a[v]+d];if(b===void 0||b.t===void 0){if(f===void 0)continue;i[v]!=null&&(x[i[v]]=f);continue}var w=b.v;switch(b.t){case"z":if(w==null)break;continue;case"e":w=w==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+b.t)}if(i[v]!=null){if(w==null)if(b.t=="e"&&w===null)x[i[v]]=null;else if(f!==void 0)x[i[v]]=f;else if(p&&w===null)x[i[v]]=null;else continue;else x[i[v]]=p&&(b.t!=="n"||b.t==="n"&&u.rawNumbers!==!1)?w:$o(b,w,u);w!=null&&(m=!1)}}return{row:x,isempty:m}}function Hx(e,t){if(e==null||e["!ref"]==null)return[];var r={t:"n",v:0},a=0,s=1,i=[],l=0,u="",d={s:{r:0,c:0},e:{r:0,c:0}},f=t||{},p=f.range!=null?f.range:e["!ref"];switch(f.header===1?a=1:f.header==="A"?a=2:Array.isArray(f.header)?a=3:f.header==null&&(a=0),typeof p){case"string":d=Pr(p);break;case"number":d=Pr(e["!ref"]),d.s.r=p;break;default:d=p}a>0&&(s=0);var m=Qa(d.s.r),x=[],v=[],b=0,w=0,j=Array.isArray(e),k=d.s.r,C=0,N={};j&&!e[k]&&(e[k]=[]);var O=f.skipHidden&&e["!cols"]||[],E=f.skipHidden&&e["!rows"]||[];for(C=d.s.c;C<=d.e.c;++C)if(!(O[C]||{}).hidden)switch(x[C]=ln(C),r=j?e[k][C]:e[x[C]+m],a){case 1:i[C]=C-d.s.c;break;case 2:i[C]=x[C];break;case 3:i[C]=f.header[C-d.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),u=l=$o(r,null,f),w=N[l]||0,!w)N[l]=1;else{do u=l+"_"+w++;while(N[u]);N[l]=w,N[u]=1}i[C]=u}for(k=d.s.r+s;k<=d.e.r;++k)if(!(E[k]||{}).hidden){var A=kye(e,d,k,x,a,i,j,f);(A.isempty===!1||(a===1?f.blankrows!==!1:f.blankrows))&&(v[b++]=A.row)}return v.length=b,v}var K8=/"/g;function Sye(e,t,r,a,s,i,l,u){for(var d=!0,f=[],p="",m=Qa(r),x=t.s.c;x<=t.e.c;++x)if(a[x]){var v=u.dense?(e[r]||[])[x]:e[a[x]+m];if(v==null)p="";else if(v.v!=null){d=!1,p=""+(u.rawNumbers&&v.t=="n"?v.v:$o(v,null,u));for(var b=0,w=0;b!==p.length;++b)if((w=p.charCodeAt(b))===s||w===i||w===34||u.forceQuotes){p='"'+p.replace(K8,'""')+'"';break}p=="ID"&&(p='"ID"')}else v.f!=null&&!v.F?(d=!1,p="="+v.f,p.indexOf(",")>=0&&(p='"'+p.replace(K8,'""')+'"')):p="";f.push(p)}return u.blankrows===!1&&d?null:f.join(l)}function vS(e,t){var r=[],a=t==null?{}:t;if(e==null||e["!ref"]==null)return"";var s=Pr(e["!ref"]),i=a.FS!==void 0?a.FS:",",l=i.charCodeAt(0),u=a.RS!==void 0?a.RS:`
`,d=u.charCodeAt(0),f=new RegExp((i=="|"?"\\|":i)+"+$"),p="",m=[];a.dense=Array.isArray(e);for(var x=a.skipHidden&&e["!cols"]||[],v=a.skipHidden&&e["!rows"]||[],b=s.s.c;b<=s.e.c;++b)(x[b]||{}).hidden||(m[b]=ln(b));for(var w=0,j=s.s.r;j<=s.e.r;++j)(v[j]||{}).hidden||(p=Sye(e,s,j,m,l,d,i,a),p!=null&&(a.strip&&(p=p.replace(f,"")),(p||a.blankrows!==!1)&&r.push((w++?u:"")+p)));return delete a.dense,r.join("")}function fL(e,t){t||(t={}),t.FS=" ",t.RS=`
`;var r=vS(e,t);return r}function Nye(e){var t="",r,a="";if(e==null||e["!ref"]==null)return[];var s=Pr(e["!ref"]),i="",l=[],u,d=[],f=Array.isArray(e);for(u=s.s.c;u<=s.e.c;++u)l[u]=ln(u);for(var p=s.s.r;p<=s.e.r;++p)for(i=Qa(p),u=s.s.c;u<=s.e.c;++u)if(t=l[u]+i,r=f?(e[p]||[])[u]:e[t],a="",r!==void 0){if(r.F!=null){if(t=r.F,!r.f)continue;a=r.f,t.indexOf(":")==-1&&(t=t+":"+t)}if(r.f!=null)a=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)a=""+r.v;else if(r.t=="b")a=r.v?"TRUE":"FALSE";else if(r.w!==void 0)a="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?a="'"+r.v:a=""+r.v}}d[d.length]=t+"="+a}return d}function hL(e,t,r){var a=r||{},s=+!a.skipHeader,i=e||{},l=0,u=0;if(i&&a.origin!=null)if(typeof a.origin=="number")l=a.origin;else{var d=typeof a.origin=="string"?Pa(a.origin):a.origin;l=d.r,u=d.c}var f,p={s:{c:0,r:0},e:{c:u,r:l+t.length-1+s}};if(i["!ref"]){var m=Pr(i["!ref"]);p.e.c=Math.max(p.e.c,m.e.c),p.e.r=Math.max(p.e.r,m.e.r),l==-1&&(l=m.e.r+1,p.e.r=l+t.length-1+s)}else l==-1&&(l=0,p.e.r=t.length-1+s);var x=a.header||[],v=0;t.forEach(function(w,j){tn(w).forEach(function(k){(v=x.indexOf(k))==-1&&(x[v=x.length]=k);var C=w[k],N="z",O="",E=hr({c:u+v,r:l+j+s});f=Ah(i,E),C&&typeof C=="object"&&!(C instanceof Date)?i[E]=C:(typeof C=="number"?N="n":typeof C=="boolean"?N="b":typeof C=="string"?N="s":C instanceof Date?(N="d",a.cellDates||(N="n",C=$n(C)),O=a.dateNF||Kr[14]):C===null&&a.nullError&&(N="e",C=0),f?(f.t=N,f.v=C,delete f.w,delete f.R,O&&(f.z=O)):i[E]=f={t:N,v:C},O&&(f.z=O))})}),p.e.c=Math.max(p.e.c,u+x.length-1);var b=Qa(l);if(s)for(v=0;v<x.length;++v)i[ln(v+u)+b]={t:"s",v:x[v]};return i["!ref"]=ua(p),i}function Cye(e,t){return hL(null,e,t)}function Ah(e,t,r){if(typeof t=="string"){if(Array.isArray(e)){var a=Pa(t);return e[a.r]||(e[a.r]=[]),e[a.r][a.c]||(e[a.r][a.c]={t:"z"})}return e[t]||(e[t]={t:"z"})}return typeof t!="number"?Ah(e,hr(t)):Ah(e,hr({r:t,c:r||0}))}function Tye(e,t){if(typeof t=="number"){if(t>=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}else if(typeof t=="string"){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}else throw new Error("Cannot find sheet |"+t+"|")}function Eye(){return{SheetNames:[],Sheets:{}}}function Aye(e,t,r,a){var s=1;if(!r)for(;s<=65535&&e.SheetNames.indexOf(r="Sheet"+s)!=-1;++s,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(a&&e.SheetNames.indexOf(r)>=0){var i=r.match(/(^.*?)(\d+)$/);s=i&&+i[2]||0;var l=i&&i[1]||r;for(++s;s<=65535&&e.SheetNames.indexOf(r=l+s)!=-1;++s);}if(rL(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function Oye(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var a=Tye(e,t);switch(e.Workbook.Sheets[a]||(e.Workbook.Sheets[a]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[a].Hidden=r}function Pye(e,t){return e.z=t,e}function pL(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function Dye(e,t,r){return pL(e,"#"+t,r)}function Rye(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function Fye(e,t,r,a){for(var s=typeof t!="string"?t:Pr(t),i=typeof t=="string"?t:ua(t),l=s.s.r;l<=s.e.r;++l)for(var u=s.s.c;u<=s.e.c;++u){var d=Ah(e,l,u);d.t="n",d.F=i,delete d.v,l==s.s.r&&u==s.s.c&&(d.f=r,a&&(d.D=!0))}return e}var yw={encode_col:ln,encode_row:Qa,encode_cell:hr,encode_range:ua,decode_col:lS,decode_row:oS,split_cell:Y0e,decode_cell:Pa,decode_range:xs,format_cell:$o,sheet_add_aoa:pM,sheet_add_json:hL,sheet_add_dom:oL,aoa_to_sheet:j0,json_to_sheet:Cye,table_to_sheet:lL,table_to_book:nye,sheet_to_csv:vS,sheet_to_txt:fL,sheet_to_json:Hx,sheet_to_html:iL,sheet_to_formulae:Nye,sheet_to_row_object_array:Hx,sheet_get_cell:Ah,book_new:Eye,book_append_sheet:Aye,book_set_sheet_visibility:Oye,cell_set_number_format:Pye,cell_set_hyperlink:pL,cell_set_internal_link:Dye,cell_add_comment:Rye,sheet_set_array_formula:Fye,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};const Mye={Work_Order:new Set(["name","asset","asset_name","work_order_type","company","department","repair_status","workflow_state","custom_priority_","creation","modified"]),Asset:new Set(["name","asset_name","custom_serial_number","company","location","custom_device_status","modified"])},sg=new Map;function Lye(e){const[t,r]=y.useState([]),[a,s]=y.useState(!1),[i,l]=y.useState(null),u=y.useRef(!1);return y.useEffect(()=>{if(!e)return;let f=!1;return fe(null,null,function*(){if(!u.current){if(u.current=!0,sg.has(e)){f||r(sg.get(e)),u.current=!1;return}f||(s(!0),l(null));try{const m=yield fetch("/api/method/asset_lite.api.doctype_fields.get_export_fields",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({doctype:e})});if(!m.ok)throw new Error(`Server returned ${m.status}`);const x=yield m.json();if(x.exc)throw new Error(x.exc);const v=x.message||[],b=Mye[e],w=v.map((j,k)=>({key:j.fieldname,label:j.label||j.fieldname,fieldtype:j.fieldtype||"Data",default:b?b.has(j.fieldname):k<8}));console.log(`[useDoctypeFields] ✅ "${e}": ${w.length} fields from server`),sg.set(e,w),f||r(w)}catch(m){console.error("[useDoctypeFields] ❌",m),f||(l(m instanceof Error?m.message:"Failed to fetch fields"),r([{key:"name",label:"ID",fieldtype:"Data",default:!0},{key:"creation",label:"Created On",fieldtype:"Datetime",default:!1},{key:"modified",label:"Modified On",fieldtype:"Datetime",default:!0}]))}finally{u.current=!1,f||s(!1)}}}),()=>{f=!0}},[e]),{fields:t,loading:a,error:i,refetchFields:()=>{sg.delete(e),u.current=!1,r([]),l(null)}}}function mL(e){return e==null?"":typeof e=="boolean"?e?"Yes":"No":String(e)}function Iye(e,t,r){const a=t.map(f=>f.label),s=e.map(f=>t.map(p=>{const m=mL(f[p.key]);return m.includes(",")||m.includes('"')||m.includes(`
`)?`"${m.replace(/"/g,'""')}"`:m}).join(",")),i=[a.join(","),...s].join(`
`),l=new Blob(["\uFEFF"+i],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(l),d=document.createElement("a");d.href=u,d.download=r,d.click(),URL.revokeObjectURL(u)}function zye(e,t,r){const a=[t.map(l=>l.label),...e.map(l=>t.map(u=>mL(l[u.key])))],s=yw.aoa_to_sheet(a),i=yw.book_new();yw.book_append_sheet(i,s,"Export"),_ye(i,r)}const Gn=({isOpen:e,onClose:t,doctype:r,selectedCount:a,pageCount:s,totalCount:i,onExport:l,onFetchAll:u,pageData:d,selectedRows:f,rowKey:p="name",extraColumns:m=[],hiddenColumns:x=[],defaultColumns:v,fileNamePrefix:b})=>{const{t:w}=sr(),{fields:j,loading:k}=Lye(r),C=_t.useMemo(()=>{const me=new Set(x),oe=[...j.filter(L=>!me.has(L.key)),...m.filter(L=>!me.has(L.key))];if(v){const L=new Set(v);return oe.map(H=>Se(ee({},H),{default:L.has(H.key)}))}return oe},[j,m,x,v]),[N,O]=y.useState(a>0?"selected":"all_with_filters"),[E,A]=y.useState("csv"),[T,P]=y.useState(new Set),[D,z]=y.useState(""),[G,V]=y.useState(!1),ne=_t.useRef(!1);if(y.useEffect(()=>{O(a>0?"selected":"all_with_filters")},[a]),y.useEffect(()=>{C.length!==0&&(ne.current||(ne.current=!0,P(new Set(C.filter(me=>me.default).map(me=>me.key)))))},[C]),y.useEffect(()=>{e||(ne.current=!1,P(new Set))},[e]),!e)return null;const ge=D.trim()?C.filter(me=>me.label.toLowerCase().includes(D.toLowerCase())||me.key.toLowerCase().includes(D.toLowerCase())):C,Z=me=>{P(oe=>{const L=new Set(oe);return L.has(me)?L.delete(me):L.add(me),L})},U=()=>P(new Set(C.map(me=>me.key))),ce=()=>P(new Set(C.filter(me=>me.default).map(me=>me.key))),xe=()=>P(new Set),be=()=>fe(null,null,function*(){if(T.size!==0){V(!0);try{if(l){yield l(N,E,[...T]),t();return}let me=[];if(N==="selected"){const Y=f!=null?f:new Set;me=d.filter(re=>Y.has(re[p]))}else if(N==="all_on_page")me=d;else{if(!u){alert("onFetchAll not provided for all_with_filters scope");return}me=yield u()}if(me.length===0){alert("No data to export.");return}const oe=C.filter(Y=>T.has(Y.key)),L=b!=null?b:r.toLowerCase().replace(/\s+/g,"_"),H=new Date().toISOString().split("T")[0],K=`${L}_export_${H}.${E==="csv"?"csv":"xlsx"}`;E==="csv"?Iye(me,oe,K):zye(me,oe,K),t()}catch(me){console.error("Export failed:",me),alert(`Export failed: ${me instanceof Error?me.message:"Unknown error"}`)}finally{V(!1)}}});return n.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[70] p-4",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-2xl max-h-[92vh] flex flex-col animate-scale-in",children:[n.jsx("div",{className:"bg-gradient-to-r from-green-500 to-green-600 px-6 py-4 rounded-t-lg flex-shrink-0",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(hn,{className:"text-white text-xl"}),n.jsxs("div",{children:[n.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Export ",r.replace(/_/g," ")]}),n.jsxs("p",{className:"text-green-100 text-xs mt-0.5",children:[C.length," fields available · ",T.size," selected"]})]})]}),n.jsx("button",{onClick:t,className:"text-white/80 hover:text-white transition-colors",disabled:G,children:n.jsx(yt,{size:20})})]})}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-3",children:"What to export"}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(vw,{value:"selected",current:N,onChange:O,disabled:a===0,badge:a,badgeColor:"green",label:"Selected rows",sub:`${a} row${a!==1?"s":""} selected`}),n.jsx(vw,{value:"all_on_page",current:N,onChange:O,badge:s,badgeColor:"blue",label:"Current page",sub:`${s} rows on this page`}),n.jsx(vw,{value:"all_with_filters",current:N,onChange:O,badge:i,badgeColor:"purple",label:"All records (current filters)",sub:`${i} total matching records`})]})]}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-3",children:"File format"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx(Y8,{value:"csv",current:E,onChange:A,icon:n.jsx(Cq,{className:"text-green-600 text-xl"}),label:"CSV",sub:"Universal, works everywhere"}),n.jsx(Y8,{value:"excel",current:E,onChange:A,icon:n.jsx(Nq,{className:"text-green-700 text-xl"}),label:"Excel (.xlsx)",sub:"Native Excel workbook"})]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("h4",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:["Columns to export",k&&n.jsx(vt,{className:"inline ml-2 animate-spin text-gray-400",size:12})]}),n.jsxs("div",{className:"flex gap-3 text-xs text-blue-600 dark:text-blue-400",children:[n.jsx("button",{onClick:U,className:"hover:underline",children:"All"}),n.jsx("button",{onClick:ce,className:"hover:underline",children:"Default"}),n.jsx("button",{onClick:xe,className:"hover:underline",children:"None"})]})]}),n.jsxs("div",{className:"relative mb-2",children:[n.jsx(fn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-400",size:12}),n.jsx("input",{type:"text",value:D,onChange:me=>z(me.target.value),placeholder:"Search fields…",className:"w-full pl-8 pr-3 py-1.5 text-xs border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white"}),D&&n.jsx("button",{onClick:()=>z(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:n.jsx(yt,{size:10})})]}),k?n.jsxs("div",{className:"flex items-center justify-center h-24 text-gray-400 text-sm gap-2",children:[n.jsx(vt,{className:"animate-spin"})," Loading fields…"]}):n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-1.5 max-h-52 overflow-y-auto p-2 bg-gray-50 dark:bg-gray-900/50 rounded-lg border border-gray-200 dark:border-gray-700",children:[ge.map(me=>{const oe=T.has(me.key);return n.jsxs("div",{onClick:()=>Z(me.key),className:`flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer transition-all text-xs select-none ${oe?"bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-200":"hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-600 dark:text-gray-400"}`,children:[n.jsx("span",{className:"flex-shrink-0",children:oe?n.jsx(Sn,{size:13,className:"text-green-600"}):n.jsx(Gr,{size:13,className:"text-gray-300 dark:text-gray-600"})}),n.jsx("span",{className:"truncate",title:`${me.label} (${me.key})`,children:me.label})]},me.key)}),ge.length===0&&n.jsxs("p",{className:"col-span-3 text-center text-gray-400 text-xs py-4",children:['No fields match "',D,'"']})]}),n.jsxs("p",{className:"text-xs text-gray-400 mt-1.5",children:[T.size," of ",C.length," fields selected",D&&` · showing ${ge.length} matching`]})]})]}),n.jsxs("div",{className:"flex-shrink-0 px-6 py-4 bg-gray-50 dark:bg-gray-900/50 border-t border-gray-200 dark:border-gray-700 rounded-b-lg flex justify-between items-center",children:[n.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[N==="selected"&&`Exporting ${a} selected row${a!==1?"s":""}`,N==="all_on_page"&&`Exporting ${s} rows from current page`,N==="all_with_filters"&&`Exporting up to ${i} records`]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx("button",{onClick:t,disabled:G,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:"Cancel"}),n.jsx("button",{onClick:be,disabled:T.size===0||G,className:"px-4 py-2 text-sm font-medium text-white bg-green-600 hover:bg-green-700 rounded-lg transition-colors flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:G?n.jsxs(n.Fragment,{children:[n.jsx(vt,{className:"animate-spin",size:14})," Exporting…"]}):n.jsxs(n.Fragment,{children:[n.jsx(Aq,{size:14})," Export"]})})]})]})]})})},Bye={green:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300",blue:"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300",purple:"bg-purple-100 dark:bg-purple-900/40 text-purple-700 dark:text-purple-300"},vw=({value:e,current:t,onChange:r,disabled:a,label:s,sub:i,badge:l,badgeColor:u})=>n.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-all ${t===e?"border-green-500 bg-green-50 dark:bg-green-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700/50"} ${a?"opacity-50 cursor-not-allowed":""}`,children:[n.jsx("input",{type:"radio",name:"export_scope",value:e,checked:t===e,onChange:()=>!a&&r(e),disabled:a,className:"text-green-600 focus:ring-green-500"}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"font-medium text-sm text-gray-900 dark:text-white",children:s}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:i})]}),n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold flex-shrink-0 ${Bye[u]}`,children:l.toLocaleString()})]}),Y8=({value:e,current:t,onChange:r,icon:a,label:s,sub:i})=>n.jsxs("label",{className:`flex-1 flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-all ${t===e?"border-green-500 bg-green-50 dark:bg-green-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700/50"}`,children:[n.jsx("input",{type:"radio",name:"export_format",value:e,checked:t===e,onChange:()=>r(e),className:"text-green-600 focus:ring-green-500"}),a,n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-sm text-gray-900 dark:text-white",children:s}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:i})]})]});function $ye(e){if(e==null)return{};if(Array.isArray(e))return e.length>0?e:{};const t=Ta(e);return t.length>0?t:{}}function Kn(e){return fe(this,null,function*(){const{doctype:t,filters:r,orderBy:a="modified desc",fields:s=["*"],pageSize:i=100,maxPages:l=100,orFilters:u}=e,d=$ye(r),f=[];let p=0,m=!0;for(;m;){const x={doctype:t,filters:d,fields:s,limit_start:p*i,limit_page_length:i,order_by:a};u&&u.length>0&&(x.or_filters=u);const v=yield Ja.getCSRFToken(),b={"Content-Type":"application/json"};v&&(b["X-Frappe-CSRF-Token"]=v);const w=yield fetch("/api/method/frappe.client.get_list",{method:"POST",headers:b,credentials:"include",body:JSON.stringify(x)}),j=yield w.json();if(j.exc)throw new Error(typeof j.exc=="string"?j.exc:"get_list failed");if(!w.ok)throw new Error(typeof j.message=="string"?j.message:`get_list failed (${w.status})`);const k=Array.isArray(j.message)?j.message:[];f.push(...k),k.length<i?m=!1:(p+=1,p>=l&&(console.warn("[fetchAllRowsForExport] maxPages safety limit reached"),m=!1))}return f})}const Uye="/assets/project_management/pm_app/assets/ar_prompt-BqI4nTg7.mp3",X8="/assets/project_management/pm_app/assets/ar_no_selection-CHgRuCTX.mp3",Hye="/assets/project_management/pm_app/assets/en_status_prompt-Cuwd6Pz-.mp3",qye="/assets/project_management/pm_app/assets/en_no_selection_prompt-CVmv7vVD.mp3",Wye=[{value:"Open",label:"Open",keywords:["open"],color:"not-started",icon:"⏳"},{value:"Work In Progress",label:"Work In Progress",keywords:["work in progress"],color:"in-progress",icon:"🔄"},{value:"Closed",label:"Closed",keywords:["closed"],color:"completed",icon:"✅"}];function Vye(e,t){if(!e)return null;const r=e.toLowerCase().trim();for(const a of t)if(a.keywords.some(s=>new RegExp(`(^|[\\s،,])${s}([\\s،,]|$)`,"i").test(r)))return a.value;return null}const ig=18,bw=window.SpeechRecognition||window.webkitSpeechRecognition;function Gye({onStatusConfirmed:e,selectedCount:t=0,selectedNames:r=[],isUpdating:a=!1,statusOptions:s=Wye,widgetTitle:i="Voice Status Update",showLanguageToggle:l=!1,noSelectionLabel:u="project"}){const[d,f]=y.useState(t===0?"noselection":"prompted"),[p,m]=y.useState(""),[x,v]=y.useState(null),[b,w]=y.useState(!1),[j,k]=y.useState(Array(ig).fill(4)),[C,N]=y.useState("en"),O=y.useRef(null),E=y.useRef(null),A=y.useRef(null),T=y.useRef(null),P=y.useRef(null),D=y.useRef(null),z=y.useRef(null),G=y.useRef(!1),V=y.useRef(null),ne=s.map(ie=>ie.label).join(", "),ge=s.map(ie=>ie.arLabel||ie.label).join("، "),Z=`من فضلك قل الحالة: ${ge}.`,U=`Please select at least one ${u} from the list in order to continue.`,ce=C==="ar"?`قل: ${ge}`:`Say: ${ne}`;function xe(ie){const he=ie==="ar"?Uye:Hye,_e=new Audio(he);_e.onended=()=>f("ready"),_e.onerror=()=>f("ready"),_e.play().catch(()=>f("ready"))}y.useEffect(()=>{if(t===0){const se=new Audio(qye);se.onended=()=>{new Audio(X8).play().catch(()=>{})},se.onerror=()=>{new Audio(X8).play().catch(()=>{})},se.play().catch(()=>{});return}const ie=setTimeout(()=>xe(C),1e3);return()=>{clearTimeout(ie),me()}},[]);const be=y.useRef(!0);y.useEffect(()=>{if(be.current){be.current=!1;return}if(t===0||d==="listening"||d==="detected")return;window.speechSynthesis&&window.speechSynthesis.cancel(),f("prompted");const ie=C,se=setTimeout(()=>xe(ie),400);return()=>clearTimeout(se)},[C]);function me(){z.current&&clearTimeout(z.current),A.current&&cancelAnimationFrame(A.current),E.current&&(E.current.disconnect(),E.current=null),O.current&&(O.current.close(),O.current=null),D.current&&(D.current.getTracks().forEach(ie=>ie.stop()),D.current=null),[T,P].forEach(ie=>{if(ie.current){try{ie.current.stop()}catch(se){}ie.current=null}}),k(Array(ig).fill(4))}function oe(){return fe(this,null,function*(){try{let ie=function(){A.current=requestAnimationFrame(ie),_e.getByteFrequencyData(X),k(Array.from({length:ig},(R,I)=>{const te=Math.floor(I*X.length/ig);return 4+X[te]/255*22}))};const se=yield navigator.mediaDevices.getUserMedia({audio:!0});D.current=se;const he=new(window.AudioContext||window.webkitAudioContext);O.current=he;const _e=he.createAnalyser();_e.fftSize=64;const F=he.createMediaStreamSource(se);E.current=F,F.connect(_e);const X=new Uint8Array(_e.frequencyBinCount);ie()}catch(ie){}})}function L(ie,se){if(!bw)return null;const he=new bw;return he.lang=ie,he.interimResults=!1,he.continuous=!1,he.maxAlternatives=3,he.onresult=_e=>{const F=_e.results[_e.resultIndex];if(F&&F.isFinal){const X=F[0].transcript.trim();X&&se(X,!0)}},he.onerror=()=>{},he.onend=()=>{},he}function H(){return fe(this,null,function*(){if(f("listening"),m(""),V.current=null,yield oe(),!bw){me(),f("ready");return}const ie=C==="ar"?"ar-SA":"en-US";let se="";const he=(X,R)=>{if(G.current||V.current)return;m(X);const I=Vye(X,s);if(I){G.current=!0,V.current=I,v(I),f("detected"),me(),setTimeout(()=>{e==null||e(I)},800);return}R&&(se+=X+" ")},_e=()=>{if(V.current||G.current||!se.trim())return;f("notunderstood"),me(),C==="ar"?setTimeout(()=>f("ready"),1500):smartSpeak({text:`Please pick only from one of the values provided: ${ne}.`,lang:"en-US",onEnd:()=>f("ready"),onError:()=>f("ready")})},F=L(ie,he);if(!F){me(),f("ready");return}T.current=F,F.onend=()=>{!V.current&&!G.current&&_e()};try{F.start()}catch(X){}z.current=setTimeout(()=>{me(),f(X=>X==="listening"?"ready":X)},8e3)})}function K(ie){G.current||(v(ie),V.current=ie,m(`Selected: ${ie}`),f("detected"),me(),setTimeout(()=>{e&&!G.current&&(G.current=!0,e(ie))},800))}function Y(){me(),G.current=!1,V.current=null,m(""),v(null),w(!1),t===0?(f("noselection"),smartSpeak({text:U,lang:"en-US",onEnd:()=>{},onError:()=>{}})):(f("prompted"),setTimeout(()=>xe(C),500))}const re=x?s.find(ie=>ie.value===x):null,de=C==="ar";return n.jsxs("div",{className:"vsw-card",children:[n.jsxs("div",{className:"vsw-header",children:[n.jsx("div",{className:"vsw-logo",children:"🛠️"}),n.jsxs("div",{className:"vsw-brand",children:["SEERA",n.jsx("span",{children:"-ASM"})]}),t>0&&n.jsxs("span",{className:"vsw-selected-badge",children:[t," selected"]})]}),n.jsx("div",{className:"vsw-title",children:i}),n.jsx("div",{className:"vsw-subtitle",children:t===0?`No ${u}s selected`:`Updating ${t} record${t>1?"s":""}`}),l&&t>0&&n.jsx("div",{style:{display:"flex",gap:6,marginBottom:14,background:"#f1f5f9",borderRadius:10,padding:4},children:[{key:"en",label:"English"},{key:"ar",label:"عربي"}].map(({key:ie,label:se})=>n.jsx("button",{onClick:()=>N(ie),style:{flex:1,padding:"6px 0",borderRadius:7,border:"none",fontSize:12,fontWeight:600,cursor:"pointer",transition:"all 0.15s",background:C===ie?"#fff":"transparent",color:C===ie?"#2563eb":"#64748b",boxShadow:C===ie?"0 1px 4px rgba(0,0,0,0.1)":"none"},children:se},ie))}),d==="noselection"&&n.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:16,marginBottom:16,background:"#fffbeb",border:"1px solid #fde68a",borderRadius:10},children:[n.jsx("span",{style:{fontSize:20,flexShrink:0},children:"⚠️"}),n.jsxs("div",{style:{width:"100%"},children:[n.jsxs("p",{style:{fontWeight:700,fontSize:14,color:"#92400e",margin:"0 0 2px"},children:["No ",u,"s selected"]}),n.jsxs("p",{style:{fontSize:13,color:"#b45309",margin:"0 0 10px",lineHeight:1.5},children:["Please select at least one ",u," from the list in order to continue."]}),n.jsx("p",{style:{fontWeight:700,fontSize:14,color:"#92400e",margin:"0 0 2px",direction:"rtl",textAlign:"right"},children:"لم يتم اختيار أي مشروع"}),n.jsx("p",{style:{fontSize:13,color:"#b45309",margin:0,lineHeight:1.5,direction:"rtl",textAlign:"right"},children:"من فضلك اختر مشروعاً واحداً على الأقل من القائمة للمتابعة"})]})]}),t>0&&n.jsxs(n.Fragment,{children:[r.length>0&&n.jsxs("div",{className:"vsw-wo-list",children:[r.slice(0,3).map(ie=>n.jsx("span",{className:"vsw-wo-tag",children:ie},ie)),r.length>3&&n.jsxs("span",{className:"vsw-wo-tag vsw-wo-tag--more",children:["+",r.length-3," more"]})]}),n.jsx("div",{className:"vsw-status-row",children:s.map(ie=>n.jsxs("div",{className:`vsw-pill ${x===ie.value?`vsw-pill--active vsw-pill--${ie.color}`:""}`,onClick:()=>K(ie.value),title:"Click to select manually",children:[n.jsx("span",{className:`vsw-dot vsw-dot--${ie.color}`}),n.jsx("span",{children:de&&ie.arLabel||ie.label})]},ie.value))}),n.jsxs("div",{className:"vsw-action-area",children:[d==="prompted"&&n.jsxs("div",{className:"vsw-status-message vsw-status-message--speaking",children:[n.jsx("div",{className:"vsw-speaking-icon",children:"🔊"}),n.jsx("div",{className:"vsw-speaking-text",children:de?"يرجى الانتظار…":"Please wait…"}),n.jsxs("div",{className:"vsw-speaking-dots",children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]})]}),d==="ready"&&n.jsxs(n.Fragment,{children:[de&&n.jsx("div",{style:{width:"100%",padding:"12px 16px",marginBottom:8,background:"#f0f9ff",border:"1px solid #bae6fd",borderRadius:10,textAlign:"right",direction:"rtl"},children:n.jsx("p",{style:{margin:0,fontSize:14,fontWeight:600,color:"#0369a1"},children:Z})}),n.jsxs("button",{className:"vsw-speak-btn",onClick:H,children:[n.jsx("div",{className:"vsw-speak-btn-icon",children:"🎙️"}),n.jsxs("div",{className:"vsw-speak-btn-text",children:[n.jsx("span",{className:"vsw-speak-btn-title",children:de?"اضغط للتحدث":"Tap to Speak"}),n.jsx("span",{className:"vsw-speak-btn-hint",children:ce})]})]})]}),d==="listening"&&n.jsxs("div",{className:"vsw-listening-area",children:[n.jsx("div",{className:"vsw-mic-active",children:"🔴"}),n.jsx("div",{className:"vsw-waveform vsw-waveform--active",children:j.map((ie,se)=>n.jsx("div",{className:"vsw-bar",style:{height:`${ie}px`}},se))}),n.jsx("div",{className:"vsw-mic-label vsw-mic-label--listening",children:de?"جاري الاستماع… تحدث الآن":"Listening… speak now"}),p&&n.jsx("div",{style:{marginTop:8,padding:"6px 12px",background:"#f8fafc",border:"1px solid #e2e8f0",borderRadius:8,fontSize:13,color:"#1e293b",maxWidth:"100%",direction:de?"rtl":"ltr"},children:p})]}),d==="detected"&&re&&n.jsxs("div",{className:"vsw-status-message vsw-status-message--detected",children:[re.icon," ",de?"تم اكتشاف الحالة!":"Status detected!"]}),d==="notunderstood"&&n.jsxs("div",{className:"vsw-status-message vsw-status-message--notunderstood",children:["⚠️ ",de?"من فضلك اختر من القيم المتاحة":"Please pick only from one of the values provided"]})]}),p&&d!=="listening"&&n.jsx("div",{className:"vsw-transcript vsw-transcript--filled",style:{direction:de?"rtl":"ltr"},children:p})]}),n.jsx("hr",{className:"vsw-divider"}),n.jsxs("div",{className:"vsw-actions",children:[n.jsx("button",{className:"vsw-btn vsw-btn--ghost",onClick:Y,disabled:a,children:de?"إعادة":"Reset"}),a&&n.jsx("button",{className:"vsw-btn vsw-btn--primary",disabled:!0,children:de?"جاري التحديث…":"Updating…"}),b&&n.jsx("button",{className:"vsw-btn vsw-btn--confirmed vsw-btn--primary",disabled:!0,children:de?"تم التحديث!":"Updated!"})]})]})}const Kye=[{value:"Open",label:"Open",keywords:["open"],color:"not-started",icon:"⏳"},{value:"Work In Progress",label:"Work In Progress",keywords:["work in progress"],color:"in-progress",icon:"🔄"},{value:"Closed",label:"Closed",keywords:["closed"],color:"completed",icon:"✅"}],Yye=[{value:"Open",label:"Open",arLabel:"مفتوح",keywords:["open","مفتوح","مفتوحة","افتح","open"],color:"not-started",icon:"📂"},{value:"Completed",label:"Completed",arLabel:"مكتمل",keywords:["completed","complete","done","finish","finished","مكتمل","مكتملة","اكتمل","منجز","منتهي","منتهية","تم"],color:"completed",icon:"✅"},{value:"Cancelled",label:"Cancelled",arLabel:"ملغي",keywords:["cancelled","canceled","cancel","ملغي","ملغاة","ملغى","الغي","إلغاء"],color:"in-progress",icon:"🚫"}],Xye=({isOpen:e,onClose:t,selectedRows:r,onUpdateSuccess:a,doctype:s="Work_Order",fieldname:i="repair_status",statusOptions:l=Kye,widgetTitle:u="Voice Status Update",showLanguageToggle:d=!1,noSelectionLabel:f="row"})=>{const[p,m]=y.useState(!1);if(!e)return null;const x=r.size,v=b=>fe(null,null,function*(){if(x===0)return;const w=Array.from(r);m(!0);let j=0,k=0;for(const C of w)try{const O=yield(yield fetch("/api/method/frappe.client.set_value",{method:"POST",headers:{"Content-Type":"application/json","X-Frappe-CSRF-Token":window.csrf_token||"fetch"},credentials:"include",body:JSON.stringify({doctype:s,name:C,fieldname:i,value:b})})).json();if(O.exc||O.exception)throw new Error(O.exc||O.exception);j++}catch(N){console.error(`Failed to update ${C}:`,N),k++}m(!1),j>0&&k===0?setTimeout(()=>{a(),t()},2e3):j>0&&a()});return n.jsxs("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-[80] p-4",onClick:b=>{b.target===b.currentTarget&&!p&&t()},children:[n.jsxs("div",{className:"relative animate-scale-in",children:[n.jsx("button",{onClick:()=>{p||t()},className:"absolute -top-3 -right-3 z-10 w-8 h-8 rounded-full bg-gray-600 hover:bg-gray-500 text-white flex items-center justify-center shadow-lg transition-colors",disabled:p,title:"Close",children:n.jsx(yt,{size:12})}),n.jsx(Gye,{onStatusConfirmed:v,selectedCount:x,selectedNames:Array.from(r),isUpdating:p,statusOptions:l,widgetTitle:u,showLanguageToggle:d,noSelectionLabel:f})]}),n.jsx("style",{children:`
@keyframes scale-in {
from { transform: scale(0.92); opacity: 0; }
to { transform: scale(1); opacity: 1; }
}
.animate-scale-in { animation: scale-in 0.2s ease-out; }
`})]})},Jye=e=>{switch(e==null?void 0:e.toLowerCase()){case"open":return"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300";case"completed":return"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300";case"cancelled":return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300";default:return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"}},Qye=e=>{switch(e==null?void 0:e.toLowerCase()){case"high":return"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300";case"medium":return"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300";case"low":return"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300";default:return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"}},Zye=()=>{const{t:e}=sr(),t=Ut(),[r,a]=dn(),s=y.useRef(a);y.useEffect(()=>{s.current=a},[a]);const i=y.useMemo(()=>{const te=parseInt(r.get("page")||"1",10);return Number.isNaN(te)||te<1?1:te},[r]),l=y.useCallback(te=>{const q=typeof te=="function"?te(i):te;a(B=>{const je=new URLSearchParams(B);return je.set("page",String(q)),je})},[i,a]),u=20,[d,f]=y.useState(!1),[p,m]=y.useState(()=>r.get("status")||""),[x,v]=y.useState(()=>r.get("priority")||""),[b,w]=y.useState(()=>r.get("q")||""),[j,k]=y.useState(()=>r.get("date_filter_by")||""),[C,N]=y.useState(()=>r.get("date_start")||""),[O,E]=y.useState(()=>r.get("date_end")||""),[A,T]=y.useState(()=>r.get("sort_by")||"modified desc"),[P,D]=y.useState(!1),[z,G]=y.useState(!1),V=y.useRef(!1),ne=y.useRef(!0),ge=y.useRef(null),Z=y.useMemo(()=>{const te={};return p&&(te.status=p),x&&(te.priority=x),b&&(te.project_name=["like",`%${b}%`]),Object.assign(te,n_(j,C,O)),te},[p,x,b,j,C,O]),U=["creation desc","creation asc","modified desc","modified asc","name asc","name desc"].includes(A)?A:"modified desc",{projects:ce,loading:xe,error:be,totalCount:me,refetch:oe}=Fde({filters:Z,limit_start:(i-1)*u,limit_page_length:u,order_by:U}),L=y.useMemo(()=>`${i}|${A}|${JSON.stringify(Z)}`,[i,A,Z]),{selectedRows:H,toggleRow:K,toggleAllOnPage:Y,allOnPageSelected:re,someOnPageSelected:de}=Vn(ce,L),ie=y.useCallback(()=>Kn({doctype:"Project",filters:Z,orderBy:U}),[Z,U]),se=Math.ceil(me/u),he=te=>te?new Date(te).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"-",_e=()=>{m(""),v(""),w(""),k(""),N(""),E(""),T("modified desc"),a(te=>{const q=new URLSearchParams(te);return q.delete("status"),q.delete("priority"),q.delete("q"),q.delete("date_filter_by"),q.delete("date_start"),q.delete("date_end"),q.delete("sort_by"),q.set("page","1"),q})},F=!!p||!!x||!!b||!!(j&&(C||O)),X=y.useCallback(()=>{a(te=>{const q=new URLSearchParams(te);return p?q.set("status",p):q.delete("status"),x?q.set("priority",x):q.delete("priority"),b?q.set("q",b):q.delete("q"),j?q.set("date_filter_by",j):q.delete("date_filter_by"),C?q.set("date_start",C):q.delete("date_start"),O?q.set("date_end",O):q.delete("date_end"),A!=="modified desc"?q.set("sort_by",A):q.delete("sort_by"),q.set("page","1"),q})},[p,x,b,j,C,O,A,a]);y.useEffect(()=>{if(!V.current){V.current=!0;return}s.current(te=>{const q=new URLSearchParams(te);return p?q.set("status",p):q.delete("status"),x?q.set("priority",x):q.delete("priority"),j?q.set("date_filter_by",j):q.delete("date_filter_by"),C?q.set("date_start",C):q.delete("date_start"),O?q.set("date_end",O):q.delete("date_end"),A!=="modified desc"?q.set("sort_by",A):q.delete("sort_by"),q.set("page","1"),q})},[p,x,j,C,O,A]),y.useEffect(()=>{if(V.current){if(ne.current){ne.current=!1;return}return ge.current&&window.clearTimeout(ge.current),ge.current=window.setTimeout(()=>{s.current(te=>{const q=new URLSearchParams(te);return b?q.set("q",b):q.delete("q"),q.set("page","1"),q})},450),()=>{ge.current&&window.clearTimeout(ge.current)}}},[b]);const R=te=>t(`/projects/list/${encodeURIComponent(te)}?edit=1`),I=te=>t(`/projects/list/new?duplicate=${encodeURIComponent(te)}`);return n.jsxs("div",{className:"p-6 bg-gray-50 dark:bg-gray-900 min-h-screen",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-4",children:[n.jsx("button",{onClick:()=>t("/projects"),className:"text-gray-500 hover:text-blue-600 dark:text-gray-400 dark:hover:text-blue-400",children:e("projects.moduleTitle")}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:e("projects.projectsDoctype")})]}),n.jsxs("div",{className:"mb-6 flex flex-col gap-4 sm:flex-row sm:justify-between sm:items-center",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-bold text-gray-800 dark:text-white",children:e("projects.title")}),n.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:[e("projects.listTotal"),me," ",e(me!==1?"projects.listProjects":"projects.listProject"),H.size>0&&n.jsxs("span",{className:"ml-2 text-blue-600 dark:text-blue-400",children:["• ",H.size," ",e("common.selected")]}),xe&&n.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 text-xs text-blue-600 dark:text-blue-400",children:[n.jsx(en,{className:"animate-spin h-3 w-3"}),e("common.updating")]})]})]}),n.jsxs("div",{className:"flex flex-wrap gap-3",children:[n.jsxs("button",{type:"button",onClick:()=>G(!0),className:"bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all",title:"Bulk-update project status by voice",children:[n.jsx(iP,{}),n.jsx("span",{className:"font-medium",children:"Voice Command Assist"})]}),n.jsxs("button",{type:"button",onClick:()=>D(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all disabled:opacity-50",disabled:me===0&&H.size===0,children:[n.jsx(hn,{}),n.jsx("span",{className:"font-medium",children:e("listPages.export")}),H.size>0&&n.jsx("span",{className:"bg-white/20 px-1.5 py-0.5 rounded text-xs",children:H.size})]}),n.jsxs("button",{type:"button",onClick:()=>t("/projects/list/new"),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow-lg transition-all hover:shadow-xl",children:[n.jsx(Pt,{}),n.jsx("span",{className:"font-medium",children:e("projects.newProject")})]})]})]}),n.jsx(Gn,{isOpen:P,onClose:()=>D(!1),doctype:"Project",selectedCount:H.size,pageCount:ce.length,totalCount:me,pageData:ce,selectedRows:H,rowKey:"name",onFetchAll:ie,fileNamePrefix:"projects"}),n.jsx(Xye,{isOpen:z,onClose:()=>G(!1),selectedRows:H,onUpdateSuccess:()=>{oe()},doctype:"Project",fieldname:"status",statusOptions:Yye,widgetTitle:"Voice Project Status Update",showLanguageToggle:!0,noSelectionLabel:"project"}),n.jsxs("div",{className:"isolate bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 mb-6",children:[n.jsx("div",{className:"bg-gradient-to-r from-blue-500 to-blue-600 dark:from-blue-600 dark:to-blue-700 px-4 py-3 rounded-t-lg",children:n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[n.jsx("button",{onClick:()=>f(te=>!te),className:"text-white hover:bg-white/20 p-2 rounded-lg transition-all",children:d?n.jsx(ps,{size:14}):n.jsx(nr,{size:14})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Dh,{className:"text-white",size:16}),n.jsx("span",{className:"text-white font-semibold text-sm",children:e("listPages.filters")})]}),F&&n.jsx("span",{className:"bg-white text-blue-600 px-2 py-0.5 rounded-full text-xs font-bold",children:[b,p,x,j&&C].filter(Boolean).length})]}),F&&n.jsx("div",{className:"flex-1 overflow-x-auto mx-2",children:n.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[b&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-blue-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Name:"})," ",b,n.jsx("button",{onClick:()=>w(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),p&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-blue-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Status:"})," ",p,n.jsx("button",{onClick:()=>m(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),x&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-blue-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Priority:"})," ",x,n.jsx("button",{onClick:()=>v(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),j&&C&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-blue-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsxs("span",{className:"font-semibold",children:[j==="creation"?"Created":"Modified",":"]})," ",C,O?` ${O}`:"",n.jsx("button",{onClick:()=>{k(""),N(""),E("")},children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]})]})}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[F&&n.jsx("button",{onClick:_e,className:"text-white/80 hover:text-white text-xs underline whitespace-nowrap",children:"Clear all"}),n.jsx("button",{onClick:()=>oe(),className:"text-white hover:bg-white/20 p-1.5 rounded-lg transition-all",title:"Refresh",children:n.jsx(en,{size:12,className:xe?"animate-spin":""})})]})]})}),d&&n.jsx("div",{className:"p-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Search"}),n.jsxs("div",{className:"relative",children:[n.jsx(fn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-400 text-xs"}),n.jsx("input",{type:"text",value:b,onChange:te=>w(te.target.value),onKeyDown:te=>te.key==="Enter"&&X(),placeholder:e("projects.searchPlaceholder"),className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:outline-none"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Status"}),n.jsxs("select",{value:p,onChange:te=>m(te.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:outline-none",children:[n.jsx("option",{value:"",children:"All Status"}),n.jsx("option",{value:"Open",children:"Open"}),n.jsx("option",{value:"Completed",children:"Completed"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Priority"}),n.jsxs("select",{value:x,onChange:te=>v(te.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:outline-none",children:[n.jsx("option",{value:"",children:"All Priority"}),n.jsx("option",{value:"High",children:"High"}),n.jsx("option",{value:"Medium",children:"Medium"}),n.jsx("option",{value:"Low",children:"Low"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Date Filter By"}),n.jsxs("select",{value:j,onChange:te=>k(te.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:outline-none",children:[n.jsx("option",{value:"",children:"None"}),n.jsx("option",{value:"creation",children:"Created"}),n.jsx("option",{value:"modified",children:"Modified"})]})]}),j&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"From"}),n.jsx("input",{type:"date",value:C,onChange:te=>N(te.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:outline-none"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"To"}),n.jsx("input",{type:"date",value:O,onChange:te=>E(te.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:outline-none"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Sort By"}),n.jsxs("select",{value:A,onChange:te=>T(te.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:outline-none",children:[n.jsx("option",{value:"modified desc",children:"Modified (newest)"}),n.jsx("option",{value:"creation desc",children:"Created (newest)"}),n.jsx("option",{value:"modified asc",children:"Modified (oldest)"}),n.jsx("option",{value:"creation asc",children:"Created (oldest)"}),n.jsx("option",{value:"name asc",children:"Name AZ"}),n.jsx("option",{value:"name desc",children:"Name ZA"})]})]})]})})]}),be&&n.jsx("div",{className:"mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg text-red-700 dark:text-red-300",children:be}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden relative",children:[xe?n.jsx("div",{className:"p-12 text-center text-gray-500 dark:text-gray-400",children:e("common.loading")}):ce.length===0?n.jsx("div",{className:"p-12 text-center text-gray-500 dark:text-gray-400",children:e("projects.noProjects")}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[n.jsx("thead",{className:"bg-gray-100 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600",children:n.jsxs("tr",{children:[n.jsx("th",{className:"w-10 px-4 py-3 text-left",children:n.jsx("button",{type:"button",onClick:Y,className:"text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",title:re?"Deselect all":"Select all","aria-label":"Select all on page",children:re?n.jsx(Sn,{className:"text-blue-600 dark:text-blue-400",size:18}):de?n.jsxs("div",{className:"relative inline-block",children:[n.jsx(Gr,{size:18}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"w-2 h-0.5 bg-current"})})]}):n.jsx(Gr,{size:18})})}),n.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 dark:text-gray-300 uppercase tracking-wider",children:e("projects.projectName")}),n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:e("commonFields.status")}),n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:e("commonFields.priority")}),n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:e("projects.customer")}),n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:e("projects.expectedEnd")}),n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:e("projects.progress")}),n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:e("common.actions")})]})}),n.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:ce.map(te=>{var q,B;return n.jsxs("tr",{className:`hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer ${H.has(te.name)?"bg-blue-50 dark:bg-blue-900/20":""}`,onClick:()=>t(`/projects/list/${te.name}`),children:[n.jsx("td",{className:"w-10 px-4 py-3",onClick:je=>je.stopPropagation(),children:n.jsx("button",{type:"button",onClick:()=>K(te.name),className:"text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors","aria-label":`Select ${te.name}`,children:H.has(te.name)?n.jsx(Sn,{className:"text-blue-600 dark:text-blue-400",size:18}):n.jsx(Gr,{size:18})})}),n.jsxs("td",{className:"px-6 py-4",children:[n.jsx("span",{className:"text-[15px] font-medium text-gray-900 dark:text-white hover:underline",children:te.project_name||te.name}),n.jsx("span",{className:"block text-xs text-gray-500 dark:text-gray-400",children:te.name})]}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Jye(te.status||"")}`,children:te.status||"-"})}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Qye(te.priority||"")}`,children:te.priority||"-"})}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300",children:te.customer||"-"}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300",children:he(te.expected_end_date||"")}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"flex-1 h-2 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden max-w-[80px]",children:n.jsx("div",{className:"h-full bg-blue-500 rounded-full",style:{width:`${(q=te.percent_complete)!=null?q:0}%`}})}),n.jsxs("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:[(B=te.percent_complete)!=null?B:0,"%"]})]})}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",onClick:je=>je.stopPropagation(),children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:()=>t(`/projects/list/${te.name}`),className:"text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 p-2 hover:bg-blue-50 dark:hover:bg-blue-900/30 rounded transition-colors",title:e("common.view"),"aria-label":e("common.view"),children:n.jsx(Hs,{})}),n.jsx("button",{type:"button",onClick:()=>R(te.name),className:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 p-2 hover:bg-green-50 dark:hover:bg-green-900/30 rounded transition-colors",title:e("common.edit","Edit"),"aria-label":e("common.edit","Edit"),children:n.jsx(ha,{})}),n.jsx("button",{type:"button",onClick:()=>I(te.name),className:"text-purple-600 dark:text-purple-400 hover:text-purple-900 dark:hover:text-purple-300 p-2 hover:bg-purple-50 dark:hover:bg-purple-900/30 rounded transition-colors",title:e("common.duplicate","Duplicate"),"aria-label":e("common.duplicate","Duplicate"),children:n.jsx(uu,{})})]})})]},te.name)})})]})}),se>1&&n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 px-4 py-3",children:n.jsx(Wy,{currentPage:i,totalPages:se,totalCount:me,pageSize:u,onPageChange:l})})]})]})},eve=({doctype:e,docname:t,limit:r=50,enabled:a=!0})=>{const[s,i]=y.useState([]),[l,u]=y.useState(!1),[d,f]=y.useState(null),p=y.useCallback(()=>fe(null,null,function*(){if(!(!a||!e||!t)){u(!0),f(null);try{const m=yield Ja.apiCall(`/api/resource/Version?filters=[["ref_doctype","=","${encodeURIComponent(e)}"],["docname","=","${encodeURIComponent(t)}"]]&fields=["name","owner","creation","data"]&order_by=creation desc&limit=${r}`);if(m!=null&&m.data&&m.data.length>0){const x=m.data.map(v=>{let b={added:[],changed:[],removed:[],row_changed:[]};try{b=JSON.parse(v.data||"{}")}catch(j){console.error("Error parsing version data:",j)}const w=(b.changed||[]).map(j=>({field:j[0]||"",oldValue:j[1],newValue:j[2]}));return{name:v.name,owner:v.owner,creation:v.creation,changes:w,added:b.added||[],removed:b.removed||[],rowChanged:b.row_changed||[]}});i(x)}else i([])}catch(m){console.error(`Error fetching audit logs for ${e}/${t}:`,m),f(m instanceof Error?m.message:"Failed to load activity log"),i([])}finally{u(!1)}}}),[e,t,r,a]);return y.useEffect(()=>{p()},[p]),{auditLogs:s,loading:l,error:d,refetch:p}},tve=e=>e?e.replace(/^custom_/,"").replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase()):"",J8=e=>e==null||e===""?"(empty)":e===0?"0":e===1?"1":typeof e=="boolean"?e?"Yes":"No":typeof e=="object"?JSON.stringify(e):String(e),gL=e=>{if(!e)return"";const t=new Date(e),r=new Date,a=r.getTime()-t.getTime(),s=Math.floor(a/6e4),i=Math.floor(a/36e5),l=Math.floor(a/864e5);return s<1?"Just now":s<60?`${s} min${s>1?"s":""} ago`:i<24?`${i} hour${i>1?"s":""} ago`:l<7?`${l} day${l>1?"s":""} ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:t.getFullYear()!==r.getFullYear()?"numeric":void 0,hour:"2-digit",minute:"2-digit"})},xL=e=>{if(!e)return"Unknown";const t=e.indexOf("@");return t===-1?e:e.substring(0,t)},rve=e=>{const t=e.toLowerCase();return t.includes("status")||t.includes("state")||t.includes("workflow")?"text-purple-600 dark:text-purple-400":t.includes("date")?"text-blue-600 dark:text-blue-400":t.includes("technician")||t.includes("supervisor")||t.includes("assigned")||t.includes("location")||t.includes("department")||t.includes("building")||t.includes("room")?"text-green-600 dark:text-green-400":"text-gray-600 dark:text-gray-400"},ave=({log:e,isLatest:t,compact:r})=>{const a=r?"w-2.5 h-2.5":"w-3 h-3",s=r?"w-5 h-5":"w-6 h-6",i=r?8:10,l=r?"text-[10px]":"text-xs",u=r?"text-[9px]":"text-[10px]";return n.jsxs("div",{className:`relative ${r?"pl-6":"pl-8"}`,children:[n.jsx("div",{className:`absolute ${r?"left-1":"left-1.5"} top-1.5 ${a} rounded-full border-2 border-white dark:border-gray-800 ${t?"bg-blue-500":"bg-gray-300 dark:bg-gray-600"}`}),n.jsxs("div",{className:`${r?"p-2":"p-3"} rounded-lg ${t?"bg-blue-50 dark:bg-blue-900/20 border border-blue-100 dark:border-blue-800/50":"bg-gray-50 dark:bg-gray-700/50"}`,children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:`${s} rounded-full bg-gray-200 dark:bg-gray-600 flex items-center justify-center`,children:n.jsx(sh,{className:"text-gray-500 dark:text-gray-400",size:i})}),n.jsx("span",{className:`${l} font-medium text-gray-700 dark:text-gray-300`,children:xL(e.owner)})]}),n.jsxs("div",{className:`flex items-center gap-1 ${l} text-gray-500 dark:text-gray-400`,children:[n.jsx(ds,{size:i}),n.jsx("span",{title:new Date(e.creation).toLocaleString(),children:gL(e.creation)})]})]}),n.jsxs("div",{className:"space-y-1",children:[e.changes.length>0?e.changes.map((d,f)=>n.jsxs("div",{className:l,children:[n.jsx("span",{className:`font-medium ${rve(d.field)}`,children:tve(d.field)}),n.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:" changed from "}),n.jsx("span",{className:`px-1 py-0.5 bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400 rounded ${u} font-mono`,children:J8(d.oldValue)}),n.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:" → "}),n.jsx("span",{className:`px-1 py-0.5 bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400 rounded ${u} font-mono`,children:J8(d.newValue)})]},f)):n.jsx("p",{className:`${l} text-gray-500 dark:text-gray-400 italic`,children:"Document updated"}),e.added&&e.added.length>0&&n.jsxs("div",{className:`${l} text-green-600 dark:text-green-400`,children:[n.jsx("span",{className:"font-medium",children:"Added:"})," ",e.added.length," item(s)"]}),e.removed&&e.removed.length>0&&n.jsxs("div",{className:`${l} text-red-600 dark:text-red-400`,children:[n.jsx("span",{className:"font-medium",children:"Removed:"})," ",e.removed.length," item(s)"]}),e.rowChanged&&e.rowChanged.length>0&&n.jsxs("div",{className:`${l} text-orange-600 dark:text-orange-400`,children:[n.jsx("span",{className:"font-medium",children:"Modified:"})," ",e.rowChanged.length," row(s)"]})]})]})]})},Q8=({creationDate:e,createdBy:t,doctype:r,compact:a})=>{const s=a?"w-2.5 h-2.5":"w-3 h-3",i=a?"w-5 h-5":"w-6 h-6",l=a?8:10,u=a?"text-[10px]":"text-xs",d=r.replace(/_/g," ");return n.jsxs("div",{className:`relative ${a?"pl-6":"pl-8"}`,children:[n.jsx("div",{className:`absolute ${a?"left-1":"left-1.5"} top-1.5 ${s} rounded-full border-2 border-white dark:border-gray-800 bg-green-500`}),n.jsxs("div",{className:`${a?"p-2":"p-3"} rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-100 dark:border-green-800/50`,children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:`${i} rounded-full bg-green-200 dark:bg-green-800 flex items-center justify-center`,children:n.jsx(sh,{className:"text-green-600 dark:text-green-400",size:l})}),n.jsx("span",{className:`${u} font-medium text-gray-700 dark:text-gray-300`,children:xL(t)})]}),n.jsxs("div",{className:`flex items-center gap-1 ${u} text-gray-500 dark:text-gray-400`,children:[n.jsx(ds,{size:l}),n.jsx("span",{title:new Date(e).toLocaleString(),children:gL(e)})]})]}),n.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 bg-green-100 dark:bg-green-800/50 text-green-700 dark:text-green-300 rounded ${u} font-medium`,children:[n.jsx(Or,{size:l}),"Created this ",d]})]})]})},Yn=({doctype:e,docname:t,creationDate:r,createdBy:a,title:s="Activity Log",limit:i=50,initialVisible:l=5,collapsible:u=!0,startCollapsed:d=!1,compact:f=!1,className:p="",onRefresh:m})=>{const[x,v]=y.useState(!d),[b,w]=y.useState(!1),{auditLogs:j,loading:k,refetch:C}=eve({doctype:e,docname:t,limit:i,enabled:!!t}),N=()=>{C(),m==null||m()};if(!t)return null;const O=f?14:16,E=f?"text-sm":"text-base",A=f?"left-2":"left-3",T=f?"text-[10px]":"text-xs",P=f?8:10,D=b?j:j.slice(0,l);return n.jsxs("div",{className:`bg-white dark:bg-gray-800 rounded-xl shadow-md border border-gray-200 dark:border-gray-700 overflow-hidden ${p}`,children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:`flex items-center gap-2 flex-1 ${u?"cursor-pointer":""}`,onClick:()=>u&&v(!x),children:[n.jsx(kq,{className:"text-blue-500",size:O}),n.jsx("h2",{className:`${E} font-semibold text-gray-800 dark:text-white`,children:s}),j.length>0&&n.jsx("span",{className:"px-1.5 py-0.5 bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400 rounded-full text-[10px] font-medium",children:j.length})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:z=>{z.stopPropagation(),N()},disabled:k,className:"p-1 text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded transition-colors disabled:opacity-50",title:"Refresh activity log",children:n.jsx(en,{className:k?"animate-spin":"",size:f?10:12})}),u&&n.jsx("button",{type:"button",onClick:()=>v(!x),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1",children:x?n.jsx(ps,{size:f?12:14}):n.jsx(nr,{size:f?12:14})})]})]}),x&&n.jsxs("div",{className:"p-3",children:[k&&n.jsxs("div",{className:"flex items-center justify-center py-6",children:[n.jsx(vt,{className:"animate-spin text-blue-500 mr-2",size:14}),n.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Loading..."})]}),!k&&j.length===0&&n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:`absolute ${A} top-0 bottom-0 w-0.5 bg-gray-200 dark:bg-gray-700`}),n.jsxs("div",{className:`relative ${f?"pl-6":"pl-8"} mb-3`,children:[n.jsx("div",{className:`absolute ${f?"left-1":"left-1.5"} top-1 ${f?"w-2.5 h-2.5":"w-3 h-3"} rounded-full border-2 border-white dark:border-gray-800 bg-gray-300 dark:bg-gray-600`}),n.jsx("div",{className:`${f?"p-2":"p-3"} rounded-lg bg-gray-50 dark:bg-gray-700/50`,children:n.jsx("p",{className:`${f?"text-[10px]":"text-xs"} text-gray-500 dark:text-gray-400 italic`,children:"No changes recorded yet"})})]}),r&&a&&n.jsx(Q8,{creationDate:r,createdBy:a,doctype:e,compact:f})]}),!k&&j.length>0&&n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:`absolute ${A} top-0 bottom-0 w-0.5 bg-gray-200 dark:bg-gray-700`}),n.jsx("div",{className:"space-y-3",children:D.map((z,G)=>n.jsx(ave,{log:z,isLatest:G===0,compact:f},z.name))}),j.length>l&&n.jsx("div",{className:"mt-3 text-center",children:n.jsx("button",{type:"button",onClick:()=>w(!b),className:`inline-flex items-center gap-1 px-2 py-1 ${T} font-medium text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-md transition-colors`,children:b?n.jsxs(n.Fragment,{children:[n.jsx(ps,{size:P})," Show Less"]}):n.jsxs(n.Fragment,{children:[n.jsx(nr,{size:P})," Show All (",j.length,")"]})})}),r&&a&&n.jsx("div",{className:"mt-3",children:n.jsx(Q8,{creationDate:r,createdBy:a,doctype:e,compact:f})})]})]})]})},fa="Seera Arabia",xt="SAR",i0="KSA Tax Charges - SA";function mi(e){var r;const t=(r=e.tax_rate)!=null?r:e.rate;return typeof t=="number"&&!Number.isNaN(t)?t:0}function Va(e){const t=(e||"").trim();return!t||t==="INR"?xt:t}function yL(e){return`SAR ${Number(e!=null?e:0).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}const jl=({title:e,icon:t,defaultOpen:r=!0,children:a,badge:s})=>{const[i,l]=y.useState(r);return n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden shadow-sm",children:[n.jsxs("button",{type:"button",onClick:()=>l(u=>!u),className:"w-full flex items-center justify-between px-5 py-3.5 hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors text-left",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-700 dark:text-gray-200",children:[t,n.jsx("span",{children:e}),s]}),i?n.jsx(nr,{className:"text-gray-400 text-xs flex-shrink-0"}):n.jsx(bs,{className:"text-gray-400 text-xs flex-shrink-0"})]}),i&&n.jsx("div",{className:"px-5 py-5 bg-white dark:bg-gray-800 border-t border-gray-100 dark:border-gray-700/50",children:a})]})},Mt=({children:e,required:t})=>n.jsxs("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),Lt=({children:e})=>n.jsx("div",{className:"px-3 py-2.5 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-900/30 rounded-lg min-h-[38px] flex items-center border border-gray-100 dark:border-gray-700/50",children:e||n.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:"—"})}),Z8=({icon:e,label:t,value:r,loading:a,color:s,onClick:i})=>n.jsxs("button",{onClick:i,disabled:!i,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl border text-xs font-semibold transition-all ${s} ${i?"hover:shadow-sm hover:scale-105 cursor-pointer":"cursor-default"}`,children:[n.jsx("span",{children:e}),a?n.jsx(vt,{className:"animate-spin",size:10}):n.jsx("span",{className:"font-bold",children:r}),n.jsx("span",{className:"font-normal opacity-80",children:t})]}),eO=e=>{switch(e==null?void 0:e.toLowerCase()){case"open":return"bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300 border border-green-200/90 dark:border-green-800";case"completed":return"bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300 border border-emerald-200/90 dark:border-emerald-800";case"cancelled":return"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400 border border-slate-200 dark:border-slate-600";default:return"bg-slate-100 text-slate-600 dark:bg-slate-700 dark:text-slate-400 border border-slate-200 dark:border-slate-600"}},tO=e=>{switch(e==null?void 0:e.toLowerCase()){case"high":return"bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300 border border-red-200 dark:border-red-800";case"medium":return"bg-purple-100 text-purple-800 dark:bg-purple-900/40 dark:text-purple-300 border border-purple-200 dark:border-purple-700";case"low":return"bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300 border border-green-200 dark:border-green-800";case"urgent":return"bg-red-200 text-red-900 dark:bg-red-800/50 dark:text-red-200 border border-red-300 dark:border-red-700";default:return"bg-slate-100 text-slate-600 dark:bg-slate-700 border border-slate-200 dark:border-slate-600"}},Pf=e=>e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"—",_l=yL,Fs=e=>e?e.substring(0,8):"",nve=()=>{var F,X,R,I,te,q;const{t:e}=sr(),{projectName:t}=Hn(),[r]=dn(),a=Ut(),s=t==="new",i=s?null:t||null,l=r.get("source_so")||"",u=y.useMemo(()=>s&&r.get("duplicate")||"",[s,r]),d=y.useMemo(()=>!s&&(r.get("edit")||"")==="1",[s,r]),[f,p]=y.useState(s),[m,x]=y.useState(null),[v,b]=y.useState(""),[w,j]=y.useState([]),{project:k,loading:C,error:N,refetch:O}=Mde(i),{tasks:E,loading:A}=Ide(i),{timesheets:T,loading:P}=$de(i),{createProject:D,updateProject:z,loading:G}=np(),V=T.filter(B=>B.docstatus===1),ne={costing:V.reduce((B,je)=>B+(je.total_costing_amount||0),0),billable:V.reduce((B,je)=>B+(je.total_billable_amount||0),0),hours:V.reduce((B,je)=>B+(je.total_hours||0),0)},ge={project_name:"",status:"Open",is_active:"Yes",priority:"Medium",company:fa,customer:"",project_template:"",project_type:"",custom_project_manager:"",expected_start_date:"",expected_end_date:"",department:"",percent_complete_method:"Task Completion",percent_complete:0,description:"",notes:"",estimated_costing:void 0,collect_progress:0,holiday_list:"",frequency:"Hourly",day_to_send:"Monday",from_time:"",to_time:"",first_email:"",second_email:"",daily_time_to_send:"",weekly_time_to_send:"",subject:"",message:""},[Z,U]=y.useState(ge),[ce,xe]=y.useState(!1),[be,me]=y.useState([]),[oe,L]=y.useState([]),H=B=>{var je,Ce;return U({project_name:B.project_name||"",status:B.status||"Open",is_active:B.is_active||"Yes",priority:B.priority||"Medium",company:B.company||fa,customer:B.customer||"",project_template:B.project_template||"",project_type:B.project_type||"",custom_project_manager:B.custom_project_manager||"",expected_start_date:B.expected_start_date||"",expected_end_date:B.expected_end_date||"",department:B.department||"",percent_complete_method:B.percent_complete_method||"Task Completion",percent_complete:(je=B.percent_complete)!=null?je:0,description:B.description||"",notes:Bj(B.notes||"")||"",estimated_costing:B.estimated_costing!=null?B.estimated_costing:void 0,collect_progress:(Ce=B.collect_progress)!=null?Ce:0,holiday_list:B.holiday_list||"",frequency:B.frequency||"Hourly",from_time:B.from_time||"",to_time:B.to_time||"",first_email:B.first_email||"",second_email:B.second_email||"",daily_time_to_send:B.daily_time_to_send||"",day_to_send:B.day_to_send||"Monday",weekly_time_to_send:B.weekly_time_to_send||"",subject:B.subject||"",message:B.message||""})};y.useEffect(()=>{k&&!s&&H(k)},[k,s]),y.useEffect(()=>{d&&p(!0)},[d]),y.useEffect(()=>{s&&!u&&me([])},[s,u]),y.useEffect(()=>{!k||s||me((k[If]||[]).map(B=>({name:B.name,update_:B.update_,date:B.date?String(B.date).slice(0,10):"",task:B.task})))},[k,s]),y.useEffect(()=>{if(!i||s){L([]);return}let B=!1;const je=E.map(Ce=>Ce.name).filter(Boolean).slice(0,120);return fe(null,null,function*(){const Ce=yield Promise.all(je.map(Ee=>wt.getTask(Ee).catch(()=>null)));if(B)return;const ye=[];for(const Ee of Ce){if(!Ee)continue;const Xe=Ee.custom_task_updates||[];for(const tt of Xe)ye.push(Se(ee({},tt),{task:tt.task||Ee.name,date:tt.date?String(tt.date).slice(0,10):tt.date}))}L(ye)}),()=>{B=!0}},[i,s,E]);const K=y.useMemo(()=>{const B=oe.map(ye=>({row:ye,source:"task"})),je=be.map((ye,Ee)=>({row:ye,source:"project",projectIndex:Ee})),Ce=ye=>String(ye.date||"").slice(0,10)||"";return[...B,...je].sort((ye,Ee)=>Ce(Ee.row).localeCompare(Ce(ye.row)))},[oe,be]);y.useEffect(()=>{if(!s||!u)return;let B=!1;return xe(!0),wt.getProject(u).then(je=>{if(B)return;const Ce=Se(ee({},je),{name:"",project_name:je.project_name?`${je.project_name} (Copy)`:""});H(Ce);const ye=Ce[If]||[];me(ye.map(Ee=>({update_:Ee.update_,date:Ee.date?String(Ee.date).slice(0,10):"",task:Ee.task}))),p(!0)}).catch(()=>{}).finally(()=>{B||xe(!1)}),()=>{B=!0}},[s,u]),y.useEffect(()=>{if(!i||s){x(null),j([]);return}let B=!1;return cs.getSalesOrderCount([["Sales Order","project","=",i]]).then(je=>{B||x(je)}).catch(()=>{B||x(0)}),()=>{B=!0}},[i,s]),y.useEffect(()=>{if(l){b(l);return}if(!i||s){b("");return}cs.getSalesOrderNamesForProject(i,1).then(B=>b((B==null?void 0:B[0])||"")).catch(()=>b(""))},[i,s,l]),y.useEffect(()=>{j([])},[i,s,m]);const Y=(B,je)=>U(Ce=>Se(ee({},Ce),{[B]:je})),re=s||f,de=s||f||!!Number(Z.collect_progress),ie="w-full px-3 py-2.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:border-blue-400 focus:outline-none transition-colors",se="w-full px-3 py-2.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:border-blue-400 focus:outline-none transition-colors",he=()=>fe(null,null,function*(){var je,Ce;if(!((je=Z.project_name)!=null&&je.trim())){$e.error("Project Name is required",{icon:n.jsx(Fr,{})});return}const B=Se(ee({},Z),{estimated_costing:(Ce=Z.estimated_costing)!=null?Ce:0,[If]:$w(be)});try{if(s){const ye=yield D(B);if($e.success("Project created successfully",{icon:n.jsx(Or,{})}),p(!1),l){try{yield cs.updateSalesOrder(l,{project:ye.name})}catch(Ee){$e.error(Ya(Ee)||"Failed to link Sales Order",{icon:n.jsx(Fr,{})})}a(`/projects/list/${ye.name}?source_so=${encodeURIComponent(l)}`);return}a(`/projects/list/${ye.name}`)}else yield z(t,B),$e.success("Project saved",{icon:n.jsx(Or,{})}),p(!1),O()}catch(ye){$e.error(Ya(ye)||"Error saving project",{icon:n.jsx(Fr,{})})}}),_e=()=>{k&&(H(k),me((k[If]||[]).map(B=>({name:B.name,update_:B.update_,date:B.date?String(B.date).slice(0,10):"",task:B.task})))),p(!1)};return C&&!s?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[n.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-[3px] border-blue-600 border-t-transparent"}),n.jsx("p",{className:"text-sm text-gray-500",children:"Loading project…"})]})}):!s&&(N||!k)?n.jsxs("div",{className:"p-6",children:[n.jsxs("button",{onClick:()=>a("/projects/list"),className:"flex items-center gap-2 text-gray-600 dark:text-gray-400 mb-4 text-sm hover:text-gray-900",children:[n.jsx(da,{})," Back to Projects"]}),n.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 rounded-lg text-red-700 dark:text-red-300",children:N||"Project not found"})]}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsx("div",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 shadow-sm",children:n.jsxs("div",{className:"px-6 py-4",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-xs mb-3 text-gray-400 dark:text-gray-500",children:[n.jsx("button",{onClick:()=>a("/projects"),className:"hover:text-blue-600 dark:hover:text-blue-400 transition-colors",children:e("projects.moduleTitle","Project Management")}),n.jsx("span",{children:"/"}),n.jsx("button",{onClick:()=>a("/projects/list"),className:"hover:text-blue-600 dark:hover:text-blue-400 transition-colors",children:"Projects"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-600 dark:text-gray-300 font-medium",children:s?"New Project":(k==null?void 0:k.project_name)||t})]}),n.jsxs("div",{className:"flex items-start justify-between gap-4 flex-nowrap overflow-x-auto",children:[n.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n.jsx("button",{onClick:()=>a("/projects/list"),className:"mt-1 p-1.5 rounded-lg text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors flex-shrink-0",children:n.jsx(da,{size:13})}),n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center flex-shrink-0 shadow-sm",children:n.jsx(Id,{className:"text-white text-sm"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white leading-tight",children:s?"New Project":(k==null?void 0:k.project_name)||t}),s&&u&&n.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:["Duplicating from ",n.jsx("span",{className:"font-mono",children:u}),ce?"…":""]}),!s&&n.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 font-mono",children:t})]})]}),!s&&n.jsxs("div",{className:"flex items-center flex-wrap gap-2 mt-3 ml-12",children:[n.jsx("span",{className:`px-2.5 py-1 rounded-lg text-xs font-semibold ${eO((k==null?void 0:k.status)||"")}`,children:(k==null?void 0:k.status)||"Open"}),n.jsx("span",{className:`px-2.5 py-1 rounded-lg text-xs font-semibold ${tO((k==null?void 0:k.priority)||"")}`,children:(k==null?void 0:k.priority)||"—"}),n.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500 dark:text-gray-400",children:[n.jsx("div",{className:"w-20 h-1.5 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-green-600 dark:bg-green-500 rounded-full transition-all",style:{width:`${Math.min((F=k==null?void 0:k.percent_complete)!=null?F:0,100)}%`}})}),n.jsxs("span",{className:"font-semibold tabular-nums",children:[(X=k==null?void 0:k.percent_complete)!=null?X:0,"%"]})]}),n.jsx(Z8,{icon:n.jsx(Gc,{size:10}),label:"Tasks",value:E.length,loading:A,color:"bg-purple-50 dark:bg-purple-900/20 border-purple-200 dark:border-purple-700 text-purple-800 dark:text-purple-200",onClick:()=>a(`/projects/tasks?project=${t}`)}),n.jsx(Z8,{icon:n.jsx(ds,{size:10}),label:"Timesheets",value:T.length,loading:P,color:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-700 text-green-800 dark:text-green-200",onClick:()=>a(`/projects/timesheets?project=${encodeURIComponent(t)}`)})]})]})]}),n.jsxs("div",{className:"flex gap-2 flex-shrink-0 flex-nowrap items-center whitespace-nowrap",children:[!s&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:()=>a(`/projects/tasks/new?project=${encodeURIComponent(t||"")}`),className:"flex items-center gap-1.5 px-3 py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-xs font-medium shadow-sm transition-colors",children:[n.jsx(Pt,{size:10}),n.jsx(Gc,{size:10})," Task"]}),n.jsxs("button",{type:"button",onClick:()=>{const B=new URLSearchParams;B.set("project",t||""),Z.customer&&B.set("customer",Z.customer),Z.company&&B.set("company",Z.company),a(`/projects/timesheets/new?${B.toString()}`)},className:"flex items-center gap-1.5 px-3 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-xs font-medium shadow-sm transition-colors",children:[n.jsx(Pt,{size:10}),n.jsx(ds,{size:10})," Timesheet"]}),n.jsxs("button",{type:"button",onClick:()=>{const B=new URLSearchParams;B.set("project",t||""),Z.customer&&B.set("customer",Z.customer),Z.company&&B.set("company",Z.company),a(`/sales-orders/new?${B.toString()}`)},className:"flex items-center gap-1.5 px-3 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg text-xs font-medium shadow-sm transition-colors",children:[n.jsx(Pt,{size:10}),n.jsx(Ld,{size:10})," Sales Order"]}),n.jsxs("button",{type:"button",onClick:()=>{const B=new URLSearchParams;B.set("project",t||""),Z.company&&B.set("company",Z.company),a(`/material-requests/new?${B.toString()}`)},className:"flex items-center gap-1.5 px-3 py-2 bg-orange-600 hover:bg-orange-700 text-white rounded-lg text-xs font-medium shadow-sm transition-colors",children:[n.jsx(Pt,{size:10}),n.jsx(zd,{size:10})," Material Request"]})]}),!f&&!s&&n.jsxs("button",{onClick:()=>p(!0),className:"flex items-center gap-1.5 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium transition-all shadow-lg hover:shadow-xl",children:[n.jsx(ha,{size:12})," Edit"]}),(f||s)&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:he,disabled:G,className:"flex items-center gap-1.5 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg disabled:opacity-50 text-sm font-medium transition-all shadow-lg hover:shadow-xl",children:[G?n.jsx(vt,{className:"animate-spin",size:12}):n.jsx(Cn,{size:12}),G?"Saving…":"Save"]}),!s&&n.jsxs("button",{onClick:_e,className:"flex items-center gap-1.5 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-sm text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:[n.jsx(yt,{size:12})," Cancel"]})]})]})]})]})}),n.jsxs("div",{className:"px-6 py-6 space-y-3",children:[n.jsx(jl,{title:"Details",defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-5",children:[n.jsxs("div",{children:[n.jsx(Mt,{required:!0,children:"Project Name"}),re?n.jsx("input",{type:"text",value:Z.project_name||"",onChange:B=>Y("project_name",B.target.value),className:ie,placeholder:"Enter project name"}):n.jsx(Lt,{children:Z.project_name})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Expected Start Date"}),re?n.jsx("input",{type:"date",value:Z.expected_start_date||"",onChange:B=>Y("expected_start_date",B.target.value),className:ie}):n.jsx(Lt,{children:Pf(Z.expected_start_date)})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Status"}),re?n.jsxs("select",{value:Z.status||"Open",onChange:B=>Y("status",B.target.value),className:se,children:[n.jsx("option",{value:"Open",children:"Open"}),n.jsx("option",{value:"Completed",children:"Completed"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]}):n.jsx(Lt,{children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${eO(Z.status||"")}`,children:Z.status})})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Expected End Date"}),re?n.jsx("input",{type:"date",value:Z.expected_end_date||"",onChange:B=>Y("expected_end_date",B.target.value),className:ie}):n.jsx(Lt,{children:Pf(Z.expected_end_date)})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Project Type"}),re?n.jsx(Be,{label:"Project Type",hideLabel:!0,doctype:"Project Type",value:Z.project_type||"",onChange:B=>Y("project_type",B),placeholder:"Select project type…"}):n.jsx(Lt,{children:Z.project_type||"—"})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Priority"}),re?n.jsxs("select",{value:Z.priority||"Medium",onChange:B=>Y("priority",B.target.value),className:se,children:[n.jsx("option",{value:"Low",children:"Low"}),n.jsx("option",{value:"Medium",children:"Medium"}),n.jsx("option",{value:"High",children:"High"}),n.jsx("option",{value:"Urgent",children:"Urgent"})]}):n.jsx(Lt,{children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${tO(Z.priority||"")}`,children:Z.priority})})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Project Manager"}),re?n.jsx(Be,{label:"Project Manager",hideLabel:!0,doctype:"User",value:Z.custom_project_manager||"",onChange:B=>Y("custom_project_manager",B),placeholder:"Select project manager…"}):n.jsx(Lt,{children:Z.custom_project_manager||"—"})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Department"}),re?n.jsx(Be,{label:"Department",hideLabel:!0,doctype:"Department",value:Z.department||"",onChange:B=>Y("department",B),placeholder:"Select department…",allowQuickCreate:!0}):n.jsx(Lt,{children:Z.department||"—"})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Is Active"}),re?n.jsxs("select",{value:Z.is_active||"Yes",onChange:B=>Y("is_active",B.target.value),className:se,children:[n.jsx("option",{value:"Yes",children:"Yes"}),n.jsx("option",{value:"No",children:"No"})]}):n.jsx(Lt,{children:Z.is_active})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"% Complete Method"}),re?n.jsxs("select",{value:Z.percent_complete_method||"Task Completion",onChange:B=>Y("percent_complete_method",B.target.value),className:se,children:[n.jsx("option",{value:"Manual",children:"Manual"}),n.jsx("option",{value:"Task Completion",children:"Task Completion"}),n.jsx("option",{value:"Task Progress",children:"Task Progress"}),n.jsx("option",{value:"Task Weight",children:"Task Weight"})]}):n.jsx(Lt,{children:Z.percent_complete_method})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"From Template"}),s?n.jsx(Be,{label:"From Template",hideLabel:!0,doctype:"Project Template",value:Z.project_template||"",onChange:B=>Y("project_template",B),placeholder:"Select template…",allowQuickCreate:!0}):n.jsx(Lt,{children:Z.project_template||"—"})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"% Completed"}),re&&Z.percent_complete_method==="Manual"?n.jsx("input",{type:"number",min:0,max:100,step:.001,value:(R=Z.percent_complete)!=null?R:0,onChange:B=>Y("percent_complete",parseFloat(B.target.value)||0),className:ie}):n.jsx(Lt,{children:n.jsxs("div",{className:"flex items-center gap-2 w-full min-w-0",children:[n.jsx("div",{className:"flex-1 h-2 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden min-w-0",children:n.jsx("div",{className:"h-full bg-green-600 dark:bg-green-500 rounded-full transition-all",style:{width:`${Math.min((I=Z.percent_complete)!=null?I:0,100)}%`}})}),n.jsxs("span",{className:"text-sm font-semibold min-w-[52px] text-right tabular-nums flex-shrink-0",children:[((te=Z.percent_complete)!=null?te:0).toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}),"%"]})]})})]})]})}),n.jsx(jl,{title:"Customer Details",defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-5",children:[n.jsxs("div",{children:[n.jsx(Mt,{children:"Customer"}),re?n.jsx(Be,{label:"Customer",hideLabel:!0,doctype:"Customer",value:Z.customer||"",onChange:B=>Y("customer",B),placeholder:"Select customer…",allowQuickCreate:!0}):n.jsx(Lt,{children:Z.customer||"—"})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Sales Order"}),!s&&i?n.jsx(Lt,{children:v?n.jsx("button",{type:"button",onClick:()=>a(`/sales-orders/${encodeURIComponent(v)}`),className:"text-blue-700 hover:underline font-medium",title:"Open sales order",children:v}):m!=null&&m>0?n.jsxs("button",{type:"button",onClick:()=>a(`/sales-orders?project=${encodeURIComponent(t)}`),className:"text-blue-700 hover:underline font-medium",title:"Open sales orders list",children:[m," linked — open list"]}):n.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:"—"})}):n.jsx(Lt,{children:n.jsx("span",{className:"text-gray-400",children:"—"})})]})]})}),n.jsx(jl,{title:"Notes",defaultOpen:!0,children:re?n.jsx("textarea",{rows:4,value:Z.notes||"",onChange:B=>Y("notes",B.target.value),className:"w-full px-3 py-2.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-400 focus:outline-none resize-y",placeholder:"Add notes…"}):n.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 whitespace-pre-wrap min-h-[40px] leading-relaxed",children:Bj(Z.notes)||n.jsx("span",{className:"text-gray-400 italic",children:"No notes"})})}),n.jsx(jl,{title:"Updates",icon:n.jsx(dP,{className:"text-violet-500",size:13}),defaultOpen:!0,badge:!s&&K.length>0?n.jsx("span",{className:"ml-2 text-[10px] font-mono bg-white/20 px-1.5 py-0.5 rounded",children:K.length}):null,children:n.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:[n.jsxs("div",{className:`grid ${re&&!s?"grid-cols-[40px_1fr_8rem_1fr_36px]":"grid-cols-[40px_1fr_8rem_1fr]"} bg-gray-50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-700`,children:[n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"No."}),n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"Update"}),n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"Date"}),n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"Task"}),re&&!s&&n.jsx("div",{className:"py-2 w-9"})]}),K.length===0?n.jsx("div",{className:"py-8 text-center text-sm text-gray-400 italic",children:"No updates yet."}):n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:K.map((B,je)=>{const{row:Ce,source:ye,projectIndex:Ee}=B,Xe=re&&!s&&ye==="project"&&Ee!==void 0;return n.jsxs("div",{className:`grid ${Xe?"grid-cols-[40px_1fr_8rem_1fr_36px]":"grid-cols-[40px_1fr_8rem_1fr]"} items-center hover:bg-gray-50/80 dark:hover:bg-gray-800/40`,children:[n.jsx("div",{className:"px-3 py-2 text-xs text-gray-500 font-medium",children:je+1}),n.jsx("div",{className:"px-3 py-1.5 min-w-0",children:Xe?n.jsx("input",{type:"text",value:Ce.update_||"",onChange:tt=>{const ve=Ee;me(Oe=>Oe.map((st,ct)=>ct===ve?Se(ee({},st),{update_:tt.target.value}):st))},className:ie,placeholder:"Update…"}):n.jsx("span",{className:"text-sm text-gray-800 dark:text-gray-200",children:Ce.update_||"—"})}),n.jsx("div",{className:"px-3 py-1.5",children:Xe?n.jsx("input",{type:"date",value:Ce.date?String(Ce.date).slice(0,10):"",onChange:tt=>{const ve=Ee;me(Oe=>Oe.map((st,ct)=>ct===ve?Se(ee({},st),{date:tt.target.value}):st))},className:ie}):n.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:Ce.date?Pf(String(Ce.date).slice(0,10)):"—"})}),n.jsx("div",{className:"px-3 py-1.5 min-w-0",children:Xe?n.jsx(Be,{label:"Task",hideLabel:!0,doctype:"Task",value:Ce.task||"",onChange:tt=>{const ve=Ee;me(Oe=>Oe.map((st,ct)=>ct===ve?Se(ee({},st),{task:tt}):st))},placeholder:"Task…",filters:i?{project:i}:void 0,compact:!0}):Ce.task?n.jsx("button",{type:"button",onClick:()=>a(`/projects/tasks/${encodeURIComponent(Ce.task)}`),className:"text-sm text-indigo-600 dark:text-indigo-400 hover:underline font-mono truncate max-w-full block text-left",children:Ce.task}):n.jsx("span",{className:"text-sm text-gray-400",children:"—"})}),Xe&&n.jsx("div",{className:"flex justify-center",children:n.jsx("button",{type:"button",onClick:()=>{const tt=Ee;me(ve=>ve.filter((Oe,st)=>st!==tt))},className:"p-1.5 text-red-400 hover:text-red-600 rounded transition-colors",title:"Remove row",children:n.jsx(Za,{size:11})})})]},`${ye}-${Ce.name||Ee}-${je}`)})}),re&&!s&&n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 px-3 py-2 bg-gray-50 dark:bg-gray-900/30",children:n.jsxs("button",{type:"button",onClick:()=>me(B=>[...B,{}]),className:"flex items-center gap-1.5 text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})}),s&&n.jsx("p",{className:"text-[11px] text-gray-500 px-3 py-2 border-t border-gray-100 dark:border-gray-700",children:"Save the project first to add updates and to load task-sourced rows."})]})}),!s&&k&&n.jsx(jl,{title:"Start and End Dates",icon:n.jsx(ds,{className:"text-sky-500",size:13}),defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-5",children:[n.jsxs("div",{children:[n.jsx(Mt,{children:"Actual Start Date (via Timesheet)"}),n.jsx(Lt,{children:Pf(k.actual_start_date)})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Actual End Date (via Timesheet)"}),n.jsx(Lt,{children:Pf(k.actual_end_date)})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Actual Time in Hours (via Timesheet)"}),n.jsx(Lt,{children:k.actual_time!=null&&k.actual_time!==""?Number(k.actual_time).toLocaleString("en-US",{maximumFractionDigits:2}):"—"})]})]})}),n.jsx(jl,{title:"Costing and Billing",icon:n.jsx(Dl,{className:"text-emerald-500",size:13}),defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-5",children:[n.jsxs("div",{children:[n.jsx(Mt,{children:"Estimated Cost"}),re?n.jsx("input",{type:"number",min:0,step:"0.01",value:Z.estimated_costing===void 0||Z.estimated_costing===null?"":Z.estimated_costing,onChange:B=>{const je=B.target.value;if(je===""){Y("estimated_costing",void 0);return}const Ce=parseFloat(je);Y("estimated_costing",Number.isFinite(Ce)?Ce:void 0)},className:ie}):n.jsx(Lt,{children:_l(k==null?void 0:k.estimated_costing)})]}),s?n.jsx("div",{}):n.jsxs("div",{children:[n.jsx(Mt,{children:"Total Sales Amount (via Sales Order)"}),n.jsx(Lt,{children:_l(k==null?void 0:k.total_sales_amount)})]}),s?n.jsx("div",{}):n.jsxs("div",{children:[n.jsx(Mt,{children:"Total Costing Amount (via Timesheet)"}),n.jsx(Lt,{children:_l(ne.costing||(k==null?void 0:k.total_costing_amount))})]}),s?n.jsx("div",{}):n.jsxs("div",{children:[n.jsx(Mt,{children:"Total Billable Amount (via Timesheet)"}),n.jsx(Lt,{children:_l(ne.billable||(k==null?void 0:k.total_billable_amount))})]}),s?n.jsx("div",{}):n.jsxs("div",{children:[n.jsx(Mt,{children:"Total Purchase Cost (via Purchase Invoice)"}),n.jsx(Lt,{children:_l(k==null?void 0:k.total_purchase_cost)})]}),s?n.jsx("div",{}):n.jsxs("div",{children:[n.jsx(Mt,{children:"Total Billed Amount (via Sales Invoice)"}),n.jsx(Lt,{children:_l(k==null?void 0:k.total_billed_amount)})]}),n.jsxs("div",{children:[n.jsx(Mt,{required:!0,children:"Hospital"}),re?n.jsx(Be,{label:"Company",hideLabel:!0,doctype:"Company",value:Z.company||"",onChange:B=>Y("company",B),placeholder:"Select company…"}):n.jsx(Lt,{children:Z.company||"—"})]}),s?n.jsx("div",{}):n.jsxs("div",{children:[n.jsx(Mt,{children:"Total Consumed Material Cost (via Stock Entry)"}),n.jsx(Lt,{children:_l(k==null?void 0:k.total_consumed_material_cost)})]}),s?n.jsx("div",{}):n.jsx("div",{className:"hidden sm:block","aria-hidden":!0}),s?null:n.jsxs("div",{children:[n.jsx(Mt,{children:"Default Cost Center"}),n.jsx(Lt,{children:(k==null?void 0:k.cost_center)||"—"})]})]})}),!s&&n.jsx(jl,{title:"Margin",icon:n.jsx(Pq,{className:"text-purple-500",size:13}),defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-5",children:[n.jsxs("div",{children:[n.jsx(Mt,{children:"Gross Margin"}),n.jsx(Lt,{children:_l(k==null?void 0:k.gross_margin)})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Gross Margin %"}),n.jsxs(Lt,{children:[((q=k==null?void 0:k.per_gross_margin)!=null?q:0).toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}),"%"]})]})]})}),de&&n.jsx(jl,{title:"Monitor Progress",icon:n.jsx(Fq,{className:"text-blue-500",size:13}),defaultOpen:!0,children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"checkbox",id:"collect_progress",checked:!!Z.collect_progress,disabled:!re,onChange:B=>Y("collect_progress",B.target.checked?1:0),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 cursor-pointer disabled:cursor-default"}),n.jsx("label",{htmlFor:"collect_progress",className:`text-sm font-medium ${re?"cursor-pointer":"cursor-default"} text-gray-700 dark:text-gray-300`,children:"Collect Progress"})]}),!!Z.collect_progress&&n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-5 pt-4 border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{children:[n.jsx(Mt,{children:"Holiday List"}),re?n.jsx(Be,{label:"Holiday List",hideLabel:!0,doctype:"Holiday List",value:Z.holiday_list||"",onChange:B=>Y("holiday_list",B),placeholder:"Select holiday list…"}):n.jsx(Lt,{children:Z.holiday_list||"—"})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Frequency To Collect Progress"}),re?n.jsxs("select",{value:Z.frequency||"Hourly",onChange:B=>Y("frequency",B.target.value),className:se,children:[n.jsx("option",{value:"Hourly",children:"Hourly"}),n.jsx("option",{value:"Twice Daily",children:"Twice Daily"}),n.jsx("option",{value:"Daily",children:"Daily"}),n.jsx("option",{value:"Weekly",children:"Weekly"})]}):n.jsx(Lt,{children:Z.frequency})]}),Z.frequency==="Hourly"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx(Mt,{children:"From Time"}),re?n.jsx("input",{type:"time",value:Fs(Z.from_time),onChange:B=>Y("from_time",B.target.value),className:ie}):n.jsx(Lt,{children:Fs(Z.from_time)||"—"})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"To Time"}),re?n.jsx("input",{type:"time",value:Fs(Z.to_time),onChange:B=>Y("to_time",B.target.value),className:ie}):n.jsx(Lt,{children:Fs(Z.to_time)||"—"})]})]}),Z.frequency==="Twice Daily"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx(Mt,{children:"First Email"}),re?n.jsx("input",{type:"time",value:Fs(Z.first_email),onChange:B=>Y("first_email",B.target.value),className:ie}):n.jsx(Lt,{children:Fs(Z.first_email)||"—"})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Second Email"}),re?n.jsx("input",{type:"time",value:Fs(Z.second_email),onChange:B=>Y("second_email",B.target.value),className:ie}):n.jsx(Lt,{children:Fs(Z.second_email)||"—"})]})]}),Z.frequency==="Daily"&&n.jsxs("div",{children:[n.jsx(Mt,{children:"Daily Time to send"}),re?n.jsx("input",{type:"time",value:Fs(Z.daily_time_to_send),onChange:B=>Y("daily_time_to_send",B.target.value),className:ie}):n.jsx(Lt,{children:Fs(Z.daily_time_to_send)||"—"})]}),Z.frequency==="Weekly"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx(Mt,{children:"Day to Send"}),re?n.jsx("select",{value:Z.day_to_send||"Monday",onChange:B=>Y("day_to_send",B.target.value),className:se,children:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"].map(B=>n.jsx("option",{value:B,children:B},B))}):n.jsx(Lt,{children:Z.day_to_send})]}),n.jsxs("div",{children:[n.jsx(Mt,{children:"Weekly Time to send"}),re?n.jsx("input",{type:"time",value:Fs(Z.weekly_time_to_send),onChange:B=>Y("weekly_time_to_send",B.target.value),className:ie}):n.jsx(Lt,{children:Fs(Z.weekly_time_to_send)||"—"})]})]})]}),n.jsxs("div",{className:"space-y-5",children:[n.jsxs("div",{children:[n.jsx(Mt,{required:!0,children:"Subject"}),re?n.jsx("input",{type:"text",value:Z.subject||"",onChange:B=>Y("subject",B.target.value),className:ie,placeholder:"Email subject…"}):n.jsx(Lt,{children:Z.subject||"—"})]}),n.jsxs("div",{children:[n.jsx(Mt,{required:!0,children:"Message"}),re?n.jsx("textarea",{rows:5,value:Z.message||"",onChange:B=>Y("message",B.target.value),className:`${ie} resize-y`,placeholder:"Message to project users…"}):n.jsx("div",{className:"px-3 py-2.5 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-900/30 rounded-lg min-h-[38px] border border-gray-100 dark:border-gray-700/50 whitespace-pre-wrap",children:Z.message||"—"}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1.5",children:"Message will be sent to the users to get their status on the Project"})]})]})]})]})}),!s&&n.jsx(Yn,{doctype:"Project",docname:t||"",creationDate:k==null?void 0:k.creation,createdBy:k==null?void 0:k.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})},sve=e=>{switch(e==null?void 0:e.toLowerCase()){case"open":return"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300";case"working":return"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300";case"completed":return"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300";case"cancelled":return"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400";case"overdue":return"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300";default:return"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}},ive=e=>{switch(e==null?void 0:e.toLowerCase()){case"high":return"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300";case"medium":return"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300";case"low":return"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300";default:return"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}},ove=()=>{const{t:e}=sr(),t=Ut(),[r,a]=dn(),s=20,i=y.useMemo(()=>{const R=parseInt(r.get("page")||"1",10);return Number.isNaN(R)||R<1?1:R},[r]),l=y.useCallback(R=>{const I=typeof R=="function"?R(i):R;a(te=>{const q=new URLSearchParams(te);return q.set("page",String(I)),q})},[i,a]),[u,d]=y.useState(!1),[f,p]=y.useState(r.get("status")||""),[m,x]=y.useState(r.get("priority")||""),[v,b]=y.useState(r.get("project")||""),[w,j]=y.useState(r.get("q")||""),[k,C]=y.useState(r.get("date_filter_by")||""),[N,O]=y.useState(r.get("date_start")||""),[E,A]=y.useState(r.get("date_end")||""),[T,P]=y.useState(r.get("sort_by")||"creation desc"),[D,z]=y.useState(!1),G=y.useRef(!1),V=y.useRef(!0),ne=y.useRef(null),ge=y.useRef(a);y.useEffect(()=>{ge.current=a},[a]);const Z=y.useMemo(()=>{const R={};return f&&(R.status=f),m&&(R.priority=m),v&&(R.project=v),w&&(R.subject=["like",`%${w}%`]),Object.assign(R,n_(k,N,E)),R},[f,m,v,w,k,N,E]),{tasks:U,loading:ce,error:xe,totalCount:be,refetch:me}=Lde({filters:Z,limit_start:(i-1)*s,limit_page_length:s,order_by:T}),oe=y.useMemo(()=>`${i}|${T}|${JSON.stringify(Z)}`,[i,T,Z]),{selectedRows:L,toggleRow:H,toggleAllOnPage:K,allOnPageSelected:Y,someOnPageSelected:re}=Vn(U,oe),de=y.useCallback(()=>Kn({doctype:"Task",filters:Z,orderBy:T}),[Z,T]),ie=Math.ceil(be/s),se=R=>R?new Date(R).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"-",he=()=>{p(""),x(""),b(""),j(""),C(""),O(""),A(""),P("creation desc"),a(R=>{const I=new URLSearchParams(R);return["status","priority","project","q","date_filter_by","date_start","date_end","sort_by"].forEach(te=>I.delete(te)),I.set("page","1"),I})};y.useEffect(()=>{if(!G.current){G.current=!0;return}ge.current(R=>{const I=new URLSearchParams(R);return f?I.set("status",f):I.delete("status"),m?I.set("priority",m):I.delete("priority"),v?I.set("project",v):I.delete("project"),k?I.set("date_filter_by",k):I.delete("date_filter_by"),N?I.set("date_start",N):I.delete("date_start"),E?I.set("date_end",E):I.delete("date_end"),T!=="creation desc"?I.set("sort_by",T):I.delete("sort_by"),I.set("page","1"),I})},[f,m,v,k,N,E,T]),y.useEffect(()=>{if(G.current){if(V.current){V.current=!1;return}return ne.current&&window.clearTimeout(ne.current),ne.current=window.setTimeout(()=>{ge.current(R=>{const I=new URLSearchParams(R);return w?I.set("q",w):I.delete("q"),I.set("page","1"),I})},450),()=>{ne.current&&window.clearTimeout(ne.current)}}},[w]);const _e=!!(f||m||v||w||k&&(N||E)),F=R=>t(`/projects/tasks/${encodeURIComponent(R)}?edit=1`),X=R=>t(`/projects/tasks/new?duplicate=${encodeURIComponent(R)}`);return n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>t("/projects"),className:"text-sm text-gray-500 hover:text-indigo-600 dark:text-gray-400 dark:hover:text-indigo-400",children:e("projects.moduleTitle")}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(Gc,{className:"text-indigo-500"})," ",e("projects.tasksDoctype")]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("button",{type:"button",onClick:()=>z(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all disabled:opacity-50",disabled:be===0&&L.size===0,children:[n.jsx(hn,{})," ",n.jsx("span",{className:"font-medium",children:e("listPages.export")}),L.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:L.size})]}),n.jsxs("button",{onClick:()=>t("/projects/tasks/new"),className:"flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700",children:[n.jsx(Pt,{})," ",e("projects.newTask")]})]})]}),n.jsx(Gn,{isOpen:D,onClose:()=>z(!1),doctype:"Task",selectedCount:L.size,pageCount:U.length,totalCount:be,pageData:U,selectedRows:L,rowKey:"name",onFetchAll:de,fileNamePrefix:"tasks"}),n.jsxs("div",{className:"isolate bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 mb-6",children:[n.jsx("div",{className:"bg-gradient-to-r from-blue-500 to-blue-600 dark:from-blue-600 dark:to-blue-700 px-4 py-2.5 rounded-t-lg",children:n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[n.jsx("button",{onClick:()=>d(R=>!R),className:"text-white hover:bg-white/20 p-1.5 rounded-lg transition-all",children:u?n.jsx(ps,{size:12}):n.jsx(nr,{size:12})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Dh,{className:"text-white",size:13}),n.jsx("span",{className:"text-white font-semibold text-sm",children:"Filters"})]}),_e&&n.jsx("span",{className:"bg-white text-blue-600 px-2 py-0.5 rounded-full text-xs font-bold",children:[w,f,m,v,k&&N].filter(Boolean).length})]}),_e&&n.jsx("div",{className:"flex-1 overflow-x-auto mx-2",children:n.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[w&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Subject:"})," ",w,n.jsx("button",{onClick:()=>j(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),f&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Status:"})," ",f,n.jsx("button",{onClick:()=>p(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),m&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Priority:"})," ",m,n.jsx("button",{onClick:()=>x(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),v&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Project:"})," ",v,n.jsx("button",{onClick:()=>b(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),k&&N&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsxs("span",{className:"font-semibold",children:[k==="creation"?"Created":"Modified",":"]})," ",N,E?` ${E}`:"",n.jsx("button",{onClick:()=>{C(""),O(""),A("")},children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]})]})}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[_e&&n.jsx("button",{onClick:he,className:"text-white/80 hover:text-white text-xs underline whitespace-nowrap",children:"Clear all"}),n.jsx("button",{onClick:()=>me(),className:"text-white hover:bg-white/20 p-1.5 rounded-lg transition-all",title:"Refresh",children:n.jsx(en,{size:12,className:ce?"animate-spin":""})})]})]})}),u&&n.jsx("div",{className:"p-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Search"}),n.jsxs("div",{className:"relative",children:[n.jsx(fn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-400 text-xs"}),n.jsx("input",{type:"text",value:w,onChange:R=>j(R.target.value),onKeyDown:R=>R.key==="Enter"&&R.preventDefault(),placeholder:"Search by task subject…",className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Status"}),n.jsxs("select",{value:f,onChange:R=>p(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none",children:[n.jsx("option",{value:"",children:"All Status"}),n.jsx("option",{value:"Open",children:"Open"}),n.jsx("option",{value:"Working",children:"Working"}),n.jsx("option",{value:"Completed",children:"Completed"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Priority"}),n.jsxs("select",{value:m,onChange:R=>x(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none",children:[n.jsx("option",{value:"",children:"All Priority"}),n.jsx("option",{value:"High",children:"High"}),n.jsx("option",{value:"Medium",children:"Medium"}),n.jsx("option",{value:"Low",children:"Low"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Project"}),n.jsx(Be,{label:"Project",hideLabel:!0,value:v,onChange:b,doctype:"Project",placeholder:"Filter by project…",compact:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Date Filter By"}),n.jsxs("select",{value:k,onChange:R=>C(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none",children:[n.jsx("option",{value:"",children:"None"}),n.jsx("option",{value:"creation",children:"Created"}),n.jsx("option",{value:"modified",children:"Modified"})]})]}),k&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"From"}),n.jsx("input",{type:"date",value:N,onChange:R=>O(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"To"}),n.jsx("input",{type:"date",value:E,onChange:R=>A(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Sort By"}),n.jsxs("select",{value:T,onChange:R=>P(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none",children:[n.jsx("option",{value:"creation desc",children:"Created (newest)"}),n.jsx("option",{value:"creation asc",children:"Created (oldest)"}),n.jsx("option",{value:"exp_end_date asc",children:"Due date (soonest)"}),n.jsx("option",{value:"priority desc",children:"Priority (high first)"})]})]})]})})]}),xe&&n.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg text-red-700 dark:text-red-300 text-sm",children:xe}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:[ce?n.jsx("div",{className:"p-12 text-center text-gray-500 dark:text-gray-400",children:e("common.loading")}):U.length===0?n.jsxs("div",{className:"p-12 text-center",children:[n.jsx(Gc,{className:"text-4xl text-gray-300 dark:text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:e("projects.noTasks")})]}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[n.jsx("thead",{className:"bg-gray-100 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600",children:n.jsxs("tr",{children:[n.jsx("th",{className:"w-10 px-4 py-3 text-left",children:n.jsx("button",{type:"button",onClick:K,className:"text-gray-500 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors",title:Y?"Deselect all":"Select all","aria-label":"Select all on page",children:Y?n.jsx(Sn,{className:"text-indigo-600 dark:text-indigo-400",size:18}):re?n.jsxs("div",{className:"relative inline-block",children:[n.jsx(Gr,{size:18}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"w-2 h-0.5 bg-current"})})]}):n.jsx(Gr,{size:18})})}),[e("projects.taskColumn"),e("projects.project"),e("commonFields.status"),e("commonFields.priority"),e("projects.assignedTo"),e("projects.dueDate"),"Exp. Time",""].map(R=>n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:R},R))]})}),n.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:U.map(R=>n.jsxs("tr",{className:`hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer ${L.has(R.name)?"bg-indigo-50 dark:bg-indigo-900/20":""}`,onClick:()=>t(`/projects/tasks/${R.name}`),children:[n.jsx("td",{className:"w-10 px-4 py-3",onClick:I=>I.stopPropagation(),children:n.jsx("button",{type:"button",onClick:()=>H(R.name),className:"text-gray-500 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors","aria-label":`Select ${R.name}`,children:L.has(R.name)?n.jsx(Sn,{className:"text-indigo-600 dark:text-indigo-400",size:18}):n.jsx(Gr,{size:18})})}),n.jsxs("td",{className:"px-6 py-4",children:[n.jsx("div",{className:"font-medium text-gray-900 dark:text-white",children:R.subject||R.name}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:R.name})]}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:R.project?n.jsx("button",{onClick:I=>{I.stopPropagation(),t(`/projects/list/${R.project}`)},className:"text-sm text-indigo-600 dark:text-indigo-400 hover:underline",children:R.project}):n.jsx("span",{className:"text-gray-400 text-sm",children:"-"})}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${sve(R.status||"")}`,children:R.status||"-"})}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${ive(R.priority||"")}`,children:R.priority||"-"})}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300",children:R._assign&&JSON.parse(R._assign)[0]||"-"}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300",children:se(R.exp_end_date||"")}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300",children:R.expected_time?`${R.expected_time}h`:"-"}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",onClick:I=>I.stopPropagation(),children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>t(`/projects/tasks/${R.name}`),className:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300 p-2 hover:bg-indigo-50 dark:hover:bg-indigo-900/30 rounded transition-colors",title:"View",children:n.jsx(Hs,{})}),n.jsx("button",{onClick:()=>F(R.name),className:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 p-2 hover:bg-green-50 dark:hover:bg-green-900/30 rounded transition-colors",title:"Edit",children:n.jsx(ha,{})}),n.jsx("button",{onClick:()=>X(R.name),className:"text-purple-600 dark:text-purple-400 hover:text-purple-900 dark:hover:text-purple-300 p-2 hover:bg-purple-50 dark:hover:bg-purple-900/30 rounded transition-colors",title:"Duplicate",children:n.jsx(uu,{})})]})})]},R.name))})]})}),ie>1&&n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 px-4 py-3",children:n.jsx(Wy,{currentPage:i,totalPages:ie,totalCount:be,pageSize:s,onPageChange:l})})]})]})},lve="/assets/project_management/pm_app/assets/ar_task_prompt-CTPTWoU4.mp3",cve="/assets/project_management/pm_app/assets/en_task_prompt-MpN_x5Ld.mp3",og=18,rO=window.SpeechRecognition||window.webkitSpeechRecognition;function uve({onUpdateConfirmed:e,isSubmitting:t=!1}){const[r,a]=y.useState("prompted"),[s,i]=y.useState(""),[l,u]=y.useState(""),[d,f]=y.useState(Array(og).fill(4)),[p,m]=y.useState("en"),x=y.useRef(null),v=y.useRef(null),b=y.useRef(null),w=y.useRef(null),j=y.useRef(null),k=y.useRef(null),C=y.useRef(""),N=p==="ar";y.useEffect(()=>{const ne=setTimeout(()=>E(p),800);return()=>{clearTimeout(ne),A()}},[]);const O=y.useRef(!0);y.useEffect(()=>{if(O.current){O.current=!1;return}if(r==="listening"||r==="preview"||r==="saved")return;window.speechSynthesis&&window.speechSynthesis.cancel(),a("prompted");const ne=p,ge=setTimeout(()=>E(ne),400);return()=>clearTimeout(ge)},[p]);function E(ne){const ge=ne==="ar"?lve:cve,Z=new Audio(ge);Z.onended=()=>a("ready"),Z.onerror=()=>a("ready"),Z.play().catch(()=>a("ready"))}function A(){if(k.current&&clearTimeout(k.current),b.current&&cancelAnimationFrame(b.current),v.current&&(v.current.disconnect(),v.current=null),x.current&&(x.current.close(),x.current=null),j.current&&(j.current.getTracks().forEach(ne=>ne.stop()),j.current=null),w.current){try{w.current.stop()}catch(ne){}w.current=null}f(Array(og).fill(4))}function T(){return fe(this,null,function*(){try{let ne=function(){b.current=requestAnimationFrame(ne),U.getByteFrequencyData(xe),f(Array.from({length:og},(be,me)=>{const oe=Math.floor(me*xe.length/og);return 4+xe[oe]/255*22}))};const ge=yield navigator.mediaDevices.getUserMedia({audio:!0});j.current=ge;const Z=new(window.AudioContext||window.webkitAudioContext);x.current=Z;const U=Z.createAnalyser();U.fftSize=64;const ce=Z.createMediaStreamSource(ge);v.current=ce,ce.connect(U);const xe=new Uint8Array(U.frequencyBinCount);ne()}catch(ne){}})}function P(){return fe(this,null,function*(){if(a("listening"),i(""),u(""),C.current="",yield T(),!rO){A(),a("ready");return}const ne=new rO;w.current=ne,ne.lang=N?"ar-SA":"en-US",ne.interimResults=!1,ne.continuous=!1,ne.maxAlternatives=1,ne.onresult=ge=>{const Z=ge.results[ge.resultIndex];if(Z&&Z.isFinal){const U=Z[0].transcript.trim();C.current=U,i(U)}},ne.onend=()=>{A();const ge=C.current.trim();ge.length>0?(u(ge),a("preview")):a("ready")},ne.onerror=()=>{A(),a("ready")},ne.start(),k.current=setTimeout(()=>{w.current&&w.current.stop()},15e3)})}function D(){w.current&&w.current.stop()}function z(){!l.trim()||t||(e(l.trim()),a("saved"))}function G(){A(),i(""),u(""),C.current="",a("ready")}function V(){A(),i(""),u(""),C.current="",a("prompted"),window.speechSynthesis&&window.speechSynthesis.cancel(),setTimeout(()=>E(p),400)}return n.jsxs("div",{style:At.card,children:[n.jsxs("div",{style:At.header,children:[n.jsx("div",{style:At.logo,children:"📝"}),n.jsxs("div",{style:At.brand,children:["SEERA",n.jsx("span",{style:At.brandAccent,children:"-ASM"})]}),n.jsx("span",{style:At.badge,children:"Task Update"})]}),n.jsx("div",{style:At.title,children:"Voice Task Update"}),n.jsx("div",{style:At.subtitle,children:"Speak your progress note — it will be added to Task Updates"}),n.jsx("div",{style:{display:"flex",gap:6,marginBottom:16,background:"#f1f5f9",borderRadius:10,padding:4},children:[{key:"en",label:"English"},{key:"ar",label:"عربي"}].map(({key:ne,label:ge})=>n.jsx("button",{onClick:()=>m(ne),style:{flex:1,padding:"6px 0",borderRadius:7,border:"none",fontSize:12,fontWeight:600,cursor:"pointer",transition:"all 0.15s",background:p===ne?"#fff":"transparent",color:p===ne?"#7c3aed":"#64748b",boxShadow:p===ne?"0 1px 4px rgba(0,0,0,0.1)":"none"},children:ge},ne))}),n.jsxs("div",{style:At.actionArea,children:[r==="prompted"&&n.jsxs("div",{style:ee(ee({},At.statusMsg),At.speakingMsg),children:[n.jsx("div",{style:At.speakingIcon,children:"🔊"}),n.jsx("div",{style:At.speakingText,children:N?"يرجى الانتظار…":"Please wait…"}),n.jsxs("div",{style:At.dots,children:[n.jsx("span",{style:At.dot}),n.jsx("span",{style:Se(ee({},At.dot),{animationDelay:"0.2s"})}),n.jsx("span",{style:Se(ee({},At.dot),{animationDelay:"0.4s"})})]})]}),r==="ready"&&n.jsxs("button",{style:At.speakBtn,onClick:P,children:[n.jsx("div",{style:At.speakBtnIcon,children:"🎙️"}),n.jsxs("div",{children:[n.jsx("span",{style:At.speakBtnTitle,children:N?"اضغط للتحدث":"Tap to Speak"}),n.jsx("span",{style:At.speakBtnHint,children:N?"تحدث عن تحديث مهمتك بوضوح":"Speak your task update clearly"})]})]}),r==="listening"&&n.jsxs("div",{style:At.listeningArea,children:[n.jsx("div",{style:At.micActive,children:"🔴"}),n.jsx("div",{style:At.waveform,children:d.map((ne,ge)=>n.jsx("div",{style:Se(ee({},At.bar),{height:`${ne}px`})},ge))}),n.jsx("div",{style:At.micLabel,children:N?"جاري الاستماع… تحدث الآن":"Listening… speak your update"}),s&&n.jsxs("div",{style:At.liveTranscript,children:[n.jsx("em",{style:{color:"#64748b",fontSize:12},children:N?"يسمع:":"Hearing:"}),n.jsx("p",{style:{margin:"4px 0 0",fontSize:13,color:"#1e293b",direction:N?"rtl":"ltr"},children:s})]}),n.jsx("button",{style:At.stopBtn,onClick:D,children:N?"⏹ انتهيت":"⏹ Done Speaking"})]}),r==="preview"&&n.jsxs("div",{style:At.previewArea,children:[n.jsx("div",{style:At.previewLabel,children:N?"✅ تم! راجع وعدّل إذا لزم:":"✅ Got it! Review and edit if needed:"}),n.jsx("textarea",{style:Se(ee({},At.textarea),{direction:N?"rtl":"ltr"}),value:l,onChange:ne=>u(ne.target.value),rows:4,placeholder:N?"نص التحديث…":"Your update text…",autoFocus:!0}),n.jsx("p",{style:At.previewHint,children:N?"📅 سيتم إضافة تاريخ اليوم تلقائياً":"📅 Today's date will be added automatically"})]}),r==="saved"&&n.jsx("div",{style:ee(ee({},At.statusMsg),At.savedMsg),children:N?"✅ تمت إضافة التحديث!":"✅ Update added to task!"})]}),n.jsxs("div",{style:At.actions,children:[r!=="saved"&&n.jsx("button",{style:At.ghostBtn,onClick:V,disabled:t,children:N?"إعادة":"Reset"}),r==="listening"&&n.jsx("button",{style:Se(ee({},At.primaryBtn),{background:"#dc2626"}),onClick:D,children:N?"إيقاف":"Stop"}),r==="preview"&&n.jsxs(n.Fragment,{children:[n.jsx("button",{style:At.ghostBtn,onClick:G,children:N?"🔄 إعادة التسجيل":"🔄 Re-record"}),n.jsx("button",{style:ee(ee({},At.primaryBtn),t?At.disabledBtn:{}),onClick:z,disabled:t||!l.trim(),children:t?N?"جاري الحفظ…":"Saving…":N?"✅ إضافة التحديث":"✅ Add Update"})]}),r==="saved"&&n.jsx("button",{style:At.ghostBtn,onClick:V,children:N?"إضافة تحديث آخر":"Add Another"})]})]})}const At={card:{background:"#ffffff",border:"1px solid #e2e8f0",borderRadius:16,padding:"28px 28px 24px",width:"100%",maxWidth:480,boxShadow:"0 8px 32px rgba(0,0,0,0.12)",fontFamily:"inherit",color:"#1e293b"},header:{display:"flex",alignItems:"center",gap:10,marginBottom:20},logo:{width:36,height:36,borderRadius:8,background:"linear-gradient(135deg,#8b5cf6,#7c3aed)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:16},brand:{fontWeight:700,fontSize:15,letterSpacing:"0.03em",color:"#1e293b"},brandAccent:{color:"#7c3aed"},badge:{marginLeft:"auto",background:"#f5f3ff",border:"1px solid #ddd6fe",color:"#6d28d9",fontSize:11,fontWeight:600,padding:"3px 10px",borderRadius:100},title:{fontSize:22,fontWeight:700,marginBottom:4},subtitle:{fontSize:13,color:"#64748b",marginBottom:12},actionArea:{display:"flex",flexDirection:"column",alignItems:"center",gap:12,marginBottom:20,minHeight:100,justifyContent:"center"},statusMsg:{display:"flex",alignItems:"center",gap:10,fontSize:14,fontWeight:600,padding:"16px 20px",borderRadius:10,width:"100%"},speakingMsg:{flexDirection:"column",background:"#f5f3ff",border:"1px solid #ddd6fe",color:"#7c3aed",gap:8},savedMsg:{background:"#f0fdf4",border:"1px solid #bbf7d0",color:"#16a34a",fontSize:16,justifyContent:"center"},speakingIcon:{fontSize:28},speakingText:{fontSize:14,fontWeight:600,color:"#7c3aed"},dots:{display:"flex",gap:4},dot:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"#8b5cf6",animation:"vsw-dot 1.2s ease-in-out infinite"},speakBtn:{width:"100%",padding:"14px 16px",borderRadius:12,border:"1px solid #ddd6fe",background:"#f5f3ff",color:"#5b21b6",fontFamily:"inherit",cursor:"pointer",display:"flex",alignItems:"center",gap:12,transition:"all 0.2s"},speakBtnIcon:{width:40,height:40,borderRadius:"50%",background:"#7c3aed",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:18,flexShrink:0},speakBtnTitle:{display:"block",fontSize:15,fontWeight:600,color:"#5b21b6"},speakBtnHint:{display:"block",fontSize:11,color:"#8b5cf6",marginTop:2},listeningArea:{display:"flex",flexDirection:"column",alignItems:"center",gap:8,width:"100%"},micActive:{fontSize:36},waveform:{display:"flex",alignItems:"center",gap:3,height:30},bar:{width:3,borderRadius:2,background:"linear-gradient(to top,#8b5cf6,#c4b5fd)",transition:"height 0.08s ease"},micLabel:{fontSize:13,color:"#ef4444",fontWeight:600},liveTranscript:{width:"100%",background:"#f8fafc",border:"1px solid #e2e8f0",borderRadius:8,padding:"8px 12px",marginTop:4},stopBtn:{marginTop:8,padding:"8px 20px",borderRadius:8,border:"1px solid #fecaca",background:"#fef2f2",color:"#dc2626",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:"pointer"},previewArea:{width:"100%"},previewLabel:{fontSize:13,fontWeight:600,color:"#16a34a",marginBottom:8},textarea:{width:"100%",padding:"10px 12px",border:"1px solid #c4b5fd",borderRadius:8,fontSize:14,fontFamily:"inherit",color:"#1e293b",background:"#fafafa",resize:"vertical",outline:"none",boxSizing:"border-box"},previewHint:{fontSize:11,color:"#64748b",marginTop:6},actions:{display:"flex",gap:10},ghostBtn:{flex:1,padding:"10px 18px",borderRadius:8,border:"1px solid #e2e8f0",background:"#f1f5f9",color:"#475569",fontFamily:"inherit",fontSize:14,fontWeight:600,cursor:"pointer"},primaryBtn:{flex:1,padding:"10px 18px",borderRadius:8,border:"none",background:"#7c3aed",color:"#fff",fontFamily:"inherit",fontSize:14,fontWeight:600,cursor:"pointer"},disabledBtn:{opacity:.45,cursor:"not-allowed"}};function dve(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${a}`}const fve=({isOpen:e,onClose:t,taskName:r,onUpdateSuccess:a})=>{const[s,i]=y.useState(!1),[l,u]=y.useState("");if(!e)return null;const d=f=>fe(null,null,function*(){if(!(!r||!f.trim())){i(!0),u("");try{const m=yield(yield fetch(`/api/resource/Task/${encodeURIComponent(r)}`,{credentials:"include"})).json();if(m.exc||m.exception)throw new Error(m.exc||m.exception||"Failed to fetch task");const v=(m.data.custom_task_updates||[]).map(C=>({name:C.name,update_:C.update_,date:C.date,task:C.task})),b={doctype:"Updates",update_:f.trim(),date:dve(),task:r},w=[...v,b],k=yield(yield fetch(`/api/resource/Task/${encodeURIComponent(r)}`,{method:"PUT",headers:{"Content-Type":"application/json","X-Frappe-CSRF-Token":window.csrf_token||"fetch"},credentials:"include",body:JSON.stringify({custom_task_updates:w})})).json();if(k.exc||k.exception)throw new Error(k.exc||k.exception||"Failed to save update");t(),a()}catch(p){const m=p instanceof Error?p.message:"Unknown error";u(`Failed to save: ${m}`)}finally{i(!1)}}});return n.jsxs("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-[80] p-4",onClick:f=>{f.target===f.currentTarget&&!s&&t()},children:[n.jsxs("div",{className:"relative animate-scale-in",children:[n.jsx("button",{onClick:()=>{s||t()},className:"absolute -top-3 -right-3 z-10 w-8 h-8 rounded-full bg-gray-600 hover:bg-gray-500 text-white flex items-center justify-center shadow-lg transition-colors",disabled:s,title:"Close",children:n.jsx(yt,{size:12})}),l&&n.jsxs("div",{className:"mb-3 px-4 py-2 bg-red-50 border border-red-300 rounded-lg text-red-700 text-sm font-medium flex items-center gap-2",children:["⚠️ ",l,n.jsx("button",{onClick:()=>u(""),className:"ml-auto text-red-400 hover:text-red-600",children:n.jsx(yt,{size:10})})]}),n.jsx(uve,{onUpdateConfirmed:d,isSubmitting:s})]}),n.jsx("style",{children:`
@keyframes scale-in {
from { transform: scale(0.92); opacity: 0; }
to { transform: scale(1); opacity: 1; }
}
.animate-scale-in { animation: scale-in 0.2s ease-out; }
`})]})},hve=["Open","Raised","Warning","Penalty","Change Requests","Problems","Letter"],vc=({title:e,icon:t,defaultOpen:r=!0,children:a,headerExtra:s})=>{const[i,l]=y.useState(r);return n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors",children:[n.jsxs("button",{type:"button",onClick:()=>l(u=>!u),className:"flex items-center gap-2 text-sm font-semibold text-gray-700 dark:text-gray-200 flex-1 text-left",children:[t,n.jsx("span",{children:e})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[s,n.jsx("button",{type:"button",onClick:()=>l(u=>!u),children:i?n.jsx(nr,{className:"text-gray-400 text-xs flex-shrink-0"}):n.jsx(bs,{className:"text-gray-400 text-xs flex-shrink-0"})})]})]}),i&&n.jsx("div",{className:"px-5 py-5 bg-white dark:bg-gray-800 border-t border-gray-100 dark:border-gray-700/50",children:a})]})},zr=({children:e,required:t})=>n.jsxs("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),ia=({children:e})=>n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-900/30 rounded-lg min-h-[36px] flex items-center border border-transparent",children:e||n.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:"-"})}),aO=e=>{switch(e==null?void 0:e.toLowerCase()){case"open":return"bg-blue-100 text-blue-800 dark:bg-blue-900/40 dark:text-blue-300";case"working":return"bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300";case"pending review":return"bg-purple-100 text-purple-800 dark:bg-purple-900/40 dark:text-purple-300";case"completed":return"bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300";case"cancelled":return"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400";case"overdue":return"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300";default:return"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}},nO=e=>{switch(e==null?void 0:e.toLowerCase()){case"high":return"bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300";case"medium":return"bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-300";case"low":return"bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300";case"urgent":return"bg-red-200 text-red-900 dark:bg-red-800/50 dark:text-red-200";default:return"bg-gray-100 text-gray-600"}},lg=e=>e?new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"-",sO=yL,pve=()=>{var de,ie,se,he,_e,F,X,R;const{t:e}=sr(),{taskName:t}=Hn(),r=Ut(),[a]=dn(),s=t==="new",i=y.useMemo(()=>!s&&(a.get("edit")||"")==="1",[s,a]),l=y.useMemo(()=>s&&a.get("duplicate")||"",[s,a]),[u,d]=y.useState(!1),{task:f,loading:p,error:m,refetch:x}=zde(s?null:t||null),{createTask:v,updateTask:b,loading:w}=np(),[j,k]=y.useState(s),[C,N]=y.useState(!1),E={subject:"",project:s&&a.get("project")||"",status:"Open",priority:"Medium",task_weight:0,is_group:0,is_template:0,is_milestone:0,exp_start_date:"",exp_end_date:"",expected_time:0,progress:0,completed_on:"",custom_risk:"",custom_action:"",custom_task_obstacle:"",description:"",color:"",department:"",company:fa,parent_task:"",custom_assign_to:""},[A,T]=y.useState(E);y.useEffect(()=>{i&&k(!0)},[i]),y.useEffect(()=>{if(!s||!l)return;let I=!1;return d(!0),wt.getTask(l).then(te=>{if(I)return;T(B=>Se(ee(ee({},B),te),{name:"",subject:te.subject?`${te.subject} (Copy)`:"",status:"Open",progress:0}));const q=te[Lf]||[];G(q.map(B=>({update_:B.update_,date:B.date?String(B.date).slice(0,10):""}))),k(!0)}).catch(()=>{}).finally(()=>{I||d(!1)}),()=>{I=!0}},[s,l]);const[P,D]=y.useState([]),[z,G]=y.useState([]),[V,ne]=y.useState(null);y.useEffect(()=>{A.parent_task?wt.getTask(A.parent_task).then(I=>ne({subject:I.subject,status:I.status})).catch(()=>ne({})):ne(null)},[A.parent_task]);const ge=I=>{var te,q,B,je,Ce,ye;T({subject:I.subject||"",project:I.project||"",status:I.status||"Open",priority:I.priority||"Medium",task_weight:(te=I.task_weight)!=null?te:0,is_group:(q=I.is_group)!=null?q:0,is_template:(B=I.is_template)!=null?B:0,is_milestone:(je=I.is_milestone)!=null?je:0,exp_start_date:I.exp_start_date||"",exp_end_date:I.exp_end_date||"",expected_time:(Ce=I.expected_time)!=null?Ce:0,progress:(ye=I.progress)!=null?ye:0,description:I.description||"",color:I.color||"",department:I.department||"",company:I.company||fa,parent_task:I.parent_task||"",custom_assign_to:I.custom_assign_to||"",completed_on:I.completed_on?String(I.completed_on).slice(0,10):"",custom_risk:I.custom_risk||"",custom_action:I.custom_action||"",custom_task_obstacle:I.custom_task_obstacle||""}),D(I.depends_on||[]),G((I[Lf]||[]).map(Ee=>({name:Ee.name,update_:Ee.update_,date:Ee.date?String(Ee.date).slice(0,10):"",task:Ee.task})))};y.useEffect(()=>{f&&!s&&ge(f)},[f,s]),y.useEffect(()=>{s&&!l&&G([])},[s,l]);const Z=(I,te)=>T(q=>Se(ee({},q),{[I]:te})),U=s||j,ce="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-amber-400 focus:outline-none",xe="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-amber-400 focus:outline-none",be=()=>D(I=>[...I,{task:"",subject:"",_isNew:!0}]),me=(I,te)=>fe(null,null,function*(){if(D(q=>q.map((B,je)=>je===I?Se(ee({},B),{task:te,subject:""}):B)),!!te)try{const q=yield wt.getTask(te);D(B=>B.map((je,Ce)=>Ce===I?Se(ee({},je),{task:te,subject:q.subject||te}):je))}catch(q){}}),oe=I=>{D(te=>te.filter((q,B)=>B!==I))},L=()=>G(I=>[...I,{}]),H=I=>G(te=>te.filter((q,B)=>B!==I)),K=()=>{x(),$e.success("Voice update added!",{icon:n.jsx(Or,{})})},Y=()=>fe(null,null,function*(){var I;if(!((I=A.subject)!=null&&I.trim())){$e.error("Task Subject is required",{icon:n.jsx(Fr,{})});return}if(A.status==="Completed"&&!String(A.completed_on||"").trim()){$e.error("Completed On: This field is mandatory",{icon:n.jsx(Fr,{})});return}try{const te={subject:A.subject,project:A.project||void 0,status:A.status,priority:A.priority,task_weight:A.task_weight,is_group:A.is_group,is_template:A.is_template,is_milestone:A.is_milestone,expected_time:A.expected_time,progress:A.progress,description:A.description,department:A.department||void 0,company:A.company||void 0,parent_task:A.parent_task||void 0,custom_assign_to:A.custom_assign_to||void 0,depends_on:P.filter(q=>q.task).map((q,B)=>({task:q.task,idx:B+1})),custom_risk:A.custom_risk||void 0,custom_action:A.custom_action||void 0,custom_task_obstacle:A.custom_task_obstacle||void 0};if(A.exp_start_date&&(te.exp_start_date=A.exp_start_date),A.exp_end_date&&(te.exp_end_date=A.exp_end_date),A.status==="Completed"?te.completed_on=A.completed_on:te.completed_on=null,s){const q=yield v(te),B=$w(z,{fillTaskLink:q.name});B.length&&(yield b(q.name,{[Lf]:B})),$e.success("Task created",{icon:n.jsx(Or,{})}),k(!1),r(`/projects/tasks/${q.name}`)}else yield b(t,Se(ee({},te),{[Lf]:$w(z,{fillTaskLink:t})})),$e.success("Task saved",{icon:n.jsx(Or,{})}),k(!1),x()}catch(te){$e.error(te instanceof Error?te.message:"Error saving task",{icon:n.jsx(Fr,{})})}}),re=()=>{f&&ge(f),k(!1)};return p&&!s?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-amber-500"})}):!s&&(m||!f)?n.jsxs("div",{className:"p-6",children:[n.jsxs("button",{onClick:()=>r("/projects/tasks"),className:"flex items-center gap-2 text-gray-600 mb-4 text-sm hover:text-gray-900",children:[n.jsx(da,{})," Back to Tasks"]}),n.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 rounded-lg text-red-700 dark:text-red-300",children:m||"Task not found"})]}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),!s&&t&&n.jsx(fve,{isOpen:C,onClose:()=>N(!1),taskName:t,onUpdateSuccess:K}),n.jsx("div",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 shadow-sm",children:n.jsxs("div",{className:"px-6 py-4",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-xs mb-3 text-gray-400 dark:text-gray-500",children:[n.jsx("button",{onClick:()=>r("/projects"),className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:e("projects.moduleTitle","Project Management")}),n.jsx("span",{children:"/"}),n.jsx("button",{onClick:()=>r("/projects/tasks"),className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:e("projects.tasksDoctype","Tasks")}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-600 dark:text-gray-300 font-medium",children:s?"New Task":(f==null?void 0:f.subject)||t})]}),n.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n.jsx("button",{onClick:()=>r("/projects/tasks"),className:"mt-1 text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 flex-shrink-0 transition-colors",children:n.jsx(da,{})}),n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[n.jsx("div",{className:"w-9 h-9 rounded-lg bg-amber-500 flex items-center justify-center flex-shrink-0 shadow-sm",children:n.jsx(Gc,{className:"text-white text-sm"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white leading-tight",children:s?"New Task":(f==null?void 0:f.subject)||t}),!s&&n.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:t})]})]}),!s&&f&&n.jsxs("div",{className:"flex items-center flex-wrap gap-2 mt-2 ml-12",children:[n.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-xs font-semibold ${aO(f.status||"")}`,children:f.status||"Open"}),n.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-xs font-semibold ${nO(f.priority||"")}`,children:f.priority||"-"}),f.project&&n.jsx("button",{onClick:()=>r(`/projects/list/${f.project}`),className:"text-xs text-indigo-600 dark:text-indigo-400 border border-indigo-200 dark:border-indigo-700 rounded-full px-2.5 py-0.5 hover:underline",children:f.project}),f.progress!==void 0&&f.progress>0&&n.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500 dark:text-gray-400",children:[n.jsx("div",{className:"w-20 h-1.5 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${Math.min(f.progress,100)}%`}})}),n.jsxs("span",{className:"font-medium",children:[f.progress,"%"]})]})]})]})]}),n.jsxs("div",{className:"flex gap-2 flex-wrap flex-shrink-0",children:[!s&&n.jsxs("button",{onClick:()=>{const I=new URLSearchParams;f!=null&&f.project&&I.set("project",f.project),I.set("task",(f==null?void 0:f.name)||t||""),r(`/projects/timesheets/new?${I.toString()}`)},className:"flex items-center gap-2 px-4 py-2 border border-green-500 text-green-600 dark:text-green-400 rounded-lg hover:bg-green-50 dark:hover:bg-green-900/20 text-sm transition-colors",title:"Create a timesheet for this task",children:[n.jsx(ds,{size:13})," Create Timesheet"]}),!j&&!s&&n.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-2 px-4 py-2 bg-amber-500 text-white rounded-lg hover:bg-amber-600 text-sm transition-colors shadow-sm",children:[n.jsx(ha,{size:13})," Edit"]}),(j||s)&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:Y,disabled:w,className:"flex items-center gap-2 px-4 py-2 bg-amber-500 text-white rounded-lg hover:bg-amber-600 disabled:opacity-50 text-sm shadow-sm",children:[w?n.jsx(vt,{className:"animate-spin",size:13}):n.jsx(Cn,{size:13}),w?"Saving…":"Save"]}),!s&&n.jsxs("button",{onClick:re,className:"flex items-center gap-1.5 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-sm text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700/50",children:[n.jsx(yt,{size:13})," Cancel"]})]})]})]})]})}),n.jsxs("div",{className:"px-6 py-6 space-y-3",children:[n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm px-5 py-5",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{className:"sm:col-span-2",children:[n.jsx(zr,{required:!0,children:"Subject"}),U?n.jsx("input",{type:"text",value:A.subject||"",onChange:I=>Z("subject",I.target.value),className:ce,placeholder:"Enter task subject"}):n.jsx(ia,{children:A.subject})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Status"}),U?n.jsxs("select",{value:A.status||"Open",onChange:I=>Z("status",I.target.value),className:xe,children:[n.jsx("option",{value:"Open",children:"Open"}),n.jsx("option",{value:"Working",children:"Working"}),n.jsx("option",{value:"Pending Review",children:"Pending Review"}),n.jsx("option",{value:"Overdue",children:"Overdue"}),n.jsx("option",{value:"Template",children:"Template"}),n.jsx("option",{value:"Completed",children:"Completed"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]}):n.jsx(ia,{children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${aO(A.status||"")}`,children:A.status})})]}),A.status==="Completed"&&n.jsxs("div",{children:[n.jsx(zr,{required:!0,children:"Completed On"}),U?n.jsx("input",{type:"date",value:A.completed_on||"",onChange:I=>Z("completed_on",I.target.value),className:ce}):n.jsx(ia,{children:lg(A.completed_on)})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Project"}),U?n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:A.project||"",onChange:I=>Z("project",I),placeholder:"Link to project…"}):n.jsx(ia,{children:A.project?n.jsx("button",{onClick:()=>r(`/projects/list/${A.project}`),className:"text-indigo-600 dark:text-indigo-400 hover:underline",children:A.project}):"-"})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Risk"}),U?n.jsxs("select",{value:A.custom_risk||"",onChange:I=>Z("custom_risk",I.target.value),className:xe,children:[n.jsx("option",{value:"",children:"—"}),n.jsx("option",{value:"Yes",children:"Yes"}),n.jsx("option",{value:"No",children:"No"})]}):n.jsx(ia,{children:A.custom_risk||"—"})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Action"}),U?n.jsxs("select",{value:A.custom_action||"",onChange:I=>Z("custom_action",I.target.value),className:xe,children:[n.jsx("option",{value:"",children:"—"}),hve.map(I=>n.jsx("option",{value:I,children:I},I))]}):n.jsx(ia,{children:A.custom_action||"—"})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Priority"}),U?n.jsxs("select",{value:A.priority||"Medium",onChange:I=>Z("priority",I.target.value),className:xe,children:[n.jsx("option",{value:"Low",children:"Low"}),n.jsx("option",{value:"Medium",children:"Medium"}),n.jsx("option",{value:"High",children:"High"}),n.jsx("option",{value:"Urgent",children:"Urgent"})]}):n.jsx(ia,{children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${nO(A.priority||"")}`,children:A.priority})})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Weight"}),U?n.jsx("input",{type:"number",min:0,step:.1,value:(de=A.task_weight)!=null?de:0,onChange:I=>Z("task_weight",parseFloat(I.target.value)||0),className:ce}):n.jsx(ia,{children:(ie=A.task_weight)!=null?ie:0})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Parent Task"}),U?n.jsx(Be,{label:"Parent Task",hideLabel:!0,doctype:"Task",value:A.parent_task||"",onChange:I=>Z("parent_task",I),placeholder:"Select parent task…",filters:{is_group:1}}):n.jsx(ia,{children:A.parent_task?n.jsx("button",{onClick:()=>r(`/projects/tasks/${A.parent_task}`),className:"text-indigo-600 dark:text-indigo-400 hover:underline",children:A.parent_task}):"-"})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Assign to"}),U?n.jsx(Be,{label:"Assign to",hideLabel:!0,doctype:"User",value:A.custom_assign_to||"",onChange:I=>Z("custom_assign_to",I),placeholder:"Select user…"}):n.jsx(ia,{children:A.custom_assign_to||"—"})]}),n.jsx("div",{className:"sm:col-span-2 flex flex-wrap gap-6 pt-1",children:[{key:"is_group",label:"Is Group"},{key:"is_template",label:"Is Template"}].map(({key:I,label:te})=>n.jsxs("label",{className:`flex items-center gap-2 ${U?"cursor-pointer":"cursor-default"}`,children:[n.jsx("input",{type:"checkbox",checked:!!A[I],onChange:q=>Z(I,q.target.checked?1:0),disabled:!U,className:"w-4 h-4 text-amber-500 border-gray-300 rounded focus:ring-amber-400"}),n.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 font-medium",children:te})]},I))})]})}),n.jsx(vc,{title:"Timeline",icon:n.jsx(Dq,{className:"text-indigo-500",size:13}),defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(zr,{children:"Expected Start Date"}),U?n.jsx("input",{type:"date",value:A.exp_start_date||"",onChange:I=>Z("exp_start_date",I.target.value),className:ce}):n.jsx(ia,{children:lg(A.exp_start_date)})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Expected End Date"}),U?n.jsx("input",{type:"date",value:A.exp_end_date||"",onChange:I=>Z("exp_end_date",I.target.value),className:ce}):n.jsx(ia,{children:lg(A.exp_end_date)})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Expected Time (In hours)"}),U?n.jsx("input",{type:"number",min:0,step:.5,value:(se=A.expected_time)!=null?se:0,onChange:I=>Z("expected_time",parseFloat(I.target.value)||0),className:ce}):n.jsx(ia,{children:(he=A.expected_time)!=null?he:0})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"% Progress"}),U?n.jsx("input",{type:"number",min:0,max:100,value:(_e=A.progress)!=null?_e:0,onChange:I=>Z("progress",parseInt(I.target.value)||0),className:ce}):n.jsx(ia,{children:n.jsxs("div",{className:"flex items-center gap-2 w-full",children:[n.jsx("div",{className:"flex-1 h-2 bg-gray-200 dark:bg-gray-600 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-amber-500 rounded-full",style:{width:`${Math.min((F=A.progress)!=null?F:0,100)}%`}})}),n.jsxs("span",{className:"text-sm font-medium min-w-[36px] text-right",children:[(X=A.progress)!=null?X:0,"%"]})]})})]}),n.jsx("div",{className:"sm:col-span-2",children:n.jsxs("label",{className:`flex items-center gap-2 ${U?"cursor-pointer":"cursor-default"}`,children:[n.jsx("input",{type:"checkbox",checked:!!A.is_milestone,onChange:I=>Z("is_milestone",I.target.checked?1:0),disabled:!U,className:"w-4 h-4 text-amber-500 border-gray-300 rounded focus:ring-amber-400"}),n.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 font-medium",children:"Is Milestone"})]})})]})}),n.jsx(vc,{title:"Task Updates",icon:n.jsx(dP,{className:"text-violet-500",size:13}),defaultOpen:!0,headerExtra:!s&&t?n.jsxs("button",{type:"button",onClick:I=>{I.stopPropagation(),N(!0)},className:"flex items-center gap-1.5 px-3 py-1 bg-purple-600 hover:bg-purple-700 text-white text-xs font-medium rounded-lg transition-colors shadow-sm",title:"Add a voice update",children:[n.jsx(iP,{size:10}),"Voice Update"]}):null,children:n.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:[n.jsxs("div",{className:`grid ${U?"grid-cols-[40px_1fr_8rem_36px]":"grid-cols-[40px_1fr_8rem]"} bg-gray-50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-700`,children:[n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"No."}),n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"Update"}),n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"Date"}),U&&n.jsx("div",{className:"py-2 w-9"})]}),z.length===0?n.jsx("div",{className:"py-8 text-center text-sm text-gray-400 italic",children:"No updates yet."}):n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:z.map((I,te)=>n.jsxs("div",{className:`grid ${U?"grid-cols-[40px_1fr_8rem_36px]":"grid-cols-[40px_1fr_8rem]"} items-center hover:bg-gray-50/80 dark:hover:bg-gray-800/40`,children:[n.jsx("div",{className:"px-3 py-2 text-xs text-gray-500 font-medium",children:te+1}),n.jsx("div",{className:"px-3 py-1.5 min-w-0",children:U?n.jsx("input",{type:"text",value:I.update_||"",onChange:q=>G(B=>B.map((je,Ce)=>Ce===te?Se(ee({},je),{update_:q.target.value}):je)),className:ce,placeholder:"Update text…"}):n.jsx("span",{className:"text-sm text-gray-800 dark:text-gray-200",children:I.update_||"—"})}),n.jsx("div",{className:"px-3 py-1.5",children:U?n.jsx("input",{type:"date",value:I.date?String(I.date).slice(0,10):"",onChange:q=>G(B=>B.map((je,Ce)=>Ce===te?Se(ee({},je),{date:q.target.value}):je)),className:ce}):n.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:I.date?lg(String(I.date).slice(0,10)):"—"})}),U&&n.jsx("div",{className:"flex justify-center",children:n.jsx("button",{type:"button",onClick:()=>H(te),className:"p-1.5 text-red-400 hover:text-red-600 rounded transition-colors",title:"Remove row",children:n.jsx(Za,{size:11})})})]},I.name||`row-${te}`))}),U&&n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 px-3 py-2 bg-gray-50 dark:bg-gray-900/30",children:n.jsxs("button",{type:"button",onClick:L,className:"flex items-center gap-1.5 text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})]})}),n.jsx(vc,{title:"Details",icon:n.jsx(oP,{className:"text-gray-400",size:13}),defaultOpen:!1,children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx(zr,{children:"Task Description"}),U?n.jsx("textarea",{rows:6,value:A.description||"",onChange:I=>Z("description",I.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-amber-400 focus:outline-none resize-y",placeholder:"Task description…"}):n.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 whitespace-pre-wrap min-h-[60px] leading-relaxed",children:A.description||n.jsx("span",{className:"text-gray-400 italic",children:"No description"})})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Task Obstacles"}),U?n.jsx("textarea",{rows:4,value:A.custom_task_obstacle||"",onChange:I=>Z("custom_task_obstacle",I.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-amber-400 focus:outline-none resize-y",placeholder:"Describe obstacles…"}):n.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 whitespace-pre-wrap min-h-[48px] leading-relaxed",children:A.custom_task_obstacle||n.jsx("span",{className:"text-gray-400 italic",children:"—"})})]})]})}),n.jsx(vc,{title:"Dependencies",icon:n.jsx(jq,{className:"text-blue-500",size:13}),defaultOpen:!0,children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx(zr,{children:"Dependent Tasks"}),n.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:[n.jsxs("div",{className:`grid ${U?"grid-cols-[40px_1fr_1fr_36px]":"grid-cols-[40px_1fr_1fr]"} bg-gray-50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-700`,children:[n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"No."}),n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"Task"}),n.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-500 uppercase",children:"Subject"}),U&&n.jsx("div",{className:"py-2 w-9"})]}),P.length===0?n.jsx("div",{className:"py-8 text-center text-sm text-gray-400 dark:text-gray-500 italic",children:"No Data"}):n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:P.map((I,te)=>n.jsxs("div",{className:`grid ${U?"grid-cols-[40px_1fr_1fr_36px]":"grid-cols-[40px_1fr_1fr]"} items-center hover:bg-gray-50 dark:hover:bg-gray-700/30`,children:[n.jsx("div",{className:"px-3 py-2.5 text-xs text-gray-500 dark:text-gray-400 font-medium",children:te+1}),n.jsx("div",{className:"px-3 py-1.5",children:U?n.jsx(Be,{label:"Task",hideLabel:!0,doctype:"Task",value:I.task||"",onChange:q=>me(te,q),placeholder:"Select task…",compact:!0}):n.jsx("button",{onClick:()=>I.task&&r(`/projects/tasks/${I.task}`),className:"text-sm text-indigo-600 dark:text-indigo-400 hover:underline",children:I.task||"-"})}),n.jsx("div",{className:"px-3 py-2.5",children:n.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:I.subject||(I.task?n.jsx("span",{className:"text-gray-400 italic text-xs",children:"fetching…"}):"-")})}),U&&n.jsx("div",{className:"flex justify-center",children:n.jsx("button",{type:"button",onClick:()=>oe(te),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors",title:"Remove row",children:n.jsx(Za,{size:11})})})]},te))}),U&&n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 px-3 py-2 bg-gray-50 dark:bg-gray-900/30",children:n.jsxs("button",{type:"button",onClick:be,className:"flex items-center gap-1.5 text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 font-medium transition-colors",children:[n.jsx(Pt,{size:10})," Add Row"]})})]})]}),!s&&n.jsxs("div",{children:[n.jsx(zr,{children:"Actual Time In Hours (via Timesheet)"}),n.jsx(ia,{children:(R=f==null?void 0:f.actual_time)!=null?R:0})]})]})}),!s&&n.jsx(vc,{title:"Costing",icon:n.jsx(Dl,{className:"text-emerald-500",size:13}),defaultOpen:!1,children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(zr,{children:"Total Costing Amount (via Timesheet)"}),n.jsx(ia,{children:sO(f==null?void 0:f.total_costing_amount)})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Total Billable Amount (via Timesheet)"}),n.jsx(ia,{children:sO(f==null?void 0:f.total_billing_amount)})]})]})}),!s&&(A.parent_task||P.length>0)&&n.jsx(vc,{title:"Task Hierarchy",icon:n.jsx(sP,{className:"text-purple-500",size:13}),defaultOpen:!0,children:n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute left-[19px] top-0 bottom-0 w-0.5 bg-gradient-to-b from-purple-200 via-indigo-200 to-indigo-100 dark:from-purple-700 dark:via-indigo-700 dark:to-indigo-800"}),n.jsxs("div",{className:"space-y-2 ml-1",children:[A.parent_task&&n.jsxs("div",{className:"flex items-center gap-3 relative",children:[n.jsx("div",{className:"w-10 h-10 rounded-full bg-purple-100 dark:bg-purple-900/40 border-2 border-purple-300 dark:border-purple-600 flex items-center justify-center flex-shrink-0 z-10",children:n.jsx("svg",{className:"w-4 h-4 text-purple-600 dark:text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15l7-7 7 7"})})}),n.jsx("button",{onClick:()=>r(`/projects/tasks/${A.parent_task}`),className:"flex-1 text-left px-4 py-2.5 rounded-xl bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-700 hover:bg-purple-100 dark:hover:bg-purple-900/40 transition-colors group",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-semibold text-purple-500 dark:text-purple-400 uppercase tracking-wide mb-0.5",children:"Parent Task"}),n.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white group-hover:text-purple-700 dark:group-hover:text-purple-300",children:(V==null?void 0:V.subject)||A.parent_task}),n.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:A.parent_task})]}),(V==null?void 0:V.status)&&n.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-purple-100 dark:bg-purple-800 text-purple-700 dark:text-purple-300 font-medium",children:V.status})]})})]}),n.jsxs("div",{className:"flex items-center gap-3 relative",children:[n.jsx("div",{className:"w-10 h-10 rounded-full bg-indigo-500 border-2 border-indigo-400 flex items-center justify-center flex-shrink-0 z-10 shadow-md",children:n.jsx(Gc,{className:"text-white",size:14})}),n.jsxs("div",{className:"flex-1 px-4 py-2.5 rounded-xl bg-indigo-50 dark:bg-indigo-900/30 border-2 border-indigo-300 dark:border-indigo-600 shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-semibold text-indigo-500 dark:text-indigo-400 uppercase tracking-wide mb-0.5",children:"Current Task"}),n.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:A.subject||(f==null?void 0:f.name)}),n.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:f==null?void 0:f.name})]}),n.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${A.status==="Completed"?"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300":A.status==="Working"?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":A.status==="Overdue"?"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300":"bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400"}`,children:A.status})]}),A.progress!==void 0&&n.jsx("div",{className:"mt-2",children:n.jsx("div",{className:"h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-indigo-500 rounded-full transition-all",style:{width:`${A.progress}%`}})})})]})]}),P.filter(I=>I.task).map((I,te)=>n.jsxs("div",{className:"flex items-center gap-3 relative",children:[n.jsx("div",{className:"w-10 h-10 rounded-full bg-teal-100 dark:bg-teal-900/40 border-2 border-teal-300 dark:border-teal-600 flex items-center justify-center flex-shrink-0 z-10",children:n.jsx("svg",{className:"w-4 h-4 text-teal-600 dark:text-teal-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})}),n.jsx("button",{onClick:()=>r(`/projects/tasks/${I.task}`),className:"flex-1 text-left px-4 py-2.5 rounded-xl bg-teal-50 dark:bg-teal-900/20 border border-teal-200 dark:border-teal-700 hover:bg-teal-100 dark:hover:bg-teal-900/40 transition-colors group",children:n.jsxs("div",{children:[n.jsxs("p",{className:"text-xs font-semibold text-teal-500 dark:text-teal-400 uppercase tracking-wide mb-0.5",children:["Depends on #",te+1]}),n.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white group-hover:text-teal-700 dark:group-hover:text-teal-300",children:I.subject||I.task}),I.subject&&I.task!==I.subject&&n.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:I.task})]})})]},te))]})]})}),n.jsx(vc,{title:"More Info",icon:n.jsx(a_,{className:"text-gray-400",size:13}),defaultOpen:!1,children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(zr,{children:"Department"}),U?n.jsx(Be,{label:"Department",hideLabel:!0,doctype:"Department",value:A.department||"",onChange:I=>Z("department",I),placeholder:"Select department…",allowQuickCreate:!0}):n.jsx(ia,{children:A.department||"-"})]}),n.jsxs("div",{children:[n.jsx(zr,{children:"Company"}),U?n.jsx(Be,{label:"Company",hideLabel:!0,doctype:"Company",value:A.company||"",onChange:I=>Z("company",I),placeholder:"Select company…"}):n.jsx(ia,{children:A.company||"-"})]}),!s&&(f==null?void 0:f.template_task)&&n.jsxs("div",{children:[n.jsx(zr,{children:"Template Task"}),n.jsx(ia,{children:n.jsx("button",{onClick:()=>r(`/projects/tasks/${f.template_task}`),className:"text-indigo-600 dark:text-indigo-400 hover:underline",children:f.template_task})})]})]})}),!s&&n.jsx(Yn,{doctype:"Task",docname:t||"",creationDate:f==null?void 0:f.creation,createdBy:f==null?void 0:f.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})},mve=e=>{switch(e==null?void 0:e.toLowerCase()){case"submitted":return"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300";case"draft":return"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400";case"cancelled":return"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300";default:return"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}},gve=()=>{const{t:e}=sr(),t=Ut(),[r,a]=dn(),s=y.useRef(a),i=20;y.useEffect(()=>{s.current=a},[a]);const l=y.useMemo(()=>{const R=parseInt(r.get("page")||"1",10);return Number.isNaN(R)||R<1?1:R},[r]),u=y.useCallback(R=>{const I=typeof R=="function"?R(l):R;a(te=>{const q=new URLSearchParams(te);return q.set("page",String(I)),q})},[l,a]),[d,f]=y.useState(!1),[p,m]=y.useState(r.get("status")||""),[x,v]=y.useState(r.get("q")||""),[b,w]=y.useState(r.get("date_filter_by")||""),[j,k]=y.useState(r.get("date_start")||""),[C,N]=y.useState(r.get("date_end")||""),[O,E]=y.useState(r.get("sort_by")||"creation desc"),[A,T]=y.useState(!1),P=y.useRef(!1),D=y.useRef(!0),z=y.useRef(null),G=y.useMemo(()=>{var R;return((R=r.get("project"))==null?void 0:R.trim())||""},[r]),[V,ne]=y.useState(G);y.useEffect(()=>{ne(G)},[G]);const ge=y.useMemo(()=>G?[["Timesheet Detail","project","=",G]]:[],[G]),Z=y.useMemo(()=>{const R={};return p&&(R.status=p),x&&(R.name=["like",`%${x}%`]),Object.assign(R,n_(b,j,C)),R},[p,x,b,j,C]),{timesheets:U,loading:ce,error:xe,totalCount:be,refetch:me}=Bde({filters:Z,appendFilters:ge,limit_start:(l-1)*i,limit_page_length:i,order_by:O}),oe=y.useMemo(()=>`${l}|${O}|${G}|${JSON.stringify(Z)}|${JSON.stringify(ge)}`,[l,O,G,Z,ge]),{selectedRows:L,toggleRow:H,toggleAllOnPage:K,allOnPageSelected:Y,someOnPageSelected:re}=Vn(U,oe),de=y.useMemo(()=>{let R=Ta(Z);return ge.length&&(R=[...R,...ge]),R.length>0?R:{}},[Z,ge]),ie=y.useCallback(()=>Kn({doctype:"Timesheet",filters:de,orderBy:O}),[de,O]),se=Math.ceil(be/i),he=()=>{m(""),v(""),w(""),k(""),N(""),E("creation desc"),ne(""),a(R=>{const I=new URLSearchParams(R);return["status","q","date_filter_by","date_start","date_end","sort_by","project"].forEach(te=>I.delete(te)),I.set("page","1"),I})};y.useEffect(()=>{if(!P.current){P.current=!0;return}s.current(R=>{const I=new URLSearchParams(R);p?I.set("status",p):I.delete("status"),b?I.set("date_filter_by",b):I.delete("date_filter_by"),j?I.set("date_start",j):I.delete("date_start"),C?I.set("date_end",C):I.delete("date_end"),O!=="creation desc"?I.set("sort_by",O):I.delete("sort_by");const te=V.trim();return te?I.set("project",te):I.delete("project"),I.set("page","1"),I})},[p,b,j,C,O,V]),y.useEffect(()=>{if(P.current){if(D.current){D.current=!1;return}return z.current&&window.clearTimeout(z.current),z.current=window.setTimeout(()=>{s.current(R=>{const I=new URLSearchParams(R);return x?I.set("q",x):I.delete("q"),I.set("page","1"),I})},450),()=>{z.current&&window.clearTimeout(z.current)}}},[x]);const _e=!!(p||x||G||b&&(j||C)),F=R=>t(`/projects/timesheets/${encodeURIComponent(R)}?edit=1`),X=R=>t(`/projects/timesheets/new?duplicate=${encodeURIComponent(R)}`);return n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>t("/projects"),className:"text-sm text-gray-500 hover:text-indigo-600 dark:text-gray-400 dark:hover:text-indigo-400",children:e("projects.moduleTitle")}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(ds,{className:"text-indigo-500"})," ",e("projects.timesheetDoctype")]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("button",{type:"button",onClick:()=>T(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all disabled:opacity-50",disabled:be===0&&L.size===0,children:[n.jsx(hn,{})," ",n.jsx("span",{className:"font-medium",children:e("listPages.export")}),L.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:L.size})]}),n.jsxs("button",{type:"button",onClick:()=>{const R=new URLSearchParams;G&&R.set("project",G);const I=R.toString();t(I?`/projects/timesheets/new?${I}`:"/projects/timesheets/new")},className:"flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700",children:[n.jsx(Pt,{})," ",e("projects.newTimesheet")]})]})]}),n.jsx(Gn,{isOpen:A,onClose:()=>T(!1),doctype:"Timesheet",selectedCount:L.size,pageCount:U.length,totalCount:be,pageData:U,selectedRows:L,rowKey:"name",onFetchAll:ie,fileNamePrefix:"timesheets"}),n.jsxs("div",{className:"isolate bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 mb-6",children:[n.jsx("div",{className:"bg-gradient-to-r from-blue-500 to-blue-600 dark:from-blue-600 dark:to-blue-700 px-4 py-2.5 rounded-t-lg",children:n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[n.jsx("button",{onClick:()=>f(R=>!R),className:"text-white hover:bg-white/20 p-1.5 rounded-lg transition-all",children:d?n.jsx(ps,{size:12}):n.jsx(nr,{size:12})}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Dh,{className:"text-white",size:13}),n.jsx("span",{className:"text-white font-semibold text-sm",children:"Filters"})]}),_e&&n.jsx("span",{className:"bg-white text-blue-600 px-2 py-0.5 rounded-full text-xs font-bold",children:[p,x,G,b&&j].filter(Boolean).length})]}),_e&&n.jsx("div",{className:"flex-1 overflow-x-auto mx-2",children:n.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[x&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-gray-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"ID:"})," ",x,n.jsx("button",{onClick:()=>v(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),p&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Status:"})," ",p,n.jsx("button",{onClick:()=>m(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),G&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Project:"})," ",G,n.jsx("button",{type:"button",onClick:()=>{ne(""),a(R=>{const I=new URLSearchParams(R);return I.delete("project"),I.set("page","1"),I})},children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),b&&j&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsxs("span",{className:"font-semibold",children:[b==="creation"?"Created":"Modified",":"]})," ",j,C?` ${C}`:"",n.jsx("button",{type:"button",onClick:()=>{w(""),k(""),N("")},children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]})]})}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[_e&&n.jsx("button",{onClick:he,className:"text-white/80 hover:text-white text-xs underline whitespace-nowrap",children:"Clear all"}),n.jsx("button",{onClick:()=>me(),className:"text-white hover:bg-white/20 p-1.5 rounded-lg transition-all",title:"Refresh",children:n.jsx(en,{size:12,className:ce?"animate-spin":""})})]})]})}),d&&n.jsx("div",{className:"p-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Project"}),n.jsx("input",{type:"text",value:V,onChange:R=>ne(R.target.value),onKeyDown:R=>R.key==="Enter"&&R.preventDefault(),placeholder:"Filter by project…",className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Timesheet ID"}),n.jsxs("div",{className:"relative",children:[n.jsx(fn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-400 text-xs"}),n.jsx("input",{type:"text",value:x,onChange:R=>v(R.target.value),onKeyDown:R=>R.key==="Enter"&&R.preventDefault(),placeholder:"Search by ID…",className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Status"}),n.jsxs("select",{value:p,onChange:R=>m(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none",children:[n.jsx("option",{value:"",children:"All Status"}),n.jsx("option",{value:"Draft",children:"Draft"}),n.jsx("option",{value:"Submitted",children:"Submitted"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Date Filter By"}),n.jsxs("select",{value:b,onChange:R=>w(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none",children:[n.jsx("option",{value:"",children:"None"}),n.jsx("option",{value:"creation",children:"Created"}),n.jsx("option",{value:"modified",children:"Modified"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Sort By"}),n.jsxs("select",{value:O,onChange:R=>E(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none",children:[n.jsx("option",{value:"creation desc",children:"Created (newest)"}),n.jsx("option",{value:"creation asc",children:"Created (oldest)"}),n.jsx("option",{value:"modified desc",children:"Modified (newest)"}),n.jsx("option",{value:"total_hours desc",children:"Hours (highest)"}),n.jsx("option",{value:"total_hours asc",children:"Hours (lowest)"})]})]}),b&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"From"}),n.jsx("input",{type:"date",value:j,onChange:R=>k(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"To"}),n.jsx("input",{type:"date",value:C,onChange:R=>N(R.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"})]})]})]})})]}),xe&&n.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg text-red-700 dark:text-red-300 text-sm",children:xe}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:[ce?n.jsx("div",{className:"p-12 text-center text-gray-500 dark:text-gray-400",children:e("common.loading")}):U.length===0?n.jsxs("div",{className:"p-12 text-center",children:[n.jsx(ds,{className:"text-4xl text-gray-300 dark:text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:e("projects.noTimesheets")})]}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[n.jsx("thead",{className:"bg-gray-100 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600",children:n.jsxs("tr",{children:[n.jsx("th",{className:"w-10 px-4 py-3 text-left",children:n.jsx("button",{type:"button",onClick:K,className:"text-gray-500 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors",title:Y?"Deselect all":"Select all","aria-label":"Select all on page",children:Y?n.jsx(Sn,{className:"text-indigo-600 dark:text-indigo-400",size:18}):re?n.jsxs("div",{className:"relative inline-block",children:[n.jsx(Gr,{size:18}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"w-2 h-0.5 bg-current"})})]}):n.jsx(Gr,{size:18})})}),[e("projects.timesheetId"),e("commonFields.status"),e("projects.totalHours"),"Billable Hrs","Billing Amt","Costing Amt","Created",""].map(R=>n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:R},R))]})}),n.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:U.map(R=>{var I,te,q,B;return n.jsxs("tr",{className:`hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer ${L.has(R.name)?"bg-indigo-50 dark:bg-indigo-900/20":""}`,onClick:()=>t(`/projects/timesheets/${R.name}`),children:[n.jsx("td",{className:"w-10 px-4 py-3",onClick:je=>je.stopPropagation(),children:n.jsx("button",{type:"button",onClick:()=>H(R.name),className:"text-gray-500 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors","aria-label":`Select ${R.name}`,children:L.has(R.name)?n.jsx(Sn,{className:"text-indigo-600 dark:text-indigo-400",size:18}):n.jsx(Gr,{size:18})})}),n.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[n.jsx("div",{className:"font-medium text-gray-900 dark:text-white",children:R.name}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:R.modified?new Date(R.modified).toLocaleDateString():""})]}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${mve(R.status||"")}`,children:R.status||"Draft"})}),n.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-white",children:[(I=R.total_hours)!=null?I:0," hrs"]}),n.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300",children:[(te=R.total_billable_hours)!=null?te:0," hrs"]}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300",children:(q=R.total_billable_amount)!=null?q:"-"}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-700 dark:text-gray-300",children:(B=R.total_costing_amount)!=null?B:"-"}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",children:R.creation?new Date(R.creation).toLocaleDateString():"-"}),n.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",onClick:je=>je.stopPropagation(),children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>t(`/projects/timesheets/${R.name}`),className:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300 p-2 hover:bg-indigo-50 dark:hover:bg-indigo-900/30 rounded transition-colors",title:"View",children:n.jsx(Hs,{})}),n.jsx("button",{onClick:()=>F(R.name),className:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 p-2 hover:bg-green-50 dark:hover:bg-green-900/30 rounded transition-colors",title:"Edit",children:n.jsx(ha,{})}),n.jsx("button",{onClick:()=>X(R.name),className:"text-purple-600 dark:text-purple-400 hover:text-purple-900 dark:hover:text-purple-300 p-2 hover:bg-purple-50 dark:hover:bg-purple-900/30 rounded transition-colors",title:"Duplicate",children:n.jsx(uu,{})})]})})]},R.name)})})]})}),se>1&&n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 px-4 py-3",children:n.jsx(Wy,{currentPage:l,totalPages:se,totalCount:be,pageSize:i,onPageChange:u})})]})]})},iO=e=>{switch(e==null?void 0:e.toLowerCase()){case"submitted":return"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300";case"cancelled":return"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300";default:return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300"}},oa=({children:e,required:t})=>n.jsxs("label",{className:"block text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),Zr=({children:e,className:t})=>n.jsx("div",{className:`px-3 py-2.5 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-900/30 rounded-lg min-h-[36px] flex items-center border border-transparent dark:border-gray-700/50 ${t||""}`,children:e||n.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:"—"})}),oO="w-full px-3 py-2.5 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-indigo-400 focus:border-indigo-400 transition-colors",cg=({title:e,icon:t,children:r,defaultOpen:a=!0})=>{const[s,i]=y.useState(a);return n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden shadow-sm",children:[n.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"w-full flex items-center justify-between px-5 py-3.5 hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors text-left",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-700 dark:text-gray-200",children:[t,n.jsx("span",{children:e})]}),s?n.jsx(nr,{className:"text-gray-400 text-xs flex-shrink-0"}):n.jsx(bs,{className:"text-gray-400 text-xs flex-shrink-0"})]}),s&&n.jsx("div",{className:"px-5 py-5 bg-white dark:bg-gray-800 border-t border-gray-100 dark:border-gray-700/50",children:r})]})},ug=({title:e,icon:t,children:r})=>n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"px-4 py-2.5 border-b border-gray-100 dark:border-gray-700 bg-gray-50/90 dark:bg-gray-900/40 flex items-center gap-2",children:[t,n.jsx("h3",{className:"text-xs font-bold text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:e})]}),n.jsx("div",{className:"p-4 sm:p-5",children:r})]}),dg=(e={})=>({activity_type:"",from_time:void 0,to_time:void 0,hours:void 0,project:e.project||"",task:e.task||"",note:"",is_billable:0,completed:0}),lO=e=>e.length===16?e+":00":e,xve=e=>e.filter(t=>t.from_time&&t.from_time.trim()!=="").map(t=>{var r;return Se(ee({},t),{from_time:lO(t.from_time.replace("T"," ")),to_time:(r=t.to_time)!=null&&r.trim()?lO(t.to_time.replace("T"," ")):void 0})}),yve=()=>{var R,I,te,q,B,je,Ce;const{t:e}=sr(),{timesheetName:t}=Hn(),[r]=dn(),a=Ut(),s=t==="new",i=y.useMemo(()=>!s&&(r.get("edit")||"")==="1",[s,r]),l=y.useMemo(()=>s&&r.get("duplicate")||"",[s,r]),[u,d]=y.useState(!1),f=r.get("project")||"",p=r.get("task")||"",m=r.get("customer")||"",x=r.get("company")||fa,{timesheet:v,loading:b,error:w,refetch:j}=Ude(s?null:t||null),{createTimesheet:k,updateTimesheet:C,submitTimesheet:N,loading:O}=np(),[E,A]=y.useState(!1),[T,P]=y.useState(s);y.useEffect(()=>{i&&P(!0)},[i]);const[D,z]=y.useState(null),[G,V]=y.useState(!1),[ne,ge]=y.useState(-1),[Z,U]=y.useState(0),ce=y.useRef(null),xe=y.useRef(null),be=ye=>{const Ee=Math.floor(ye/3600).toString().padStart(2,"0"),Xe=Math.floor(ye%3600/60).toString().padStart(2,"0"),tt=(ye%60).toString().padStart(2,"0");return`${Ee}:${Xe}:${tt}`},me=()=>{if(!X)return;const ye=new Date,Ee=ye.toISOString().replace("T"," ").slice(0,19),Xe=dg({project:L.parent_project||f,task:p});Xe.from_time=Ee,H(ve=>Se(ee({},ve),{time_logs:[...ve.time_logs||[],Xe]}));const tt=(L.time_logs||[]).length;ge(tt),z(tt),ce.current=ye,U(0),V(!0),xe.current=setInterval(()=>{U(ve=>ve+1)},1e3)},oe=()=>{if(xe.current&&clearInterval(xe.current),ce.current&&ne>=0){const ye=new Date,Ee=ye.toISOString().replace("T"," ").slice(0,19),Xe=(ye.getTime()-ce.current.getTime())/36e5;H(tt=>{const ve=[...tt.time_logs||[]];return ve[ne]&&(ve[ne]=Se(ee({},ve[ne]),{to_time:Ee,hours:parseFloat(Xe.toFixed(4))})),Se(ee({},tt),{time_logs:ve})})}V(!1),ge(-1),ce.current=null};y.useEffect(()=>()=>{xe.current&&clearInterval(xe.current)},[]);const[L,H]=y.useState({status:"Draft",currency:xt,exchange_rate:1,employee:"",customer:m,parent_project:f,company:x,note:"",time_logs:[dg({project:f,task:p})]}),K=y.useCallback(ye=>{var Xe,tt;const Ee=ye.parent_project||ye.project||"";H({status:ye.status||"Draft",currency:ye.currency||xt,exchange_rate:(Xe=ye.exchange_rate)!=null?Xe:1,employee:ye.employee||"",customer:ye.customer||"",parent_project:Ee,company:ye.company||ye.hospital||fa,note:ye.note||"",time_logs:(tt=ye.time_logs)!=null&&tt.length?ye.time_logs:[]})},[]);y.useEffect(()=>{v&&!s&&K(v)},[v,s,K]),y.useEffect(()=>{if(!s||!l)return;let ye=!1;return d(!0),wt.getTimesheet(l).then(Ee=>{if(ye)return;const Xe=Array.isArray(Ee.time_logs)?Ee.time_logs.map(ve=>({activity_type:ve.activity_type||"",from_time:void 0,to_time:void 0,hours:void 0,project:f||ve.project||"",task:p||ve.task||"",note:ve.note||"",is_billable:ve.is_billable||0,completed:0})):[],tt=Xe.length?Xe:[dg({project:f,task:p})];H(ve=>Se(ee({},ve),{status:"Draft",note:Ee.note||"",parent_project:f||Ee.parent_project||Ee.project||ve.parent_project,customer:m||Ee.customer||ve.customer,company:x,time_logs:tt})),P(!0)}).catch(()=>{}).finally(()=>{ye||d(!1)}),()=>{ye=!0}},[s,l,f,p,m,x]);const Y=(ye,Ee)=>H(Xe=>Se(ee({},Xe),{[ye]:Ee})),re=()=>{H(ye=>Se(ee({},ye),{time_logs:[...ye.time_logs||[],dg({project:ye.parent_project||f,task:p})]}))},de=(ye,Ee,Xe)=>H(tt=>{const ve=[...tt.time_logs||[]],Oe=Se(ee({},ve[ye]),{[Ee]:Xe});if(Ee==="from_time"||Ee==="to_time"){const st=Ee==="from_time"?Xe:Oe.from_time,ct=Ee==="to_time"?Xe:Oe.to_time;if(st&&ct){const ot=new Date(st.replace(" ","T")).getTime(),Ze=new Date(ct.replace(" ","T")).getTime();if(Ze>ot){const St=parseFloat(((Ze-ot)/36e5).toFixed(4));Oe.hours=St,(!Oe.billing_hours||Oe.billing_hours===ve[ye].hours)&&(Oe.billing_hours=St)}}}if(Ee==="is_billable"&&Xe&&!Oe.billing_hours&&Oe.hours&&(Oe.billing_hours=Oe.hours),Ee==="billing_rate"||Ee==="billing_hours"){const st=Ee==="billing_rate"?parseFloat(Xe)||0:Oe.billing_rate||0,ct=Ee==="billing_hours"?parseFloat(Xe)||0:Oe.billing_hours||0;Oe.billing_amount=parseFloat((st*ct).toFixed(2))}return Oe.costing_amount=parseFloat(((Oe.costing_rate||0)*(Oe.hours||0)).toFixed(2)),ve[ye]=Oe,Se(ee({},tt),{time_logs:ve})}),ie=ye=>H(Ee=>{const Xe=[...Ee.time_logs||[]];return Xe.splice(ye,1),z(null),Se(ee({},Ee),{time_logs:Xe})}),se=(L.time_logs||[]).reduce((ye,Ee)=>ye+(Ee.hours||0),0),he=()=>fe(null,null,function*(){const ye=xve(L.time_logs||[]);if(ye.length===0){$e.error("At least one time log with a From Time is required.",{icon:n.jsx(Fr,{})});return}const Ee={status:L.status,currency:L.currency,exchange_rate:L.exchange_rate,naming_series:L.naming_series,time_logs:ye,employee:L.employee||void 0,customer:L.customer||void 0,company:L.company||void 0,parent_project:L.parent_project||void 0,note:L.note||void 0};try{if(s){const Xe=yield k(Ee);$e.success(e("projects.timesheetCreated"),{icon:n.jsx(Or,{})}),P(!1),a(`/projects/timesheets/${Xe.name}`)}else yield C(t,Ee),$e.success(e("projects.timesheetUpdated"),{icon:n.jsx(Or,{})}),P(!1),j()}catch(Xe){$e.error(Xe instanceof Error?Xe.message:e("common.error"),{icon:n.jsx(Fr,{})})}}),_e=()=>{v&&K(v),P(!1),z(null)},F=()=>fe(null,null,function*(){if(!(!t||s))try{A(!0),yield N(t),$e.success("Timesheet submitted",{icon:n.jsx(Or,{})}),j()}catch(ye){$e.error(ye instanceof Error?ye.message:"Error submitting",{icon:n.jsx(Fr,{})})}finally{A(!1)}}),X=s||T;return b?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-indigo-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsx("div",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 shadow-sm",children:n.jsxs("div",{className:"px-6 py-4",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-xs mb-3 text-gray-400 dark:text-gray-500",children:[n.jsx("button",{onClick:()=>a("/projects"),className:"hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors",children:e("projects.moduleTitle")}),n.jsx("span",{children:"/"}),n.jsx("button",{onClick:()=>a("/projects/timesheets"),className:"hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors",children:"Timesheets"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-600 dark:text-gray-300 font-medium",children:s?"New Timesheet":t})]}),n.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[n.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[n.jsx("button",{onClick:()=>a("/projects/timesheets"),className:"mt-1 text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 flex-shrink-0 transition-colors",children:n.jsx(da,{})}),n.jsx("div",{className:"min-w-0",children:n.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[n.jsx("div",{className:"w-9 h-9 rounded-lg bg-indigo-600 flex items-center justify-center flex-shrink-0 shadow-sm",children:n.jsx(ds,{className:"text-white text-sm"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white leading-tight",children:s?"New Timesheet":t}),!s&&n.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:"Series: TS-.YYYY.-"})]}),n.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-semibold ${(v==null?void 0:v.docstatus)===1?"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300":(v==null?void 0:v.docstatus)===2?"bg-red-100 text-red-700":iO(L.status||"Draft")}`,children:[n.jsx(ds,{size:9}),(v==null?void 0:v.docstatus)===1?"Submitted":(v==null?void 0:v.docstatus)===2?"Cancelled":L.status||"Draft"]})]})})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[!s&&!T&&(v==null?void 0:v.docstatus)===1&&n.jsxs("button",{onClick:()=>{const ye=new URLSearchParams({customer:L.customer||""});L.company&&ye.set("company",String(L.company)),L.parent_project&&ye.set("project",String(L.parent_project)),a(`/invoices/new?${ye.toString()}`)},className:"flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 text-sm font-medium",children:[n.jsx(Kc,{size:13})," Create Sales Invoice"]}),!s&&!T&&(v==null?void 0:v.docstatus)===0&&n.jsxs("button",{onClick:F,disabled:E,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 text-sm font-medium",children:[E?n.jsx(vt,{className:"animate-spin"}):n.jsx(cu,{size:12}),"Submit"]}),X&&(G?n.jsxs("button",{type:"button",onClick:oe,className:"flex items-center gap-2 px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 text-sm font-medium shadow-sm",children:[n.jsx(vq,{size:11}),n.jsx("span",{className:"font-mono tracking-widest",children:be(Z)}),"Stop Timer"]}):n.jsxs("button",{type:"button",onClick:me,className:"flex items-center gap-2 px-4 py-2 bg-gray-800 dark:bg-gray-700 text-white rounded-lg hover:bg-gray-900 dark:hover:bg-gray-600 text-sm font-medium",children:[n.jsx(yq,{})," Start Timer"]})),!s&&!T&&n.jsxs("button",{onClick:()=>P(!0),className:"flex items-center gap-2 px-4 py-2 border border-indigo-500 text-indigo-600 dark:text-indigo-400 rounded-lg hover:bg-indigo-50 dark:hover:bg-indigo-900/20 text-sm transition-colors",children:[n.jsx(ha,{})," ",e("common.edit")]}),X&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:he,disabled:O,className:"flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 disabled:opacity-50 text-sm font-medium shadow-sm",children:[O?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),e(O?"common.saving":"common.save")]}),!s&&n.jsx("button",{onClick:_e,className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-600 dark:text-gray-400 text-sm",children:n.jsx(yt,{})})]})]})]})]})}),n.jsxs("div",{className:"px-6 py-6 space-y-3",children:[w&&!s&&n.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-red-700 dark:text-red-300 text-sm",children:w}),!s&&v&&n.jsx(ug,{title:"Summary",icon:n.jsx(ds,{className:"text-indigo-500 flex-shrink-0",size:13}),children:n.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[{label:"Total Hours",value:`${(R=v.total_hours)!=null?R:0} hrs`},{label:"Billable Hours",value:`${(I=v.total_billable_hours)!=null?I:0} hrs`},{label:"Billable Amount",value:`${v.currency||xt} ${(te=v.total_billable_amount)!=null?te:0}`},{label:"Costing Amount",value:`${v.currency||xt} ${(q=v.total_costing_amount)!=null?q:0}`}].map(({label:ye,value:Ee})=>n.jsxs("div",{className:"rounded-lg border border-gray-200/80 dark:border-gray-600/80 bg-gray-50/80 dark:bg-gray-900/40 px-3 py-2.5 min-h-[72px] flex flex-col justify-center",children:[n.jsx("p",{className:"text-[10px] font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:ye}),n.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-white tabular-nums leading-snug",children:Ee})]},ye))})}),n.jsx(ug,{title:"Document",icon:n.jsx(cP,{className:"text-indigo-500 flex-shrink-0",size:13}),children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx(oa,{children:"Series"}),n.jsx(Zr,{children:"TS-.YYYY.-"})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx(oa,{children:"Status"}),X?n.jsxs("select",{value:L.status||"Draft",onChange:ye=>Y("status",ye.target.value),className:oO,children:[n.jsx("option",{value:"Draft",children:"Draft"}),n.jsx("option",{value:"Submitted",children:"Submitted"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]}):n.jsx(Zr,{children:n.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-semibold ${iO(L.status||"Draft")}`,children:L.status||"Draft"})})]})]})}),n.jsx(ug,{title:"Organization",icon:n.jsx(sP,{className:"text-indigo-500 flex-shrink-0",size:13}),children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx(oa,{children:"Hospital"}),X?n.jsx(Be,{label:"Hospital",hideLabel:!0,doctype:"Company",value:L.company||"",onChange:ye=>Y("company",ye),placeholder:"Select hospital / company…"}):n.jsx(Zr,{children:L.company})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx(oa,{children:"Project"}),X?n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:L.parent_project||"",onChange:ye=>Y("parent_project",ye),placeholder:"Select project…"}):n.jsx(Zr,{children:L.parent_project?n.jsx("button",{type:"button",onClick:()=>a(`/projects/list/${L.parent_project}`),className:"text-indigo-600 dark:text-indigo-400 hover:underline font-medium",children:L.parent_project}):null})]})]})}),n.jsx(ug,{title:"Customer & currency",icon:n.jsx(Dl,{className:"text-indigo-500 flex-shrink-0",size:13}),children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-4",children:[n.jsxs("div",{className:"min-w-0 sm:col-span-2 lg:col-span-1",children:[n.jsx(oa,{children:"Customer"}),X?n.jsx(Be,{label:"Customer",hideLabel:!0,doctype:"Customer",value:L.customer||"",onChange:ye=>Y("customer",ye),placeholder:"Select customer…"}):n.jsx(Zr,{children:L.customer})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx(oa,{children:"Currency"}),n.jsx(Zr,{children:L.currency||xt})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx(oa,{children:"Exchange rate"}),n.jsx(Zr,{children:(B=L.exchange_rate)!=null?B:1})]})]})}),n.jsx(cg,{title:"Employee Detail",icon:n.jsx(sh,{className:"text-indigo-500",size:13}),children:n.jsxs("div",{className:"max-w-sm",children:[n.jsx(oa,{children:"Employee"}),X?n.jsx(Be,{label:"Employee",hideLabel:!0,doctype:"Employee",value:L.employee||"",onChange:ye=>Y("employee",ye),placeholder:"Select employee…",filters:{status:"Active"},allowQuickCreate:!0}):n.jsx(Zr,{children:L.employee})]})}),n.jsxs(cg,{title:"Time Sheets",icon:n.jsx(ds,{className:"text-indigo-500",size:13}),defaultOpen:!0,children:[n.jsxs("div",{className:"overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-700 mb-3",children:[n.jsxs("div",{className:`grid ${X?"grid-cols-[40px_minmax(130px,1fr)_155px_155px_70px_minmax(110px,1fr)_58px_36px]":"grid-cols-[40px_minmax(130px,1fr)_155px_155px_70px_minmax(110px,1fr)_58px]"}
bg-gray-50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-700 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase`,children:[n.jsx("div",{className:"px-3 py-2",children:"No."}),n.jsx("div",{className:"px-3 py-2",children:"Activity Type"}),n.jsxs("div",{className:"px-3 py-2",children:["From Time ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsx("div",{className:"px-3 py-2",children:"To Time"}),n.jsx("div",{className:"px-3 py-2",children:"Hrs"}),n.jsx("div",{className:"px-3 py-2",children:"Project"}),n.jsx("div",{className:"px-3 py-2 text-center",children:"Billable"}),n.jsx("div",{className:"py-2"}),X&&n.jsx("div",{className:"py-2"})]}),(L.time_logs||[]).length===0?n.jsx("div",{className:"py-10 text-center text-sm text-gray-400 dark:text-gray-500 italic",children:X?'Click "Add Row" below to add time entries':"No time logs"}):n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:(L.time_logs||[]).map((ye,Ee)=>{var Xe,tt,ve,Oe,st,ct,ot;return n.jsxs(_t.Fragment,{children:[n.jsxs("div",{className:`grid ${X?"grid-cols-[40px_minmax(130px,1fr)_155px_155px_70px_minmax(110px,1fr)_58px_32px_36px]":"grid-cols-[40px_minmax(130px,1fr)_155px_155px_70px_minmax(110px,1fr)_58px_32px]"}
items-center hover:bg-gray-50 dark:hover:bg-gray-700/20
${D===Ee?"bg-indigo-50 dark:bg-indigo-900/10":""}
${G&&ne===Ee?"bg-red-50 dark:bg-red-900/10 border-l-2 border-red-400":""}`,children:[n.jsx("div",{className:"px-3 py-2.5 text-xs text-gray-500 font-medium",children:Ee+1}),n.jsx("div",{className:"px-2 py-1.5",onClick:Ze=>Ze.stopPropagation(),children:X?n.jsx(Be,{label:"Activity Type",hideLabel:!0,doctype:"Activity Type",value:ye.activity_type||"",onChange:Ze=>de(Ee,"activity_type",Ze),placeholder:"Activity…",allowQuickCreate:!0,compact:!0}):n.jsx("span",{className:"text-sm text-gray-800 dark:text-gray-200",children:ye.activity_type||"-"})}),n.jsx("div",{className:"px-2 py-1.5",onClick:Ze=>Ze.stopPropagation(),children:X?n.jsx("input",{type:"datetime-local",value:ye.from_time?ye.from_time.replace(" ","T").slice(0,16):"",onChange:Ze=>de(Ee,"from_time",Ze.target.value||void 0),required:!0,className:`text-xs border rounded px-2 py-1.5 w-full focus:outline-none focus:ring-1 focus:ring-indigo-400 ${ye.from_time?"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700":"border-red-300 bg-red-50 dark:bg-red-900/20 dark:border-red-600"} text-gray-900 dark:text-white`}):n.jsx("span",{className:"text-xs text-gray-700 dark:text-gray-300",children:ye.from_time||"-"})}),n.jsx("div",{className:"px-2 py-1.5",onClick:Ze=>Ze.stopPropagation(),children:X?n.jsx("input",{type:"datetime-local",value:ye.to_time?ye.to_time.replace(" ","T").slice(0,16):"",onChange:Ze=>de(Ee,"to_time",Ze.target.value||void 0),className:"text-xs border border-gray-300 dark:border-gray-600 rounded px-2 py-1.5 w-full bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-indigo-400"}):n.jsx("span",{className:"text-xs text-gray-700 dark:text-gray-300",children:ye.to_time||"-"})}),n.jsx("div",{className:"px-2 py-1.5",onClick:Ze=>Ze.stopPropagation(),children:X?n.jsx("input",{type:"number",min:0,step:.25,value:(Xe=ye.hours)!=null?Xe:"",onChange:Ze=>de(Ee,"hours",parseFloat(Ze.target.value)||void 0),placeholder:"0",className:"text-xs border border-gray-300 dark:border-gray-600 rounded px-2 py-1.5 w-full bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-indigo-400"}):n.jsx("span",{className:"text-sm font-medium text-gray-800 dark:text-gray-200",children:((tt=ye.hours)!=null?tt:0).toFixed(3)})}),n.jsx("div",{className:"px-2 py-1.5",onClick:Ze=>Ze.stopPropagation(),children:X?n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:ye.project||"",onChange:Ze=>de(Ee,"project",Ze),placeholder:"Project…",compact:!0}):n.jsx("span",{className:"text-sm text-gray-800 dark:text-gray-200",children:ye.project||"-"})}),n.jsx("div",{className:"px-3 py-2.5 flex justify-center",onClick:Ze=>Ze.stopPropagation(),children:n.jsx("input",{type:"checkbox",checked:!!ye.is_billable,onChange:Ze=>de(Ee,"is_billable",Ze.target.checked?1:0),disabled:!X,className:"w-4 h-4 text-green-600 rounded cursor-pointer"})}),n.jsx("div",{className:"flex justify-center",onClick:Ze=>Ze.stopPropagation(),children:n.jsx("button",{type:"button",onClick:()=>z(D===Ee?null:Ee),className:`p-1.5 rounded transition-colors ${D===Ee?"text-indigo-600 bg-indigo-100 dark:bg-indigo-900/30":"text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 dark:hover:bg-indigo-900/20"}`,title:"Edit row details",children:n.jsx(Vs,{size:11})})}),X&&n.jsx("div",{className:"flex justify-center",onClick:Ze=>Ze.stopPropagation(),children:n.jsx("button",{type:"button",onClick:()=>ie(Ee),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded transition-colors",title:"Remove row",children:n.jsx(Za,{size:11})})})]}),D===Ee&&n.jsxs("div",{className:"border-t border-indigo-100 dark:border-indigo-800/40 bg-indigo-50/60 dark:bg-indigo-900/10 px-4 py-4 mx-0",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-xs font-semibold text-indigo-700 dark:text-indigo-400 uppercase tracking-wide",children:["Editing Row #",Ee+1]}),n.jsx("button",{type:"button",onClick:()=>z(null),className:"text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 px-2 py-0.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700",children:"✕ Close"})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3",children:[n.jsxs("div",{children:[n.jsx(oa,{children:"Activity Type"}),X?n.jsx(Be,{label:"Activity Type",hideLabel:!0,doctype:"Activity Type",value:ye.activity_type||"",onChange:Ze=>de(Ee,"activity_type",Ze),placeholder:"Select activity…",allowQuickCreate:!0}):n.jsx(Zr,{children:ye.activity_type||"-"})]}),n.jsxs("div",{children:[n.jsx(oa,{children:"Hours"}),n.jsx(Zr,{children:((ve=ye.hours)!=null?ve:0).toFixed(3)})]}),n.jsxs("div",{children:[n.jsx(oa,{required:!0,children:"From Time"}),X?n.jsx("input",{type:"datetime-local",value:ye.from_time?ye.from_time.replace(" ","T").slice(0,16):"",onChange:Ze=>de(Ee,"from_time",Ze.target.value||void 0),className:"w-full text-sm border border-gray-300 dark:border-gray-600 rounded-lg px-3 py-2 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"}):n.jsx(Zr,{children:ye.from_time||"-"})]}),n.jsxs("div",{children:[n.jsx(oa,{children:"To Time"}),X?n.jsx("input",{type:"datetime-local",value:ye.to_time?ye.to_time.replace(" ","T").slice(0,16):"",onChange:Ze=>de(Ee,"to_time",Ze.target.value||void 0),className:"w-full text-sm border border-gray-300 dark:border-gray-600 rounded-lg px-3 py-2 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"}):n.jsx(Zr,{children:ye.to_time||"-"})]}),n.jsxs("div",{className:"sm:col-span-2",children:[n.jsx(oa,{children:"Description"}),X?n.jsx("textarea",{rows:2,value:ye.note||"",onChange:Ze=>de(Ee,"note",Ze.target.value),placeholder:"Add notes…",className:"w-full text-sm border border-gray-300 dark:border-gray-600 rounded-lg px-3 py-2 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none resize-none"}):n.jsx(Zr,{children:ye.note||"-"})]}),n.jsxs("div",{children:[n.jsx(oa,{children:"Project"}),X?n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:ye.project||"",onChange:Ze=>de(Ee,"project",Ze),placeholder:"Select project…"}):n.jsx(Zr,{children:ye.project||"-"})]}),n.jsxs("div",{className:"flex items-center gap-3 pt-5",children:[n.jsx("input",{type:"checkbox",id:`completed-${Ee}`,checked:!!ye.completed,onChange:Ze=>de(Ee,"completed",Ze.target.checked?1:0),disabled:!X,className:"w-4 h-4 text-green-600 rounded"}),n.jsx("label",{htmlFor:`completed-${Ee}`,className:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer",children:"Completed"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"checkbox",id:`billable-${Ee}`,checked:!!ye.is_billable,onChange:Ze=>de(Ee,"is_billable",Ze.target.checked?1:0),disabled:!X,className:"w-4 h-4 text-green-600 rounded"}),n.jsx("label",{htmlFor:`billable-${Ee}`,className:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer",children:"Is Billable"})]}),n.jsxs("div",{children:[n.jsx(oa,{children:"Billing Hours"}),X?n.jsx("input",{type:"number",min:0,step:.01,value:(Oe=ye.billing_hours)!=null?Oe:"",onChange:Ze=>de(Ee,"billing_hours",parseFloat(Ze.target.value)||void 0),placeholder:"0",className:"w-full text-sm border border-gray-300 dark:border-gray-600 rounded-lg px-3 py-2 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"}):n.jsx(Zr,{children:(st=ye.billing_hours)!=null?st:"-"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-3 mt-3 pt-3 border-t border-indigo-100 dark:border-indigo-800/40",children:[n.jsxs("div",{children:[n.jsxs(oa,{children:["Billing Rate (",L.currency||xt,")"]}),X?n.jsx("input",{type:"number",min:0,step:.01,value:(ct=ye.billing_rate)!=null?ct:"",onChange:Ze=>de(Ee,"billing_rate",parseFloat(Ze.target.value)||void 0),placeholder:"0.00",className:"w-full text-sm border border-gray-300 dark:border-gray-600 rounded-lg px-3 py-2 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"}):n.jsx(Zr,{children:ye.billing_rate!=null?`${L.currency||xt} ${ye.billing_rate.toFixed(2)}`:"-"})]}),n.jsxs("div",{children:[n.jsxs(oa,{children:["Billing Amount (",L.currency||xt,")"]}),n.jsx(Zr,{className:"font-semibold text-green-700 dark:text-green-400",children:ye.billing_amount!=null?`${L.currency||xt} ${ye.billing_amount.toFixed(2)}`:"-"})]}),n.jsxs("div",{children:[n.jsxs(oa,{children:["Costing Rate (",L.currency||xt,")"]}),X?n.jsx("input",{type:"number",min:0,step:.01,value:(ot=ye.costing_rate)!=null?ot:"",onChange:Ze=>de(Ee,"costing_rate",parseFloat(Ze.target.value)||void 0),placeholder:"0.00",className:"w-full text-sm border border-gray-300 dark:border-gray-600 rounded-lg px-3 py-2 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-indigo-400 focus:outline-none"}):n.jsx(Zr,{children:ye.costing_rate!=null?`${L.currency||xt} ${ye.costing_rate.toFixed(2)}`:"-"})]}),n.jsxs("div",{children:[n.jsxs(oa,{children:["Costing Amount (",L.currency||xt,")"]}),n.jsx(Zr,{children:ye.costing_amount!=null?`${L.currency||xt} ${ye.costing_amount.toFixed(2)}`:"-"})]})]})]}),!X&&!!ye.completed&&n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/30 px-6 pb-1 text-xs text-green-600 dark:text-green-400",children:"✓ Completed"})]},Ee)})})]}),X&&n.jsxs("button",{type:"button",onClick:re,className:"flex items-center gap-1.5 px-3 py-1.5 text-sm text-indigo-700 dark:text-indigo-400 border border-indigo-300 dark:border-indigo-700 rounded-lg hover:bg-indigo-50 dark:hover:bg-indigo-900/20 transition-colors",children:[n.jsx(Pt,{size:10})," Add Row"]}),n.jsxs("div",{className:"mt-4 flex items-center justify-between border-t border-gray-100 dark:border-gray-700 pt-3",children:[n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Total Working Hours"}),n.jsx("span",{className:"text-sm font-bold text-gray-900 dark:text-white bg-gray-100 dark:bg-gray-700 px-3 py-1 rounded-lg",children:s?se.toFixed(3):((je=v==null?void 0:v.total_hours)!=null?je:se).toFixed?((Ce=v==null?void 0:v.total_hours)!=null?Ce:se).toFixed(3):"0.000"})]})]}),n.jsx(cg,{title:"Billing Details",icon:n.jsx(Dl,{className:"text-indigo-500",size:13}),defaultOpen:!1,children:n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:(()=>{const ye=L.time_logs||[],Ee=L.currency||xt,Xe=ye.filter(ot=>ot.is_billable).reduce((ot,Ze)=>ot+(Ze.billing_hours||Ze.hours||0),0),tt=ye.filter(ot=>ot.is_billable).reduce((ot,Ze)=>ot+(Ze.billing_amount||0),0),ve=ye.reduce((ot,Ze)=>ot+(Ze.costing_amount||0),0),Oe=v==null?void 0:v.total_billable_hours,st=v==null?void 0:v.total_billable_amount,ct=v==null?void 0:v.total_costing_amount;return[{label:"Total Billable Hours",value:`${(Oe!=null?Oe:Xe).toFixed?(Oe!=null?Oe:Xe).toFixed(3):Xe.toFixed(3)} hrs`},{label:"Total Billable Amount",value:`${Ee} ${(st!=null?st:tt).toFixed(2)}`},{label:"Total Costing Amount",value:`${Ee} ${(ct!=null?ct:ve).toFixed(2)}`}].map(({label:ot,value:Ze})=>n.jsxs("div",{children:[n.jsx(oa,{children:ot}),n.jsx(Zr,{children:Ze})]},ot))})()})}),n.jsx(cg,{title:"Note",icon:n.jsx(oP,{className:"text-gray-400",size:13}),defaultOpen:!1,children:X?n.jsx("textarea",{value:L.note||"",onChange:ye=>Y("note",ye.target.value),rows:4,placeholder:"Add notes for this timesheet…",className:`${oO} resize-y`}):n.jsx(Zr,{children:L.note})}),!s&&v&&n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm py-4 px-5 grid grid-cols-2 sm:grid-cols-3 gap-3 text-xs text-gray-400 dark:text-gray-500",children:[n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block text-gray-500 dark:text-gray-400",children:"Created By"}),v.owner||"-"]}),n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block text-gray-500 dark:text-gray-400",children:"Created"}),v.creation?new Date(v.creation).toLocaleString():"-"]}),n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block text-gray-500 dark:text-gray-400",children:"Modified"}),v.modified?new Date(v.modified).toLocaleString():"-"]})]}),!s&&n.jsx(Yn,{doctype:"Timesheet",docname:t||"",creationDate:v==null?void 0:v.creation,createdBy:v==null?void 0:v.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})},Df=20,vve=()=>{const{t:e}=sr(),t=Ut(),[r,a]=y.useState(""),[s,i]=y.useState(0),[l,u]=y.useState(!1),d=y.useMemo(()=>{const E={};return r.trim()&&(E.activity_type=["like",`%${r.trim()}%`]),E},[r]),{activityTypes:f,loading:p,totalCount:m,refetch:x}=Wde({filters:d,limit_start:s*Df,limit_page_length:Df,order_by:"name asc"});y.useEffect(()=>{x()},[s,d,x]);const v=y.useMemo(()=>`${s}|${JSON.stringify(d)}`,[s,d]),{selectedRows:b,toggleRow:w,toggleAllOnPage:j,allOnPageSelected:k,someOnPageSelected:C}=Vn(f,v),N=y.useCallback(()=>Kn({doctype:"Activity Type",filters:d,orderBy:"name asc"}),[d]),O=Math.max(1,Math.ceil(m/Df));return n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{type:"button",onClick:()=>t("/projects"),className:"text-sm text-gray-500 hover:text-teal-600 dark:text-gray-400 dark:hover:text-teal-400",children:e("projects.moduleTitle")}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(nP,{className:"text-teal-500"})," ",e("projects.activityTypeDoctype")]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("button",{type:"button",onClick:()=>u(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:m===0&&b.size===0,children:[n.jsx(hn,{})," ",e("listPages.export"),b.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:b.size})]}),n.jsx("button",{type:"button",onClick:()=>x(),className:"p-2 text-gray-500 border border-gray-200 dark:border-gray-600 rounded-lg hover:text-teal-600","aria-label":"Refresh",children:n.jsx(en,{size:14,className:p?"animate-spin":""})}),n.jsxs("button",{type:"button",onClick:()=>t("/projects/activity-types/new"),className:"flex items-center gap-2 px-4 py-2 bg-teal-600 text-white rounded-lg hover:bg-teal-700 text-sm font-medium",children:[n.jsx(Pt,{size:12})," New"]})]})]}),n.jsxs("div",{className:"mb-4 flex flex-wrap gap-3 items-center",children:[n.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-md",children:[n.jsx(fn,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-xs"}),n.jsx("input",{value:r,onChange:E=>{a(E.target.value),i(0)},placeholder:"Search activity type…",className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white"})]}),n.jsxs("span",{className:"text-xs text-gray-500",children:[m," total"]})]}),n.jsx(Gn,{isOpen:l,onClose:()=>u(!1),doctype:"Activity Type",selectedCount:b.size,pageCount:f.length,totalCount:m,pageData:f,selectedRows:b,rowKey:"name",onFetchAll:N,fileNamePrefix:"activity_types"}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"w-10 px-2 py-3",children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-teal-600 focus:ring-teal-500",checked:k,ref:E=>{E&&(E.indeterminate=C)},onChange:j,"aria-label":"Select all on page"})}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Name"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Billing rate"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Costing rate"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Status"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-3 px-4 w-24",children:" "})]})}),n.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:p?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"text-center py-10 text-gray-400",children:"Loading…"})}):f.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"text-center py-10 text-gray-400",children:"No activity types found"})}):f.map(E=>{var A,T;return n.jsxs("tr",{className:`hover:bg-gray-50 dark:hover:bg-gray-700/30 cursor-pointer ${b.has(E.name)?"bg-teal-50/80 dark:bg-teal-900/20":""}`,onClick:()=>t(`/projects/activity-types/${encodeURIComponent(E.name)}`),children:[n.jsx("td",{className:"w-10 px-2 py-3",onClick:P=>P.stopPropagation(),children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-teal-600 focus:ring-teal-500",checked:b.has(E.name),onChange:()=>w(E.name),"aria-label":`Select ${E.name}`})}),n.jsx("td",{className:"py-3 px-4 font-medium text-teal-600",children:E.activity_type||E.name}),n.jsx("td",{className:"py-3 px-4 text-gray-600 dark:text-gray-300",children:(A=E.billing_rate)!=null?A:"—"}),n.jsx("td",{className:"py-3 px-4 text-gray-600 dark:text-gray-300",children:(T=E.costing_rate)!=null?T:"—"}),n.jsx("td",{className:"py-3 px-4",children:n.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${E.disabled?"bg-red-100 text-red-700":"bg-green-100 text-green-700"}`,children:E.disabled?"Disabled":"Active"})}),n.jsx("td",{className:"py-3 px-4 text-right",children:n.jsx("button",{type:"button",onClick:P=>{P.stopPropagation(),t(`/projects/activity-types/${encodeURIComponent(E.name)}`)},className:"text-teal-600 hover:text-teal-800 p-1","aria-label":"View",children:n.jsx(Hs,{})})})]},E.name)})})]})}),m>Df&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:["Page ",s+1," of ",O]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",disabled:s===0,onClick:()=>i(E=>Math.max(0,E-1)),className:"px-3 py-1 text-xs border rounded disabled:opacity-40",children:"Prev"}),n.jsx("button",{type:"button",disabled:(s+1)*Df>=m,onClick:()=>i(E=>E+1),className:"px-3 py-1 text-xs border rounded disabled:opacity-40",children:"Next"})]})]})]})]})},bve=()=>{var O,E;const{t:e}=sr(),{activityTypeName:t}=Hn(),r=Ut(),a=t==="new",{activityType:s,loading:i,error:l,refetch:u}=Vde(a?null:t||null),{createActivityType:d,updateActivityType:f,loading:p}=np(),[m,x]=y.useState(a),[v,b]=y.useState({activity_type:"",billing_rate:void 0,costing_rate:void 0,disabled:0});y.useEffect(()=>{var A;s&&!a&&b({activity_type:s.activity_type||s.name||"",billing_rate:s.billing_rate,costing_rate:s.costing_rate,disabled:(A=s.disabled)!=null?A:0})},[s,a]);const w=(A,T)=>b(P=>Se(ee({},P),{[A]:T})),j=()=>fe(null,null,function*(){var A,T,P;if(!((A=v.activity_type)!=null&&A.trim())){$e.error("Activity Type name is required");return}try{if(a){const D=Se(ee(ee({activity_type:v.activity_type.trim()},v.billing_rate!==void 0?{billing_rate:v.billing_rate}:{}),v.costing_rate!==void 0?{costing_rate:v.costing_rate}:{}),{disabled:(T=v.disabled)!=null?T:0}),z=yield d(D);$e.success("Activity Type created",{icon:n.jsx(Or,{})}),r(`/projects/activity-types/${encodeURIComponent(z.name)}`)}else{const D=Se(ee(ee({},v.billing_rate!==void 0?{billing_rate:v.billing_rate}:{}),v.costing_rate!==void 0?{costing_rate:v.costing_rate}:{}),{disabled:(P=v.disabled)!=null?P:0});yield f(t,D),$e.success("Activity Type updated",{icon:n.jsx(Or,{})}),x(!1),u()}}catch(D){$e.error(D instanceof Error?D.message:e("common.error"),{icon:n.jsx(Fr,{})})}}),k=()=>{var A;x(!1),s&&b({activity_type:s.activity_type||s.name||"",billing_rate:s.billing_rate,costing_rate:s.costing_rate,disabled:(A=s.disabled)!=null?A:0})},C=A=>`w-full px-3 py-2 text-sm border rounded-lg ${A?"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-teal-400":"border-transparent bg-gray-50 dark:bg-gray-800 text-gray-800 dark:text-gray-200 cursor-default"}`,N=a||m;return i?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-teal-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-6",children:[n.jsx("button",{onClick:()=>r("/projects"),className:"text-gray-500 hover:text-indigo-600 dark:text-gray-400",children:e("projects.moduleTitle")}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsx("button",{onClick:()=>r("/projects/activity-types"),className:"text-gray-500 hover:text-teal-600 dark:text-gray-400",children:e("projects.activityTypeDoctype")}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:a?e("projects.newActivityType"):(s==null?void 0:s.activity_type)||(s==null?void 0:s.name)||t})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 dark:border-gray-700 flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>r("/projects/activity-types"),className:"text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",children:n.jsx(da,{})}),n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:a?e("projects.newActivityType"):v.activity_type||t})]}),n.jsxs("div",{className:"flex gap-2",children:[!a&&!m&&n.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-2 px-4 py-2 border border-teal-500 text-teal-600 dark:text-teal-400 rounded-lg hover:bg-teal-50 dark:hover:bg-teal-900/20 text-sm",children:[n.jsx(ha,{})," ",e("common.edit")]}),N&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:j,disabled:p,className:"flex items-center gap-2 px-4 py-2 bg-teal-600 text-white rounded-lg hover:bg-teal-700 disabled:opacity-50 text-sm",children:[p?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),e(p?"common.saving":"common.save")]}),!a&&n.jsx("button",{onClick:k,className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-600 dark:text-gray-400 text-sm",children:n.jsx(yt,{})})]})]})]}),l&&!a&&n.jsx("div",{className:"mx-6 mt-4 p-3 bg-red-50 dark:bg-red-900/20 rounded text-red-700 dark:text-red-300 text-sm",children:l}),n.jsxs("div",{className:"p-6 space-y-4",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"block text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:["Activity Type *",a&&n.jsx("span",{className:"ml-1 text-gray-400 font-normal normal-case text-xs",children:"(becomes the record name)"})]}),n.jsx("input",{type:"text",value:v.activity_type||"",onChange:A=>w("activity_type",A.target.value),disabled:!a,className:C(a),placeholder:"e.g. Design, Development, Testing..."}),!a&&n.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Activity Type name cannot be changed after creation."})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Billing Rate"}),n.jsx("input",{type:"number",min:0,step:.01,value:(O=v.billing_rate)!=null?O:"",onChange:A=>w("billing_rate",A.target.value?parseFloat(A.target.value):void 0),disabled:!N,className:C(N),placeholder:"0.00"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Costing Rate"}),n.jsx("input",{type:"number",min:0,step:.01,value:(E=v.costing_rate)!=null?E:"",onChange:A=>w("costing_rate",A.target.value?parseFloat(A.target.value):void 0),disabled:!N,className:C(N),placeholder:"0.00"})]})]}),n.jsx("div",{children:n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:!!v.disabled,onChange:A=>w("disabled",A.target.checked?1:0),disabled:!N,className:"w-4 h-4 text-red-500 rounded"}),n.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Disabled"})]})}),!a&&s&&n.jsxs("div",{className:"pt-4 border-t border-gray-100 dark:border-gray-700 grid grid-cols-2 gap-3 text-xs text-gray-500 dark:text-gray-400",children:[n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block",children:"Created"}),s.creation?new Date(s.creation).toLocaleString():"-"]}),n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block",children:"Modified"}),s.modified?new Date(s.modified).toLocaleString():"-"]})]}),!a&&n.jsx("div",{className:"pt-4",children:n.jsx(Yn,{doctype:"Activity Type",docname:(s==null?void 0:s.name)||t||"",creationDate:s==null?void 0:s.creation,createdBy:s==null?void 0:s.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})})]})]})]})},Rf=20,wve=()=>{const{t:e}=sr(),t=Ut(),[r,a]=y.useState(""),[s,i]=y.useState(0),[l,u]=y.useState(!1),d=y.useMemo(()=>{const E={};return r.trim()&&(E.name=["like",`%${r.trim()}%`]),E},[r]),{templates:f,loading:p,totalCount:m,refetch:x}=Hde({filters:d,limit_start:s*Rf,limit_page_length:Rf,order_by:"name asc"});y.useEffect(()=>{x()},[s,d,x]);const v=y.useMemo(()=>`${s}|${JSON.stringify(d)}`,[s,d]),{selectedRows:b,toggleRow:w,toggleAllOnPage:j,allOnPageSelected:k,someOnPageSelected:C}=Vn(f,v),N=y.useCallback(()=>Kn({doctype:"Project Template",filters:d,orderBy:"name asc"}),[d]),O=Math.max(1,Math.ceil(m/Rf));return n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{type:"button",onClick:()=>t("/projects"),className:"text-sm text-gray-500 hover:text-violet-600 dark:text-gray-400 dark:hover:text-violet-400",children:e("projects.moduleTitle")}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(lP,{className:"text-violet-500"})," ",e("projects.projectTemplateDoctype")]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("button",{type:"button",onClick:()=>u(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:m===0&&b.size===0,children:[n.jsx(hn,{})," ",e("listPages.export"),b.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:b.size})]}),n.jsx("button",{type:"button",onClick:()=>x(),className:"p-2 text-gray-500 border border-gray-200 dark:border-gray-600 rounded-lg hover:text-violet-600","aria-label":"Refresh",children:n.jsx(en,{size:14,className:p?"animate-spin":""})}),n.jsxs("button",{type:"button",onClick:()=>t("/projects/templates/new"),className:"flex items-center gap-2 px-4 py-2 bg-violet-600 text-white rounded-lg hover:bg-violet-700 text-sm font-medium",children:[n.jsx(Pt,{size:12})," New"]})]})]}),n.jsxs("div",{className:"mb-4 flex flex-wrap gap-3 items-center",children:[n.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-md",children:[n.jsx(fn,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-xs"}),n.jsx("input",{value:r,onChange:E=>{a(E.target.value),i(0)},placeholder:"Search template…",className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white"})]}),n.jsxs("span",{className:"text-xs text-gray-500",children:[m," total"]})]}),n.jsx(Gn,{isOpen:l,onClose:()=>u(!1),doctype:"Project Template",selectedCount:b.size,pageCount:f.length,totalCount:m,pageData:f,selectedRows:b,rowKey:"name",onFetchAll:N,fileNamePrefix:"project_templates"}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"w-10 px-2 py-3",children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-violet-600 focus:ring-violet-500",checked:k,ref:E=>{E&&(E.indeterminate=C)},onChange:j,"aria-label":"Select all on page"})}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Name"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Project type"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Modified"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-3 px-4 w-24",children:" "})]})}),n.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:p?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"text-center py-10 text-gray-400",children:"Loading…"})}):f.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"text-center py-10 text-gray-400",children:"No templates found"})}):f.map(E=>n.jsxs("tr",{className:`hover:bg-gray-50 dark:hover:bg-gray-700/30 cursor-pointer ${b.has(E.name)?"bg-violet-50/80 dark:bg-violet-900/20":""}`,onClick:()=>t(`/projects/templates/${encodeURIComponent(E.name)}`),children:[n.jsx("td",{className:"w-10 px-2 py-3",onClick:A=>A.stopPropagation(),children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-violet-600 focus:ring-violet-500",checked:b.has(E.name),onChange:()=>w(E.name),"aria-label":`Select ${E.name}`})}),n.jsx("td",{className:"py-3 px-4 font-medium text-violet-600",children:E.name}),n.jsx("td",{className:"py-3 px-4 text-gray-600 dark:text-gray-300",children:E.project_type||"—"}),n.jsx("td",{className:"py-3 px-4 text-gray-500 text-xs",children:E.modified?new Date(E.modified).toLocaleDateString():"—"}),n.jsx("td",{className:"py-3 px-4 text-right",children:n.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),t(`/projects/templates/${encodeURIComponent(E.name)}`)},className:"text-violet-600 hover:text-violet-800 p-1","aria-label":"View",children:n.jsx(Hs,{})})})]},E.name))})]})}),m>Rf&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:["Page ",s+1," of ",O]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",disabled:s===0,onClick:()=>i(E=>Math.max(0,E-1)),className:"px-3 py-1 text-xs border rounded disabled:opacity-40",children:"Prev"}),n.jsx("button",{type:"button",disabled:(s+1)*Rf>=m,onClick:()=>i(E=>E+1),className:"px-3 py-1 text-xs border rounded disabled:opacity-40",children:"Next"})]})]})]})]})},cO=()=>({task:"",subject:"",duration:void 0}),jve=e=>e.filter(t=>{var r;return(r=t.task)==null?void 0:r.trim()}).map(({task:t,duration:r})=>ee({task:t.trim()},r!==void 0?{duration:r}:{})),_ve=()=>{const{t:e}=sr(),{templateName:t}=Hn(),r=Ut(),a=t==="new",{template:s,loading:i,error:l,refetch:u}=qde(a?null:t||null),{createProjectTemplate:d,updateProjectTemplate:f,loading:p}=np(),[m,x]=y.useState(a),[v,b]=y.useState({name:"",project_type:"",tasks:[cO()]});y.useEffect(()=>{var A;s&&!a&&b({name:s.name||"",project_type:s.project_type||"",tasks:(A=s.tasks)!=null&&A.length?s.tasks:[]})},[s,a]);const w=(A,T)=>b(P=>Se(ee({},P),{[A]:T})),j=()=>b(A=>Se(ee({},A),{tasks:[...A.tasks||[],cO()]})),k=(A,T,P)=>b(D=>{const z=[...D.tasks||[]];return z[A]=Se(ee({},z[A]),{[T]:P}),Se(ee({},D),{tasks:z})}),C=A=>b(T=>{const P=[...T.tasks||[]];return P.splice(A,1),Se(ee({},T),{tasks:P})}),N=()=>fe(null,null,function*(){var P,D;if(!((P=v.name)!=null&&P.trim())){$e.error("Template name is required");return}const A=jve(v.tasks||[]),T=Se(ee({name:v.name.trim()},(D=v.project_type)!=null&&D.trim()?{project_type:v.project_type.trim()}:{}),{tasks:A});try{if(a){const z=yield d(T);$e.success(e("projects.templateCreated"),{icon:n.jsx(Or,{})}),r(`/projects/templates/${encodeURIComponent(z.name)}`)}else yield f(t,T),$e.success(e("projects.templateUpdated"),{icon:n.jsx(Or,{})}),x(!1),u()}catch(z){$e.error(z instanceof Error?z.message:e("common.error"),{icon:n.jsx(Fr,{})})}}),O=A=>`w-full px-3 py-2 text-sm border rounded-lg ${A?"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-purple-400":"border-transparent bg-gray-50 dark:bg-gray-800 text-gray-800 dark:text-gray-200 cursor-default"}`,E=a||m;return i?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-purple-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-6",children:[n.jsx("button",{onClick:()=>r("/projects"),className:"text-gray-500 hover:text-indigo-600 dark:text-gray-400",children:e("projects.moduleTitle")}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsx("button",{onClick:()=>r("/projects/templates"),className:"text-gray-500 hover:text-purple-600 dark:text-gray-400",children:e("projects.projectTemplateDoctype")}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:a?e("projects.newProjectTemplate"):t})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 dark:border-gray-700 flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>r("/projects/templates"),className:"text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",children:n.jsx(da,{})}),n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:a?e("projects.newProjectTemplate"):v.name||t})]}),n.jsxs("div",{className:"flex gap-2",children:[!a&&!m&&n.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-2 px-4 py-2 border border-purple-500 text-purple-600 dark:text-purple-400 rounded-lg hover:bg-purple-50 dark:hover:bg-purple-900/20 text-sm",children:[n.jsx(ha,{})," ",e("common.edit")]}),E&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:N,disabled:p,className:"flex items-center gap-2 px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 disabled:opacity-50 text-sm",children:[p?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),e(p?"common.saving":"common.save")]}),!a&&n.jsx("button",{onClick:()=>x(!1),className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-sm",children:n.jsx(yt,{})})]})]})]}),l&&!a&&n.jsx("div",{className:"mx-6 mt-4 p-3 bg-red-50 dark:bg-red-900/20 rounded text-red-700 dark:text-red-300 text-sm",children:l}),n.jsxs("div",{className:"p-6 grid grid-cols-1 sm:grid-cols-2 gap-4 border-b border-gray-100 dark:border-gray-700",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Name *"}),n.jsx("input",{type:"text",value:v.name||"",onChange:A=>w("name",A.target.value),disabled:!a,className:O(a),placeholder:"Template name..."}),!a&&n.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Name cannot be changed after creation"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wide mb-1",children:"Project Type"}),E?n.jsx(Be,{label:"Project Type",hideLabel:!0,value:v.project_type||"",onChange:A=>w("project_type",A),doctype:"Project Type",placeholder:"Select project type..."}):n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200",children:v.project_type||"-"})]})]}),n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide",children:"Tasks"}),E&&n.jsxs("button",{onClick:j,className:"flex items-center gap-1.5 px-3 py-1.5 bg-purple-600 text-white text-xs rounded-lg hover:bg-purple-700",children:[n.jsx(Pt,{})," Add Row"]})]}),n.jsxs("div",{className:"flex items-start gap-2 mb-3 p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-800 text-xs text-blue-700 dark:text-blue-300",children:[n.jsx(a_,{className:"mt-0.5 flex-shrink-0"}),n.jsxs("span",{children:["Each row links to a ",n.jsx("strong",{children:"Task"})," that has ",n.jsx("strong",{children:"Is Template = Yes"}),". To create a new template task, first go to"," ",n.jsx("button",{onClick:()=>r("/projects/tasks/new"),className:"underline hover:text-blue-900 dark:hover:text-blue-100",children:"Tasks → New Task"})," ",'and check "Is Template", then come back and select it here.']})]}),(v.tasks||[]).length===0?n.jsx("div",{className:"py-8 text-center text-gray-400 dark:text-gray-500 text-sm bg-gray-50 dark:bg-gray-900/30 rounded-lg border border-dashed border-gray-300 dark:border-gray-600",children:E?'Click "Add Row" to link template tasks':"No tasks defined"}):n.jsx("div",{className:"overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-700",children:n.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700 text-sm",children:[n.jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/50",children:n.jsxs("tr",{children:[n.jsx("th",{className:"px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase w-10",children:"No."}),n.jsxs("th",{className:"px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase min-w-[280px]",children:["Task * ",n.jsx("span",{className:"font-normal normal-case text-gray-400",children:"(is_template=Yes)"})]}),n.jsx("th",{className:"px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase",children:"Subject"}),n.jsx("th",{className:"px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase w-28",children:"Duration (days)"}),E&&n.jsx("th",{className:"px-3 py-2 w-10"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:(v.tasks||[]).map((A,T)=>{var P,D;return n.jsxs("tr",{children:[n.jsx("td",{className:"px-3 py-2 text-gray-500 text-xs font-medium",children:T+1}),n.jsx("td",{className:"px-2 py-1.5 min-w-[280px]",children:E?n.jsx(Be,{label:"Task",hideLabel:!0,value:A.task||"",onChange:z=>k(T,"task",z),doctype:"Task",placeholder:"Search template task...",compact:!0}):n.jsx("span",{className:"text-gray-800 dark:text-gray-200 font-medium",children:A.task||"-"})}),n.jsx("td",{className:"px-3 py-2",children:n.jsx("span",{className:"text-gray-600 dark:text-gray-400 text-xs italic",children:A.subject||"(from task)"})}),n.jsx("td",{className:"px-2 py-1.5",children:E?n.jsx("input",{type:"number",min:0,value:(P=A.duration)!=null?P:"",onChange:z=>k(T,"duration",z.target.value?parseInt(z.target.value):void 0),placeholder:"0",className:"w-full px-2 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-1 focus:ring-purple-400"}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300 text-sm",children:(D=A.duration)!=null?D:"-"})}),E&&n.jsx("td",{className:"px-3 py-2",children:n.jsx("button",{onClick:()=>C(T),className:"text-red-500 hover:text-red-700 p-1 rounded hover:bg-red-50 dark:hover:bg-red-900/20",children:n.jsx(Za,{size:12})})})]},T)})})]})}),!a&&s&&n.jsxs("div",{className:"mt-6 pt-4 border-t border-gray-100 dark:border-gray-700 grid grid-cols-2 gap-3 text-xs text-gray-500 dark:text-gray-400",children:[n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block",children:"Created"}),s.creation?new Date(s.creation).toLocaleString():"-"]}),n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block",children:"Modified"}),s.modified?new Date(s.modified).toLocaleString():"-"]})]}),!a&&n.jsx("div",{className:"mt-4",children:n.jsx(Yn,{doctype:"Project Template",docname:(s==null?void 0:s.name)||t||"",creationDate:s==null?void 0:s.creation,createdBy:s==null?void 0:s.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})})]})]})]})},kve=e=>e?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300":"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300",Sve=()=>{const{t:e}=sr(),t=Ut(),[r,a]=y.useState([]),[s,i]=y.useState(!0),[l,u]=y.useState(""),[d,f]=y.useState(0),[p,m]=y.useState(0),[x,v]=y.useState(!1),b=20,w=y.useMemo(()=>{const D={};return l.trim()&&(D.customer_name=["like",`%${l.trim()}%`]),D},[l]),j=y.useCallback((D=0)=>fe(null,null,function*(){i(!0);try{const[{data:z},G]=yield Promise.all([qs.getCustomers({limit_start:D*b,limit_page_length:b,filters:w}),qs.getCustomerCount(w)]);a(z),m(G),f(D)}catch(z){$e.error(z instanceof Error?z.message:"Failed to load customers")}finally{i(!1)}}),[w]);y.useEffect(()=>{j(0)},[j]);const k=y.useMemo(()=>`${d}|${JSON.stringify(w)}`,[d,w]),{selectedRows:C,toggleRow:N,toggleAllOnPage:O,allOnPageSelected:E,someOnPageSelected:A}=Vn(r,k),T=y.useCallback(()=>Kn({doctype:"Customer",filters:w,orderBy:"modified desc"}),[w]),P=D=>{u(D.target.value)};return n.jsxs("div",{className:"p-6",children:[n.jsx(Br,{position:"top-right",autoClose:3e3}),n.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[n.jsx("button",{onClick:()=>t("/projects"),className:"text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",children:n.jsx(da,{})}),n.jsx("div",{className:"w-10 h-10 rounded-xl bg-cyan-600 flex items-center justify-center",children:n.jsx(Dg,{className:"text-white text-lg"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Customers"}),n.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[p," total"]})]}),n.jsxs("div",{className:"ml-auto flex flex-wrap gap-2 items-center",children:[n.jsxs("button",{type:"button",onClick:()=>v(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:p===0&&C.size===0||s,children:[n.jsx(hn,{})," ",e("listPages.export"),C.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:C.size})]}),n.jsxs("div",{className:"relative",children:[n.jsx(fn,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-xs"}),n.jsx("input",{value:l,onChange:P,placeholder:"Search customers…",className:"pl-8 pr-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white w-52 focus:outline-none focus:ring-2 focus:ring-cyan-400"})]}),n.jsxs("button",{onClick:()=>t("/customers/new"),className:"flex items-center gap-2 px-4 py-2 bg-cyan-600 text-white rounded-lg hover:bg-cyan-700 text-sm font-medium",children:[n.jsx(Pt,{size:11})," New Customer"]})]})]}),n.jsx(Gn,{isOpen:x,onClose:()=>v(!1),doctype:"Customer",selectedCount:C.size,pageCount:r.length,totalCount:p,pageData:r,selectedRows:C,rowKey:"name",onFetchAll:T,fileNamePrefix:"customers"}),n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:s?n.jsx("div",{className:"flex justify-center items-center py-16",children:n.jsx(vt,{className:"animate-spin text-cyan-500 text-2xl"})}):r.length===0?n.jsxs("div",{className:"py-16 text-center text-gray-400 dark:text-gray-500",children:[n.jsx(Dg,{className:"mx-auto text-4xl mb-3 opacity-30"}),n.jsx("p",{className:"text-sm",children:"No customers found"}),n.jsx("button",{onClick:()=>t("/customers/new"),className:"mt-3 text-sm text-cyan-600 hover:underline",children:"+ Create first customer"})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-[2.5rem_1fr_1fr_1fr_1fr_100px] bg-gray-50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-700 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide",children:[n.jsx("div",{className:"px-2 py-3 flex items-center justify-center",children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-cyan-600 focus:ring-cyan-500",checked:E,ref:D=>{D&&(D.indeterminate=A)},onChange:O,"aria-label":"Select all on page"})}),n.jsx("div",{className:"px-4 py-3",children:"Customer Name"}),n.jsx("div",{className:"px-4 py-3",children:"Type"}),n.jsx("div",{className:"px-4 py-3",children:"Customer Group"}),n.jsx("div",{className:"px-4 py-3",children:"Territory"}),n.jsx("div",{className:"px-4 py-3",children:"Status"})]}),n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:r.map(D=>n.jsxs("div",{role:"button",tabIndex:0,onClick:()=>t(`/customers/${encodeURIComponent(D.name)}`),onKeyDown:z=>{(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),t(`/customers/${encodeURIComponent(D.name)}`))},className:`grid grid-cols-[2.5rem_1fr_1fr_1fr_1fr_100px] w-full text-left hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors cursor-pointer ${C.has(D.name)?"bg-cyan-50/70 dark:bg-cyan-900/15":""}`,children:[n.jsx("div",{className:"px-2 py-3 flex items-center justify-center",onClick:z=>z.stopPropagation(),children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-cyan-600 focus:ring-cyan-500",checked:C.has(D.name),onChange:()=>N(D.name),"aria-label":`Select ${D.name}`})}),n.jsxs("div",{className:"px-4 py-3",children:[n.jsx("p",{className:"text-sm font-medium text-indigo-600 dark:text-indigo-400",children:D.customer_name||D.name}),n.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:D.name})]}),n.jsx("div",{className:"px-4 py-3 text-sm text-gray-700 dark:text-gray-300",children:D.customer_type||"-"}),n.jsx("div",{className:"px-4 py-3 text-sm text-gray-700 dark:text-gray-300",children:D.customer_group||"-"}),n.jsx("div",{className:"px-4 py-3 text-sm text-gray-700 dark:text-gray-300",children:D.territory||"-"}),n.jsx("div",{className:"px-4 py-3",children:n.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${kve(D.disabled)}`,children:D.disabled?"Disabled":"Active"})})]},D.name))}),n.jsxs("div",{className:"px-4 py-3 border-t border-gray-100 dark:border-gray-700 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[n.jsxs("span",{children:["Page ",d+1]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>j(d-1),disabled:d===0,className:"px-3 py-1 border border-gray-300 dark:border-gray-600 rounded disabled:opacity-40 hover:bg-gray-50 dark:hover:bg-gray-700",children:"Prev"}),n.jsx("button",{onClick:()=>j(d+1),disabled:r.length<b,className:"px-3 py-1 border border-gray-300 dark:border-gray-600 rounded disabled:opacity-40 hover:bg-gray-50 dark:hover:bg-gray-700",children:"Next"})]})]})]})})]})},bd=({children:e,required:t})=>n.jsxs("label",{className:"block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),wd=({children:e})=>n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800/60 rounded-lg min-h-[38px] flex items-center",children:e||n.jsx("span",{className:"text-gray-400",children:"-"})}),ww="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-cyan-400",Nve=({title:e,children:t,defaultOpen:r=!0})=>{const[a,s]=y.useState(r);return n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"w-full flex items-center justify-between px-6 py-3 hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors",children:[n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:e}),a?n.jsx(nr,{className:"text-gray-400 text-xs"}):n.jsx(bs,{className:"text-gray-400 text-xs"})]}),a&&n.jsx("div",{className:"px-6 pb-5",children:t})]})},Cve=["Company","Individual","Hospital"],Tve=()=>{var E,A;const{customerName:e}=Hn(),t=Ut(),r=e==="new",[a,s]=y.useState(null),[i,l]=y.useState(!r),[u,d]=y.useState(!1),[f,p]=y.useState(r),[m,x]=y.useState(""),v={customer_name:"",customer_type:"Company",customer_group:"All Customer Groups",territory:"All Territories",language:"en",is_internal_customer:0,default_commission_rate:0,so_required:0,dn_required:0,is_frozen:0,disabled:0},[b,w]=y.useState(v),j=y.useCallback(T=>{var P,D,z,G,V,ne;w({customer_name:T.customer_name||"",customer_type:T.customer_type||"Company",customer_group:T.customer_group||"",territory:T.territory||"",language:T.language||"en",is_internal_customer:(P=T.is_internal_customer)!=null?P:0,default_commission_rate:(D=T.default_commission_rate)!=null?D:0,so_required:(z=T.so_required)!=null?z:0,dn_required:(G=T.dn_required)!=null?G:0,is_frozen:(V=T.is_frozen)!=null?V:0,disabled:(ne=T.disabled)!=null?ne:0})},[]);y.useEffect(()=>{!r&&e&&(l(!0),qs.getCustomer(e).then(T=>{s(T),j(T)}).catch(T=>x(T.message)).finally(()=>l(!1)))},[e,r,j]);const k=(T,P)=>w(D=>Se(ee({},D),{[T]:P})),C=()=>fe(null,null,function*(){var T;if(!((T=b.customer_name)!=null&&T.trim())){$e.error("Customer Name is required");return}d(!0);try{if(r){const P=yield qs.createCustomer(b);$e.success("Customer created",{icon:n.jsx(Or,{})}),t(`/customers/${encodeURIComponent(P.name)}`)}else{const P=yield qs.updateCustomer(e,b);$e.success("Customer updated",{icon:n.jsx(Or,{})}),s(P),j(P),p(!1)}}catch(P){$e.error(P instanceof Error?P.message:"Save failed",{icon:n.jsx(Fr,{})})}finally{d(!1)}}),N=()=>{a&&j(a),p(!1)},O=r||f;return i?n.jsx("div",{className:"flex justify-center items-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-cyan-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-6 text-gray-500 dark:text-gray-400",children:[n.jsx("button",{onClick:()=>t("/projects"),className:"hover:text-cyan-600",children:"Project Management"}),n.jsx("span",{children:"/"}),n.jsx("button",{onClick:()=>t("/customers"),className:"hover:text-cyan-600",children:"Customers"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:r?"New Customer":e})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 dark:border-gray-700 flex items-center justify-between gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>t("/customers"),className:"text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",children:n.jsx(da,{})}),n.jsx("div",{className:"w-10 h-10 rounded-xl bg-cyan-600 flex items-center justify-center flex-shrink-0",children:n.jsx(Dg,{className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r?"New Customer":(a==null?void 0:a.customer_name)||e}),!r&&a&&n.jsx("span",{className:`text-xs px-2 py-0.5 rounded font-medium ${a.disabled?"bg-red-100 text-red-700":"bg-green-100 text-green-700"}`,children:a.disabled?"Disabled":"Active"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[!r&&!f&&n.jsxs("button",{onClick:()=>p(!0),className:"flex items-center gap-2 px-4 py-2 bg-cyan-600 text-white rounded-lg hover:bg-cyan-700 text-sm",children:[n.jsx(ha,{})," Edit"]}),O&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:C,disabled:u,className:"flex items-center gap-2 px-4 py-2 bg-cyan-600 text-white rounded-lg hover:bg-cyan-700 disabled:opacity-50 text-sm font-medium",children:[u?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),u?"Saving…":"Save"]}),!r&&n.jsx("button",{onClick:N,className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-600 dark:text-gray-400 text-sm",children:n.jsx(yt,{})})]})]})]}),m&&n.jsx("div",{className:"mx-6 mt-4 p-3 bg-red-50 dark:bg-red-900/20 rounded text-red-700 dark:text-red-300 text-sm",children:m}),n.jsxs("div",{className:"p-6 grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4 border-b border-gray-100 dark:border-gray-700",children:[n.jsxs("div",{className:"sm:col-span-2",children:[n.jsx(bd,{required:!0,children:"Customer Name"}),O?n.jsx("input",{value:b.customer_name||"",onChange:T=>k("customer_name",T.target.value),className:ww,placeholder:"Enter customer name"}):n.jsx(wd,{children:b.customer_name})]}),n.jsxs("div",{children:[n.jsx(bd,{children:"Customer Type"}),O?n.jsx("select",{value:b.customer_type||"Company",onChange:T=>k("customer_type",T.target.value),className:ww,children:Cve.map(T=>n.jsx("option",{children:T},T))}):n.jsx(wd,{children:b.customer_type})]}),n.jsxs("div",{children:[n.jsx(bd,{children:"Territory"}),O?n.jsx(Be,{label:"Territory",hideLabel:!0,doctype:"Territory",value:b.territory||"",onChange:T=>k("territory",T),placeholder:"Select territory…"}):n.jsx(wd,{children:b.territory})]}),n.jsxs("div",{children:[n.jsx(bd,{children:"Customer Group"}),O?n.jsx(Be,{label:"Customer Group",hideLabel:!0,doctype:"Customer Group",value:b.customer_group||"",onChange:T=>k("customer_group",T),placeholder:"Select group…"}):n.jsx(wd,{children:b.customer_group})]}),n.jsxs("div",{children:[n.jsx(bd,{children:"Language"}),O?n.jsx(Be,{label:"Language",hideLabel:!0,doctype:"Language",value:b.language||"",onChange:T=>k("language",T),placeholder:"Select language…"}):n.jsx(wd,{children:b.language})]})]}),n.jsx(Nve,{title:"Settings",defaultOpen:!1,children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(bd,{children:"Default Commission Rate (%)"}),O?n.jsx("input",{type:"number",min:0,max:100,step:.01,value:(E=b.default_commission_rate)!=null?E:0,onChange:T=>k("default_commission_rate",parseFloat(T.target.value)||0),className:ww}):n.jsx(wd,{children:(A=b.default_commission_rate)!=null?A:0})]}),[{field:"is_internal_customer",label:"Is Internal Customer"},{field:"so_required",label:"Sales Order Required"},{field:"dn_required",label:"Delivery Note Required"},{field:"is_frozen",label:"Is Frozen"},{field:"disabled",label:"Disabled"}].map(({field:T,label:P})=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"checkbox",id:T,checked:!!b[T],onChange:D=>k(T,D.target.checked?1:0),disabled:!O,className:"w-4 h-4 text-cyan-600 rounded"}),n.jsx("label",{htmlFor:T,className:"text-sm text-gray-700 dark:text-gray-300",children:P})]},T))]})}),!r&&a&&n.jsxs("div",{className:"px-6 py-4 border-t border-gray-100 dark:border-gray-700 grid grid-cols-2 sm:grid-cols-3 gap-3 text-xs text-gray-400 dark:text-gray-500",children:[n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block text-gray-500 dark:text-gray-400",children:"Created By"}),a.owner]}),n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block text-gray-500 dark:text-gray-400",children:"Created"}),a.creation?new Date(a.creation).toLocaleString():"-"]}),n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block text-gray-500 dark:text-gray-400",children:"Modified"}),a.modified?new Date(a.modified).toLocaleString():"-"]})]}),!r&&n.jsx("div",{className:"px-6 pb-6",children:n.jsx(Yn,{doctype:"Customer",docname:(a==null?void 0:a.name)||e||"",creationDate:a==null?void 0:a.creation,createdBy:a==null?void 0:a.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})})]})]})},jw=20,Eve=e=>{const t=(e||"").toLowerCase();return t==="active"?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300":t==="inactive"||t==="left"?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300":"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300"},Ave=()=>{const{t:e}=sr(),t=Ut(),[r,a]=y.useState([]),[s,i]=y.useState(!0),[l,u]=y.useState(""),[d,f]=y.useState(0),[p,m]=y.useState(0),[x,v]=y.useState(!1),b=y.useMemo(()=>{const P={};return l.trim()&&(P.employee_name=["like",`%${l.trim()}%`]),P},[l]),w=y.useCallback((P=0)=>fe(null,null,function*(){i(!0);try{const[{data:D},z]=yield Promise.all([qs.getEmployees({limit_start:P*jw,limit_page_length:jw,filters:b}),qs.getEmployeeCount(b)]);a(D),m(z),f(P)}catch(D){$e.error(D instanceof Error?D.message:"Failed to load employees")}finally{i(!1)}}),[b]);y.useEffect(()=>{w(0)},[w]);const j=y.useMemo(()=>`${d}|${JSON.stringify(b)}`,[d,b]),{selectedRows:k,toggleRow:C,toggleAllOnPage:N,allOnPageSelected:O,someOnPageSelected:E}=Vn(r,j),A=y.useCallback(()=>Kn({doctype:"Employee",filters:b,orderBy:"modified desc"}),[b]),T=P=>{u(P.target.value)};return n.jsxs("div",{className:"p-6",children:[n.jsx(Br,{position:"top-right",autoClose:3e3}),n.jsxs("div",{className:"flex items-center gap-3 mb-6 flex-wrap",children:[n.jsx("button",{type:"button",onClick:()=>t("/projects"),className:"text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",children:n.jsx(da,{})}),n.jsx("div",{className:"w-10 h-10 rounded-xl bg-teal-600 flex items-center justify-center",children:n.jsx(Mw,{className:"text-white text-lg"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Employees"}),n.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[p," total"]})]}),n.jsxs("div",{className:"ml-auto flex flex-wrap gap-2 items-center",children:[n.jsxs("button",{type:"button",onClick:()=>v(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:p===0&&k.size===0||s,children:[n.jsx(hn,{})," ",e("listPages.export"),k.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:k.size})]}),n.jsxs("div",{className:"relative",children:[n.jsx(fn,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-xs"}),n.jsx("input",{value:l,onChange:T,placeholder:"Search employees…",className:"pl-8 pr-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white w-52 focus:outline-none focus:ring-2 focus:ring-teal-400"})]}),n.jsxs("button",{type:"button",onClick:()=>t("/employees/new"),className:"flex items-center gap-2 px-4 py-2 bg-teal-600 text-white rounded-lg hover:bg-teal-700 text-sm font-medium",children:[n.jsx(Pt,{size:11})," New Employee"]})]})]}),n.jsx(Gn,{isOpen:x,onClose:()=>v(!1),doctype:"Employee",selectedCount:k.size,pageCount:r.length,totalCount:p,pageData:r,selectedRows:k,rowKey:"name",onFetchAll:A,fileNamePrefix:"employees"}),n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:s?n.jsx("div",{className:"flex justify-center items-center py-16",children:n.jsx(vt,{className:"animate-spin text-teal-500 text-2xl"})}):r.length===0?n.jsxs("div",{className:"py-16 text-center text-gray-400 dark:text-gray-500",children:[n.jsx(Mw,{className:"mx-auto text-4xl mb-3 opacity-30"}),n.jsx("p",{className:"text-sm",children:"No employees found"}),n.jsx("button",{type:"button",onClick:()=>t("/employees/new"),className:"mt-3 text-sm text-teal-600 hover:underline",children:"+ Create first employee"})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-[2.5rem_1fr_1fr_1fr_1fr_120px] bg-gray-50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-700 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide",children:[n.jsx("div",{className:"px-2 py-3 flex items-center justify-center",children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-teal-600 focus:ring-teal-500",checked:O,ref:P=>{P&&(P.indeterminate=E)},onChange:N,"aria-label":"Select all on page"})}),n.jsx("div",{className:"px-4 py-3",children:"Name"}),n.jsx("div",{className:"px-4 py-3",children:"ID"}),n.jsx("div",{className:"px-4 py-3",children:"Department"}),n.jsx("div",{className:"px-4 py-3",children:"Company"}),n.jsx("div",{className:"px-4 py-3",children:"Status"})]}),n.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:r.map(P=>n.jsxs("div",{role:"button",tabIndex:0,onClick:()=>t(`/employees/${encodeURIComponent(P.name)}`),onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),t(`/employees/${encodeURIComponent(P.name)}`))},className:`grid grid-cols-[2.5rem_1fr_1fr_1fr_1fr_120px] w-full text-left hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors cursor-pointer ${k.has(P.name)?"bg-teal-50/80 dark:bg-teal-900/20":""}`,children:[n.jsx("div",{className:"px-2 py-3 flex items-center justify-center",onClick:D=>D.stopPropagation(),children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-teal-600 focus:ring-teal-500",checked:k.has(P.name),onChange:()=>C(P.name),"aria-label":`Select ${P.name}`})}),n.jsx("div",{className:"px-4 py-3",children:n.jsx("p",{className:"text-sm font-medium text-teal-600 dark:text-teal-400",children:P.employee_name||P.name})}),n.jsx("div",{className:"px-4 py-3 text-sm text-gray-700 dark:text-gray-300",children:P.name}),n.jsx("div",{className:"px-4 py-3 text-sm text-gray-700 dark:text-gray-300",children:P.department||"—"}),n.jsx("div",{className:"px-4 py-3 text-sm text-gray-700 dark:text-gray-300",children:P.company||"—"}),n.jsx("div",{className:"px-4 py-3",children:n.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${Eve(P.status)}`,children:P.status||"—"})})]},P.name))}),n.jsxs("div",{className:"px-4 py-3 border-t border-gray-100 dark:border-gray-700 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[n.jsxs("span",{children:["Page ",d+1," · Showing ",r.length," of ",p]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",onClick:()=>w(d-1),disabled:d===0,className:"px-3 py-1 border border-gray-300 dark:border-gray-600 rounded disabled:opacity-40 hover:bg-gray-50 dark:hover:bg-gray-700",children:"Prev"}),n.jsx("button",{type:"button",onClick:()=>w(d+1),disabled:(d+1)*jw>=p,className:"px-3 py-1 border border-gray-300 dark:border-gray-600 rounded disabled:opacity-40 hover:bg-gray-50 dark:hover:bg-gray-700",children:"Next"})]})]})]})})]})},as=({children:e,required:t})=>n.jsxs("label",{className:"block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),ns=({children:e})=>n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800/60 rounded-lg min-h-[38px] flex items-center",children:e||n.jsx("span",{className:"text-gray-400",children:"-"})}),yo="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-teal-400",Ove=({title:e,children:t,defaultOpen:r=!0})=>{const[a,s]=y.useState(r);return n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"w-full flex items-center justify-between px-6 py-3 hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors",children:[n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:e}),a?n.jsx(nr,{className:"text-gray-400 text-xs"}):n.jsx(bs,{className:"text-gray-400 text-xs"})]}),a&&n.jsx("div",{className:"px-6 pb-5",children:t})]})},uO=e=>{switch(e){case"Active":return"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300";case"Inactive":return"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400";case"Left":return"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-300";case"On Leave":return"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300";default:return"bg-gray-100 text-gray-600"}},Pve=()=>{const{employeeName:e}=Hn(),t=Ut(),r=e==="new",[a,s]=y.useState(null),[i,l]=y.useState(!r),[u,d]=y.useState(!1),[f,p]=y.useState(r),[m,x]=y.useState(""),v={first_name:"",middle_name:"",last_name:"",salutation:"",gender:"",date_of_birth:"",date_of_joining:"",status:"Active",company:"",designation:"",branch:"",department:"",reports_to:"",employee_number:""},[b,w]=y.useState(v),j=y.useCallback(A=>{w({first_name:A.first_name||"",middle_name:A.middle_name||"",last_name:A.last_name||"",salutation:A.salutation||"",gender:A.gender||"",date_of_birth:A.date_of_birth||"",date_of_joining:A.date_of_joining||"",status:A.status||"Active",company:A.company||"",designation:A.designation||"",branch:A.branch||"",department:A.department||"",reports_to:A.reports_to||"",employee_number:A.employee_number||""})},[]);y.useEffect(()=>{!r&&e&&(l(!0),qs.getEmployee(e).then(A=>{s(A),j(A)}).catch(A=>x(A.message)).finally(()=>l(!1)))},[e,r,j]);const k=(A,T)=>w(P=>Se(ee({},P),{[A]:T})),C=()=>fe(null,null,function*(){var A;if(!((A=b.first_name)!=null&&A.trim())){$e.error("First Name is required");return}if(!b.gender){$e.error("Gender is required");return}if(!b.date_of_birth){$e.error("Date of Birth is required");return}if(!b.date_of_joining){$e.error("Date of Joining is required");return}d(!0);try{if(r){const T=yield qs.createEmployee(b);$e.success("Employee created",{icon:n.jsx(Or,{})}),t(`/employees/${encodeURIComponent(T.name)}`)}else{const T=yield qs.updateEmployee(e,b);$e.success("Employee updated",{icon:n.jsx(Or,{})}),s(T),j(T),p(!1)}}catch(T){$e.error(T instanceof Error?T.message:"Save failed",{icon:n.jsx(Fr,{})})}finally{d(!1)}}),N=()=>{a&&j(a),p(!1)},O=r||f,E=(a==null?void 0:a.employee_name)||[a==null?void 0:a.first_name,a==null?void 0:a.last_name].filter(Boolean).join(" ")||e;return i?n.jsx("div",{className:"flex justify-center items-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-teal-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-6 text-gray-500 dark:text-gray-400",children:[n.jsx("button",{onClick:()=>t("/projects"),className:"hover:text-teal-600",children:"Project Management"}),n.jsx("span",{children:"/"}),n.jsx("button",{onClick:()=>t("/employees"),className:"hover:text-teal-600",children:"Employees"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:r?"New Employee":E})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 dark:border-gray-700 flex items-center justify-between gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>t("/employees"),className:"text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",children:n.jsx(da,{})}),n.jsx("div",{className:"w-10 h-10 rounded-xl bg-teal-600 flex items-center justify-center flex-shrink-0",children:n.jsx(Mw,{className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:r?"New Employee":E}),!r&&a&&n.jsx("span",{className:`text-xs px-2 py-0.5 rounded font-medium ${uO(a.status)}`,children:a.status||"Active"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[!r&&!f&&n.jsxs("button",{onClick:()=>p(!0),className:"flex items-center gap-2 px-4 py-2 bg-teal-600 text-white rounded-lg hover:bg-teal-700 text-sm",children:[n.jsx(ha,{})," Edit"]}),O&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:C,disabled:u,className:"flex items-center gap-2 px-4 py-2 bg-teal-600 text-white rounded-lg hover:bg-teal-700 disabled:opacity-50 text-sm font-medium",children:[u?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),u?"Saving…":"Save"]}),!r&&n.jsx("button",{onClick:N,className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-600 dark:text-gray-400 text-sm",children:n.jsx(yt,{})})]})]})]}),m&&n.jsx("div",{className:"mx-6 mt-4 p-3 bg-red-50 dark:bg-red-900/20 rounded text-red-700 dark:text-red-300 text-sm",children:m}),n.jsxs("div",{className:"p-6 grid grid-cols-1 sm:grid-cols-3 gap-x-6 gap-y-4 border-b border-gray-100 dark:border-gray-700",children:[n.jsxs("div",{children:[n.jsx(as,{children:"Series"}),n.jsx(ns,{children:"HR-EMP-"})]}),n.jsxs("div",{children:[n.jsx(as,{required:!0,children:"Gender"}),O?n.jsxs("select",{value:b.gender||"",onChange:A=>k("gender",A.target.value),className:yo,children:[n.jsx("option",{value:"",children:"Select gender"}),n.jsx("option",{children:"Male"}),n.jsx("option",{children:"Female"}),n.jsx("option",{children:"Other"}),n.jsx("option",{children:"Prefer not to say"})]}):n.jsx(ns,{children:b.gender})]}),n.jsxs("div",{children:[n.jsx(as,{required:!0,children:"Date of Joining"}),O?n.jsx("input",{type:"date",value:b.date_of_joining||"",onChange:A=>k("date_of_joining",A.target.value),className:yo}):n.jsx(ns,{children:b.date_of_joining})]}),n.jsxs("div",{children:[n.jsx(as,{required:!0,children:"First Name"}),O?n.jsx("input",{value:b.first_name||"",onChange:A=>k("first_name",A.target.value),className:yo,placeholder:"First name"}):n.jsx(ns,{children:b.first_name})]}),n.jsxs("div",{children:[n.jsx(as,{required:!0,children:"Date of Birth"}),O?n.jsx("input",{type:"date",value:b.date_of_birth||"",onChange:A=>k("date_of_birth",A.target.value),className:yo}):n.jsx(ns,{children:b.date_of_birth})]}),n.jsxs("div",{children:[n.jsx(as,{children:"Status"}),O?n.jsxs("select",{value:b.status||"Active",onChange:A=>k("status",A.target.value),className:yo,children:[n.jsx("option",{children:"Active"}),n.jsx("option",{children:"Inactive"}),n.jsx("option",{children:"Left"}),n.jsx("option",{children:"On Leave"})]}):n.jsx(ns,{children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${uO(b.status)}`,children:b.status||"Active"})})]}),n.jsxs("div",{children:[n.jsx(as,{children:"Middle Name"}),O?n.jsx("input",{value:b.middle_name||"",onChange:A=>k("middle_name",A.target.value),className:yo,placeholder:"Middle name"}):n.jsx(ns,{children:b.middle_name})]}),n.jsxs("div",{children:[n.jsx(as,{children:"Salutation"}),O?n.jsxs("select",{value:b.salutation||"",onChange:A=>k("salutation",A.target.value),className:yo,children:[n.jsx("option",{value:"",children:"Select"}),n.jsx("option",{children:"Mr."}),n.jsx("option",{children:"Ms."}),n.jsx("option",{children:"Mrs."}),n.jsx("option",{children:"Dr."}),n.jsx("option",{children:"Prof."})]}):n.jsx(ns,{children:b.salutation})]}),n.jsxs("div",{children:[n.jsx(as,{children:"Last Name"}),O?n.jsx("input",{value:b.last_name||"",onChange:A=>k("last_name",A.target.value),className:yo,placeholder:"Last name"}):n.jsx(ns,{children:b.last_name})]})]}),n.jsx(Ove,{title:"Company Details",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-6 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(as,{required:!0,children:"Hospital"}),O?n.jsx(Be,{label:"Hospital",hideLabel:!0,doctype:"Company",value:b.company||"",onChange:A=>k("company",A),placeholder:"Select hospital…"}):n.jsx(ns,{children:b.company})]}),n.jsxs("div",{children:[n.jsx(as,{children:"Designation"}),O?n.jsx(Be,{label:"Designation",hideLabel:!0,doctype:"Designation",value:b.designation||"",onChange:A=>k("designation",A),placeholder:"Select designation…"}):n.jsx(ns,{children:b.designation})]}),n.jsxs("div",{children:[n.jsx(as,{children:"Department"}),O?n.jsx(Be,{label:"Department",hideLabel:!0,doctype:"Department",value:b.department||"",onChange:A=>k("department",A),placeholder:"Select department…"}):n.jsx(ns,{children:b.department})]}),n.jsxs("div",{children:[n.jsx(as,{children:"Employee Number"}),O?n.jsx("input",{value:b.employee_number||"",onChange:A=>k("employee_number",A.target.value),className:yo,placeholder:"e.g. EMP-001"}):n.jsx(ns,{children:b.employee_number})]})]})}),!r&&a&&n.jsxs("div",{className:"px-6 py-4 border-t border-gray-100 dark:border-gray-700 grid grid-cols-2 sm:grid-cols-3 gap-3 text-xs text-gray-400 dark:text-gray-500",children:[n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block text-gray-500 dark:text-gray-400",children:"Created By"}),a.owner]}),n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block text-gray-500 dark:text-gray-400",children:"Created"}),a.creation?new Date(a.creation).toLocaleString():"-"]}),n.jsxs("div",{children:[n.jsx("span",{className:"font-medium block text-gray-500 dark:text-gray-400",children:"Modified"}),a.modified?new Date(a.modified).toLocaleString():"-"]})]}),!r&&n.jsx("div",{className:"px-6 pb-6",children:n.jsx(Yn,{doctype:"Employee",docname:(a==null?void 0:a.name)||e||"",creationDate:a==null?void 0:a.creation,createdBy:a==null?void 0:a.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})})]})]})},Dve=(e,t)=>t===2?"bg-red-100 text-red-700":t===1||e==="Paid"?"bg-green-100 text-green-800":e==="Overdue"?"bg-orange-100 text-orange-800":"bg-yellow-100 text-yellow-800",fg=20,Rve=()=>{const{t:e}=sr(),t=Ut(),[r,a]=dn(),s=y.useRef(a);y.useEffect(()=>{s.current=a},[a]);const i=y.useMemo(()=>{const ie=parseInt(r.get("page")||"1",10);return Number.isNaN(ie)||ie<1?1:ie},[r]),l=y.useCallback(ie=>{const se=typeof ie=="function"?ie(i):ie;a(he=>{const _e=new URLSearchParams(he);return _e.set("page",String(se)),_e})},[i,a]),[u,d]=y.useState(!1),[f,p]=y.useState(r.get("status")||""),[m,x]=y.useState(r.get("q")||""),[v,b]=y.useState(r.get("sort_by")||"creation desc"),[w,j]=y.useState([]),[k,C]=y.useState(0),[N,O]=y.useState(!0),[E,A]=y.useState(null),[T,P]=y.useState(!1),D=y.useRef(!1),z=y.useRef(!0),G=y.useRef(null),V=y.useRef(0),ne=y.useMemo(()=>{const ie={};return f&&(ie.status=f),m&&(ie.name=["like",`%${m}%`]),ie},[f,m]),ge=y.useCallback(()=>fe(null,null,function*(){const ie=++V.current;try{O(!0),A(null);const[se,he]=yield Promise.all([Ii.getSalesInvoices({filters:ne,limit_start:(i-1)*fg,limit_page_length:fg,order_by:v}),Ii.getSalesInvoiceCount(ne)]);if(ie!==V.current)return;j(se.data),C(he)}catch(se){if(ie!==V.current)return;A(se instanceof Error?se.message:"Failed to fetch invoices")}finally{ie===V.current&&O(!1)}}),[ne,i,v]);y.useEffect(()=>{ge()},[ge]);const Z=y.useMemo(()=>`${i}|${v}|${JSON.stringify(ne)}`,[i,v,ne]),{selectedRows:U,toggleRow:ce,toggleAllOnPage:xe,allOnPageSelected:be,someOnPageSelected:me}=Vn(w,Z),oe=y.useCallback(()=>Kn({doctype:"Sales Invoice",filters:ne,orderBy:v}),[ne,v]),L=Math.ceil(k/fg),H=()=>{p(""),x(""),b("creation desc"),a(ie=>{const se=new URLSearchParams(ie);return["status","q","sort_by"].forEach(he=>se.delete(he)),se.set("page","1"),se})};y.useEffect(()=>{if(!D.current){D.current=!0;return}s.current(ie=>{const se=new URLSearchParams(ie);return f?se.set("status",f):se.delete("status"),v!=="creation desc"?se.set("sort_by",v):se.delete("sort_by"),se.set("page","1"),se})},[f,v]),y.useEffect(()=>{if(D.current){if(z.current){z.current=!1;return}return G.current&&window.clearTimeout(G.current),G.current=window.setTimeout(()=>{s.current(ie=>{const se=new URLSearchParams(ie);return m?se.set("q",m):se.delete("q"),se.set("page","1"),se})},450),()=>{G.current&&window.clearTimeout(G.current)}}},[m]);const K=!!(f||m),Y=ie=>t(`/invoices/${encodeURIComponent(ie)}`),re=ie=>t(`/invoices/${encodeURIComponent(ie)}?edit=1`),de=ie=>t(`/invoices/new?duplicate=${encodeURIComponent(ie)}`);return n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>t("/projects"),className:"text-sm text-gray-500 hover:text-indigo-600",children:"Project Management"}),n.jsx("span",{className:"text-gray-400",children:"/"}),n.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(Kc,{className:"text-indigo-500"})," Sales Invoices"]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("button",{type:"button",onClick:()=>P(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all disabled:opacity-50",disabled:k===0&&U.size===0,children:[n.jsx(hn,{})," ",n.jsx("span",{className:"font-medium",children:e("listPages.export")}),U.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:U.size})]}),n.jsxs("button",{onClick:()=>t("/invoices/new"),className:"flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700",children:[n.jsx(Pt,{})," New Invoice"]})]})]}),n.jsx(Gn,{isOpen:T,onClose:()=>P(!1),doctype:"Sales Invoice",selectedCount:U.size,pageCount:w.length,totalCount:k,pageData:w,selectedRows:U,rowKey:"name",onFetchAll:oe,fileNamePrefix:"sales_invoices"}),n.jsxs("div",{className:"isolate bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 mb-6",children:[n.jsx("div",{className:"bg-gradient-to-r from-blue-500 to-blue-600 dark:from-blue-600 dark:to-blue-700 px-4 py-2.5 rounded-t-lg",children:n.jsxs("div",{className:"flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[n.jsx("button",{onClick:()=>d(ie=>!ie),className:"text-white hover:bg-white/20 p-1.5 rounded-lg",children:u?n.jsx(ps,{size:12}):n.jsx(nr,{size:12})}),n.jsx(Dh,{className:"text-white",size:13}),n.jsx("span",{className:"text-white font-semibold text-sm",children:"Filters"}),K&&n.jsx("span",{className:"bg-white text-blue-600 px-2 py-0.5 rounded-full text-xs font-bold",children:[f,m].filter(Boolean).length})]}),K&&n.jsx("div",{className:"flex-1 overflow-x-auto mx-2",children:n.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[m&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"ID:"})," ",m,n.jsx("button",{onClick:()=>x(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]}),f&&n.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-white/90 text-indigo-700 rounded-full text-[10px] font-medium whitespace-nowrap",children:[n.jsx("span",{className:"font-semibold",children:"Status:"})," ",f,n.jsx("button",{onClick:()=>p(""),children:n.jsx(yt,{className:"text-[9px] hover:text-red-500"})})]})]})}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[K&&n.jsx("button",{onClick:H,className:"text-white/80 hover:text-white text-xs underline",children:"Clear all"}),n.jsx("button",{onClick:ge,className:"text-white hover:bg-white/20 p-1.5 rounded-lg",title:"Refresh",children:n.jsx(en,{size:12,className:N?"animate-spin":""})})]})]})}),u&&n.jsx("div",{className:"p-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 uppercase tracking-wide mb-1",children:"Invoice ID"}),n.jsxs("div",{className:"relative",children:[n.jsx(fn,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-400 text-xs"}),n.jsx("input",{type:"text",value:m,onChange:ie=>x(ie.target.value),onKeyDown:ie=>ie.key==="Enter"&&ie.preventDefault(),placeholder:"Search by ID…",className:"w-full pl-8 pr-3 py-1.5 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-400 focus:outline-none"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 uppercase tracking-wide mb-1",children:"Status"}),n.jsxs("select",{value:f,onChange:ie=>p(ie.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-400 focus:outline-none",children:[n.jsx("option",{value:"",children:"All Status"}),n.jsx("option",{value:"Draft",children:"Draft"}),n.jsx("option",{value:"Submitted",children:"Submitted"}),n.jsx("option",{value:"Paid",children:"Paid"}),n.jsx("option",{value:"Unpaid",children:"Unpaid"}),n.jsx("option",{value:"Overdue",children:"Overdue"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-medium text-gray-600 uppercase tracking-wide mb-1",children:"Sort By"}),n.jsxs("select",{value:v,onChange:ie=>b(ie.target.value),className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-400 focus:outline-none",children:[n.jsx("option",{value:"creation desc",children:"Created (newest)"}),n.jsx("option",{value:"creation asc",children:"Created (oldest)"}),n.jsx("option",{value:"posting_date desc",children:"Date (newest)"}),n.jsx("option",{value:"grand_total desc",children:"Amount (highest)"})]})]})]})})]}),E&&n.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm",children:E}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden",children:[N?n.jsx("div",{className:"p-12 text-center text-gray-500",children:"Loading…"}):w.length===0?n.jsxs("div",{className:"p-12 text-center",children:[n.jsx(Kc,{className:"text-4xl text-gray-300 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"No sales invoices yet"})]}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[n.jsx("thead",{className:"bg-gray-100 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600",children:n.jsxs("tr",{children:[n.jsx("th",{className:"w-10 px-4 py-3 text-left",children:n.jsx("button",{type:"button",onClick:xe,className:"text-gray-500 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors",title:be?"Deselect all":"Select all","aria-label":"Select all on page",children:be?n.jsx(Sn,{className:"text-indigo-600 dark:text-indigo-400",size:18}):me?n.jsxs("div",{className:"relative inline-block",children:[n.jsx(Gr,{size:18}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"w-2 h-0.5 bg-current"})})]}):n.jsx(Gr,{size:18})})}),["Invoice ID","Customer","Status","Date","Grand Total","Outstanding",""].map(ie=>n.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:ie},ie))]})}),n.jsx("tbody",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:w.map(ie=>{var se,he;return n.jsxs("tr",{className:`hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer ${U.has(ie.name)?"bg-indigo-50 dark:bg-indigo-900/20":""}`,onClick:()=>Y(ie.name),children:[n.jsx("td",{className:"w-10 px-4 py-3",onClick:_e=>_e.stopPropagation(),children:n.jsx("button",{type:"button",onClick:()=>ce(ie.name),className:"text-gray-500 dark:text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400 transition-colors","aria-label":`Select ${ie.name}`,children:U.has(ie.name)?n.jsx(Sn,{className:"text-indigo-600 dark:text-indigo-400",size:18}):n.jsx(Gr,{size:18})})}),n.jsx("td",{className:"px-6 py-4 font-medium text-gray-900 dark:text-white text-sm",children:ie.name}),n.jsx("td",{className:"px-6 py-4 text-sm text-gray-700 dark:text-gray-300",children:ie.customer_name||ie.customer||"-"}),n.jsx("td",{className:"px-6 py-4",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Dve(ie.status||"",ie.docstatus)}`,children:ie.status||"Draft"})}),n.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:ie.posting_date||"-"}),n.jsxs("td",{className:"px-6 py-4 text-sm font-medium text-gray-900 dark:text-white",children:[ie.currency||""," ",((se=ie.grand_total)!=null?se:0).toFixed(2)]}),n.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:((he=ie.outstanding_amount)!=null?he:0).toFixed(2)}),n.jsx("td",{className:"px-6 py-3",onClick:_e=>_e.stopPropagation(),children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>Y(ie.name),className:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300 p-2 hover:bg-indigo-50 dark:hover:bg-indigo-900/30 rounded transition-colors",title:"View",children:n.jsx(Hs,{})}),n.jsx("button",{onClick:()=>re(ie.name),className:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 p-2 hover:bg-green-50 dark:hover:bg-green-900/30 rounded transition-colors",title:"Edit",children:n.jsx(ha,{})}),n.jsx("button",{onClick:()=>de(ie.name),className:"text-purple-600 dark:text-purple-400 hover:text-purple-900 dark:hover:text-purple-300 p-2 hover:bg-purple-50 dark:hover:bg-purple-900/30 rounded transition-colors",title:"Duplicate",children:n.jsx(uu,{})})]})})]},ie.name)})})]})}),L>1&&n.jsx("div",{className:"border-t border-gray-200 px-4 py-3",children:n.jsx(Wy,{currentPage:i,totalPages:L,totalCount:k,pageSize:fg,onPageChange:l})})]})]})},Dt=({children:e,required:t})=>n.jsxs("label",{className:"block text-[11px] font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),ni=({children:e})=>n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800/60 rounded min-h-[34px] flex items-center",children:e||n.jsx("span",{className:"text-gray-400",children:"-"})}),fi="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-indigo-400",Pc=fi+" text-right",vL="w-full px-2 py-1 text-xs border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-indigo-400",Fve=vL+" text-right",qf=({title:e,children:t,defaultOpen:r=!1})=>{const[a,s]=y.useState(r);return n.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-600 mt-3 pt-1",children:[n.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"flex items-center gap-2 py-1 text-xs font-semibold text-blue-600 dark:text-blue-400 hover:underline",children:[a?n.jsx(nr,{size:9}):n.jsx(bs,{size:9}),e]}),a&&n.jsx("div",{className:"mt-2",children:t})]})},hg=({title:e,children:t,defaultOpen:r=!0})=>{const[a,s]=y.useState(r);return n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"w-full flex items-center justify-between px-6 py-3 hover:bg-gray-50 dark:hover:bg-gray-700/30",children:[n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:e}),a?n.jsx(nr,{className:"text-gray-400 text-xs"}):n.jsx(bs,{className:"text-gray-400 text-xs"})]}),a&&n.jsx("div",{className:"px-6 pb-5",children:t})]})},Mve=()=>({item_code:"",item_name:"",description:"",qty:1,uom:"",stock_uom:"",conversion_factor:1,rate:0,amount:0,price_list_rate:0,discount_percentage:0,net_rate:0,net_amount:0,income_account:"",expense_account:"",item_tax_template:"",is_free_item:0,grant_commission:1}),sn=e=>{if(e==null||e==="")return;const t=String(e);if(t.toLowerCase()!=="none")return t},_w=e=>{var a,s;const t=sn((a=e.sales_order)!=null?a:e.against_sales_order),r=sn((s=e.delivery_note)!=null?s:e.against_delivery_note);return Se(ee({},e),{sales_order:t,delivery_note:r,so_detail:sn(e.so_detail),dn_detail:sn(e.dn_detail),against_sales_order:t,against_delivery_note:r})},Lve=(e,t)=>{var s,i,l,u,d,f,p,m,x;const r=sn((s=e.sales_order)!=null?s:e.against_sales_order),a=sn((i=e.delivery_note)!=null?i:e.against_delivery_note);return Se(ee({},e.name?{name:e.name}:{}),{item_code:e.item_code,item_name:e.item_name||e.item_code,description:e.description||void 0,qty:(l=e.qty)!=null?l:1,uom:e.uom||void 0,stock_uom:e.stock_uom||void 0,conversion_factor:(u=e.conversion_factor)!=null?u:1,price_list_rate:(d=e.price_list_rate)!=null?d:0,discount_percentage:(f=e.discount_percentage)!=null?f:0,rate:(p=e.rate)!=null?p:0,amount:(m=e.amount)!=null?m:0,item_tax_template:e.item_tax_template||void 0,is_free_item:(x=e.is_free_item)!=null?x:0,income_account:e.income_account||void 0,expense_account:e.expense_account||void 0,cost_center:e.cost_center||void 0,project:e.project||void 0,sales_order:r,delivery_note:a,so_detail:sn(e.so_detail),dn_detail:sn(e.dn_detail),pos_invoice:sn(e.pos_invoice),pos_invoice_item:e.pos_invoice_item||void 0,delivered_qty:e.delivered_qty!=null?e.delivered_qty:void 0,idx:t+1})},Ive=({item:e,rowNo:t,onChange:r,onClose:a,onDelete:s,onInsertBelow:i})=>{var p,m,x,v,b,w,j,k,C;const[l,u]=y.useState(!1),d=y.useCallback(N=>fe(null,null,function*(){if(N)try{u(!0);const A=(yield(yield fetch(`/api/resource/Item/${encodeURIComponent(N)}`,{credentials:"include"})).json()).data;if(!A)return;A.item_name&&r("item_name",A.item_name),A.description&&r("description",A.description),A.stock_uom&&r("stock_uom",A.stock_uom),(A.sales_uom||A.stock_uom)&&r("uom",A.sales_uom||A.stock_uom)}catch(O){}finally{u(!1)}}),[r]),f=(N,O)=>r(N,O);return n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"p-0",children:n.jsxs("div",{className:"border border-blue-300 dark:border-blue-600 rounded-lg mx-2 my-1 bg-white dark:bg-gray-800 shadow-md",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-blue-50 dark:bg-blue-900/30 rounded-t-lg border-b border-blue-200 dark:border-blue-700",children:[n.jsxs("span",{className:"text-sm font-semibold text-blue-700 dark:text-blue-300",children:["Editing Row #",t," ",l&&n.jsx(vt,{className:"inline animate-spin ml-1 text-xs"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:i,className:"px-2 py-1 text-xs border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-300",children:"Insert Below"}),n.jsx("button",{onClick:s,className:"px-2 py-1 text-xs border border-red-300 dark:border-red-700 rounded text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20",children:"Delete"}),n.jsx("button",{onClick:a,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:n.jsx(yt,{size:13})})]})]}),n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Item"}),n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:e.item_code||"",onChange:N=>{r("item_code",N),d(N)},placeholder:"Select item…"})]}),n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Item Name"}),n.jsx("input",{type:"text",value:e.item_name||"",onChange:N=>r("item_name",N.target.value),className:fi,placeholder:"Item name…"})]})]}),n.jsxs(qf,{title:"Description",defaultOpen:!!e.description,children:[n.jsx(Dt,{children:"Description"}),n.jsx("textarea",{rows:2,value:e.description||"",onChange:N=>r("description",N.target.value),className:fi,placeholder:"Description…"})]}),n.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Quantity"}),n.jsx("input",{type:"number",min:0,step:"1",value:(p=e.qty)!=null?p:1,onChange:N=>f("qty",parseFloat(N.target.value)||0),className:Pc})]}),n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"UOM"}),n.jsx("input",{type:"text",value:e.uom||"",onChange:N=>r("uom",N.target.value),className:fi,placeholder:"UOM…"})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Stock UOM"}),n.jsx("input",{type:"text",value:e.stock_uom||"",onChange:N=>r("stock_uom",N.target.value),className:fi,placeholder:"Stock UOM…"})]}),n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"UOM Conversion Factor"}),n.jsx("input",{type:"number",min:0,step:"0.001",value:(m=e.conversion_factor)!=null?m:1,onChange:N=>r("conversion_factor",parseFloat(N.target.value)||1),className:Pc})]})]}),n.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[n.jsxs("div",{children:[n.jsx(Dt,{children:"Price List Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(x=e.price_list_rate)!=null?x:0,onChange:N=>r("price_list_rate",parseFloat(N.target.value)||0),className:Pc})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Discount %"}),n.jsx("input",{type:"number",min:0,max:100,step:"0.01",value:(v=e.discount_percentage)!=null?v:0,onChange:N=>r("discount_percentage",parseFloat(N.target.value)||0),className:Pc})]}),n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(b=e.rate)!=null?b:0,onChange:N=>f("rate",parseFloat(N.target.value)||0),className:Pc})]}),n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Amount"}),n.jsx("div",{className:"px-3 py-2 text-sm font-semibold text-gray-800 dark:text-gray-100 bg-gray-50 dark:bg-gray-700 rounded text-right",children:(e.amount||0).toFixed(2)})]})]}),n.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[n.jsxs("div",{children:[n.jsx(Dt,{children:"Net Rate"}),n.jsx("div",{className:"px-3 py-2 text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 rounded text-right",children:(e.net_rate||e.rate||0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Net Amount"}),n.jsx("div",{className:"px-3 py-2 text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 rounded text-right",children:(e.net_amount||e.amount||0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Item Tax Template"}),n.jsx("input",{type:"text",value:e.item_tax_template||"",onChange:N=>r("item_tax_template",N.target.value),className:fi,placeholder:"Tax template…"})]}),n.jsxs("div",{className:"flex flex-col justify-end gap-2 pb-1",children:[n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[n.jsx("input",{type:"checkbox",checked:!!e.is_free_item,onChange:N=>r("is_free_item",N.target.checked?1:0),className:"rounded border-gray-300"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Is Free Item"})]}),n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[n.jsx("input",{type:"checkbox",checked:e.grant_commission!==0,onChange:N=>r("grant_commission",N.target.checked?1:0),className:"rounded border-gray-300"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Grant Commission"})]})]})]}),n.jsx(qf,{title:"Accounting Details",defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Income Account"}),n.jsx(Be,{label:"Income Account",hideLabel:!0,doctype:"Account",value:e.income_account||"",onChange:N=>r("income_account",N),placeholder:"Income account…"})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Expense Account"}),n.jsx(Be,{label:"Expense Account",hideLabel:!0,doctype:"Account",value:e.expense_account||"",onChange:N=>r("expense_account",N),placeholder:"Expense account…"})]})]})}),n.jsx(qf,{title:"Accounting Dimensions",children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Dt,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:N=>r("cost_center",N),placeholder:"Cost center…"})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Project"}),n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:e.project||"",onChange:N=>r("project",N),placeholder:"Project…"})]})]})}),n.jsx(qf,{title:"References",defaultOpen:!!(sn((w=e.sales_order)!=null?w:e.against_sales_order)||sn((j=e.delivery_note)!=null?j:e.against_delivery_note)||sn(e.pos_invoice)),children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Dt,{children:"Sales Order"}),n.jsx(Be,{label:"Sales Order",hideLabel:!0,doctype:"Sales Order",value:sn((k=e.sales_order)!=null?k:e.against_sales_order)||"",onChange:N=>{r("sales_order",N),r("against_sales_order",N)},placeholder:"Sales Order…"})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Delivery Note"}),n.jsx(Be,{label:"Delivery Note",hideLabel:!0,doctype:"Delivery Note",value:sn((C=e.delivery_note)!=null?C:e.against_delivery_note)||"",onChange:N=>{r("delivery_note",N),r("against_delivery_note",N)},placeholder:"Delivery Note…"})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"POS Invoice"}),n.jsx(Be,{label:"POS Invoice",hideLabel:!0,doctype:"POS Invoice",value:e.pos_invoice||"",onChange:N=>r("pos_invoice",N),placeholder:"POS Invoice…"})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Delivered Qty"}),n.jsx("div",{className:"px-3 py-2 text-sm text-gray-700 dark:text-gray-200 bg-gray-50 dark:bg-gray-700 rounded",children:e.delivered_qty!=null?+e.delivered_qty:"—"})]})]})})]})]})})})},zve=({tax:e,rowNo:t,onChange:r,onClose:a,onDelete:s,onInsertBelow:i})=>{var l;return n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"p-0",children:n.jsxs("div",{className:"border border-blue-300 dark:border-blue-600 rounded-lg mx-2 my-1 bg-white dark:bg-gray-800 shadow-md",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-blue-50 dark:bg-blue-900/30 rounded-t-lg border-b border-blue-200",children:[n.jsxs("span",{className:"text-sm font-semibold text-blue-700 dark:text-blue-300",children:["Tax Row #",t]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:i,className:"px-2 py-1 text-xs border border-gray-300 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-300",children:"Insert Below"}),n.jsx("button",{type:"button",onClick:s,className:"px-2 py-1 text-xs border border-red-300 rounded text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20",children:"Delete"}),n.jsx("button",{type:"button",onClick:a,className:"p-1 text-gray-400 hover:text-gray-600",children:n.jsx(yt,{size:13})})]})]}),n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Type"}),n.jsxs("select",{value:e.charge_type||"",onChange:u=>r("charge_type",u.target.value),className:fi,children:[n.jsx("option",{value:"",children:"Select type…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"}),n.jsx("option",{value:"On Previous Row Total",children:"On Previous Row Total"}),n.jsx("option",{value:"On Item Quantity",children:"On Item Quantity"}),n.jsx("option",{value:"Inter Company Transaction",children:"Inter Company Transaction"})]})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Description"}),n.jsx("textarea",{rows:3,value:e.description||"",onChange:u=>r("description",u.target.value),className:fi,placeholder:"Description…"})]})]}),n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Account Head"}),n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:e.account_head||"",onChange:u=>r("account_head",u),placeholder:"Account…"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"checkbox",checked:!!e.included_in_print_rate,onChange:u=>r("included_in_print_rate",u.target.checked?1:0),className:"rounded border-gray-300"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Tax included in basic rate"})]}),n.jsx(qf,{title:"Accounting dimensions",defaultOpen:!0,children:n.jsxs("div",{children:[n.jsx(Dt,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:u=>r("cost_center",u),placeholder:"Cost center…"})]})}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.charge_type==="Actual"&&n.jsxs("div",{children:[n.jsx(Dt,{children:"Tax amount"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(l=e.tax_amount)!=null?l:0,onChange:u=>r("tax_amount",parseFloat(u.target.value)||0),className:Pc})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Tax rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:mi(e),onChange:u=>r("tax_rate",parseFloat(u.target.value)||0),className:Pc})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Account currency"}),n.jsx("input",{value:e.account_currency||xt,onChange:u=>r("account_currency",u.target.value),className:fi})]})]})]})]})})})},Bve=()=>({charge_type:"",account_head:"",tax_rate:0,account_currency:xt,included_in_print_rate:0}),pg=e=>{var t,r;return Se(ee({},e),{tax_rate:(r=(t=e.tax_rate)!=null?t:e.rate)!=null?r:0,tax_amount:e.tax_amount})},$ve=(e,t)=>{var a,s;const r=Se(ee({},e.name?{name:e.name}:{}),{charge_type:e.charge_type,account_head:e.account_head||void 0,description:e.description||void 0,included_in_print_rate:(a=e.included_in_print_rate)!=null?a:0,cost_center:e.cost_center||void 0,rate:mi(e),account_currency:e.account_currency||xt,idx:t+1});return e.charge_type==="Actual"&&(r.tax_amount=(s=e.tax_amount)!=null?s:0),r},Uve=()=>{var _e,F,X,R,I,te;const{invoiceName:e}=Hn(),[t]=dn(),r=Ut(),a=e==="new",s=t.get("customer")||"",i=t.get("dn")||"",l=t.get("so")||"",u=t.get("company")||fa,d=t.get("project")||"",[f,p]=y.useState(null),[m,x]=y.useState(!a),[v,b]=y.useState(null),[w,j]=y.useState(a),[k,C]=y.useState(!1),[N,O]=y.useState(!1),[E,A]=y.useState(null),[T,P]=y.useState(null),D=new Date().toISOString().split("T")[0],[z,G]=y.useState({customer:s,posting_date:D,currency:xt,company:u,project:d||void 0,taxes_and_charges:i0,items:[],taxes:[]}),V=y.useCallback(q=>{G({customer:q.customer||"",posting_date:q.posting_date||D,currency:q.currency==="INR"?xt:q.currency||xt,company:q.company||fa,project:q.project||"",items:(q.items||[]).map(B=>_w(B)),tax_category:q.tax_category||"",taxes_and_charges:q.taxes_and_charges||"",shipping_rule:q.shipping_rule||"",incoterm:q.incoterm||"",taxes:(q.taxes||[]).map(pg),selling_price_list:q.selling_price_list||"",price_list_currency:q.price_list_currency||"",conversion_rate:q.conversion_rate||1,plc_conversion_rate:q.plc_conversion_rate||1}),A(null),P(null)},[D]);y.useEffect(()=>{const q=z.company;!a||!q||fetch(`/api/resource/Company/${encodeURIComponent(q)}`,{credentials:"include"}).then(B=>B.json()).then(B=>{var je;if((je=B.data)!=null&&je.default_currency){const Ce=Va(B.data.default_currency);G(ye=>Se(ee({},ye),{currency:Ce,selling_price_list:ye.selling_price_list||"Standard Selling",price_list_currency:ye.price_list_currency||Ce}))}}).catch(()=>{})},[z.company,a]),y.useEffect(()=>{!a||!i||fetch(`/api/resource/Delivery Note/${encodeURIComponent(i)}`,{credentials:"include"}).then(q=>q.json()).then(q=>{const B=q.data;if(!B)return;const je=B.project||"";G(Ce=>{var ye;return Se(ee({},Ce),{customer:B.customer||Ce.customer,company:B.company||Ce.company,project:je||Ce.project,tax_category:B.tax_category||Ce.tax_category,taxes_and_charges:B.taxes_and_charges||Ce.taxes_and_charges,shipping_rule:B.shipping_rule||Ce.shipping_rule,incoterm:B.incoterm||Ce.incoterm,taxes:((ye=B.taxes)!=null&&ye.length?B.taxes:Ce.taxes||[]).map(pg),items:(B.items||[]).map(Ee=>_w({item_code:Ee.item_code,item_name:Ee.item_name,description:Ee.description||Ee.item_name||Ee.item_code,qty:Ee.qty,uom:Ee.uom,stock_uom:Ee.stock_uom,rate:Ee.rate,amount:Ee.amount,project:Ee.project||je||void 0,delivery_note:i,sales_order:sn(Ee.against_sales_order),so_detail:sn(Ee.so_detail),dn_detail:Ee.name||void 0}))})})}).catch(()=>{})},[a,i]),y.useEffect(()=>{!a||!l||i||fetch(`/api/resource/Sales Order/${encodeURIComponent(l)}`,{credentials:"include"}).then(q=>q.json()).then(q=>{const B=q.data;if(!B)return;const je=String(B.project||"").trim()||d;G(Ce=>{var ye,Ee,Xe,tt,ve;return Se(ee({},Ce),{customer:B.customer||Ce.customer,company:B.company||Ce.company,project:je||Ce.project,tax_category:B.tax_category||Ce.tax_category,taxes_and_charges:B.taxes_and_charges||Ce.taxes_and_charges,shipping_rule:B.shipping_rule||Ce.shipping_rule,incoterm:B.incoterm||Ce.incoterm,taxes:((ye=B.taxes)!=null&&ye.length?B.taxes:Ce.taxes||[]).map(pg),currency:B.currency||Ce.currency,selling_price_list:B.selling_price_list||Ce.selling_price_list||"Standard Selling",price_list_currency:B.currency||Ce.price_list_currency||Ce.currency,conversion_rate:(Xe=(Ee=B.conversion_rate)!=null?Ee:Ce.conversion_rate)!=null?Xe:1,plc_conversion_rate:(ve=(tt=B.plc_conversion_rate)!=null?tt:Ce.plc_conversion_rate)!=null?ve:1,items:(B.items||[]).map(Oe=>{var st,ct;return _w({item_code:Oe.item_code,item_name:Oe.item_name,description:Oe.description||Oe.item_name||Oe.item_code,qty:Oe.qty,uom:Oe.uom,stock_uom:Oe.stock_uom,conversion_factor:(st=Oe.conversion_factor)!=null?st:1,rate:Oe.rate,amount:(ct=Oe.amount)!=null?ct:(Oe.qty||0)*(Oe.rate||0),income_account:Oe.income_account,expense_account:Oe.expense_account,item_tax_template:Oe.item_tax_template,cost_center:Oe.cost_center,project:Oe.project||je||void 0,sales_order:l,so_detail:Oe.name||void 0})})})})}).catch(()=>{})},[a,l,i]),y.useEffect(()=>{a||(x(!0),Ii.getSalesInvoice(e).then(q=>{p(q),V(q)}).catch(q=>b(q.message)).finally(()=>x(!1)))},[e,a,V]);const ne=(q,B)=>G(je=>Se(ee({},je),{[q]:B})),ge=(q,B,je)=>G(Ce=>{const ye=[...Ce.items||[]],Ee=Se(ee({},ye[q]),{[B]:je});if(B==="qty"||B==="rate"){const Xe=parseFloat(String(B==="qty"?je:Ee.qty))||0,tt=parseFloat(String(B==="rate"?je:Ee.rate))||0;Ee.amount=parseFloat((Xe*tt).toFixed(4)),Ee.net_amount=Ee.amount,Ee.net_rate=tt}return ye[q]=Ee,Se(ee({},Ce),{items:ye})}),Z=q=>{G(B=>{const je=[...B.items||[]],Ce=Mve();let ye;return q!==void 0?(je.splice(q+1,0,Ce),ye=q+1):(je.push(Ce),ye=je.length-1),setTimeout(()=>A(ye),0),Se(ee({},B),{items:je})})},U=q=>{G(B=>{const je=[...B.items||[]];return je.splice(q,1),Se(ee({},B),{items:je})}),A(null)},ce=(q,B)=>fe(null,null,function*(){if(ge(q,"item_code",B),!!B)try{const ye=(yield(yield fetch(`/api/resource/Item/${encodeURIComponent(B)}`,{credentials:"include"})).json()).data;if(!ye)return;G(Ee=>{const Xe=[...Ee.items||[]];return Xe[q]=Se(ee({},Xe[q]),{item_code:B,item_name:ye.item_name||B,description:ye.description||Xe[q].description||"",stock_uom:ye.stock_uom||Xe[q].stock_uom||"",uom:ye.sales_uom||ye.stock_uom||Xe[q].uom||""}),Se(ee({},Ee),{items:Xe})})}catch(je){}}),xe=(q,B,je)=>G(Ce=>{const ye=[...Ce.taxes||[]];return ye[q]=Se(ee({},ye[q]),{[B]:je}),Se(ee({},Ce),{taxes:ye})}),be=q=>{G(B=>{const je=[...B.taxes||[]],Ce=Bve();let ye;return q!==void 0?(je.splice(q+1,0,Ce),ye=q+1):(je.push(Ce),ye=je.length-1),setTimeout(()=>P(ye),0),Se(ee({},B),{taxes:je})})},me=q=>{G(B=>{const je=[...B.taxes||[]];return je.splice(q,1),Se(ee({},B),{taxes:je})}),P(null)},oe=q=>fe(null,null,function*(){var B;if(q)try{const ye=(yield(yield fetch(`/api/resource/Sales Taxes and Charges Template/${encodeURIComponent(q)}`,{credentials:"include"})).json()).data;(B=ye==null?void 0:ye.taxes)!=null&&B.length&&G(Ee=>Se(ee({},Ee),{taxes:ye.taxes.map(Xe=>{var tt;return pg({charge_type:Xe.charge_type,account_head:Xe.account_head,description:Xe.description,rate:Xe.rate,tax_amount:Xe.tax_amount,cost_center:Xe.cost_center,account_currency:Xe.account_currency,included_in_print_rate:(tt=Xe.included_in_print_rate)!=null?tt:0})})}))}catch(je){}});y.useEffect(()=>{!a||i||l||oe(i0)},[a,i,l]);const L=(z.items||[]).reduce((q,B)=>q+(B.amount||0),0),K=((q,B)=>{let je=B;return q.map(Ce=>{const ye=mi(Ce);let Ee=0;return Ce.charge_type==="On Net Total"?Ee=B*(ye/100):Ce.charge_type==="Actual"?Ee=Ce.tax_amount||0:Ce.charge_type==="On Previous Row Amount"||Ce.charge_type==="On Previous Row Total"?Ee=je*(ye/100):Ee=B*(ye/100),je+=Ee,Se(ee({},Ce),{_computed_amt:Ee,_computed_total:je})})})(z.taxes||[],L),Y=K.reduce((q,B)=>q+B._computed_amt,0),re=L+Y,de=()=>fe(null,null,function*(){if(!z.customer){$e.error("Customer is required",{icon:n.jsx(Fr,{})});return}if(!z.posting_date){$e.error("Posting date is required",{icon:n.jsx(Fr,{})});return}try{C(!0);const q={customer:z.customer,posting_date:z.posting_date,currency:z.currency||void 0,selling_price_list:z.selling_price_list||"Standard Selling",price_list_currency:z.price_list_currency||z.currency||void 0,conversion_rate:z.conversion_rate||1,plc_conversion_rate:z.plc_conversion_rate||1,company:z.company||void 0,project:z.project||void 0,tax_category:z.tax_category||void 0,taxes_and_charges:z.taxes_and_charges||void 0,shipping_rule:z.shipping_rule||void 0,incoterm:z.incoterm||void 0,items:(z.items||[]).filter(B=>B.item_code).map((B,je)=>Lve(Se(ee({},B),{project:B.project||z.project}),je)),taxes:(z.taxes||[]).filter(B=>B.charge_type).map((B,je)=>$ve(B,je))};if(a){const B=yield Ii.createSalesInvoice(q);$e.success("Sales Invoice created",{icon:n.jsx(Or,{})}),j(!1),r(`/invoices/${B.name}`)}else{const B=yield Ii.updateSalesInvoice(e,q);p(B),V(B),$e.success("Sales Invoice saved",{icon:n.jsx(Or,{})}),j(!1)}}catch(q){$e.error(q instanceof Error?q.message:"Error saving invoice",{icon:n.jsx(Fr,{})})}finally{C(!1)}}),ie=()=>fe(null,null,function*(){if(!(!e||a))try{O(!0),yield Ii.clearItemLinkNones(e);const q=yield Ii.submitSalesInvoice(e);p(q),V(q),$e.success("Sales Invoice submitted",{icon:n.jsx(Or,{})})}catch(q){$e.error(q instanceof Error?q.message:"Error submitting",{icon:n.jsx(Fr,{})})}finally{O(!1)}}),se=a||w,he=!a&&(f==null?void 0:f.docstatus)===1;return m?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-indigo-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-6 text-gray-500",children:[n.jsx("button",{onClick:()=>r("/projects"),className:"hover:text-indigo-600",children:"Project Management"}),n.jsx("span",{children:"/"}),n.jsx("button",{onClick:()=>r("/invoices"),className:"hover:text-indigo-600",children:"Sales Invoices"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:a?"New Sales Invoice":e})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 dark:border-gray-700 flex items-center justify-between gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>r("/invoices"),className:"text-gray-400 hover:text-gray-700",children:n.jsx(da,{})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx(Kc,{className:"text-indigo-500"}),n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:a?"New Sales Invoice":e}),!a&&n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${(()=>{const q=(f==null?void 0:f.status)||"";return(f==null?void 0:f.docstatus)===2||q==="Cancelled"?"bg-red-100 text-red-700":!f||f.docstatus===0?"bg-yellow-100 text-yellow-800":q==="Paid"?"bg-green-100 text-green-800":q==="Partly Paid"?"bg-indigo-100 text-indigo-800":q==="Unpaid"?"bg-orange-100 text-orange-800":q==="Overdue"?"bg-red-100 text-red-700":q==="Return"||q==="Credit Note Issued"?"bg-orange-100 text-orange-800":"bg-green-100 text-green-800"})()}`,children:(f==null?void 0:f.docstatus)===2?"Cancelled":(f==null?void 0:f.docstatus)===0?"Draft":(f==null?void 0:f.status)||"Submitted"})]}),z.customer&&n.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:z.customer})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[!a&&!w&&(f==null?void 0:f.docstatus)===0&&n.jsxs("button",{onClick:ie,disabled:N,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 text-sm font-medium",children:[N?n.jsx(vt,{className:"animate-spin"}):n.jsx(cu,{size:12})," Submit"]}),!a&&!w&&he&&((_e=f==null?void 0:f.outstanding_amount)!=null?_e:0)>0&&n.jsxs("button",{onClick:()=>{const q=new URLSearchParams({si:e,customer:(f==null?void 0:f.customer)||"",company:(f==null?void 0:f.company)||"",project:(f==null?void 0:f.project)||"",amount:String((f==null?void 0:f.outstanding_amount)||(f==null?void 0:f.grand_total)||0),currency:(f==null?void 0:f.currency)||""});r(`/payment-entries/new?${q}`)},className:"flex items-center gap-2 px-4 py-2 bg-teal-600 hover:bg-teal-700 text-white text-sm font-semibold rounded-lg shadow transition-colors",children:[n.jsx(Dl,{size:13})," Create Payment"]}),!a&&!w&&!he&&n.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-2 px-4 py-2 border border-indigo-500 text-indigo-600 rounded-lg hover:bg-indigo-50 text-sm",children:[n.jsx(ha,{})," Edit"]}),se&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:de,disabled:k,className:"flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 disabled:opacity-50 text-sm font-medium",children:[k?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),k?"Saving…":"Save"]}),!a&&n.jsx("button",{onClick:()=>{f&&V(f),j(!1)},className:"px-3 py-2 border border-gray-300 rounded-lg text-gray-600 text-sm",children:n.jsx(yt,{})})]})]})]}),v&&n.jsx("div",{className:"mx-6 mt-4 p-3 bg-red-50 rounded-lg text-red-700 text-sm",children:v}),n.jsx("div",{className:"px-6 pt-5 pb-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Customer"}),se?n.jsx(Be,{label:"Customer",hideLabel:!0,doctype:"Customer",value:z.customer||"",onChange:q=>ne("customer",q),placeholder:"Select customer…"}):n.jsx(ni,{children:z.customer})]}),n.jsxs("div",{children:[n.jsx(Dt,{required:!0,children:"Posting Date"}),se?n.jsx("input",{type:"date",value:z.posting_date||"",onChange:q=>ne("posting_date",q.target.value),className:fi}):n.jsx(ni,{children:z.posting_date})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Currency"}),se?n.jsxs("select",{value:z.currency||xt,onChange:q=>ne("currency",q.target.value),className:fi,children:[n.jsx("option",{value:"SAR",children:"SAR"}),n.jsx("option",{value:"USD",children:"USD"}),n.jsx("option",{value:"EUR",children:"EUR"})]}):n.jsx(ni,{children:z.currency})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Company"}),se?n.jsx(Be,{label:"Company",hideLabel:!0,doctype:"Company",value:z.company||"",onChange:q=>ne("company",q),placeholder:"Select company…"}):n.jsx(ni,{children:z.company})]})]})}),n.jsxs(hg,{title:"Items",children:[n.jsx("div",{className:"overflow-x-auto -mx-2",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 min-w-[200px]",children:"Item"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3",children:"Item Name"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:"Qty"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Rate"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Amount"}),n.jsx("th",{className:"w-20 py-2 px-3"})]})}),n.jsxs("tbody",{children:[(z.items||[]).map((q,B)=>{var je,Ce,ye,Ee,Xe;return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${E===B?"bg-blue-50/60 dark:bg-blue-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:B+1}),n.jsx("td",{className:"py-1.5 px-2 min-w-[200px]",children:se?n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:q.item_code||"",onChange:tt=>ce(B,tt),placeholder:"Select item…"}):n.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-200",children:q.item_code||n.jsx("span",{className:"text-gray-400 italic text-xs",children:"No item"})})}),n.jsx("td",{className:"py-1.5 px-3 text-gray-600 dark:text-gray-400 max-w-[180px] truncate text-sm",children:q.item_name||n.jsx("span",{className:"text-gray-400",children:"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:se?n.jsx("input",{type:"number",min:0,step:"0.001",value:(je=q.qty)!=null?je:1,onChange:tt=>ge(B,"qty",parseFloat(tt.target.value)||0),className:"w-full px-2 py-1 text-sm text-right border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-400"}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 text-sm pr-1",children:(Ce=q.qty)!=null?Ce:0})}),n.jsx("td",{className:"py-1.5 px-2 w-28",children:se?n.jsx("input",{type:"number",min:0,step:"0.01",value:(ye=q.rate)!=null?ye:0,onChange:tt=>ge(B,"rate",parseFloat(tt.target.value)||0),className:"w-full px-2 py-1 text-sm text-right border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-400"}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 text-sm pr-1",children:((Ee=q.rate)!=null?Ee:0).toFixed(2)})}),n.jsx("td",{className:"py-1.5 px-3 text-right font-semibold text-gray-900 dark:text-white text-sm",children:((Xe=q.amount)!=null?Xe:0).toFixed(2)}),n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[se&&n.jsx("button",{onClick:()=>A(E===B?null:B),className:`p-1.5 rounded text-xs ${E===B?"bg-blue-600 text-white":"text-indigo-600 hover:bg-indigo-50 dark:hover:bg-indigo-900/20"}`,title:"More fields",children:n.jsx(Vs,{size:11})}),se&&n.jsx("button",{onClick:()=>U(B),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded text-xs",title:"Delete row",children:n.jsx(Za,{size:11})})]})})]}),se&&E===B&&n.jsx(Ive,{item:q,rowNo:B+1,onChange:(tt,ve)=>{tt==="item_code"?ce(B,ve):ge(B,tt,ve)},onClose:()=>A(null),onDelete:()=>U(B),onInsertBelow:()=>Z(B)})]},B)}),se&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{onClick:()=>Z(),className:"flex items-center gap-1.5 text-indigo-600 hover:text-indigo-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})}),n.jsxs("div",{className:"mt-3 flex justify-between items-center text-sm border-t border-gray-100 dark:border-gray-700 pt-3",children:[n.jsxs("span",{className:"text-gray-500",children:["Total Quantity: ",n.jsx("strong",{className:"text-gray-800 dark:text-gray-200",children:(z.items||[]).reduce((q,B)=>q+(B.qty||0),0)})]}),n.jsxs("span",{className:"text-gray-500",children:["Total: ",n.jsxs("strong",{className:"text-gray-900 dark:text-white text-base",children:[Va(z.currency)," ",L.toFixed(2)]})]})]})]}),n.jsxs(hg,{title:"Taxes and Charges",defaultOpen:!0,children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-x-8 gap-y-3",children:[n.jsxs("div",{children:[n.jsx(Dt,{children:"Tax Category"}),se?n.jsx(Be,{label:"Tax Category",hideLabel:!0,doctype:"Tax Category",value:z.tax_category||"",onChange:q=>ne("tax_category",q),placeholder:"Select tax category…"}):n.jsx(ni,{children:z.tax_category})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Shipping Rule"}),se?n.jsx(Be,{label:"Shipping Rule",hideLabel:!0,doctype:"Shipping Rule",value:z.shipping_rule||"",onChange:q=>ne("shipping_rule",q),placeholder:"Select shipping rule…"}):n.jsx(ni,{children:z.shipping_rule})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Incoterm"}),se?n.jsx(Be,{label:"Incoterm",hideLabel:!0,doctype:"Incoterm",value:z.incoterm||"",onChange:q=>ne("incoterm",q),placeholder:"Select incoterm…"}):n.jsx(ni,{children:z.incoterm})]})]}),n.jsxs("div",{className:"mt-3",children:[n.jsx(Dt,{children:"Sales Taxes and Charges Template"}),se?n.jsx(Be,{label:"Sales Taxes and Charges Template",hideLabel:!0,doctype:"Sales Taxes and Charges Template",value:z.taxes_and_charges||"",onChange:q=>{ne("taxes_and_charges",q),oe(q)},placeholder:"Select template…"}):n.jsx(ni,{children:z.taxes_and_charges})]}),n.jsxs("div",{className:"overflow-x-auto -mx-2 mt-4",children:[n.jsx("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-wide px-2 mb-2",children:"Sales Taxes and Charges"}),n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-44",children:["Type ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3",children:["Account Head ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:"Tax Rate"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Amount"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Total"}),se&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[K.length===0&&n.jsx("tr",{children:n.jsx("td",{colSpan:se?7:6,className:"py-10 text-center text-gray-400 text-sm",children:"No tax rows — use Add Row or pick a template."})}),K.map((q,B)=>{var je,Ce;return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${T===B?"bg-blue-50/60 dark:bg-blue-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:B+1}),n.jsx("td",{className:"py-1.5 px-2 w-44",children:se?n.jsxs("select",{value:q.charge_type||"",onChange:ye=>xe(B,"charge_type",ye.target.value),className:vL,children:[n.jsx("option",{value:"",children:"Select type…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"}),n.jsx("option",{value:"On Previous Row Total",children:"On Previous Row Total"}),n.jsx("option",{value:"On Item Quantity",children:"On Item Quantity"}),n.jsx("option",{value:"Inter Company Transaction",children:"Inter Company Transaction"})]}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:q.charge_type||"-"})}),n.jsx("td",{className:"py-1.5 px-2",children:se?n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:q.account_head||"",onChange:ye=>xe(B,"account_head",ye),placeholder:"Account Head"}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:q.account_head||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:se?n.jsx("input",{type:"number",min:0,step:"0.01",value:mi(q),onChange:ye=>xe(B,"tax_rate",parseFloat(ye.target.value)||0),className:Fve}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 pr-1",children:mi(q)})}),n.jsx("td",{className:"py-1.5 px-3 text-right text-gray-700 dark:text-gray-300 text-sm",children:((je=q._computed_amt)!=null?je:0).toFixed(2)}),n.jsx("td",{className:"py-1.5 px-3 text-right font-semibold text-gray-900 dark:text-white text-sm",children:((Ce=q._computed_total)!=null?Ce:0).toFixed(2)}),se&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{type:"button",onClick:()=>P(T===B?null:B),className:`p-1.5 rounded text-xs ${T===B?"bg-blue-600 text-white":"text-indigo-600 hover:bg-indigo-50 dark:hover:bg-indigo-900/20"}`,title:"More fields",children:n.jsx(Vs,{size:11})}),n.jsx("button",{type:"button",onClick:()=>me(B),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 rounded",children:n.jsx(Za,{size:11})})]})})]}),se&&T===B&&n.jsx(zve,{tax:q,rowNo:B+1,onChange:(ye,Ee)=>xe(B,ye,Ee),onClose:()=>P(null),onDelete:()=>me(B),onInsertBelow:()=>be(B)})]},B)}),se&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{type:"button",onClick:()=>be(),className:"flex items-center gap-1.5 text-indigo-600 hover:text-indigo-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})]}),n.jsxs("div",{className:"mt-3 flex justify-end text-sm text-gray-500 pt-2 border-t border-gray-100 dark:border-gray-700",children:["Total Taxes and Charges (",Va(z.currency),"):"," ",n.jsxs("strong",{className:"ml-2 text-gray-900 dark:text-white",children:[Va(z.currency)," ",((F=f==null?void 0:f.total_taxes_and_charges)!=null?F:Y).toFixed(2)]})]})]}),n.jsx(hg,{title:"Totals",children:n.jsx("div",{className:"space-y-3 max-w-xs ml-auto",children:[{label:"Net Total",value:((X=f==null?void 0:f.net_total)!=null?X:L).toFixed(2)},{label:"Total Taxes",value:((R=f==null?void 0:f.total_taxes_and_charges)!=null?R:Y).toFixed(2)},{label:"Grand Total",value:((I=f==null?void 0:f.grand_total)!=null?I:re).toFixed(2)},{label:"Outstanding",value:(f!=null&&(te=f.outstanding_amount)!=null?te:re).toFixed(2)}].map(({label:q,value:B})=>n.jsxs("div",{className:"flex justify-between items-center text-sm border-b border-gray-100 dark:border-gray-700 pb-2 last:border-0",children:[n.jsx("span",{className:"text-gray-500",children:q}),n.jsxs("span",{className:"font-semibold text-gray-900 dark:text-white",children:[Va(z.currency)," ",B]})]},q))})}),!a&&f&&n.jsx(hg,{title:"Meta",defaultOpen:!1,children:n.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[n.jsxs("div",{children:[n.jsx(Dt,{children:"Created By"}),n.jsx(ni,{children:f.owner})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Created"}),n.jsx(ni,{children:f.creation?new Date(f.creation).toLocaleString():"-"})]}),n.jsxs("div",{children:[n.jsx(Dt,{children:"Modified"}),n.jsx(ni,{children:f.modified?new Date(f.modified).toLocaleString():"-"})]})]})}),!a&&n.jsx(Yn,{doctype:"Sales Invoice",docname:(f==null?void 0:f.name)||e||"",creationDate:f==null?void 0:f.creation,createdBy:f==null?void 0:f.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})},bc=20;function Hve(e){const t=[];return e.search&&t.push(["Sales Order","name","like",`%${e.search}%`]),e.project&&t.push(["Sales Order","project","=",e.project]),e.status==="Draft"&&t.push(["Sales Order","docstatus","=",0]),e.status==="Submitted"&&t.push(["Sales Order","docstatus","=",1]),e.status==="Cancelled"&&t.push(["Sales Order","docstatus","=",2]),t}function qve(e){return e.docstatus===2?"bg-red-100 text-red-700":e.docstatus===1?e.billing_status==="Fully Billed"?"bg-green-100 text-green-700":(e.delivery_status==="Fully Delivered","bg-blue-100 text-blue-700"):"bg-yellow-100 text-yellow-800"}function Wve(e){return e.docstatus===2?"Cancelled":e.docstatus===1?e.status||"Submitted":"Draft"}const Vve=()=>{var Y;const{t:e}=sr(),t=Ut(),[r,a]=dn(),[s,i]=y.useState([]),[l,u]=y.useState(!0),[d,f]=y.useState(0),[p,m]=y.useState(0),[x,v]=y.useState(!1),b=((Y=r.get("project"))==null?void 0:Y.trim())||"",[w,j]=y.useState(""),[k,C]=y.useState(""),[N,O]=y.useState(b),[E,A]=y.useState({search:"",status:"",project:b}),[T,P]=y.useState(!1),D=y.useRef(!1),z=y.useRef(null);y.useEffect(()=>{var de;const re=((de=r.get("project"))==null?void 0:de.trim())||"";O(re),A(ie=>ie.project===re?ie:(m(0),Se(ee({},ie),{project:re})))},[r]);const G=y.useCallback((re,de)=>fe(null,null,function*(){u(!0);try{const ie=[];de.search&&ie.push(["Sales Order","name","like",`%${de.search}%`]),de.project&&ie.push(["Sales Order","project","=",de.project]),de.status==="Draft"&&ie.push(["Sales Order","docstatus","=",0]),de.status==="Submitted"&&ie.push(["Sales Order","docstatus","=",1]),de.status==="Cancelled"&&ie.push(["Sales Order","docstatus","=",2]);const[se,he]=yield Promise.all([cs.getSalesOrders({filters:ie,limit_start:re,limit_page_length:bc}),cs.getSalesOrderCount(ie)]);i(se),f(he)}catch(ie){$e.error(ie.message||"Failed to load")}finally{u(!1)}}),[]);y.useEffect(()=>{G(0,E)},[G,E]);const V=y.useMemo(()=>`${p}|${E.search}|${E.status}|${E.project}`,[p,E.search,E.status,E.project]),{selectedRows:ne,toggleRow:ge,toggleAllOnPage:Z,allOnPageSelected:U,someOnPageSelected:ce}=Vn(s,V);y.useEffect(()=>{if(!D.current){D.current=!0;return}const re={search:E.search,status:k,project:N.trim()};A(re),m(0),a(de=>{const ie=new URLSearchParams(de);return re.project?ie.set("project",re.project):ie.delete("project"),ie})},[k,N]),y.useEffect(()=>{if(D.current)return z.current&&window.clearTimeout(z.current),z.current=window.setTimeout(()=>{const re={search:w,status:k,project:N.trim()};A(re),m(0)},450),()=>{z.current&&window.clearTimeout(z.current)}},[w,k,N]);const xe=()=>{j(""),C(""),O(""),A({search:"",status:"",project:""}),m(0),a(re=>{const de=new URLSearchParams(re);return de.delete("project"),de})},be=!!(E.search||E.status||E.project),me=re=>{m(re),G(re*bc,E)},oe=re=>t(`/sales-orders/${encodeURIComponent(re)}`),L=re=>t(`/sales-orders/${encodeURIComponent(re)}?edit=1`),H=re=>t(`/sales-orders/new?duplicate=${encodeURIComponent(re)}`),K=y.useCallback(()=>Kn({doctype:"Sales Order",filters:Hve(E),orderBy:"modified desc"}),[E]);return n.jsxs("div",{className:"p-6",children:[n.jsx(Br,{position:"top-right",autoClose:3e3}),n.jsxs("div",{className:"flex items-center justify-between mb-6 gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-600 flex items-center justify-center",children:n.jsx(Ld,{className:"text-white text-base"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Sales Orders"}),n.jsxs("p",{className:"text-xs text-gray-500",children:[d," total"]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("button",{onClick:()=>G(p*bc,E),className:"p-2 text-gray-500 hover:text-blue-600 border border-gray-200 rounded-lg",children:n.jsx(en,{size:13})}),n.jsxs("button",{type:"button",onClick:()=>P(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:d===0&&ne.size===0,children:[n.jsx(hn,{})," ",e("listPages.export"),ne.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:ne.size})]}),n.jsxs("button",{type:"button",onClick:()=>{const re=E.project?`?project=${encodeURIComponent(E.project)}`:"";t(`/sales-orders/new${re}`)},className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-sm font-medium",children:[n.jsx(Pt,{size:11})," New Order"]})]})]}),n.jsx(Gn,{isOpen:T,onClose:()=>P(!1),doctype:"Sales Order",selectedCount:ne.size,pageCount:s.length,totalCount:d,pageData:s,selectedRows:ne,rowKey:"name",onFetchAll:K,fileNamePrefix:"sales_orders"}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl mb-5 overflow-hidden",children:[n.jsxs("button",{onClick:()=>v(re=>!re),className:"w-full flex items-center justify-between px-4 py-3 bg-gradient-to-r from-blue-500 to-blue-600 dark:from-blue-600 dark:to-blue-700 text-white",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[n.jsx(fn,{size:12})," Filters",be&&n.jsx("span",{className:"bg-white/30 text-white text-xs px-2 py-0.5 rounded-full",children:"Active"})]}),x?n.jsx(ps,{size:11}):n.jsx(nr,{size:11})]}),be&&n.jsxs("div",{className:"px-4 py-2 bg-blue-50 dark:bg-blue-900/20 flex flex-wrap gap-2 items-center border-b border-blue-100 dark:border-blue-800",children:[E.search&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-blue-100 dark:bg-blue-800 text-blue-700 dark:text-blue-300 px-2 py-1 rounded-full",children:["ID: ",E.search,n.jsx("button",{type:"button",onClick:()=>{j(""),A(re=>Se(ee({},re),{search:""}))},children:n.jsx(yt,{size:9})})]}),E.project&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-blue-100 dark:bg-blue-800 text-blue-700 dark:text-blue-300 px-2 py-1 rounded-full",children:["Project: ",E.project,n.jsx("button",{type:"button",onClick:()=>{O(""),A(re=>Se(ee({},re),{project:""})),a(re=>{const de=new URLSearchParams(re);return de.delete("project"),de})},children:n.jsx(yt,{size:9})})]}),E.status&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-blue-100 dark:bg-blue-800 text-blue-700 dark:text-blue-300 px-2 py-1 rounded-full",children:["Status: ",E.status,n.jsx("button",{type:"button",onClick:()=>{C(""),A(re=>Se(ee({},re),{status:""}))},children:n.jsx(yt,{size:9})})]}),n.jsx("button",{type:"button",onClick:xe,className:"text-xs text-blue-600 hover:underline ml-auto",children:"Clear All"})]}),x&&n.jsxs("div",{className:"px-4 py-3 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Order ID"}),n.jsx("input",{value:w,onChange:re=>j(re.target.value),onKeyDown:re=>re.key==="Enter"&&re.preventDefault(),placeholder:"Search…",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-400"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Project"}),n.jsx("input",{value:N,onChange:re=>O(re.target.value),onKeyDown:re=>re.key==="Enter"&&re.preventDefault(),placeholder:"Project name…",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-400"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Status"}),n.jsxs("select",{value:k,onChange:re=>C(re.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-400",children:[n.jsx("option",{value:"",children:"All"}),n.jsx("option",{value:"Draft",children:"Draft"}),n.jsx("option",{value:"Submitted",children:"Submitted"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]})]})]})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"w-10 px-4 py-3 text-left",children:n.jsx("button",{type:"button",onClick:Z,className:"text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",title:U?"Deselect all":"Select all","aria-label":"Select all on page",children:U?n.jsx(Sn,{className:"text-blue-600 dark:text-blue-400",size:18}):ce?n.jsxs("div",{className:"relative inline-block",children:[n.jsx(Gr,{size:18}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"w-2 h-0.5 bg-current"})})]}):n.jsx(Gr,{size:18})})}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Order ID"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Customer"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Date"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Status"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Grand Total"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4 w-28",children:" "})]})}),n.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:l?n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"text-center py-10 text-gray-400",children:"Loading…"})}):s.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"text-center py-10 text-gray-400",children:"No sales orders found"})}):s.map(re=>{var de;return n.jsxs("tr",{onClick:()=>oe(re.name),className:`cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors ${ne.has(re.name)?"bg-blue-50 dark:bg-blue-900/20":""}`,children:[n.jsx("td",{className:"w-10 px-4 py-3",onClick:ie=>ie.stopPropagation(),children:n.jsx("button",{type:"button",onClick:()=>ge(re.name),className:"text-gray-500 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors","aria-label":`Select ${re.name}`,children:ne.has(re.name)?n.jsx(Sn,{className:"text-blue-600 dark:text-blue-400",size:18}):n.jsx(Gr,{size:18})})}),n.jsx("td",{className:"py-3 px-4 font-medium text-gray-900 dark:text-white",children:re.name}),n.jsx("td",{className:"py-3 px-4 text-gray-700 dark:text-gray-300",children:re.customer_name||re.customer||"-"}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:re.transaction_date||"-"}),n.jsx("td",{className:"py-3 px-4",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${qve(re)}`,children:Wve(re)})}),n.jsxs("td",{className:"py-3 px-4 text-right font-semibold text-gray-900 dark:text-white",children:[re.currency||"SAR"," ",((de=re.grand_total)!=null?de:0).toFixed(2)]}),n.jsx("td",{className:"py-2 px-4",onClick:ie=>ie.stopPropagation(),children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>oe(re.name),className:"text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 p-2 hover:bg-blue-50 dark:hover:bg-blue-900/30 rounded transition-colors",title:"View",children:n.jsx(Hs,{})}),n.jsx("button",{onClick:()=>L(re.name),className:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 p-2 hover:bg-green-50 dark:hover:bg-green-900/30 rounded transition-colors",title:"Edit",children:n.jsx(ha,{})}),n.jsx("button",{onClick:()=>H(re.name),className:"text-purple-600 dark:text-purple-400 hover:text-purple-900 dark:hover:text-purple-300 p-2 hover:bg-purple-50 dark:hover:bg-purple-900/30 rounded transition-colors",title:"Duplicate",children:n.jsx(uu,{})})]})})]},re.name)})})]})}),d>bc&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:[p*bc+1,"",Math.min((p+1)*bc,d)," of ",d]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{disabled:p===0,onClick:()=>me(p-1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Prev"}),n.jsx("button",{disabled:(p+1)*bc>=d,onClick:()=>me(p+1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Next"})]})]})]})]})},Ot=({children:e,required:t})=>n.jsxs("label",{className:"block text-[11px] font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),si=({children:e})=>n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800/60 rounded min-h-[34px] flex items-center",children:e||n.jsx("span",{className:"text-gray-400",children:"-"})}),hi="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-blue-400",Td=hi+" text-right",kw="w-full px-2 py-1 text-sm text-right border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-400",dO="w-full px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-blue-400",Gve=({items:e})=>{const[t,r]=y.useState(!1),a=y.useRef(null);return y.useEffect(()=>{const s=i=>{a.current&&!a.current.contains(i.target)&&r(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),n.jsxs("div",{className:"relative",ref:a,children:[n.jsxs("button",{onClick:()=>r(s=>!s),className:"flex items-center gap-1.5 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-sm font-medium shadow-sm",children:["Create",n.jsx(nr,{size:10,className:`transition-transform ${t?"rotate-180":""}`})]}),t&&n.jsxs("div",{className:"absolute right-0 mt-1 w-52 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl shadow-xl z-50 py-1.5 overflow-hidden",children:[n.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold text-gray-400 dark:text-gray-500 uppercase tracking-wider border-b border-gray-100 dark:border-gray-700 mb-1",children:"Create from this order"}),e.map(({label:s,icon:i,onClick:l})=>n.jsxs("button",{onClick:()=>{l(),r(!1)},className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-blue-50 dark:hover:bg-blue-900/20 hover:text-blue-700 dark:hover:text-blue-300 transition-colors text-left",children:[n.jsx("span",{className:"text-gray-400 group-hover:text-blue-500",children:i}),s]},s))]})]})},bo=({title:e,children:t,defaultOpen:r=!1})=>{const[a,s]=y.useState(r);return n.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-600 mt-3 pt-1",children:[n.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"flex items-center gap-2 py-1 text-xs font-semibold text-blue-600 dark:text-blue-400 hover:underline",children:[a?n.jsx(nr,{size:9}):n.jsx(bs,{size:9}),e]}),a&&n.jsx("div",{className:"mt-2",children:t})]})},Kve=({item:e,rowNo:t,onChange:r,onClose:a,onDelete:s,onInsertBelow:i})=>{var l,u,d,f,p,m,x,v,b,w,j,k;return n.jsx("tr",{children:n.jsx("td",{colSpan:8,className:"p-0",children:n.jsxs("div",{className:"border border-blue-300 dark:border-blue-600 rounded-lg mx-2 my-1 bg-white dark:bg-gray-800 shadow-md",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-blue-50 dark:bg-blue-900/30 rounded-t-lg border-b border-blue-200 dark:border-blue-700",children:[n.jsxs("span",{className:"text-sm font-semibold text-blue-700 dark:text-blue-300",children:["Editing Row #",t]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:i,className:"px-2 py-1 text-xs border border-gray-300 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-600",children:"Insert Below"}),n.jsx("button",{onClick:s,className:"px-2 py-1 text-xs border border-red-300 rounded text-red-500 hover:bg-red-50",children:"Delete"}),n.jsx("button",{onClick:a,className:"p-1 text-gray-400 hover:text-gray-600",children:n.jsx(yt,{size:13})})]})]}),n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Item Code"}),n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:e.item_code||"",onChange:C=>r("item_code",C),placeholder:"Select item…"})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Delivery Date"}),n.jsx("input",{type:"date",value:e.delivery_date||"",onChange:C=>r("delivery_date",C.target.value),className:hi})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"flex items-center gap-2 pt-4",children:[n.jsx("input",{type:"checkbox",checked:!!e.ensure_delivery_based_on_produced_serial_no,onChange:C=>r("ensure_delivery_based_on_produced_serial_no",C.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Ensure Delivery Based on Produced Serial No"})]}),n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Item Name"}),n.jsx("input",{value:e.item_name||"",onChange:C=>r("item_name",C.target.value),className:hi,placeholder:"Item name…"})]})]}),n.jsx(bo,{title:"Description",defaultOpen:!!e.description,children:n.jsx("textarea",{rows:2,value:e.description||"",onChange:C=>r("description",C.target.value),className:hi,placeholder:"Description…"})}),n.jsx(bo,{title:"Quantity and Rate",defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Quantity"}),n.jsx("input",{type:"number",min:0,step:"1",value:(l=e.qty)!=null?l:0,onChange:C=>r("qty",parseFloat(C.target.value)||0),className:Td})]}),n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"UOM"}),n.jsx(Be,{label:"UOM",hideLabel:!0,doctype:"UOM",value:e.uom||"",onChange:C=>r("uom",C),placeholder:"UOM…"})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Stock UOM"}),n.jsx(Be,{label:"Stock UOM",hideLabel:!0,doctype:"UOM",value:e.stock_uom||"",onChange:C=>r("stock_uom",C),placeholder:"Stock UOM…"})]}),n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"UOM Conversion Factor"}),n.jsx("input",{type:"number",min:0,step:"0.001",value:(u=e.conversion_factor)!=null?u:1,onChange:C=>r("conversion_factor",parseFloat(C.target.value)||1),className:Td})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Qty as per Stock UOM"}),n.jsx("div",{className:"px-3 py-2 text-sm text-gray-600 bg-gray-50 dark:bg-gray-700 rounded text-right",children:((e.qty||0)*(e.conversion_factor||1)).toFixed(3)})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Price List Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(d=e.price_list_rate)!=null?d:0,onChange:C=>r("price_list_rate",parseFloat(C.target.value)||0),className:Td})]})]})}),n.jsx(bo,{title:"Discount and Margin",children:n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(f=e.rate)!=null?f:0,onChange:C=>r("rate",parseFloat(C.target.value)||0),className:Td})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Rate of Stock UOM"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:((p=e.stock_uom_rate)!=null?p:0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Amount"}),n.jsx("div",{className:"px-3 py-2 text-sm font-semibold text-right bg-gray-50 dark:bg-gray-700 rounded",children:((e.qty||0)*(e.rate||0)).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Item Tax Template"}),n.jsx("input",{value:e.item_tax_template||"",onChange:C=>r("item_tax_template",C.target.value),className:hi,placeholder:"Tax template…"})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Billed Amount"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:((m=e.billed_amt)!=null?m:0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Valuation Rate"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:((x=e.valuation_rate)!=null?x:0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Gross Profit"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:((v=e.gross_profit)!=null?v:0).toFixed(2)})]}),n.jsxs("div",{className:"flex flex-col justify-end gap-2 pb-1",children:[n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:!!e.is_free_item,onChange:C=>r("is_free_item",C.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Is Free Item"})]}),n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:e.grant_commission!==0,onChange:C=>r("grant_commission",C.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Grant Commission"})]})]})]})}),n.jsx(bo,{title:"Drop Ship",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"checkbox",checked:!!e.delivered_by_supplier,onChange:C=>r("delivered_by_supplier",C.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Supplier delivers to Customer"})]}),e.delivered_by_supplier?n.jsxs("div",{children:[n.jsx(Ot,{children:"Supplier"}),n.jsx(Be,{label:"Supplier",hideLabel:!0,doctype:"Supplier",value:e.supplier||"",onChange:C=>r("supplier",C),placeholder:"Select supplier…"})]}):null]})}),n.jsx(bo,{title:"Item Weight Details",children:n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx(Ot,{children:"Weight Per Unit"}),n.jsx("input",{type:"number",min:0,step:"0.001",value:(b=e.weight_per_unit)!=null?b:0,onChange:C=>r("weight_per_unit",parseFloat(C.target.value)||0),className:Td})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Weight UOM"}),n.jsx("input",{value:e.weight_uom||"",onChange:C=>r("weight_uom",C.target.value),className:hi,placeholder:"UOM…"})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Total Weight"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:((w=e.total_weight)!=null?w:0).toFixed(3)})]})]})}),n.jsx(bo,{title:"Warehouse and Reference",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Ot,{children:"Delivery Warehouse"}),n.jsx(Be,{label:"Warehouse",hideLabel:!0,doctype:"Warehouse",value:e.delivery_warehouse||"",onChange:C=>r("delivery_warehouse",C),placeholder:"Warehouse…"})]}),n.jsx("div",{className:"flex items-end pb-2",children:n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:!!e.against_blanket_order,onChange:C=>r("against_blanket_order",C.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Against Blanket Order"})]})})]})}),n.jsx(bo,{title:"Available Quantity",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Ot,{children:"Qty (Warehouse)"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:(j=e.actual_qty)!=null?j:0})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Qty (Company)"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:(k=e.company_total_stock)!=null?k:0})]})]})}),n.jsx(bo,{title:"Manufacturing Section",children:n.jsxs("div",{children:[n.jsx(Ot,{children:"BOM No"}),n.jsx(Be,{label:"BOM",hideLabel:!0,doctype:"BOM",value:e.bom_no||"",onChange:C=>r("bom_no",C),placeholder:"BOM…"})]})})]})]})})})},Yve=({tax:e,rowNo:t,onChange:r,onClose:a,onDelete:s,onInsertBelow:i})=>n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"p-0",children:n.jsxs("div",{className:"border border-blue-300 dark:border-blue-600 rounded-lg mx-2 my-1 bg-white dark:bg-gray-800 shadow-md",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-blue-50 dark:bg-blue-900/30 rounded-t-lg border-b border-blue-200",children:[n.jsxs("span",{className:"text-sm font-semibold text-blue-700 dark:text-blue-300",children:["Editing Row #",t]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:i,className:"px-2 py-1 text-xs border border-gray-300 rounded hover:bg-gray-50 text-gray-600",children:"Insert Below"}),n.jsx("button",{onClick:s,className:"px-2 py-1 text-xs border border-red-300 rounded text-red-500 hover:bg-red-50",children:"Delete"}),n.jsx("button",{onClick:a,className:"p-1 text-gray-400 hover:text-gray-600",children:n.jsx(yt,{size:13})})]})]}),n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Type"}),n.jsxs("select",{value:e.charge_type||"",onChange:l=>r("charge_type",l.target.value),className:hi,children:[n.jsx("option",{value:"",children:"Select type…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"}),n.jsx("option",{value:"On Previous Row Total",children:"On Previous Row Total"}),n.jsx("option",{value:"On Item Quantity",children:"On Item Quantity"}),n.jsx("option",{value:"Inter Company Transaction",children:"Inter Company Transaction"})]})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Description"}),n.jsx("textarea",{rows:3,value:e.description||"",onChange:l=>r("description",l.target.value),className:hi,placeholder:"Description…"})]})]}),n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Account Head"}),n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:e.account_head||"",onChange:l=>r("account_head",l),placeholder:"Account…"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"checkbox",checked:!!e.included_in_print_rate,onChange:l=>r("included_in_print_rate",l.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Is this Tax included in Basic Rate?"})]}),n.jsx("p",{className:"text-xs text-blue-500 dark:text-blue-400",children:"If checked, the tax amount will be considered as already included in the Print Rate / Print Amount"}),n.jsx(bo,{title:"Accounting Dimensions",defaultOpen:!0,children:n.jsxs("div",{children:[n.jsx(Ot,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:l=>r("cost_center",l),placeholder:"Cost center…"})]})}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Tax Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:mi(e),onChange:l=>r("tax_rate",parseFloat(l.target.value)||0),className:Td})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Account Currency"}),n.jsx("input",{value:e.account_currency||xt,onChange:l=>r("account_currency",l.target.value),className:hi})]})]})]})]})})}),Xve=()=>({item_code:"",item_name:"",qty:1,rate:0,amount:0,uom:"",conversion_factor:1,is_free_item:0,grant_commission:0}),Jve=()=>({charge_type:"",account_head:"",tax_rate:0,account_currency:xt,included_in_print_rate:0}),Qve=()=>{var B,je,Ce,ye,Ee,Xe,tt;const{soName:e}=Hn(),[t]=dn(),r=Ut(),a=e==="new",s=t.get("project")||"",i=t.get("customer")||"",l=t.get("company")||fa,u=t.get("project")||"",[d,f]=y.useState(null),[p,m]=y.useState(!a),[x,v]=y.useState(!1),[b,w]=y.useState(!1),[j,k]=y.useState(a),[C,N]=y.useState(null),[O,E]=y.useState(null),A=y.useRef(null),T=new Date().toISOString().split("T")[0],[P,D]=y.useState({customer:i,customer_name:i,company:l,project:s,transaction_date:T,currency:xt,order_type:"Sales",taxes_and_charges:i0,items:[],taxes:[]}),z=y.useCallback(ve=>{D({customer:ve.customer||"",customer_name:ve.customer_name||ve.customer||"",company:ve.company||fa,project:ve.project||u||"",transaction_date:ve.transaction_date||T,currency:ve.currency==="INR"?xt:ve.currency||xt,order_type:ve.order_type||"Sales",cost_center:ve.cost_center||"",selling_price_list:ve.selling_price_list||"",price_list_currency:ve.price_list_currency||"",conversion_rate:ve.conversion_rate||1,plc_conversion_rate:ve.plc_conversion_rate||1,tax_category:ve.tax_category||"",taxes_and_charges:ve.taxes_and_charges||"",items:ve.items||[],taxes:ve.taxes||[]}),N(null),E(null)},[u,T]);y.useEffect(()=>{a||(m(!0),cs.getSalesOrder(e).then(ve=>{f(ve),z(ve)}).catch(ve=>$e.error(Ya(ve))).finally(()=>m(!1)))},[e,a,z]);const[G,V]=y.useState(!1);y.useEffect(()=>{u&&D(ve=>Se(ee({},ve),{project:ve.project||u}))},[u]),y.useEffect(()=>{!u||a||!d||G||d.docstatus!==0||String(d.project||"").trim()||(V(!0),cs.updateSalesOrder(e,{project:u}).then(Oe=>{f(Oe),z(Oe)}).catch(Oe=>$e.error(Ya(Oe))))},[d,G,u,a,e,z]),y.useEffect(()=>{const ve=P.company;!a||!ve||fetch(`/api/resource/Company/${encodeURIComponent(ve)}`,{credentials:"include"}).then(Oe=>Oe.json()).then(Oe=>{var st;if((st=Oe.data)!=null&&st.default_currency){const ct=Va(Oe.data.default_currency);D(ot=>Se(ee({},ot),{currency:ct,selling_price_list:ot.selling_price_list||"Standard Selling",price_list_currency:ot.price_list_currency||ct}))}}).catch(()=>{})},[P.company,a]);const ne=(ve,Oe)=>D(st=>Se(ee({},st),{[ve]:Oe})),ge=y.useCallback(()=>{const ve=P.project;if(ve&&String(ve).trim()){r(`/projects/list/${encodeURIComponent(String(ve))}`);return}const Oe=new URLSearchParams;!a&&e&&Oe.set("source_so",String(e)),P.customer&&Oe.set("customer",String(P.customer)),P.company&&Oe.set("company",String(P.company)),r(`/projects/list/new?${Oe.toString()}`)},[P,a,r,e]),Z=(ve,Oe,st)=>D(ct=>{const ot=[...ct.items||[]],Ze=Se(ee({},ot[ve]),{[Oe]:st});if(Oe==="qty"||Oe==="rate"){const St=parseFloat(String(Oe==="qty"?st:Ze.qty))||0,Ir=parseFloat(String(Oe==="rate"?st:Ze.rate))||0;Ze.amount=parseFloat((St*Ir).toFixed(4))}return ot[ve]=Ze,Se(ee({},ct),{items:ot})}),U=(ve,Oe)=>fe(null,null,function*(){if(Z(ve,"item_code",Oe),!!Oe)try{const ot=(yield(yield fetch(`/api/resource/Item/${encodeURIComponent(Oe)}`,{credentials:"include"})).json()).data;if(!ot)return;D(Ze=>{var Ir;const St=[...Ze.items||[]];return St[ve]=Se(ee({},St[ve]),{item_code:Oe,item_name:ot.item_name||Oe,description:ot.description||ot.item_name||Oe,stock_uom:ot.stock_uom||"",uom:ot.sales_uom||ot.stock_uom||"",price_list_rate:(Ir=ot.standard_rate)!=null?Ir:0,rate:St[ve].rate||ot.standard_rate||0}),Se(ee({},Ze),{items:St})})}catch(st){}}),ce=ve=>{D(Oe=>{const st=[...Oe.items||[]],ct=Xve();let ot;return ve!==void 0?(st.splice(ve+1,0,ct),ot=ve+1):(st.push(ct),ot=st.length-1),setTimeout(()=>N(ot),0),Se(ee({},Oe),{items:st})})},xe=ve=>{D(Oe=>{const st=[...Oe.items||[]];return st.splice(ve,1),Se(ee({},Oe),{items:st})}),N(null)},be=(ve,Oe,st)=>D(ct=>{const ot=[...ct.taxes||[]];return ot[ve]=Se(ee({},ot[ve]),{[Oe]:st}),Se(ee({},ct),{taxes:ot})}),me=ve=>{D(Oe=>{const st=[...Oe.taxes||[]],ct=Jve();let ot;return ve!==void 0?(st.splice(ve+1,0,ct),ot=ve+1):(st.push(ct),ot=st.length-1),setTimeout(()=>E(ot),0),Se(ee({},Oe),{taxes:st})})},oe=ve=>{D(Oe=>{const st=[...Oe.taxes||[]];return st.splice(ve,1),Se(ee({},Oe),{taxes:st})}),E(null)},L=(P.items||[]).reduce((ve,Oe)=>ve+(Oe.qty||0)*(Oe.rate||0),0),K=((ve,Oe)=>{let st=Oe;return ve.map(ct=>{const ot=mi(ct);let Ze=0;return ct.charge_type==="On Net Total"?Ze=Oe*(ot/100):ct.charge_type==="Actual"?Ze=ct.tax_amount||0:ct.charge_type==="On Previous Row Amount"||ct.charge_type==="On Previous Row Total"?Ze=st*(ot/100):Ze=Oe*(ot/100),st+=Ze,Se(ee({},ct),{_computed_amt:Ze,_computed_total:st})})})(P.taxes||[],L),Y=K.reduce((ve,Oe)=>ve+Oe._computed_amt,0),re=L+Y,de=ve=>fe(null,null,function*(){var Oe;if(ve)try{const ot=(yield(yield fetch(`/api/resource/Sales Taxes and Charges Template/${encodeURIComponent(ve)}`,{credentials:"include"})).json()).data;(Oe=ot==null?void 0:ot.taxes)!=null&&Oe.length&&D(Ze=>Se(ee({},Ze),{taxes:ot.taxes.map(St=>{var Ir,Xr,jr;return{charge_type:St.charge_type,account_head:St.account_head,description:St.description,tax_rate:(Xr=(Ir=St.rate)!=null?Ir:St.tax_rate)!=null?Xr:0,cost_center:St.cost_center,account_currency:St.account_currency,included_in_print_rate:(jr=St.included_in_print_rate)!=null?jr:0}})}))}catch(st){}});y.useEffect(()=>{a&&de(i0)},[a]);const ie=()=>({customer:P.customer,company:P.company||void 0,project:P.project||void 0,cost_center:P.cost_center||void 0,transaction_date:P.transaction_date,currency:P.currency||void 0,order_type:P.order_type||"Sales",selling_price_list:P.selling_price_list||"Standard Selling",price_list_currency:P.price_list_currency||P.currency||void 0,conversion_rate:P.conversion_rate||1,plc_conversion_rate:P.plc_conversion_rate||1,tax_category:P.tax_category||void 0,taxes_and_charges:P.taxes_and_charges||void 0,items:(P.items||[]).filter(ve=>ve.item_code).map((ve,Oe)=>{var st,ct,ot,Ze,St,Ir,Xr,jr,ea;return{item_code:ve.item_code,item_name:ve.item_name||ve.item_code,description:ve.description||ve.item_name||ve.item_code,qty:(st=ve.qty)!=null?st:1,uom:ve.uom||void 0,stock_uom:ve.stock_uom||void 0,conversion_factor:(ct=ve.conversion_factor)!=null?ct:1,rate:(ot=ve.rate)!=null?ot:0,amount:(ve.qty||0)*(ve.rate||0),price_list_rate:(Ze=ve.price_list_rate)!=null?Ze:0,delivery_date:ve.delivery_date||void 0,item_tax_template:ve.item_tax_template||void 0,is_free_item:(St=ve.is_free_item)!=null?St:0,grant_commission:(Ir=ve.grant_commission)!=null?Ir:0,delivered_by_supplier:(Xr=ve.delivered_by_supplier)!=null?Xr:0,supplier:ve.supplier||void 0,weight_per_unit:ve.weight_per_unit||void 0,weight_uom:ve.weight_uom||void 0,delivery_warehouse:ve.delivery_warehouse||void 0,against_blanket_order:(jr=ve.against_blanket_order)!=null?jr:0,ensure_delivery_based_on_produced_serial_no:(ea=ve.ensure_delivery_based_on_produced_serial_no)!=null?ea:0,bom_no:ve.bom_no||void 0,project:P.project||void 0,cost_center:P.cost_center||void 0,idx:Oe+1}}),taxes:(P.taxes||[]).filter(ve=>ve.charge_type).map((ve,Oe)=>{var st;return{charge_type:ve.charge_type,account_head:ve.account_head||void 0,description:ve.description||void 0,included_in_print_rate:(st=ve.included_in_print_rate)!=null?st:0,cost_center:ve.cost_center||void 0,rate:mi(ve),account_currency:ve.account_currency||xt,idx:Oe+1}})}),se=()=>fe(null,null,function*(){if(!P.customer){$e.error("Customer is required");return}try{if(v(!0),a){const ve=yield cs.createSalesOrder(ie());$e.success("Sales Order created"),k(!1),r(`/sales-orders/${ve.name}`)}else{const ve=yield cs.updateSalesOrder(e,ie());f(ve),z(ve),$e.success("Sales Order saved"),k(!1)}}catch(ve){$e.error(Ya(ve)||"Error saving")}finally{v(!1)}}),he=()=>fe(null,null,function*(){if(!(!e||a))try{w(!0);const ve=yield cs.submitSalesOrder(e);f(ve),z(ve),$e.success("Sales Order submitted")}catch(ve){$e.error(Ya(ve)||"Error submitting")}finally{w(!1)}}),_e=()=>{const ve=new URLSearchParams;return P.customer&&ve.set("customer",P.customer),P.company&&ve.set("company",String(P.company||"")),P.project&&ve.set("project",String(P.project||"")),ve},F=()=>{const ve=_e();ve.set("so",e),r(`/delivery-notes/new?${ve.toString()}`)},X=()=>{const ve=_e();ve.set("so",e),r(`/invoices/new?${ve.toString()}`)},R=()=>{const ve=new URLSearchParams;P.project&&ve.set("project",String(P.project)),P.company&&ve.set("company",String(P.company||"")),r(`/material-requests/new?${ve.toString()}`)},I=a||j,te=!a&&(d==null?void 0:d.docstatus)===1,q=a?"New Sales Order":P.customer_name||e||"";return p?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-blue-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-6 text-gray-500",children:[n.jsx("button",{type:"button",onClick:()=>r("/projects"),className:"hover:text-blue-600",children:"Project Management"}),n.jsx("span",{children:"/"}),n.jsx("button",{type:"button",onClick:()=>r("/sales-orders"),className:"hover:text-blue-600",children:"Sales Orders"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:a?"New Sales Order":e})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 dark:border-gray-700 flex items-center justify-between gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>r("/sales-orders"),className:"text-gray-400 hover:text-gray-700",children:n.jsx(da,{})}),n.jsx(Ld,{className:"text-blue-500"}),n.jsx("div",{children:n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:q}),!a&&e&&n.jsx("span",{className:"text-xs text-gray-400 font-mono",children:e}),!a&&n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${(()=>{const ve=(d==null?void 0:d.status)||"";return(d==null?void 0:d.docstatus)===2||ve==="Cancelled"?"bg-red-100 text-red-700":!d||d.docstatus===0?"bg-yellow-100 text-yellow-800":ve==="Completed"?"bg-green-100 text-green-800":ve==="To Deliver and Bill"||ve==="To Bill"||ve==="To Deliver"?"bg-blue-100 text-blue-800":ve==="On Hold"?"bg-orange-100 text-orange-800":ve==="Closed"?"bg-gray-100 text-gray-700":"bg-green-100 text-green-800"})()}`,children:(d==null?void 0:d.docstatus)===2?"Cancelled":(d==null?void 0:d.docstatus)===0?"Draft":(d==null?void 0:d.status)||"Submitted"}),P.project&&n.jsx("button",{type:"button",onClick:()=>r(`/projects/list/${encodeURIComponent(String(P.project))}`),className:"text-xs text-blue-700 dark:text-blue-400 border border-blue-200 dark:border-blue-700 rounded-full px-2.5 py-0.5 hover:underline",children:P.project})]})})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsxs("button",{type:"button",onClick:ge,title:P.project?"Open linked project":"Link a project (scrolls to Project field)",className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-sm font-medium shadow-sm",children:[n.jsx(Pt,{size:10}),n.jsx(Id,{size:13}),"Project"]}),te&&n.jsx(Gve,{items:[{label:"Delivery Note",icon:n.jsx(Yx,{size:13}),onClick:F},{label:"Sales Invoice",icon:n.jsx(Kc,{size:13}),onClick:X},{label:"Material Request",icon:n.jsx(zd,{size:13}),onClick:R}]}),!a&&!j&&(d==null?void 0:d.docstatus)===0&&n.jsxs("button",{onClick:he,disabled:b,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 text-sm font-medium",children:[b?n.jsx(vt,{className:"animate-spin"}):n.jsx(cu,{size:12})," Submit"]}),!a&&!j&&!te&&n.jsxs("button",{type:"button",onClick:()=>k(!0),className:"flex items-center gap-2 px-4 py-2 border border-blue-500 text-blue-600 rounded-lg hover:bg-blue-50 text-sm",children:[n.jsx(ha,{})," Edit"]}),I&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{type:"button",onClick:se,disabled:x,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 text-sm font-medium",children:[x?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),x?"Saving…":"Save"]}),!a&&n.jsx("button",{onClick:()=>{d&&z(d),k(!1)},className:"px-3 py-2 border border-gray-300 rounded-lg text-gray-600 text-sm",children:n.jsx(yt,{})})]})]})]}),n.jsx("div",{className:"px-6 pt-5 pb-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Customer"}),I?n.jsx(Be,{label:"Customer",hideLabel:!0,doctype:"Customer",value:P.customer||"",onChange:ve=>{ne("customer",ve),ne("customer_name",ve)},placeholder:"Select customer…"}):n.jsx(si,{children:P.customer})]}),n.jsxs("div",{children:[n.jsx(Ot,{required:!0,children:"Transaction Date"}),I?n.jsx("input",{type:"date",value:P.transaction_date||"",onChange:ve=>ne("transaction_date",ve.target.value),className:hi}):n.jsx(si,{children:P.transaction_date})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Company"}),I?n.jsx(Be,{label:"Company",hideLabel:!0,doctype:"Company",value:P.company||"",onChange:ve=>ne("company",ve),placeholder:"Select company…"}):n.jsx(si,{children:P.company})]}),n.jsxs("div",{ref:A,className:"scroll-mt-28",children:[n.jsx(Ot,{children:"Project"}),n.jsx(si,{children:P.project?n.jsx("button",{type:"button",onClick:()=>r(`/projects/list/${encodeURIComponent(String(P.project))}`),className:"text-blue-700 hover:underline font-medium",title:"Open project",children:P.project}):n.jsx("button",{type:"button",onClick:ge,className:"text-blue-700 hover:underline font-medium",title:"Create / link a project",children:"—"})})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Currency"}),I?n.jsxs("select",{value:P.currency||xt,onChange:ve=>ne("currency",ve.target.value),className:hi,children:[n.jsx("option",{value:"SAR",children:"SAR"}),n.jsx("option",{value:"USD",children:"USD"}),n.jsx("option",{value:"EUR",children:"EUR"})]}):n.jsx(si,{children:P.currency})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Cost Center"}),I?n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:P.cost_center||"",onChange:ve=>ne("cost_center",ve),placeholder:"Cost center…"}):n.jsx(si,{children:P.cost_center})]})]})}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:"px-6 py-3 bg-gray-50 dark:bg-gray-900/20 border-b border-gray-100 dark:border-gray-700",children:n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Items"})}),n.jsxs("div",{className:"px-6 pb-5",children:[n.jsx("div",{className:"overflow-x-auto -mx-2 mt-3",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 min-w-[180px]",children:["Item Code ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-32",children:["Delivery Date ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:["Quantity ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:["Rate (",Va(P.currency),")"]}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:["Amount (",Va(P.currency),")"]}),I&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[(P.items||[]).map((ve,Oe)=>{var st,ct,ot,Ze;return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${C===Oe?"bg-blue-50/60 dark:bg-blue-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:Oe+1}),n.jsx("td",{className:"py-1.5 px-2 min-w-[180px]",children:I?n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:ve.item_code||"",onChange:St=>U(Oe,St),placeholder:"Item Code"}):n.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-200",children:ve.item_code||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-32",children:I?n.jsx("input",{type:"date",value:ve.delivery_date||"",onChange:St=>Z(Oe,"delivery_date",St.target.value),className:dO}):n.jsx("span",{className:"text-gray-500 text-sm",children:ve.delivery_date||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:I?n.jsx("input",{type:"number",min:0,step:"1",value:(st=ve.qty)!=null?st:0,onChange:St=>Z(Oe,"qty",parseFloat(St.target.value)||0),className:kw}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 text-sm pr-1",children:(ct=ve.qty)!=null?ct:0})}),n.jsx("td",{className:"py-1.5 px-2 w-28",children:I?n.jsx("input",{type:"number",min:0,step:"0.01",value:(ot=ve.rate)!=null?ot:0,onChange:St=>Z(Oe,"rate",parseFloat(St.target.value)||0),className:kw}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 text-sm pr-1",children:((Ze=ve.rate)!=null?Ze:0).toFixed(2)})}),n.jsx("td",{className:"py-1.5 px-3 text-right font-semibold text-gray-900 dark:text-white text-sm",children:((ve.qty||0)*(ve.rate||0)).toFixed(2)}),I&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>N(C===Oe?null:Oe),className:`p-1.5 rounded text-xs ${C===Oe?"bg-blue-600 text-white":"text-blue-600 hover:bg-blue-50"}`,title:"More fields",children:n.jsx(Vs,{size:11})}),n.jsx("button",{onClick:()=>xe(Oe),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:n.jsx(Za,{size:11})})]})})]}),I&&C===Oe&&n.jsx(Kve,{item:ve,rowNo:Oe+1,onChange:(St,Ir)=>{St==="item_code"?U(Oe,Ir):Z(Oe,St,Ir)},onClose:()=>N(null),onDelete:()=>xe(Oe),onInsertBelow:()=>ce(Oe)})]},Oe)}),I&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{type:"button",onClick:()=>ce(),className:"flex items-center gap-1.5 text-blue-600 hover:text-blue-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})}),n.jsxs("div",{className:"mt-3 flex justify-between text-sm border-t border-gray-100 dark:border-gray-700 pt-3",children:[n.jsxs("span",{className:"text-gray-500",children:["Total Qty: ",n.jsx("strong",{children:(P.items||[]).reduce((ve,Oe)=>ve+(Oe.qty||0),0)})]}),n.jsxs("span",{className:"text-gray-500",children:["Total: ",n.jsxs("strong",{className:"text-gray-900 dark:text-white",children:[Va(P.currency)," ",L.toFixed(2)]})]})]})]})]}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:"px-6 py-3 bg-gray-50 dark:bg-gray-900/20 border-b border-gray-100 dark:border-gray-700",children:n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Taxes"})}),n.jsxs("div",{className:"px-6 pt-4 pb-2 grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-3",children:[n.jsxs("div",{children:[n.jsx(Ot,{children:"Tax Category"}),I?n.jsx(Be,{label:"Tax Category",hideLabel:!0,doctype:"Tax Category",value:P.tax_category||"",onChange:ve=>ne("tax_category",ve),placeholder:"Select tax category…"}):n.jsx(si,{children:P.tax_category})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Sales Taxes and Charges Template"}),I?n.jsx(Be,{label:"Sales Taxes and Charges Template",hideLabel:!0,doctype:"Sales Taxes and Charges Template",value:P.taxes_and_charges||"",onChange:ve=>{ne("taxes_and_charges",ve),de(ve)},placeholder:"Select template…"}):n.jsx(si,{children:P.taxes_and_charges})]})]}),n.jsxs("div",{className:"px-6 pb-5",children:[n.jsx("div",{className:"overflow-x-auto -mx-2 mt-3",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-44",children:["Type ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3",children:["Account Head ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:"Tax Rate"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Amount"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Total"}),I&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[K.map((ve,Oe)=>{var st,ct;return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${O===Oe?"bg-blue-50/60 dark:bg-blue-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:Oe+1}),n.jsx("td",{className:"py-1.5 px-2 w-44",children:I?n.jsxs("select",{value:ve.charge_type||"",onChange:ot=>be(Oe,"charge_type",ot.target.value),className:dO,children:[n.jsx("option",{value:"",children:"Select type…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"}),n.jsx("option",{value:"On Previous Row Total",children:"On Previous Row Total"}),n.jsx("option",{value:"On Item Quantity",children:"On Item Quantity"}),n.jsx("option",{value:"Inter Company Transaction",children:"Inter Company Transaction"})]}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:ve.charge_type||"-"})}),n.jsx("td",{className:"py-1.5 px-2",children:I?n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:ve.account_head||"",onChange:ot=>be(Oe,"account_head",ot),placeholder:"Account Head"}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:ve.account_head||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:I?n.jsx("input",{type:"number",min:0,step:"0.01",value:mi(ve),onChange:ot=>be(Oe,"tax_rate",parseFloat(ot.target.value)||0),className:kw}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 pr-1",children:mi(ve)})}),n.jsx("td",{className:"py-1.5 px-3 text-right text-gray-700 dark:text-gray-300 text-sm",children:((st=ve._computed_amt)!=null?st:0).toFixed(2)}),n.jsx("td",{className:"py-1.5 px-3 text-right font-semibold text-gray-900 dark:text-white text-sm",children:((ct=ve._computed_total)!=null?ct:0).toFixed(2)}),I&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>E(O===Oe?null:Oe),className:`p-1.5 rounded text-xs ${O===Oe?"bg-blue-600 text-white":"text-blue-600 hover:bg-blue-50"}`,title:"More fields",children:n.jsx(Vs,{size:11})}),n.jsx("button",{onClick:()=>oe(Oe),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:n.jsx(Za,{size:11})})]})})]}),I&&O===Oe&&n.jsx(Yve,{tax:ve,rowNo:Oe+1,onChange:(ot,Ze)=>be(Oe,ot,Ze),onClose:()=>E(null),onDelete:()=>oe(Oe),onInsertBelow:()=>me(Oe)})]},Oe)}),I&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{type:"button",onClick:()=>me(),className:"flex items-center gap-1.5 text-blue-600 hover:text-blue-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})}),(P.taxes||[]).length>0&&n.jsxs("div",{className:"mt-2 flex justify-end text-sm text-gray-500 pt-2 border-t border-gray-100 dark:border-gray-700",children:["Total Taxes and Charges:"," ",n.jsxs("strong",{className:"ml-2 text-gray-900 dark:text-white",children:[Va(P.currency)," ",((B=d==null?void 0:d.total_taxes_and_charges)!=null?B:Y).toFixed(2)]})]})]})]}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700 px-6 py-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-3",children:"Totals"}),n.jsx("div",{className:"space-y-2 max-w-xs ml-auto",children:[{label:"Net Total",value:((je=d==null?void 0:d.net_total)!=null?je:L).toFixed(2)},{label:"Total Taxes",value:((Ce=d==null?void 0:d.total_taxes_and_charges)!=null?Ce:Y).toFixed(2)},{label:"Grand Total",value:((ye=d==null?void 0:d.grand_total)!=null?ye:re).toFixed(2)},{label:"Rounding Adjustment",value:((Ee=d==null?void 0:d.rounding_adjustment)!=null?Ee:0).toFixed(2)},{label:"Rounded Total",value:((Xe=d==null?void 0:d.rounded_total)!=null?Xe:re).toFixed(2)},{label:"Advance Paid",value:((tt=d==null?void 0:d.advance_paid)!=null?tt:0).toFixed(2)}].map(({label:ve,value:Oe})=>n.jsxs("div",{className:"flex justify-between text-sm border-b border-gray-100 dark:border-gray-700 pb-1.5 last:border-0",children:[n.jsx("span",{className:"text-gray-500",children:ve}),n.jsxs("span",{className:"font-semibold text-gray-900 dark:text-white",children:[Va(P.currency)," ",Oe]})]},ve))})]}),!a&&d&&n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700 px-6 py-4 grid grid-cols-3 gap-4 text-sm bg-gray-50 dark:bg-gray-900/20",children:[n.jsxs("div",{children:[n.jsx(Ot,{children:"Created By"}),n.jsx(si,{children:d.owner})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Created"}),n.jsx(si,{children:d.creation?new Date(d.creation).toLocaleString():"-"})]}),n.jsxs("div",{children:[n.jsx(Ot,{children:"Modified"}),n.jsx(si,{children:d.modified?new Date(d.modified).toLocaleString():"-"})]})]}),!a&&n.jsx(Yn,{doctype:"Sales Order",docname:(d==null?void 0:d.name)||e||"",creationDate:d==null?void 0:d.creation,createdBy:d==null?void 0:d.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})},wc=20;function Zve(e){return e.docstatus===2?"bg-red-100 text-red-700":e.docstatus===1?e.status==="Completed"?"bg-green-100 text-green-700":e.status==="Stopped"?"bg-red-100 text-red-700":"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-800"}function e1e(e){return e.docstatus===2?"Cancelled":e.docstatus===1?e.status||"Submitted":"Draft"}function fO(e){const t=[];return e.search&&t.push(["Purchase Order","name","like",`%${e.search}%`]),e.status==="Draft"&&t.push(["Purchase Order","docstatus","=",0]),e.status==="Submitted"&&t.push(["Purchase Order","docstatus","=",1]),e.status==="Cancelled"&&t.push(["Purchase Order","docstatus","=",2]),e.status==="Completed"&&t.push(["Purchase Order","status","=","Completed"]),t}const t1e=()=>{const{t:e}=sr(),t=Ut(),[r,a]=y.useState([]),[s,i]=y.useState(!0),[l,u]=y.useState(0),[d,f]=y.useState(0),[p,m]=y.useState(!1),[x,v]=y.useState(""),[b,w]=y.useState(""),[j,k]=y.useState({search:"",status:""}),[C,N]=y.useState(!1),O=y.useCallback((U,ce)=>fe(null,null,function*(){i(!0);try{const xe=fO(ce),[be,me]=yield Promise.all([Mc.getPurchaseOrders({filters:xe,limit_start:U,limit_page_length:wc}),Mc.getPurchaseOrderCount(xe)]);a(be),u(me)}catch(xe){$e.error(xe.message||"Failed to load")}finally{i(!1)}}),[]);y.useEffect(()=>{O(0,j)},[O,j]);const E=y.useMemo(()=>`${d}|${j.search}|${j.status}`,[d,j.search,j.status]),{selectedRows:A,toggleRow:T,toggleAllOnPage:P,allOnPageSelected:D,someOnPageSelected:z}=Vn(r,E),G=()=>{k({search:x,status:b}),f(0)},V=()=>{v(""),w(""),k({search:"",status:""}),f(0)},ne=!!(j.search||j.status),ge=U=>{f(U),O(U*wc,j)},Z=y.useCallback(()=>Kn({doctype:"Purchase Order",filters:fO(j),orderBy:"modified desc"}),[j]);return n.jsxs("div",{className:"p-6",children:[n.jsx(Br,{position:"top-right",autoClose:3e3}),n.jsxs("div",{className:"flex items-center justify-between mb-6 gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-500 flex items-center justify-center",children:n.jsx(r_,{className:"text-white text-base"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Purchase Orders"}),n.jsxs("p",{className:"text-xs text-gray-500",children:[l," total"]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("button",{onClick:()=>O(d*wc,j),className:"p-2 text-gray-500 hover:text-amber-600 border border-gray-200 rounded-lg",children:n.jsx(en,{size:13})}),n.jsxs("button",{type:"button",onClick:()=>N(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:l===0&&A.size===0,children:[n.jsx(hn,{})," ",e("listPages.export"),A.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:A.size})]}),n.jsxs("button",{onClick:()=>t("/purchase-orders/new"),className:"flex items-center gap-2 px-4 py-2 bg-amber-500 text-white rounded-lg hover:bg-amber-600 text-sm font-medium",children:[n.jsx(Pt,{size:11})," New Purchase Order"]})]})]}),n.jsx(Gn,{isOpen:C,onClose:()=>N(!1),doctype:"Purchase Order",selectedCount:A.size,pageCount:r.length,totalCount:l,pageData:r,selectedRows:A,rowKey:"name",onFetchAll:Z,fileNamePrefix:"purchase_orders"}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl mb-5 overflow-hidden",children:[n.jsxs("button",{onClick:()=>m(U=>!U),className:"w-full flex items-center justify-between px-4 py-3 bg-gradient-to-r from-indigo-600 to-indigo-700 text-white",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[n.jsx(fn,{size:12})," Filters",ne&&n.jsx("span",{className:"bg-white/30 text-white text-xs px-2 py-0.5 rounded-full",children:"Active"})]}),p?n.jsx(ps,{size:11}):n.jsx(nr,{size:11})]}),ne&&n.jsxs("div",{className:"px-4 py-2 bg-indigo-50 dark:bg-indigo-900/20 flex flex-wrap gap-2 items-center border-b border-indigo-100 dark:border-indigo-800",children:[j.search&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300 px-2 py-1 rounded-full",children:["ID: ",j.search,n.jsx("button",{onClick:()=>{v(""),k(U=>Se(ee({},U),{search:""}))},children:n.jsx(yt,{size:9})})]}),j.status&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-indigo-100 dark:bg-indigo-800 text-indigo-700 dark:text-indigo-300 px-2 py-1 rounded-full",children:["Status: ",j.status,n.jsx("button",{onClick:()=>{w(""),k(U=>Se(ee({},U),{status:""}))},children:n.jsx(yt,{size:9})})]}),n.jsx("button",{onClick:V,className:"text-xs text-indigo-600 hover:underline ml-auto",children:"Clear All"})]}),p&&n.jsxs("div",{className:"px-4 py-3 grid grid-cols-1 sm:grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Order ID"}),n.jsx("input",{value:x,onChange:U=>v(U.target.value),onKeyDown:U=>U.key==="Enter"&&G(),placeholder:"Search…",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-400"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Status"}),n.jsxs("select",{value:b,onChange:U=>w(U.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-400",children:[n.jsx("option",{value:"",children:"All"}),n.jsx("option",{value:"Draft",children:"Draft"}),n.jsx("option",{value:"Submitted",children:"Submitted"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"}),n.jsx("option",{value:"Completed",children:"Completed"})]})]}),n.jsxs("div",{className:"flex items-end gap-2",children:[n.jsx("button",{onClick:G,className:"px-4 py-2 bg-indigo-600 text-white text-sm rounded hover:bg-indigo-700",children:"Apply"}),n.jsx("button",{onClick:V,className:"px-4 py-2 border border-gray-300 text-gray-600 text-sm rounded hover:bg-gray-50",children:"Clear"})]})]})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"w-10 px-2 py-3",children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-amber-600 focus:ring-amber-500",checked:D,ref:U=>{U&&(U.indeterminate=z)},onChange:P,"aria-label":"Select all on page"})}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"PO ID"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Supplier"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Transaction Date"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Schedule Date"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Status"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Grand Total"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Company"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:s?n.jsx("tr",{children:n.jsx("td",{colSpan:8,className:"text-center py-10 text-gray-400",children:"Loading…"})}):r.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:8,className:"text-center py-10 text-gray-400",children:"No purchase orders found"})}):r.map(U=>{var ce;return n.jsxs("tr",{onClick:()=>t(`/purchase-orders/${U.name}`),className:`cursor-pointer hover:bg-amber-50 dark:hover:bg-amber-900/10 transition-colors ${A.has(U.name)?"bg-amber-50/90 dark:bg-amber-900/20":""}`,children:[n.jsx("td",{className:"w-10 px-2 py-3",onClick:xe=>xe.stopPropagation(),children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-amber-600 focus:ring-amber-500",checked:A.has(U.name),onChange:()=>T(U.name),"aria-label":`Select ${U.name}`})}),n.jsx("td",{className:"py-3 px-4 font-medium text-amber-600",children:U.name}),n.jsx("td",{className:"py-3 px-4 text-gray-700 dark:text-gray-300",children:U.supplier_name||U.supplier||"-"}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:U.transaction_date||"-"}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:U.schedule_date||"-"}),n.jsx("td",{className:"py-3 px-4",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${Zve(U)}`,children:e1e(U)})}),n.jsx("td",{className:"py-3 px-4 text-right font-semibold text-gray-900 dark:text-white",children:((ce=U.grand_total)!=null?ce:0).toFixed(2)}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:U.company||"-"})]},U.name)})})]})}),l>wc&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:[d*wc+1,"",Math.min((d+1)*wc,l)," of ",l]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{disabled:d===0,onClick:()=>ge(d-1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Prev"}),n.jsx("button",{disabled:(d+1)*wc>=l,onClick:()=>ge(d+1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Next"})]})]})]})]})},Rt=({children:e,required:t})=>n.jsxs("label",{className:"block text-[11px] font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),Ln=({children:e})=>n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800/60 rounded min-h-[34px] flex items-center",children:e||n.jsx("span",{className:"text-gray-400",children:"-"})}),qi="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-amber-400",Ed=qi+" text-right",Sw="w-full px-2 py-1 text-sm text-right border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-amber-400",hO="w-full px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-amber-400",r1e=({items:e})=>{const[t,r]=y.useState(!1),a=y.useRef(null);return y.useEffect(()=>{const s=i=>{a.current&&!a.current.contains(i.target)&&r(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),n.jsxs("div",{className:"relative",ref:a,children:[n.jsxs("button",{onClick:()=>r(s=>!s),className:"flex items-center gap-1.5 px-4 py-2 bg-amber-500 text-white rounded-lg hover:bg-amber-600 text-sm font-medium shadow-sm",children:["Create",n.jsx(nr,{size:10,className:`transition-transform ${t?"rotate-180":""}`})]}),t&&n.jsxs("div",{className:"absolute right-0 mt-1 w-52 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl shadow-xl z-50 py-1.5 overflow-hidden",children:[n.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold text-gray-400 dark:text-gray-500 uppercase tracking-wider border-b border-gray-100 dark:border-gray-700 mb-1",children:"Create from this order"}),e.map(({label:s,icon:i,onClick:l})=>n.jsxs("button",{onClick:()=>{l(),r(!1)},className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-amber-50 dark:hover:bg-amber-900/20 hover:text-amber-700 dark:hover:text-amber-300 transition-colors text-left",children:[n.jsx("span",{className:"text-gray-400",children:i}),s]},s))]})]})},wo=({title:e,children:t,defaultOpen:r=!1})=>{const[a,s]=y.useState(r);return n.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-600 mt-3 pt-1",children:[n.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"flex items-center gap-2 py-1 text-xs font-semibold text-amber-600 dark:text-amber-400 hover:underline",children:[a?n.jsx(nr,{size:9}):n.jsx(bs,{size:9}),e]}),a&&n.jsx("div",{className:"mt-2",children:t})]})},a1e=({item:e,rowNo:t,onChange:r,onClose:a,onDelete:s,onInsertBelow:i})=>{var l,u,d,f,p,m,x,v;return n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"p-0",children:n.jsxs("div",{className:"border border-amber-300 dark:border-amber-600 rounded-lg mx-2 my-1 bg-white dark:bg-gray-800 shadow-md",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-amber-50 dark:bg-amber-900/30 rounded-t-lg border-b border-amber-200 dark:border-amber-700",children:[n.jsxs("span",{className:"text-sm font-semibold text-amber-700 dark:text-amber-300",children:["Editing Row #",t]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:i,className:"px-2 py-1 text-xs border border-gray-300 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-600",children:"Insert Below"}),n.jsx("button",{onClick:s,className:"px-2 py-1 text-xs border border-red-300 rounded text-red-500 hover:bg-red-50",children:"Delete"}),n.jsx("button",{onClick:a,className:"p-1 text-gray-400 hover:text-gray-600",children:n.jsx(yt,{size:13})})]})]}),n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"Item Code"}),n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:e.item_code||"",onChange:b=>r("item_code",b),placeholder:"Select item…"})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Schedule Date"}),n.jsx("input",{type:"date",value:e.schedule_date||"",onChange:b=>r("schedule_date",b.target.value),className:qi})]})]}),n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"Item Name"}),n.jsx("input",{value:e.item_name||"",onChange:b=>r("item_name",b.target.value),className:qi,placeholder:"Item name…"})]}),n.jsx(wo,{title:"Description",defaultOpen:!!e.description,children:n.jsx("textarea",{rows:2,value:e.description||"",onChange:b=>r("description",b.target.value),className:qi,placeholder:"Description…"})}),n.jsx(wo,{title:"Quantity and Rate",defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"Quantity"}),n.jsx("input",{type:"number",min:0,step:"1",value:(l=e.qty)!=null?l:0,onChange:b=>r("qty",parseFloat(b.target.value)||0),className:Ed})]}),n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"UOM"}),n.jsx(Be,{label:"UOM",hideLabel:!0,doctype:"UOM",value:e.uom||"",onChange:b=>r("uom",b),placeholder:"UOM…"})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Stock UOM"}),n.jsx(Be,{label:"Stock UOM",hideLabel:!0,doctype:"UOM",value:e.stock_uom||"",onChange:b=>r("stock_uom",b),placeholder:"Stock UOM…"})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"UOM Conversion Factor"}),n.jsx("input",{type:"number",min:0,step:"0.001",value:(u=e.conversion_factor)!=null?u:1,onChange:b=>r("conversion_factor",parseFloat(b.target.value)||1),className:Ed})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Stock Qty (auto)"}),n.jsx("div",{className:"px-3 py-2 text-sm text-gray-600 bg-gray-50 dark:bg-gray-700 rounded text-right",children:((e.qty||0)*(e.conversion_factor||1)).toFixed(3)})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Price List Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(d=e.price_list_rate)!=null?d:0,onChange:b=>r("price_list_rate",parseFloat(b.target.value)||0),className:Ed})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Last Purchase Rate"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:((f=e.last_purchase_rate)!=null?f:0).toFixed(2)})]})]})}),n.jsx(wo,{title:"Discount and Margin",children:n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(p=e.rate)!=null?p:0,onChange:b=>r("rate",parseFloat(b.target.value)||0),className:Ed})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Amount (auto)"}),n.jsx("div",{className:"px-3 py-2 text-sm font-semibold text-right bg-gray-50 dark:bg-gray-700 rounded",children:((e.qty||0)*(e.rate||0)).toFixed(2)})]}),n.jsx("div",{className:"flex flex-col justify-end gap-2 pb-1",children:n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:!!e.is_free_item,onChange:b=>r("is_free_item",b.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Is Free Item"})]})})]})}),n.jsx(wo,{title:"Warehouse and Reference",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Rt,{children:"Warehouse"}),n.jsx(Be,{label:"Warehouse",hideLabel:!0,doctype:"Warehouse",value:e.warehouse||"",onChange:b=>r("warehouse",b),placeholder:"Warehouse…"})]}),n.jsx("div",{className:"flex items-end pb-2",children:n.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:!!e.against_blanket_order,onChange:b=>r("against_blanket_order",b.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Against Blanket Order"})]})}),e.material_request&&n.jsxs("div",{children:[n.jsx(Rt,{children:"Material Request"}),n.jsx(Ln,{children:e.material_request})]})]})}),n.jsx(wo,{title:"Available Quantity",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Rt,{children:"Actual Qty (Warehouse)"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:(m=e.actual_qty)!=null?m:0})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Company Total Stock"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:(x=e.company_total_stock)!=null?x:0})]})]})}),n.jsx(wo,{title:"Accounting Details",children:n.jsxs("div",{children:[n.jsx(Rt,{children:"Expense Account"}),n.jsx(Be,{label:"Account",hideLabel:!0,doctype:"Account",value:e.expense_account||"",onChange:b=>r("expense_account",b),placeholder:"Expense account…"})]})}),n.jsx(wo,{title:"Accounting Dimensions",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Rt,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:b=>r("cost_center",b),placeholder:"Cost center…"})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Project"}),n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:e.project||"",onChange:b=>r("project",b),placeholder:"Project…"})]})]})}),n.jsx(wo,{title:"Item Weight Details",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Rt,{children:"Weight Per Unit"}),n.jsx("input",{type:"number",min:0,step:"0.001",value:(v=e.weight_per_unit)!=null?v:0,onChange:b=>r("weight_per_unit",parseFloat(b.target.value)||0),className:Ed})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Total Weight (auto)"}),n.jsx("div",{className:"px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700 rounded",children:((e.qty||0)*(e.weight_per_unit||0)).toFixed(3)})]})]})})]})]})})})},n1e=({tax:e,rowNo:t,onChange:r,onClose:a,onDelete:s,onInsertBelow:i})=>{var l;return n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"p-0",children:n.jsxs("div",{className:"border border-amber-300 dark:border-amber-600 rounded-lg mx-2 my-1 bg-white dark:bg-gray-800 shadow-md",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-amber-50 dark:bg-amber-900/30 rounded-t-lg border-b border-amber-200",children:[n.jsxs("span",{className:"text-sm font-semibold text-amber-700 dark:text-amber-300",children:["Editing Row #",t]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:i,className:"px-2 py-1 text-xs border border-gray-300 rounded hover:bg-gray-50 text-gray-600",children:"Insert Below"}),n.jsx("button",{onClick:s,className:"px-2 py-1 text-xs border border-red-300 rounded text-red-500 hover:bg-red-50",children:"Delete"}),n.jsx("button",{onClick:a,className:"p-1 text-gray-400 hover:text-gray-600",children:n.jsx(yt,{size:13})})]})]}),n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"Type"}),n.jsxs("select",{value:e.charge_type||"",onChange:u=>r("charge_type",u.target.value),className:qi,children:[n.jsx("option",{value:"",children:"Select type…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"})]})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Description"}),n.jsx("textarea",{rows:3,value:e.description||"",onChange:u=>r("description",u.target.value),className:qi,placeholder:"Description…"})]})]}),n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"Account Head"}),n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:e.account_head||"",onChange:u=>r("account_head",u),placeholder:"Account…"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"checkbox",checked:!!e.included_in_print_rate,onChange:u=>r("included_in_print_rate",u.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Is this Tax included in Basic Rate?"})]}),n.jsx("p",{className:"text-xs text-amber-500 dark:text-amber-400",children:"If checked, the tax amount will be considered as already included in the Print Rate / Print Amount"}),n.jsx(wo,{title:"Accounting Dimensions",defaultOpen:!0,children:n.jsxs("div",{children:[n.jsx(Rt,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:u=>r("cost_center",u),placeholder:"Cost center…"})]})}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"Tax Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(l=e.rate)!=null?l:0,onChange:u=>r("rate",parseFloat(u.target.value)||0),className:Ed})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Account Currency"}),n.jsx("input",{value:e.account_currency||xt,onChange:u=>r("account_currency",u.target.value),className:qi})]})]})]})]})})})},s1e=()=>({item_code:"",item_name:"",qty:1,rate:0,amount:0,uom:"",conversion_factor:1,is_free_item:0}),i1e=()=>({charge_type:"",account_head:"",rate:0,account_currency:xt,included_in_print_rate:0}),o1e=()=>{var se,he,_e,F,X;const{poName:e}=Hn(),[t]=dn(),r=Ut(),a=e==="new",s=t.get("project")||"",i=t.get("supplier")||"",l=t.get("company")||fa,u=t.get("mr")||"",[d,f]=y.useState(null),[p,m]=y.useState(!a),[x,v]=y.useState(!1),[b,w]=y.useState(!1),[j,k]=y.useState(a),[C,N]=y.useState(null),[O,E]=y.useState(null),A=new Date().toISOString().split("T")[0],[T,P]=y.useState({supplier:i,supplier_name:i,company:l,project:s,transaction_date:A,schedule_date:A,currency:xt,items:[],taxes:[]}),D=y.useCallback(R=>{P({supplier:R.supplier||"",supplier_name:R.supplier_name||R.supplier||"",company:R.company||fa,project:R.project||"",transaction_date:R.transaction_date||A,schedule_date:R.schedule_date||"",currency:R.currency||xt,cost_center:R.cost_center||"",set_warehouse:R.set_warehouse||"",tax_category:R.tax_category||"",taxes_and_charges:R.taxes_and_charges||"",items:R.items||[],taxes:R.taxes||[]}),N(null),E(null)},[A]);y.useEffect(()=>{!a||!u||fetch(`/api/resource/Material Request/${encodeURIComponent(u)}`,{credentials:"include"}).then(R=>R.json()).then(R=>{const I=R.data;I&&P(te=>Se(ee({},te),{company:I.company||te.company,project:I.project||te.project,schedule_date:I.transaction_date||te.schedule_date,items:(I.items||[]).map(q=>({item_code:q.item_code,item_name:q.item_name,description:q.description,qty:q.qty,uom:q.uom,stock_uom:q.stock_uom,rate:0,amount:0,schedule_date:q.required_by||te.schedule_date,material_request:u,material_request_item:q.name,warehouse:q.warehouse,project:q.project||I.project,cost_center:q.cost_center}))}))}).catch(()=>{})},[a,u]),y.useEffect(()=>{a||(m(!0),Mc.getPurchaseOrder(e).then(R=>{f(R),D(R)}).catch(R=>$e.error(R.message)).finally(()=>m(!1)))},[e,a,D]),y.useEffect(()=>{const R=T.company;!a||!R||fetch(`/api/resource/Company/${encodeURIComponent(R)}`,{credentials:"include"}).then(I=>I.json()).then(I=>{var te;if((te=I.data)!=null&&te.default_currency){const q=Va(I.data.default_currency);P(B=>Se(ee({},B),{currency:q,buying_price_list:B.buying_price_list||"Standard Buying",price_list_currency:B.price_list_currency||q}))}}).catch(()=>{})},[T.company,a]);const z=(R,I)=>P(te=>Se(ee({},te),{[R]:I})),G=(R,I,te)=>P(q=>{const B=[...q.items||[]],je=Se(ee({},B[R]),{[I]:te});if(I==="qty"||I==="rate"){const Ce=parseFloat(String(I==="qty"?te:je.qty))||0,ye=parseFloat(String(I==="rate"?te:je.rate))||0;je.amount=parseFloat((Ce*ye).toFixed(4))}if(I==="qty"||I==="conversion_factor"){const Ce=parseFloat(String(I==="qty"?te:je.qty))||0,ye=parseFloat(String(I==="conversion_factor"?te:je.conversion_factor))||1;je.stock_qty=parseFloat((Ce*ye).toFixed(4))}return B[R]=je,Se(ee({},q),{items:B})}),V=(R,I)=>fe(null,null,function*(){if(G(R,"item_code",I),!!I)try{const B=(yield(yield fetch(`/api/resource/Item/${encodeURIComponent(I)}`,{credentials:"include"})).json()).data;if(!B)return;P(je=>{var ye;const Ce=[...je.items||[]];return Ce[R]=Se(ee({},Ce[R]),{item_code:I,item_name:B.item_name||I,description:B.description||B.item_name||I,stock_uom:B.stock_uom||"",uom:B.purchase_uom||B.stock_uom||"",price_list_rate:(ye=B.standard_rate)!=null?ye:0,rate:Ce[R].rate||B.standard_rate||0}),Se(ee({},je),{items:Ce})})}catch(te){}}),ne=R=>{P(I=>{const te=[...I.items||[]],q=s1e();let B;return R!==void 0?(te.splice(R+1,0,q),B=R+1):(te.push(q),B=te.length-1),setTimeout(()=>N(B),0),Se(ee({},I),{items:te})})},ge=R=>{P(I=>{const te=[...I.items||[]];return te.splice(R,1),Se(ee({},I),{items:te})}),N(null)},Z=(R,I,te)=>P(q=>{const B=[...q.taxes||[]];return B[R]=Se(ee({},B[R]),{[I]:te}),Se(ee({},q),{taxes:B})}),U=R=>{P(I=>{const te=[...I.taxes||[]],q=i1e();let B;return R!==void 0?(te.splice(R+1,0,q),B=R+1):(te.push(q),B=te.length-1),setTimeout(()=>E(B),0),Se(ee({},I),{taxes:te})})},ce=R=>{P(I=>{const te=[...I.taxes||[]];return te.splice(R,1),Se(ee({},I),{taxes:te})}),E(null)},xe=(T.items||[]).reduce((R,I)=>R+(I.qty||0)*(I.rate||0),0),be=(T.taxes||[]).reduce((R,I)=>I.charge_type==="On Net Total"?R+(I.rate||0)/100*xe:R+(I.tax_amount||0),0),me=xe+be,oe=R=>fe(null,null,function*(){var I;if(R)try{const B=(yield(yield fetch(`/api/resource/Purchase Taxes and Charges Template/${encodeURIComponent(R)}`,{credentials:"include"})).json()).data;(I=B==null?void 0:B.taxes)!=null&&I.length&&P(je=>Se(ee({},je),{taxes:B.taxes.map(Ce=>{var ye;return{charge_type:Ce.charge_type,account_head:Ce.account_head,description:Ce.description,rate:Ce.rate,cost_center:Ce.cost_center,account_currency:Ce.account_currency,included_in_print_rate:(ye=Ce.included_in_print_rate)!=null?ye:0}})}))}catch(te){}}),L=()=>({supplier:T.supplier,company:T.company||void 0,project:T.project||void 0,cost_center:T.cost_center||void 0,transaction_date:T.transaction_date,schedule_date:T.schedule_date||void 0,currency:T.currency||void 0,set_warehouse:T.set_warehouse||void 0,tax_category:T.tax_category||void 0,taxes_and_charges:T.taxes_and_charges||void 0,items:(T.items||[]).filter(R=>R.item_code).map((R,I)=>{var te,q,B,je,Ce,ye;return{item_code:R.item_code,item_name:R.item_name||R.item_code,description:R.description||R.item_name||R.item_code,qty:(te=R.qty)!=null?te:1,uom:R.uom||void 0,stock_uom:R.stock_uom||void 0,conversion_factor:(q=R.conversion_factor)!=null?q:1,rate:(B=R.rate)!=null?B:0,amount:(R.qty||0)*(R.rate||0),price_list_rate:(je=R.price_list_rate)!=null?je:0,schedule_date:R.schedule_date||T.schedule_date||void 0,is_free_item:(Ce=R.is_free_item)!=null?Ce:0,warehouse:R.warehouse||T.set_warehouse||void 0,expense_account:R.expense_account||void 0,against_blanket_order:(ye=R.against_blanket_order)!=null?ye:0,weight_per_unit:R.weight_per_unit||void 0,project:R.project||T.project||void 0,cost_center:R.cost_center||T.cost_center||void 0,idx:I+1}}),taxes:(T.taxes||[]).filter(R=>R.charge_type).map((R,I)=>{var te,q;return{charge_type:R.charge_type,account_head:R.account_head||void 0,description:R.description||void 0,included_in_print_rate:(te=R.included_in_print_rate)!=null?te:0,cost_center:R.cost_center||void 0,rate:(q=R.rate)!=null?q:0,account_currency:R.account_currency||xt,idx:I+1}})}),H=()=>fe(null,null,function*(){if(!T.supplier){$e.error("Supplier is required");return}try{if(v(!0),a){const R=yield Mc.createPurchaseOrder(L());$e.success("Purchase Order created"),k(!1),r(`/purchase-orders/${R.name}`)}else{const R=yield Mc.updatePurchaseOrder(e,L());f(R),D(R),$e.success("Purchase Order saved"),k(!1)}}catch(R){$e.error(R.message||"Error saving")}finally{v(!1)}}),K=()=>fe(null,null,function*(){if(!(!e||a))try{w(!0);const R=yield Mc.submitPurchaseOrder(e);f(R),D(R),$e.success("Purchase Order submitted")}catch(R){$e.error(R.message||"Error submitting")}finally{w(!1)}}),Y=()=>{const R=new URLSearchParams;R.set("po",e),T.supplier&&R.set("supplier",T.supplier),T.company&&R.set("company",String(T.company)),T.project&&R.set("project",String(T.project)),r(`/purchase-receipts/new?${R.toString()}`)},re=a||j,de=!a&&(d==null?void 0:d.docstatus)===1,ie=a?"New Purchase Order":T.supplier_name||e||"";return p?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-amber-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-6 text-gray-500",children:[n.jsx("button",{onClick:()=>r("/purchase-orders"),className:"hover:text-amber-600",children:"Purchase Orders"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:a?"New Purchase Order":e})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 dark:border-gray-700 flex items-center justify-between gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>r("/purchase-orders"),className:"text-gray-400 hover:text-gray-700",children:n.jsx(da,{})}),n.jsx(r_,{className:"text-amber-500"}),n.jsx("div",{children:n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:ie}),!a&&e&&n.jsx("span",{className:"text-xs text-gray-400 font-mono",children:e}),!a&&n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${(()=>{const R=(d==null?void 0:d.status)||"";return(d==null?void 0:d.docstatus)===2||R==="Cancelled"?"bg-red-100 text-red-700":!d||d.docstatus===0?"bg-yellow-100 text-yellow-800":R==="Completed"?"bg-green-100 text-green-800":R==="To Receive and Bill"||R==="To Bill"||R==="To Receive"?"bg-blue-100 text-blue-800":R==="Closed"?"bg-gray-100 text-gray-700":"bg-green-100 text-green-800"})()}`,children:(d==null?void 0:d.docstatus)===2?"Cancelled":(d==null?void 0:d.docstatus)===0?"Draft":(d==null?void 0:d.status)||"Submitted"})]})})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[de&&n.jsx(r1e,{items:[{label:"Purchase Receipt",icon:n.jsx(Sq,{size:13}),onClick:Y}]}),!a&&!j&&(d==null?void 0:d.docstatus)===0&&n.jsxs("button",{onClick:K,disabled:b,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 text-sm font-medium",children:[b?n.jsx(vt,{className:"animate-spin"}):n.jsx(cu,{size:12})," Submit"]}),!a&&!j&&!de&&n.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-2 px-4 py-2 border border-amber-500 text-amber-600 rounded-lg hover:bg-amber-50 text-sm",children:[n.jsx(ha,{})," Edit"]}),re&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:H,disabled:x,className:"flex items-center gap-2 px-4 py-2 bg-amber-500 text-white rounded-lg hover:bg-amber-600 disabled:opacity-50 text-sm font-medium",children:[x?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),x?"Saving…":"Save"]}),!a&&n.jsx("button",{onClick:()=>{d&&D(d),k(!1)},className:"px-3 py-2 border border-gray-300 rounded-lg text-gray-600 text-sm",children:n.jsx(yt,{})})]})]})]}),n.jsx("div",{className:"px-6 pt-5 pb-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"Supplier"}),re?n.jsx(Be,{label:"Supplier",hideLabel:!0,doctype:"Supplier",value:T.supplier||"",onChange:R=>{z("supplier",R),z("supplier_name",R)},placeholder:"Select supplier…"}):n.jsx(Ln,{children:T.supplier_name||T.supplier})]}),n.jsxs("div",{children:[n.jsx(Rt,{required:!0,children:"Transaction Date"}),re?n.jsx("input",{type:"date",value:T.transaction_date||"",onChange:R=>z("transaction_date",R.target.value),className:qi}):n.jsx(Ln,{children:T.transaction_date})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Schedule Date"}),re?n.jsx("input",{type:"date",value:T.schedule_date||"",onChange:R=>z("schedule_date",R.target.value),className:qi}):n.jsx(Ln,{children:T.schedule_date})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Company"}),re?n.jsx(Be,{label:"Company",hideLabel:!0,doctype:"Company",value:T.company||"",onChange:R=>z("company",R),placeholder:"Select company…"}):n.jsx(Ln,{children:T.company})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Project"}),re?n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:T.project||"",onChange:R=>z("project",R),placeholder:"Select project…"}):n.jsx(Ln,{children:T.project})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Set Warehouse"}),re?n.jsx(Be,{label:"Warehouse",hideLabel:!0,doctype:"Warehouse",value:T.set_warehouse||"",onChange:R=>z("set_warehouse",R),placeholder:"Set warehouse…"}):n.jsx(Ln,{children:T.set_warehouse})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Currency"}),re?n.jsxs("select",{value:T.currency||xt,onChange:R=>z("currency",R.target.value),className:qi,children:[n.jsx("option",{value:"SAR",children:"SAR"}),n.jsx("option",{value:"USD",children:"USD"}),n.jsx("option",{value:"EUR",children:"EUR"})]}):n.jsx(Ln,{children:T.currency})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Cost Center"}),re?n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:T.cost_center||"",onChange:R=>z("cost_center",R),placeholder:"Cost center…"}):n.jsx(Ln,{children:T.cost_center})]})]})}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:"px-6 py-3 bg-gray-50 dark:bg-gray-900/20 border-b border-gray-100 dark:border-gray-700",children:n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Items"})}),n.jsxs("div",{className:"px-6 pb-5",children:[n.jsx("div",{className:"overflow-x-auto -mx-2 mt-3",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 min-w-[180px]",children:["Item Code ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-32",children:"Schedule Date"}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:["Qty ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:["Rate (",T.currency||xt,")"]}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:["Amount (",T.currency||xt,")"]}),re&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[(T.items||[]).map((R,I)=>{var te,q,B,je;return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${C===I?"bg-amber-50/60 dark:bg-amber-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:I+1}),n.jsx("td",{className:"py-1.5 px-2 min-w-[180px]",children:re?n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:R.item_code||"",onChange:Ce=>V(I,Ce),placeholder:"Item Code"}):n.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-200",children:R.item_code||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-32",children:re?n.jsx("input",{type:"date",value:R.schedule_date||"",onChange:Ce=>G(I,"schedule_date",Ce.target.value),className:hO}):n.jsx("span",{className:"text-gray-500 text-sm",children:R.schedule_date||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:re?n.jsx("input",{type:"number",min:0,step:"1",value:(te=R.qty)!=null?te:0,onChange:Ce=>G(I,"qty",parseFloat(Ce.target.value)||0),className:Sw}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 text-sm pr-1",children:(q=R.qty)!=null?q:0})}),n.jsx("td",{className:"py-1.5 px-2 w-28",children:re?n.jsx("input",{type:"number",min:0,step:"0.01",value:(B=R.rate)!=null?B:0,onChange:Ce=>G(I,"rate",parseFloat(Ce.target.value)||0),className:Sw}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 text-sm pr-1",children:((je=R.rate)!=null?je:0).toFixed(2)})}),n.jsx("td",{className:"py-1.5 px-3 text-right font-semibold text-gray-900 dark:text-white text-sm",children:((R.qty||0)*(R.rate||0)).toFixed(2)}),re&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>N(C===I?null:I),className:`p-1.5 rounded text-xs ${C===I?"bg-amber-500 text-white":"text-amber-600 hover:bg-amber-50"}`,title:"More fields",children:n.jsx(Vs,{size:11})}),n.jsx("button",{onClick:()=>ge(I),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:n.jsx(Za,{size:11})})]})})]}),re&&C===I&&n.jsx(a1e,{item:R,rowNo:I+1,onChange:(Ce,ye)=>{Ce==="item_code"?V(I,ye):G(I,Ce,ye)},onClose:()=>N(null),onDelete:()=>ge(I),onInsertBelow:()=>ne(I)})]},I)}),re&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{onClick:()=>ne(),className:"flex items-center gap-1.5 text-amber-600 hover:text-amber-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})}),n.jsxs("div",{className:"mt-3 flex justify-between text-sm border-t border-gray-100 dark:border-gray-700 pt-3",children:[n.jsxs("span",{className:"text-gray-500",children:["Total Qty: ",n.jsx("strong",{children:(T.items||[]).reduce((R,I)=>R+(I.qty||0),0)})]}),n.jsxs("span",{className:"text-gray-500",children:["Net Total: ",n.jsxs("strong",{className:"text-gray-900 dark:text-white",children:[T.currency||xt," ",xe.toFixed(2)]})]})]})]})]}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:"px-6 py-3 bg-gray-50 dark:bg-gray-900/20 border-b border-gray-100 dark:border-gray-700",children:n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Taxes and Charges"})}),n.jsxs("div",{className:"px-6 pt-4 pb-2 grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-3",children:[n.jsxs("div",{children:[n.jsx(Rt,{children:"Tax Category"}),re?n.jsx(Be,{label:"Tax Category",hideLabel:!0,doctype:"Tax Category",value:T.tax_category||"",onChange:R=>z("tax_category",R),placeholder:"Select tax category…"}):n.jsx(Ln,{children:T.tax_category})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Purchase Taxes and Charges Template"}),re?n.jsx(Be,{label:"Purchase Taxes and Charges Template",hideLabel:!0,doctype:"Purchase Taxes and Charges Template",value:T.taxes_and_charges||"",onChange:R=>{z("taxes_and_charges",R),oe(R)},placeholder:"Select template…"}):n.jsx(Ln,{children:T.taxes_and_charges})]})]}),n.jsxs("div",{className:"px-6 pb-5",children:[n.jsx("div",{className:"overflow-x-auto -mx-2 mt-3",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-44",children:["Type ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3",children:["Account Head ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:"Tax Rate"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Amount"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Total"}),re&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[(T.taxes||[]).map((R,I)=>{var B,je;const te=R.charge_type==="On Net Total"?(R.rate||0)/100*xe:R.charge_type==="Actual"?R.tax_amount||0:(R.rate||0)/100*xe,q=xe+(T.taxes||[]).slice(0,I+1).reduce((Ce,ye)=>{const Ee=ye.charge_type==="On Net Total"?(ye.rate||0)/100*xe:ye.charge_type==="Actual"?ye.tax_amount||0:(ye.rate||0)/100*xe;return Ce+Ee},0);return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${O===I?"bg-amber-50/60 dark:bg-amber-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:I+1}),n.jsx("td",{className:"py-1.5 px-2 w-44",children:re?n.jsxs("select",{value:R.charge_type||"",onChange:Ce=>Z(I,"charge_type",Ce.target.value),className:hO,children:[n.jsx("option",{value:"",children:"Select type…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"})]}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:R.charge_type||"-"})}),n.jsx("td",{className:"py-1.5 px-2",children:re?n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:R.account_head||"",onChange:Ce=>Z(I,"account_head",Ce),placeholder:"Account Head"}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:R.account_head||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:re?n.jsx("input",{type:"number",min:0,step:"0.01",value:(B=R.rate)!=null?B:0,onChange:Ce=>Z(I,"rate",parseFloat(Ce.target.value)||0),className:Sw}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 pr-1",children:(je=R.rate)!=null?je:0})}),n.jsx("td",{className:"py-1.5 px-3 text-right text-gray-700 dark:text-gray-300 text-sm",children:te.toFixed(2)}),n.jsx("td",{className:"py-1.5 px-3 text-right font-semibold text-gray-900 dark:text-white text-sm",children:q.toFixed(2)}),re&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>E(O===I?null:I),className:`p-1.5 rounded text-xs ${O===I?"bg-amber-500 text-white":"text-amber-600 hover:bg-amber-50"}`,title:"More fields",children:n.jsx(Vs,{size:11})}),n.jsx("button",{onClick:()=>ce(I),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:n.jsx(Za,{size:11})})]})})]}),re&&O===I&&n.jsx(n1e,{tax:R,rowNo:I+1,onChange:(Ce,ye)=>Z(I,Ce,ye),onClose:()=>E(null),onDelete:()=>ce(I),onInsertBelow:()=>U(I)})]},I)}),re&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{onClick:()=>U(),className:"flex items-center gap-1.5 text-amber-600 hover:text-amber-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})}),(T.taxes||[]).length>0&&n.jsxs("div",{className:"mt-2 flex justify-end text-sm text-gray-500 pt-2 border-t border-gray-100 dark:border-gray-700",children:["Total Taxes and Charges: ",n.jsxs("strong",{className:"ml-2 text-gray-900 dark:text-white",children:[T.currency||xt," ",be.toFixed(2)]})]})]})]}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700 px-6 py-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-3",children:"Totals"}),n.jsx("div",{className:"space-y-2 max-w-xs ml-auto",children:[{label:"Net Total",value:((se=d==null?void 0:d.net_total)!=null?se:xe).toFixed(2)},{label:"Total Taxes",value:((he=d==null?void 0:d.total_taxes_and_charges)!=null?he:be).toFixed(2)},{label:"Grand Total",value:((_e=d==null?void 0:d.grand_total)!=null?_e:me).toFixed(2)},{label:"Rounded Total",value:((F=d==null?void 0:d.rounded_total)!=null?F:me).toFixed(2)},{label:"Advance Paid",value:((X=d==null?void 0:d.advance_paid)!=null?X:0).toFixed(2)}].map(({label:R,value:I})=>n.jsxs("div",{className:"flex justify-between text-sm border-b border-gray-100 dark:border-gray-700 pb-1.5 last:border-0",children:[n.jsx("span",{className:"text-gray-500",children:R}),n.jsxs("span",{className:"font-semibold text-gray-900 dark:text-white",children:[T.currency||xt," ",I]})]},R))})]}),!a&&d&&n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700 px-6 py-4 grid grid-cols-3 gap-4 text-sm bg-gray-50 dark:bg-gray-900/20",children:[n.jsxs("div",{children:[n.jsx(Rt,{children:"Created By"}),n.jsx(Ln,{children:d.owner})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Created"}),n.jsx(Ln,{children:d.creation?new Date(d.creation).toLocaleString():"-"})]}),n.jsxs("div",{children:[n.jsx(Rt,{children:"Modified"}),n.jsx(Ln,{children:d.modified?new Date(d.modified).toLocaleString():"-"})]})]}),!a&&n.jsx(Yn,{doctype:"Purchase Order",docname:(d==null?void 0:d.name)||e||"",creationDate:d==null?void 0:d.creation,createdBy:d==null?void 0:d.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})},jc=20;function l1e(e){const t=[];return e.search&&t.push(["Delivery Note","name","like",`%${e.search}%`]),e.status==="Draft"&&t.push(["Delivery Note","docstatus","=",0]),e.status==="Submitted"&&t.push(["Delivery Note","docstatus","=",1]),e.status==="Cancelled"&&t.push(["Delivery Note","docstatus","=",2]),t}function c1e(e){return e.docstatus===2?"bg-red-100 text-red-700":e.docstatus===1?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-800"}function u1e(e){return e.docstatus===2?"Cancelled":e.docstatus===1?e.status||"Submitted":"Draft"}const d1e=()=>{const{t:e}=sr(),t=Ut(),[r,a]=y.useState([]),[s,i]=y.useState(!0),[l,u]=y.useState(0),[d,f]=y.useState(0),[p,m]=y.useState(!1),[x,v]=y.useState(""),[b,w]=y.useState(""),[j,k]=y.useState({search:"",status:""}),[C,N]=y.useState(!1),O=y.useRef(!1),E=y.useRef(null),A=y.useCallback((me,oe)=>fe(null,null,function*(){i(!0);try{const L=[];oe.search&&L.push(["Delivery Note","name","like",`%${oe.search}%`]),oe.status==="Draft"&&L.push(["Delivery Note","docstatus","=",0]),oe.status==="Submitted"&&L.push(["Delivery Note","docstatus","=",1]),oe.status==="Cancelled"&&L.push(["Delivery Note","docstatus","=",2]);const[H,K]=yield Promise.all([Dc.getDeliveryNotes({filters:L,limit_start:me,limit_page_length:jc}),Dc.getDeliveryNoteCount(L)]);a(H),u(K)}catch(L){$e.error(L.message||"Failed to load")}finally{i(!1)}}),[]);y.useEffect(()=>{A(0,j)},[A,j]);const T=y.useMemo(()=>`${d}|${j.search}|${j.status}`,[d,j.search,j.status]),{selectedRows:P,toggleRow:D,toggleAllOnPage:z,allOnPageSelected:G,someOnPageSelected:V}=Vn(r,T);y.useEffect(()=>{if(!O.current){O.current=!0;return}k(me=>Se(ee({},me),{status:b})),f(0)},[b]),y.useEffect(()=>{if(O.current)return E.current&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{k(me=>Se(ee({},me),{search:x})),f(0)},450),()=>{E.current&&window.clearTimeout(E.current)}},[x]);const ne=()=>{v(""),w(""),k({search:"",status:""}),f(0)},ge=!!(j.search||j.status),Z=me=>{f(me),A(me*jc,j)},U=me=>t(`/delivery-notes/${encodeURIComponent(me)}`),ce=me=>t(`/delivery-notes/${encodeURIComponent(me)}?edit=1`),xe=me=>t(`/delivery-notes/new?duplicate=${encodeURIComponent(me)}`),be=y.useCallback(()=>Kn({doctype:"Delivery Note",filters:l1e(j),orderBy:"modified desc"}),[j]);return n.jsxs("div",{className:"p-6",children:[n.jsx(Br,{position:"top-right",autoClose:3e3}),n.jsxs("div",{className:"flex items-center justify-between mb-6 gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-teal-600 flex items-center justify-center",children:n.jsx(Yx,{className:"text-white text-base"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Delivery Notes"}),n.jsxs("p",{className:"text-xs text-gray-500",children:[l," total"]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("button",{onClick:()=>A(d*jc,j),className:"p-2 text-gray-500 hover:text-indigo-600 border border-gray-200 rounded-lg",children:n.jsx(en,{size:13})}),n.jsxs("button",{type:"button",onClick:()=>N(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:l===0&&P.size===0,children:[n.jsx(hn,{})," ",e("listPages.export"),P.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:P.size})]}),n.jsxs("button",{onClick:()=>t("/delivery-notes/new"),className:"flex items-center gap-2 px-4 py-2 bg-teal-600 text-white rounded-lg hover:bg-teal-700 text-sm font-medium",children:[n.jsx(Pt,{size:11})," New Note"]})]})]}),n.jsx(Gn,{isOpen:C,onClose:()=>N(!1),doctype:"Delivery Note",selectedCount:P.size,pageCount:r.length,totalCount:l,pageData:r,selectedRows:P,rowKey:"name",onFetchAll:be,fileNamePrefix:"delivery_notes"}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl mb-5 overflow-hidden",children:[n.jsxs("button",{onClick:()=>m(me=>!me),className:"w-full flex items-center justify-between px-4 py-3 bg-gradient-to-r from-blue-500 to-blue-600 dark:from-blue-600 dark:to-blue-700 text-white",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[n.jsx(fn,{size:12})," Filters ",ge&&n.jsx("span",{className:"bg-white/30 text-white text-xs px-2 py-0.5 rounded-full",children:"Active"})]}),p?n.jsx(ps,{size:11}):n.jsx(nr,{size:11})]}),ge&&n.jsxs("div",{className:"px-4 py-2 bg-blue-50 dark:bg-blue-900/20 flex flex-wrap gap-2 items-center border-b border-blue-100 dark:border-blue-900/30",children:[j.search&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:["ID: ",j.search,n.jsx("button",{onClick:()=>{v(""),k(me=>Se(ee({},me),{search:""}))},children:n.jsx(yt,{size:9})})]}),j.status&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:["Status: ",j.status,n.jsx("button",{onClick:()=>{w(""),k(me=>Se(ee({},me),{status:""}))},children:n.jsx(yt,{size:9})})]}),n.jsx("button",{onClick:ne,className:"text-xs text-blue-600 hover:underline ml-auto",children:"Clear All"})]}),p&&n.jsxs("div",{className:"px-4 py-3 grid grid-cols-1 sm:grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Note ID"}),n.jsx("input",{value:x,onChange:me=>v(me.target.value),onKeyDown:me=>me.key==="Enter"&&me.preventDefault(),placeholder:"Search…",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-400"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Status"}),n.jsxs("select",{value:b,onChange:me=>w(me.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-400",children:[n.jsx("option",{value:"",children:"All"}),n.jsx("option",{value:"Draft",children:"Draft"}),n.jsx("option",{value:"Submitted",children:"Submitted"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]})]})]})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"w-10 px-4 py-3 text-left",children:n.jsx("button",{type:"button",onClick:z,className:"text-gray-500 dark:text-gray-400 hover:text-teal-600 dark:hover:text-teal-400 transition-colors",title:G?"Deselect all":"Select all","aria-label":"Select all on page",children:G?n.jsx(Sn,{className:"text-teal-600 dark:text-teal-400",size:18}):V?n.jsxs("div",{className:"relative inline-block",children:[n.jsx(Gr,{size:18}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"w-2 h-0.5 bg-current"})})]}):n.jsx(Gr,{size:18})})}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Note ID"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Customer"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Date"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Status"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Grand Total"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4 w-28",children:" "})]})}),n.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:s?n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"text-center py-10 text-gray-400",children:"Loading…"})}):r.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"text-center py-10 text-gray-400",children:"No delivery notes found"})}):r.map(me=>{var oe;return n.jsxs("tr",{onClick:()=>U(me.name),className:`cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors ${P.has(me.name)?"bg-teal-50 dark:bg-teal-900/20":""}`,children:[n.jsx("td",{className:"w-10 px-4 py-3",onClick:L=>L.stopPropagation(),children:n.jsx("button",{type:"button",onClick:()=>D(me.name),className:"text-gray-500 dark:text-gray-400 hover:text-teal-600 dark:hover:text-teal-400 transition-colors","aria-label":`Select ${me.name}`,children:P.has(me.name)?n.jsx(Sn,{className:"text-teal-600 dark:text-teal-400",size:18}):n.jsx(Gr,{size:18})})}),n.jsx("td",{className:"py-3 px-4 font-medium text-gray-900 dark:text-white",children:me.name}),n.jsx("td",{className:"py-3 px-4 text-gray-700 dark:text-gray-300",children:me.customer_name||me.customer||"-"}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:me.posting_date||"-"}),n.jsx("td",{className:"py-3 px-4",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${c1e(me)}`,children:u1e(me)})}),n.jsxs("td",{className:"py-3 px-4 text-right font-semibold text-gray-900 dark:text-white",children:[me.currency||"SAR"," ",((oe=me.grand_total)!=null?oe:0).toFixed(2)]}),n.jsx("td",{className:"py-2 px-4",onClick:L=>L.stopPropagation(),children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>U(me.name),className:"text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 p-2 hover:bg-blue-50 dark:hover:bg-blue-900/30 rounded transition-colors",title:"View",children:n.jsx(Hs,{})}),n.jsx("button",{onClick:()=>ce(me.name),className:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 p-2 hover:bg-green-50 dark:hover:bg-green-900/30 rounded transition-colors",title:"Edit",children:n.jsx(ha,{})}),n.jsx("button",{onClick:()=>xe(me.name),className:"text-purple-600 dark:text-purple-400 hover:text-purple-900 dark:hover:text-purple-300 p-2 hover:bg-purple-50 dark:hover:bg-purple-900/30 rounded transition-colors",title:"Duplicate",children:n.jsx(uu,{})})]})})]},me.name)})})]})}),l>jc&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:[d*jc+1,"",Math.min((d+1)*jc,l)," of ",l]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{disabled:d===0,onClick:()=>Z(d-1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Prev"}),n.jsx("button",{disabled:(d+1)*jc>=l,onClick:()=>Z(d+1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Next"})]})]})]})]})},It=({children:e,required:t})=>n.jsxs("label",{className:"block text-[11px] font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),Ms=({children:e})=>n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800/60 rounded min-h-[34px] flex items-center",children:e||n.jsx("span",{className:"text-gray-400",children:"-"})}),pO="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-teal-400",f1e="w-full px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-teal-400",Nw="w-full px-2 py-1 text-sm text-right border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-teal-400",rh="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-teal-400",_c="w-full px-3 py-2 text-sm text-right border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-teal-400",jd="w-full px-3 py-2 text-sm bg-gray-50 dark:bg-gray-800/60 text-gray-600 dark:text-gray-400 rounded min-h-[34px] flex items-center",jo=({label:e,children:t,defaultOpen:r=!1})=>{const[a,s]=y.useState(r);return n.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden mt-3",children:[n.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"w-full flex items-center gap-2 px-3 py-2 text-[11px] font-bold text-gray-500 dark:text-gray-400 uppercase tracking-wider bg-gray-50 dark:bg-gray-800/80 hover:bg-gray-100 dark:hover:bg-gray-700/60 transition-colors text-left",children:[a?n.jsx(nr,{size:9}):n.jsx(bs,{size:9}),e]}),a&&n.jsx("div",{className:"p-3 grid grid-cols-1 sm:grid-cols-2 gap-3 bg-white dark:bg-gray-800",children:t})]})},h1e=({items:e})=>{const[t,r]=y.useState(!1),a=y.useRef(null);return y.useEffect(()=>{const s=i=>{a.current&&!a.current.contains(i.target)&&r(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),n.jsxs("div",{className:"relative",ref:a,children:[n.jsxs("button",{onClick:()=>r(s=>!s),className:"flex items-center gap-1.5 px-4 py-2 bg-teal-600 text-white rounded-lg hover:bg-teal-700 text-sm font-medium shadow-sm",children:["Create ",n.jsx(nr,{size:10,className:`transition-transform ${t?"rotate-180":""}`})]}),t&&n.jsxs("div",{className:"absolute right-0 mt-1 w-52 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl shadow-xl z-50 py-1.5",children:[n.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold text-gray-400 uppercase tracking-wider border-b border-gray-100 dark:border-gray-700 mb-1",children:"Create from this note"}),e.map(({label:s,icon:i,onClick:l})=>n.jsxs("button",{onClick:()=>{l(),r(!1)},className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-teal-50 dark:hover:bg-teal-900/20 hover:text-teal-700 transition-colors text-left",children:[n.jsx("span",{className:"text-gray-400",children:i}),s]},s))]})]})},p1e=({item:e,rowNo:t,currency:r,onChange:a,onClose:s,onDelete:i,onInsertBelow:l})=>{var f,p,m,x,v,b,w,j,k;const u=(C,N)=>a(C,N),d=r||xt;return n.jsx("tr",{children:n.jsx("td",{colSpan:8,className:"p-0",children:n.jsxs("div",{className:"bg-blue-50/60 dark:bg-blue-900/10 border-b border-blue-200 dark:border-blue-800 px-4 py-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-xs font-bold text-teal-700 dark:text-teal-300 uppercase tracking-wider",children:["Editing Row #",t]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{onClick:l,className:"px-2 py-1 text-[11px] bg-teal-600 text-white rounded hover:bg-teal-700",children:"Insert Below"}),n.jsx("button",{onClick:i,className:"px-2 py-1 text-[11px] bg-red-500 text-white rounded hover:bg-red-600",children:"Delete"}),n.jsx("button",{onClick:s,className:"px-2 py-1 text-[11px] bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded hover:bg-gray-300",children:"ESC"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(It,{required:!0,children:"Item Code"}),n.jsx(Be,{label:"Item Code",hideLabel:!0,doctype:"Item",value:e.item_code||"",onChange:C=>u("item_code",C)})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Item Name"}),n.jsx("input",{value:e.item_name||"",onChange:C=>u("item_name",C.target.value),className:rh})]})]}),n.jsx(jo,{label:"Description",children:n.jsxs("div",{className:"sm:col-span-2",children:[n.jsx(It,{children:"Description"}),n.jsx("textarea",{value:e.description||"",onChange:C=>u("description",C.target.value),rows:2,className:rh+" resize-none"})]})}),n.jsxs(jo,{label:"Quantity and Warehouse",defaultOpen:!0,children:[n.jsxs("div",{children:[n.jsx(It,{required:!0,children:"Quantity"}),n.jsx("input",{type:"number",min:0,step:"1",value:(f=e.qty)!=null?f:1,onChange:C=>u("qty",parseFloat(C.target.value)||0),className:_c})]}),n.jsxs("div",{children:[n.jsx(It,{required:!0,children:"UOM"}),n.jsx(Be,{label:"UOM",hideLabel:!0,doctype:"UOM",value:e.uom||"",onChange:C=>u("uom",C)})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Stock UOM"}),n.jsx(Be,{label:"Stock UOM",hideLabel:!0,doctype:"UOM",value:e.stock_uom||"",onChange:C=>u("stock_uom",C)})]}),n.jsxs("div",{children:[n.jsx(It,{children:"UOM Conversion Factor"}),n.jsx("input",{type:"number",min:0,step:"0.0001",value:(p=e.conversion_factor)!=null?p:1,onChange:C=>u("conversion_factor",parseFloat(C.target.value)||1),className:_c})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Stock Qty (auto)"}),n.jsx("div",{className:jd,children:((e.qty||1)*(e.conversion_factor||1)).toFixed(3)})]})]}),n.jsxs(jo,{label:`Discount and Margin (${d})`,defaultOpen:!0,children:[n.jsxs("div",{children:[n.jsxs(It,{children:["Price List Rate (",d,")"]}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(m=e.price_list_rate)!=null?m:0,onChange:C=>u("price_list_rate",parseFloat(C.target.value)||0),className:_c})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Discount %"}),n.jsx("input",{type:"number",min:0,max:100,step:"0.01",value:(x=e.discount_percentage)!=null?x:0,onChange:C=>u("discount_percentage",parseFloat(C.target.value)||0),className:_c})]}),n.jsxs("div",{children:[n.jsxs(It,{children:["Discount Amount (",d,")"]}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(v=e.discount_amount)!=null?v:0,onChange:C=>u("discount_amount",parseFloat(C.target.value)||0),className:_c})]}),n.jsxs("div",{children:[n.jsxs(It,{children:["Rate (",d,")"]}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(b=e.rate)!=null?b:0,onChange:C=>u("rate",parseFloat(C.target.value)||0),className:_c})]}),n.jsxs("div",{children:[n.jsxs(It,{children:["Amount (",d,") (auto)"]}),n.jsx("div",{className:jd,children:((e.qty||0)*(e.rate||0)).toFixed(2)})]}),n.jsxs("div",{className:"flex items-center gap-2 pt-4",children:[n.jsx("input",{type:"checkbox",id:`fi-${t}`,checked:!!e.is_free_item,onChange:C=>u("is_free_item",C.target.checked?1:0),className:"w-4 h-4 text-teal-600 rounded"}),n.jsx("label",{htmlFor:`fi-${t}`,className:"text-sm text-gray-700 dark:text-gray-300",children:"Is Free Item"})]}),n.jsxs("div",{className:"flex items-center gap-2 pt-4",children:[n.jsx("input",{type:"checkbox",id:`gc-${t}`,checked:!!e.grant_commission,onChange:C=>u("grant_commission",C.target.checked?1:0),className:"w-4 h-4 text-teal-600 rounded"}),n.jsx("label",{htmlFor:`gc-${t}`,className:"text-sm text-gray-700 dark:text-gray-300",children:"Grant Commission"})]})]}),n.jsxs(jo,{label:"Warehouse and Reference",children:[n.jsxs("div",{children:[n.jsx(It,{children:"Warehouse"}),n.jsx(Be,{label:"Warehouse",hideLabel:!0,doctype:"Warehouse",value:e.warehouse||"",onChange:C=>u("warehouse",C)})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Against Sales Order"}),n.jsx("div",{className:jd,children:e.against_sales_order||"-"})]})]}),n.jsxs(jo,{label:"Available Quantity",children:[n.jsxs("div",{children:[n.jsx(It,{children:"Actual Qty (Warehouse)"}),n.jsx("div",{className:jd,children:(w=e.actual_qty)!=null?w:0})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Company Total Stock"}),n.jsx("div",{className:jd,children:(j=e.company_total_stock)!=null?j:0})]})]}),n.jsxs(jo,{label:"Item Weight Details",children:[n.jsxs("div",{children:[n.jsx(It,{children:"Weight Per Unit"}),n.jsx("input",{type:"number",min:0,step:"0.001",value:(k=e.weight_per_unit)!=null?k:0,onChange:C=>u("weight_per_unit",parseFloat(C.target.value)||0),className:_c})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Total Weight (auto)"}),n.jsx("div",{className:jd,children:((e.weight_per_unit||0)*(e.qty||0)).toFixed(3)})]})]}),n.jsx(jo,{label:"Accounting Details",children:n.jsxs("div",{className:"sm:col-span-2",children:[n.jsx(It,{children:"Expense Account"}),n.jsx(Be,{label:"Expense Account",hideLabel:!0,doctype:"Account",value:e.expense_account||"",onChange:C=>u("expense_account",C)})]})}),n.jsxs(jo,{label:"Accounting Dimensions",children:[n.jsxs("div",{children:[n.jsx(It,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:C=>u("cost_center",C)})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Project"}),n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:e.project||"",onChange:C=>u("project",C)})]})]})]})})})},m1e=({tax:e,rowNo:t,onChange:r,onClose:a,onDelete:s})=>{const i=(l,u)=>r(l,u);return n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"p-0",children:n.jsxs("div",{className:"bg-blue-50/60 dark:bg-blue-900/10 border-b border-blue-200 dark:border-blue-800 px-4 py-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-xs font-bold text-teal-700 dark:text-teal-300 uppercase tracking-wider",children:["Editing Tax Row #",t]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{onClick:s,className:"px-2 py-1 text-[11px] bg-red-500 text-white rounded hover:bg-red-600",children:"Delete"}),n.jsx("button",{onClick:a,className:"px-2 py-1 text-[11px] bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded hover:bg-gray-300",children:"ESC"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(It,{required:!0,children:"Type"}),n.jsxs("select",{value:e.charge_type||"",onChange:l=>i("charge_type",l.target.value),className:rh,children:[n.jsx("option",{value:"",children:"Select…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"}),n.jsx("option",{value:"On Previous Row Total",children:"On Previous Row Total"}),n.jsx("option",{value:"On Item Quantity",children:"On Item Quantity"})]})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Description"}),n.jsx("input",{value:e.description||"",onChange:l=>i("description",l.target.value),className:rh})]}),n.jsxs("div",{children:[n.jsx(It,{required:!0,children:"Account Head"}),n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:e.account_head||"",onChange:l=>i("account_head",l)})]}),n.jsxs("div",{className:"flex items-center gap-2 pt-5",children:[n.jsx("input",{type:"checkbox",id:`incl-${t}`,checked:!!e.included_in_print_rate,onChange:l=>i("included_in_print_rate",l.target.checked?1:0),className:"w-4 h-4 text-teal-600 rounded"}),n.jsx("label",{htmlFor:`incl-${t}`,className:"text-sm text-gray-700 dark:text-gray-300",children:"Included in Basic Rate"})]})]}),n.jsxs(jo,{label:"Accounting Dimensions",children:[n.jsxs("div",{children:[n.jsx(It,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:l=>i("cost_center",l)})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Account Currency"}),n.jsx("input",{value:e.account_currency||"",onChange:l=>i("account_currency",l.target.value),className:rh})]})]})]})})})},g1e=()=>({item_code:"",item_name:"",qty:1,rate:0,amount:0,uom:"",conversion_factor:1}),x1e=()=>({charge_type:"On Net Total",account_head:"",rate:15}),y1e=()=>{var _e;const{dnName:e}=Hn(),[t]=dn(),r=Ut(),a=e==="new",s=t.get("so")||"",i=t.get("customer")||"",l=t.get("company")||fa,u=t.get("project")||"",[d,f]=y.useState(null),[p,m]=y.useState(!a),[x,v]=y.useState(!1),[b,w]=y.useState(!1),[j,k]=y.useState(a),[C,N]=y.useState(null),[O,E]=y.useState(null),[A,T]=y.useState([]),P=new Date().toISOString().split("T")[0],[D,z]=y.useState({customer:i,company:l,project:u,posting_date:P,currency:xt,taxes_and_charges:i0,items:[]}),G=y.useCallback(F=>{z({customer:F.customer||"",company:F.company||fa,project:F.project||"",posting_date:F.posting_date||P,currency:F.currency==="INR"?xt:F.currency||xt,cost_center:F.cost_center||"",items:F.items||[],selling_price_list:F.selling_price_list||"",price_list_currency:F.price_list_currency||"",conversion_rate:F.conversion_rate||1,plc_conversion_rate:F.plc_conversion_rate||1,tax_category:F.tax_category||"",taxes_and_charges:F.taxes_and_charges||""}),T(F.taxes||[])},[P]);y.useEffect(()=>{const F=D.company;!a||!F||fetch(`/api/resource/Company/${encodeURIComponent(F)}`,{credentials:"include"}).then(X=>X.json()).then(X=>{var R;if((R=X.data)!=null&&R.default_currency){const I=Va(X.data.default_currency);z(te=>Se(ee({},te),{currency:I,selling_price_list:te.selling_price_list||"Standard Selling",price_list_currency:te.price_list_currency||I}))}}).catch(()=>{})},[D.company,a]),y.useEffect(()=>{!a||!s||cs.getSalesOrder(s).then(F=>{var X;z(R=>Se(ee({},R),{customer:F.customer||R.customer,company:F.company||R.company,project:F.project||R.project,cost_center:F.cost_center||R.cost_center,currency:F.currency||R.currency,selling_price_list:F.selling_price_list||"Standard Selling",price_list_currency:F.price_list_currency||F.currency,conversion_rate:F.conversion_rate||1,plc_conversion_rate:F.plc_conversion_rate||1,taxes_and_charges:F.taxes_and_charges||"",tax_category:F.tax_category||"",items:(F.items||[]).map(I=>{var te;return{item_code:I.item_code,item_name:I.item_name,description:I.description||I.item_name||I.item_code,qty:I.qty,uom:I.uom,stock_uom:I.stock_uom,rate:I.rate,amount:I.amount,against_sales_order:s,so_detail:I.name||void 0,conversion_factor:(te=I.conversion_factor)!=null?te:1,warehouse:I.warehouse||void 0,expense_account:I.expense_account||void 0,cost_center:I.cost_center||F.cost_center||void 0,project:I.project||F.project||void 0}})})),F.taxes_and_charges?H(F.taxes_and_charges):(X=F.taxes)!=null&&X.length&&T(F.taxes.map(R=>{var I,te,q;return{charge_type:R.charge_type,account_head:R.account_head,description:R.description,rate:(te=(I=R.rate)!=null?I:R.tax_rate)!=null?te:0,cost_center:R.cost_center,account_currency:R.account_currency,included_in_print_rate:(q=R.included_in_print_rate)!=null?q:0}}))}).catch(()=>{})},[a,s]),y.useEffect(()=>{a||(m(!0),Dc.getDeliveryNote(e).then(F=>{f(F),G(F)}).catch(F=>$e.error(F.message)).finally(()=>m(!1)))},[e,a,G]);const V=(F,X)=>z(R=>Se(ee({},R),{[F]:X})),ne=(F,X,R)=>z(I=>{const te=[...I.items||[]],q=Se(ee({},te[F]),{[X]:R});if(X==="qty"||X==="rate"){const B=parseFloat(String(X==="qty"?R:q.qty))||0,je=parseFloat(String(X==="rate"?R:q.rate))||0;q.amount=parseFloat((B*je).toFixed(4))}return te[F]=q,Se(ee({},I),{items:te})}),ge=(F,X)=>fe(null,null,function*(){if(ne(F,"item_code",X),!!X)try{const te=(yield(yield fetch(`/api/resource/Item/${encodeURIComponent(X)}`,{credentials:"include"})).json()).data;if(!te)return;z(q=>{const B=[...q.items||[]];return B[F]=Se(ee({},B[F]),{item_code:X,item_name:te.item_name||X,stock_uom:te.stock_uom||"",uom:te.sales_uom||te.stock_uom||"",description:te.description||""}),Se(ee({},q),{items:B})})}catch(R){}}),Z=F=>{z(X=>{const R=[...X.items||[]],I=F!==void 0?F+1:R.length;return R.splice(I,0,g1e()),Se(ee({},X),{items:R})})},U=F=>{z(X=>{const R=[...X.items||[]];return R.splice(F,1),Se(ee({},X),{items:R})}),N(null)},ce=(F,X,R)=>T(I=>{const te=[...I];return te[F]=Se(ee({},te[F]),{[X]:R}),te}),xe=()=>T(F=>[...F,x1e()]),be=F=>{T(X=>{const R=[...X];return R.splice(F,1),R}),E(null)},me=(D.items||[]).reduce((F,X)=>F+(X.amount||0),0),oe=A.reduce((F,X)=>{const R=mi(X);return X.charge_type==="On Net Total"?F+me*(R/100):X.charge_type==="Actual"?F+(X.tax_amount||0):F+me*(R/100)},0),L=me+oe,H=F=>fe(null,null,function*(){var X;if(F)try{const te=(yield(yield fetch(`/api/resource/Sales Taxes and Charges Template/${encodeURIComponent(F)}`,{credentials:"include"})).json()).data;(X=te==null?void 0:te.taxes)!=null&&X.length&&T(te.taxes.map(q=>{var B;return{charge_type:q.charge_type,account_head:q.account_head,description:q.description,rate:q.rate,cost_center:q.cost_center,account_currency:q.account_currency,included_in_print_rate:(B=q.included_in_print_rate)!=null?B:0}}))}catch(R){}});y.useEffect(()=>{!a||s||H(i0)},[a,s]);const K=F=>({customer:D.customer,company:D.company||void 0,project:D.project||void 0,cost_center:D.cost_center||void 0,posting_date:D.posting_date,currency:D.currency||void 0,selling_price_list:D.selling_price_list||"Standard Selling",price_list_currency:D.price_list_currency||D.currency||void 0,conversion_rate:D.conversion_rate||1,plc_conversion_rate:D.plc_conversion_rate||1,tax_category:D.tax_category||void 0,taxes_and_charges:D.taxes_and_charges||void 0,items:(F||D.items||[]).filter(X=>X.item_code).map((X,R)=>{var I,te,q,B,je,Ce,ye,Ee,Xe,tt,ve;return{item_code:X.item_code,item_name:X.item_name||X.item_code,description:X.description||void 0,qty:(I=X.qty)!=null?I:1,uom:X.uom||void 0,stock_uom:X.stock_uom||void 0,conversion_factor:(te=X.conversion_factor)!=null?te:1,price_list_rate:(q=X.price_list_rate)!=null?q:0,discount_percentage:(B=X.discount_percentage)!=null?B:0,discount_amount:(je=X.discount_amount)!=null?je:0,rate:(Ce=X.rate)!=null?Ce:0,amount:(ye=X.amount)!=null?ye:0,is_free_item:(Ee=X.is_free_item)!=null?Ee:0,grant_commission:(Xe=X.grant_commission)!=null?Xe:0,warehouse:X.warehouse||void 0,expense_account:X.expense_account||void 0,cost_center:X.cost_center||void 0,project:X.project||D.project||void 0,against_sales_order:X.against_sales_order||void 0,so_detail:X.so_detail||void 0,weight_per_unit:(tt=X.weight_per_unit)!=null?tt:0,total_weight:(ve=X.total_weight)!=null?ve:0,idx:R+1}}),taxes:A.filter(X=>X.account_head).map((X,R)=>{var I,te;return{charge_type:X.charge_type||"On Net Total",account_head:X.account_head,description:X.description||X.account_head,included_in_print_rate:(I=X.included_in_print_rate)!=null?I:0,rate:(te=X.rate)!=null?te:0,cost_center:X.cost_center||void 0,account_currency:X.account_currency||void 0,idx:R+1}})}),Y=F=>fe(null,null,function*(){const X=F.filter(I=>I.against_sales_order&&!I.so_detail);if(!X.length)return F;const R=X[0].against_sales_order;try{const q=((yield(yield fetch(`/api/resource/Sales%20Order%20Item?filters=${encodeURIComponent(JSON.stringify([["parent","=",R]]))}&fields=${encodeURIComponent(JSON.stringify(["name","item_code","idx"]))}&limit=100`,{credentials:"include"})).json()).data||[]).sort((je,Ce)=>(je.idx||0)-(Ce.idx||0)),B=new Set;return F.map(je=>{if(!je.against_sales_order||je.so_detail)return je;const Ce=q.find(ye=>ye.item_code===je.item_code&&!B.has(ye.name));return Ce?(B.add(Ce.name),Se(ee({},je),{so_detail:Ce.name})):je})}catch(I){return F}}),re=()=>fe(null,null,function*(){if(!D.customer){$e.error("Customer is required");return}try{v(!0);const F=yield Y([...D.items||[]]);if(a){const X=yield Dc.createDeliveryNote(K(F));$e.success("Delivery Note created"),k(!1),r(`/delivery-notes/${X.name}`)}else{const X=yield Dc.updateDeliveryNote(e,K(F));f(X),G(X),$e.success("Delivery Note saved"),k(!1)}}catch(F){$e.error(Ya(F)||"Error saving")}finally{v(!1)}}),de=()=>fe(null,null,function*(){if(!(!e||a))try{w(!0);const F=yield Dc.submitDeliveryNote(e);f(F),G(F),$e.success("Delivery Note submitted")}catch(F){$e.error(Ya(F)||"Error submitting")}finally{w(!1)}}),ie=()=>{const F=new URLSearchParams;F.set("dn",e),D.customer&&F.set("customer",D.customer),D.company&&F.set("company",String(D.company)),D.project&&F.set("project",String(D.project)),r(`/invoices/new?${F.toString()}`)},se=a||j,he=!a&&(d==null?void 0:d.docstatus)===1;return p?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-teal-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-6 text-gray-500",children:[n.jsx("button",{onClick:()=>r("/projects"),className:"hover:text-indigo-600",children:"Project Management"}),n.jsx("span",{children:"/"}),n.jsx("button",{onClick:()=>r("/delivery-notes"),className:"hover:text-indigo-600",children:"Delivery Notes"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:a?"New Delivery Note":e})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 dark:border-gray-700 flex items-center justify-between gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>r("/delivery-notes"),className:"text-gray-400 hover:text-gray-700",children:n.jsx(da,{})}),n.jsx(Yx,{className:"text-teal-500"}),n.jsx("div",{children:n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:a?"New Delivery Note":D.customer||e}),!a&&n.jsx("span",{className:"text-sm text-gray-400 font-normal",children:e}),!a&&n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${(()=>{const F=(d==null?void 0:d.status)||"";return(d==null?void 0:d.docstatus)===2||F==="Cancelled"?"bg-red-100 text-red-700":!d||d.docstatus===0?"bg-yellow-100 text-yellow-800":F==="Completed"?"bg-green-100 text-green-800":F==="To Bill"?"bg-blue-100 text-blue-800":F==="Return Issued"?"bg-orange-100 text-orange-800":F==="Closed"?"bg-gray-100 text-gray-700":"bg-green-100 text-green-800"})()}`,children:(d==null?void 0:d.docstatus)===2?"Cancelled":(d==null?void 0:d.docstatus)===0?"Draft":(d==null?void 0:d.status)||"Submitted"})]})})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[he&&n.jsx(h1e,{items:[{label:"Sales Invoice",icon:n.jsx(Kc,{size:13}),onClick:ie}]}),!a&&!j&&(d==null?void 0:d.docstatus)===0&&n.jsxs("button",{onClick:de,disabled:b,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 text-sm font-medium",children:[b?n.jsx(vt,{className:"animate-spin"}):n.jsx(cu,{size:12})," Submit"]}),!a&&!j&&!he&&n.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-2 px-4 py-2 border border-teal-500 text-teal-600 rounded-lg hover:bg-teal-50 text-sm",children:[n.jsx(ha,{})," Edit"]}),se&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:re,disabled:x,className:"flex items-center gap-2 px-4 py-2 bg-teal-600 text-white rounded-lg hover:bg-teal-700 disabled:opacity-50 text-sm font-medium",children:[x?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),x?"Saving…":"Save"]}),!a&&n.jsx("button",{onClick:()=>{d&&G(d),k(!1)},className:"px-3 py-2 border border-gray-300 rounded-lg text-gray-600 text-sm",children:n.jsx(yt,{})})]})]})]}),n.jsx("div",{className:"px-6 pt-5 pb-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(It,{required:!0,children:"Customer"}),se?n.jsx(Be,{label:"Customer",hideLabel:!0,doctype:"Customer",value:D.customer||"",onChange:F=>V("customer",F),placeholder:"Select customer…"}):n.jsx(Ms,{children:D.customer})]}),n.jsxs("div",{children:[n.jsx(It,{required:!0,children:"Posting Date"}),se?n.jsx("input",{type:"date",value:D.posting_date||"",onChange:F=>V("posting_date",F.target.value),className:pO}):n.jsx(Ms,{children:D.posting_date})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Company"}),se?n.jsx(Be,{label:"Company",hideLabel:!0,doctype:"Company",value:D.company||"",onChange:F=>V("company",F),placeholder:"Select company…"}):n.jsx(Ms,{children:D.company})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Project"}),se?n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:D.project||"",onChange:F=>V("project",F),placeholder:"Select project…"}):n.jsx(Ms,{children:D.project})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Currency"}),se?n.jsxs("select",{value:D.currency||xt,onChange:F=>V("currency",F.target.value),className:pO,children:[n.jsx("option",{value:"SAR",children:"SAR"}),n.jsx("option",{value:"USD",children:"USD"}),n.jsx("option",{value:"EUR",children:"EUR"})]}):n.jsx(Ms,{children:D.currency})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Cost Center"}),se?n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:D.cost_center||"",onChange:F=>V("cost_center",F)}):n.jsx(Ms,{children:D.cost_center})]}),s&&n.jsxs("div",{children:[n.jsx(It,{children:"Against Sales Order"}),n.jsx(Ms,{children:s})]})]})}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:"px-6 py-3 bg-gray-50 dark:bg-gray-900/20 border-b border-gray-100 dark:border-gray-700",children:n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Items"})}),n.jsx("div",{className:"px-6 pb-4",children:n.jsx("div",{className:"overflow-x-auto -mx-2 mt-3",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 min-w-[180px]",children:["Item Code ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:["UOM ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:["Qty ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:["Rate (",D.currency||xt,")"]}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:["Amount (",D.currency||xt,")"]}),se&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[(D.items||[]).map((F,X)=>{var R,I,te,q;return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${C===X?"bg-blue-50/60 dark:bg-blue-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:X+1}),n.jsx("td",{className:"py-1.5 px-2 min-w-[180px]",children:se?n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:F.item_code||"",onChange:B=>ge(X,B),placeholder:"Item Code"}):n.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-200",children:F.item_code||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-28",children:se?n.jsx(Be,{label:"UOM",hideLabel:!0,doctype:"UOM",value:F.uom||"",onChange:B=>ne(X,"uom",B),placeholder:"UOM"}):n.jsx("span",{className:"text-gray-500 text-sm",children:F.uom||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:se?n.jsx("input",{type:"number",min:0,step:"1",value:(R=F.qty)!=null?R:1,onChange:B=>ne(X,"qty",parseFloat(B.target.value)||0),className:Nw}):n.jsx("span",{className:"block text-right text-sm pr-1",children:(I=F.qty)!=null?I:0})}),n.jsx("td",{className:"py-1.5 px-2 w-28",children:se?n.jsx("input",{type:"number",min:0,step:"0.01",value:(te=F.rate)!=null?te:0,onChange:B=>ne(X,"rate",parseFloat(B.target.value)||0),className:Nw}):n.jsx("span",{className:"block text-right text-sm pr-1",children:((q=F.rate)!=null?q:0).toFixed(2)})}),n.jsx("td",{className:"py-1.5 px-3 text-right font-semibold text-gray-900 dark:text-white text-sm",children:((F.qty||0)*(F.rate||0)).toFixed(2)}),se&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>N(C===X?null:X),className:`p-1.5 rounded text-xs ${C===X?"bg-teal-600 text-white":"text-teal-600 hover:bg-teal-50"}`,title:"More fields",children:n.jsx(Vs,{size:11})}),n.jsx("button",{onClick:()=>U(X),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:n.jsx(Za,{size:11})})]})})]}),se&&C===X&&n.jsx(p1e,{item:F,rowNo:X+1,currency:D.currency||xt,onChange:(B,je)=>{B==="item_code"?ge(X,je):ne(X,B,je)},onClose:()=>N(null),onDelete:()=>U(X),onInsertBelow:()=>Z(X)})]},X)}),se&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{onClick:()=>Z(),className:"flex items-center gap-1.5 text-teal-600 hover:text-teal-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})})})]}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:"px-6 py-3 bg-gray-50 dark:bg-gray-900/20 border-b border-gray-100 dark:border-gray-700",children:n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Taxes and Charges"})}),n.jsxs("div",{className:"px-6 pt-4 pb-2 grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-3",children:[n.jsxs("div",{children:[n.jsx(It,{children:"Tax Category"}),se?n.jsx(Be,{label:"Tax Category",hideLabel:!0,doctype:"Tax Category",value:D.tax_category||"",onChange:F=>V("tax_category",F),placeholder:"Select tax category…"}):n.jsx(Ms,{children:D.tax_category})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Sales Taxes and Charges Template"}),se?n.jsx(Be,{label:"Sales Taxes and Charges Template",hideLabel:!0,doctype:"Sales Taxes and Charges Template",value:D.taxes_and_charges||"",onChange:F=>{V("taxes_and_charges",F),H(F)},placeholder:"Select template…"}):n.jsx(Ms,{children:D.taxes_and_charges})]})]}),n.jsx("div",{className:"px-6 pb-4 mt-3",children:n.jsx("div",{className:"overflow-x-auto -mx-2",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-36",children:["Type ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 min-w-[180px]",children:["Account Head ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:"Tax Rate"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Amount"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Total"}),se&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[A.map((F,X)=>{var te,q;const R=F.charge_type==="On Net Total"?me*((F.rate||0)/100):F.tax_amount||0,I=me+A.slice(0,X+1).reduce((B,je)=>B+(je.charge_type==="On Net Total"?me*((je.rate||0)/100):je.tax_amount||0),0);return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${O===X?"bg-blue-50/60 dark:bg-blue-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:X+1}),n.jsx("td",{className:"py-1.5 px-2 w-36",children:se?n.jsxs("select",{value:F.charge_type||"",onChange:B=>ce(X,"charge_type",B.target.value),className:f1e,children:[n.jsx("option",{value:"",children:"Type…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"})]}):n.jsx("span",{className:"text-sm text-gray-700",children:F.charge_type||"-"})}),n.jsx("td",{className:"py-1.5 px-2 min-w-[180px]",children:se?n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:F.account_head||"",onChange:B=>ce(X,"account_head",B),placeholder:"Account…"}):n.jsx("span",{className:"text-sm text-gray-700",children:F.account_head||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:se?n.jsx("input",{type:"number",min:0,step:"0.01",value:(te=F.rate)!=null?te:0,onChange:B=>ce(X,"rate",parseFloat(B.target.value)||0),className:Nw}):n.jsx("span",{className:"block text-right text-sm pr-1",children:(q=F.rate)!=null?q:0})}),n.jsx("td",{className:"py-1.5 px-3 text-right text-sm text-gray-700 dark:text-gray-300",children:R.toFixed(2)}),n.jsx("td",{className:"py-1.5 px-3 text-right text-sm font-semibold text-gray-900 dark:text-white",children:I.toFixed(2)}),se&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>E(O===X?null:X),className:`p-1.5 rounded text-xs ${O===X?"bg-teal-600 text-white":"text-teal-600 hover:bg-teal-50"}`,children:n.jsx(Vs,{size:11})}),n.jsx("button",{onClick:()=>be(X),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:n.jsx(Za,{size:11})})]})})]}),se&&O===X&&n.jsx(m1e,{tax:F,rowNo:X+1,onChange:(B,je)=>ce(X,B,je),onClose:()=>E(null),onDelete:()=>be(X)})]},X)}),se&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{onClick:xe,className:"flex items-center gap-1.5 text-teal-600 hover:text-teal-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Tax Row"]})})})]})]})})})]}),n.jsx("div",{className:"border-t border-gray-100 dark:border-gray-700 px-6 py-4",children:n.jsx("div",{className:"flex justify-end",children:n.jsxs("div",{className:"w-full max-w-xs space-y-2 text-sm",children:[n.jsxs("div",{className:"flex justify-between text-gray-600 dark:text-gray-400",children:[n.jsxs("span",{children:["Net Total (",Va(D.currency),")"]}),n.jsx("span",{className:"font-medium",children:me.toFixed(2)})]}),n.jsxs("div",{className:"flex justify-between text-gray-600 dark:text-gray-400",children:[n.jsxs("span",{children:["Total Taxes and Charges (",Va(D.currency),")"]}),n.jsx("span",{className:"font-medium",children:((_e=d==null?void 0:d.total_taxes_and_charges)!=null?_e:oe).toFixed(2)})]}),n.jsxs("div",{className:"flex justify-between font-bold text-gray-900 dark:text-white border-t border-gray-200 dark:border-gray-700 pt-2 text-base",children:[n.jsxs("span",{children:["Grand Total (",Va(D.currency),")"]}),n.jsx("span",{children:L.toFixed(2)})]})]})})}),!a&&d&&n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700 px-6 py-4 grid grid-cols-3 gap-4 text-sm bg-gray-50 dark:bg-gray-900/20",children:[n.jsxs("div",{children:[n.jsx(It,{children:"Created By"}),n.jsx(Ms,{children:d.owner})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Created"}),n.jsx(Ms,{children:d.creation?new Date(d.creation).toLocaleString():"-"})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Modified"}),n.jsx(Ms,{children:d.modified?new Date(d.modified).toLocaleString():"-"})]})]}),!a&&n.jsx(Yn,{doctype:"Delivery Note",docname:(d==null?void 0:d.name)||e||"",creationDate:d==null?void 0:d.creation,createdBy:d==null?void 0:d.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})},kc=20;function v1e(e){const t=[];return e.search&&t.push(["Material Request","name","like",`%${e.search}%`]),e.status==="Draft"&&t.push(["Material Request","docstatus","=",0]),e.status==="Submitted"&&t.push(["Material Request","docstatus","=",1]),e.status==="Cancelled"&&t.push(["Material Request","docstatus","=",2]),e.type&&t.push(["Material Request","material_request_type","=",e.type]),t}function b1e(e){return e.docstatus===2?"bg-red-100 text-red-700":e.docstatus===1?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-800"}function w1e(e){return e.docstatus===2?"Cancelled":e.docstatus===1?e.status||"Submitted":e.status||"Draft"}const j1e=()=>{const{t:e}=sr(),t=Ut(),[r,a]=y.useState([]),[s,i]=y.useState(!0),[l,u]=y.useState(0),[d,f]=y.useState(0),[p,m]=y.useState(!1),[x,v]=y.useState(""),[b,w]=y.useState(""),[j,k]=y.useState(""),[C,N]=y.useState({search:"",status:"",type:""}),[O,E]=y.useState(!1),A=y.useCallback((xe,be)=>fe(null,null,function*(){i(!0);try{const me=[];be.search&&me.push(["Material Request","name","like",`%${be.search}%`]),be.status==="Draft"&&me.push(["Material Request","docstatus","=",0]),be.status==="Submitted"&&me.push(["Material Request","docstatus","=",1]),be.status==="Cancelled"&&me.push(["Material Request","docstatus","=",2]),be.type&&me.push(["Material Request","material_request_type","=",be.type]);const[oe,L]=yield Promise.all([Fc.getMaterialRequests({filters:me,limit_start:xe,limit_page_length:kc}),Fc.getMaterialRequestCount(me)]);a(oe),u(L)}catch(me){$e.error(me.message||"Failed to load")}finally{i(!1)}}),[]);y.useEffect(()=>{A(0,C)},[A,C]);const T=y.useMemo(()=>`${d}|${C.search}|${C.status}|${C.type}`,[d,C.search,C.status,C.type]),{selectedRows:P,toggleRow:D,toggleAllOnPage:z,allOnPageSelected:G,someOnPageSelected:V}=Vn(r,T),ne=()=>{N({search:x,status:b,type:j}),f(0)},ge=()=>{v(""),w(""),k(""),N({search:"",status:"",type:""}),f(0)},Z=!!(C.search||C.status||C.type),U=xe=>{f(xe),A(xe*kc,C)},ce=y.useCallback(()=>Kn({doctype:"Material Request",filters:v1e(C),orderBy:"modified desc"}),[C]);return n.jsxs("div",{className:"p-6",children:[n.jsx(Br,{position:"top-right",autoClose:3e3}),n.jsxs("div",{className:"flex items-center justify-between mb-6 gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-orange-500 flex items-center justify-center",children:n.jsx(zd,{className:"text-white text-base"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Material Requests"}),n.jsxs("p",{className:"text-xs text-gray-500",children:[l," total"]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("button",{onClick:()=>A(d*kc,C),className:"p-2 text-gray-500 hover:text-indigo-600 border border-gray-200 rounded-lg",children:n.jsx(en,{size:13})}),n.jsxs("button",{type:"button",onClick:()=>E(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:l===0&&P.size===0,children:[n.jsx(hn,{})," ",e("listPages.export"),P.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:P.size})]}),n.jsxs("button",{onClick:()=>t("/material-requests/new"),className:"flex items-center gap-2 px-4 py-2 bg-orange-500 text-white rounded-lg hover:bg-orange-600 text-sm font-medium",children:[n.jsx(Pt,{size:11})," New Request"]})]})]}),n.jsx(Gn,{isOpen:O,onClose:()=>E(!1),doctype:"Material Request",selectedCount:P.size,pageCount:r.length,totalCount:l,pageData:r,selectedRows:P,rowKey:"name",onFetchAll:ce,fileNamePrefix:"material_requests"}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl mb-5 overflow-hidden",children:[n.jsxs("button",{onClick:()=>m(xe=>!xe),className:"w-full flex items-center justify-between px-4 py-3 bg-gradient-to-r from-indigo-600 to-indigo-700 text-white",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[n.jsx(fn,{size:12})," Filters ",Z&&n.jsx("span",{className:"bg-white/30 text-white text-xs px-2 py-0.5 rounded-full",children:"Active"})]}),p?n.jsx(ps,{size:11}):n.jsx(nr,{size:11})]}),Z&&n.jsxs("div",{className:"px-4 py-2 bg-indigo-50 dark:bg-indigo-900/20 flex flex-wrap gap-2 items-center border-b border-indigo-100",children:[C.search&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-indigo-100 text-indigo-700 px-2 py-1 rounded-full",children:["ID: ",C.search,n.jsx("button",{onClick:()=>{v(""),N(xe=>Se(ee({},xe),{search:""}))},children:n.jsx(yt,{size:9})})]}),C.status&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-indigo-100 text-indigo-700 px-2 py-1 rounded-full",children:["Status: ",C.status,n.jsx("button",{onClick:()=>{w(""),N(xe=>Se(ee({},xe),{status:""}))},children:n.jsx(yt,{size:9})})]}),C.type&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-indigo-100 text-indigo-700 px-2 py-1 rounded-full",children:["Type: ",C.type,n.jsx("button",{onClick:()=>{k(""),N(xe=>Se(ee({},xe),{type:""}))},children:n.jsx(yt,{size:9})})]}),n.jsx("button",{onClick:ge,className:"text-xs text-indigo-600 hover:underline ml-auto",children:"Clear All"})]}),p&&n.jsxs("div",{className:"px-4 py-3 grid grid-cols-1 sm:grid-cols-4 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Request ID"}),n.jsx("input",{value:x,onChange:xe=>v(xe.target.value),onKeyDown:xe=>xe.key==="Enter"&&ne(),placeholder:"Search…",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-400"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Type"}),n.jsxs("select",{value:j,onChange:xe=>k(xe.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-400",children:[n.jsx("option",{value:"",children:"All"}),n.jsx("option",{value:"Purchase",children:"Purchase"}),n.jsx("option",{value:"Material Transfer",children:"Material Transfer"}),n.jsx("option",{value:"Manufacture",children:"Manufacture"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Status"}),n.jsxs("select",{value:b,onChange:xe=>w(xe.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-400",children:[n.jsx("option",{value:"",children:"All"}),n.jsx("option",{value:"Draft",children:"Draft"}),n.jsx("option",{value:"Submitted",children:"Submitted"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]})]}),n.jsxs("div",{className:"flex items-end gap-2",children:[n.jsx("button",{onClick:ne,className:"px-4 py-2 bg-indigo-600 text-white text-sm rounded hover:bg-indigo-700",children:"Apply"}),n.jsx("button",{onClick:ge,className:"px-4 py-2 border border-gray-300 text-gray-600 text-sm rounded hover:bg-gray-50",children:"Clear"})]})]})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"w-10 px-2 py-3",children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-orange-600 focus:ring-orange-500",checked:G,ref:xe=>{xe&&(xe.indeterminate=V)},onChange:z,"aria-label":"Select all on page"})}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Request ID"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Type"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Date"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Company"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Status"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:s?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"text-center py-10 text-gray-400",children:"Loading…"})}):r.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"text-center py-10 text-gray-400",children:"No material requests found"})}):r.map(xe=>n.jsxs("tr",{onClick:()=>t(`/material-requests/${xe.name}`),className:`cursor-pointer hover:bg-orange-50 dark:hover:bg-orange-900/10 transition-colors ${P.has(xe.name)?"bg-orange-50/90 dark:bg-orange-900/20":""}`,children:[n.jsx("td",{className:"w-10 px-2 py-3",onClick:be=>be.stopPropagation(),children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-orange-600 focus:ring-orange-500",checked:P.has(xe.name),onChange:()=>D(xe.name),"aria-label":`Select ${xe.name}`})}),n.jsx("td",{className:"py-3 px-4 font-medium text-orange-600",children:xe.name}),n.jsx("td",{className:"py-3 px-4 text-gray-700 dark:text-gray-300",children:xe.material_request_type||"-"}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:xe.transaction_date||"-"}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:xe.company||"-"}),n.jsx("td",{className:"py-3 px-4",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${b1e(xe)}`,children:w1e(xe)})})]},xe.name))})]})}),l>kc&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:[d*kc+1,"",Math.min((d+1)*kc,l)," of ",l]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{disabled:d===0,onClick:()=>U(d-1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Prev"}),n.jsx("button",{disabled:(d+1)*kc>=l,onClick:()=>U(d+1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Next"})]})]})]})]})};let Rd=null,Fd=null;const _1e=(e,t)=>{Rd=e,t&&(Fd=t),console.log("[Workflow] User set manually:",e,"Roles:",t)},k1e=()=>{Rd=null,Fd=null},ev=()=>fe(null,null,function*(){try{if(Rd&&Fd)return console.log("[Workflow] Using cached user:",Rd,"roles:",Fd),{user:Rd,roles:Fd};const e=yield Ja.getUserDetails();if(e&&e.email){const t=e.email||e.user_id,r=e.roles||[];return Rd=t,Fd=r,console.log("[Workflow] User from getUserDetails():",t),console.log("[Workflow] Roles from getUserDetails():",r),{user:t,roles:r}}return console.warn("[Workflow] getUserDetails() returned no user"),{user:"",roles:[]}}catch(e){return console.error("[Workflow] Error getting user details:",e),{user:"",roles:[]}}}),S1e=()=>fe(null,null,function*(){const{user:e}=yield ev();return e}),tv=()=>fe(null,null,function*(){const{roles:e}=yield ev();return e}),N1e=["System Manager","System User","Manager","Administrator","Admin"],dp=e=>String(e!=null?e:"").trim().toLowerCase(),bL=new Set(N1e.map(e=>dp(e))),wL=e=>e.some(t=>dp(t)==="system manager"),C1e=e=>e.some(t=>bL.has(dp(t))),T1e=()=>fe(null,null,function*(){try{const e=yield tv(),t=wL(e);return console.log("[Workflow] Is System Manager:",t,"Roles:",e),t}catch(e){return console.error("[Workflow] Error checking System Manager role:",e),!1}}),E1e=e=>dp(e)==="administrator",fp=()=>fe(null,null,function*(){try{const{user:e,roles:t}=yield ev();if(E1e(e))return console.log("[Workflow] Full access: Administrator user"),!0;if(wL(t))return console.log("[Workflow] Full access: System Manager role"),!0;if(C1e(t)){const r=t.filter(a=>bL.has(dp(a)));return console.log("[Workflow] Full-access role(s):",r),!0}return!1}catch(e){return console.error("[Workflow] Error checking full-access roles:",e),!1}}),bS=(e,t)=>{if(!e||e.trim()==="")return!0;try{console.log("[Workflow] Evaluating condition:",e),console.log("[Workflow] Document data for condition:",{asset_type:t.asset_type,site_name:t.site_name,need_procurement:t.need_procurement,custom_assign_to_contractor:t.custom_assign_to_contractor,docstatus:t.docstatus});let r=e;r=r.replace(/\band\b/g,"&&"),r=r.replace(/\bor\b/g,"||"),r=r.replace(/\bnot\s+/g,"!"),r=r.replace(/\bTrue\b/g,"true"),r=r.replace(/\bFalse\b/g,"false"),r=r.replace(/\bNone\b/g,"null"),r=r.replace(/doc\.(\w+)/g,(s,i)=>{const l=t[i];return l==null||l===""?"false":typeof l=="string"?`"${l.replace(/"/g,'\\"')}"`:typeof l=="boolean"?l?"true":"false":typeof l=="number"?String(l):JSON.stringify(l)}),r=r.replace(/== 1/g,"=== 1"),r=r.replace(/== 0/g,"=== 0"),r=r.replace(/!= 1/g,"!== 1"),r=r.replace(/!= 0/g,"!== 0"),console.log("[Workflow] Transformed condition:",r);const a=new Function(`return (${r})`)();return console.log("[Workflow] Condition result:",a),!!a}catch(r){return console.error("[Workflow] Error evaluating condition:",e,r),!1}},rv=e=>fe(null,null,function*(){var t,r,a,s;try{console.log("[Workflow] Getting workflow info for doctype:",e);const i=yield Ja.apiCall(`/api/resource/Workflow?filters=[["document_type","=","${e}"],["is_active","=",1]]&fields=["name","workflow_state_field"]&limit=1`);if(console.log("[Workflow] Workflow response:",i),!(i!=null&&i.data)||i.data.length===0)return console.warn("[Workflow] No active workflow found for doctype:",e),null;const l=i.data[0].name;console.log("[Workflow] Found workflow:",l);const u=yield Ja.apiCall(`/api/resource/Workflow/${encodeURIComponent(l)}`);return console.log("[Workflow] Full workflow data:",u==null?void 0:u.data),console.log("[Workflow] Transitions count:",(r=(t=u==null?void 0:u.data)==null?void 0:t.transitions)==null?void 0:r.length),console.log("[Workflow] States count:",(s=(a=u==null?void 0:u.data)==null?void 0:a.states)==null?void 0:s.length),{workflow_name:u.data.name,workflow_state:"",workflow_state_field:u.data.workflow_state_field,transitions:u.data.transitions||[],states:u.data.states||[]}}catch(i){return console.error("[Workflow] Error fetching workflow info:",i),null}}),jL=(e,t,r)=>fe(null,null,function*(){try{console.log("[Workflow] Getting all transitions for state:",t);const a=yield rv(e);if(!a)return console.warn("[Workflow] No workflow info found"),[];console.log("[Workflow] All transitions from workflow:",a.transitions.length);let s=a.transitions.filter(u=>u.state===t);console.log("[Workflow] Transitions for state",t,":",s.length),r&&(s=s.filter(u=>{const d=bS(u.condition,r);return console.log(`[Workflow] Transition "${u.action}" (allowed: ${u.allowed}) condition "${u.condition||"none"}" = ${d}`),d}),console.log("[Workflow] Transitions after condition evaluation:",s.length));const i=new Set,l=[];for(const u of s){const d=`${u.action}::${u.next_state}`;i.has(d)?console.log(`[Workflow] Skipping duplicate: ${u.action} → ${u.next_state} (allowed: ${u.allowed})`):(i.add(d),l.push(u))}return console.log("[Workflow] Unique transitions after deduplication:",l.length),l}catch(a){return console.error("[Workflow] Error fetching all transitions:",a),[]}}),A1e=(e,t,r,a)=>fe(null,null,function*(){var s;try{console.log("[Workflow] getWorkflowTransitions called with:",{doctype:e,docname:t,currentState:r});const i=yield fp(),l=yield tv();if(console.log("[Workflow] User has full workflow access:",i),console.log("[Workflow] User roles:",l),i&&r){console.log("[Workflow] Full-access user: all transitions for state:",r);const f=yield jL(e,r,a);return console.log("[Workflow] Final transitions for full-access user:",f.map(p=>`${p.action} → ${p.next_state}`)),f}console.log("[Workflow] Standard user, using Frappe API");const u=yield Ja.apiCall("/api/method/frappe.model.workflow.get_transitions",{method:"POST",body:JSON.stringify({doc:JSON.stringify({doctype:e,name:t})})});console.log("[Workflow] Frappe transitions raw response:",u);let d=[];if(Array.isArray(u)?d=u:u!=null&&u.message&&Array.isArray(u.message)?d=u.message:u!=null&&u.data&&Array.isArray(u.data)?d=u.data:(s=u==null?void 0:u.data)!=null&&s.message&&Array.isArray(u.data.message)&&(d=u.data.message),console.log("[Workflow] Parsed transitions:",d),console.log("[Workflow] Transitions count:",d.length),d.length===0&&r&&a){console.log("[Workflow] Frappe API returned no transitions, trying local filtering");const f=yield rv(e);if(f){const p=f.transitions.filter(v=>!(v.state!==r||!l.includes(v.allowed)||!bS(v.condition,a))),m=new Set,x=[];for(const v of p){const b=`${v.action}::${v.next_state}`;m.has(b)||(m.add(b),x.push(v))}return console.log("[Workflow] Local filtered transitions:",x),x}}return d}catch(i){return console.error("[Workflow] Error fetching workflow transitions:",i),[]}}),O1e=(e,t,r,a)=>fe(null,null,function*(){try{if(console.log("[Workflow] Applying action:",{doctype:e,docname:t,action:r,nextState:a}),(yield fp())&&a)try{const l=yield Ja.apiCall("/api/method/frappe.model.workflow.apply_workflow",{method:"POST",body:JSON.stringify({doc:JSON.stringify({doctype:e,name:t}),action:r})});return console.log("[Workflow] Action applied successfully via workflow API"),l==null?void 0:l.message}catch(l){console.log("[Workflow] Normal workflow failed, full-access user forcing state change...");const u=yield Ja.apiCall(`/api/resource/${e}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({workflow_state:a})});return console.log("[Workflow] Force update response:",u),u==null?void 0:u.data}const i=yield Ja.apiCall("/api/method/frappe.model.workflow.apply_workflow",{method:"POST",body:JSON.stringify({doc:JSON.stringify({doctype:e,name:t}),action:r})});return console.log("[Workflow] Action applied successfully"),i==null?void 0:i.message}catch(s){throw console.error("[Workflow] Error applying workflow action:",s),s}}),P1e=(e,t,r)=>fe(null,null,function*(){try{if(yield fp())return console.log("[Workflow] Full-access user can always edit"),!0;const a=yield rv(e);if(!a)return!0;const s=yield tv(),i=a.states.filter(u=>u.state===r);if(i.length===0)return!0;const l=i.some(u=>s.includes(u.allow_edit));return console.log("[Workflow] Can user edit:",l,"User roles:",s,"Allowed roles:",i.map(u=>u.allow_edit)),l}catch(a){return console.error("[Workflow] Error checking edit permission:",a),!1}}),_L=e=>{const t={Draft:{bg:"bg-gray-100 dark:bg-gray-700",text:"text-gray-800 dark:text-gray-200",border:"border-gray-300 dark:border-gray-600"},"Sent To Maintenance manger":{bg:"bg-blue-100 dark:bg-blue-900/30",text:"text-blue-800 dark:text-blue-200",border:"border-blue-300 dark:border-blue-600"},"Sent to Supervisor":{bg:"bg-blue-100 dark:bg-blue-900/30",text:"text-blue-800 dark:text-blue-200",border:"border-blue-300 dark:border-blue-600"},"Sent to Engineer":{bg:"bg-blue-100 dark:bg-blue-900/30",text:"text-blue-800 dark:text-blue-200",border:"border-blue-300 dark:border-blue-600"},"Sent to Work Control":{bg:"bg-blue-100 dark:bg-blue-900/30",text:"text-blue-800 dark:text-blue-200",border:"border-blue-300 dark:border-blue-600"},"Sent to technician":{bg:"bg-blue-100 dark:bg-blue-900/30",text:"text-blue-800 dark:text-blue-200",border:"border-blue-300 dark:border-blue-600"},"Sent to General WOA":{bg:"bg-blue-100 dark:bg-blue-900/30",text:"text-blue-800 dark:text-blue-200",border:"border-blue-300 dark:border-blue-600"},"Repair InProgress":{bg:"bg-yellow-100 dark:bg-yellow-900/30",text:"text-yellow-800 dark:text-yellow-200",border:"border-yellow-300 dark:border-yellow-600"},"Pending Purchase":{bg:"bg-orange-100 dark:bg-orange-900/30",text:"text-orange-800 dark:text-orange-200",border:"border-orange-300 dark:border-orange-600"},"Pending Approval":{bg:"bg-purple-100 dark:bg-purple-900/30",text:"text-purple-800 dark:text-purple-200",border:"border-purple-300 dark:border-purple-600"},Completed:{bg:"bg-green-100 dark:bg-green-900/30",text:"text-green-800 dark:text-green-200",border:"border-green-300 dark:border-green-600"},Approved:{bg:"bg-green-100 dark:bg-green-900/30",text:"text-green-800 dark:text-green-200",border:"border-green-300 dark:border-green-600"},Rejected:{bg:"bg-red-100 dark:bg-red-900/30",text:"text-red-800 dark:text-red-200",border:"border-red-300 dark:border-red-600"},Cancelled:{bg:"bg-red-100 dark:bg-red-900/30",text:"text-red-800 dark:text-red-200",border:"border-red-300 dark:border-red-600"},Closed:{bg:"bg-gray-100 dark:bg-gray-700",text:"text-gray-800 dark:text-gray-200",border:"border-gray-300 dark:border-gray-600"},Applied:{bg:"bg-blue-100 dark:bg-blue-900/30",text:"text-blue-800 dark:text-blue-200",border:"border-blue-300 dark:border-blue-600"},"Sent to Procurement User":{bg:"bg-indigo-100 dark:bg-indigo-900/30",text:"text-indigo-800 dark:text-indigo-200",border:"border-indigo-300 dark:border-indigo-600"}};return t[e]||t.Draft},kL=e=>({Apply:"bg-blue-600 hover:bg-blue-700 text-white","Assign Technician":"bg-blue-600 hover:bg-blue-700 text-white","Back To Controller":"bg-gray-600 hover:bg-gray-700 text-white","Send For Repair":"bg-yellow-600 hover:bg-yellow-700 text-white","Send For Approval":"bg-purple-600 hover:bg-purple-700 text-white","Send to Supervisor":"bg-purple-600 hover:bg-purple-700 text-white","Material Request":"bg-orange-600 hover:bg-orange-700 text-white",Accept:"bg-green-600 hover:bg-green-700 text-white",Reject:"bg-red-600 hover:bg-red-700 text-white",Close:"bg-gray-600 hover:bg-gray-700 text-white","Re-Open":"bg-blue-600 hover:bg-blue-700 text-white",Cancel:"bg-red-600 hover:bg-red-700 text-white",Approve:"bg-green-600 hover:bg-green-700 text-white"})[e]||"bg-blue-600 hover:bg-blue-700 text-white",SL=e=>({Apply:"📤","Send For Repair":"🔧","Send For Approval":"📋","Material Request":"📦",Accept:"✅",Reject:"❌",Close:"🔒","Re-Open":"🔓",Cancel:"🚫",Approve:"✅"})[e]||"▶️",kl={getWorkflowTransitions:A1e,applyWorkflowAction:O1e,getWorkflowInfo:rv,getCurrentUserRoles:tv,getCurrentUser:S1e,getCurrentUserAndRoles:ev,setCurrentUser:_1e,clearCurrentUser:k1e,canUserEditDocument:P1e,getWorkflowStateStyle:_L,getActionButtonStyle:kL,getActionIcon:SL,isSystemManager:T1e,hasWorkflowFullAccess:fp,getAllTransitionsForState:jL,evaluateCondition:bS},D1e=({doctype:e,docname:t,workflowState:r,enabled:a=!0,docData:s})=>{const[i,l]=y.useState([]),[u,d]=y.useState(null),[f,p]=y.useState([]),[m,x]=y.useState(""),[v,b]=y.useState(!1),[w,j]=y.useState(!1),[k,C]=y.useState(!1),[N,O]=y.useState(null),[E,A]=y.useState(!0);y.useEffect(()=>{if(!a)return;fe(null,null,function*(){try{const z=yield kl.getWorkflowInfo(e);d(z)}catch(z){console.error("Error fetching workflow info:",z)}})},[e,a]),y.useEffect(()=>{if(!a)return;fe(null,null,function*(){try{const[z,G,V,ne]=yield Promise.all([kl.getCurrentUserRoles(),kl.getCurrentUser(),kl.isSystemManager(),fp()]);p(z),x(G),b(V||ne),ne&&A(!0)}catch(z){console.error("Error fetching user info:",z)}})},[a]);const T=y.useCallback(()=>fe(null,null,function*(){if(!t||!a){l([]);return}j(!0),O(null);try{const D=yield kl.getWorkflowTransitions(e,t,r,s);if(console.log("[useWorkflow] Available transitions:",D),l(D),r){const z=yield kl.canUserEditDocument(e,t,r);A(z)}}catch(D){console.error("Error fetching transitions:",D),O("Failed to load workflow actions"),l([])}finally{j(!1)}}),[e,t,r,a,s]);y.useEffect(()=>{T()},[T]);const P=y.useCallback((D,z)=>fe(null,null,function*(){if(!t)return O("Document not saved yet"),!1;C(!0),O(null);try{return yield kl.applyWorkflowAction(e,t,D,z),yield T(),!0}catch(G){console.error("Error applying workflow action:",G);let V="Failed to apply action";if(G.message)V=G.message;else if(G._server_messages)try{V=JSON.parse(G._server_messages).map(ge=>{try{return JSON.parse(ge).message}catch(Z){return ge}}).join(`
`)}catch(ne){V=G._server_messages}return O(V),!1}finally{C(!1)}}),[e,t,T]);return{transitions:i,workflowInfo:u,userRoles:f,currentUser:m,isSystemManager:v,loading:w,actionLoading:k,error:N,canEdit:E,applyAction:P,refreshTransitions:T,getStateStyle:_L,getButtonStyle:kL,getIcon:SL}},R1e=({doctype:e,docname:t,workflowState:r,docData:a,onActionComplete:s,onStateChange:i,onWorkflowMeta:l,documentLabel:u="document",showStateInfo:d=!0,stateHeading:f="Workflow State",showFullAccessNote:p=!1,hideWhenNoWorkflow:m=!1,className:x=""})=>{const{t:v}=sr(),{transitions:b,loading:w,actionLoading:j,error:k,applyAction:C,canEdit:N,isSystemManager:O,workflowInfo:E,getStateStyle:A,getButtonStyle:T,getIcon:P}=D1e({doctype:e,docname:t,workflowState:r,enabled:!!t,docData:a});y.useEffect(()=>{t&&(l==null||l({canEdit:N}))},[t,N,l]);const[D,z]=y.useState(null),G=["Reject","Cancel","Close"],V=(Z,U)=>fe(null,null,function*(){if(G.includes(Z)&&D!==Z){z(Z);return}z(null);const ce=yield C(Z,U);s&&s(Z,ce),ce&&i&&i()}),ne=()=>{z(null)};if(!t||m&&!w&&!E)return null;const ge=A(r||"Draft");return n.jsxs("div",{className:`space-y-4 ${x}`,children:[d&&r&&n.jsx("div",{className:`p-4 rounded-lg border ${ge.bg} ${ge.border}`,children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:f}),n.jsx("p",{className:`text-lg font-semibold ${ge.text}`,children:r})]}),n.jsx("div",{className:`w-3 h-3 rounded-full ${ge.bg.replace("100","500").replace("900/30","500")}`})]})}),w&&n.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[n.jsx(vt,{className:"animate-spin"}),n.jsx("span",{className:"text-sm",children:"Loading workflow actions..."})]}),k&&n.jsx("div",{className:"p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx(So,{className:"text-red-500 mt-0.5"}),n.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:k})]})}),D&&n.jsxs("div",{className:"p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg",children:[n.jsxs("div",{className:"flex items-start gap-2 mb-3",children:[n.jsx(So,{className:"text-yellow-500 mt-0.5"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200",children:"Confirm Action"}),n.jsxs("p",{className:"text-xs text-yellow-600 dark:text-yellow-400 mt-1",children:["Are you sure you want to ",n.jsx("strong",{children:D})," this ",u,"?"]})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{const Z=b.find(U=>U.action===D);V(D,Z==null?void 0:Z.next_state)},disabled:j,className:"px-3 py-1.5 bg-red-600 hover:bg-red-700 text-white text-sm rounded-md disabled:opacity-50",children:j?n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(vt,{className:"animate-spin",size:12}),"Processing..."]}):`Yes, ${D}`}),n.jsx("button",{onClick:ne,disabled:j,className:"px-3 py-1.5 bg-gray-300 hover:bg-gray-400 text-gray-700 text-sm rounded-md disabled:opacity-50",children:"Cancel"})]})]}),!w&&b.length>0&&!D&&n.jsxs("div",{className:"space-y-2",children:[p&&O&&n.jsx("div",{className:"p-2 bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg mb-2",children:n.jsx("p",{className:"text-xs text-purple-700 dark:text-purple-300",children:v("workOrders.detail.systemManagerNote")})}),n.jsxs("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 flex items-center gap-1",children:[n.jsx(a_,{size:12}),"Available Actions (",b.length,")"]}),n.jsx("div",{className:"flex flex-wrap gap-2",children:b.map((Z,U)=>n.jsxs("button",{onClick:()=>V(Z.action,Z.next_state),disabled:j,className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 flex items-center gap-2 ${T(Z.action)}`,title:`Move to: ${Z.next_state}`,children:[j?n.jsx(vt,{className:"animate-spin",size:14}):n.jsx("span",{children:P(Z.action)}),Z.action]},`${Z.action}-${U}`))}),n.jsxs("div",{className:"mt-3 pt-2 border-t border-gray-200 dark:border-gray-600",children:[n.jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:v("issues.actionResults")}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:b.map((Z,U)=>n.jsxs("span",{className:"inline-block mr-3",children:[Z.action," → ",n.jsx("span",{className:"font-medium",children:Z.next_state})]},U))})]})]}),!w&&b.length===0&&t&&n.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-lg",children:n.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 text-center",children:"No workflow actions available for your role"})})]})},Ca=({children:e,required:t})=>n.jsxs("label",{className:"block text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),mg=({children:e})=>n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800/60 rounded-lg min-h-[38px] flex items-center",children:e||n.jsx("span",{className:"text-gray-400",children:"-"})}),mO="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-orange-400",F1e="w-full px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-orange-400",M1e="w-full px-2 py-1 text-sm text-right border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-orange-400",Cw="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-orange-400",Tw="w-full px-3 py-2 text-sm text-right border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-orange-400",gO=({title:e,icon:t,defaultOpen:r=!0,children:a})=>{const[s,i]=y.useState(r);return n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden shadow-sm",children:[n.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"w-full flex items-center justify-between px-5 py-3.5 hover:bg-gray-50 dark:hover:bg-gray-700/30 transition-colors text-left",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-700 dark:text-gray-200",children:[t,n.jsx("span",{children:e})]}),s?n.jsx(nr,{className:"text-gray-400 text-xs flex-shrink-0"}):n.jsx(bs,{className:"text-gray-400 text-xs flex-shrink-0"})]}),s&&n.jsx("div",{className:"px-5 py-5 bg-white dark:bg-gray-800 border-t border-gray-100 dark:border-gray-700/50",children:a})]})},_d=({label:e,children:t,defaultOpen:r=!1})=>{const[a,s]=y.useState(r);return n.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden mt-3",children:[n.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"w-full flex items-center gap-2 px-3 py-2 text-[11px] font-bold text-gray-500 uppercase tracking-wider bg-gray-50 dark:bg-gray-800/80 hover:bg-gray-100 transition-colors text-left",children:[a?n.jsx(nr,{size:9}):n.jsx(bs,{size:9}),e]}),a&&n.jsx("div",{className:"p-3 grid grid-cols-1 sm:grid-cols-2 gap-3 bg-white dark:bg-gray-800",children:t})]})},L1e=({items:e})=>{const[t,r]=y.useState(!1),a=y.useRef(null);return y.useEffect(()=>{const s=i=>{a.current&&!a.current.contains(i.target)&&r(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),n.jsxs("div",{className:"relative",ref:a,children:[n.jsxs("button",{onClick:()=>r(s=>!s),className:"flex items-center gap-1.5 px-4 py-2 bg-amber-600 text-white rounded-lg hover:bg-amber-700 text-sm font-medium shadow-sm",children:["Create ",n.jsx(nr,{size:10,className:`transition-transform ${t?"rotate-180":""}`})]}),t&&n.jsxs("div",{className:"absolute right-0 mt-1 w-52 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl shadow-xl z-50 py-1.5",children:[n.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold text-gray-400 uppercase tracking-wider border-b border-gray-100 dark:border-gray-700 mb-1",children:"Create from this request"}),e.map(({label:s,icon:i,onClick:l})=>n.jsxs("button",{onClick:()=>{l(),r(!1)},className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-amber-50 dark:hover:bg-amber-900/20 hover:text-amber-700 transition-colors text-left",children:[n.jsx("span",{className:"text-gray-400",children:i}),s]},s))]})]})},I1e=({item:e,rowNo:t,onChange:r,onClose:a,onDelete:s,onInsertBelow:i})=>{var u,d,f;const l=(p,m)=>r(p,m);return n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"p-0",children:n.jsxs("div",{className:"bg-amber-50/60 dark:bg-amber-900/10 border-b border-amber-200 dark:border-amber-800 px-4 py-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("span",{className:"text-xs font-bold text-amber-700 dark:text-amber-300 uppercase tracking-wider",children:["Editing Row #",t]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{onClick:i,className:"px-2 py-1 text-[11px] bg-amber-600 text-white rounded hover:bg-amber-700",children:"Insert Below"}),n.jsx("button",{onClick:s,className:"px-2 py-1 text-[11px] bg-red-500 text-white rounded hover:bg-red-600",children:"Delete"}),n.jsx("button",{onClick:a,className:"px-2 py-1 text-[11px] bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded hover:bg-gray-300",children:"ESC"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Ca,{required:!0,children:"Item Code"}),n.jsx(Be,{label:"Item Code",hideLabel:!0,doctype:"Item",value:e.item_code||"",onChange:p=>l("item_code",p)})]}),n.jsxs("div",{children:[n.jsx(Ca,{required:!0,children:"Required By"}),n.jsx("input",{type:"date",value:e.schedule_date||"",onChange:p=>l("schedule_date",p.target.value),className:Cw})]}),n.jsxs("div",{children:[n.jsx(Ca,{children:"Item Name"}),n.jsx("input",{value:e.item_name||"",onChange:p=>l("item_name",p.target.value),className:Cw})]})]}),n.jsx(_d,{label:"Description",children:n.jsxs("div",{className:"sm:col-span-2",children:[n.jsx(Ca,{children:"Description"}),n.jsx("textarea",{value:e.description||"",onChange:p=>l("description",p.target.value),rows:2,className:Cw+" resize-none"})]})}),n.jsxs(_d,{label:"Quantity and Warehouse",defaultOpen:!0,children:[n.jsxs("div",{children:[n.jsx(Ca,{required:!0,children:"Quantity"}),n.jsx("input",{type:"number",min:0,step:"1",value:(u=e.qty)!=null?u:1,onChange:p=>l("qty",parseFloat(p.target.value)||0),className:Tw})]}),n.jsxs("div",{children:[n.jsx(Ca,{required:!0,children:"UOM"}),n.jsx(Be,{label:"UOM",hideLabel:!0,doctype:"UOM",value:e.uom||"",onChange:p=>l("uom",p)})]}),n.jsxs("div",{children:[n.jsx(Ca,{children:"Stock UOM"}),n.jsx(Be,{label:"Stock UOM",hideLabel:!0,doctype:"UOM",value:e.stock_uom||"",onChange:p=>l("stock_uom",p)})]}),n.jsxs("div",{children:[n.jsx(Ca,{children:"UOM Conversion Factor"}),n.jsx("input",{type:"number",min:0,step:"0.0001",value:(d=e.conversion_factor)!=null?d:1,onChange:p=>l("conversion_factor",parseFloat(p.target.value)||1),className:Tw})]}),n.jsxs("div",{children:[n.jsx(Ca,{children:"Target Warehouse"}),n.jsx(Be,{label:"Target Warehouse",hideLabel:!0,doctype:"Warehouse",value:e.warehouse||"",onChange:p=>l("warehouse",p)})]})]}),n.jsx(_d,{label:"Rate",children:n.jsxs("div",{children:[n.jsx(Ca,{children:"Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(f=e.rate)!=null?f:0,onChange:p=>l("rate",parseFloat(p.target.value)||0),className:Tw})]})}),n.jsx(_d,{label:"Accounting Details",children:n.jsxs("div",{className:"sm:col-span-2",children:[n.jsx(Ca,{children:"Expense Account"}),n.jsx(Be,{label:"Expense Account",hideLabel:!0,doctype:"Account",value:e.expense_account||"",onChange:p=>l("expense_account",p)})]})}),n.jsx(_d,{label:"Manufacturing",children:n.jsxs("div",{children:[n.jsx(Ca,{children:"BOM No"}),n.jsx(Be,{label:"BOM No",hideLabel:!0,doctype:"BOM",value:e.bom_no||"",onChange:p=>l("bom_no",p)})]})}),n.jsxs(_d,{label:"Accounting Dimensions",children:[n.jsxs("div",{children:[n.jsx(Ca,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:p=>l("cost_center",p)})]}),n.jsxs("div",{children:[n.jsx(Ca,{children:"Project"}),n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:e.project||"",onChange:p=>l("project",p)})]})]})]})})})},xO=e=>({item_code:"",item_name:"",qty:1,uom:"",schedule_date:e}),z1e=()=>{const{mrName:e}=Hn(),[t]=dn(),r=Ut(),a=e==="new",s=t.get("project")||"",i=t.get("customer")||"",l=t.get("company")||fa,[u,d]=y.useState(null),[f,p]=y.useState(!a),[m,x]=y.useState(!1),[v,b]=y.useState(!1),[w,j]=y.useState(a),[k,C]=y.useState(null),[N,O]=y.useState(!0),[E,A]=y.useState(null),T=new Date().toISOString().split("T")[0],[P,D]=y.useState({material_request_type:"Purchase",company:l,project:s,customer:i,transaction_date:T,schedule_date:T,items:[xO(T)]}),z=y.useCallback(de=>{const ie=(de.items||[]).map(se=>Se(ee({},se),{schedule_date:se.schedule_date||se.required_by||""}));D({material_request_type:de.material_request_type||"Purchase",company:de.company||fa,project:de.project||"",customer:de.customer||"",transaction_date:de.transaction_date||T,schedule_date:de.schedule_date||T,items:ie})},[T]),G=y.useCallback(()=>{a||!e||(p(!0),Fc.getMaterialRequest(e).then(de=>{d(de),z(de)}).catch(de=>$e.error(de.message)).finally(()=>p(!1)))},[a,e,z]);y.useEffect(()=>{G()},[G]),y.useEffect(()=>{kl.getWorkflowInfo("Material Request").then(de=>A(!!de)).catch(()=>A(!1))},[]);const V=y.useCallback(de=>{O(de.canEdit)},[]),ne=(de,ie)=>D(se=>Se(ee({},se),{[de]:ie})),ge=(de,ie,se)=>D(he=>{const _e=[...he.items||[]];return _e[de]=Se(ee({},_e[de]),{[ie]:se}),Se(ee({},he),{items:_e})}),Z=(de,ie)=>fe(null,null,function*(){if(ge(de,"item_code",ie),!!ie)try{const _e=(yield(yield fetch(`/api/resource/Item/${encodeURIComponent(ie)}`,{credentials:"include"})).json()).data;if(!_e)return;D(F=>{const X=[...F.items||[]];return X[de]=Se(ee({},X[de]),{item_code:ie,item_name:_e.item_name||ie,stock_uom:_e.stock_uom||"",uom:_e.purchase_uom||_e.stock_uom||"",description:_e.description||""}),Se(ee({},F),{items:X})})}catch(se){}}),U=de=>{D(ie=>{const se=[...ie.items||[]],he=de!==void 0?de+1:se.length;return se.splice(he,0,xO(T)),Se(ee({},ie),{items:se})})},ce=de=>{D(ie=>{const se=[...ie.items||[]];return se.splice(de,1),Se(ee({},ie),{items:se})}),C(null)},xe=()=>{const ie=(P.items||[]).map(se=>se.schedule_date||se.required_by||"").filter(Boolean).sort()[0]||P.schedule_date||T;return{material_request_type:P.material_request_type||"Purchase",company:P.company||void 0,project:P.project||void 0,customer:P.customer||void 0,transaction_date:P.transaction_date,schedule_date:ie,items:(P.items||[]).filter(se=>se.item_code).map((se,he)=>{var _e,F,X;return Se(ee({},se.name?{name:se.name}:{}),{item_code:se.item_code,item_name:se.item_name||se.item_code,description:se.description||void 0,qty:(_e=se.qty)!=null?_e:1,uom:se.uom||void 0,stock_uom:se.stock_uom||void 0,conversion_factor:(F=se.conversion_factor)!=null?F:1,schedule_date:se.schedule_date||se.required_by||ie,warehouse:se.warehouse||void 0,rate:(X=se.rate)!=null?X:0,expense_account:se.expense_account||void 0,cost_center:se.cost_center||P.cost_center||void 0,project:se.project||P.project||void 0,idx:he+1})})}},be=()=>fe(null,null,function*(){try{if(x(!0),a){const de=yield Fc.createMaterialRequest(xe());$e.success("Material Request created"),j(!1),r(`/material-requests/${de.name}`)}else yield Fc.updateMaterialRequest(e,xe()),$e.success("Material Request saved"),j(!1),G()}catch(de){$e.error(de.message||"Error saving")}finally{x(!1)}}),me=()=>fe(null,null,function*(){if(!(!e||a))try{b(!0);const de=yield Fc.submitMaterialRequest(e);d(de),z(de),$e.success("Material Request submitted")}catch(de){$e.error(de.message||"Error submitting")}finally{b(!1)}}),oe=()=>{const de=new URLSearchParams;de.set("mr",e),P.company&&de.set("company",String(P.company)),P.project&&de.set("project",String(P.project)),r(`/purchase-orders/new?${de.toString()}`)},L=(u==null?void 0:u.workflow_state)||"",H=y.useMemo(()=>u?ee({},u):void 0,[u]),K=a||w&&N,Y=!a&&(u==null?void 0:u.docstatus)===1,re=!a&&(u==null?void 0:u.docstatus)===0&&E===!1;return f?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-orange-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsx("div",{className:"sticky top-0 z-10 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 shadow-sm",children:n.jsxs("div",{className:"px-6 py-4",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-400 mb-2.5",children:[n.jsx("button",{onClick:()=>r("/projects"),className:"hover:text-orange-500 transition-colors",children:"Project Management"}),n.jsx("span",{children:"/"}),n.jsx("button",{onClick:()=>r("/material-requests"),className:"hover:text-orange-500 transition-colors",children:"Material Requests"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-600 dark:text-gray-300 font-medium",children:a?"New Material Request":e})]}),n.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>r("/material-requests"),className:"p-1.5 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:n.jsx(da,{size:14})}),n.jsx(zd,{className:"text-orange-500 text-xl"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:a?"New Material Request":e}),!a&&n.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-0.5",children:[n.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-xs font-semibold ${(()=>{const de=(u==null?void 0:u.status)||"";return(u==null?void 0:u.docstatus)===2||de==="Cancelled"?"bg-red-100 text-red-700":!u||u.docstatus===0?"bg-yellow-100 text-yellow-800":de==="Transferred"||de==="Issued"?"bg-green-100 text-green-800":de==="Partially Ordered"||de==="Ordered"?"bg-blue-100 text-blue-800":de==="Pending"?"bg-orange-100 text-orange-800":de==="Stopped"||de==="Closed"?"bg-gray-100 text-gray-700":"bg-green-100 text-green-800"})()}`,children:(u==null?void 0:u.docstatus)===2?"Cancelled":(u==null?void 0:u.docstatus)===0?"Draft":(u==null?void 0:u.status)||"Submitted"}),L?n.jsx("span",{className:"inline-block px-2 py-0.5 rounded text-xs font-medium bg-violet-100 text-violet-800 dark:bg-violet-900/40 dark:text-violet-200 border border-violet-200 dark:border-violet-700",children:L}):null]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[Y&&n.jsx(L1e,{items:[{label:"Purchase Order",icon:n.jsx(r_,{size:13}),onClick:oe}]}),re&&!w&&n.jsxs("button",{onClick:me,disabled:v,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 text-sm font-medium shadow-sm",children:[v?n.jsx(vt,{className:"animate-spin",size:12}):n.jsx(cu,{size:12})," Submit"]}),!a&&!w&&!Y&&N&&n.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-2 px-4 py-2 border border-orange-500 text-orange-600 rounded-lg hover:bg-orange-50 text-sm font-medium",children:[n.jsx(ha,{size:12})," Edit"]}),K&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:be,disabled:m,className:"flex items-center gap-2 px-4 py-2 bg-orange-500 text-white rounded-lg hover:bg-orange-600 disabled:opacity-50 text-sm font-medium shadow-sm",children:[m?n.jsx(vt,{className:"animate-spin",size:12}):n.jsx(Cn,{size:12}),m?"Saving…":"Save"]}),!a&&n.jsx("button",{onClick:()=>{u&&z(u),j(!1)},className:"p-2 border border-gray-300 rounded-lg text-gray-500 hover:bg-gray-100 text-sm",children:n.jsx(yt,{size:12})})]})]})]})]})}),n.jsx("div",{className:"px-6 py-6",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 items-start",children:[n.jsxs("div",{className:`space-y-3 ${a?"lg:col-span-4":"lg:col-span-3"}`,children:[n.jsx(gO,{title:"Details",icon:n.jsx(zd,{size:12,className:"text-orange-500"}),children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(Ca,{required:!0,children:"Purpose (Type)"}),K?n.jsxs("select",{value:P.material_request_type||"Purchase",onChange:de=>ne("material_request_type",de.target.value),className:mO,children:[n.jsx("option",{value:"Purchase",children:"Purchase"}),n.jsx("option",{value:"Material Transfer",children:"Material Transfer"}),n.jsx("option",{value:"Manufacture",children:"Manufacture"}),n.jsx("option",{value:"Customer Provided",children:"Customer Provided"}),n.jsx("option",{value:"Material Issue",children:"Material Issue"})]}):n.jsx(mg,{children:P.material_request_type})]}),n.jsxs("div",{children:[n.jsx(Ca,{required:!0,children:"Transaction Date"}),K?n.jsx("input",{type:"date",value:P.transaction_date||"",onChange:de=>ne("transaction_date",de.target.value),className:mO}):n.jsx(mg,{children:P.transaction_date})]}),n.jsxs("div",{children:[n.jsx(Ca,{children:"Company"}),K?n.jsx(Be,{label:"Company",hideLabel:!0,doctype:"Company",value:P.company||"",onChange:de=>ne("company",de),placeholder:"Select company…"}):n.jsx(mg,{children:P.company})]}),n.jsxs("div",{children:[n.jsx(Ca,{children:"Project"}),K?n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:P.project||"",onChange:de=>ne("project",de),placeholder:"Select project…"}):n.jsx(mg,{children:P.project})]})]})}),n.jsx(gO,{title:"Items",icon:n.jsx(zd,{size:12,className:"text-amber-500"}),children:n.jsx("div",{className:"overflow-x-auto -mx-2",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 min-w-[180px]",children:["Item Code ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:["UOM ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:["Qty ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-32",children:"Required By"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-36",children:"Target Warehouse"}),K&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[(P.items||[]).map((de,ie)=>{var se,he;return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${k===ie?"bg-amber-50/60 dark:bg-amber-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:ie+1}),n.jsx("td",{className:"py-1.5 px-2 min-w-[180px]",children:K?n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:de.item_code||"",onChange:_e=>Z(ie,_e),placeholder:"Select item…"}):n.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-200",children:de.item_code||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-28",children:K?n.jsx(Be,{label:"UOM",hideLabel:!0,doctype:"UOM",value:de.uom||"",onChange:_e=>ge(ie,"uom",_e),placeholder:"UOM"}):n.jsx("span",{className:"text-gray-500 text-sm",children:de.uom||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:K?n.jsx("input",{type:"number",min:0,step:"1",value:(se=de.qty)!=null?se:1,onChange:_e=>ge(ie,"qty",parseFloat(_e.target.value)||0),className:M1e}):n.jsx("span",{className:"block text-right text-sm pr-1",children:(he=de.qty)!=null?he:0})}),n.jsx("td",{className:"py-1.5 px-2 w-32",children:K?n.jsx("input",{type:"date",value:de.schedule_date||de.required_by||"",onChange:_e=>ge(ie,"schedule_date",_e.target.value),className:F1e}):n.jsx("span",{className:"text-gray-500 text-sm",children:de.schedule_date||de.required_by||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-36",children:K?n.jsx(Be,{label:"Warehouse",hideLabel:!0,doctype:"Warehouse",value:de.warehouse||"",onChange:_e=>ge(ie,"warehouse",_e),placeholder:"Warehouse"}):n.jsx("span",{className:"text-gray-500 text-sm truncate max-w-[120px] block",children:de.warehouse||"-"})}),K&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>C(k===ie?null:ie),className:`p-1.5 rounded text-xs ${k===ie?"bg-amber-600 text-white":"text-amber-600 hover:bg-amber-50"}`,children:n.jsx(Vs,{size:11})}),n.jsx("button",{onClick:()=>ce(ie),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:n.jsx(Za,{size:11})})]})})]}),K&&k===ie&&n.jsx(I1e,{item:de,rowNo:ie+1,onChange:(_e,F)=>{_e==="item_code"?Z(ie,F):ge(ie,_e,F)},onClose:()=>C(null),onDelete:()=>ce(ie),onInsertBelow:()=>U(ie)})]},ie)}),K&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{onClick:()=>U(),className:"flex items-center gap-1.5 text-orange-600 hover:text-orange-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})})})]}),!a&&e&&n.jsxs("aside",{className:"lg:col-span-1 space-y-6 lg:sticky lg:top-28 lg:self-start",children:[n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl shadow-md p-5 border border-gray-200 dark:border-gray-700",children:[n.jsx("h2",{className:"text-base font-semibold text-gray-800 dark:text-white mb-4 pb-2 border-b border-gray-200 dark:border-gray-700",children:"Workflow Actions"}),n.jsx(R1e,{doctype:"Material Request",docname:e,workflowState:L,docData:H,documentLabel:"Material Request",onStateChange:G,onWorkflowMeta:V,className:"space-y-4"})]}),n.jsx(Yn,{doctype:"Material Request",docname:e||"",creationDate:u==null?void 0:u.creation,createdBy:u==null?void 0:u.owner,compact:!0,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})})]})},Sc=20;function B1e(e){const t=[];return e.search&&t.push(["Purchase Receipt","name","like",`%${e.search}%`]),e.status==="Draft"&&t.push(["Purchase Receipt","docstatus","=",0]),e.status==="Submitted"&&t.push(["Purchase Receipt","docstatus","=",1]),e.status==="Cancelled"&&t.push(["Purchase Receipt","docstatus","=",2]),t}function $1e(e){return e.docstatus===2?"bg-red-100 text-red-700":e.docstatus===1?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-800"}function U1e(e){return e.docstatus===2?"Cancelled":e.docstatus===1?e.status||"Submitted":"Draft"}const H1e=()=>{const{t:e}=sr(),t=Ut(),[r,a]=y.useState([]),[s,i]=y.useState(!0),[l,u]=y.useState(0),[d,f]=y.useState(0),[p,m]=y.useState(!1),[x,v]=y.useState(""),[b,w]=y.useState(""),[j,k]=y.useState({search:"",status:""}),[C,N]=y.useState(!1),O=y.useCallback((U,ce)=>fe(null,null,function*(){i(!0);try{const xe=[];ce.search&&xe.push(["Purchase Receipt","name","like",`%${ce.search}%`]),ce.status==="Draft"&&xe.push(["Purchase Receipt","docstatus","=",0]),ce.status==="Submitted"&&xe.push(["Purchase Receipt","docstatus","=",1]),ce.status==="Cancelled"&&xe.push(["Purchase Receipt","docstatus","=",2]);const[be,me]=yield Promise.all([Lc.getPurchaseReceipts({filters:xe,limit_start:U,limit_page_length:Sc}),Lc.getPurchaseReceiptCount(xe)]);a(be),u(me)}catch(xe){$e.error(xe.message||"Failed to load")}finally{i(!1)}}),[]);y.useEffect(()=>{O(0,j)},[O,j]);const E=y.useMemo(()=>`${d}|${j.search}|${j.status}`,[d,j.search,j.status]),{selectedRows:A,toggleRow:T,toggleAllOnPage:P,allOnPageSelected:D,someOnPageSelected:z}=Vn(r,E),G=()=>{k({search:x,status:b}),f(0)},V=()=>{v(""),w(""),k({search:"",status:""}),f(0)},ne=!!(j.search||j.status),ge=U=>{f(U),O(U*Sc,j)},Z=y.useCallback(()=>Kn({doctype:"Purchase Receipt",filters:B1e(j),orderBy:"modified desc"}),[j]);return n.jsxs("div",{className:"p-6",children:[n.jsx(Br,{position:"top-right",autoClose:3e3}),n.jsxs("div",{className:"flex items-center justify-between mb-6 gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-green-500 flex items-center justify-center",children:n.jsx(uP,{className:"text-white text-base"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Purchase Receipts"}),n.jsxs("p",{className:"text-xs text-gray-500",children:[l," total"]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("button",{onClick:()=>O(d*Sc,j),className:"p-2 text-gray-500 hover:text-green-600 border border-gray-200 rounded-lg",children:n.jsx(en,{size:13})}),n.jsxs("button",{type:"button",onClick:()=>N(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:l===0&&A.size===0,children:[n.jsx(hn,{})," ",e("listPages.export"),A.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:A.size})]}),n.jsxs("button",{onClick:()=>t("/purchase-receipts/new"),className:"flex items-center gap-2 px-4 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 text-sm font-medium",children:[n.jsx(Pt,{size:11})," New Receipt"]})]})]}),n.jsx(Gn,{isOpen:C,onClose:()=>N(!1),doctype:"Purchase Receipt",selectedCount:A.size,pageCount:r.length,totalCount:l,pageData:r,selectedRows:A,rowKey:"name",onFetchAll:Z,fileNamePrefix:"purchase_receipts"}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl mb-5 overflow-hidden",children:[n.jsxs("button",{onClick:()=>m(U=>!U),className:"w-full flex items-center justify-between px-4 py-3 bg-gradient-to-r from-green-500 to-green-600 text-white",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[n.jsx(fn,{size:12})," Filters",ne&&n.jsx("span",{className:"bg-white/30 text-white text-xs px-2 py-0.5 rounded-full",children:"Active"})]}),p?n.jsx(ps,{size:11}):n.jsx(nr,{size:11})]}),ne&&n.jsxs("div",{className:"px-4 py-2 bg-green-50 dark:bg-green-900/20 flex flex-wrap gap-2 items-center border-b border-green-100 dark:border-green-800",children:[j.search&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-green-100 dark:bg-green-800 text-green-700 dark:text-green-300 px-2 py-1 rounded-full",children:["ID: ",j.search,n.jsx("button",{onClick:()=>{v(""),k(U=>Se(ee({},U),{search:""}))},children:n.jsx(yt,{size:9})})]}),j.status&&n.jsxs("span",{className:"flex items-center gap-1 text-xs bg-green-100 dark:bg-green-800 text-green-700 dark:text-green-300 px-2 py-1 rounded-full",children:["Status: ",j.status,n.jsx("button",{onClick:()=>{w(""),k(U=>Se(ee({},U),{status:""}))},children:n.jsx(yt,{size:9})})]}),n.jsx("button",{onClick:V,className:"text-xs text-green-600 hover:underline ml-auto",children:"Clear All"})]}),p&&n.jsxs("div",{className:"px-4 py-3 grid grid-cols-1 sm:grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Receipt ID"}),n.jsx("input",{value:x,onChange:U=>v(U.target.value),onKeyDown:U=>U.key==="Enter"&&G(),placeholder:"Search…",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-green-400"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[11px] font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Status"}),n.jsxs("select",{value:b,onChange:U=>w(U.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-green-400",children:[n.jsx("option",{value:"",children:"All"}),n.jsx("option",{value:"Draft",children:"Draft"}),n.jsx("option",{value:"Submitted",children:"Submitted"}),n.jsx("option",{value:"Cancelled",children:"Cancelled"})]})]}),n.jsxs("div",{className:"flex items-end gap-2",children:[n.jsx("button",{onClick:G,className:"px-4 py-2 bg-green-500 text-white text-sm rounded hover:bg-green-600",children:"Apply"}),n.jsx("button",{onClick:V,className:"px-4 py-2 border border-gray-300 text-gray-600 text-sm rounded hover:bg-gray-50",children:"Clear"})]})]})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"w-10 px-2 py-3",children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-green-600 focus:ring-green-500",checked:D,ref:U=>{U&&(U.indeterminate=z)},onChange:P,"aria-label":"Select all on page"})}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"PR ID"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Supplier"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Posting Date"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Status"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Grand Total"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Company"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:s?n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"text-center py-10 text-gray-400",children:"Loading…"})}):r.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"text-center py-10 text-gray-400",children:"No purchase receipts found"})}):r.map(U=>{var ce;return n.jsxs("tr",{onClick:()=>t(`/purchase-receipts/${U.name}`),className:`cursor-pointer hover:bg-green-50 dark:hover:bg-green-900/10 transition-colors ${A.has(U.name)?"bg-green-50/90 dark:bg-green-900/20":""}`,children:[n.jsx("td",{className:"w-10 px-2 py-3",onClick:xe=>xe.stopPropagation(),children:n.jsx("input",{type:"checkbox",className:"rounded border-gray-300 dark:border-gray-600 text-green-600 focus:ring-green-500",checked:A.has(U.name),onChange:()=>T(U.name),"aria-label":`Select ${U.name}`})}),n.jsx("td",{className:"py-3 px-4 font-medium text-green-600",children:U.name}),n.jsx("td",{className:"py-3 px-4 text-gray-700 dark:text-gray-300",children:U.supplier_name||U.supplier||"-"}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:U.posting_date||"-"}),n.jsx("td",{className:"py-3 px-4",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${$1e(U)}`,children:U1e(U)})}),n.jsxs("td",{className:"py-3 px-4 text-right font-semibold text-gray-900 dark:text-white",children:["SAR ",((ce=U.grand_total)!=null?ce:0).toFixed(2)]}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:U.company||"-"})]},U.name)})})]})}),l>Sc&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:[d*Sc+1,"",Math.min((d+1)*Sc,l)," of ",l]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{disabled:d===0,onClick:()=>ge(d-1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Prev"}),n.jsx("button",{disabled:(d+1)*Sc>=l,onClick:()=>ge(d+1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Next"})]})]})]})]})},Tt=({children:e,required:t})=>n.jsxs("label",{className:"block text-[11px] font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),ii=({children:e})=>n.jsx("div",{className:"px-3 py-2 text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800/60 rounded min-h-[34px] flex items-center",children:e||n.jsx("span",{className:"text-gray-400",children:"-"})}),Do="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-green-400",Ec=Do+" text-right",gg="w-full px-2 py-1 text-sm text-right border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-green-400",q1e="w-full px-2 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 focus:outline-none focus:ring-1 focus:ring-green-400",vo="px-3 py-2 text-sm text-right bg-gray-50 dark:bg-gray-700/60 rounded text-gray-600 dark:text-gray-300",Li=({title:e,children:t,defaultOpen:r=!1})=>{const[a,s]=y.useState(r);return n.jsxs("div",{className:"border-t border-gray-200 dark:border-gray-600 mt-3 pt-1",children:[n.jsxs("button",{type:"button",onClick:()=>s(i=>!i),className:"flex items-center gap-2 py-1 text-xs font-semibold text-blue-600 dark:text-blue-400 hover:underline",children:[a?n.jsx(nr,{size:9}):n.jsx(bs,{size:9}),e]}),a&&n.jsx("div",{className:"mt-2",children:t})]})},W1e=({item:e,rowNo:t,onChange:r,onClose:a,onDelete:s,onInsertBelow:i})=>{var l,u,d,f,p,m,x,v,b,w,j,k,C,N,O,E,A,T,P;return n.jsx("tr",{children:n.jsx("td",{colSpan:8,className:"p-0",children:n.jsxs("div",{className:"border border-blue-300 dark:border-blue-600 rounded-lg mx-2 my-1 bg-white dark:bg-gray-800 shadow-md",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-blue-50 dark:bg-blue-900/30 rounded-t-lg border-b border-blue-200 dark:border-blue-700",children:[n.jsxs("span",{className:"text-sm font-semibold text-blue-700 dark:text-blue-300",children:["Editing Row #",t]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:i,className:"px-2 py-1 text-xs border border-gray-300 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-600",children:"Insert Below"}),n.jsx("button",{onClick:s,className:"px-2 py-1 text-xs border border-red-300 rounded text-red-500 hover:bg-red-50",children:"Delete"}),n.jsx("button",{onClick:a,className:"p-1 text-gray-400 hover:text-gray-600",children:n.jsx(yt,{size:13})})]})]}),n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"Item Code"}),n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:e.item_code||"",onChange:D=>r("item_code",D),placeholder:"Select item…"})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Item Name"}),n.jsx("input",{value:e.item_name||"",onChange:D=>r("item_name",D.target.value),className:Do,placeholder:"Item name…"})]})]}),n.jsx(Li,{title:"Description",defaultOpen:!!e.description,children:n.jsx("textarea",{rows:2,value:e.description||"",onChange:D=>r("description",D.target.value),className:Do,placeholder:"Description…"})}),n.jsx(Li,{title:"Received and Accepted",defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"Received Qty"}),n.jsx("input",{type:"number",min:0,step:"1",value:(l=e.received_qty)!=null?l:0,onChange:D=>r("received_qty",parseFloat(D.target.value)||0),className:Ec})]}),n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"UOM"}),n.jsx(Be,{label:"UOM",hideLabel:!0,doctype:"UOM",value:e.uom||"",onChange:D=>r("uom",D),placeholder:"UOM…"})]}),n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"Accepted Qty"}),n.jsx("input",{type:"number",min:0,step:"1",value:(d=(u=e.qty)!=null?u:e.received_qty)!=null?d:0,onChange:D=>r("qty",parseFloat(D.target.value)||0),className:Ec})]}),n.jsxs("div",{className:"flex items-center gap-2 pt-4",children:[n.jsx("input",{type:"checkbox",checked:!!e.retain_sample,onChange:D=>r("retain_sample",D.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Retain Sample"})]}),e.retain_sample?n.jsxs("div",{children:[n.jsx(Tt,{children:"Sample Quantity"}),n.jsx("input",{type:"number",min:0,step:"0.001",value:(f=e.sample_quantity)!=null?f:0,onChange:D=>r("sample_quantity",parseFloat(D.target.value)||0),className:Ec})]}):null,n.jsxs("div",{children:[n.jsx(Tt,{children:"Rejected Qty"}),n.jsx("input",{type:"number",min:0,step:"0.001",value:(p=e.rejected_qty)!=null?p:0,onChange:D=>r("rejected_qty",parseFloat(D.target.value)||0),className:Ec})]})]})}),n.jsx(Li,{title:"Rate and Amount",defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx(Tt,{children:"Price List Rate"}),n.jsx("div",{className:vo,children:((m=e.price_list_rate)!=null?m:0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Price List Rate (Company Currency)"}),n.jsx("div",{className:vo,children:((x=e.price_list_rate)!=null?x:0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Last Purchase Rate"}),n.jsx("div",{className:vo,children:((v=e.valuation_rate)!=null?v:0).toFixed(2)})]})]})}),n.jsx(Li,{title:"Discount and Margin",children:n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(b=e.rate)!=null?b:0,onChange:D=>r("rate",parseFloat(D.target.value)||0),className:Ec})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Rate (Company Currency)"}),n.jsx("div",{className:vo,children:((w=e.rate)!=null?w:0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Amount"}),n.jsx("div",{className:"px-3 py-2 text-sm font-semibold text-right bg-gray-50 dark:bg-gray-700/60 rounded",children:(((k=(j=e.qty)!=null?j:e.received_qty)!=null?k:0)*(e.rate||0)).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Amount (Company Currency)"}),n.jsx("div",{className:vo,children:(((N=(C=e.qty)!=null?C:e.received_qty)!=null?N:0)*(e.rate||0)).toFixed(2)})]}),n.jsxs("div",{className:"flex items-center gap-2 pt-4",children:[n.jsx("input",{type:"checkbox",checked:!!e.is_free_item,onChange:D=>r("is_free_item",D.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Is Free Item"})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Net Rate"}),n.jsx("div",{className:vo,children:((E=(O=e.net_rate)!=null?O:e.rate)!=null?E:0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Net Amount"}),n.jsx("div",{className:vo,children:((A=e.net_amount)!=null?A:0).toFixed(2)})]})]})}),n.jsx(Li,{title:"Warehouse and Reference",defaultOpen:!0,children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Tt,{children:"Accepted Warehouse"}),n.jsx(Be,{label:"Warehouse",hideLabel:!0,doctype:"Warehouse",value:e.warehouse||"",onChange:D=>r("warehouse",D),placeholder:"Warehouse…"})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Rejected Warehouse"}),n.jsx(Be,{label:"Warehouse",hideLabel:!0,doctype:"Warehouse",value:e.rejected_warehouse||"",onChange:D=>r("rejected_warehouse",D),placeholder:"Rejected Warehouse…"})]}),n.jsxs("div",{className:"flex items-center gap-2 pt-4",children:[n.jsx("input",{type:"checkbox",checked:!!e.allow_zero_valuation_rate,onChange:D=>r("allow_zero_valuation_rate",D.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Allow Zero Valuation Rate"})]}),n.jsxs("div",{className:"flex items-center gap-2 pt-4",children:[n.jsx("input",{type:"checkbox",checked:!!e.from_warehouse,onChange:D=>r("from_warehouse",D.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Return Qty from Rejected Warehouse"})]}),e.purchase_order&&n.jsxs("div",{children:[n.jsx(Tt,{children:"Purchase Order"}),n.jsx("div",{className:vo+" text-left",children:e.purchase_order})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Schedule Date"}),n.jsx("input",{type:"date",value:e.schedule_date||"",onChange:D=>r("schedule_date",D.target.value),className:Do})]})]})}),n.jsx(Li,{title:"Serial and Batch No",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"checkbox",checked:!!e.use_serial_batch_fields,onChange:D=>r("use_serial_batch_fields",D.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Use Serial / Batch Fields"})]})}),n.jsx(Li,{title:"Item Weight Details",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Tt,{children:"Weight Per Unit"}),n.jsx("input",{type:"number",min:0,step:"0.001",value:(T=e.weight_per_unit)!=null?T:0,onChange:D=>r("weight_per_unit",parseFloat(D.target.value)||0),className:Ec})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Total Weight"}),n.jsx("div",{className:vo,children:((P=e.total_weight)!=null?P:0).toFixed(3)})]})]})}),n.jsx(Li,{title:"Accounting Details",children:n.jsxs("div",{children:[n.jsx(Tt,{children:"Expense Account"}),n.jsx(Be,{label:"Expense Account",hideLabel:!0,doctype:"Account",value:e.expense_account||"",onChange:D=>r("expense_account",D),placeholder:"Expense Account…"})]})}),n.jsx(Li,{title:"Accounting Dimensions",children:n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx(Tt,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:D=>r("cost_center",D),placeholder:"Cost center…"})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Project"}),n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:e.project||"",onChange:D=>r("project",D),placeholder:"Project…"})]})]})})]})]})})})},V1e=({tax:e,rowNo:t,onChange:r,onClose:a,onDelete:s,onInsertBelow:i})=>{var l;return n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"p-0",children:n.jsxs("div",{className:"border border-blue-300 dark:border-blue-600 rounded-lg mx-2 my-1 bg-white dark:bg-gray-800 shadow-md",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-blue-50 dark:bg-blue-900/30 rounded-t-lg border-b border-blue-200",children:[n.jsxs("span",{className:"text-sm font-semibold text-blue-700 dark:text-blue-300",children:["Editing Row #",t]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:i,className:"px-2 py-1 text-xs border border-gray-300 rounded hover:bg-gray-50 text-gray-600",children:"Insert Below"}),n.jsx("button",{onClick:s,className:"px-2 py-1 text-xs border border-red-300 rounded text-red-500 hover:bg-red-50",children:"Delete"}),n.jsx("button",{onClick:a,className:"p-1 text-gray-400 hover:text-gray-600",children:n.jsx(yt,{size:13})})]})]}),n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"Type"}),n.jsxs("select",{value:e.charge_type||"",onChange:u=>r("charge_type",u.target.value),className:Do,children:[n.jsx("option",{value:"",children:"Select type…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"}),n.jsx("option",{value:"On Previous Row Total",children:"On Previous Row Total"}),n.jsx("option",{value:"On Item Quantity",children:"On Item Quantity"}),n.jsx("option",{value:"Inter Company Transaction",children:"Inter Company Transaction"})]})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Description"}),n.jsx("textarea",{rows:3,value:e.description||"",onChange:u=>r("description",u.target.value),className:Do,placeholder:"Description…"})]})]}),n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"Account Head"}),n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:e.account_head||"",onChange:u=>r("account_head",u),placeholder:"Account…"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"checkbox",checked:!!e.included_in_print_rate,onChange:u=>r("included_in_print_rate",u.target.checked?1:0),className:"rounded"}),n.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:"Is this Tax included in Basic Rate?"})]}),n.jsx("p",{className:"text-xs text-blue-500 dark:text-blue-400",children:"If checked, the tax amount will be considered as already included in the Print Rate / Print Amount"}),n.jsx(Li,{title:"Accounting Dimensions",defaultOpen:!0,children:n.jsxs("div",{children:[n.jsx(Tt,{children:"Cost Center"}),n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:e.cost_center||"",onChange:u=>r("cost_center",u),placeholder:"Cost center…"})]})}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"Tax Rate"}),n.jsx("input",{type:"number",min:0,step:"0.01",value:(l=e.rate)!=null?l:0,onChange:u=>r("rate",parseFloat(u.target.value)||0),className:Ec})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Account Currency"}),n.jsx("input",{value:e.account_currency||xt,onChange:u=>r("account_currency",u.target.value),className:Do})]})]})]})]})})})},G1e=()=>({item_code:"",item_name:"",received_qty:0,qty:0,rejected_qty:0,rate:0,amount:0,uom:"",conversion_factor:1,is_free_item:0,retain_sample:0}),K1e=()=>({charge_type:"",account_head:"",rate:0,account_currency:xt,included_in_print_rate:0}),Y1e=()=>{var ie,se,he,_e;const{prName:e}=Hn(),[t]=dn(),r=Ut(),a=e==="new",s=t.get("po")||"",i=t.get("supplier")||"",l=t.get("company")||fa,u=t.get("project")||"",[d,f]=y.useState(null),[p,m]=y.useState(!a),[x,v]=y.useState(!1),[b,w]=y.useState(!1),[j,k]=y.useState(a),[C,N]=y.useState(null),[O,E]=y.useState(null),A=new Date().toISOString().split("T")[0],[T,P]=y.useState({supplier:i,supplier_name:i,company:l,project:u,posting_date:A,currency:xt,items:[],taxes:[]}),D=y.useCallback(F=>{P({supplier:F.supplier||"",supplier_name:F.supplier_name||F.supplier||"",company:F.company||fa,project:F.project||"",posting_date:F.posting_date||A,currency:F.currency||xt,set_warehouse:F.set_warehouse||"",cost_center:F.cost_center||"",tax_category:F.tax_category||"",taxes_and_charges:F.taxes_and_charges||"",items:F.items||[],taxes:F.taxes||[]}),N(null),E(null)},[A]);y.useEffect(()=>{a||(m(!0),Lc.getPurchaseReceipt(e).then(F=>{f(F),D(F)}).catch(F=>$e.error(F.message)).finally(()=>m(!1)))},[e,a,D]),y.useEffect(()=>{const F=T.company;!a||!F||fetch(`/api/resource/Company/${encodeURIComponent(F)}`,{credentials:"include"}).then(X=>X.json()).then(X=>{var R;if((R=X.data)!=null&&R.default_currency){const I=Va(X.data.default_currency);P(te=>Se(ee({},te),{currency:I,buying_price_list:te.buying_price_list||"Standard Buying",price_list_currency:te.price_list_currency||I}))}}).catch(()=>{})},[T.company,a]),y.useEffect(()=>{!a||!s||fetch(`/api/resource/Purchase Order/${encodeURIComponent(s)}`,{credentials:"include"}).then(F=>F.json()).then(F=>{const X=F.data;X&&P(R=>Se(ee({},R),{supplier:X.supplier||R.supplier,supplier_name:X.supplier_name||X.supplier||R.supplier_name,company:X.company||R.company,project:X.project||R.project,items:(X.items||[]).map(I=>{var te,q,B,je,Ce,ye;return{item_code:I.item_code,item_name:I.item_name,uom:I.uom||I.stock_uom,stock_uom:I.stock_uom,conversion_factor:(te=I.conversion_factor)!=null?te:1,received_qty:(q=I.qty)!=null?q:0,qty:(B=I.qty)!=null?B:0,rejected_qty:0,rate:(je=I.rate)!=null?je:0,amount:((Ce=I.qty)!=null?Ce:0)*((ye=I.rate)!=null?ye:0),warehouse:I.warehouse||"",purchase_order:s,purchase_order_item:I.name,schedule_date:I.schedule_date||"",project:X.project||"",cost_center:I.cost_center||"",expense_account:I.expense_account||""}})}))}).catch(()=>{})},[a,s]);const z=(F,X)=>P(R=>Se(ee({},R),{[F]:X})),G=(F,X,R)=>P(I=>{var B;const te=[...I.items||[]],q=Se(ee({},te[F]),{[X]:R});if(X==="qty"||X==="received_qty"||X==="rate"){const je=parseFloat(String(X==="qty"||X==="received_qty"?R:(B=q.qty)!=null?B:q.received_qty))||0,Ce=parseFloat(String(X==="rate"?R:q.rate))||0;q.amount=parseFloat((je*Ce).toFixed(4))}return te[F]=q,Se(ee({},I),{items:te})}),V=(F,X)=>fe(null,null,function*(){if(G(F,"item_code",X),!!X)try{const te=(yield(yield fetch(`/api/resource/Item/${encodeURIComponent(X)}`,{credentials:"include"})).json()).data;if(!te)return;P(q=>{var je;const B=[...q.items||[]];return B[F]=Se(ee({},B[F]),{item_code:X,item_name:te.item_name||X,description:te.description||te.item_name||X,stock_uom:te.stock_uom||"",uom:te.purchase_uom||te.stock_uom||"",price_list_rate:(je=te.standard_rate)!=null?je:0,rate:B[F].rate||te.standard_rate||0}),Se(ee({},q),{items:B})})}catch(R){}}),ne=F=>{P(X=>{const R=[...X.items||[]],I=G1e();let te;return F!==void 0?(R.splice(F+1,0,I),te=F+1):(R.push(I),te=R.length-1),setTimeout(()=>N(te),0),Se(ee({},X),{items:R})})},ge=F=>{P(X=>{const R=[...X.items||[]];return R.splice(F,1),Se(ee({},X),{items:R})}),N(null)},Z=(F,X,R)=>P(I=>{const te=[...I.taxes||[]];return te[F]=Se(ee({},te[F]),{[X]:R}),Se(ee({},I),{taxes:te})}),U=F=>{P(X=>{const R=[...X.taxes||[]],I=K1e();let te;return F!==void 0?(R.splice(F+1,0,I),te=F+1):(R.push(I),te=R.length-1),setTimeout(()=>E(te),0),Se(ee({},X),{taxes:R})})},ce=F=>{P(X=>{const R=[...X.taxes||[]];return R.splice(F,1),Se(ee({},X),{taxes:R})}),E(null)},xe=(T.items||[]).reduce((F,X)=>{var R,I;return F+((I=(R=X.qty)!=null?R:X.received_qty)!=null?I:0)*(X.rate||0)},0),be=(T.taxes||[]).reduce((F,X)=>X.charge_type==="On Net Total"?F+(X.rate||0)/100*xe:X.charge_type==="Actual"?F+(X.tax_amount||0):F+(X.rate||0)/100*xe,0),me=xe+be,oe=F=>fe(null,null,function*(){var X;if(F)try{const te=(yield(yield fetch(`/api/resource/Purchase Taxes and Charges Template/${encodeURIComponent(F)}`,{credentials:"include"})).json()).data;(X=te==null?void 0:te.taxes)!=null&&X.length&&P(q=>Se(ee({},q),{taxes:te.taxes.map(B=>{var je;return{charge_type:B.charge_type,account_head:B.account_head,description:B.description,rate:B.rate,cost_center:B.cost_center,account_currency:B.account_currency,included_in_print_rate:(je=B.included_in_print_rate)!=null?je:0}})}))}catch(R){}}),L=()=>({supplier:T.supplier,company:T.company||void 0,project:T.project||void 0,posting_date:T.posting_date,currency:T.currency||void 0,set_warehouse:T.set_warehouse||void 0,cost_center:T.cost_center||void 0,tax_category:T.tax_category||void 0,taxes_and_charges:T.taxes_and_charges||void 0,items:(T.items||[]).filter(F=>F.item_code).map((F,X)=>{var R,I,te,q,B,je,Ce,ye,Ee,Xe,tt,ve;return{item_code:F.item_code,item_name:F.item_name||F.item_code,description:F.description||F.item_name||F.item_code,received_qty:(R=F.received_qty)!=null?R:0,qty:(te=(I=F.qty)!=null?I:F.received_qty)!=null?te:0,rejected_qty:(q=F.rejected_qty)!=null?q:0,uom:F.uom||void 0,stock_uom:F.stock_uom||void 0,conversion_factor:(B=F.conversion_factor)!=null?B:1,rate:(je=F.rate)!=null?je:0,amount:((ye=(Ce=F.qty)!=null?Ce:F.received_qty)!=null?ye:0)*((Ee=F.rate)!=null?Ee:0),price_list_rate:(Xe=F.price_list_rate)!=null?Xe:0,warehouse:F.warehouse||void 0,rejected_warehouse:F.rejected_warehouse||void 0,expense_account:F.expense_account||void 0,cost_center:F.cost_center||void 0,project:F.project||T.project||void 0,purchase_order:F.purchase_order||void 0,purchase_order_item:F.purchase_order_item||void 0,schedule_date:F.schedule_date||void 0,is_free_item:(tt=F.is_free_item)!=null?tt:0,retain_sample:(ve=F.retain_sample)!=null?ve:0,sample_quantity:F.sample_quantity||void 0,weight_per_unit:F.weight_per_unit||void 0,idx:X+1}}),taxes:(T.taxes||[]).filter(F=>F.charge_type).map((F,X)=>{var R,I;return{charge_type:F.charge_type,account_head:F.account_head||void 0,description:F.description||void 0,included_in_print_rate:(R=F.included_in_print_rate)!=null?R:0,cost_center:F.cost_center||void 0,rate:(I=F.rate)!=null?I:0,account_currency:F.account_currency||xt,idx:X+1}})}),H=()=>fe(null,null,function*(){if(!T.supplier){$e.error("Supplier is required");return}try{if(v(!0),a){const F=yield Lc.createPurchaseReceipt(L());$e.success("Purchase Receipt created"),k(!1),r(`/purchase-receipts/${F.name}`)}else{const F=yield Lc.updatePurchaseReceipt(e,L());f(F),D(F),$e.success("Purchase Receipt saved"),k(!1)}}catch(F){$e.error(F.message||"Error saving")}finally{v(!1)}}),K=()=>fe(null,null,function*(){if(!(!e||a))try{w(!0);const F=yield Lc.submitPurchaseReceipt(e);f(F),D(F),$e.success("Purchase Receipt submitted")}catch(F){$e.error(F.message||"Error submitting")}finally{w(!1)}}),Y=a||j,re=!a&&(d==null?void 0:d.docstatus)===1,de=a?"New Purchase Receipt":T.supplier_name||e||"";return p?n.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:n.jsx(vt,{className:"animate-spin text-green-500 text-3xl"})}):n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6",children:[n.jsx(Br,{position:"top-right",autoClose:3500}),n.jsxs("div",{className:"flex items-center gap-2 text-sm mb-6 text-gray-500",children:[n.jsx("button",{onClick:()=>r("/purchase-receipts"),className:"hover:text-green-600",children:"Purchase Receipts"}),n.jsx("span",{children:"/"}),n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:a?"New Purchase Receipt":e})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"px-6 py-4 border-b border-gray-100 dark:border-gray-700 flex items-center justify-between gap-4 flex-wrap",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>r("/purchase-receipts"),className:"text-gray-400 hover:text-gray-700",children:n.jsx(da,{})}),n.jsx(uP,{className:"text-green-500"}),n.jsx("div",{children:n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:de}),!a&&e&&n.jsx("span",{className:"text-xs text-gray-400 font-mono",children:e}),!a&&n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${(()=>{const F=(d==null?void 0:d.status)||"";return(d==null?void 0:d.docstatus)===2||F==="Cancelled"?"bg-red-100 text-red-700":!d||d.docstatus===0?"bg-yellow-100 text-yellow-800":F==="Completed"?"bg-green-100 text-green-800":F==="Return Issued"?"bg-orange-100 text-orange-800":F==="Closed"?"bg-gray-100 text-gray-700":"bg-green-100 text-green-800"})()}`,children:(d==null?void 0:d.docstatus)===2?"Cancelled":(d==null?void 0:d.docstatus)===0?"Draft":(d==null?void 0:d.status)||"Submitted"})]})})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[!a&&!j&&(d==null?void 0:d.docstatus)===0&&n.jsxs("button",{onClick:K,disabled:b,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 text-sm font-medium",children:[b?n.jsx(vt,{className:"animate-spin"}):n.jsx(cu,{size:12})," Submit"]}),!a&&!j&&!re&&n.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-2 px-4 py-2 border border-green-500 text-green-600 rounded-lg hover:bg-green-50 text-sm",children:[n.jsx(ha,{})," Edit"]}),Y&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:H,disabled:x,className:"flex items-center gap-2 px-4 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 disabled:opacity-50 text-sm font-medium",children:[x?n.jsx(vt,{className:"animate-spin"}):n.jsx(Cn,{}),x?"Saving…":"Save"]}),!a&&n.jsx("button",{onClick:()=>{d&&D(d),k(!1)},className:"px-3 py-2 border border-gray-300 rounded-lg text-gray-600 text-sm",children:n.jsx(yt,{})})]})]})]}),n.jsx("div",{className:"px-6 pt-5 pb-4",children:n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-4",children:[n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"Supplier"}),Y?n.jsx(Be,{label:"Supplier",hideLabel:!0,doctype:"Supplier",value:T.supplier||"",onChange:F=>{z("supplier",F),z("supplier_name",F)},placeholder:"Select supplier…"}):n.jsx(ii,{children:T.supplier_name||T.supplier})]}),n.jsxs("div",{children:[n.jsx(Tt,{required:!0,children:"Posting Date"}),Y?n.jsx("input",{type:"date",value:T.posting_date||"",onChange:F=>z("posting_date",F.target.value),className:Do}):n.jsx(ii,{children:T.posting_date})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Company"}),Y?n.jsx(Be,{label:"Company",hideLabel:!0,doctype:"Company",value:T.company||"",onChange:F=>z("company",F),placeholder:"Select company…"}):n.jsx(ii,{children:T.company})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Project"}),Y?n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:T.project||"",onChange:F=>z("project",F),placeholder:"Select project…"}):n.jsx(ii,{children:T.project})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Set Warehouse"}),Y?n.jsx(Be,{label:"Warehouse",hideLabel:!0,doctype:"Warehouse",value:T.set_warehouse||"",onChange:F=>z("set_warehouse",F),placeholder:"Warehouse…"}):n.jsx(ii,{children:T.set_warehouse})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Currency"}),Y?n.jsxs("select",{value:T.currency||xt,onChange:F=>z("currency",F.target.value),className:Do,children:[n.jsx("option",{value:"SAR",children:"SAR"}),n.jsx("option",{value:"USD",children:"USD"}),n.jsx("option",{value:"EUR",children:"EUR"})]}):n.jsx(ii,{children:T.currency})]})]})}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:"px-6 py-3 bg-gray-50 dark:bg-gray-900/20 border-b border-gray-100 dark:border-gray-700",children:n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Items"})}),n.jsxs("div",{className:"px-6 pb-5",children:[n.jsx("div",{className:"overflow-x-auto -mx-2 mt-3",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 min-w-[180px]",children:["Item Code ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 min-w-[140px]",children:"Item Name"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:"Received Qty"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:"Accepted Qty"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Rate"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Amount"}),Y&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[(T.items||[]).map((F,X)=>{var R,I,te,q,B,je,Ce,ye,Ee;return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${C===X?"bg-blue-50/60 dark:bg-blue-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:X+1}),n.jsx("td",{className:"py-1.5 px-2 min-w-[180px]",children:Y?n.jsx(Be,{label:"Item",hideLabel:!0,doctype:"Item",value:F.item_code||"",onChange:Xe=>V(X,Xe),placeholder:"Item Code"}):n.jsx("span",{className:"font-medium text-gray-800 dark:text-gray-200",children:F.item_code||"-"})}),n.jsx("td",{className:"py-1.5 px-2 min-w-[140px]",children:n.jsx("span",{className:"text-gray-500 text-sm",children:F.item_name||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:Y?n.jsx("input",{type:"number",min:0,step:"1",value:(R=F.received_qty)!=null?R:0,onChange:Xe=>G(X,"received_qty",parseFloat(Xe.target.value)||0),className:gg}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 text-sm pr-1",children:((I=F.received_qty)!=null?I:0).toFixed(3)})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:Y?n.jsx("input",{type:"number",min:0,step:"1",value:(q=(te=F.qty)!=null?te:F.received_qty)!=null?q:0,onChange:Xe=>G(X,"qty",parseFloat(Xe.target.value)||0),className:gg}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 text-sm pr-1",children:((B=F.qty)!=null?B:0).toFixed(3)})}),n.jsx("td",{className:"py-1.5 px-2 w-28",children:Y?n.jsx("input",{type:"number",min:0,step:"0.01",value:(je=F.rate)!=null?je:0,onChange:Xe=>G(X,"rate",parseFloat(Xe.target.value)||0),className:gg}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 text-sm pr-1",children:((Ce=F.rate)!=null?Ce:0).toFixed(2)})}),n.jsx("td",{className:"py-1.5 px-3 text-right font-semibold text-gray-900 dark:text-white text-sm",children:(((Ee=(ye=F.qty)!=null?ye:F.received_qty)!=null?Ee:0)*(F.rate||0)).toFixed(2)}),Y&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>N(C===X?null:X),className:`p-1.5 rounded text-xs ${C===X?"bg-blue-600 text-white":"text-green-600 hover:bg-green-50"}`,title:"More fields",children:n.jsx(Vs,{size:11})}),n.jsx("button",{onClick:()=>ge(X),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:n.jsx(Za,{size:11})})]})})]}),Y&&C===X&&n.jsx(W1e,{item:F,rowNo:X+1,onChange:(Xe,tt)=>{Xe==="item_code"?V(X,tt):G(X,Xe,tt)},onClose:()=>N(null),onDelete:()=>ge(X),onInsertBelow:()=>ne(X)})]},X)}),Y&&n.jsx("tr",{children:n.jsx("td",{colSpan:8,className:"py-2 px-3",children:n.jsxs("button",{onClick:()=>ne(),className:"flex items-center gap-1.5 text-green-600 hover:text-green-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})}),n.jsxs("div",{className:"mt-3 flex justify-between text-sm border-t border-gray-100 dark:border-gray-700 pt-3",children:[n.jsxs("span",{className:"text-gray-500",children:["Total Qty: ",n.jsx("strong",{children:(T.items||[]).reduce((F,X)=>{var R,I;return F+((I=(R=X.qty)!=null?R:X.received_qty)!=null?I:0)},0).toFixed(3)})]}),n.jsxs("span",{className:"text-gray-500",children:["Total: ",n.jsxs("strong",{className:"text-gray-900 dark:text-white",children:[T.currency||xt," ",xe.toFixed(2)]})]})]})]})]}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700",children:[n.jsx("div",{className:"px-6 py-3 bg-gray-50 dark:bg-gray-900/20 border-b border-gray-100 dark:border-gray-700",children:n.jsx("span",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300",children:"Taxes and Charges"})}),n.jsxs("div",{className:"px-6 pt-4 pb-2 grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-3",children:[n.jsxs("div",{children:[n.jsx(Tt,{children:"Tax Category"}),Y?n.jsx(Be,{label:"Tax Category",hideLabel:!0,doctype:"Tax Category",value:T.tax_category||"",onChange:F=>z("tax_category",F),placeholder:"Select tax category…"}):n.jsx(ii,{children:T.tax_category})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Purchase Taxes and Charges Template"}),Y?n.jsx(Be,{label:"Purchase Taxes and Charges Template",hideLabel:!0,doctype:"Purchase Taxes and Charges Template",value:T.taxes_and_charges||"",onChange:F=>{z("taxes_and_charges",F),oe(F)},placeholder:"Select template…"}):n.jsx(ii,{children:T.taxes_and_charges})]})]}),n.jsxs("div",{className:"px-6 pb-5",children:[n.jsx("div",{className:"overflow-x-auto -mx-2 mt-3",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-44",children:["Type ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsxs("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3",children:["Account Head ",n.jsx("span",{className:"text-red-400",children:"*"})]}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-24",children:"Tax Rate"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Amount"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Total"}),Y&&n.jsx("th",{className:"w-16 py-2 px-2"})]})}),n.jsxs("tbody",{children:[(T.taxes||[]).map((F,X)=>{var te,q;const R=F.charge_type==="On Net Total"?(F.rate||0)/100*xe:F.charge_type==="Actual"?F.tax_amount||0:(F.rate||0)/100*xe,I=xe+(T.taxes||[]).slice(0,X+1).reduce((B,je)=>{const Ce=je.charge_type==="On Net Total"?(je.rate||0)/100*xe:je.charge_type==="Actual"?je.tax_amount||0:(je.rate||0)/100*xe;return B+Ce},0);return n.jsxs(_t.Fragment,{children:[n.jsxs("tr",{className:`border-b border-gray-100 dark:border-gray-700 align-middle ${O===X?"bg-blue-50/60 dark:bg-blue-900/10":""}`,children:[n.jsx("td",{className:"py-1.5 px-3 text-gray-400 text-xs",children:X+1}),n.jsx("td",{className:"py-1.5 px-2 w-44",children:Y?n.jsxs("select",{value:F.charge_type||"",onChange:B=>Z(X,"charge_type",B.target.value),className:q1e,children:[n.jsx("option",{value:"",children:"Select type…"}),n.jsx("option",{value:"Actual",children:"Actual"}),n.jsx("option",{value:"On Net Total",children:"On Net Total"}),n.jsx("option",{value:"On Previous Row Amount",children:"On Previous Row Amount"}),n.jsx("option",{value:"On Previous Row Total",children:"On Previous Row Total"}),n.jsx("option",{value:"On Item Quantity",children:"On Item Quantity"}),n.jsx("option",{value:"Inter Company Transaction",children:"Inter Company Transaction"})]}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:F.charge_type||"-"})}),n.jsx("td",{className:"py-1.5 px-2",children:Y?n.jsx(Be,{label:"Account Head",hideLabel:!0,doctype:"Account",value:F.account_head||"",onChange:B=>Z(X,"account_head",B),placeholder:"Account Head"}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:F.account_head||"-"})}),n.jsx("td",{className:"py-1.5 px-2 w-24",children:Y?n.jsx("input",{type:"number",min:0,step:"0.01",value:(te=F.rate)!=null?te:0,onChange:B=>Z(X,"rate",parseFloat(B.target.value)||0),className:gg}):n.jsx("span",{className:"block text-right text-gray-700 dark:text-gray-300 pr-1",children:(q=F.rate)!=null?q:0})}),n.jsx("td",{className:"py-1.5 px-3 text-right text-gray-700 dark:text-gray-300 text-sm",children:R.toFixed(2)}),n.jsx("td",{className:"py-1.5 px-3 text-right font-semibold text-gray-900 dark:text-white text-sm",children:I.toFixed(2)}),Y&&n.jsx("td",{className:"py-1.5 px-2",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>E(O===X?null:X),className:`p-1.5 rounded text-xs ${O===X?"bg-blue-600 text-white":"text-green-600 hover:bg-green-50"}`,title:"More fields",children:n.jsx(Vs,{size:11})}),n.jsx("button",{onClick:()=>ce(X),className:"p-1.5 text-red-400 hover:text-red-600 hover:bg-red-50 rounded",children:n.jsx(Za,{size:11})})]})})]}),Y&&O===X&&n.jsx(V1e,{tax:F,rowNo:X+1,onChange:(B,je)=>Z(X,B,je),onClose:()=>E(null),onDelete:()=>ce(X),onInsertBelow:()=>U(X)})]},X)}),Y&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{onClick:()=>U(),className:"flex items-center gap-1.5 text-green-600 hover:text-green-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})}),(T.taxes||[]).length>0&&n.jsxs("div",{className:"mt-2 flex justify-end text-sm text-gray-500 pt-2 border-t border-gray-100 dark:border-gray-700",children:["Total Taxes and Charges: ",n.jsxs("strong",{className:"ml-2 text-gray-900 dark:text-white",children:[T.currency||xt," ",be.toFixed(2)]})]})]})]}),n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700 px-6 py-4",children:[n.jsx("h3",{className:"text-sm font-semibold text-gray-700 dark:text-gray-300 mb-3",children:"Totals"}),n.jsx("div",{className:"space-y-2 max-w-xs ml-auto",children:[{label:"Net Total",value:((ie=d==null?void 0:d.net_total)!=null?ie:xe).toFixed(2)},{label:"Total Taxes",value:((se=d==null?void 0:d.total_taxes_and_charges)!=null?se:be).toFixed(2)},{label:"Grand Total",value:((he=d==null?void 0:d.grand_total)!=null?he:me).toFixed(2)},{label:"Rounded Total",value:((_e=d==null?void 0:d.rounded_total)!=null?_e:me).toFixed(2)}].map(({label:F,value:X})=>n.jsxs("div",{className:"flex justify-between text-sm border-b border-gray-100 dark:border-gray-700 pb-1.5 last:border-0",children:[n.jsx("span",{className:"text-gray-500",children:F}),n.jsxs("span",{className:"font-semibold text-gray-900 dark:text-white",children:[T.currency||xt," ",X]})]},F))})]}),!a&&d&&n.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-700 px-6 py-4 grid grid-cols-3 gap-4 text-sm bg-gray-50 dark:bg-gray-900/20",children:[n.jsxs("div",{children:[n.jsx(Tt,{children:"Created By"}),n.jsx(ii,{children:d.owner})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Created"}),n.jsx(ii,{children:d.creation?new Date(d.creation).toLocaleString():"-"})]}),n.jsxs("div",{children:[n.jsx(Tt,{children:"Modified"}),n.jsx(ii,{children:d.modified?new Date(d.modified).toLocaleString():"-"})]})]}),!a&&n.jsx(Yn,{doctype:"Purchase Receipt",docname:(d==null?void 0:d.name)||e||"",creationDate:d==null?void 0:d.creation,createdBy:d==null?void 0:d.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})},kd=20,X1e=(e,t)=>t===1?e==="Paid"?"bg-green-100 text-green-700":"bg-blue-100 text-blue-700":t===2?"bg-red-100 text-red-700":"bg-yellow-100 text-yellow-700",J1e=(e,t)=>t===2?"Cancelled":t===1?e||"Submitted":"Draft";function Q1e(){const{t:e}=sr(),t=Ut(),[r,a]=y.useState([]),[s,i]=y.useState(0),[l,u]=y.useState(0),[d,f]=y.useState(!0),[p,m]=y.useState(!0),[x,v]=y.useState(""),[b,w]=y.useState(""),[j,k]=y.useState(""),[C,N]=y.useState(!1),O=y.useCallback(()=>{const be=[];return x&&be.push(["name","like",`%${x}%`]),b&&be.push(["party","like",`%${b}%`]),j&&be.push(["payment_type","=",j]),be},[x,b,j]),E=y.useCallback((be=0)=>fe(null,null,function*(){f(!0);try{const me=O(),[oe,L]=yield Promise.all([Rc.getPaymentEntries({filters:me,limit_start:be*kd,limit_page_length:kd}),Rc.getPaymentEntryCount(me)]);a(oe),i(L),u(be)}catch(me){$e.error(me.message||"Error loading")}finally{f(!1)}}),[O]);y.useEffect(()=>{E(0)},[E]);const A=y.useMemo(()=>`${l}|${x}|${b}|${j}`,[l,x,b,j]),{selectedRows:T,toggleRow:P,toggleAllOnPage:D,allOnPageSelected:z,someOnPageSelected:G}=Vn(r,A),V=y.useCallback(()=>Kn({doctype:"Payment Entry",filters:O(),orderBy:"modified desc"}),[O]),ne=be=>E(be),ge=[x,b,j].filter(Boolean).length,Z=()=>{v(""),w(""),k("")},U=be=>t(`/payment-entries/${encodeURIComponent(be)}`),ce=be=>t(`/payment-entries/${encodeURIComponent(be)}?edit=1`),xe=be=>t(`/payment-entries/new?duplicate=${encodeURIComponent(be)}`);return n.jsxs(n.Fragment,{children:[n.jsx(Br,{position:"top-right",autoClose:3e3}),n.jsxs("div",{className:"px-6 py-6 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-teal-600 flex items-center justify-center shadow",children:n.jsx(Dl,{className:"text-white",size:18})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Payment Entries"}),n.jsxs("p",{className:"text-xs text-gray-500",children:[s," total"]})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("button",{onClick:()=>E(l),className:"p-2 text-gray-500 hover:text-teal-600 hover:bg-teal-50 rounded-lg transition-colors",children:n.jsx(en,{size:14})}),n.jsxs("button",{type:"button",onClick:()=>N(!0),className:"bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg flex items-center gap-2 shadow transition-all text-sm font-medium disabled:opacity-50",disabled:s===0&&T.size===0,children:[n.jsx(hn,{})," ",e("listPages.export"),T.size>0&&n.jsx("span",{className:"bg-white/25 px-1.5 py-0.5 rounded text-xs font-bold",children:T.size})]}),n.jsxs("button",{onClick:()=>t("/payment-entries/new"),className:"flex items-center gap-2 px-4 py-2 bg-teal-600 hover:bg-teal-700 text-white text-sm font-semibold rounded-lg shadow transition-colors",children:[n.jsx(Pt,{size:12})," New Entry"]})]})]}),n.jsx(Gn,{isOpen:C,onClose:()=>N(!1),doctype:"Payment Entry",selectedCount:T.size,pageCount:r.length,totalCount:s,pageData:r,selectedRows:T,rowKey:"name",onFetchAll:V,fileNamePrefix:"payment_entries"}),n.jsxs("div",{className:"rounded-xl border border-blue-200 dark:border-blue-800 overflow-hidden shadow-sm",children:[n.jsxs("button",{onClick:()=>m(be=>!be),className:"w-full flex items-center justify-between px-4 py-3 bg-gradient-to-r from-blue-500 to-blue-600 dark:from-blue-600 dark:to-blue-700 text-white text-sm font-semibold",children:[n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Dh,{size:12})," Filters ",ge>0&&n.jsx("span",{className:"bg-white/25 text-white text-[10px] px-1.5 py-0.5 rounded-full",children:ge})]}),p?n.jsx(ps,{size:12}):n.jsx(nr,{size:12})]}),p&&n.jsxs("div",{className:"p-4 bg-white dark:bg-gray-800 grid grid-cols-1 sm:grid-cols-3 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-semibold text-gray-500 uppercase mb-1",children:"Payment ID"}),n.jsx("input",{value:x,onChange:be=>v(be.target.value),placeholder:"Search by ID…",className:"w-full border border-gray-200 dark:border-gray-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-indigo-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-semibold text-gray-500 uppercase mb-1",children:"Party"}),n.jsx("input",{value:b,onChange:be=>w(be.target.value),placeholder:"Customer / Supplier…",className:"w-full border border-gray-200 dark:border-gray-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-indigo-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-[10px] font-semibold text-gray-500 uppercase mb-1",children:"Type"}),n.jsxs("select",{value:j,onChange:be=>k(be.target.value),className:"w-full border border-gray-200 dark:border-gray-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-indigo-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100",children:[n.jsx("option",{value:"",children:"All Types"}),n.jsx("option",{value:"Receive",children:"Receive"}),n.jsx("option",{value:"Pay",children:"Pay"}),n.jsx("option",{value:"Internal Transfer",children:"Internal Transfer"})]})]}),ge>0&&n.jsxs("div",{className:"sm:col-span-3 flex flex-wrap gap-2 items-center",children:[x&&n.jsxs("span",{className:"flex items-center gap-1 bg-blue-100 text-blue-700 text-xs px-2 py-1 rounded-full",children:["ID: ",x,n.jsx("button",{onClick:()=>v(""),children:n.jsx(yt,{size:9})})]}),b&&n.jsxs("span",{className:"flex items-center gap-1 bg-blue-100 text-blue-700 text-xs px-2 py-1 rounded-full",children:["Party: ",b,n.jsx("button",{onClick:()=>w(""),children:n.jsx(yt,{size:9})})]}),j&&n.jsxs("span",{className:"flex items-center gap-1 bg-blue-100 text-blue-700 text-xs px-2 py-1 rounded-full",children:["Type: ",j,n.jsx("button",{onClick:()=>k(""),children:n.jsx(yt,{size:9})})]}),n.jsx("button",{onClick:Z,className:"text-xs text-blue-600 hover:text-blue-800 font-medium ml-1",children:"Clear all"})]})]})]}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"w-10 px-4 py-3 text-left",children:n.jsx("button",{type:"button",onClick:D,className:"text-gray-500 dark:text-gray-400 hover:text-teal-600 dark:hover:text-teal-400 transition-colors",title:z?"Deselect all":"Select all","aria-label":"Select all on page",children:z?n.jsx(Sn,{className:"text-teal-600 dark:text-teal-400",size:18}):G?n.jsxs("div",{className:"relative inline-block",children:[n.jsx(Gr,{size:18}),n.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"w-2 h-0.5 bg-current"})})]}):n.jsx(Gr,{size:18})})}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Payment ID"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Type"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Date"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Party"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Amount"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4",children:"Status"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-3 px-4 w-28",children:" "})]})}),n.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:d?n.jsx("tr",{children:n.jsx("td",{colSpan:8,className:"text-center py-10 text-gray-400",children:"Loading…"})}):r.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:8,className:"text-center py-10 text-gray-400",children:"No payment entries found"})}):r.map(be=>n.jsxs("tr",{onClick:()=>U(be.name),className:`cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors ${T.has(be.name)?"bg-teal-50 dark:bg-teal-900/20":""}`,children:[n.jsx("td",{className:"w-10 px-4 py-3",onClick:me=>me.stopPropagation(),children:n.jsx("button",{type:"button",onClick:()=>P(be.name),className:"text-gray-500 dark:text-gray-400 hover:text-teal-600 dark:hover:text-teal-400 transition-colors","aria-label":`Select ${be.name}`,children:T.has(be.name)?n.jsx(Sn,{className:"text-teal-600 dark:text-teal-400",size:18}):n.jsx(Gr,{size:18})})}),n.jsx("td",{className:"py-3 px-4 font-medium text-gray-900 dark:text-white",children:be.name}),n.jsx("td",{className:"py-3 px-4 text-gray-700 dark:text-gray-300",children:be.payment_type||"-"}),n.jsx("td",{className:"py-3 px-4 text-gray-500",children:be.posting_date||"-"}),n.jsx("td",{className:"py-3 px-4 text-gray-700 dark:text-gray-300",children:be.party_name||be.party||"-"}),n.jsx("td",{className:"py-3 px-4 text-right font-semibold text-gray-900 dark:text-white",children:(be.paid_amount||0).toFixed(2)}),n.jsx("td",{className:"py-3 px-4",children:n.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${X1e(be.status,be.docstatus)}`,children:J1e(be.status,be.docstatus)})}),n.jsx("td",{className:"py-2 px-4",onClick:me=>me.stopPropagation(),children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>U(be.name),className:"text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 p-2 hover:bg-blue-50 dark:hover:bg-blue-900/30 rounded transition-colors",title:"View",children:n.jsx(Hs,{})}),n.jsx("button",{onClick:()=>ce(be.name),className:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 p-2 hover:bg-green-50 dark:hover:bg-green-900/30 rounded transition-colors",title:"Edit",children:n.jsx(ha,{})}),n.jsx("button",{onClick:()=>xe(be.name),className:"text-purple-600 dark:text-purple-400 hover:text-purple-900 dark:hover:text-purple-300 p-2 hover:bg-purple-50 dark:hover:bg-purple-900/30 rounded transition-colors",title:"Duplicate",children:n.jsx(uu,{})})]})})]},be.name))})]})}),s>kd&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-100 dark:border-gray-700",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:[l*kd+1,"",Math.min((l+1)*kd,s)," of ",s]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{disabled:l===0,onClick:()=>ne(l-1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Prev"}),n.jsx("button",{disabled:(l+1)*kd>=s,onClick:()=>ne(l+1),className:"px-3 py-1 text-xs border border-gray-300 rounded disabled:opacity-40",children:"Next"})]})]})]})]})]})}const Mn=({children:e,required:t})=>n.jsxs("label",{className:"block text-[11px] font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-1",children:[e,t&&n.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),yn=({children:e})=>n.jsx("p",{className:"text-sm text-gray-800 dark:text-gray-200 min-h-[20px] py-0.5",children:e||n.jsx("span",{className:"text-gray-400 italic",children:"—"})}),Ac="w-full border border-gray-200 dark:border-gray-600 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-teal-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100",yO=Ac+" text-right",Z1e=e=>{var r;const t=(r=e.docstatus)!=null?r:0;if(t===2)return n.jsx("span",{className:"px-2 py-1 rounded-full text-xs font-bold bg-red-100 text-red-700",children:"Cancelled"});if(t===1){const a=e.status||"Submitted";return a==="Paid"?n.jsx("span",{className:"px-2 py-1 rounded-full text-xs font-bold bg-green-100 text-green-700",children:"Paid"}):n.jsx("span",{className:"px-2 py-1 rounded-full text-xs font-bold bg-blue-100 text-blue-700",children:a})}return n.jsx("span",{className:"px-2 py-1 rounded-full text-xs font-bold bg-yellow-100 text-yellow-700",children:"Draft"})},Sd=({title:e,children:t})=>n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden",children:[n.jsx("div",{className:"px-4 py-2.5 border-b border-gray-100 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:n.jsx("h3",{className:"text-xs font-bold text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:e})}),n.jsx("div",{className:"p-4",children:t})]}),ebe=()=>({reference_doctype:"Sales Invoice",reference_name:"",total_amount:0,outstanding_amount:0,allocated_amount:0,exchange_rate:1}),tbe="Cash - SA";function rbe(){var be,me,oe,L;const{peName:e}=Hn(),t=Ut(),[r]=dn(),a=e==="new",s=r.get("si")||"",i=r.get("customer")||"",l=r.get("company")||fa,u=r.get("project")||"",d=parseFloat(r.get("amount")||"0"),f=r.get("currency")||xt,[p,m]=y.useState(null),[x,v]=y.useState(!a),[b,w]=y.useState(!1),[j,k]=y.useState(!1),[C,N]=y.useState(a),O=new Date().toISOString().split("T")[0],[E,A]=y.useState({payment_type:"Receive",posting_date:O,company:l,party_type:"Customer",party:i||"",party_name:i||"",mode_of_payment:"Cash",paid_to:tbe,reference_date:O,reference_no:"",paid_amount:d||0,received_amount:d||0,source_exchange_rate:1,target_exchange_rate:1,project:u||"",references:s?[{reference_doctype:"Sales Invoice",reference_name:s,total_amount:d,outstanding_amount:d,allocated_amount:d,exchange_rate:1}]:[]}),T=y.useCallback(H=>{A({payment_type:H.payment_type||"Receive",posting_date:H.posting_date||O,company:H.company||fa,party_type:H.party_type||"Customer",party:H.party||"",party_name:H.party_name||"",mode_of_payment:H.mode_of_payment||"",paid_from:H.paid_from||"",paid_to:H.paid_to||"",paid_from_account_currency:H.paid_from_account_currency||"",paid_to_account_currency:H.paid_to_account_currency||"",paid_amount:H.paid_amount||0,received_amount:H.received_amount||0,source_exchange_rate:H.source_exchange_rate||1,target_exchange_rate:H.target_exchange_rate||1,total_allocated_amount:H.total_allocated_amount||0,unallocated_amount:H.unallocated_amount||0,difference_amount:H.difference_amount||0,project:H.project||"",cost_center:H.cost_center||"",remarks:H.remarks||"",reference_no:H.reference_no||"",reference_date:H.reference_date||"",references:H.references||[]})},[O]);y.useEffect(()=>{!a||!s||fetch(`/api/resource/Sales Invoice/${encodeURIComponent(s)}`,{credentials:"include"}).then(H=>H.json()).then(H=>{const K=H.data;if(!K)return;const Y=K.outstanding_amount||K.grand_total||0;A(re=>Se(ee({},re),{party:K.customer||re.party,party_name:K.customer_name||K.customer||re.party_name,company:K.company||re.company,project:K.project||re.project,paid_from:K.debit_to||"",paid_from_account_currency:K.currency||f,paid_to_account_currency:K.currency||f,paid_amount:Y,received_amount:Y,references:[{reference_doctype:"Sales Invoice",reference_name:s,total_amount:K.grand_total||0,outstanding_amount:Y,allocated_amount:Y,exchange_rate:1}],remarks:`Amount ${K.currency||""} ${Y} received from ${K.customer_name||K.customer}
Amount ${K.currency||""} ${Y} against Sales Invoice ${s}`}))}).catch(()=>{})},[a,s]),y.useEffect(()=>{a||(v(!0),Rc.getPaymentEntry(e).then(H=>{m(H),T(H)}).catch(H=>$e.error(H.message)).finally(()=>v(!1)))},[e,a,T]);const P=(H,K)=>A(Y=>Se(ee({},Y),{[H]:K})),D=(H,K,Y)=>{A(re=>{const de=[...re.references||[]];return de[H]=Se(ee({},de[H]),{[K]:Y}),K==="outstanding_amount"&&(de[H].allocated_amount=Y),Se(ee({},re),{references:de})})},z=()=>A(H=>Se(ee({},H),{references:[...H.references||[],ebe()]})),G=H=>A(K=>Se(ee({},K),{references:(K.references||[]).filter((Y,re)=>re!==H)})),V=(E.references||[]).reduce((H,K)=>H+(K.allocated_amount||0),0),ne=(H,K,Y)=>fe(null,null,function*(){if(Y)try{const ie=(yield(yield fetch(`/api/resource/${encodeURIComponent(K)}/${encodeURIComponent(Y)}`,{credentials:"include"})).json()).data;if(!ie)return;A(se=>{const he=[...se.references||[]];return he[H]=Se(ee({},he[H]),{total_amount:ie.grand_total||ie.outstanding_amount||0,outstanding_amount:ie.outstanding_amount||ie.grand_total||0,allocated_amount:ie.outstanding_amount||ie.grand_total||0}),Se(ee({},se),{references:he,paid_amount:ie.outstanding_amount||ie.grand_total||0,received_amount:ie.outstanding_amount||ie.grand_total||0})})}catch(re){}}),ge=()=>({payment_type:E.payment_type||"Receive",posting_date:E.posting_date,company:E.company||void 0,party_type:E.party_type||"Customer",party:E.party,party_name:E.party_name||E.party,mode_of_payment:E.mode_of_payment||void 0,paid_from:E.paid_from||void 0,paid_to:E.paid_to||void 0,paid_from_account_currency:E.paid_from_account_currency||void 0,paid_to_account_currency:E.paid_to_account_currency||void 0,paid_amount:E.paid_amount||V,received_amount:E.received_amount||V,source_exchange_rate:E.source_exchange_rate||1,target_exchange_rate:E.target_exchange_rate||1,project:E.project||void 0,cost_center:E.cost_center||void 0,remarks:E.remarks||void 0,reference_no:E.reference_no||void 0,reference_date:E.reference_date||void 0,references:(E.references||[]).filter(H=>H.reference_name).map((H,K)=>({reference_doctype:H.reference_doctype||"Sales Invoice",reference_name:H.reference_name,total_amount:H.total_amount||0,outstanding_amount:H.outstanding_amount||0,allocated_amount:H.allocated_amount||0,exchange_rate:H.exchange_rate||1,idx:K+1}))}),Z=()=>fe(null,null,function*(){if(!E.party){$e.error("Party is required");return}try{if(w(!0),a){const H=yield Rc.createPaymentEntry(ge());$e.success("Payment Entry created"),N(!1),t(`/payment-entries/${H.name}`)}else{const H=yield Rc.updatePaymentEntry(e,ge());m(H),T(H),$e.success("Payment Entry saved"),N(!1)}}catch(H){$e.error(H.message||"Error saving")}finally{w(!1)}}),U=()=>fe(null,null,function*(){if(!(!e||a))try{k(!0);const H=yield Rc.submitPaymentEntry(e);m(H),T(H),$e.success("Payment Entry submitted")}catch(H){$e.error(H.message||"Error submitting")}finally{k(!1)}}),ce=C&&((be=p==null?void 0:p.docstatus)!=null?be:0)<1,xe=((me=p==null?void 0:p.docstatus)!=null?me:0)===1;return x?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-teal-600"})}):n.jsxs(n.Fragment,{children:[n.jsx(Br,{position:"top-right",autoClose:3e3}),n.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 px-6 py-6 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("button",{onClick:()=>t("/payment-entries"),className:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",children:n.jsx(da,{size:14})}),n.jsx("div",{className:"w-9 h-9 rounded-xl bg-teal-600 flex items-center justify-center shadow-sm",children:n.jsx(Dl,{className:"text-white",size:15})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h1",{className:"text-lg font-bold text-gray-900 dark:text-white",children:a?"New Payment Entry":(p==null?void 0:p.party_name)||(p==null?void 0:p.party)||e}),!a&&Z1e(p||{})]}),!a&&n.jsx("p",{className:"text-xs text-gray-400",children:e})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[ce&&n.jsxs("button",{onClick:Z,disabled:b,className:"flex items-center gap-2 px-4 py-2 bg-teal-600 hover:bg-teal-700 text-white text-sm font-semibold rounded-lg shadow disabled:opacity-50 transition-colors",children:[n.jsx(Cn,{size:13}),b?"Saving…":"Save"]}),!a&&!C&&!xe&&n.jsx("button",{onClick:()=>N(!0),className:"flex items-center gap-2 px-4 py-2 border border-teal-500 text-teal-600 hover:bg-teal-50 text-sm font-semibold rounded-lg transition-colors",children:"Edit"}),!a&&!xe&&!C&&n.jsxs("button",{onClick:U,disabled:j,className:"flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-lg shadow disabled:opacity-50 transition-colors",children:[n.jsx(Oq,{size:12}),j?"Submitting…":"Submit"]})]})]}),n.jsx(Sd,{title:"Payment Details",children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Mn,{required:!0,children:"Payment Type"}),ce?n.jsxs("select",{value:E.payment_type||"Receive",onChange:H=>P("payment_type",H.target.value),className:Ac,children:[n.jsx("option",{value:"Receive",children:"Receive"}),n.jsx("option",{value:"Pay",children:"Pay"}),n.jsx("option",{value:"Internal Transfer",children:"Internal Transfer"})]}):n.jsx(yn,{children:E.payment_type})]}),n.jsxs("div",{children:[n.jsx(Mn,{required:!0,children:"Posting Date"}),ce?n.jsx("input",{type:"date",value:E.posting_date||"",onChange:H=>P("posting_date",H.target.value),className:Ac}):n.jsx(yn,{children:E.posting_date})]}),n.jsxs("div",{children:[n.jsx(Mn,{children:"Mode of Payment"}),ce?n.jsx(Be,{label:"Mode of Payment",hideLabel:!0,doctype:"Mode of Payment",value:E.mode_of_payment||"",onChange:H=>P("mode_of_payment",H),placeholder:"Cash, Bank…"}):n.jsx(yn,{children:E.mode_of_payment})]}),n.jsxs("div",{children:[n.jsx(Mn,{children:"Company"}),ce?n.jsx(Be,{label:"Company",hideLabel:!0,doctype:"Company",value:E.company||"",onChange:H=>P("company",H),placeholder:"Company…"}):n.jsx(yn,{children:E.company})]})]})}),n.jsx(Sd,{title:"Payment From / To",children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Mn,{children:"Party Type"}),ce?n.jsxs("select",{value:E.party_type||"Customer",onChange:H=>P("party_type",H.target.value),className:Ac,children:[n.jsx("option",{value:"Customer",children:"Customer"}),n.jsx("option",{value:"Supplier",children:"Supplier"}),n.jsx("option",{value:"Employee",children:"Employee"})]}):n.jsx(yn,{children:E.party_type})]}),n.jsxs("div",{children:[n.jsx(Mn,{required:!0,children:"Party"}),ce?n.jsx(Be,{label:"Party",hideLabel:!0,doctype:E.party_type||"Customer",value:E.party||"",onChange:H=>{P("party",H),P("party_name",H)},placeholder:"Select party…"}):n.jsx(yn,{children:E.party_name||E.party})]}),n.jsxs("div",{children:[n.jsx(Mn,{children:"Project"}),ce?n.jsx(Be,{label:"Project",hideLabel:!0,doctype:"Project",value:E.project||"",onChange:H=>P("project",H),placeholder:"Project…"}):n.jsx(yn,{children:E.project})]}),n.jsxs("div",{children:[n.jsx(Mn,{children:"Cost Center"}),ce?n.jsx(Be,{label:"Cost Center",hideLabel:!0,doctype:"Cost Center",value:E.cost_center||"",onChange:H=>P("cost_center",H),placeholder:"Cost center…"}):n.jsx(yn,{children:E.cost_center})]})]})}),n.jsx(Sd,{title:"Accounts",children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Mn,{children:"Account Paid From"}),ce?n.jsx(Be,{label:"Account Paid From",hideLabel:!0,doctype:"Account",value:E.paid_from||"",onChange:H=>P("paid_from",H),placeholder:"Debtors account…"}):n.jsx(yn,{children:E.paid_from})]}),n.jsxs("div",{children:[n.jsx(Mn,{children:"Account Paid To"}),ce?n.jsx(Be,{label:"Account Paid To",hideLabel:!0,doctype:"Account",value:E.paid_to||"",onChange:H=>P("paid_to",H),placeholder:"Cash / Bank account…"}):n.jsx(yn,{children:E.paid_to})]}),n.jsxs("div",{children:[n.jsx(Mn,{required:!0,children:"Paid Amount"}),ce?n.jsx("input",{type:"number",min:0,step:"0.01",value:(oe=E.paid_amount)!=null?oe:0,onChange:H=>{const K=parseFloat(H.target.value)||0;P("paid_amount",K),P("received_amount",K)},className:yO}):n.jsx(yn,{children:(E.paid_amount||0).toFixed(2)})]}),n.jsxs("div",{children:[n.jsx(Mn,{children:"Received Amount"}),ce?n.jsx("input",{type:"number",min:0,step:"0.01",value:(L=E.received_amount)!=null?L:0,onChange:H=>P("received_amount",parseFloat(H.target.value)||0),className:yO}):n.jsx(yn,{children:(E.received_amount||0).toFixed(2)})]})]})}),n.jsx(Sd,{title:"Transaction ID",children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx(Mn,{children:"Cheque / Reference No"}),ce?n.jsx("input",{type:"text",value:E.reference_no||"",onChange:H=>P("reference_no",H.target.value),className:Ac,placeholder:"Reference number…"}):n.jsx(yn,{children:E.reference_no})]}),n.jsxs("div",{children:[n.jsx(Mn,{children:"Cheque / Reference Date"}),ce?n.jsx("input",{type:"date",value:E.reference_date||"",onChange:H=>P("reference_date",H.target.value),className:Ac}):n.jsx(yn,{children:E.reference_date})]})]})}),n.jsxs(Sd,{title:"Payment References",children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"min-w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40",children:[n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-8",children:"No."}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3",children:"Type"}),n.jsx("th",{className:"text-left text-[10px] font-semibold text-gray-500 uppercase py-2 px-3",children:"Reference"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Total Amount"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Outstanding"}),n.jsx("th",{className:"text-right text-[10px] font-semibold text-gray-500 uppercase py-2 px-3 w-28",children:"Allocated"}),ce&&n.jsx("th",{className:"w-10 py-2 px-2"})]})}),n.jsxs("tbody",{children:[(E.references||[]).map((H,K)=>{var Y,re;return n.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-700 align-middle",children:[n.jsx("td",{className:"py-2 px-3 text-gray-400 text-xs",children:K+1}),n.jsx("td",{className:"py-2 px-3 w-40",children:ce?n.jsxs("select",{value:H.reference_doctype||"",onChange:de=>D(K,"reference_doctype",de.target.value),className:"w-full border border-gray-200 rounded px-2 py-1 text-xs bg-white dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100",children:[n.jsx("option",{value:"Sales Invoice",children:"Sales Invoice"}),n.jsx("option",{value:"Purchase Invoice",children:"Purchase Invoice"}),n.jsx("option",{value:"Sales Order",children:"Sales Order"}),n.jsx("option",{value:"Purchase Order",children:"Purchase Order"}),n.jsx("option",{value:"Journal Entry",children:"Journal Entry"})]}):n.jsx("span",{className:"text-gray-700 dark:text-gray-300 text-xs",children:H.reference_doctype})}),n.jsx("td",{className:"py-2 px-3 min-w-[180px]",children:ce?n.jsx(Be,{label:"Reference",hideLabel:!0,doctype:H.reference_doctype||"Sales Invoice",value:H.reference_name||"",onChange:de=>{D(K,"reference_name",de),de&&ne(K,H.reference_doctype||"Sales Invoice",de)},placeholder:"Select document…"}):n.jsx("span",{className:"text-teal-600 font-medium text-xs",children:H.reference_name||"-"})}),n.jsx("td",{className:"py-2 px-3 text-right text-gray-700 dark:text-gray-300 text-xs",children:ce?n.jsx("input",{type:"number",min:0,step:"0.01",value:(Y=H.total_amount)!=null?Y:0,onChange:de=>D(K,"total_amount",parseFloat(de.target.value)||0),className:"w-full border border-gray-200 rounded px-2 py-1 text-xs text-right bg-white dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100"}):(H.total_amount||0).toFixed(2)}),n.jsx("td",{className:"py-2 px-3 text-right text-gray-700 dark:text-gray-300 text-xs",children:(H.outstanding_amount||0).toFixed(2)}),n.jsx("td",{className:"py-2 px-3 text-right font-semibold text-gray-900 dark:text-white text-xs",children:ce?n.jsx("input",{type:"number",min:0,step:"0.01",value:(re=H.allocated_amount)!=null?re:0,onChange:de=>D(K,"allocated_amount",parseFloat(de.target.value)||0),className:"w-full border border-gray-200 rounded px-2 py-1 text-xs text-right bg-white dark:bg-gray-700 dark:border-gray-600 dark:text-gray-100"}):(H.allocated_amount||0).toFixed(2)}),ce&&n.jsx("td",{className:"py-2 px-2",children:n.jsx("button",{onClick:()=>G(K),className:"p-1 text-red-400 hover:text-red-600 rounded",children:n.jsx(Za,{size:11})})})]},K)}),ce&&n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"py-2 px-3",children:n.jsxs("button",{onClick:z,className:"flex items-center gap-1.5 text-teal-600 hover:text-teal-700 text-sm font-medium",children:[n.jsx(Pt,{size:10})," Add Row"]})})})]})]})}),n.jsxs("div",{className:"flex justify-end mt-3 pt-3 border-t border-gray-100 dark:border-gray-700 gap-6 text-sm",children:[n.jsxs("span",{className:"text-gray-500",children:["Total Allocated: ",n.jsx("strong",{className:"text-gray-900 dark:text-white",children:V.toFixed(2)})]}),n.jsxs("span",{className:"text-gray-500",children:["Unallocated: ",n.jsx("strong",{className:"text-gray-900 dark:text-white",children:Math.max(0,(E.paid_amount||0)-V).toFixed(2)})]})]})]}),n.jsx(Sd,{title:"Remarks",children:n.jsx("div",{children:ce?n.jsx("textarea",{rows:3,value:E.remarks||"",onChange:H=>P("remarks",H.target.value),className:Ac,placeholder:"Remarks…"}):n.jsx(yn,{children:E.remarks})})}),!a&&n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 p-4",children:n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[{label:"Paid Amount",value:(E.paid_amount||0).toFixed(2)},{label:"Total Allocated",value:V.toFixed(2)},{label:"Unallocated",value:Math.max(0,(E.paid_amount||0)-V).toFixed(2)}].map(({label:H,value:K})=>n.jsxs("div",{className:"text-center",children:[n.jsx("p",{className:"text-[10px] font-semibold text-gray-500 uppercase mb-1",children:H}),n.jsx("span",{className:"font-semibold text-gray-900 dark:text-white",children:K})]},H))})}),!a&&p&&n.jsx(Yn,{doctype:"Payment Entry",docname:p.name||e||"",creationDate:p.creation,createdBy:p.owner,compact:!1,initialVisible:5,collapsible:!0,startCollapsed:!0})]})]})}const tr=({children:e})=>{const t=localStorage.getItem("user"),r=t?JSON.parse(t).email:"";return n.jsx(RH,{children:n.jsxs("div",{className:"flex h-screen overflow-hidden bg-gray-50 dark:bg-gray-900",children:[n.jsx(Lq,{userEmail:r}),n.jsxs("div",{className:"pm-app-main flex min-w-0 flex-1 flex-col overflow-hidden",children:[n.jsx(Bq,{userEmail:r}),n.jsx("div",{className:"flex-1 overflow-y-auto bg-gray-50 dark:bg-gray-900",children:e})]})]})})},rr=({children:e})=>{const[t,r]=y.useState("loading");return y.useEffect(()=>{let a=!1;return fe(null,null,function*(){if(localStorage.getItem("user")){a||r("authed");return}const s=yield KO();a||r(s.ok?"authed":"guest")}),()=>{a=!0}},[]),t==="loading"?n.jsx("div",{className:"flex h-screen items-center justify-center bg-gray-50 dark:bg-gray-900",children:n.jsxs("div",{className:"flex flex-col items-center gap-3 text-gray-600 dark:text-gray-400",children:[n.jsxs("svg",{className:"h-10 w-10 animate-spin text-indigo-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":!0,children:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),n.jsx("span",{className:"text-sm",children:"Loading…"})]})}):t==="guest"?n.jsx(Ff,{to:"/login",replace:!0}):n.jsx(n.Fragment,{children:e})},abe=()=>n.jsx(bH,{basename:"/project_management",children:n.jsxs(YU,{children:[n.jsx($t,{path:"/login",element:n.jsx(PH,{})}),n.jsx($t,{path:"/user-profile",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(DW,{})})})}),n.jsx($t,{path:"/projects",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(HW,{})})})}),n.jsx($t,{path:"/projects/reports",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Rde,{})})})}),n.jsx($t,{path:"/projects/project-updates",element:n.jsx(Ff,{to:"/projects",replace:!0})}),n.jsx($t,{path:"/projects/project-updates/:updateName",element:n.jsx(Ff,{to:"/projects",replace:!0})}),n.jsx($t,{path:"/projects/list",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Zye,{})})})}),n.jsx($t,{path:"/projects/list/:projectName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(nve,{})})})}),n.jsx($t,{path:"/projects/tasks",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(ove,{})})})}),n.jsx($t,{path:"/projects/tasks/:taskName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(pve,{})})})}),n.jsx($t,{path:"/projects/timesheets",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(gve,{})})})}),n.jsx($t,{path:"/projects/timesheets/:timesheetName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(yve,{})})})}),n.jsx($t,{path:"/projects/activity-types",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(vve,{})})})}),n.jsx($t,{path:"/projects/activity-types/:activityTypeName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(bve,{})})})}),n.jsx($t,{path:"/projects/templates",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(wve,{})})})}),n.jsx($t,{path:"/projects/templates/:templateName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(_ve,{})})})}),n.jsx($t,{path:"/customers",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Sve,{})})})}),n.jsx($t,{path:"/customers/:customerName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Tve,{})})})}),n.jsx($t,{path:"/employees",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Ave,{})})})}),n.jsx($t,{path:"/employees/:employeeName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Pve,{})})})}),n.jsx($t,{path:"/invoices",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Rve,{})})})}),n.jsx($t,{path:"/invoices/:invoiceName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Uve,{})})})}),n.jsx($t,{path:"/sales-orders",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Vve,{})})})}),n.jsx($t,{path:"/sales-orders/:soName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Qve,{})})})}),n.jsx($t,{path:"/purchase-orders",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(t1e,{})})})}),n.jsx($t,{path:"/purchase-orders/:poName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(o1e,{})})})}),n.jsx($t,{path:"/delivery-notes",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(d1e,{})})})}),n.jsx($t,{path:"/delivery-notes/:dnName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(y1e,{})})})}),n.jsx($t,{path:"/material-requests",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(j1e,{})})})}),n.jsx($t,{path:"/material-requests/:mrName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(z1e,{})})})}),n.jsx($t,{path:"/purchase-receipts",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(H1e,{})})})}),n.jsx($t,{path:"/purchase-receipts/:prName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Y1e,{})})})}),n.jsx($t,{path:"/payment-entries",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(Q1e,{})})})}),n.jsx($t,{path:"/payment-entries/:peName",element:n.jsx(rr,{children:n.jsx(tr,{children:n.jsx(rbe,{})})})}),n.jsx($t,{path:"/",element:n.jsx(Ff,{to:"/projects",replace:!0})}),n.jsx($t,{path:"*",element:n.jsx(Ff,{to:"/projects",replace:!0})})]})});Gz.createRoot(document.getElementById("root")).render(n.jsx(y.StrictMode,{children:n.jsx(DH,{children:n.jsx(Iq,{children:n.jsx(abe,{})})})}))});export default nbe();